Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.
TypeScript agentic-codingaiai-agentsclaude-codecode-contextcoding-agentembeddingsknowledge-graphllmmcpmcp-serveropencodepersistent-memorysqlitetypescript
Initial commit: megamemory MCP server with web explorer
0xk3vind69ad74a9738
diff --git a/.gitignore b/.gitignorenew file mode 100644index 0000000..9473030--- /dev/null+++ b/.gitignore@@ -0,0 +1,5 @@+node_modules/+dist/+.megamemory/+.osgrep/+*.dbdiff --git a/README.md b/README.mdnew file mode 100644index 0000000..02da0b3--- /dev/null+++ b/README.md@@ -0,0 +1,108 @@+# megamemory++Persistent project knowledge graph for coding agents. An MCP server that lets your agent build and query a graph of concepts, architecture, and decisions — so it remembers across sessions.++## How it works++The LLM is the indexer. There's no AST parsing or static analysis. Your agent reads code, writes concepts in its own words, and queries them before future tasks. The graph stores **concepts** (features, modules, patterns, decisions), not code symbols.++**The loop: understand → work → update**++1. **Session start** — agent calls `list_roots` to orient itself+2. **Before a task** — agent calls `understand` with a natural language query to load relevant context+3. **After a task** — agent calls `create_concept` or `update_concept` to record what it built++Everything persists in a per-project SQLite database at `.megamemory/knowledge.db`.++## Install++```bash+npm install -g megamemory+```++Requires Node.js >= 18. The embedding model (~23MB) downloads on first use.++## Setup++### With opencode++```bash+megamemory init+```++This configures everything in one command:+- Adds the MCP server to `~/.config/opencode/opencode.json`+- Appends workflow instructions to `~/.config/opencode/AGENTS.md`+- Installs a skill tool plugin at `~/.config/opencode/tool/megamemory.ts`+- Installs a `/user:bootstrap-memory` command for initial graph population++Restart opencode after running init.++### With other MCP clients++Add megamemory as a stdio MCP server. The command is just `megamemory` (no arguments). It reads/writes `.megamemory/knowledge.db` relative to the working directory, or set `MEGAMEMORY_DB_PATH` to override.++## MCP Tools++| Tool | Description |+|------|-------------|+| `understand` | Semantic search over the knowledge graph. Returns matched concepts with children, edges, and parent context. |+| `create_concept` | Add a new concept (feature, module, pattern, config, decision, component) with optional edges and file references. |+| `update_concept` | Update fields on an existing concept. Automatically regenerates the embedding if name or summary changes. |+| `link` | Create a typed relationship between two concepts (connects_to, depends_on, implements, calls, configured_by). |+| `remove_concept` | Soft-delete a concept with a reason. Preserved in history. |+| `list_roots` | List all top-level concepts with their direct children. Good for session-start orientation. |++## Web Explorer++Visualize the knowledge graph in a browser:++```bash+cd your-project/+megamemory serve+```++Opens a Cytoscape.js graph at `http://localhost:4321` with:+- Nodes colored by kind (feature, module, pattern, config, decision, component)+- Dashed edges for parent-child, solid edges for relationships+- Click-to-inspect detail panel with summary, files, edges, and children+- Search bar with highlight/dim filtering++Use `--port` to change the port:++```bash+megamemory serve --port 8080+```++## Commands++| Command | Description |+|---------|-------------|+| `megamemory` | Start the MCP stdio server (invoked by your agent framework) |+| `megamemory init` | Configure opencode integration |+| `megamemory serve` | Start the web graph explorer |+| `megamemory --help` | Show help |+| `megamemory --version` | Show version |++## Architecture++```+src/+ index.ts CLI entry point + MCP server registration+ tools.ts Tool handlers (understand, createConcept, etc.)+ db.ts SQLite via better-sqlite3 (nodes + edges tables)+ embeddings.ts In-process embeddings (all-MiniLM-L6-v2, 384 dims)+ types.ts TypeScript types+ init.ts `megamemory init` command+ web.ts HTTP server for the graph explorer+plugin/+ megamemory.ts Opencode skill tool plugin+commands/+ bootstrap-memory.md Opencode /user command for initial population+web/+ index.html Single-file graph visualization (Cytoscape.js)+```++## License++MITdiff --git a/commands/bootstrap-memory.md b/commands/bootstrap-memory.mdnew file mode 100644index 0000000..c871acf--- /dev/null+++ b/commands/bootstrap-memory.md@@ -0,0 +1,47 @@+# Bootstrap Project Knowledge Graph++RUN { git ls-files; git ls-files --others --exclude-standard; } 2>/dev/null | sort -u | xargs wc -l 2>/dev/null | sort -rn | head -150+READ README.md++You are bootstrapping the megamemory knowledge graph for this project.++Your job is to understand the codebase and record its core concepts, architecture,+and patterns as knowledge graph nodes. The file listing above is sorted by line+count — the biggest files are where the core logic lives.++## Step 1: Check existing graph++Call `megamemory:list_roots` to see what's already recorded. If the graph has+good coverage, report what's there and ask if I want to fill in specific areas.++## Step 2: Identify major modules++From the file listing and README, identify the top-level systems in this project.+Think in terms of:+- What does this project DO? (features)+- What are the distinct subsystems? (modules)+- How is it structured? (patterns, decisions)++## Step 3: Read and create root concepts++For each major module, read its key files to understand what it does. Then call+`megamemory:create_concept` with a specific, detailed summary. Include parameter+names, defaults, file paths, and behavior details — not vague descriptions.++## Step 4: Create children for important sub-components++For substantial modules, create child concepts for key pieces. Stay max 2 levels+deep. Focus on things a developer would need to know when working in that area.++## Step 5: Link related concepts++Connect concepts that interact across boundaries using `megamemory:link`.+Focus on meaningful relationships: depends_on, calls, connects_to, implements,+configured_by.++## Guidelines++- Be specific. "Handles auth" is useless. "JWT auth with RS256, tokens from+ /auth/login, validated in middleware, refresh tokens in Redis with 7d TTL" is useful.+- Focus on the top 10-15 most important concepts first. The graph grows over time.+- Don't document trivial things. If it's obvious from the file name, skip it.diff --git a/package-lock.json b/package-lock.jsonnew file mode 100644index 0000000..2c77c4f--- /dev/null+++ b/package-lock.json@@ -0,0 +1,2595 @@+{+ "name": "megamemory",+ "version": "1.0.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "megamemory",+ "version": "1.0.0",+ "dependencies": {+ "@modelcontextprotocol/sdk": "^1.12.1",+ "@xenova/transformers": "^2.17.2",+ "better-sqlite3": "^11.7.0",+ "zod": "^3.24.2"+ },+ "bin": {+ "megamemory": "dist/index.js"+ },+ "devDependencies": {+ "@types/better-sqlite3": "^7.6.12",+ "@types/node": "^20.17.14",+ "tsx": "^4.19.2",+ "typescript": "^5.7.3"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/openharmony-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@hono/node-server": {+ "version": "1.19.9",+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz",+ "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==",+ "license": "MIT",+ "engines": {+ "node": ">=18.14.1"+ },+ "peerDependencies": {+ "hono": "^4"+ }+ },+ "node_modules/@huggingface/jinja": {+ "version": "0.2.2",+ "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.2.2.tgz",+ "integrity": "sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@modelcontextprotocol/sdk": {+ "version": "1.26.0",+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz",+ "integrity": "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==",+ "license": "MIT",+ "dependencies": {+ "@hono/node-server": "^1.19.9",+ "ajv": "^8.17.1",+ "ajv-formats": "^3.0.1",+ "content-type": "^1.0.5",+ "cors": "^2.8.5",+ "cross-spawn": "^7.0.5",+ "eventsource": "^3.0.2",+ "eventsource-parser": "^3.0.0",+ "express": "^5.2.1",+ "express-rate-limit": "^8.2.1",+ "hono": "^4.11.4",+ "jose": "^6.1.3",+ "json-schema-typed": "^8.0.2",+ "pkce-challenge": "^5.0.0",+ "raw-body": "^3.0.0",+ "zod": "^3.25 || ^4.0",+ "zod-to-json-schema": "^3.25.1"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@cfworker/json-schema": "^4.1.1",+ "zod": "^3.25 || ^4.0"+ },+ "peerDependenciesMeta": {+ "@cfworker/json-schema": {+ "optional": true+ },+ "zod": {+ "optional": false+ }+ }+ },+ "node_modules/@protobufjs/aspromise": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/base64": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/codegen": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/eventemitter": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",+ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/fetch": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",+ "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.1",+ "@protobufjs/inquire": "^1.1.0"+ }+ },+ "node_modules/@protobufjs/float": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/inquire": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",+ "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/path": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/pool": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/utf8": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",+ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@types/better-sqlite3": {+ "version": "7.6.13",+ "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz",+ "integrity": "sha512-NMv9ASNARoKksWtsq/SHakpYAYnhBrQgGD8zkLYk/jaK8jUGn08CfEdTRgYhMypUQAfzSP8W6gNLe0q19/t4VA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/node": "*"+ }+ },+ "node_modules/@types/long": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz",+ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==",+ "license": "MIT"+ },+ "node_modules/@types/node": {+ "version": "20.19.32",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.32.tgz",+ "integrity": "sha512-Ez8QE4DMfhjjTsES9K2dwfV258qBui7qxUsoaixZDiTzbde4U12e1pXGNu/ECsUIOi5/zoCxAQxIhQnaUQ2VvA==",+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/@xenova/transformers": {+ "version": "2.17.2",+ "resolved": "https://registry.npmjs.org/@xenova/transformers/-/transformers-2.17.2.tgz",+ "integrity": "sha512-lZmHqzrVIkSvZdKZEx7IYY51TK0WDrC8eR0c5IMnBsO8di8are1zzw8BlLhyO2TklZKLN5UffNGs1IJwT6oOqQ==",+ "license": "Apache-2.0",+ "dependencies": {+ "@huggingface/jinja": "^0.2.2",+ "onnxruntime-web": "1.14.0",+ "sharp": "^0.32.0"+ },+ "optionalDependencies": {+ "onnxruntime-node": "1.14.0"+ }+ },+ "node_modules/accepts": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",+ "license": "MIT",+ "dependencies": {+ "mime-types": "^3.0.0",+ "negotiator": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/ajv": {+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",+ "license": "MIT",+ "dependencies": {+ "fast-deep-equal": "^3.1.3",+ "fast-uri": "^3.0.1",+ "json-schema-traverse": "^1.0.0",+ "require-from-string": "^2.0.2"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/sponsors/epoberezkin"+ }+ },+ "node_modules/ajv-formats": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",+ "license": "MIT",+ "dependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependencies": {+ "ajv": "^8.0.0"+ },+ "peerDependenciesMeta": {+ "ajv": {+ "optional": true+ }+ }+ },+ "node_modules/b4a": {+ "version": "1.7.3",+ "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz",+ "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==",+ "license": "Apache-2.0",+ "peerDependencies": {+ "react-native-b4a": "*"+ },+ "peerDependenciesMeta": {+ "react-native-b4a": {+ "optional": true+ }+ }+ },+ "node_modules/bare-events": {+ "version": "2.8.2",+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",+ "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",+ "license": "Apache-2.0",+ "peerDependencies": {+ "bare-abort-controller": "*"+ },+ "peerDependenciesMeta": {+ "bare-abort-controller": {+ "optional": true+ }+ }+ },+ "node_modules/bare-fs": {+ "version": "4.5.3",+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.3.tgz",+ "integrity": "sha512-9+kwVx8QYvt3hPWnmb19tPnh38c6Nihz8Lx3t0g9+4GoIf3/fTgYwM4Z6NxgI+B9elLQA7mLE9PpqcWtOMRDiQ==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-events": "^2.5.4",+ "bare-path": "^3.0.0",+ "bare-stream": "^2.6.4",+ "bare-url": "^2.2.2",+ "fast-fifo": "^1.3.2"+ },+ "engines": {+ "bare": ">=1.16.0"+ },+ "peerDependencies": {+ "bare-buffer": "*"+ },+ "peerDependenciesMeta": {+ "bare-buffer": {+ "optional": true+ }+ }+ },+ "node_modules/bare-os": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.2.tgz",+ "integrity": "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==",+ "license": "Apache-2.0",+ "optional": true,+ "engines": {+ "bare": ">=1.14.0"+ }+ },+ "node_modules/bare-path": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",+ "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-os": "^3.0.1"+ }+ },+ "node_modules/bare-stream": {+ "version": "2.7.0",+ "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz",+ "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "streamx": "^2.21.0"+ },+ "peerDependencies": {+ "bare-buffer": "*",+ "bare-events": "*"+ },+ "peerDependenciesMeta": {+ "bare-buffer": {+ "optional": true+ },+ "bare-events": {+ "optional": true+ }+ }+ },+ "node_modules/bare-url": {+ "version": "2.3.2",+ "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz",+ "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==",+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "bare-path": "^3.0.0"+ }+ },+ "node_modules/base64-js": {+ "version": "1.5.1",+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/better-sqlite3": {+ "version": "11.10.0",+ "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.10.0.tgz",+ "integrity": "sha512-EwhOpyXiOEL/lKzHz9AW1msWFNzGc/z+LzeB3/jnFJpxu+th2yqvzsSWas1v9jgs9+xiXJcD5A8CJxAG2TaghQ==",+ "hasInstallScript": true,+ "license": "MIT",+ "dependencies": {+ "bindings": "^1.5.0",+ "prebuild-install": "^7.1.1"+ }+ },+ "node_modules/bindings": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",+ "license": "MIT",+ "dependencies": {+ "file-uri-to-path": "1.0.0"+ }+ },+ "node_modules/bl": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",+ "license": "MIT",+ "dependencies": {+ "buffer": "^5.5.0",+ "inherits": "^2.0.4",+ "readable-stream": "^3.4.0"+ }+ },+ "node_modules/body-parser": {+ "version": "2.2.2",+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",+ "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",+ "license": "MIT",+ "dependencies": {+ "bytes": "^3.1.2",+ "content-type": "^1.0.5",+ "debug": "^4.4.3",+ "http-errors": "^2.0.0",+ "iconv-lite": "^0.7.0",+ "on-finished": "^2.4.1",+ "qs": "^6.14.1",+ "raw-body": "^3.0.1",+ "type-is": "^2.0.1"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/buffer": {+ "version": "5.7.1",+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "base64-js": "^1.3.1",+ "ieee754": "^1.1.13"+ }+ },+ "node_modules/bytes": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/call-bind-apply-helpers": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/call-bound": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "get-intrinsic": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/chownr": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",+ "license": "ISC"+ },+ "node_modules/color": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1",+ "color-string": "^1.9.0"+ },+ "engines": {+ "node": ">=12.5.0"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT"+ },+ "node_modules/color-string": {+ "version": "1.9.1",+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",+ "license": "MIT",+ "dependencies": {+ "color-name": "^1.0.0",+ "simple-swizzle": "^0.2.2"+ }+ },+ "node_modules/content-disposition": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz",+ "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/content-type": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/cookie": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/cookie-signature": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",+ "license": "MIT",+ "engines": {+ "node": ">=6.6.0"+ }+ },+ "node_modules/cors": {+ "version": "2.8.6",+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",+ "license": "MIT",+ "dependencies": {+ "object-assign": "^4",+ "vary": "^1"+ },+ "engines": {+ "node": ">= 0.10"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/cross-spawn": {+ "version": "7.0.6",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",+ "license": "MIT",+ "dependencies": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/decompress-response": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",+ "license": "MIT",+ "dependencies": {+ "mimic-response": "^3.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/deep-extend": {+ "version": "0.6.0",+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",+ "license": "MIT",+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/depd": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/dunder-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.1",+ "es-errors": "^1.3.0",+ "gopd": "^1.2.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/ee-first": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",+ "license": "MIT"+ },+ "node_modules/encodeurl": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/end-of-stream": {+ "version": "1.4.5",+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",+ "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",+ "license": "MIT",+ "dependencies": {+ "once": "^1.4.0"+ }+ },+ "node_modules/es-define-property": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-errors": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-object-atoms": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/esbuild": {+ "version": "0.27.3",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=18"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.27.3",+ "@esbuild/android-arm": "0.27.3",+ "@esbuild/android-arm64": "0.27.3",+ "@esbuild/android-x64": "0.27.3",+ "@esbuild/darwin-arm64": "0.27.3",+ "@esbuild/darwin-x64": "0.27.3",+ "@esbuild/freebsd-arm64": "0.27.3",+ "@esbuild/freebsd-x64": "0.27.3",+ "@esbuild/linux-arm": "0.27.3",+ "@esbuild/linux-arm64": "0.27.3",+ "@esbuild/linux-ia32": "0.27.3",+ "@esbuild/linux-loong64": "0.27.3",+ "@esbuild/linux-mips64el": "0.27.3",+ "@esbuild/linux-ppc64": "0.27.3",+ "@esbuild/linux-riscv64": "0.27.3",+ "@esbuild/linux-s390x": "0.27.3",+ "@esbuild/linux-x64": "0.27.3",+ "@esbuild/netbsd-arm64": "0.27.3",+ "@esbuild/netbsd-x64": "0.27.3",+ "@esbuild/openbsd-arm64": "0.27.3",+ "@esbuild/openbsd-x64": "0.27.3",+ "@esbuild/openharmony-arm64": "0.27.3",+ "@esbuild/sunos-x64": "0.27.3",+ "@esbuild/win32-arm64": "0.27.3",+ "@esbuild/win32-ia32": "0.27.3",+ "@esbuild/win32-x64": "0.27.3"+ }+ },+ "node_modules/escape-html": {+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",+ "license": "MIT"+ },+ "node_modules/etag": {+ "version": "1.8.1",+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/events-universal": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",+ "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",+ "license": "Apache-2.0",+ "dependencies": {+ "bare-events": "^2.7.0"+ }+ },+ "node_modules/eventsource": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",+ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",+ "license": "MIT",+ "dependencies": {+ "eventsource-parser": "^3.0.1"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/eventsource-parser": {+ "version": "3.0.6",+ "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz",+ "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==",+ "license": "MIT",+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/expand-template": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",+ "license": "(MIT OR WTFPL)",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/express": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",+ "license": "MIT",+ "dependencies": {+ "accepts": "^2.0.0",+ "body-parser": "^2.2.1",+ "content-disposition": "^1.0.0",+ "content-type": "^1.0.5",+ "cookie": "^0.7.1",+ "cookie-signature": "^1.2.1",+ "debug": "^4.4.0",+ "depd": "^2.0.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "finalhandler": "^2.1.0",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.0",+ "merge-descriptors": "^2.0.0",+ "mime-types": "^3.0.0",+ "on-finished": "^2.4.1",+ "once": "^1.4.0",+ "parseurl": "^1.3.3",+ "proxy-addr": "^2.0.7",+ "qs": "^6.14.0",+ "range-parser": "^1.2.1",+ "router": "^2.2.0",+ "send": "^1.1.0",+ "serve-static": "^2.2.0",+ "statuses": "^2.0.1",+ "type-is": "^2.0.1",+ "vary": "^1.1.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/express-rate-limit": {+ "version": "8.2.1",+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz",+ "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==",+ "license": "MIT",+ "dependencies": {+ "ip-address": "10.0.1"+ },+ "engines": {+ "node": ">= 16"+ },+ "funding": {+ "url": "https://github.com/sponsors/express-rate-limit"+ },+ "peerDependencies": {+ "express": ">= 4.11"+ }+ },+ "node_modules/fast-deep-equal": {+ "version": "3.1.3",+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",+ "license": "MIT"+ },+ "node_modules/fast-fifo": {+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",+ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",+ "license": "MIT"+ },+ "node_modules/fast-uri": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",+ "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/fastify"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/fastify"+ }+ ],+ "license": "BSD-3-Clause"+ },+ "node_modules/file-uri-to-path": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",+ "license": "MIT"+ },+ "node_modules/finalhandler": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "on-finished": "^2.4.1",+ "parseurl": "^1.3.3",+ "statuses": "^2.0.1"+ },+ "engines": {+ "node": ">= 18.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/flatbuffers": {+ "version": "1.12.0",+ "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz",+ "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==",+ "license": "SEE LICENSE IN LICENSE.txt"+ },+ "node_modules/forwarded": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/fresh": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/fs-constants": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",+ "license": "MIT"+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/function-bind": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/get-intrinsic": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",+ "license": "MIT",+ "dependencies": {+ "call-bind-apply-helpers": "^1.0.2",+ "es-define-property": "^1.0.1",+ "es-errors": "^1.3.0",+ "es-object-atoms": "^1.1.1",+ "function-bind": "^1.1.2",+ "get-proto": "^1.0.1",+ "gopd": "^1.2.0",+ "has-symbols": "^1.1.0",+ "hasown": "^2.0.2",+ "math-intrinsics": "^1.1.0"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/get-proto": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",+ "license": "MIT",+ "dependencies": {+ "dunder-proto": "^1.0.1",+ "es-object-atoms": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/get-tsconfig": {+ "version": "4.13.3",+ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.3.tgz",+ "integrity": "sha512-vp8Cj/+9Q/ibZUrq1rhy8mCTQpCk31A3uu9wc1C50yAb3x2pFHOsGdAZQ7jD86ARayyxZUViYeIztW+GE8dcrg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "resolve-pkg-maps": "^1.0.0"+ },+ "funding": {+ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"+ }+ },+ "node_modules/github-from-package": {+ "version": "0.0.0",+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==",+ "license": "MIT"+ },+ "node_modules/gopd": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/guid-typescript": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz",+ "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==",+ "license": "ISC"+ },+ "node_modules/has-symbols": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/hasown": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",+ "license": "MIT",+ "dependencies": {+ "function-bind": "^1.1.2"+ },+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/hono": {+ "version": "4.11.7",+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.7.tgz",+ "integrity": "sha512-l7qMiNee7t82bH3SeyUCt9UF15EVmaBvsppY2zQtrbIhl/yzBTny+YUxsVjSjQ6gaqaeVtZmGocom8TzBlA4Yw==",+ "license": "MIT",+ "engines": {+ "node": ">=16.9.0"+ }+ },+ "node_modules/http-errors": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",+ "license": "MIT",+ "dependencies": {+ "depd": "~2.0.0",+ "inherits": "~2.0.4",+ "setprototypeof": "~1.2.0",+ "statuses": "~2.0.2",+ "toidentifier": "~1.0.1"+ },+ "engines": {+ "node": ">= 0.8"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/iconv-lite": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",+ "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",+ "license": "MIT",+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/ieee754": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "BSD-3-Clause"+ },+ "node_modules/inherits": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",+ "license": "ISC"+ },+ "node_modules/ini": {+ "version": "1.3.8",+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",+ "license": "ISC"+ },+ "node_modules/ip-address": {+ "version": "10.0.1",+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",+ "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==",+ "license": "MIT",+ "engines": {+ "node": ">= 12"+ }+ },+ "node_modules/ipaddr.js": {+ "version": "1.9.1",+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/is-arrayish": {+ "version": "0.3.4",+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz",+ "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==",+ "license": "MIT"+ },+ "node_modules/is-promise": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",+ "license": "MIT"+ },+ "node_modules/isexe": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",+ "license": "ISC"+ },+ "node_modules/jose": {+ "version": "6.1.3",+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz",+ "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/panva"+ }+ },+ "node_modules/json-schema-traverse": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",+ "license": "MIT"+ },+ "node_modules/json-schema-typed": {+ "version": "8.0.2",+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz",+ "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",+ "license": "BSD-2-Clause"+ },+ "node_modules/long": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",+ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",+ "license": "Apache-2.0"+ },+ "node_modules/math-intrinsics": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/media-typer": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/merge-descriptors": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/mime-db": {+ "version": "1.54.0",+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/mime-types": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",+ "license": "MIT",+ "dependencies": {+ "mime-db": "^1.54.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/mimic-response": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/minimist": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/mkdirp-classic": {+ "version": "0.5.3",+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",+ "license": "MIT"+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "license": "MIT"+ },+ "node_modules/napi-build-utils": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz",+ "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==",+ "license": "MIT"+ },+ "node_modules/negotiator": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/node-abi": {+ "version": "3.87.0",+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.87.0.tgz",+ "integrity": "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==",+ "license": "MIT",+ "dependencies": {+ "semver": "^7.3.5"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/node-addon-api": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",+ "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==",+ "license": "MIT"+ },+ "node_modules/object-assign": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/object-inspect": {+ "version": "1.13.4",+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/on-finished": {+ "version": "2.4.1",+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",+ "license": "MIT",+ "dependencies": {+ "ee-first": "1.1.1"+ },+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/once": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",+ "license": "ISC",+ "dependencies": {+ "wrappy": "1"+ }+ },+ "node_modules/onnx-proto": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz",+ "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==",+ "license": "MIT",+ "dependencies": {+ "protobufjs": "^6.8.8"+ }+ },+ "node_modules/onnxruntime-common": {+ "version": "1.14.0",+ "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz",+ "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==",+ "license": "MIT"+ },+ "node_modules/onnxruntime-node": {+ "version": "1.14.0",+ "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.14.0.tgz",+ "integrity": "sha512-5ba7TWomIV/9b6NH/1x/8QEeowsb+jBEvFzU6z0T4mNsFwdPqXeFUM7uxC6QeSRkEbWu3qEB0VMjrvzN/0S9+w==",+ "license": "MIT",+ "optional": true,+ "os": [+ "win32",+ "darwin",+ "linux"+ ],+ "dependencies": {+ "onnxruntime-common": "~1.14.0"+ }+ },+ "node_modules/onnxruntime-web": {+ "version": "1.14.0",+ "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz",+ "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==",+ "license": "MIT",+ "dependencies": {+ "flatbuffers": "^1.12.0",+ "guid-typescript": "^1.0.9",+ "long": "^4.0.0",+ "onnx-proto": "^4.0.4",+ "onnxruntime-common": "~1.14.0",+ "platform": "^1.3.6"+ }+ },+ "node_modules/parseurl": {+ "version": "1.3.3",+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/path-to-regexp": {+ "version": "8.3.0",+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",+ "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",+ "license": "MIT",+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/pkce-challenge": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",+ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",+ "license": "MIT",+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/platform": {+ "version": "1.3.6",+ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",+ "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==",+ "license": "MIT"+ },+ "node_modules/prebuild-install": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",+ "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==",+ "license": "MIT",+ "dependencies": {+ "detect-libc": "^2.0.0",+ "expand-template": "^2.0.3",+ "github-from-package": "0.0.0",+ "minimist": "^1.2.3",+ "mkdirp-classic": "^0.5.3",+ "napi-build-utils": "^2.0.0",+ "node-abi": "^3.3.0",+ "pump": "^3.0.0",+ "rc": "^1.2.7",+ "simple-get": "^4.0.0",+ "tar-fs": "^2.0.0",+ "tunnel-agent": "^0.6.0"+ },+ "bin": {+ "prebuild-install": "bin.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/protobufjs": {+ "version": "6.11.4",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz",+ "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==",+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.2",+ "@protobufjs/base64": "^1.1.2",+ "@protobufjs/codegen": "^2.0.4",+ "@protobufjs/eventemitter": "^1.1.0",+ "@protobufjs/fetch": "^1.1.0",+ "@protobufjs/float": "^1.0.2",+ "@protobufjs/inquire": "^1.1.0",+ "@protobufjs/path": "^1.1.2",+ "@protobufjs/pool": "^1.1.0",+ "@protobufjs/utf8": "^1.1.0",+ "@types/long": "^4.0.1",+ "@types/node": ">=13.7.0",+ "long": "^4.0.0"+ },+ "bin": {+ "pbjs": "bin/pbjs",+ "pbts": "bin/pbts"+ }+ },+ "node_modules/proxy-addr": {+ "version": "2.0.7",+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",+ "license": "MIT",+ "dependencies": {+ "forwarded": "0.2.0",+ "ipaddr.js": "1.9.1"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/pump": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",+ "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",+ "license": "MIT",+ "dependencies": {+ "end-of-stream": "^1.1.0",+ "once": "^1.3.1"+ }+ },+ "node_modules/qs": {+ "version": "6.14.1",+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",+ "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "side-channel": "^1.1.0"+ },+ "engines": {+ "node": ">=0.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/range-parser": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/raw-body": {+ "version": "3.0.2",+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",+ "license": "MIT",+ "dependencies": {+ "bytes": "~3.1.2",+ "http-errors": "~2.0.1",+ "iconv-lite": "~0.7.0",+ "unpipe": "~1.0.0"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/rc": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",+ "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",+ "dependencies": {+ "deep-extend": "^0.6.0",+ "ini": "~1.3.0",+ "minimist": "^1.2.0",+ "strip-json-comments": "~2.0.1"+ },+ "bin": {+ "rc": "cli.js"+ }+ },+ "node_modules/readable-stream": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",+ "license": "MIT",+ "dependencies": {+ "inherits": "^2.0.3",+ "string_decoder": "^1.1.1",+ "util-deprecate": "^1.0.1"+ },+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/require-from-string": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/resolve-pkg-maps": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",+ "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"+ }+ },+ "node_modules/router": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.0",+ "depd": "^2.0.0",+ "is-promise": "^4.0.0",+ "parseurl": "^1.3.3",+ "path-to-regexp": "^8.0.0"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/safe-buffer": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/safer-buffer": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",+ "license": "MIT"+ },+ "node_modules/semver": {+ "version": "7.7.4",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/send": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",+ "license": "MIT",+ "dependencies": {+ "debug": "^4.4.3",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.1",+ "mime-types": "^3.0.2",+ "ms": "^2.1.3",+ "on-finished": "^2.4.1",+ "range-parser": "^1.2.1",+ "statuses": "^2.0.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/serve-static": {+ "version": "2.2.1",+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",+ "license": "MIT",+ "dependencies": {+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "parseurl": "^1.3.3",+ "send": "^1.2.0"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/setprototypeof": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",+ "license": "ISC"+ },+ "node_modules/sharp": {+ "version": "0.32.6",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz",+ "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==",+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "dependencies": {+ "color": "^4.2.3",+ "detect-libc": "^2.0.2",+ "node-addon-api": "^6.1.0",+ "prebuild-install": "^7.1.1",+ "semver": "^7.5.4",+ "simple-get": "^4.0.1",+ "tar-fs": "^3.0.4",+ "tunnel-agent": "^0.6.0"+ },+ "engines": {+ "node": ">=14.15.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/sharp/node_modules/tar-fs": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz",+ "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==",+ "license": "MIT",+ "dependencies": {+ "pump": "^3.0.0",+ "tar-stream": "^3.1.5"+ },+ "optionalDependencies": {+ "bare-fs": "^4.0.1",+ "bare-path": "^3.0.0"+ }+ },+ "node_modules/sharp/node_modules/tar-stream": {+ "version": "3.1.7",+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",+ "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",+ "license": "MIT",+ "dependencies": {+ "b4a": "^1.6.4",+ "fast-fifo": "^1.2.0",+ "streamx": "^2.15.0"+ }+ },+ "node_modules/shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "license": "MIT",+ "dependencies": {+ "shebang-regex": "^3.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "license": "MIT",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/side-channel": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "object-inspect": "^1.13.3",+ "side-channel-list": "^1.0.0",+ "side-channel-map": "^1.0.1",+ "side-channel-weakmap": "^1.0.2"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-list": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",+ "license": "MIT",+ "dependencies": {+ "es-errors": "^1.3.0",+ "object-inspect": "^1.13.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-map": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/side-channel-weakmap": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",+ "license": "MIT",+ "dependencies": {+ "call-bound": "^1.0.2",+ "es-errors": "^1.3.0",+ "get-intrinsic": "^1.2.5",+ "object-inspect": "^1.13.3",+ "side-channel-map": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/simple-concat": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },+ "node_modules/simple-get": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "decompress-response": "^6.0.0",+ "once": "^1.3.1",+ "simple-concat": "^1.0.0"+ }+ },+ "node_modules/simple-swizzle": {+ "version": "0.2.4",+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz",+ "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==",+ "license": "MIT",+ "dependencies": {+ "is-arrayish": "^0.3.1"+ }+ },+ "node_modules/statuses": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/streamx": {+ "version": "2.23.0",+ "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz",+ "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==",+ "license": "MIT",+ "dependencies": {+ "events-universal": "^1.0.0",+ "fast-fifo": "^1.3.2",+ "text-decoder": "^1.1.0"+ }+ },+ "node_modules/string_decoder": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",+ "license": "MIT",+ "dependencies": {+ "safe-buffer": "~5.2.0"+ }+ },+ "node_modules/strip-json-comments": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/tar-fs": {+ "version": "2.1.4",+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",+ "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",+ "license": "MIT",+ "dependencies": {+ "chownr": "^1.1.1",+ "mkdirp-classic": "^0.5.2",+ "pump": "^3.0.0",+ "tar-stream": "^2.1.4"+ }+ },+ "node_modules/tar-stream": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",+ "license": "MIT",+ "dependencies": {+ "bl": "^4.0.3",+ "end-of-stream": "^1.4.1",+ "fs-constants": "^1.0.0",+ "inherits": "^2.0.3",+ "readable-stream": "^3.1.1"+ },+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/text-decoder": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz",+ "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==",+ "license": "Apache-2.0",+ "dependencies": {+ "b4a": "^1.6.4"+ }+ },+ "node_modules/toidentifier": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",+ "license": "MIT",+ "engines": {+ "node": ">=0.6"+ }+ },+ "node_modules/tsx": {+ "version": "4.21.0",+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz",+ "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "~0.27.0",+ "get-tsconfig": "^4.7.5"+ },+ "bin": {+ "tsx": "dist/cli.mjs"+ },+ "engines": {+ "node": ">=18.0.0"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ }+ },+ "node_modules/tunnel-agent": {+ "version": "0.6.0",+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",+ "license": "Apache-2.0",+ "dependencies": {+ "safe-buffer": "^5.0.1"+ },+ "engines": {+ "node": "*"+ }+ },+ "node_modules/type-is": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",+ "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",+ "license": "MIT",+ "dependencies": {+ "content-type": "^1.0.5",+ "media-typer": "^1.1.0",+ "mime-types": "^3.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/typescript": {+ "version": "5.9.3",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "license": "MIT"+ },+ "node_modules/unpipe": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/util-deprecate": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",+ "license": "MIT"+ },+ "node_modules/vary": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "license": "ISC",+ "dependencies": {+ "isexe": "^2.0.0"+ },+ "bin": {+ "node-which": "bin/node-which"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/wrappy": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",+ "license": "ISC"+ },+ "node_modules/zod": {+ "version": "3.25.76",+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ },+ "node_modules/zod-to-json-schema": {+ "version": "3.25.1",+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz",+ "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==",+ "license": "ISC",+ "peerDependencies": {+ "zod": "^3.25 || ^4"+ }+ }+ }+}diff --git a/package.json b/package.jsonnew file mode 100644index 0000000..9091d04--- /dev/null+++ b/package.json@@ -0,0 +1,50 @@+{+ "name": "megamemory",+ "version": "1.0.0",+ "description": "MCP server that gives coding agents persistent project understanding via a knowledge graph",+ "type": "module",+ "main": "dist/index.js",+ "bin": {+ "megamemory": "dist/index.js"+ },+ "files": [+ "dist/",+ "plugin/",+ "commands/",+ "web/"+ ],+ "scripts": {+ "build": "tsc",+ "start": "node dist/index.js",+ "dev": "tsx src/index.ts",+ "prepublishOnly": "npm run build"+ },+ "keywords": [+ "mcp",+ "knowledge-graph",+ "coding-agent",+ "persistent-memory",+ "opencode"+ ],+ "author": "Kevin",+ "license": "MIT",+ "repository": {+ "type": "git",+ "url": "https://github.com/anomalyco/megamemory.git"+ },+ "engines": {+ "node": ">=18"+ },+ "dependencies": {+ "@modelcontextprotocol/sdk": "^1.12.1",+ "@xenova/transformers": "^2.17.2",+ "better-sqlite3": "^11.7.0",+ "zod": "^3.24.2"+ },+ "devDependencies": {+ "@types/better-sqlite3": "^7.6.12",+ "@types/node": "^20.17.14",+ "tsx": "^4.19.2",+ "typescript": "^5.7.3"+ }+}diff --git a/plugin/megamemory.ts b/plugin/megamemory.tsnew file mode 100644index 0000000..b508cae--- /dev/null+++ b/plugin/megamemory.ts@@ -0,0 +1,125 @@+import { tool } from "@opencode-ai/plugin";++const SKILL = `+---+name: megamemory+description: Project knowledge graph — persistent memory across sessions. Use at session start, before tasks (to load context), and after tasks (to record what you built). The graph stores concepts, architecture, decisions, and relationships — written by you, for you.+allowed-tools: "megamemory:*"+---++# Megamemory — Project Knowledge Graph++Your persistent memory of the codebase. You write concepts as you work. You query them before starting new tasks. The graph survives across sessions.++## When to Use++- **Session start** → \`list_roots\` to orient yourself+- **Before any task** → \`understand\` to load relevant context+- **After any task** → \`create_concept\` / \`update_concept\` / \`link\` to record what you did+- **Refactoring or removing features** → \`remove_concept\` to mark things as gone (with reason)++## Core Principles++1. **Query before work, update after work.** Always.+2. **Concepts, not code.** Nodes are features, patterns, decisions — not files or symbols.+3. **Be specific.** Include parameter names, defaults, file paths, rationale.+4. **Keep it shallow.** Max 3 levels deep. Useful beats exhaustive.++## Concept Kinds++\`feature\` | \`module\` | \`pattern\` | \`config\` | \`decision\` | \`component\`++## Relationship Types++- \`depends_on\` — A requires B to function+- \`implements\` — A is the concrete implementation of B+- \`calls\` — A invokes B at runtime+- \`connects_to\` — A and B interact or share data+- \`configured_by\` — A's behavior is controlled by B++## MCP Tools Reference++| Tool | When | What it does |+|---|---|---|+| \`megamemory:understand\` | Before tasks | Semantic search — returns matching concepts with children, edges, parent |+| \`megamemory:create_concept\` | After tasks | Add new concept with summary, kind, edges, file refs |+| \`megamemory:update_concept\` | After tasks | Patch existing concept fields |+| \`megamemory:link\` | After tasks | Create relationship between two concepts |+| \`megamemory:remove_concept\` | On refactor/delete | Soft-delete with reason (history preserved) |+| \`megamemory:list_roots\` | Session start | All top-level concepts with children + stats |+`;++export default tool({+ description: SKILL,+ args: {+ action: tool.schema+ .enum(["query", "record", "overview"])+ .describe(+ "Workflow action: query (before task — understand context), record (after task — create/update/link), overview (session start — list roots)",+ ),+ query: tool.schema+ .string()+ .optional()+ .describe("Natural language query for the 'query' action"),+ concepts: tool.schema+ .string()+ .optional()+ .describe(+ "For 'record' action: brief description of what concepts to create/update/link",+ ),+ },+ async execute({ action, query, concepts }) {+ switch (action) {+ case "overview":+ return `To get a project overview, call:++1. megamemory:list_roots — Returns all top-level concepts with their children and graph stats.++Use this at the start of every session to orient yourself. If the graph is empty, proceed normally and create concepts as you work.`;++ case "query":+ if (!query) {+ return "Error: query is required for the query action. Describe what you need to understand about the project.";+ }+ return `To load context for "${query}", call:++1. megamemory:understand — query="${query}"+ Returns: matched concepts ranked by relevance, each with:+ - summary, why, file_refs+ - children (1 level)+ - outgoing and incoming edges+ - parent context++Use the returned context instead of re-reading source files when possible. If no relevant results come back, proceed normally — the graph may not cover this area yet.`;++ case "record":+ return `After completing your task, update the knowledge graph:++1. **New concepts** → megamemory:create_concept+ - name: human-readable name+ - kind: feature | module | pattern | config | decision | component+ - summary: specific — include param names, defaults, file paths, behavior+ - why: rationale for this design+ - parent_id: parent concept slug (for nesting)+ - file_refs: relevant file paths + line ranges+ - edges: [{to: "concept-id", relation: "depends_on|implements|calls|connects_to|configured_by", description: "why"}]+ - created_by_task: what task/prompt created this++2. **Changed concepts** → megamemory:update_concept+ - id: the concept slug+ - changes: {summary?, why?, file_refs?, name?, kind?}++3. **New relationships** → megamemory:link+ - from, to: concept IDs+ - relation: depends_on | implements | calls | connects_to | configured_by+ - description: why this relationship exists++4. **Removed features** → megamemory:remove_concept+ - id: concept to remove+ - reason: why it was removed${concepts ? `\n\nContext about what to record: "${concepts}"` : ""}`;++ default:+ return `Unknown action: ${action}. Use: overview (session start), query (before task), record (after task).`;+ }+ },+});diff --git a/src/db.ts b/src/db.tsnew file mode 100644index 0000000..8bf7772--- /dev/null+++ b/src/db.ts@@ -0,0 +1,345 @@+import Database from "better-sqlite3";+import path from "path";+import fs from "fs";+import type { NodeRow, EdgeRow } from "./types.js";++const SCHEMA_VERSION = 1;++export class KnowledgeDB {+ private db: Database.Database;++ constructor(dbPath: string) {+ // Ensure directory exists+ const dir = path.dirname(dbPath);+ if (!fs.existsSync(dir)) {+ fs.mkdirSync(dir, { recursive: true });+ }++ this.db = new Database(dbPath);+ this.db.pragma("journal_mode = WAL");+ this.db.pragma("foreign_keys = ON");+ this.migrate();+ }++ private migrate(): void {+ const version = this.db.pragma("user_version", { simple: true }) as number;++ if (version < 1) {+ this.db.exec(`+ CREATE TABLE IF NOT EXISTS nodes (+ id TEXT PRIMARY KEY,+ name TEXT NOT NULL,+ kind TEXT NOT NULL,+ summary TEXT NOT NULL,+ why TEXT,+ file_refs TEXT,+ parent_id TEXT,+ created_by_task TEXT,+ created_at TEXT DEFAULT (datetime('now')),+ updated_at TEXT DEFAULT (datetime('now')),+ removed_at TEXT,+ removed_reason TEXT,+ embedding BLOB,+ FOREIGN KEY (parent_id) REFERENCES nodes(id) ON DELETE SET NULL+ );++ CREATE TABLE IF NOT EXISTS edges (+ id INTEGER PRIMARY KEY AUTOINCREMENT,+ from_id TEXT NOT NULL,+ to_id TEXT NOT NULL,+ relation TEXT NOT NULL,+ description TEXT,+ created_at TEXT DEFAULT (datetime('now')),+ FOREIGN KEY (from_id) REFERENCES nodes(id) ON DELETE CASCADE,+ FOREIGN KEY (to_id) REFERENCES nodes(id) ON DELETE CASCADE+ );++ CREATE INDEX IF NOT EXISTS idx_nodes_parent ON nodes(parent_id);+ CREATE INDEX IF NOT EXISTS idx_nodes_kind ON nodes(kind);+ CREATE INDEX IF NOT EXISTS idx_nodes_removed ON nodes(removed_at);+ CREATE INDEX IF NOT EXISTS idx_edges_from ON edges(from_id);+ CREATE INDEX IF NOT EXISTS idx_edges_to ON edges(to_id);+ CREATE INDEX IF NOT EXISTS idx_edges_relation ON edges(relation);+ `);+ this.db.pragma(`user_version = ${SCHEMA_VERSION}`);+ }+ }++ // ---- Node CRUD ----++ insertNode(node: {+ id: string;+ name: string;+ kind: string;+ summary: string;+ why?: string | null;+ file_refs?: string[] | null;+ parent_id?: string | null;+ created_by_task?: string | null;+ embedding?: Buffer | null;+ }): void {+ const stmt = this.db.prepare(`+ INSERT INTO nodes (id, name, kind, summary, why, file_refs, parent_id, created_by_task, embedding)+ VALUES (@id, @name, @kind, @summary, @why, @file_refs, @parent_id, @created_by_task, @embedding)+ `);+ stmt.run({+ id: node.id,+ name: node.name,+ kind: node.kind,+ summary: node.summary,+ why: node.why ?? null,+ file_refs: node.file_refs ? JSON.stringify(node.file_refs) : null,+ parent_id: node.parent_id ?? null,+ created_by_task: node.created_by_task ?? null,+ embedding: node.embedding ?? null,+ });+ }++ getNode(id: string): NodeRow | undefined {+ return this.db+ .prepare("SELECT * FROM nodes WHERE id = ? AND removed_at IS NULL")+ .get(id) as NodeRow | undefined;+ }++ getNodeIncludingRemoved(id: string): NodeRow | undefined {+ return this.db.prepare("SELECT * FROM nodes WHERE id = ?").get(id) as+ | NodeRow+ | undefined;+ }++ updateNode(+ id: string,+ changes: {+ name?: string;+ kind?: string;+ summary?: string;+ why?: string;+ file_refs?: string[];+ embedding?: Buffer;+ }+ ): boolean {+ const fields: string[] = [];+ const values: Record<string, unknown> = { id };++ if (changes.name !== undefined) {+ fields.push("name = @name");+ values.name = changes.name;+ }+ if (changes.kind !== undefined) {+ fields.push("kind = @kind");+ values.kind = changes.kind;+ }+ if (changes.summary !== undefined) {+ fields.push("summary = @summary");+ values.summary = changes.summary;+ }+ if (changes.why !== undefined) {+ fields.push("why = @why");+ values.why = changes.why;+ }+ if (changes.file_refs !== undefined) {+ fields.push("file_refs = @file_refs");+ values.file_refs = JSON.stringify(changes.file_refs);+ }+ if (changes.embedding !== undefined) {+ fields.push("embedding = @embedding");+ values.embedding = changes.embedding;+ }++ if (fields.length === 0) return false;++ fields.push("updated_at = datetime('now')");++ const stmt = this.db.prepare(+ `UPDATE nodes SET ${fields.join(", ")} WHERE id = @id AND removed_at IS NULL`+ );+ const result = stmt.run(values);+ return result.changes > 0;+ }++ softDeleteNode(id: string, reason: string): boolean {+ const stmt = this.db.prepare(`+ UPDATE nodes SET removed_at = datetime('now'), removed_reason = @reason, updated_at = datetime('now')+ WHERE id = @id AND removed_at IS NULL+ `);+ const result = stmt.run({ id, reason });++ // Also remove edges involving this node+ if (result.changes > 0) {+ this.db+ .prepare("DELETE FROM edges WHERE from_id = ? OR to_id = ?")+ .run(id, id);+ }++ return result.changes > 0;+ }++ // ---- Edge CRUD ----++ insertEdge(edge: {+ from_id: string;+ to_id: string;+ relation: string;+ description?: string | null;+ }): number {+ const stmt = this.db.prepare(`+ INSERT INTO edges (from_id, to_id, relation, description)+ VALUES (@from_id, @to_id, @relation, @description)+ `);+ const result = stmt.run({+ from_id: edge.from_id,+ to_id: edge.to_id,+ relation: edge.relation,+ description: edge.description ?? null,+ });+ return Number(result.lastInsertRowid);+ }++ deleteEdge(fromId: string, toId: string, relation: string): boolean {+ const result = this.db+ .prepare(+ "DELETE FROM edges WHERE from_id = ? AND to_id = ? AND relation = ?"+ )+ .run(fromId, toId, relation);+ return result.changes > 0;+ }++ // ---- Query methods ----++ getChildren(parentId: string): NodeRow[] {+ return this.db+ .prepare(+ "SELECT * FROM nodes WHERE parent_id = ? AND removed_at IS NULL"+ )+ .all(parentId) as NodeRow[];+ }++ getOutgoingEdges(+ nodeId: string+ ): Array<EdgeRow & { to_name: string; to_summary: string }> {+ return this.db+ .prepare(+ `+ SELECT e.*, n.name as to_name, n.summary as to_summary+ FROM edges e+ JOIN nodes n ON e.to_id = n.id+ WHERE e.from_id = ? AND n.removed_at IS NULL+ `+ )+ .all(nodeId) as Array<EdgeRow & { to_name: string; to_summary: string }>;+ }++ getIncomingEdges(+ nodeId: string+ ): Array<EdgeRow & { from_name: string; from_summary: string }> {+ return this.db+ .prepare(+ `+ SELECT e.*, n.name as from_name, n.summary as from_summary+ FROM edges e+ JOIN nodes n ON e.from_id = n.id+ WHERE e.to_id = ? AND n.removed_at IS NULL+ `+ )+ .all(nodeId) as Array<+ EdgeRow & { from_name: string; from_summary: string }+ >;+ }++ getParent(parentId: string): NodeRow | undefined {+ return this.db+ .prepare("SELECT * FROM nodes WHERE id = ? AND removed_at IS NULL")+ .get(parentId) as NodeRow | undefined;+ }++ getRootNodes(): NodeRow[] {+ return this.db+ .prepare(+ "SELECT * FROM nodes WHERE parent_id IS NULL AND removed_at IS NULL ORDER BY name"+ )+ .all() as NodeRow[];+ }++ getAllActiveNodesWithEmbeddings(): Array<+ Pick<NodeRow, "id" | "name" | "kind" | "summary" | "embedding">+ > {+ return this.db+ .prepare(+ "SELECT id, name, kind, summary, embedding FROM nodes WHERE removed_at IS NULL AND embedding IS NOT NULL"+ )+ .all() as Array<+ Pick<NodeRow, "id" | "name" | "kind" | "summary" | "embedding">+ >;+ }++ nodeExists(id: string): boolean {+ const row = this.db+ .prepare(+ "SELECT 1 FROM nodes WHERE id = ? AND removed_at IS NULL"+ )+ .get(id);+ return row !== undefined;+ }++ // ---- Web API query methods ----++ getAllActiveNodes(): Array<Omit<NodeRow, "embedding">> {+ return this.db+ .prepare(+ `SELECT id, name, kind, summary, why, file_refs, parent_id,+ created_by_task, created_at, updated_at, removed_at, removed_reason+ FROM nodes WHERE removed_at IS NULL ORDER BY name`+ )+ .all() as Array<Omit<NodeRow, "embedding">>;+ }++ getAllEdges(): EdgeRow[] {+ return this.db+ .prepare(+ `SELECT e.*+ FROM edges e+ JOIN nodes n1 ON e.from_id = n1.id+ JOIN nodes n2 ON e.to_id = n2.id+ WHERE n1.removed_at IS NULL AND n2.removed_at IS NULL`+ )+ .all() as EdgeRow[];+ }++ getKindsBreakdown(): Record<string, number> {+ const rows = this.db+ .prepare(+ "SELECT kind, COUNT(*) as count FROM nodes WHERE removed_at IS NULL GROUP BY kind"+ )+ .all() as Array<{ kind: string; count: number }>;+ const result: Record<string, number> = {};+ for (const row of rows) {+ result[row.kind] = row.count;+ }+ return result;+ }++ getStats(): { nodes: number; edges: number; removed: number } {+ const nodes = (+ this.db+ .prepare("SELECT COUNT(*) as count FROM nodes WHERE removed_at IS NULL")+ .get() as { count: number }+ ).count;+ const edges = (+ this.db.prepare("SELECT COUNT(*) as count FROM edges").get() as {+ count: number;+ }+ ).count;+ const removed = (+ this.db+ .prepare(+ "SELECT COUNT(*) as count FROM nodes WHERE removed_at IS NOT NULL"+ )+ .get() as { count: number }+ ).count;+ return { nodes, edges, removed };+ }++ close(): void {+ this.db.close();+ }+}diff --git a/src/embeddings.ts b/src/embeddings.tsnew file mode 100644index 0000000..fc52ab4--- /dev/null+++ b/src/embeddings.ts@@ -0,0 +1,104 @@+import { pipeline, type FeatureExtractionPipeline } from "@xenova/transformers";++const MODEL_NAME = "Xenova/all-MiniLM-L6-v2";+const EMBEDDING_DIM = 384;++let extractor: FeatureExtractionPipeline | null = null;++/**+ * Initialize the embedding model. Called lazily on first use.+ */+async function getExtractor(): Promise<FeatureExtractionPipeline> {+ if (!extractor) {+ extractor = await pipeline("feature-extraction", MODEL_NAME, {+ quantized: true,+ });+ }+ return extractor;+}++/**+ * Generate an embedding vector for the given text.+ * Returns a Buffer containing float32 values.+ */+export async function embed(text: string): Promise<Buffer> {+ const ext = await getExtractor();+ const output = await ext(text, { pooling: "mean", normalize: true });+ const data = output.data as Float32Array;+ return Buffer.from(data.buffer, data.byteOffset, data.byteLength);+}++/**+ * Generate embedding text from node fields.+ * Combines name, kind, and summary for richer semantic representation.+ */+export function embeddingText(+ name: string,+ kind: string,+ summary: string+): string {+ return `${kind}: ${name} — ${summary}`;+}++/**+ * Compute cosine similarity between two embedding buffers.+ * Both buffers must contain float32 arrays of the same length.+ */+export function cosineSimilarity(a: Buffer, b: Buffer): number {+ const vecA = new Float32Array(+ a.buffer,+ a.byteOffset,+ a.byteLength / Float32Array.BYTES_PER_ELEMENT+ );+ const vecB = new Float32Array(+ b.buffer,+ b.byteOffset,+ b.byteLength / Float32Array.BYTES_PER_ELEMENT+ );++ if (vecA.length !== vecB.length) {+ throw new Error(+ `Embedding dimension mismatch: ${vecA.length} vs ${vecB.length}`+ );+ }++ let dot = 0;+ let normA = 0;+ let normB = 0;+ for (let i = 0; i < vecA.length; i++) {+ dot += vecA[i] * vecB[i];+ normA += vecA[i] * vecA[i];+ normB += vecB[i] * vecB[i];+ }++ const denom = Math.sqrt(normA) * Math.sqrt(normB);+ if (denom === 0) return 0;+ return dot / denom;+}++/**+ * Find the top-K most similar nodes from a list of candidates.+ */+export function findTopK(+ queryEmbedding: Buffer,+ candidates: Array<{+ id: string;+ name: string;+ kind: string;+ summary: string;+ embedding: Buffer | null;+ }>,+ topK: number+): Array<{ id: string; similarity: number }> {+ const scored = candidates+ .filter((c) => c.embedding !== null)+ .map((c) => ({+ id: c.id,+ similarity: cosineSimilarity(queryEmbedding, c.embedding!),+ }))+ .sort((a, b) => b.similarity - a.similarity);++ return scored.slice(0, topK);+}++export { EMBEDDING_DIM };diff --git a/src/index.ts b/src/index.tsnew file mode 100644index 0000000..b7dd3ed--- /dev/null+++ b/src/index.ts@@ -0,0 +1,256 @@+#!/usr/bin/env node++import { readFileSync } from "fs";+import { dirname, resolve } from "path";+import { fileURLToPath } from "url";++// ---- CLI routing ----++const VERSION = JSON.parse(+ readFileSync(+ resolve(dirname(fileURLToPath(import.meta.url)), "..", "package.json"),+ "utf-8"+ )+).version;++const HELP = `+megamemory v${VERSION} — persistent project knowledge graph for coding agents++Commands:+ (no command) Start the MCP stdio server (invoked by opencode)+ init Configure opencode integration+ serve Start the web graph explorer++Options:+ --port PORT Port for the web explorer (default: 4321)+ --help, -h Show this help+ --version, -v Show version++Examples:+ megamemory init Setup opencode config, plugins, and commands+ megamemory serve Open graph explorer at http://localhost:4321+ megamemory serve --port 8080 Custom port+`.trim();++function parseFlags(args: string[]): { port?: number } {+ const portIdx = args.indexOf("--port");+ const port =+ portIdx !== -1 && args[portIdx + 1]+ ? parseInt(args[portIdx + 1], 10)+ : undefined;+ return { port };+}++const cmd = process.argv[2];++switch (cmd) {+ case "init": {+ const { runInit } = await import("./init.js");+ await runInit();+ process.exit(0);+ break;+ }++ case "serve": {+ const flags = parseFlags(process.argv.slice(3));+ const { runServe } = await import("./web.js");+ runServe(flags.port ?? 4321);+ break;+ }++ case "--help":+ case "-h":+ console.log(HELP);+ process.exit(0);+ break;++ case "--version":+ case "-v":+ console.log(VERSION);+ process.exit(0);+ break;++ default:+ // No command or unknown → start MCP server+ await startMcpServer();+ break;+}++// ---- MCP Server ----++async function startMcpServer() {+ const { McpServer } = await import(+ "@modelcontextprotocol/sdk/server/mcp.js"+ );+ const { StdioServerTransport } = await import(+ "@modelcontextprotocol/sdk/server/stdio.js"+ );+ const { z } = await import("zod");+ const path = await import("path");+ const { KnowledgeDB } = await import("./db.js");+ const { understand, createConcept, updateConcept, link, removeConcept, listRoots } =+ await import("./tools.js");++ type NodeKind = import("./types.js").NodeKind;+ type RelationType = import("./types.js").RelationType;++ // ---- Configuration ----+ const DB_PATH =+ process.env.MEGAMEMORY_DB_PATH ??+ path.join(process.cwd(), ".megamemory", "knowledge.db");++ const db = new KnowledgeDB(DB_PATH);++ const server = new McpServer({+ name: "megamemory",+ version: VERSION,+ });++ // ---- Zod schemas ----+ const NodeKindEnum = z.enum([+ "feature", "module", "pattern", "config", "decision", "component",+ ]);+ const RelationEnum = z.enum([+ "connects_to", "depends_on", "implements", "calls", "configured_by",+ ]);++ // ---- Register tools ----++ server.tool(+ "understand",+ "Query the project knowledge graph. Call this before starting any task to load relevant context about concepts, features, and architecture. Returns matched concepts with their children, edges, and parent context.",+ {+ query: z.string().describe("Natural language query describing what you want to understand about the project"),+ top_k: z.number().int().min(1).max(50).optional().describe("Number of top results to return (default: 10)"),+ },+ async (params) => {+ try {+ const result = await understand(db, { query: params.query, top_k: params.top_k });+ return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ server.tool(+ "create_concept",+ "Add a new concept to the knowledge graph. Call this after completing a task to record new features, components, patterns, or decisions you built. Include specific details: parameter names, defaults, file locations, and rationale.",+ {+ name: z.string().describe("Human-readable name for the concept"),+ kind: NodeKindEnum.describe("Type of concept: feature, module, pattern, config, decision, component"),+ summary: z.string().describe("What this concept is. Be specific: include parameter names, defaults, file paths, behavior details."),+ why: z.string().optional().describe("Why this exists or was built this way"),+ parent_id: z.string().optional().describe("Parent concept ID for nesting"),+ file_refs: z.array(z.string()).optional().describe("Relevant file paths + optional line ranges"),+ edges: z.array(z.object({+ to: z.string().describe("Target concept ID"),+ relation: RelationEnum.describe("Relationship type"),+ description: z.string().optional().describe("Why this relationship exists"),+ })).optional().describe("Relationships to other existing concepts"),+ created_by_task: z.string().optional().describe("Description of the task that created this concept"),+ },+ async (params) => {+ try {+ const result = await createConcept(db, {+ name: params.name,+ kind: params.kind as NodeKind,+ summary: params.summary,+ why: params.why,+ parent_id: params.parent_id,+ file_refs: params.file_refs,+ edges: params.edges?.map((e) => ({ ...e, relation: e.relation as RelationType })),+ created_by_task: params.created_by_task,+ });+ return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ server.tool(+ "update_concept",+ "Update an existing concept in the knowledge graph. Call this after completing a task that changed existing features or components. Only include fields that changed.",+ {+ id: z.string().describe("The concept ID to update"),+ changes: z.object({+ name: z.string().optional().describe("New name"),+ kind: NodeKindEnum.optional().describe("New kind"),+ summary: z.string().optional().describe("Updated summary"),+ why: z.string().optional().describe("Updated rationale"),+ file_refs: z.array(z.string()).optional().describe("Updated file references"),+ }),+ },+ async (params) => {+ try {+ const result = await updateConcept(db, {+ id: params.id,+ changes: { ...params.changes, kind: params.changes.kind as NodeKind | undefined },+ });+ return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ server.tool(+ "link",+ "Create a relationship between two existing concepts.",+ {+ from: z.string().describe("Source concept ID"),+ to: z.string().describe("Target concept ID"),+ relation: RelationEnum.describe("Relationship type"),+ description: z.string().optional().describe("Why this relationship exists"),+ },+ async (params) => {+ try {+ const result = link(db, {+ from: params.from, to: params.to,+ relation: params.relation as RelationType,+ description: params.description,+ });+ return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ server.tool(+ "remove_concept",+ "Soft-delete a concept from the knowledge graph. The concept and its removal reason are preserved in history.",+ {+ id: z.string().describe("The concept ID to remove"),+ reason: z.string().describe("Why this concept is being removed"),+ },+ async (params) => {+ try {+ const result = removeConcept(db, { id: params.id, reason: params.reason });+ return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ server.tool(+ "list_roots",+ "List all top-level concepts in the knowledge graph with their direct children. Call this at the start of a session to get a high-level project overview.",+ {},+ async () => {+ try {+ const result = listRoots(db);+ return { content: [{ type: "text" as const, text: JSON.stringify({ ...result, stats: db.getStats() }, null, 2) }] };+ } catch (err) {+ return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true };+ }+ }+ );++ // ---- Start ----+ const transport = new StdioServerTransport();+ await server.connect(transport);+ console.error(`megamemory MCP server started (db: ${DB_PATH})`);+}diff --git a/src/init.ts b/src/init.tsnew file mode 100644index 0000000..c6b84cd--- /dev/null+++ b/src/init.ts@@ -0,0 +1,235 @@+import fs from "fs";+import path from "path";++// ---- Paths ----++const OPENCODE_CONFIG_DIR = path.join(+ process.env.XDG_CONFIG_HOME ?? path.join(process.env.HOME ?? "~", ".config"),+ "opencode"+);+const OPENCODE_CONFIG_PATH = path.join(OPENCODE_CONFIG_DIR, "opencode.json");+const OPENCODE_AGENTS_MD_PATH = path.join(OPENCODE_CONFIG_DIR, "AGENTS.md");+const OPENCODE_TOOL_DIR = path.join(OPENCODE_CONFIG_DIR, "tool");+const OPENCODE_COMMANDS_DIR = path.join(OPENCODE_CONFIG_DIR, "commands");++// ---- AGENTS.md snippet ----++const AGENTS_MD_MARKER = "## Project Knowledge Graph";++const AGENTS_MD_SNIPPET = `+## Project Knowledge Graph++You have access to a project knowledge graph via the \`megamemory\` MCP server and skill tool. This is your persistent memory of the codebase — concepts, architecture, decisions, and how things connect. You write it. You read it. The graph is your memory across sessions.++**Workflow: understand → work → update**++1. **Session start:** Call \`megamemory\` tool with action \`overview\` (or \`megamemory:list_roots\` directly) to orient yourself.+2. **Before each task:** Call \`megamemory\` tool with action \`query\` (or \`megamemory:understand\` directly) to load relevant context.+3. **After each task:** Call \`megamemory\` tool with action \`record\` to create/update/link concepts for what you built.++Be specific in summaries: include parameter names, defaults, file locations, and rationale. Keep concepts max 3 levels deep.+`;++// ---- Helpers ----++function log(msg: string): void {+ console.log(` ${msg}`);+}++/**+ * Resolve absolute path to the MCP server entry point (dist/index.js).+ */+function resolveServerEntryPoint(): string {+ const thisDir = path.dirname(new URL(import.meta.url).pathname);++ // Running from dist/ → sibling index.js+ const fromDist = path.resolve(thisDir, "index.js");+ if (fs.existsSync(fromDist)) return fromDist;++ // Running from src/ via tsx → look in ../dist/+ const fromSrc = path.resolve(thisDir, "..", "dist", "index.js");+ if (fs.existsSync(fromSrc)) return fromSrc;++ // Fallback: assume dist/ relative to package root+ const fromRoot = path.resolve(thisDir, "..", "dist", "index.js");+ return fromRoot;+}++/**+ * Resolve absolute path to the plugin/megamemory.ts skill file.+ */+function resolvePluginSource(): string {+ const thisDir = path.dirname(new URL(import.meta.url).pathname);+ return path.resolve(thisDir, "..", "plugin", "megamemory.ts");+}++/**+ * Resolve absolute path to the commands/bootstrap-memory.md file.+ */+function resolveCommandSource(): string {+ const thisDir = path.dirname(new URL(import.meta.url).pathname);+ return path.resolve(thisDir, "..", "commands", "bootstrap-memory.md");+}++// ---- Setup steps ----++async function setupMcpConfig(): Promise<void> {+ if (!fs.existsSync(OPENCODE_CONFIG_DIR)) {+ fs.mkdirSync(OPENCODE_CONFIG_DIR, { recursive: true });+ }++ // Read existing config or start fresh+ let config: Record<string, unknown> = {};+ if (fs.existsSync(OPENCODE_CONFIG_PATH)) {+ try {+ config = JSON.parse(fs.readFileSync(OPENCODE_CONFIG_PATH, "utf-8"));+ } catch {+ const backup = `${OPENCODE_CONFIG_PATH}.bak`;+ fs.copyFileSync(OPENCODE_CONFIG_PATH, backup);+ log(`Backed up malformed config to ${backup}`);+ config = {};+ }+ }++ if (!config["$schema"]) {+ config["$schema"] = "https://opencode.ai/config.json";+ }++ // Detect if `megamemory` is globally available (npm link / npm install -g)+ // If so, use the short command. Otherwise fall back to absolute path.+ const { execSync } = await import("child_process");+ let isGlobal = false;+ try {+ execSync("which megamemory", { stdio: "ignore" });+ isGlobal = true;+ } catch {+ isGlobal = false;+ }++ const command: string[] = isGlobal+ ? ["megamemory"]+ : ["node", resolveServerEntryPoint()];++ // Merge megamemory into mcp key — preserve everything else+ const mcp = (config["mcp"] as Record<string, unknown>) ?? {};+ const existed = "megamemory" in mcp;++ mcp["megamemory"] = {+ type: "local",+ command,+ enabled: true,+ };+ config["mcp"] = mcp;++ fs.writeFileSync(+ OPENCODE_CONFIG_PATH,+ JSON.stringify(config, null, 2) + "\n"+ );++ log(+ existed+ ? `Updated megamemory MCP in ${OPENCODE_CONFIG_PATH}`+ : `Added megamemory MCP to ${OPENCODE_CONFIG_PATH}`+ );+ log(` Command: ${JSON.stringify(command)}`);+}++function setupAgentsMd(): void {+ // Check if snippet already exists+ if (fs.existsSync(OPENCODE_AGENTS_MD_PATH)) {+ const content = fs.readFileSync(OPENCODE_AGENTS_MD_PATH, "utf-8");+ if (content.includes(AGENTS_MD_MARKER)) {+ log(`Already contains knowledge graph instructions — skipped`);+ return;+ }+ // Append to existing+ fs.appendFileSync(OPENCODE_AGENTS_MD_PATH, "\n" + AGENTS_MD_SNIPPET.trimStart());+ log(`Appended knowledge graph instructions to ${OPENCODE_AGENTS_MD_PATH}`);+ } else {+ fs.writeFileSync(OPENCODE_AGENTS_MD_PATH, AGENTS_MD_SNIPPET.trimStart());+ log(`Created ${OPENCODE_AGENTS_MD_PATH}`);+ }+}++function setupToolPlugin(): void {+ const source = resolvePluginSource();+ const dest = path.join(OPENCODE_TOOL_DIR, "megamemory.ts");++ if (!fs.existsSync(source)) {+ log(`Plugin source not found at ${source} — skipped`);+ return;+ }++ if (!fs.existsSync(OPENCODE_TOOL_DIR)) {+ fs.mkdirSync(OPENCODE_TOOL_DIR, { recursive: true });+ }++ const sourceContent = fs.readFileSync(source, "utf-8");++ // Check if already installed and identical+ if (fs.existsSync(dest)) {+ const existing = fs.readFileSync(dest, "utf-8");+ if (existing === sourceContent) {+ log(`Tool plugin already up to date — skipped`);+ return;+ }+ // Update+ fs.writeFileSync(dest, sourceContent);+ log(`Updated tool plugin at ${dest}`);+ } else {+ fs.writeFileSync(dest, sourceContent);+ log(`Installed tool plugin at ${dest}`);+ }+}++function setupBootstrapCommand(): void {+ const source = resolveCommandSource();+ const dest = path.join(OPENCODE_COMMANDS_DIR, "bootstrap-memory.md");++ if (!fs.existsSync(source)) {+ log(`Command source not found at ${source} — skipped`);+ return;+ }++ if (!fs.existsSync(OPENCODE_COMMANDS_DIR)) {+ fs.mkdirSync(OPENCODE_COMMANDS_DIR, { recursive: true });+ }++ const sourceContent = fs.readFileSync(source, "utf-8");++ if (fs.existsSync(dest)) {+ const existing = fs.readFileSync(dest, "utf-8");+ if (existing === sourceContent) {+ log(`Bootstrap command already up to date — skipped`);+ return;+ }+ fs.writeFileSync(dest, sourceContent);+ log(`Updated bootstrap command at ${dest}`);+ } else {+ fs.writeFileSync(dest, sourceContent);+ log(`Installed bootstrap command at ${dest}`);+ }+}++// ---- Entry point ----++export async function runInit(): Promise<void> {+ console.log("\nmegamemory init\n");++ console.log("1. MCP server config:");+ await setupMcpConfig();++ console.log("\n2. Global AGENTS.md:");+ setupAgentsMd();++ console.log("\n3. Skill tool plugin:");+ setupToolPlugin();++ console.log("\n4. Bootstrap command:");+ setupBootstrapCommand();++ console.log(+ "\nDone. Restart opencode to pick up changes." ++ "\nRun /user:bootstrap-memory in any project to populate its knowledge graph.\n"+ );+}diff --git a/src/tools.ts b/src/tools.tsnew file mode 100644index 0000000..5c15f5d--- /dev/null+++ b/src/tools.ts@@ -0,0 +1,282 @@+import { KnowledgeDB } from "./db.js";+import { embed, embeddingText, findTopK } from "./embeddings.js";+import type {+ UnderstandInput,+ CreateConceptInput,+ UpdateConceptInput,+ LinkInput,+ RemoveConceptInput,+ NodeWithContext,+ UnderstandOutput,+ ListRootsOutput,+ NodeRow,+ RelationType,+} from "./types.js";++/**+ * Generate a slug ID from a name, optionally prefixed with parent ID.+ * Converts underscores and spaces to hyphens, lowercases, strips non-alphanumeric.+ */+function makeId(name: string, parentId?: string): string {+ const normalized = name+ .toLowerCase()+ .replace(/[_\s]+/g, "-") // underscores/spaces → hyphens+ .replace(/[^a-z0-9-]/g, "") // strip everything else+ .replace(/-+/g, "-") // collapse multiple hyphens+ .replace(/^-|-$/g, ""); // trim leading/trailing hyphens+ return parentId ? `${parentId}/${normalized}` : normalized;+}++/**+ * Parse file_refs from JSON string to array.+ */+function parseFileRefs(raw: string | null): string[] | null {+ if (!raw) return null;+ try {+ return JSON.parse(raw);+ } catch {+ return null;+ }+}++/**+ * Build a NodeWithContext from a node row and DB lookups.+ */+export function buildNodeWithContext(+ db: KnowledgeDB,+ node: NodeRow,+ similarity?: number+): NodeWithContext {+ const children = db.getChildren(node.id).map((c) => ({+ id: c.id,+ name: c.name,+ kind: c.kind as NodeWithContext["kind"],+ summary: c.summary,+ }));++ const outgoing = db.getOutgoingEdges(node.id).map((e) => ({+ to: e.to_id,+ to_name: e.to_name,+ relation: e.relation as RelationType,+ description: e.description,+ }));++ const incoming = db.getIncomingEdges(node.id).map((e) => ({+ from: e.from_id,+ from_name: e.from_name,+ relation: e.relation as RelationType,+ description: e.description,+ }));++ let parent: { id: string; name: string } | null = null;+ if (node.parent_id) {+ const p = db.getParent(node.parent_id);+ if (p) {+ parent = { id: p.id, name: p.name };+ }+ }++ return {+ id: node.id,+ name: node.name,+ kind: node.kind as NodeWithContext["kind"],+ summary: node.summary,+ why: node.why,+ file_refs: parseFileRefs(node.file_refs),+ children,+ edges: outgoing,+ incoming_edges: incoming,+ parent,+ ...(similarity !== undefined ? { similarity } : {}),+ };+}++// ---- Tool handlers ----++export async function understand(+ db: KnowledgeDB,+ input: UnderstandInput+): Promise<UnderstandOutput> {+ const topK = input.top_k ?? 10;++ // Embed the query+ const queryEmbedding = await embed(input.query);++ // Get all active nodes with embeddings+ const candidates = db.getAllActiveNodesWithEmbeddings();++ if (candidates.length === 0) {+ return { matches: [] };+ }++ // Find top-K by cosine similarity+ const topMatches = findTopK(queryEmbedding, candidates, topK);++ // Build full context for each match+ const matches: NodeWithContext[] = [];+ for (const match of topMatches) {+ const node = db.getNode(match.id);+ if (!node) continue;+ matches.push(buildNodeWithContext(db, node, match.similarity));+ }++ return { matches };+}++export async function createConcept(+ db: KnowledgeDB,+ input: CreateConceptInput+): Promise<{ id: string; message: string }> {+ const id = makeId(input.name, input.parent_id);++ // Check if node already exists+ if (db.nodeExists(id)) {+ throw new Error(`Concept "${id}" already exists. Use update_concept to modify it.`);+ }++ // Validate parent exists if specified+ if (input.parent_id && !db.nodeExists(input.parent_id)) {+ throw new Error(`Parent concept "${input.parent_id}" does not exist.`);+ }++ // Generate embedding+ const text = embeddingText(input.name, input.kind, input.summary);+ const embedding = await embed(text);++ // Insert node+ db.insertNode({+ id,+ name: input.name,+ kind: input.kind,+ summary: input.summary,+ why: input.why,+ file_refs: input.file_refs,+ parent_id: input.parent_id,+ created_by_task: input.created_by_task,+ embedding,+ });++ // Create edges if specified+ if (input.edges) {+ for (const edge of input.edges) {+ // Only create edge if target exists+ if (db.nodeExists(edge.to)) {+ db.insertEdge({+ from_id: id,+ to_id: edge.to,+ relation: edge.relation,+ description: edge.description,+ });+ }+ }+ }++ return { id, message: `Created concept "${id}"` };+}++export async function updateConcept(+ db: KnowledgeDB,+ input: UpdateConceptInput+): Promise<{ message: string }> {+ // Verify node exists+ const existing = db.getNode(input.id);+ if (!existing) {+ throw new Error(`Concept "${input.id}" not found.`);+ }++ // If summary or name changed, regenerate embedding+ let embedding: Buffer | undefined;+ if (input.changes.summary !== undefined || input.changes.name !== undefined) {+ const name = input.changes.name ?? existing.name;+ const kind = input.changes.kind ?? existing.kind;+ const summary = input.changes.summary ?? existing.summary;+ const text = embeddingText(name, kind, summary);+ embedding = await embed(text);+ }++ const updated = db.updateNode(input.id, {+ ...input.changes,+ embedding,+ });++ if (!updated) {+ return { message: `No changes applied to "${input.id}"` };+ }++ return { message: `Updated concept "${input.id}"` };+}++export function link(+ db: KnowledgeDB,+ input: LinkInput+): { message: string } {+ // Validate both nodes exist+ if (!db.nodeExists(input.from)) {+ throw new Error(`Source concept "${input.from}" not found.`);+ }+ if (!db.nodeExists(input.to)) {+ throw new Error(`Target concept "${input.to}" not found.`);+ }++ const edgeId = db.insertEdge({+ from_id: input.from,+ to_id: input.to,+ relation: input.relation,+ description: input.description,+ });++ return {+ message: `Created ${input.relation} link from "${input.from}" to "${input.to}" (edge #${edgeId})`,+ };+}++export function removeConcept(+ db: KnowledgeDB,+ input: RemoveConceptInput+): { message: string } {+ const existing = db.getNodeIncludingRemoved(input.id);+ if (!existing) {+ throw new Error(`Concept "${input.id}" not found.`);+ }+ if (existing.removed_at) {+ throw new Error(`Concept "${input.id}" was already removed.`);+ }++ const removed = db.softDeleteNode(input.id, input.reason);+ if (!removed) {+ throw new Error(`Failed to remove concept "${input.id}".`);+ }++ return {+ message: `Removed concept "${input.id}". Reason: ${input.reason}`,+ };+}++export function listRoots(db: KnowledgeDB): ListRootsOutput & { hint?: string } {+ const rootRows = db.getRootNodes();++ const roots = rootRows.map((root) => {+ const children = db.getChildren(root.id).map((c) => ({+ id: c.id,+ name: c.name,+ kind: c.kind as NodeWithContext["kind"],+ summary: c.summary,+ }));++ return {+ id: root.id,+ name: root.name,+ kind: root.kind as NodeWithContext["kind"],+ summary: root.summary,+ children,+ };+ });++ const stats = db.getStats();+ const hint =+ stats.nodes === 0+ ? "Graph is empty. Run /user:bootstrap-memory to populate, or create concepts as you work."+ : undefined;++ return { roots, ...(hint ? { hint } : {}) };+}diff --git a/src/types.ts b/src/types.tsnew file mode 100644index 0000000..d0d79cf--- /dev/null+++ b/src/types.ts@@ -0,0 +1,162 @@+// ---- Data model types ----++export interface Node {+ id: string;+ name: string;+ kind: NodeKind;+ summary: string;+ why: string | null;+ file_refs: string[] | null;+ parent_id: string | null;+ created_by_task: string | null;+ created_at: string;+ updated_at: string;+ removed_at: string | null;+ removed_reason: string | null;+}++export type NodeKind =+ | "feature"+ | "module"+ | "pattern"+ | "config"+ | "decision"+ | "component";++export interface Edge {+ id: number;+ from_id: string;+ to_id: string;+ relation: RelationType;+ description: string | null;+ created_at: string;+}++export type RelationType =+ | "connects_to"+ | "depends_on"+ | "implements"+ | "calls"+ | "configured_by";++// ---- Tool input types ----++export interface UnderstandInput {+ query: string;+ top_k?: number; // default 10+}++export interface CreateConceptInput {+ name: string;+ kind: NodeKind;+ summary: string;+ why?: string;+ parent_id?: string;+ file_refs?: string[];+ edges?: Array<{+ to: string;+ relation: RelationType;+ description?: string;+ }>;+ created_by_task?: string;+}++export interface UpdateConceptInput {+ id: string;+ changes: {+ name?: string;+ kind?: NodeKind;+ summary?: string;+ why?: string;+ file_refs?: string[];+ };+}++export interface LinkInput {+ from: string;+ to: string;+ relation: RelationType;+ description?: string;+}++export interface RemoveConceptInput {+ id: string;+ reason: string;+}++// ---- Tool output types ----++export interface NodeWithContext {+ id: string;+ name: string;+ kind: NodeKind;+ summary: string;+ why: string | null;+ file_refs: string[] | null;+ children: Array<{+ id: string;+ name: string;+ kind: NodeKind;+ summary: string;+ }>;+ edges: Array<{+ to: string;+ to_name: string;+ relation: RelationType;+ description: string | null;+ }>;+ incoming_edges: Array<{+ from: string;+ from_name: string;+ relation: RelationType;+ description: string | null;+ }>;+ parent: { id: string; name: string } | null;+ similarity?: number;+}++export interface UnderstandOutput {+ matches: NodeWithContext[];+}++export interface ListRootsOutput {+ roots: Array<{+ id: string;+ name: string;+ kind: NodeKind;+ summary: string;+ children: Array<{+ id: string;+ name: string;+ kind: NodeKind;+ summary: string;+ }>;+ }>;+}++// ---- DB row types (raw from SQLite) ----++export interface NodeRow {+ id: string;+ name: string;+ kind: string;+ summary: string;+ why: string | null;+ file_refs: string | null; // JSON string+ parent_id: string | null;+ created_by_task: string | null;+ created_at: string;+ updated_at: string;+ removed_at: string | null;+ removed_reason: string | null;+ embedding: Buffer | null;+}++export interface EdgeRow {+ id: number;+ from_id: string;+ to_id: string;+ relation: string;+ description: string | null;+ created_at: string;+}diff --git a/src/web.ts b/src/web.tsnew file mode 100644index 0000000..53a025c--- /dev/null+++ b/src/web.ts@@ -0,0 +1,155 @@+import http from "http";+import fs from "fs";+import path from "path";+import { KnowledgeDB } from "./db.js";+import { buildNodeWithContext } from "./tools.js";+import type { NodeRow } from "./types.js";++function resolveHtmlPath(): string {+ const thisDir = path.dirname(new URL(import.meta.url).pathname);+ // From dist/ → ../web/index.html+ const fromDist = path.resolve(thisDir, "..", "web", "index.html");+ if (fs.existsSync(fromDist)) return fromDist;+ // From src/ → ../web/index.html+ return path.resolve(thisDir, "..", "web", "index.html");+}++function json(res: http.ServerResponse, data: unknown, status = 200): void {+ res.writeHead(status, {+ "Content-Type": "application/json",+ "Access-Control-Allow-Origin": "*",+ });+ res.end(JSON.stringify(data));+}++function html(res: http.ServerResponse, content: string): void {+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });+ res.end(content);+}++function notFound(res: http.ServerResponse): void {+ res.writeHead(404, { "Content-Type": "text/plain" });+ res.end("Not found");+}++function parseFileRefs(raw: string | null): string[] | null {+ if (!raw) return null;+ try {+ return JSON.parse(raw);+ } catch {+ return null;+ }+}++export function runServe(port: number): void {+ const dbPath =+ process.env.MEGAMEMORY_DB_PATH ??+ path.join(process.cwd(), ".megamemory", "knowledge.db");++ if (!fs.existsSync(dbPath)) {+ console.error(+ `No database found at ${dbPath}\n` ++ `Run megamemory in a project that has been used with the MCP server, or set MEGAMEMORY_DB_PATH.`+ );+ process.exit(1);+ }++ const db = new KnowledgeDB(dbPath);+ const htmlPath = resolveHtmlPath();++ if (!fs.existsSync(htmlPath)) {+ console.error(`HTML file not found at ${htmlPath}`);+ process.exit(1);+ }++ const htmlContent = fs.readFileSync(htmlPath, "utf-8");++ const server = http.createServer((req, res) => {+ const url = new URL(req.url ?? "/", `http://localhost:${port}`);+ const pathname = url.pathname;++ // ---- Routes ----++ if (pathname === "/" && req.method === "GET") {+ html(res, htmlContent);+ return;+ }++ if (pathname === "/api/graph" && req.method === "GET") {+ const nodes = db.getAllActiveNodes().map((n) => ({+ id: n.id,+ name: n.name,+ kind: n.kind,+ summary: n.summary,+ parent_id: n.parent_id,+ edge_count: 0, // filled below+ }));++ const edges = db.getAllEdges().map((e) => ({+ from: e.from_id,+ to: e.to_id,+ relation: e.relation,+ description: e.description,+ }));++ // Count edges per node+ const edgeCounts = new Map<string, number>();+ for (const e of edges) {+ edgeCounts.set(e.from, (edgeCounts.get(e.from) ?? 0) + 1);+ edgeCounts.set(e.to, (edgeCounts.get(e.to) ?? 0) + 1);+ }+ for (const n of nodes) {+ n.edge_count = edgeCounts.get(n.id) ?? 0;+ }++ json(res, { nodes, edges });+ return;+ }++ if (pathname.startsWith("/api/node/") && req.method === "GET") {+ const id = decodeURIComponent(pathname.slice("/api/node/".length));+ const node = db.getNode(id);+ if (!node) {+ json(res, { error: `Concept "${id}" not found` }, 404);+ return;+ }+ const ctx = buildNodeWithContext(db, node);+ // Add timestamps+ const result = {+ ...ctx,+ created_at: node.created_at,+ updated_at: node.updated_at,+ created_by_task: node.created_by_task,+ };+ json(res, result);+ return;+ }++ if (pathname === "/api/stats" && req.method === "GET") {+ const stats = db.getStats();+ const kinds = db.getKindsBreakdown();+ json(res, { ...stats, kinds });+ return;+ }++ notFound(res);+ });++ server.listen(port, () => {+ console.log(`megamemory explorer running at http://localhost:${port}`);+ console.log(`Database: ${dbPath}`);+ console.log(`Press Ctrl+C to stop.\n`);+ });++ // Graceful shutdown+ process.on("SIGINT", () => {+ server.close();+ db.close();+ process.exit(0);+ });+ process.on("SIGTERM", () => {+ server.close();+ db.close();+ process.exit(0);+ });+}diff --git a/tsconfig.json b/tsconfig.jsonnew file mode 100644index 0000000..cc487cc--- /dev/null+++ b/tsconfig.json@@ -0,0 +1,19 @@+{+ "compilerOptions": {+ "target": "ES2022",+ "module": "Node16",+ "moduleResolution": "Node16",+ "outDir": "dist",+ "rootDir": "src",+ "strict": true,+ "esModuleInterop": true,+ "skipLibCheck": true,+ "forceConsistentCasingInFileNames": true,+ "resolveJsonModule": true,+ "declaration": true,+ "declarationMap": true,+ "sourceMap": true+ },+ "include": ["src/**/*"],+ "exclude": ["node_modules", "dist"]+}diff --git a/web/index.html b/web/index.htmlnew file mode 100644index 0000000..8b6b4a8--- /dev/null+++ b/web/index.html@@ -0,0 +1,684 @@+<!DOCTYPE html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>megamemory explorer</title>+<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.30.4/cytoscape.min.js"></script>+<style>+ * { margin: 0; padding: 0; box-sizing: border-box; }++ :root {+ --bg: #0f1117;+ --surface: #1a1d27;+ --surface2: #222639;+ --border: #2d3348;+ --text: #e2e8f0;+ --text-dim: #8892a8;+ --text-muted: #555e75;+ --accent: #3b82f6;+ }++ body {+ font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;+ background: var(--bg);+ color: var(--text);+ height: 100vh;+ display: flex;+ flex-direction: column;+ overflow: hidden;+ }++ header {+ display: flex;+ align-items: center;+ gap: 12px;+ padding: 10px 16px;+ background: var(--surface);+ border-bottom: 1px solid var(--border);+ z-index: 10;+ }++ header .logo {+ font-size: 14px;+ font-weight: 700;+ color: var(--text-dim);+ letter-spacing: 0.5px;+ white-space: nowrap;+ }++ #search {+ flex: 1;+ max-width: 400px;+ padding: 6px 12px;+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 6px;+ color: var(--text);+ font-family: inherit;+ font-size: 13px;+ outline: none;+ }++ #search:focus { border-color: var(--accent); }+ #search::placeholder { color: var(--text-muted); }++ main {+ flex: 1;+ display: flex;+ overflow: hidden;+ position: relative;+ }++ #graph { flex: 1; background: var(--bg); }++ /* ---- Panel ---- */+ #panel {+ width: 380px;+ background: var(--surface);+ border-left: 1px solid var(--border);+ overflow-y: auto;+ padding: 20px;+ display: none;+ flex-shrink: 0;+ }++ #panel.open { display: block; }++ #panel-close {+ float: right;+ background: none;+ border: none;+ color: var(--text-dim);+ font-size: 18px;+ cursor: pointer;+ padding: 2px 8px;+ border-radius: 4px;+ margin: -4px -4px 0 0;+ }++ #panel-close:hover { background: var(--surface2); color: var(--text); }++ .panel-name {+ font-size: 16px;+ font-weight: 700;+ margin-bottom: 6px;+ line-height: 1.3;+ }++ .kind-badge {+ display: inline-block;+ padding: 2px 8px;+ border-radius: 4px;+ font-size: 10px;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.5px;+ margin-bottom: 14px;+ }++ .panel-section { margin-bottom: 14px; }++ .panel-label {+ font-size: 10px;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.5px;+ color: var(--text-muted);+ margin-bottom: 4px;+ }++ .panel-body {+ font-size: 13px;+ line-height: 1.5;+ color: var(--text-dim);+ }++ .file-ref {+ display: block;+ padding: 1px 0;+ color: var(--accent);+ font-size: 12px;+ word-break: break-all;+ }++ .link-row {+ display: block;+ padding: 5px 0;+ font-size: 12px;+ cursor: pointer;+ color: var(--text-dim);+ border-bottom: 1px solid var(--border);+ }++ .link-row:last-child { border-bottom: none; }+ .link-row:hover { color: var(--text); }++ .link-row .rel {+ display: inline-block;+ padding: 1px 5px;+ background: var(--surface2);+ border-radius: 3px;+ font-size: 10px;+ color: var(--text-muted);+ margin-right: 4px;+ }++ .link-row .name { color: var(--accent); }++ .link-row .desc {+ display: block;+ font-size: 11px;+ color: var(--text-muted);+ margin-top: 2px;+ padding-left: 2px;+ }++ .child-link {+ display: inline-block;+ margin: 2px 6px 2px 0;+ padding: 2px 8px;+ background: var(--surface2);+ border-radius: 4px;+ font-size: 12px;+ cursor: pointer;+ color: var(--accent);+ }++ .child-link:hover { background: var(--border); }++ .meta { font-size: 11px; color: var(--text-muted); line-height: 1.6; }++ /* ---- Footer ---- */+ footer {+ display: flex;+ align-items: center;+ gap: 16px;+ padding: 6px 16px;+ background: var(--surface);+ border-top: 1px solid var(--border);+ font-size: 12px;+ color: var(--text-muted);+ z-index: 10;+ }++ footer .stat { white-space: nowrap; }++ footer .dot {+ display: inline-block;+ width: 8px;+ height: 8px;+ border-radius: 50%;+ margin-right: 4px;+ vertical-align: middle;+ }++ /* ---- Empty state ---- */+ #empty-state {+ position: absolute;+ top: 50%;+ left: 50%;+ transform: translate(-50%, -50%);+ text-align: center;+ color: var(--text-muted);+ display: none;+ }++ #empty-state.visible { display: block; }+ #empty-state h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }+ #empty-state p { font-size: 13px; }+</style>+</head>+<body>++<header>+ <span class="logo">megamemory</span>+ <input id="search" type="text" placeholder="Search concepts..." />+</header>++<main>+ <div id="graph"></div>+ <div id="empty-state">+ <h2>Graph is empty</h2>+ <p>Run <code>/user:bootstrap-memory</code> in opencode to populate,<br/>or create concepts as you work.</p>+ </div>+ <aside id="panel">+ <div id="panel-content"></div>+ </aside>+</main>++<footer id="stats"></footer>++<script>+const KIND_COLORS = {+ feature: '#3b82f6',+ module: '#22c55e',+ pattern: '#a855f7',+ config: '#f59e0b',+ decision: '#ef4444',+ component: '#14b8a6',+};++let cy = null;++// ---- API ----++async function fetchGraph() { return (await fetch('/api/graph')).json(); }+async function fetchNode(id) { return (await fetch('/api/node/' + id)).json(); }+async function fetchStats() { return (await fetch('/api/stats')).json(); }++// ---- Stats footer ----++function renderStats(stats) {+ const el = document.getElementById('stats');+ const parts = [+ `<span class="stat">nodes: ${stats.nodes}</span>`,+ `<span class="stat">edges: ${stats.edges}</span>`,+ ];+ if (stats.kinds) {+ for (const [kind, count] of Object.entries(stats.kinds)) {+ const c = KIND_COLORS[kind] || '#888';+ parts.push(`<span class="stat"><span class="dot" style="background:${c}"></span>${kind}: ${count}</span>`);+ }+ }+ el.innerHTML = parts.join('');+}++// ---- Build elements (flat layout — no compound nodes) ----++function buildElements(data) {+ const elements = [];++ for (const n of data.nodes) {+ elements.push({+ group: 'nodes',+ data: {+ id: n.id,+ name: n.name,+ kind: n.kind,+ summary: n.summary,+ parent_id: n.parent_id,+ edge_count: n.edge_count,+ // Short display name: strip parent prefix for children+ label: n.parent_id ? n.name : n.name,+ },+ });+ }++ // Explicit edges from the graph+ for (const e of data.edges) {+ elements.push({+ group: 'edges',+ data: {+ id: `e-${e.from}-${e.to}-${e.relation}`,+ source: e.from,+ target: e.to,+ relation: e.relation,+ description: e.description || '',+ isParentEdge: false,+ },+ });+ }++ // Parent→child edges (dashed, to show hierarchy without compound nodes)+ for (const n of data.nodes) {+ if (n.parent_id && data.nodes.some(p => p.id === n.parent_id)) {+ elements.push({+ group: 'edges',+ data: {+ id: `parent-${n.parent_id}-${n.id}`,+ source: n.parent_id,+ target: n.id,+ relation: 'child',+ description: '',+ isParentEdge: true,+ },+ });+ }+ }++ return elements;+}++// ---- Cytoscape styles ----++const STYLE = [+ // Regular nodes (leaf / no children)+ {+ selector: 'node',+ style: {+ 'label': 'data(label)',+ 'text-valign': 'bottom',+ 'text-halign': 'center',+ 'text-margin-y': 6,+ 'font-size': '10px',+ 'font-family': '"SF Mono", "Cascadia Code", "Fira Code", monospace',+ 'color': '#8892a8',+ 'text-outline-color': '#0f1117',+ 'text-outline-width': 1.5,+ 'background-color': function(ele) {+ return KIND_COLORS[ele.data('kind')] || '#888';+ },+ 'width': function(ele) {+ const ec = ele.data('edge_count') || 0;+ return Math.max(20, 20 + ec * 3);+ },+ 'height': function(ele) {+ const ec = ele.data('edge_count') || 0;+ return Math.max(20, 20 + ec * 3);+ },+ 'shape': 'ellipse',+ 'border-width': 0,+ 'overlay-padding': 6,+ 'cursor': 'pointer',+ },+ },+ // Nodes that have children get a ring outline+ {+ selector: 'node[?_hasChildren]',+ style: {+ 'border-width': 2,+ 'border-color': function(ele) {+ const c = KIND_COLORS[ele.data('kind')] || '#888';+ return c;+ },+ 'border-opacity': 0.4,+ 'background-opacity': 0.8,+ },+ },+ // Explicit relationship edges+ {+ selector: 'edge[!isParentEdge]',+ style: {+ 'width': 1.5,+ 'line-color': '#3d4460',+ 'target-arrow-color': '#3d4460',+ 'target-arrow-shape': 'triangle',+ 'arrow-scale': 0.7,+ 'curve-style': 'bezier',+ 'label': 'data(relation)',+ 'font-size': '8px',+ 'color': '#555e75',+ 'text-rotation': 'autorotate',+ 'text-margin-y': -8,+ 'text-outline-color': '#0f1117',+ 'text-outline-width': 1,+ },+ },+ // Parent→child edges (dashed, subtle)+ {+ selector: 'edge[?isParentEdge]',+ style: {+ 'width': 1,+ 'line-color': '#2a2e42',+ 'line-style': 'dashed',+ 'line-dash-pattern': [4, 4],+ 'target-arrow-shape': 'none',+ 'curve-style': 'bezier',+ 'label': '',+ },+ },+ // Selected+ {+ selector: 'node:selected',+ style: {+ 'border-width': 2,+ 'border-color': '#ffffff',+ 'border-opacity': 1,+ },+ },+ // Hover+ {+ selector: 'node:active',+ style: {+ 'overlay-color': '#ffffff',+ 'overlay-opacity': 0.1,+ },+ },+ // Dimmed (search)+ {+ selector: 'node.dimmed',+ style: { 'opacity': 0.12 },+ },+ {+ selector: 'edge.dimmed',+ style: { 'opacity': 0.05 },+ },+ // Highlighted (search match)+ {+ selector: 'node.highlighted',+ style: {+ 'border-width': 2,+ 'border-color': '#f59e0b',+ 'border-opacity': 1,+ 'color': '#e2e8f0',+ },+ },+];++// ---- Init graph ----++function initCytoscape(elements, data) {+ // Mark nodes that have children+ const childParentIds = new Set(data.nodes.filter(n => n.parent_id).map(n => n.parent_id));+ for (const el of elements) {+ if (el.group === 'nodes' && childParentIds.has(el.data.id)) {+ el.data._hasChildren = true;+ }+ }++ cy = cytoscape({+ container: document.getElementById('graph'),+ elements: elements,+ style: STYLE,+ layout: {+ name: 'cose',+ animate: true,+ animationDuration: 600,+ nodeRepulsion: function() { return 60000; },+ idealEdgeLength: function(edge) {+ // Parent-child edges shorter to keep them close+ return edge.data('isParentEdge') ? 80 : 180;+ },+ edgeElasticity: function(edge) {+ return edge.data('isParentEdge') ? 200 : 100;+ },+ gravity: 0.08,+ padding: 60,+ nodeDimensionsIncludeLabels: true,+ randomize: false,+ numIter: 2000,+ },+ minZoom: 0.15,+ maxZoom: 5,+ wheelSensitivity: 0.3,+ });++ // Click node → panel+ cy.on('tap', 'node', async function(evt) {+ const node = evt.target;+ const id = node.id();+ cy.$(':selected').unselect();+ node.select();+ try {+ const detail = await fetchNode(id);+ if (!detail.error) showPanel(detail);+ else console.error('fetchNode error:', detail.error);+ } catch (err) {+ console.error('Failed to fetch node:', id, err);+ }+ });++ // Click background → close panel+ cy.on('tap', function(evt) {+ if (evt.target === cy) closePanel();+ });+}++// ---- Detail panel ----++function showPanel(d) {+ const panel = document.getElementById('panel');+ const content = document.getElementById('panel-content');+ const color = KIND_COLORS[d.kind] || '#888';++ let h = '';++ // Header+ h += `<button id="panel-close" onclick="closePanel()">×</button>`;+ h += `<div class="panel-name">${esc(d.name)}</div>`;+ h += `<span class="kind-badge" style="background:${color}22;color:${color};border:1px solid ${color}44">${d.kind}</span>`;++ // Parent breadcrumb+ if (d.parent) {+ h += `<div style="margin-bottom:12px">`;+ h += `<span class="link-row" style="border:0;padding:0" onclick="navigateTo('${esc(d.parent.id)}')">`;+ h += `<span class="rel">parent</span> <span class="name">${esc(d.parent.name)}</span>`;+ h += `</span></div>`;+ }++ // Summary+ h += `<div class="panel-section"><div class="panel-label">Summary</div>`;+ h += `<div class="panel-body">${esc(d.summary)}</div></div>`;++ // Why+ if (d.why) {+ h += `<div class="panel-section"><div class="panel-label">Why</div>`;+ h += `<div class="panel-body">${esc(d.why)}</div></div>`;+ }++ // Files+ if (d.file_refs && d.file_refs.length) {+ h += `<div class="panel-section"><div class="panel-label">Files</div><div class="panel-body">`;+ h += d.file_refs.map(f => `<span class="file-ref">${esc(f)}</span>`).join('');+ h += `</div></div>`;+ }++ // Children+ if (d.children && d.children.length) {+ h += `<div class="panel-section"><div class="panel-label">Children</div><div class="panel-body">`;+ h += d.children.map(c =>+ `<span class="child-link" onclick="navigateTo('${esc(c.id)}')">${esc(c.name)}</span>`+ ).join('');+ h += `</div></div>`;+ }++ // Outgoing edges+ if (d.edges && d.edges.length) {+ h += `<div class="panel-section"><div class="panel-label">Outgoing</div><div class="panel-body">`;+ h += d.edges.map(e =>+ `<span class="link-row" onclick="navigateTo('${esc(e.to)}')">` ++ `<span class="rel">${e.relation}</span> <span class="name">${esc(e.to_name)}</span>` ++ (e.description ? `<span class="desc">${esc(e.description)}</span>` : '') ++ `</span>`+ ).join('');+ h += `</div></div>`;+ }++ // Incoming edges+ if (d.incoming_edges && d.incoming_edges.length) {+ h += `<div class="panel-section"><div class="panel-label">Incoming</div><div class="panel-body">`;+ h += d.incoming_edges.map(e =>+ `<span class="link-row" onclick="navigateTo('${esc(e.from)}')">` ++ `<span class="rel">${e.relation}</span> <span class="name">${esc(e.from_name)}</span>` ++ (e.description ? `<span class="desc">${esc(e.description)}</span>` : '') ++ `</span>`+ ).join('');+ h += `</div></div>`;+ }++ // Metadata+ if (d.created_at || d.created_by_task) {+ h += `<div class="panel-section"><div class="panel-label">Metadata</div><div class="meta">`;+ if (d.created_by_task) h += `task: ${esc(d.created_by_task)}<br/>`;+ if (d.created_at) h += `created: ${d.created_at}<br/>`;+ if (d.updated_at) h += `updated: ${d.updated_at}`;+ h += `</div></div>`;+ }++ content.innerHTML = h;+ panel.classList.add('open');+}++function closePanel() {+ document.getElementById('panel').classList.remove('open');+ if (cy) cy.$(':selected').unselect();+}++function navigateTo(id) {+ if (!cy) return;+ const node = cy.getElementById(id);+ if (node.length === 0) return;++ cy.$(':selected').unselect();+ node.select();++ cy.animate({+ center: { eles: node },+ zoom: 2.5,+ }, { duration: 300 });++ fetchNode(id).then(d => { if (!d.error) showPanel(d); });+}++// ---- Search ----++function setupSearch() {+ const input = document.getElementById('search');+ let timer = null;++ input.addEventListener('input', () => {+ clearTimeout(timer);+ timer = setTimeout(() => {+ const q = input.value.trim().toLowerCase();+ if (!cy) return;++ if (!q) {+ cy.elements().removeClass('dimmed highlighted');+ return;+ }++ cy.batch(() => {+ cy.elements().addClass('dimmed');+ cy.nodes().forEach(node => {+ const name = (node.data('name') || '').toLowerCase();+ const summary = (node.data('summary') || '').toLowerCase();+ const kind = (node.data('kind') || '').toLowerCase();+ if (name.includes(q) || summary.includes(q) || kind.includes(q)) {+ node.removeClass('dimmed').addClass('highlighted');+ node.connectedEdges().removeClass('dimmed');+ node.neighborhood('node').removeClass('dimmed');+ }+ });+ });+ }, 150);+ });+}++// ---- Util ----++function esc(s) {+ if (!s) return '';+ return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');+}++// ---- Init ----++async function init() {+ const [graphData, stats] = await Promise.all([fetchGraph(), fetchStats()]);+ renderStats(stats);++ if (graphData.nodes.length === 0) {+ document.getElementById('empty-state').classList.add('visible');+ return;+ }++ const elements = buildElements(graphData);+ initCytoscape(elements, graphData);+ setupSearch();+}++init();+</script>+</body>+</html>