open-index/open-npm huggingface dataset:
npm package: @sylo/money-ts
Description: TypeScript library for type-safe and lossless encoding and manipulation of world currencies and precious metals
Author: Giulio Canti
Latest version: 0.2.1-2

A porting of [safe-money](https://github.com/k0001/safe-money) (Haskell)

Blog post: https://ren.zone/articles/safe-money

# Features

## Newtypes

Via [newtype-ts](https://github.com/gcanti/newtype-ts)

- `BigInteger`
- `ExchangeRate`
- `Integer`
- `Natural`
- `NonZeroInteger`

## Type aliases

- `NonZeroRational`
- `PositiveRational`
- `Rational`

## Discrete

```ts
import { Integer } from 'money-ts/lib/Integer'
import { Discrete } from 'money-ts/lib/Discrete'

declare const ix: Integer // 2
declare const iy: Integer // 3

const x = new Discrete({ dimension: 'EUR', unit: 'cent' }, ix)
const y = new Discrete({ dimension: 'EUR', unit: 'cent' }, iy)
// z: Discrete<"EUR", "cent">
const z = x.add(y)
console.log(z)
// => EUR cent 5
```

## Dense

```ts
import * as dense from 'money-ts/lib/Dense'
import 'money-ts/lib/scale/EUR' // <= required in order to convert a discrete to a dense

const d = dense.fromDiscrete(z)
console.log(d)
// => EUR 5 / 100
```

## Runtime types for IO validation

Via [io-ts](https://github.com/gcanti/io-ts)

- `BigInteger`
- `Dense`
- `Discrete`
- `ExchangeRate`
- `Integer`
- `Natural`
- `NonZeroInteger`
- `NonZeroRational`
- `PositiveRational`
- `Rational`

# Documentation

- [API Reference](https://gcanti.github.io/money-ts)
npm package: @sylphlab/eslint-config-sylph-strict
Description: Strict ESLint Flat Configuration for SylphLab TypeScript Projects (Extends Standard)
Author: Kyle Tse
Latest version: 0.2.0

# @sylphlab/eslint-config-sylph-strict

This package provides the **Strict** ESLint Flat Configuration for SylphLab TypeScript projects.

**It extends the standard `@sylphlab/eslint-config-sylph` configuration** and adds stricter rules suitable for mature projects or pre-release validation.

## Philosophy

- **Extends Standard:** Builds upon the base `@sylphlab/eslint-config-sylph` configuration.
- **Maximum Strictness:** Re-enforces rules relaxed in the standard config (e.g., `no-explicit-any`, abbreviations) as errors.
- **Low Limits:** Enforces low limits for complexity, file/function length, nesting depth, and parameters as errors.

* **Functional Programming:** Re-introduces strict functional programming rules (immutability, no-throw) via `eslint-plugin-functional`.

Use this configuration when the highest level of code quality, consistency, and adherence to strict patterns is required. For general development, the standard `@sylphlab/eslint-config-sylph` configuration is recommended.

## Installation

1.  **Ensure Standard Config is Installed:** Follow the installation steps for `@sylphlab/eslint-config-sylph` first, including installing ESLint, TypeScript, and all its peer dependencies (using `install-peerdeps` is recommended).
2.  **Install This Package:**
    ```bash
    # Using pnpm (recommended)
    pnpm add -D @sylphlab/eslint-config-sylph-strict
    ```
3.  **Install Additional Peer Dependencies:** This package requires `eslint-plugin-functional`.
    ```bash
    pnpm add -D eslint-plugin-functional
    ```
    _(Note: Other peers like `eslint`, `typescript`, `typescript-eslint` should already be installed via the standard config setup)._

## Usage (`eslint.config.js` or `eslint.config.ts`)

Import the configuration array from this package instead of the standard one.

```javascript
// eslint.config.js
import { sylphStrict } from '@sylphlab/eslint-config-sylph-strict';

export default [
  ...sylphStrict,
  // Add any project-specific overrides here, if absolutely necessary
  {
    // Example: Further restrict a rule if needed
    // rules: { 'max-params': ['error', 3] }
  },
];
```

**Important:** Ensure you have a correctly configured `tsconfig.json` that includes all files intended for linting. This strict configuration relies heavily on type information.
npm package: @sylphlab/mcp-fetch-core
Description: Core logic for MCP fetch tool
Author: Sylph Lab
Latest version: 0.5.2

# @sylphlab/mcp-fetch-core

Core logic and schema for the MCP `fetch` tool.

## Tools Provided

-   **`fetchTool`**: Performs a single HTTP(S) fetch request.

## Usage

This package provides the core `McpTool` definition for fetching web resources. The `fetchTool` object, its Zod input schema, and TypeScript types are exported.

These can be imported and used directly or registered with an MCP server implementation, such as `@sylphlab/mcp-fetch`.
npm package: @sylphlab/prettier-config
Description: Shared Prettier configuration for SylphLab projects
Latest version: 0.3.3

# @sylphlab/prettier-config

[![npm version](https://img.shields.io/npm/v/@sylphlab/prettier-config?label=%40sylphlab%2Fprettier-config)](https://www.npmjs.com/package/@sylphlab/prettier-config)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Overview

Shared Prettier configuration for SylphLab projects. This package provides a consistent code formatting style across all SylphLab projects.

## Features

- **Consistent Code Formatting**: Enforces a uniform code style across projects
- **Modern Defaults**: Uses modern Prettier settings and conventions
- **Import Organization**: Includes plugins for organizing imports and package.json files
- **Ready-to-use**: Simple to install and integrate into any project

## Installation

```bash
npm install --save-dev prettier @sylphlab/prettier-config
# OR
yarn add --dev prettier @sylphlab/prettier-config
# OR
pnpm add --save-dev prettier @sylphlab/prettier-config
```

## Usage

### Option 1: Reference in package.json (Recommended)

Add the following to your `package.json`:

```json
{
  "prettier": "@sylphlab/prettier-config"
}
```

### Option 2: Prettier Configuration File

Create a `.prettierrc.js` file:

```js
import sylphPrettierConfig from '@sylphlab/prettier-config';

export default {
  ...sylphPrettierConfig,
  // Your project-specific overrides
};
```

### Option 3: Extending the Configuration (CommonJS)

If you need to use a CommonJS-compatible configuration:

```js
// .prettierrc.cjs
const sylphPrettierConfig = require('@sylphlab/prettier-config');

module.exports = {
  ...sylphPrettierConfig,
  // Your project-specific overrides
};
```

## Configuration Options

This configuration includes:

- 100 character print width
- 2 space indentation
- Single quotes
- Trailing commas
- LF line endings
- Organized imports
- Formatted package.json files

## License

MIT © [SylphLab](https://github.com/sylphlab)
npm package: @sylphlab/tools-memory
Description: Core logic for Knowledge Graph memory management
Author: Sylph Lab
Latest version: 0.3.0

# @sylphlab/tools-memory

Core logic and tool definitions for Knowledge Graph memory management based on a Property Graph model.

## Overview

This package provides the core functionalities for interacting with a knowledge graph used for AI agent memory, stored in a `memory.jsonl` file. It utilizes a Property Graph model where data is represented as Nodes (with IDs, labels, and key-value properties) and Edges (with type, from/to node IDs, and optional properties).

It defines individual tools (like `create_nodes`, `find_nodes`, `update_node_properties`, etc.) following the `@sylphlab/tools-core` structure. File I/O operations are handled internally by `graphUtils.ts`.

The actual MCP server implementation is handled by `@sylphlab/tools-memory-mcp`, which uses this package.

## Features

*   **Property Graph Model:** Represents knowledge using Nodes (entities) and Edges (relations), both supporting key-value properties.
*   **JSON Lines Storage:** Reads from and writes to a `memory.jsonl` file, making it version-control friendly.
*   **Comprehensive Toolset:** Exports standardized tool objects (`ToolDefinition` from `@sylphlab/tools-core`) for:
    *   **Node CRUD:** `create_nodes`, `get_node`, `update_node_properties`, `replace_node_properties`, `add_node_labels`, `remove_node_labels`, `delete_nodes`.
    *   **Edge CRUD:** `create_edges`, `update_edge_properties`, `replace_edge_properties`, `delete_edges`. (Note: Edge updates/deletes currently rely on generated IDs).
    *   **Querying & Discovery:** `find_nodes` (flexible search), `list_nodes` (by type or all, with pagination), `find_related_nodes` (graph traversal), `list_labels`, `list_relation_types`.
*   **UUID Identifiers:** Nodes and Edges use UUIDs for unique identification.

## Usage

This package is primarily intended to be used by MCP adaptor packages like `@sylphlab/tools-memory-mcp`. It's generally not used directly.

## Development

*   **Build:** `pnpm build`
*   **Watch:** `pnpm dev`
*   **Lint/Format:** `pnpm format`, `pnpm check`
*   **Test:** `pnpm test`

## License

MIT
npm package: @sylphlab/tools-memory-mcp
Description: MCP Memory Server (Knowledge Graph based, CWD storage)
Author: Sylph Lab
Latest version: 0.3.0

# @sylphlab/tools-memory-mcp

MCP Server adaptor for the Knowledge Graph memory tools.

## Overview

This package provides an MCP (Model Context Protocol) server that exposes the knowledge graph memory management tools defined in `@sylphlab/tools-memory`. It acts as an adaptor, making the core logic available to AI agents via the MCP protocol over stdio.

The server reads/writes the knowledge graph data (default: `memory.jsonl`) relative to the **current working directory (`process.cwd()`)** where the server is started.

## Features

*   **MCP Server:** Runs as a stdio-based MCP server.
*   **Adaptor:** Connects core `@sylphlab/tools-memory` tools to the MCP protocol using `@sylphlab/tools-adaptor-mcp`.
*   **CWD-based Storage:** Inherits the CWD-based storage behavior from `@sylphlab/tools-memory`.
*   **Exposed Tools:** Provides MCP access to `createEntities`, `createRelations`, `addObservations`, `deleteEntities`, `deleteObservations`, `deleteRelations`, `readGraph`, `searchNodes`, `openNodes`.

## Usage

1.  **Installation:**
    ```bash
    # Usually installed as part of the main project or globally
    pnpm add @sylphlab/tools-memory-mcp
    ```

2.  **Running the Server:**
    The package provides a binary that can be run directly:
    ```bash
    # Directly (ensure dependencies are built)
    node ./node_modules/.bin/mcp-memory

    # Or via pnpm from the workspace root (if linked correctly)
    # pnpm --filter @sylphlab/tools-memory-mcp start
    ```
    The server will start and listen on stdio. It will create/use `memory.jsonl` in the directory where you run the command.

3.  **Environment Variable (Optional):**
    You can specify a different file path or name relative to the CWD using the `MEMORY_FILE_PATH` environment variable (this is handled by the underlying `@sylphlab/tools-memory` package):
    ```bash
    MEMORY_FILE_PATH=./data/my_memory.jsonl node ./node_modules/.bin/mcp-memory
    ```

## Development

*   **Build:** `pnpm build` (Builds this package and its dependencies)
*   **Watch:** `pnpm dev`
*   **Lint/Format:** `pnpm format`, `pnpm check`

## License

MIT
npm package: @sylphx/biome-config
Description: Shared Biome configuration for SylphxAI projects
Author: SylphxAI
Latest version: 0.4.1

# @sylphx/biome-config

Shared Biome configuration for SylphxAI projects.

## Installation

```bash
bun add -D @sylphx/biome-config @biomejs/biome
```

## Usage

Create a `biome.json` in your project root:

```json
{
  "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
  "extends": ["@sylphx/biome-config"]
}
```

## Configuration

The shared config includes:

### Formatter
- Indent: tabs (width 2)
- Line width: 100 (120 for tests/examples)
- Single quotes
- Trailing commas (all)
- No semicolons

### Linter
- Recommended rules enabled
- No unused imports/variables (error)
- Use const (error)
- Use import type (error)
- No non-null assertion (warn)
- No explicit any (warn)

### Overrides (relaxed rules)
Tests, examples, and config files have relaxed linting:
- `noExplicitAny`: off
- `noNonNullAssertion`: off
- `noExcessiveCognitiveComplexity`: off

### Files
- Ignores: `dist`, `node_modules`

## Overriding

You can override any setting in your project's `biome.json`:

```json
{
  "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
  "extends": ["@sylphx/biome-config"],
  "formatter": {
    "lineWidth": 120
  },
  "linter": {
    "rules": {
      "suspicious": {
        "noExplicitAny": "off"
      }
    }
  }
}
```

## License

MIT
npm package: @sylphx/flow
Description: One CLI to rule them all. Unified orchestration layer for AI coding assistants. Auto-detection, auto-installation, auto-upgrade.
Author: sylphxltd
Latest version: 3.28.0

# @sylphx/flow

**One CLI to rule them all.**

Unified orchestration layer for Claude Code, OpenCode, Cursor and all AI development tools. Auto-detection, auto-installation, auto-upgrade.

## Installation

```bash
npm install -g @sylphx/flow
```

## Usage

```bash
# Run with a prompt
sylphx-flow "your prompt here"

# Configure settings
sylphx-flow settings

# Check status
sylphx-flow status
```

## Features

- **Auto-detect** - Automatically detects installed AI CLIs
- **Auto-install** - Installs missing dependencies on demand
- **Auto-upgrade** - Upgrades before each session
- **Unified settings** - One configuration for all tools
- **MEP system** - Minimal Effective Prompts for optimal context

## Documentation

See the [main repository](https://github.com/sylphxltd/flow) for full documentation.

## License

MIT License - see [LICENSE](../../LICENSE) file for details.

---

Powered by [@sylphx](https://github.com/SylphxAI)
npm package: @sylphx/gust-core
Description: WASM HTTP parser and Radix Trie router - works in browser and server
Latest version: 0.1.9

# @sylphx/gust-core

> WASM HTTP parser and Radix Trie router - core runtime for @sylphx/gust

## Installation

```bash
bun add @sylphx/gust-core
```

## Usage

```typescript
import { initWasm, getWasm, json, notFound, compose } from '@sylphx/gust-core'

// Initialize WASM (auto-initialized on first use)
await initWasm()

// Use WASM router
const wasm = getWasm()
const router = new wasm.WasmRouter()
router.insert('GET', '/users/:id', 0)

const match = router.find('GET', '/users/42')
console.log(match.found)  // true
console.log(match.params) // ['id', '42']
```

## API

### Response Helpers

```typescript
import { response, json, text, html, redirect, notFound, badRequest, unauthorized, forbidden, serverError } from '@sylphx/gust-core'

// Basic response
response('Hello', { status: 200, headers: { 'content-type': 'text/plain' } })

// JSON response
json({ data: 'value' })

// Text/HTML
text('Hello World')
html('<h1>Hello</h1>')

// Redirects
redirect('/new-path')
redirect('/external', 301)

// Error responses
notFound()
badRequest()
unauthorized()
forbidden()
serverError()
```

### Composition

```typescript
import { compose, pipe } from '@sylphx/gust-core'

// compose: outer to inner (right-to-left)
const app = compose(middleware1, middleware2, handler)

// pipe: first to last (left-to-right)
const app = pipe(handler, middleware2, middleware1)
```

### Types

```typescript
// Server response
type ServerResponse = {
  status: number
  headers: Record<string, string>
  body: string | Uint8Array | null
}

// Handler function
type Handler<T = unknown> = (ctx: T) => ServerResponse | Promise<ServerResponse>

// Middleware wrapper
type Wrapper<T = unknown> = (handler: Handler<T>) => Handler<T>
```

### WASM Functions

```typescript
import { initWasm, isWasmReady, getWasm } from '@sylphx/gust-core'

// Initialize WASM module
await initWasm()

// Check if ready
if (isWasmReady()) {
  const wasm = getWasm()
  // Use wasm.WasmRouter, wasm.WasmHttpParser, etc.
}
```

## License

MIT

---

✨ Powered by [Sylphx](https://github.com/SylphxAI)
npm package: @sylphx/lens
Description: Type-safe, real-time API framework - GraphQL concepts in TypeScript with zero codegen
Author: SylphxAI
Latest version: 3.1.7

# @sylphx/lens

Umbrella package that re-exports all Lens core functionality.

## Installation

```bash
bun add @sylphx/lens
```

## Usage

```typescript
import { t, entity, query, mutation, router } from "@sylphx/lens";

// All core exports available from single package
```

## Packages

- `@sylphx/lens-core` - Core schema types and utilities
- `@sylphx/lens-client` - Type-safe client with real-time subscriptions
- `@sylphx/lens-server` - Server runtime with WebSocket support

## License

MIT

---

Built with [@sylphx/lens-core](https://github.com/SylphxAI/Lens).

✨ Powered by Sylphx
npm package: @sylphx/lens-client
Description: Transport client for Lens API framework
Author: SylphxAI
Latest version: 3.1.7

# @sylphx/lens-client

Type-safe client for the Lens API framework with real-time subscriptions.

## Installation

```bash
bun add @sylphx/lens-client
```

## Usage

```typescript
import { createClient, WebSocketTransport } from "@sylphx/lens-client";
import type { AppRouter } from "./server";

const client = createClient<AppRouter>({
  transport: new WebSocketTransport("ws://localhost:3000"),
});

// Query
const user = await client.user.get({ id: "1" });

// Mutation
const result = await client.user.create({ name: "John", email: "john@example.com" });

// Subscription
client.user.get({ id: "1" }).subscribe((user) => {
  console.log("User updated:", user);
});
```

## License

MIT

---

Built with [@sylphx/lens-core](https://github.com/SylphxAI/Lens), [@sylphx/lens-server](https://github.com/SylphxAI/Lens), and [@sylphx/reify](https://github.com/SylphxAI/reify).

✨ Powered by Sylphx
npm package: @sylphx/lens-nuxt
Description: Nuxt 3 integration for Lens API framework
Author: SylphxAI
Latest version: 2.3.7

# @sylphx/lens-nuxt

Nuxt integration for the Lens API framework with SSR support.

## Installation

```bash
bun add @sylphx/lens-nuxt
```

## Usage

```vue
<script setup>
import { useQuery, useMutation } from "@sylphx/lens-nuxt";
import { client } from "./client";

const { data, loading, error } = useQuery(() => client.user.get({ id: "1" }));
</script>

<template>
  <div v-if="loading">Loading...</div>
  <div v-else-if="error">Error: {{ error.message }}</div>
  <div v-else>{{ data.name }}</div>
</template>
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens), [@sylphx/lens-vue](https://github.com/SylphxAI/Lens), and [@sylphx/lens-server](https://github.com/SylphxAI/Lens).

✨ Powered by Sylphx
npm package: @sylphx/lens-preact
Description: Preact bindings for Lens API framework
Author: SylphxAI
Latest version: 2.2.7

# @sylphx/lens-preact

Preact hooks and signals for the Lens API framework.

## Installation

```bash
bun add @sylphx/lens-preact
```

## Usage

```typescript
import { useQuery, useMutation } from "@sylphx/lens-preact";
import { client } from "./client";

function UserProfile() {
  const { data, loading, error } = useQuery(client.user.get({ id: "1" }));
  const [createUser, { loading: creating }] = useMutation(client.user.create);

  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return <div>{data.name}</div>;
}
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens).

✨ Powered by Sylphx
npm package: @sylphx/lens-solid
Description: SolidJS bindings for Lens API framework
Author: SylphxAI
Latest version: 2.4.7

# @sylphx/lens-solid

SolidJS primitives for the Lens API framework.

## Installation

```bash
bun add @sylphx/lens-solid @sylphx/lens-client
```

## Usage

### Setup Client

```typescript
// lib/client.ts
import { createClient } from "@sylphx/lens-solid";
import { http } from "@sylphx/lens-client";
import type { AppRouter } from "@/server/router";

export const client = createClient<AppRouter>({
  transport: http({ url: "/api/lens" }),
});
```

### Query (in component)

```tsx
import { client } from "@/lib/client";
import { Show } from "solid-js";

function UserProfile(props: { id: string }) {
  const { data, loading, error, refetch } = client.user.get({
    input: { id: props.id },
    select: { name: true, email: true },
  });

  return (
    <Show when={!loading()} fallback={<div>Loading...</div>}>
      <Show when={!error()} fallback={<div>Error: {error()?.message}</div>}>
        <div>{data()?.name}</div>
      </Show>
    </Show>
  );
}
```

### Mutation (in component)

```tsx
import { client } from "@/lib/client";

function CreateUser() {
  const { mutate, loading, error, data, reset } = client.user.create({
    onSuccess: (data) => console.log("Created:", data),
    onError: (error) => console.error("Failed:", error),
  });

  const handleSubmit = async () => {
    await mutate({ input: { name: "New User" } });
  };

  return (
    <button onClick={handleSubmit} disabled={loading()}>
      {loading() ? "Creating..." : "Create User"}
    </button>
  );
}
```

### SSR / Server-side

```typescript
// Use .fetch() for promise-based calls
const user = await client.user.get.fetch({ input: { id } });
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens).

Powered by Sylphx
npm package: @sylphx/lens-solidstart
Description: SolidStart integration for Lens API framework
Author: SylphxAI
Latest version: 2.2.7

# @sylphx/lens-solidstart

SolidStart integration for the Lens API framework with SSR support.

## Installation

```bash
bun add @sylphx/lens-solidstart
```

## Usage

```typescript
import { createQuery, createMutation } from "@sylphx/lens-solidstart";
import { client } from "./client";

export default function Page() {
  const user = createQuery(() => client.user.get({ id: "1" }));

  return (
    <Show when={!user.loading} fallback={<div>Loading...</div>}>
      <div>{user.data?.name}</div>
    </Show>
  );
}
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens), [@sylphx/lens-solid](https://github.com/SylphxAI/Lens), and [@sylphx/lens-server](https://github.com/SylphxAI/Lens).

✨ Powered by Sylphx
npm package: @sylphx/lens-svelte
Description: Svelte bindings for Lens API framework
Author: SylphxAI
Latest version: 2.5.8

# @sylphx/lens-svelte

Svelte stores for the Lens API framework.

## Installation

```bash
bun add @sylphx/lens-svelte @sylphx/lens-client
```

## Usage

### Setup Client

```typescript
// lib/client.ts
import { createClient } from "@sylphx/lens-svelte";
import { http } from "@sylphx/lens-client";
import type { AppRouter } from "@/server/router";

export const client = createClient<AppRouter>({
  transport: http({ url: "/api/lens" }),
});
```

### Query (in component)

```svelte
<script lang="ts">
  import { client } from "$lib/client";

  export let id: string;

  $: userStore = client.user.get({
    input: { id },
    select: { name: true, email: true },
  });
</script>

{#if $userStore.loading}
  <div>Loading...</div>
{:else if $userStore.error}
  <div>Error: {$userStore.error.message}</div>
{:else}
  <div>{$userStore.data?.name}</div>
{/if}
```

### Mutation (in component)

```svelte
<script lang="ts">
  import { client } from "$lib/client";

  const createUser = client.user.create({
    onSuccess: (data) => console.log("Created:", data),
    onError: (error) => console.error("Failed:", error),
  });

  async function handleSubmit() {
    await createUser.mutate({ input: { name: "New User" } });
  }
</script>

<button on:click={handleSubmit} disabled={$createUser.loading}>
  {$createUser.loading ? "Creating..." : "Create User"}
</button>
```

### SSR / Server-side

```typescript
// Use .fetch() for promise-based calls (e.g., in +page.server.ts)
const user = await client.user.get.fetch({ input: { id } });
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens).

Powered by Sylphx
npm package: @sylphx/lens-vue
Description: Vue composables for Lens API framework
Author: SylphxAI
Latest version: 2.5.7

# @sylphx/lens-vue

Vue composables for the Lens API framework.

## Installation

```bash
bun add @sylphx/lens-vue @sylphx/lens-client
```

## Usage

### Setup Client

```typescript
// lib/client.ts
import { createClient } from "@sylphx/lens-vue";
import { http } from "@sylphx/lens-client";
import type { AppRouter } from "@/server/router";

export const client = createClient<AppRouter>({
  transport: http({ url: "/api/lens" }),
});
```

### Query (in component)

```vue
<script setup lang="ts">
import { client } from "@/lib/client";

const props = defineProps<{ id: string }>();

const { data, loading, error, refetch } = client.user.get({
  input: { id: props.id },
  select: { name: true, email: true },
});
</script>

<template>
  <div v-if="loading">Loading...</div>
  <div v-else-if="error">Error: {{ error.message }}</div>
  <div v-else>{{ data?.name }}</div>
</template>
```

### Mutation (in component)

```vue
<script setup lang="ts">
import { client } from "@/lib/client";

const { mutate, loading, error, data, reset } = client.user.create({
  onSuccess: (data) => console.log("Created:", data),
  onError: (error) => console.error("Failed:", error),
});

const handleSubmit = async () => {
  await mutate({ input: { name: "New User" } });
};
</script>

<template>
  <button @click="handleSubmit" :disabled="loading">
    {{ loading ? "Creating..." : "Create User" }}
  </button>
</template>
```

### SSR / Server-side

```typescript
// Use .fetch() for promise-based calls
const user = await client.user.get.fetch({ input: { id } });
```

## License

MIT

---

Built with [@sylphx/lens-client](https://github.com/SylphxAI/Lens).

Powered by Sylphx
npm package: @sylphx/silk-nuxt
Description: Nuxt 3 module for Silk - Zero-codegen CSS-in-TypeScript
Author: SylphX Ltd
Latest version: 1.0.2

# @sylphx/silk-nuxt

Nuxt 3 module for [Silk](https://github.com/sylphxltd/silk) - Zero-codegen, zero-runtime CSS-in-TypeScript.

## Features

- ✅ **Zero-codegen**: No manual `generate` commands
- ✅ **Zero-runtime**: CSS generated at build time
- ✅ **Auto-import**: Automatic CSS injection
- ✅ **HMR**: Hot Module Replacement support
- ✅ **Type-safe**: Full TypeScript support
- ✅ **Framework integration**: Works with Nuxt's Vite pipeline

## Installation

```bash
npm install @sylphx/silk @sylphx/silk-nuxt
```

## Usage

### 1. Add module to `nuxt.config.ts`

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@sylphx/silk-nuxt']
})
```

### 2. Use in your components

```vue
<!-- pages/index.vue -->
<script setup lang="ts">
import { createStyleSystem } from '@sylphx/silk'

const { css } = createStyleSystem({})

const styles = {
  container: css({
    display: 'flex',
    flexDirection: 'column',
    alignItems: 'center',
    padding: '2rem',
    backgroundColor: '#f5f5f5'
  } as any),
  title: css({
    fontSize: '2.5rem',
    fontWeight: 'bold',
    color: '#00DC82'
  } as any)
}
</script>

<template>
  <div :class="styles.container.className">
    <h1 :class="styles.title.className">
      Nuxt + Silk ✅
    </h1>
  </div>
</template>
```

That's it! No need to manually import `silk.css` - the module handles it automatically.

## Configuration

```typescript
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@sylphx/silk-nuxt'],

  silk: {
    // Source directory to scan for css() calls
    // Default: Nuxt's srcDir
    srcDir: './app',

    // Virtual module ID
    // Default: 'silk.css'
    virtualModuleId: 'silk.css',

    // Enable debug logging
    // Default: false
    debug: true,

    // Enable CSS minification
    // Default: true in production, false in dev
    minify: true,

    // Auto-import silk.css globally
    // Default: true
    autoImport: true
  }
})
```

## Manual Import (if autoImport: false)

```vue
<!-- app.vue -->
<script setup>
import 'silk.css'
</script>

<template>
  <NuxtPage />
</template>
```

## How it works

1. The module wraps `@sylphx/silk-vite-plugin`
2. Scans your source files for `css()` calls at build time
3. Generates optimized CSS with lightningcss-wasm
4. Creates a virtual module that Nuxt's Vite pipeline processes
5. Auto-imports the CSS (if `autoImport: true`)
6. CSS flows through Nuxt's PostCSS, minification, and bundling

## Benefits over manual Vite plugin

**With `@sylphx/silk-nuxt`:**
```typescript
export default defineNuxtConfig({
  modules: ['@sylphx/silk-nuxt']
})
```

**Without (manual Vite plugin):**
```typescript
import silk from '@sylphx/silk-vite-plugin'

export default defineNuxtConfig({
  vite: {
    plugins: [silk()]
  }
})
```

The Nuxt module provides:
- ✅ Simpler configuration
- ✅ Auto-import support
- ✅ Nuxt-specific optimizations
- ✅ Better integration with Nuxt's build system

## License

MIT © SylphX Ltd
npm package: @sylphx/synth-md-gfm
Description: GitHub Flavored Markdown (GFM) extensions for Synth
Latest version: 0.2.3

# @sylphx/synth-md-gfm

GitHub Flavored Markdown (GFM) extensions for Synth.

## Installation

```bash
npm install @sylphx/synth @sylphx/synth-md @sylphx/synth-md-gfm
```

## Features

- **Tables** with column alignment
- **Strikethrough** text (~~deleted~~)
- **Autolinks** for URLs and emails
- **Task lists** with checkboxes

## Usage

```typescript
import { parse } from '@sylphx/synth-md'
import { gfmPlugin } from '@sylphx/synth-md-gfm'

const markdown = `
# GFM Examples

## Tables

| Feature | Supported |
|---------|:---------:|
| Tables  | ✓         |
| Align   | ✓         |

## Strikethrough

This is ~~deleted~~ text.

## Autolinks

Visit https://github.com

## Task Lists

- [x] Completed task
- [ ] Pending task
`

const tree = parse(markdown, { plugins: [gfmPlugin()] })
```

## Options

```typescript
interface GFMPluginOptions {
  tables?: boolean        // Enable tables (default: true)
  strikethrough?: boolean // Enable ~~text~~ (default: true)
  autolinks?: boolean     // Enable URL autolinks (default: true)
  taskLists?: boolean     // Enable task lists (default: true)
}
```

## GFM Specification

This plugin implements the [GitHub Flavored Markdown Spec](https://github.github.com/gfm/):

### Tables

```markdown
| Left | Center | Right |
|:-----|:------:|------:|
| A    | B      | C     |
```

- Column alignment with `:---`, `:---:`, `---:`
- Header row required
- Separator row required

### Strikethrough

```markdown
~~This text is deleted~~
```

### Autolinks

```markdown
https://example.com
user@example.com
```

Automatically converts URLs and emails to links.

### Task Lists

```markdown
- [x] Completed
- [ ] Todo
```

Checkbox syntax for task items.

---

<div align="center">
  <sub>Powered by Sylphx</sub>
</div>
npm package: @sylphx/synth-md-katex
Description: KaTeX math rendering support for Synth Markdown parser
Latest version: 0.2.3

# @sylphx/synth-md-katex

KaTeX math rendering support for Synth Markdown parser.

## Installation

```bash
npm install @sylphx/synth @sylphx/synth-md @sylphx/synth-md-katex
```

## Usage

```typescript
import { parse } from '@sylphx/synth-md'
import { katexPlugin } from '@sylphx/synth-md-katex'

const markdown = `
# Math Examples

Inline math: The equation $E = mc^2$ is famous.

Block math:

$$
\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}
$$
`

const tree = parse(markdown, { plugins: [katexPlugin()] })
```

## Options

```typescript
interface KatexPluginOptions {
  inlineMath?: boolean   // Enable inline $...$ (default: true)
  blockMath?: boolean    // Enable block $$...$$ (default: true)
  throwOnError?: boolean // Throw on invalid LaTeX (default: false)
  prerender?: boolean    // Render to HTML (default: false)
}
```

## Features

- Inline math with `$...$` delimiters
- Block math with `$$...$$` delimiters
- LaTeX expression detection and extraction
- Optional pre-rendering to HTML
- Error handling options

## Examples

### Inline Math

```markdown
The Pythagorean theorem is $a^2 + b^2 = c^2$.
```

### Block Math

```markdown
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
```

### Mixed

```markdown
Given $f(x) = x^2$, we can compute:

$$
\int_0^1 f(x) dx = \frac{1}{3}
$$
```

---

<div align="center">
  <sub>Powered by Sylphx</sub>
</div>
npm package: @sylphx/synth-wasm-js
Description: High-performance JavaScript/TypeScript parser compiled to WebAssembly (ES2024)
Latest version: 0.1.2

# @sylphx/synth-wasm-js

High-performance JavaScript/TypeScript parser compiled to WebAssembly.

## Features

- **ES2024 syntax** - Full support for modern JavaScript
- **Fast** - 175 MB/s throughput, ~7μs per KB
- **Compact** - 48KB WASM binary
- **Zero dependencies** - Just the WASM module

## Installation

```bash
bun add @sylphx/synth-wasm-js
```

## Usage

```typescript
import { parse, parseCount, parseBinary, NodeKind } from '@sylphx/synth-wasm-js'

// Parse to structured AST
const result = await parse('const x = 1;')
console.log(result.nodes) // Array of ASTNode

// Quick node count (for validation)
const count = await parseCount('function foo() {}')
console.log(count) // 5

// Maximum performance (raw binary)
const binary = await parseBinary('class Foo {}')
```

## API

### `parse(source: string): Promise<ParseResult>`

Parse JavaScript and return a structured AST.

```typescript
const result = await parse('const x = 1 + 2;')

// result.nodes is an array of ASTNode:
// - kind: NodeKind (Program, VariableDeclaration, etc.)
// - flags: node flags (const, let, async, etc.)
// - start: source start offset
// - end: source end offset
// - extra: additional data (e.g., child count)
```

### `parseBinary(source: string): Promise<Uint8Array>`

Parse to compact binary format for maximum performance.

Binary format:
- Header: `[node_count: u32]`
- Nodes: 16 bytes each `(kind: u8, flags: u8, pad: u16, start: u32, end: u32, extra: u32)`

### `parseCount(source: string): Promise<number>`

Returns only the node count. Useful for benchmarking.

### `tokenize(source: string): Promise<number>`

Returns token count. Useful for benchmarking the lexer.

## Supported Syntax

- **Declarations**: `const`, `let`, `var`, `function`, `class`, `import`, `export`
- **Statements**: `if`, `for`, `for-in`, `for-of`, `while`, `do-while`, `switch`, `try/catch/finally`, `return`, `throw`, `break`, `continue`
- **Expressions**: Binary, unary, call, member, new, arrow functions, async/await, yield, template literals, object/array literals, spread, optional chaining, nullish coalescing
- **Patterns**: Array destructuring, object destructuring, rest elements

## Performance

| Metric | Value |
|--------|-------|
| Throughput | 175 MB/s |
| Per 1KB parse | ~7μs |
| WASM size | 48KB |

## Credits

Built with Rust and `wasm-bindgen`.

## License

MIT

---

<div align="center">
  <sub>Powered by Sylphx</sub>
</div>
npm package: @sylphx/synth-wasm-md
Description: High-performance Markdown parser compiled to WebAssembly (10-18x faster)
Latest version: 0.1.1

# @sylphx/synth-wasm-md

High-performance Markdown parser compiled to WebAssembly.

## Installation

```bash
bun add @sylphx/synth-wasm-md
```

## Usage

```typescript
import { parse, initWasm } from '@sylphx/synth-wasm-md'

// Optional: eager initialization
await initWasm()

// Parse markdown
const tree = await parse('# Hello World')
console.log(tree)
```

## Performance

WASM parser provides ~2-5x speedup over pure JavaScript implementation for large documents.

| Document Size | JS Parser | WASM Parser | Speedup |
|---------------|-----------|-------------|---------|
| 1KB           | 0.5ms     | 0.3ms       | 1.7x    |
| 10KB          | 2ms       | 0.8ms       | 2.5x    |
| 100KB         | 15ms      | 4ms         | 3.8x    |

## API

### `parse(markdown: string): Promise<WasmTree>`

Parse Markdown text into an AST.

### `parseSync(markdown: string): WasmTree`

Synchronous parse (requires WASM to be pre-initialized with `initWasm()`).

### `initWasm(): Promise<void>`

Initialize the WASM module. Called automatically on first `parse()`, but can be called manually for eager initialization.

### `version(): Promise<string>`

Get the version of the WASM parser.

## Credits

Built with [@sylphx/synth-md](https://github.com/SylphxAI/synth) - the pure JavaScript reference implementation.

## License

MIT

---

<div align="center">
  <sub>Powered by Sylphx</sub>
</div>
npm package: @sylphx/tsconfig
Description: Shared TypeScript configuration for SylphxAI projects
Author: SylphxAI
Latest version: 0.3.1

# @sylphx/tsconfig

Shared TypeScript configuration for SylphxAI projects.

## Installation

```bash
bun add -D @sylphx/tsconfig
```

## Usage

### Base (Bun projects)

```json
{
  "extends": "@sylphx/tsconfig/bun",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}
```

### Node.js projects

```json
{
  "extends": "@sylphx/tsconfig/node"
}
```

### React projects

```json
{
  "extends": "@sylphx/tsconfig/react"
}
```

## Configurations

| Config | Use Case |
|--------|----------|
| `@sylphx/tsconfig` | Base config |
| `@sylphx/tsconfig/bun` | Bun projects |
| `@sylphx/tsconfig/node` | Node.js projects |
| `@sylphx/tsconfig/react` | React projects |

## License

MIT
npm package: @sylphx/zen-patterns
Description: Useful patterns and helpers for Zen state management
Author: Sylphx
Latest version: 12.0.35

# @sylphx/zen-patterns

Useful patterns and helpers built on top of `@sylphx/zen` core.

All patterns use only public zen APIs (`zen`, `computed`, `effect`, `subscribe`), making them simple, transparent, and easy to customize.

## Installation

```bash
npm install @sylphx/zen @sylphx/zen-patterns
```

## Patterns

### 📦 Store Pattern

Zustand-style factory function wrapper for creating stores with encapsulated state.

```typescript
import { zen } from '@sylphx/zen';
import { store } from '@sylphx/zen-patterns';

const counter = store(() => {
  const count = zen(0);
  return {
    count,
    increase: () => count.value++,
    decrease: () => count.value--
  };
});

counter.increase();
console.log(counter.count.value); // 1
```

### ⚡ Async Pattern

Async state management with automatic loading/error/data handling.

```typescript
import { computedAsync } from '@sylphx/zen-patterns';

const user = computedAsync(async () => {
  const res = await fetch('/api/user');
  return res.json();
});

// Access state
console.log(user.state.value.loading);
console.log(user.state.value.data);
console.log(user.state.value.error);

// Refetch
user.refetch();
```

### 🗺️ Map Pattern

Key-level reactivity for objects. Only components listening to changed keys will re-render.

```typescript
import { map, listenKeys } from '@sylphx/zen-patterns';

const form = map({
  name: '',
  email: '',
  age: 0
});

// Listen to specific keys only
listenKeys(form, ['name'], (value, key) => {
  console.log('Name changed:', value);
});

// Only name listeners will trigger
form.setKey('name', 'John');

// Email change won't trigger name listeners
form.setKey('email', 'john@example.com');
```

### 🌳 DeepMap Pattern

Path-level reactivity for nested objects. Selective notifications at any nesting level.

```typescript
import { deepMap, listenPaths } from '@sylphx/zen-patterns';

const config = deepMap({
  ui: {
    theme: 'dark',
    layout: {
      sidebar: 'left',
      width: 200
    }
  }
});

// Listen to nested path
listenPaths(config, ['ui.theme'], (value) => {
  console.log('Theme changed:', value);
});

// Only theme listeners will trigger
config.setPath('ui.theme', 'light');

// Layout changes won't trigger theme listeners
config.setPath('ui.layout.width', 300);
```

## Why Patterns?

These patterns are **not magic** - they're built entirely on public zen APIs:

- `store()` is just a factory function wrapper
- `computedAsync()` uses `zen()` + `effect()`
- `map()` uses `computed()` for key-level tracking
- `deepMap()` uses `computed()` for path-level tracking

You can:
- Read the source code (it's simple!)
- Customize them for your needs
- Copy-paste them into your project
- Learn how zen works by studying them

## Bundle Size

- **936 B gzipped** for all patterns
- Tree-shakeable - only import what you need
- Zero dependencies except `@sylphx/zen`

## Documentation

Full documentation at [https://zen.sylphx.com](https://zen.sylphx.com)

## License

MIT © Sylphx
npm package: @sylphx/zen-persistent
Description: Persistent store for Zen state manager (localStorage/sessionStorage sync)
Author: Sylphx
Latest version: 15.0.35

# @sylphx/zen-persistent

Persistent storage integration for Zen state manager. Automatically syncs state with localStorage or sessionStorage, with cross-tab synchronization support.

## Installation

```bash
npm install @sylphx/zen-persistent
# or
bun add @sylphx/zen-persistent
```

## Usage

### Basic Example

```typescript
import { persistentZen } from '@sylphx/zen-persistent';

// Create a persistent zen that syncs with localStorage
const theme = persistentZen('theme', 'light');

// Changes are automatically saved to localStorage
set(theme, 'dark');

// Value persists across page reloads and browser tabs
```

### Persistent Map

```typescript
import { persistentMap } from '@sylphx/zen-persistent';

const userPreferences = persistentMap('prefs', {
  fontSize: 14,
  language: 'en',
  notifications: true,
});

// Changes sync automatically
setKey(userPreferences, 'fontSize', 16);
```

### Custom Storage

```typescript
import { persistentZen } from '@sylphx/zen-persistent';

// Use sessionStorage instead of localStorage
const sessionData = persistentZen('session', { userId: null }, {
  storage: sessionStorage,
  listen: false, // Disable cross-tab sync
});
```

### Custom Serialization

```typescript
import { persistentZen } from '@sylphx/zen-persistent';

const dateStore = persistentZen('lastVisit', new Date(), {
  serializer: {
    encode: (date) => date.toISOString(),
    decode: (str) => new Date(str),
  },
});
```

## API

### `persistentZen<Value>(key, initialValue, options?)`

Creates a persistent zen that syncs with storage.

**Parameters:**
- `key`: Unique storage key
- `initialValue`: Default value if nothing in storage
- `options`:
  - `storage`: Storage engine (default: `localStorage`)
  - `serializer`: Custom serializer (default: `JSON`)
  - `listen`: Enable cross-tab sync (default: `true`)

### `persistentMap<Value>(key, initialValue, options?)`

Creates a persistent map that syncs with storage.

Same parameters as `persistentZen`.

## Features

- ✅ Automatic persistence to localStorage/sessionStorage
- ✅ Cross-tab synchronization
- ✅ Custom serialization support
- ✅ SSR-safe (gracefully handles non-browser environments)
- ✅ TypeScript support

## License

MIT
npm package: @sylphx/zen-preact
Description: Preact integration for Zen state manager
Author: Sylphx
Latest version: 5.0.35

# @sylphx/zen-preact

Preact integration for Zen state manager. Use Zen stores in Preact components with automatic reactivity.

## Installation

```bash
npm install @sylphx/zen-preact
# or
bun add @sylphx/zen-preact
```

## Usage

### Basic Example

```tsx
import { zen, set } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-preact';

// Create a zen store
const count = zen(0);

function Counter() {
  // Use it in a Preact component - automatically subscribes
  const value = useStore(count);

  return (
    <div>
      <p>Count: {value}</p>
      <button onClick={() => set(count, value + 1)}>
        Increment
      </button>
    </div>
  );
}
```

### With Computed Values

```tsx
import { zen, computed } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-preact';

const count = zen(0);
const doubled = computed(count, (n) => n * 2);

function App() {
  const countValue = useStore(count);
  const doubledValue = useStore(doubled);

  return (
    <div>
      <p>Count: {countValue}</p>
      <p>Doubled: {doubledValue}</p>
    </div>
  );
}
```

### Shared State Across Components

```typescript
// stores/counter.ts
import { zen } from '@sylphx/zen';

export const counter = zen(0);
```

```tsx
// ComponentA.tsx
import { useStore } from '@sylphx/zen-preact';
import { counter } from './stores/counter';

export function ComponentA() {
  const count = useStore(counter);
  return <p>Count: {count}</p>;
}
```

```tsx
// ComponentB.tsx
import { set } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-preact';
import { counter } from './stores/counter';

export function ComponentB() {
  const count = useStore(counter);

  return (
    <button onClick={() => set(counter, count + 1)}>
      Increment
    </button>
  );
}
```

## API

### `useStore<Value>(store: Zen<Value>): Value`

Subscribes to a Zen store and returns its current value.

**Parameters:**
- `store`: Any Zen store (zen, computed, map, deepMap, task, etc.)

**Returns:**
- The current value of the store

**Features:**
- ✅ Automatically subscribes on component mount
- ✅ Automatically unsubscribes on component unmount
- ✅ SSR-safe
- ✅ TypeScript support

## Why Use Zen with Preact?

- 🎯 **Simple**: Just one hook to learn
- 🪶 **Tiny**: Minimal bundle size (~300 bytes)
- ⚡ **Fast**: Optimized for performance
- 🔒 **Type-safe**: Full TypeScript support
- 🌐 **Framework-agnostic stores**: Share state logic across different frameworks
- 📦 **No boilerplate**: No providers, no context, just import and use

## License

MIT
npm package: @sylphx/zen-react
Description: React integration for Zen state manager
Author: Sylphx
Latest version: 5.0.35

# @sylphx/zen-react

React integration for Zen state manager. Use Zen stores in React components with automatic reactivity.

## Installation

```bash
npm install @sylphx/zen-react
# or
bun add @sylphx/zen-react
```

## Usage

### Basic Example

```tsx
import { zen, set } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-react';

// Create a zen store
const count = zen(0);

function Counter() {
  // Use it in a React component - automatically subscribes
  const value = useStore(count);

  return (
    <div>
      <p>Count: {value}</p>
      <button onClick={() => set(count, value + 1)}>
        Increment
      </button>
    </div>
  );
}
```

### With Computed Values

```tsx
import { zen, computed } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-react';

const count = zen(0);
const doubled = computed(count, (n) => n * 2);

function App() {
  const countValue = useStore(count);
  const doubledValue = useStore(doubled);

  return (
    <div>
      <p>Count: {countValue}</p>
      <p>Doubled: {doubledValue}</p>
    </div>
  );
}
```

### Shared State Across Components

```typescript
// stores/counter.ts
import { zen } from '@sylphx/zen';

export const counter = zen(0);
```

```tsx
// ComponentA.tsx
import { useStore } from '@sylphx/zen-react';
import { counter } from './stores/counter';

export function ComponentA() {
  const count = useStore(counter);
  return <p>Count: {count}</p>;
}
```

```tsx
// ComponentB.tsx
import { set } from '@sylphx/zen';
import { useStore } from '@sylphx/zen-react';
import { counter } from './stores/counter';

export function ComponentB() {
  const count = useStore(counter);

  return (
    <button onClick={() => set(counter, count + 1)}>
      Increment
    </button>
  );
}
```

## API

### `useStore<Value>(store: Zen<Value>): Value`

Subscribes to a Zen store and returns its current value.

**Parameters:**
- `store`: Any Zen store (zen, computed, map, deepMap, task, etc.)

**Returns:**
- The current value of the store

**Features:**
- ✅ Automatically subscribes on component mount
- ✅ Automatically unsubscribes on component unmount
- ✅ Uses `useSyncExternalStore` in React 18+ for concurrent mode support
- ✅ Falls back to `useState` + `useEffect` for React 16/17
- ✅ SSR-safe
- ✅ TypeScript support

## Why Use Zen with React?

- 🎯 **Simple**: Just one hook to learn
- 🪶 **Tiny**: Minimal bundle size (~300 bytes)
- ⚡ **Fast**: Optimized for performance
- 🔒 **Type-safe**: Full TypeScript support
- 🌐 **Framework-agnostic stores**: Share state logic across different frameworks
- 📦 **No boilerplate**: No providers, no context, just import and use

## License

MIT