From 81edb530fd53642b65c7744b456aa25606887fdc Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 11:39:37 -0400 Subject: [PATCH 1/7] [4] Public catalog MCP surface for agent assembly Add a thin Streamable HTTP MCP server on pegma-dev-api at /api/mcp that reads the published composition catalog. Tools list/get components and recipes plus rule-based plan_composition; skill page and llms.txt carry the config snippet. Catalog remains the system of record. --- docs/AGENT_ASSEMBLY_PLAN.md | 39 +- package-lock.json | 2536 ++++++++++++++++++++++++-- package.json | 5 +- public/llms.txt | 7 + public/skill.md | 33 +- src/data/mcp-tools.test.ts | 113 ++ src/data/mcp-tools.ts | 415 +++++ src/layouts/Base.astro | 1 + src/pages/skill.astro | 29 +- worker/.dev.vars.example | 3 + worker/README.md | 4 +- worker/src/index.ts | 27 +- worker/src/mcp-catalog-fetch.test.ts | 88 + worker/src/mcp-catalog-fetch.ts | 96 + worker/src/mcp-server.ts | 224 +++ worker/tsconfig.json | 7 +- 16 files changed, 3483 insertions(+), 144 deletions(-) create mode 100644 src/data/mcp-tools.test.ts create mode 100644 src/data/mcp-tools.ts create mode 100644 worker/src/mcp-catalog-fetch.test.ts create mode 100644 worker/src/mcp-catalog-fetch.ts create mode 100644 worker/src/mcp-server.ts diff --git a/docs/AGENT_ASSEMBLY_PLAN.md b/docs/AGENT_ASSEMBLY_PLAN.md index b864e3d..27d4735 100644 --- a/docs/AGENT_ASSEMBLY_PLAN.md +++ b/docs/AGENT_ASSEMBLY_PLAN.md @@ -2,12 +2,14 @@ ## Status -**Stage:** Phase 3 complete (hosted assembly skill). No MCP surface yet. +**Stage:** Phase 4 complete (public catalog MCP). Phase 5 (scaffold + eval) +remains open. + This document is the working plan for closing the gap between what AI coding agents tend to do (regenerate common backend functions as bespoke code) and what the Pegma stack already packages (typed, tested, pin-able components). -**Phase 0–3 artifacts:** +**Phase 0–4 artifacts:** | Artifact | Path | | --- | --- | @@ -22,6 +24,8 @@ what the Pegma stack already packages (typed, tested, pin-able components). | P2 fixture (Yard Loan outbox) | `recipes/storage-audit-mail-outbox/` | | Hosted assembly skill (raw) | `https://pegma.dev/skill.md` (`public/skill.md`) | | Skill install notes | `https://pegma.dev/skill` (`src/pages/skill.astro`) | +| Catalog tool logic | `src/data/mcp-tools.ts` | +| MCP Worker surface | `worker/src/mcp-server.ts` → `https://pegma.dev/api/mcp` | **Goal:** An agent given a short product description chooses the right `@pegma/*` packages, respects their refusals, and wires them at an explicit @@ -313,16 +317,32 @@ The skill teaches judgment only; versions and package sets stay in **Exit:** a human can add the Pegma skill to a major coding agent in one sitting; the skill does not hardcode package versions. -### Phase 4 — MCP surface (optional but planned) +### Phase 4 — MCP surface ✓ + +Implement a thin MCP server over the published catalog. Hosted on the +existing `pegma-dev-api` Worker at `/api/mcp` (stateless Streamable HTTP via +`createMcpHandler`). Tools: list/get components, list/get recipes, +`plan_composition`. Same progressive-disclosure limits as above. Catalog is +fetched from the static `catalog.json` URL — MCP is never the system of +record. -Implement a thin MCP server over the published catalog (likely on the -existing Workers API or a sibling Worker). Tools: list/get components, -list/get recipes, plan_composition. Same progressive-disclosure limits as -above. +Shipped: + +| Surface | Path / URL | +| --- | --- | +| Tool logic (pure) | `src/data/mcp-tools.ts` | +| Catalog fetch + cache | `worker/src/mcp-catalog-fetch.ts` | +| MCP server factory | `worker/src/mcp-server.ts` | +| Endpoint | `https://pegma.dev/api/mcp` | +| Config snippet | `public/skill.md`, `/skill` | **Exit:** MCP config snippet on pegma.dev; tools return catalog facts only; no private data plane. +**Done:** public MCP tools over catalog.json; install/config on skill page +and `llms.txt`; `plan_composition` is rule-based over structured +`capabilityTags`. + ### Phase 5 — Scaffold and eval harness Public synthetic starter template with pinned known-good versions and an @@ -398,8 +418,9 @@ Phase 0 recommendations (not irreversible) are recorded in **structured `capabilityTags`** (see schema). - **Skill packaging:** single canonical markdown vs. thin per-tool wrappers that only differ in install paths. (Phase 3) -- **MCP hosting:** extend `pegma-dev-api` vs. separate Worker to keep the - account API’s privilege surface small. (Phase 4) +- **MCP hosting:** ~~extend `pegma-dev-api` vs. separate Worker~~ → + **extend `pegma-dev-api` at `/api/mcp`** (stateless, public catalog only; + no new secrets or private data plane). ## Implementation note diff --git a/package-lock.json b/package-lock.json index e388b0b..c1d30e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "pegma.dev", "version": "0.1.0", "dependencies": { + "@modelcontextprotocol/server": "^2.0.0", "@pegma/audit": "0.1.0", "@pegma/authorization-core": "0.1.2", "@pegma/authorization-identity": "0.1.2", @@ -26,7 +27,9 @@ "@pegma/support-desk-contracts": "0.1.0", "@pegma/support-desk-core": "0.1.0", "@pegma/support-desk-templates": "0.1.0", - "@pegma/webhooks": "file:vendor/@pegma/webhooks/pegma-webhooks-0.0.0.tgz" + "@pegma/webhooks": "file:vendor/@pegma/webhooks/pegma-webhooks-0.0.0.tgz", + "agents": "^0.20.1", + "zod": "^4.4.3" }, "devDependencies": { "@astrojs/check": "0.9.10", @@ -415,6 +418,443 @@ "yaml": "^2.8.3" } }, + "node_modules/@babel/code-frame": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.0.tgz", + "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^8.0.0", + "js-tokens": "^10.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/code-frame/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-8.0.0.tgz", + "integrity": "sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/core": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.1.tgz", + "integrity": "sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^8.0.0", + "@babel/generator": "^8.0.0", + "@babel/helper-compilation-targets": "^8.0.0", + "@babel/helpers": "^8.0.0", + "@babel/parser": "^8.0.0", + "@babel/template": "^8.0.0", + "@babel/traverse": "^8.0.0", + "@babel/types": "^8.0.0", + "@types/gensync": "^1.0.5", + "convert-source-map": "^2.0.0", + "empathic": "^2.0.1", + "gensync": "^1.0.0-beta.2", + "import-meta-resolve": "^4.2.0", + "json5": "^2.2.3", + "obug": "^2.1.1", + "semver": "^7.7.3" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/parser": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz", + "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/types": "^8.0.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.0.tgz", + "integrity": "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^8.0.0", + "@babel/types": "^8.0.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "@types/jsesc": "^2.5.0", + "jsesc": "^3.0.2" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/parser": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz", + "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-8.0.0.tgz", + "integrity": "sha512-NSpMkMsvvZqzThJ0p1B02cbtA2ObEyfBvq950bmNkyxsxvcxwhvvCB036rKhlEnuBBo30bOrk13u3FzlKSoRrw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-8.0.0.tgz", + "integrity": "sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^8.0.0", + "@babel/helper-validator-option": "^8.0.0", + "browserslist": "^4.24.0", + "lru-cache": "^11.0.0", + "semver": "^7.7.3" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-8.0.1.tgz", + "integrity": "sha512-++t3ZktzlLmASAxIlxeXQK9Z2YwUafYGYcvGBFevqOqt16HozVHStUoQvWD09fzAZOb/uJGpUTBuGK41AJAuOA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^8.0.0", + "@babel/helper-member-expression-to-functions": "^8.0.0", + "@babel/helper-optimise-call-expression": "^8.0.0", + "@babel/helper-replace-supers": "^8.0.1", + "@babel/helper-skip-transparent-expression-wrappers": "^8.0.0", + "@babel/traverse": "^8.0.0", + "semver": "^7.7.3" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "peerDependencies": { + "@babel/core": "^8.0.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-8.0.0.tgz", + "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-8.0.0.tgz", + "integrity": "sha512-xkXrMbtk87Gk7+oKBVmBc6EORg/Qwx++AHESldmHkpvG8wgccdhJJFwrzqlF382Fk8wfXhJHWE/g/43QvEGNPQ==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^8.0.0", + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-8.0.0.tgz", + "integrity": "sha512-3W6satvtPuCUkUx63S2jMoW9EQNYkADgs1HTfufmL7gCmAulHMKupA/12WNz4A0GMMFn/YnWWwqOT9IZrJHQjg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-8.0.1.tgz", + "integrity": "sha512-3PKFgjTyPlhFhorfP+SjKQxLViIL++zWjFOO4hGriYU+Bsm983DxEM1JmDRJVWXV0O9npu+xXRqz7Pbd3mh70g==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "peerDependencies": { + "@babel/core": "^8.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-8.0.1.tgz", + "integrity": "sha512-B1SZADIcy3tmH8CmWvj4SHi/oAPom4UL3uknTc2QRNsPVLFk/sPnZvQL/8kj7Y5omvjMqie0vklvs6XM4OLW5Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^8.0.0", + "@babel/helper-optimise-call-expression": "^8.0.0", + "@babel/traverse": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "peerDependencies": { + "@babel/core": "^8.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-8.0.0.tgz", + "integrity": "sha512-xmCA9kP3IhySsqhzwIdWGlDN/1A4cCKNBO/uwZx/3YzmDoMePwno2Q5/Bq0q+tYaKbeF940YiKV/kaW8Mzvpjw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^8.0.0", + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", @@ -435,6 +875,64 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-validator-option": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-8.0.0.tgz", + "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helpers": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-8.0.0.tgz", + "integrity": "sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/template": "^8.0.0", + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, "node_modules/@babel/parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", @@ -451,6 +949,183 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/plugin-proposal-decorators": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-8.0.2.tgz", + "integrity": "sha512-+C6O6KKXU7BBq1GNaIkFJxrALUVGRcr+WeWm4OcuRl3h+l/CmNfcTLMrT2Lm3uvGBimBH/8pEBRrXJFLoO67Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^8.0.1", + "@babel/helper-plugin-utils": "^8.0.1", + "@babel/plugin-syntax-decorators": "^8.0.1" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "peerDependencies": { + "@babel/core": "^8.0.0" + } + }, + "node_modules/@babel/plugin-syntax-decorators": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-8.0.1.tgz", + "integrity": "sha512-NI+0S/6MvR6GlcQFwjDZ+WIc2qvG6TXN534lYs9llNldwW4b7Dh6KTtk030FA0xWdYGs4t1lWo+OEWN8wGB+Nw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^8.0.1" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "peerDependencies": { + "@babel/core": "^8.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime-corejs3": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.29.7.tgz", + "integrity": "sha512-ppj9ouYku+RX0ljtgZd+KMO5mkM2bCqg8H2PYAFWnLsHEIKIdRojqbJ2i3eVHrisuxy7nOFCmngTDdWtUCdXUQ==", + "license": "MIT", + "dependencies": { + "core-js-pure": "^3.48.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-8.0.0.tgz", + "integrity": "sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^8.0.0", + "@babel/parser": "^8.0.0", + "@babel/types": "^8.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/parser": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz", + "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/template/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/traverse": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-8.0.4.tgz", + "integrity": "sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^8.0.0", + "@babel/generator": "^8.0.0", + "@babel/helper-globals": "^8.0.0", + "@babel/parser": "^8.0.4", + "@babel/template": "^8.0.0", + "@babel/types": "^8.0.4", + "obug": "^2.1.1" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/helper-string-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/parser": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.4.tgz", + "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.4.tgz", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.4" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, "node_modules/@babel/types": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", @@ -655,6 +1330,12 @@ "node": ">=18" } }, + "node_modules/@cfworker/json-schema": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cfworker/json-schema/-/json-schema-4.1.1.tgz", + "integrity": "sha512-gAmrUZSGtKc3AiBL71iNWxDsyUC5uMaKKGdvzYsBoTW/xi42JQHl7eKV2OYzCUqvc+D2RCcf7EXY2iCyFIk6og==", + "license": "MIT" + }, "node_modules/@clack/core": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.4.3.tgz", @@ -825,6 +1506,13 @@ "node": ">=16" } }, + "node_modules/@cloudflare/workers-types": { + "version": "5.20260729.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-5.20260729.1.tgz", + "integrity": "sha512-X5r/4y0gKMq/B72qkz/tEwNK4c3v2regT3to6Ia8qqC66E0+YIN/fU7x0JG6ej2rLxtU3TV3aVhfK9y8+jMMAw==", + "license": "MIT OR Apache-2.0", + "peer": true + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -904,7 +1592,6 @@ "version": "2.0.0-alpha.3", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-alpha.3.tgz", "integrity": "sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g==", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -917,7 +1604,6 @@ "version": "2.0.0-alpha.3", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-alpha.3.tgz", "integrity": "sha512-hFPAhMUjJD9BSyCANEISPOogeXC9Zo9ZQl7L6vKnaVsMkCtzznaW/naYypeyl0Gv5rYfWYsZbpixTMpjDJzQeA==", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -929,7 +1615,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.0.1.tgz", "integrity": "sha512-9DsSk+o5NBX0CCJT8s0EROGSGxjR/tKu6aBTaVyq+SjAEQH4XcdcRxPBRzsBLizTTJ49MJjF+jgu3qnO9GLQcQ==", - "dev": true, "license": "MIT", "optional": true, "peer": true, @@ -944,7 +1629,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -961,7 +1645,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -978,7 +1661,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -995,7 +1677,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1012,7 +1693,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1029,7 +1709,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1046,7 +1725,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1063,7 +1741,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1080,7 +1757,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1097,7 +1773,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1114,7 +1789,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1131,7 +1805,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1148,7 +1821,6 @@ "cpu": [ "mips64el" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1165,7 +1837,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1182,7 +1853,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1199,7 +1869,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1216,7 +1885,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1233,7 +1901,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1250,7 +1917,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1267,7 +1933,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1284,7 +1949,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1301,7 +1965,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1318,7 +1981,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1335,7 +1997,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1352,7 +2013,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1369,7 +2029,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1385,6 +2044,19 @@ "integrity": "sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw==", "license": "MIT" }, + "node_modules/@hono/node-server": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.0.12.tgz", + "integrity": "sha512-eWpQYr67tqJLeaSUl0Q+TquuYfUdTibpOJlUMV2FfUP7+KqCC5TufnwnlXL6mobZBJbGAYRd7ZvEBDCbLInjhg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "hono": "^4" + } + }, "node_modules/@img/colour": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", @@ -2027,45 +2699,147 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@levischuck/tiny-cbor": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@levischuck/tiny-cbor/-/tiny-cbor-0.2.11.tgz", + "integrity": "sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow==", + "license": "MIT" + }, + "node_modules/@modelcontextprotocol/client": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/client/-/client-2.0.0.tgz", + "integrity": "sha512-8f1OghQ2rjzIOfqgUCP+8GiUWqRs89njoWLNqAe8kWmDePv3s1fZXseej+QXemssEuuOvLLmLO/kqM3IQHtISw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@modelcontextprotocol/core": "2.0.0", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "jose": "^6.1.3", + "pkce-challenge": "^5.0.0", + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@modelcontextprotocol/core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.0.0.tgz", + "integrity": "sha512-pJCEwGG7Lfr/+PQp9ZTwKXNeO5wzbfKL7H3MYpCorM4oFBoQrdjnBgEoqG+RjhsvS1FKrDbKux+M1HhlnGWqcA==", + "license": "MIT", + "dependencies": { + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.30.0.tgz", + "integrity": "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@hono/node-server": "^1.19.9 || ^2.0.5", + "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": ">=6.0.0" + "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/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "node_modules/@modelcontextprotocol/server": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.0.0.tgz", + "integrity": "sha512-YhHWdHfpFMQfd0prsEnxKeS3Qz3ytIGmsS0sth4KDjnacIT7hxk6hXHkJ9KysxlkvTM+WZAtQbbcUhdoP4Hvtw==", "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@modelcontextprotocol/core": "2.0.0", + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" } }, - "node_modules/@levischuck/tiny-cbor": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/@levischuck/tiny-cbor/-/tiny-cbor-0.2.11.tgz", - "integrity": "sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow==", - "license": "MIT" - }, "node_modules/@napi-rs/wasm-runtime": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.0.tgz", "integrity": "sha512-kDoONqMa+VnZ4vvvu/ZUurpJ4gkZU57e7g69qpNgWhYcZFPUHZM2CEMKm+cG6ufDVALbjMvfmMjFVqaK7uEMnA==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2094,7 +2868,6 @@ "version": "0.139.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz", "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/Boshen" @@ -2598,7 +3371,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2615,7 +3387,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2632,7 +3403,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2649,7 +3419,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2666,7 +3435,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2683,7 +3451,6 @@ "cpu": [ "arm64" ], - "dev": true, "libc": [ "glibc" ], @@ -2703,7 +3470,6 @@ "cpu": [ "arm64" ], - "dev": true, "libc": [ "musl" ], @@ -2723,7 +3489,6 @@ "cpu": [ "ppc64" ], - "dev": true, "libc": [ "glibc" ], @@ -2743,7 +3508,6 @@ "cpu": [ "s390x" ], - "dev": true, "libc": [ "glibc" ], @@ -2763,7 +3527,6 @@ "cpu": [ "x64" ], - "dev": true, "libc": [ "glibc" ], @@ -2783,7 +3546,6 @@ "cpu": [ "x64" ], - "dev": true, "libc": [ "musl" ], @@ -2803,7 +3565,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2820,7 +3581,6 @@ "cpu": [ "wasm32" ], - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2836,7 +3596,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2848,7 +3607,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2859,7 +3617,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -2873,7 +3630,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2890,7 +3646,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -2900,11 +3655,40 @@ "node": "^20.19.0 || >=22.12.0" } }, + "node_modules/@rolldown/plugin-babel": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.3.tgz", + "integrity": "sha512-+zEk16yGlz1F9STiRr6uG9hmIXb6nprjLczV/htGptYuLoCuxb+itZ03RKCEeOhBpDDd1NU7qF6x1VLMUp62bw==", + "license": "MIT", + "dependencies": { + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=22.12.0 || ^24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.29.0 || ^8.0.0-rc.1", + "@babel/plugin-transform-runtime": "^7.29.0 || ^8.0.0-rc.1", + "@babel/runtime": "^7.27.0 || ^8.0.0-rc.1", + "rolldown": "^1.0.0-rc.5", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@babel/plugin-transform-runtime": { + "optional": true + }, + "@babel/runtime": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, "node_modules/@rolldown/pluginutils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", - "dev": true, "license": "MIT" }, "node_modules/@rollup/pluginutils": { @@ -3095,7 +3879,6 @@ "version": "0.10.3", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", - "dev": true, "license": "MIT", "optional": true, "dependencies": { @@ -3137,6 +3920,13 @@ "@types/estree": "*" } }, + "node_modules/@types/gensync": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.5.tgz", + "integrity": "sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==", + "license": "MIT", + "peer": true + }, "node_modules/@types/hast": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", @@ -3147,6 +3937,12 @@ "@types/unist": "*" } }, + "node_modules/@types/jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@types/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==", + "license": "MIT" + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -3171,7 +3967,7 @@ "version": "26.1.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "undici-types": "~8.3.0" @@ -3402,11 +4198,109 @@ "dev": true, "license": "MIT" }, + "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", + "peer": true, + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agents": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/agents/-/agents-0.20.1.tgz", + "integrity": "sha512-HQRYMeZpD3k8djYBH7atRPojZMee3NvmXkzsmMWXfdHZ94vMljmWqSsD1XZd70LovHyQrw6/R81AZZIsRiFM6Q==", + "license": "MIT", + "dependencies": { + "@babel/plugin-proposal-decorators": "^8.0.2", + "@cfworker/json-schema": "^4.1.1", + "@rolldown/plugin-babel": "^0.2.3", + "cron-schedule": "^6.0.0", + "esbuild": "^0.28.1", + "mimetext": "^3.0.28", + "nanoid": "^5.1.16", + "partyserver": "^0.5.8", + "partysocket": "1.3.0", + "yaml": "^2.9.0", + "yargs": "^18.0.0" + }, + "bin": { + "agents": "dist/cli/index.js" + }, + "peerDependencies": { + "@ai-sdk/react": "^3.0.0 || ^4.0.0", + "@cloudflare/codemode": ">=0.5.0", + "@modelcontextprotocol/client": "2.0.0", + "@modelcontextprotocol/sdk": "1.30.0", + "@modelcontextprotocol/server": "2.0.0", + "@tanstack/ai": ">=0.10.2 <1.0.0", + "@x402/core": "^2.0.0", + "@x402/evm": "^2.0.0", + "ai": "^6.0.0 || ^7.0.0", + "chat": "^4.29.0", + "just-bash": "^3.0.0", + "react": "^19.0.0", + "vite": ">=6.0.0 <9.0.0", + "zod": "^4.0.0" + }, + "peerDependenciesMeta": { + "@ai-sdk/react": { + "optional": true + }, + "@cloudflare/codemode": { + "optional": true + }, + "@tanstack/ai": { + "optional": true + }, + "@x402/core": { + "optional": true + }, + "@x402/evm": { + "optional": true + }, + "ai": { + "optional": true + }, + "chat": { + "optional": true + }, + "just-bash": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/agents/node_modules/nanoid": { + "version": "5.1.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.16.tgz", + "integrity": "sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, "node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", - "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -3434,6 +4328,24 @@ } } }, + "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", + "peer": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ajv-i18n": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/ajv-i18n/-/ajv-i18n-4.2.0.tgz", @@ -3461,7 +4373,6 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -3474,7 +4385,6 @@ "version": "6.2.3", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -3688,6 +4598,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.6.tgz", + "integrity": "sha512-69D/imtToCsIcAl8WBS2YaRwA4jO/j0HhU+hELqMEu9f54MoUtI6+XH5mrKU8rEFNEk/Ui1I2MK4/JkWacclGw==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/blake3-wasm": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", @@ -3695,6 +4618,45 @@ "dev": true, "license": "MIT" }, + "node_modules/body-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "license": "MIT", + "peer": true, + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/body-parser/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -3702,6 +4664,102 @@ "dev": true, "license": "ISC" }, + "node_modules/browserslist": { + "version": "4.28.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.7.tgz", + "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.10.44", + "caniuse-lite": "^1.0.30001806", + "electron-to-chromium": "^1.5.393", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "peer": true, + "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", + "peer": true, + "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", + "peer": true, + "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/caniuse-lite": { + "version": "1.0.30001806", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", + "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -3788,7 +4846,6 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^7.2.0", @@ -3837,14 +4894,37 @@ "dev": true, "license": "BlueOak-1.0.0", "engines": { - "node": ">= 18" + "node": ">= 18" + } + }, + "node_modules/content-disposition": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "license": "MIT", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.6" } }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, "license": "MIT" }, "node_modules/cookie": { @@ -3868,6 +4948,69 @@ "dev": true, "license": "MIT" }, + "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", + "peer": true, + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/core-js-pure": { + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.49.0.tgz", + "integrity": "sha512-XM4RFka59xATyJv/cS3O3Kml72hQXUeGRuuTmMYFxwzc9/7C8OYTaIR/Ji+Yt8DXzsFLNhat15cE/JP15HrCgw==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "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", + "peer": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cron-schedule": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cron-schedule/-/cron-schedule-6.0.0.tgz", + "integrity": "sha512-BoZaseYGXOo5j5HUwTaegIog3JJbuH4BbrY9A1ArLjXpy+RWb3mV28F/9Gv1dDA7E2L8kngWva4NWisnLTyfgQ==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "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", + "peer": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/crossws": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", @@ -3958,6 +5101,24 @@ "dev": true, "license": "CC0-1.0" }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/defu": { "version": "6.1.7", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", @@ -3965,6 +5126,16 @@ "dev": true, "license": "MIT" }, + "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", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -3986,7 +5157,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "engines": { "node": ">=8" @@ -4105,6 +5276,35 @@ "node": ">=4" } }, + "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", + "peer": true, + "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", + "peer": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.398", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.398.tgz", + "integrity": "sha512-AsvhAxopJGh6museTDMIjn6JpDYOfgu4RLlygomt87MUwBUqTfd/1EiPtx10/LZE8xpTvkP2E9Gafq7lkLtodQ==", + "license": "ISC", + "peer": true + }, "node_modules/emmet": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/emmet/-/emmet-2.4.11.tgz", @@ -4126,9 +5326,28 @@ "version": "10.6.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "dev": true, "license": "MIT" }, + "node_modules/empathic": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.1.tgz", + "integrity": "sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/entities": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", @@ -4152,6 +5371,26 @@ "url": "https://github.com/sponsors/antfu" } }, + "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", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.1.tgz", @@ -4159,11 +5398,23 @@ "dev": true, "license": "MIT" }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { @@ -4205,12 +5456,18 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, + "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", + "peer": true + }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -4221,6 +5478,22 @@ "@types/estree": "^1.0.0" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-polyfill": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/event-target-polyfill/-/event-target-polyfill-0.0.4.tgz", + "integrity": "sha512-Gs6RLjzlLRdT8X9ZipJdIZI/Y6/HhRLyq9RdDlCsnpxr/+Nn6bU2EFGuC94GjxqhM+Nmij2Vcq98yoHrU8uNFQ==", + "license": "MIT" + }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", @@ -4228,6 +5501,29 @@ "dev": true, "license": "MIT" }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "peer": true, + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.0.tgz", + "integrity": "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/expect-type": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", @@ -4238,6 +5534,80 @@ "node": ">=12.0.0" } }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "peer": true, + "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.6.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.6.1.tgz", + "integrity": "sha512-0D493aP61w0TJ2A0wy27riRsO7FMQ7FK+KUHOKCSfPvYo0R55aiC6emCVgFUeShH0fq0ICPVzNcgoS+BsbXQCA==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.3", + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -4249,7 +5619,6 @@ "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==", - "dev": true, "license": "MIT" }, "node_modules/fast-string-truncated-width": { @@ -4273,7 +5642,6 @@ "version": "3.1.4", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.4.tgz", "integrity": "sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==", - "dev": true, "funding": [ { "type": "github", @@ -4300,7 +5668,7 @@ "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=12.0.0" @@ -4314,6 +5682,28 @@ } } }, + "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", + "peer": true, + "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/flattie": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", @@ -4347,11 +5737,30 @@ "node": ">=20" } }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "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, @@ -4362,11 +5771,30 @@ "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", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" @@ -4376,7 +5804,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", - "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -4385,6 +5812,45 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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", + "peer": true, + "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", + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-tsconfig": { "version": "5.0.0-beta.4", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-5.0.0-beta.4.tgz", @@ -4408,6 +5874,19 @@ "dev": true, "license": "ISC" }, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/h3": { "version": "1.15.11", "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.11.tgz", @@ -4426,6 +5905,32 @@ "uncrypto": "^0.1.3" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hast-util-from-html": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", @@ -4536,6 +6041,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hono": { + "version": "4.12.32", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.32.tgz", + "integrity": "sha512-XcuyW9qE2kJn07PkecMOBd5Vq/hMy7mmGw+idz1yblbg9N17ijJODrvPkn7/dwL3Kulj8LcRJ69DLOWf91dRUg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/html-escaper": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", @@ -4561,6 +6076,82 @@ "dev": true, "license": "BSD-2-Clause" }, + "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", + "peer": true, + "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.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "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", + "peer": true + }, + "node_modules/ip-address": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.3.1.tgz", + "integrity": "sha512-1e9d3kb97NHJTIJDZW9rKqW2h6+dFa50Dy0fpPSMQp2ADje5gvKsXmdiK6dwY5t76TaTt5+P5N1Y/LoToIxP6g==", + "license": "MIT", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/iron-webcrypto": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", @@ -4600,6 +6191,42 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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", + "peer": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC", + "peer": true + }, + "node_modules/jose": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.4.tgz", + "integrity": "sha512-N8acGzVsQy6M/fjFcxtysNc4Q379TcM5dM/qKkNtsHFji88yANnXTr7BLeP75iPnFwBfQzM/jg2BZ9+HZrHCZA==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/js-base64": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.9.2.tgz", + "integrity": "sha512-6zayE8QlUdiweYI6cETD/XBSqFcoCUlufn/29PJR99r82x1yDnIprRca0YvAYpAW+ez0GuQkVBC6xG5QkD7OjA==", + "license": "BSD-3-Clause" + }, + "node_modules/js-tokens": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz", + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "license": "MIT" + }, "node_modules/js-yaml": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", @@ -4623,13 +6250,44 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "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==", - "dev": true, "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", + "peer": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/jsonc-parser": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.3.1.tgz", @@ -4641,7 +6299,7 @@ "version": "1.33.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", - "dev": true, + "devOptional": true, "license": "MPL-2.0", "dependencies": { "detect-libc": "^2.0.3" @@ -4674,7 +6332,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4695,7 +6352,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4716,7 +6372,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4737,7 +6392,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4758,7 +6412,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4779,7 +6432,6 @@ "cpu": [ "arm64" ], - "dev": true, "libc": [ "glibc" ], @@ -4803,7 +6455,6 @@ "cpu": [ "arm64" ], - "dev": true, "libc": [ "musl" ], @@ -4827,7 +6478,6 @@ "cpu": [ "x64" ], - "dev": true, "libc": [ "glibc" ], @@ -4851,7 +6501,6 @@ "cpu": [ "x64" ], - "dev": true, "libc": [ "musl" ], @@ -4875,7 +6524,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4896,7 +6544,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MPL-2.0", "optional": true, "os": [ @@ -4914,7 +6561,6 @@ "version": "11.5.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", - "dev": true, "license": "BlueOak-1.0.0", "engines": { "node": "20 || >=22" @@ -4942,6 +6588,16 @@ "source-map-js": "^1.2.1" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdast-util-to-hast": { "version": "13.2.1", "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", @@ -4971,6 +6627,33 @@ "dev": true, "license": "CC0-1.0" }, + "node_modules/media-typer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/micromark-util-character": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", @@ -5065,6 +6748,70 @@ ], "license": "MIT" }, + "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", + "peer": true, + "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", + "peer": true, + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mimetext": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/mimetext/-/mimetext-3.0.28.tgz", + "integrity": "sha512-eQXpbNrtxLCjUtiVbR/qR09dbPgZ2o+KR1uA7QKqGhbn8QV7HIL16mXXsobBL4/8TqoYh1us31kfz+dNfCev9g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.0", + "@babel/runtime-corejs3": "^7.26.0", + "js-base64": "^3.7.7", + "mime-types": "^2.1.35" + }, + "funding": { + "type": "patreon", + "url": "https://patreon.com/muratgozel" + } + }, + "node_modules/mimetext/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimetext/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/miniflare": { "version": "4.20260722.0", "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260722.0.tgz", @@ -5649,6 +7396,13 @@ "node": ">=10" } }, + "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", + "peer": true + }, "node_modules/muggle-string": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", @@ -5660,7 +7414,7 @@ "version": "3.3.16", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", - "dev": true, + "devOptional": true, "funding": [ { "type": "github", @@ -5675,6 +7429,16 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/neotraverse": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-1.0.1.tgz", @@ -5713,6 +7477,16 @@ "dev": true, "license": "MIT" }, + "node_modules/node-releases": { + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -5736,11 +7510,33 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "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", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/obug": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz", "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==", - "dev": true, "funding": [ "https://github.com/sponsors/sxzz", "https://opencollective.com/debug" @@ -5769,6 +7565,29 @@ "dev": true, "license": "MIT" }, + "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", + "peer": true, + "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", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/oniguruma-parser": { "version": "0.12.2", "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", @@ -5854,6 +7673,63 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/partyserver": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/partyserver/-/partyserver-0.5.9.tgz", + "integrity": "sha512-0T1OGQD9Ggllrlp8Bt8XLOglEEktH4bui28Z1dbSGEX/iFmZnEWR148Qmvc1Od3rl64OAOfVtr2sG4XOMI9Y6Q==", + "license": "ISC", + "dependencies": { + "nanoid": "^5.1.9" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^4.20260424.1 || ^5.20260703.1" + } + }, + "node_modules/partyserver/node_modules/nanoid": { + "version": "5.1.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.16.tgz", + "integrity": "sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/partysocket": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/partysocket/-/partysocket-1.3.0.tgz", + "integrity": "sha512-1zToNyolZFK/7nuAw/K2bZrNzFqaZyRoCEkS+9vG6WSC5ikrN6qWRe96q6ImU51uptz2r+dAwSkwhJVdQi4LiA==", + "license": "MIT", + "dependencies": { + "event-target-polyfill": "^0.0.4" + }, + "peerDependencies": { + "react": ">=17" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -5861,6 +7737,16 @@ "dev": true, "license": "MIT" }, + "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", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-to-regexp": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", @@ -5886,27 +7772,35 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", - "dev": true, "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "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", + "peer": true, + "engines": { + "node": ">=16.20.0" } }, "node_modules/postcss": { "version": "8.5.23", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.23.tgz", "integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==", - "dev": true, + "devOptional": true, "funding": [ { "type": "opencollective", @@ -5978,6 +7872,20 @@ "url": "https://github.com/sponsors/wooorm" } }, + "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", + "peer": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -6005,6 +7913,23 @@ "node": ">=16.0.0" } }, + "node_modules/qs": { + "version": "6.15.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", + "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/radix3": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", @@ -6012,6 +7937,46 @@ "dev": true, "license": "MIT" }, + "node_modules/range-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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", + "peer": true, + "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/react": { + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", + "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/readdirp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", @@ -6070,7 +8035,6 @@ "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==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6106,7 +8070,6 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz", "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", - "dev": true, "license": "MIT", "dependencies": { "@oxc-project/types": "=0.139.0", @@ -6136,6 +8099,41 @@ "@rolldown/binding-win32-x64-msvc": "1.1.5" } }, + "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", + "peer": true, + "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/router/node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "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", + "peer": true + }, "node_modules/satteri": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/satteri/-/satteri-0.9.5.tgz", @@ -6174,7 +8172,6 @@ "version": "7.8.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -6183,6 +8180,60 @@ "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", + "peer": true, + "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", + "peer": true, + "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", + "peer": true + }, "node_modules/sharp": { "version": "0.35.3", "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz", @@ -6274,6 +8325,29 @@ "url": "https://opencollective.com/libvips" } }, + "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", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/shiki": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.1.tgz", @@ -6294,6 +8368,82 @@ "node": ">=20" } }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "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.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "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", + "peer": true, + "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", + "peer": true, + "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/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -6325,7 +8475,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -6349,6 +8499,16 @@ "dev": true, "license": "MIT" }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/std-env": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", @@ -6360,7 +8520,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^10.3.0", @@ -6393,7 +8552,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.2.2" @@ -6482,7 +8640,7 @@ "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", @@ -6505,6 +8663,16 @@ "node": ">=14.0.0" } }, + "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", + "peer": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/tr46": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", @@ -6563,6 +8731,39 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "license": "0BSD" }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "peer": true, + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/typesafe-path": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/typesafe-path/-/typesafe-path-0.2.2.tgz", @@ -6629,7 +8830,7 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/unenv": { @@ -6762,6 +8963,16 @@ "node": ">= 0.4.0" } }, + "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", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/unstorage": { "version": "1.17.5", "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.17.5.tgz", @@ -6859,6 +9070,47 @@ } } }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "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", + "peer": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", @@ -6908,7 +9160,7 @@ "version": "8.1.5", "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.5.tgz", "integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "lightningcss": "^1.32.0", @@ -7393,6 +9645,22 @@ "url": "https://github.com/sponsors/wooorm" } }, + "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", + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -7471,7 +9739,6 @@ "version": "9.0.2", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", @@ -7485,6 +9752,13 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "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", + "peer": true + }, "node_modules/ws": { "version": "8.21.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", @@ -7518,7 +9792,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "license": "ISC", "engines": { "node": ">=10" @@ -7528,7 +9801,6 @@ "version": "2.9.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", - "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -7591,7 +9863,6 @@ "version": "18.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.1.0.tgz", "integrity": "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==", - "dev": true, "license": "MIT", "dependencies": { "cliui": "^9.0.1", @@ -7609,7 +9880,6 @@ "version": "22.0.0", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", - "dev": true, "license": "ISC", "engines": { "node": "^20.19.0 || ^22.12.0 || >=23" @@ -7619,7 +9889,6 @@ "version": "8.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", - "dev": true, "license": "MIT", "dependencies": { "get-east-asian-width": "^1.5.0", @@ -7674,12 +9943,21 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peer": true, + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } + }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", diff --git a/package.json b/package.json index 5e9dc38..6b91daf 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "worker:types": "wrangler types worker/worker-configuration.d.ts -c worker/wrangler.jsonc" }, "dependencies": { + "@modelcontextprotocol/server": "^2.0.0", "@pegma/audit": "0.1.0", "@pegma/authorization-core": "0.1.2", "@pegma/authorization-identity": "0.1.2", @@ -35,7 +36,9 @@ "@pegma/support-desk-contracts": "0.1.0", "@pegma/support-desk-core": "0.1.0", "@pegma/support-desk-templates": "0.1.0", - "@pegma/webhooks": "file:vendor/@pegma/webhooks/pegma-webhooks-0.0.0.tgz" + "@pegma/webhooks": "file:vendor/@pegma/webhooks/pegma-webhooks-0.0.0.tgz", + "agents": "^0.20.1", + "zod": "^4.4.3" }, "devDependencies": { "@astrojs/check": "0.9.10", diff --git a/public/llms.txt b/public/llms.txt index 42f3a22..78c402d 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -90,6 +90,13 @@ status, design decisions, and non-goals. package versions; re-fetch the catalog. Install notes: [https://pegma.dev/skill](https://pegma.dev/skill). +## Composition MCP (agents) + +- [MCP endpoint](https://pegma.dev/api/mcp): Streamable HTTP MCP over the same + catalog. Tools: `list_components`, `get_component`, `list_recipes`, + `get_recipe`, `plan_composition`. Public catalog facts only; no private data + plane; no auth for reads. Config notes: https://pegma.dev/skill + ## Site - [The stack](https://pegma.dev/stack): every component — owns, refuses, diff --git a/public/skill.md b/public/skill.md index db83e22..a5707e8 100644 --- a/public/skill.md +++ b/public/skill.md @@ -71,7 +71,38 @@ decision: Index (short): `https://pegma.dev/llms.txt` Human stack pages: `https://pegma.dev/stack` Recipe index: `https://pegma.dev/examples` -This skill (judgment only): `https://pegma.dev/skill.md` +This skill (judgment only): `https://pegma.dev/skill.md` +Optional MCP (same catalog facts): `https://pegma.dev/api/mcp` + +### Optional MCP transport + +When the agent supports remote MCP (Streamable HTTP), point it at the public +catalog server. Tools return catalog facts only — no private data plane and +no authentication for reads: + +| Tool | Returns | +| --- | --- | +| `list_components` | id, summary, status, packages | +| `get_component` | owns, refuses, deps, adapters, versions, links | +| `list_recipes` | id, intent, package set, fixture status | +| `get_recipe` | full recipe + fixture citation | +| `plan_composition` | deterministic recommendation from `capabilityTags` + host | + +Config snippet (remote URL; adapt to your client’s MCP schema): + +```json +{ + "mcpServers": { + "pegma": { + "url": "https://pegma.dev/api/mcp" + } + } +} +``` + +Some clients still need a local proxy (`npx mcp-remote https://pegma.dev/api/mcp`). +The MCP is never the system of record — re-fetch or call tools rather than +caching package versions in this skill. ## How to assemble diff --git a/src/data/mcp-tools.test.ts b/src/data/mcp-tools.test.ts new file mode 100644 index 0000000..471e461 --- /dev/null +++ b/src/data/mcp-tools.test.ts @@ -0,0 +1,113 @@ +import { readFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { describe, expect, it } from 'vitest'; +import type { CompositionCatalog } from './catalog-schema'; +import { + getComponent, + getRecipe, + listComponents, + listRecipes, + planComposition, +} from './mcp-tools'; + +const here = dirname(fileURLToPath(import.meta.url)); +const exampleCatalog = JSON.parse( + readFileSync(join(here, '../../docs/catalog/example-catalog.json'), 'utf8'), +) as CompositionCatalog; + +describe('mcp catalog tools (progressive disclosure)', () => { + it('list_components returns compact rows only', () => { + const rows = listComponents(exampleCatalog); + expect(rows.length).toBe(exampleCatalog.components.length); + expect(rows[0]).toMatchObject({ + id: 'example-contracts', + title: 'Example Contracts', + publishUsability: 'usable', + }); + expect(rows[0]).not.toHaveProperty('owns'); + expect(rows[0]).not.toHaveProperty('refuses'); + expect(rows[0]).not.toHaveProperty('dependencies'); + }); + + it('get_component returns full entry or null', () => { + const full = getComponent(exampleCatalog, 'example-store'); + expect(full?.owns).toContain('Declared collections and single-partition transactions'); + expect(full?.adapters.length).toBeGreaterThan(0); + expect(getComponent(exampleCatalog, 'missing')).toBeNull(); + }); + + it('list_recipes and get_recipe', () => { + const rows = listRecipes(exampleCatalog); + expect(rows.map((r) => r.id)).toEqual([ + 'example-accounts', + 'example-outbox', + 'example-deferred', + ]); + expect(rows[0]).not.toHaveProperty('antiPatterns'); + const full = getRecipe(exampleCatalog, 'example-outbox'); + expect(full?.antiPatterns.length).toBeGreaterThan(0); + expect(getRecipe(exampleCatalog, 'nope')).toBeNull(); + }); +}); + +describe('plan_composition', () => { + it('returns empty when no tags', () => { + const plan = planComposition(exampleCatalog, { capabilityTags: [] }); + expect(plan.components).toEqual([]); + expect(plan.recipes).toEqual([]); + expect(plan.notes[0]).toMatch(/No capabilityTags/); + }); + + it('scores storage recipes and omits non-overlapping deferred recipes', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['storage', 'audit', 'mail_transactional'], + host: 'cloudflare', + }); + expect(plan.schema).toBe('pegma.plan_composition.v1'); + expect(plan.recipes.map((r) => r.id)).toContain('example-outbox'); + // Deferred webhook recipe has no overlapping tags → not a candidate. + expect(plan.recipes.map((r) => r.id)).not.toContain('example-deferred'); + expect(plan.components.some((c) => c.id === 'example-store')).toBe(true); + expect(plan.components.some((c) => c.id === 'example-inbox')).toBe(false); + expect(plan.packages.every((p) => p.published)).toBe(true); + }); + + it('skips unpublished webhook recipe under productionOnly', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['webhooks_inbound'], + productionOnly: true, + }); + expect(plan.recipes.map((r) => r.id)).not.toContain('example-deferred'); + expect(plan.skipped.some((s) => s.id === 'example-deferred')).toBe(true); + expect(plan.components.some((c) => c.id === 'example-inbox')).toBe(false); + expect(plan.skipped.some((s) => s.id === 'example-inbox')).toBe(true); + }); + + it('includes unpublished when productionOnly=false', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['webhooks_inbound'], + productionOnly: false, + }); + expect(plan.components.some((c) => c.id === 'example-inbox')).toBe(true); + expect(plan.recipes.some((r) => r.id === 'example-deferred')).toBe(true); + }); + + it('static_host prefers not recommending heavy stacks', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['static_host'], + }); + // Example catalog has no static_host-tagged components; result may be empty + // but must not recommend webhooks/inbox as the primary story. + expect(plan.components.every((c) => c.id !== 'example-inbox')).toBe(true); + expect(plan.notes.some((n) => n.includes('static_host'))).toBe(true); + }); + + it('accounts tags surface account-shaped recipe', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['accounts', 'passkeys', 'cloudflare'], + host: 'cloudflare', + }); + expect(plan.recipes[0]?.id).toBe('example-accounts'); + }); +}); diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts new file mode 100644 index 0000000..f07b973 --- /dev/null +++ b/src/data/mcp-tools.ts @@ -0,0 +1,415 @@ +/** + * Progressive-disclosure catalog tools for the public MCP surface (Phase 4). + * + * Pure functions over a CompositionCatalog — no network, no private data. + * Transports (MCP, future clients) call these; they do not invent package facts. + */ + +import { + isPublishUsable, + recipePackagesReady, + type CapabilityTag, + type CatalogComponent, + type CatalogRecipe, + type CompositionCatalog, +} from './catalog-schema'; + +/** List row: minimum fields for the next selection decision. */ +export interface ComponentListItem { + readonly id: string; + readonly title: string; + readonly summary: string; + readonly status: CatalogComponent['status']; + readonly publishUsability: CatalogComponent['publishUsability']; + readonly packages: readonly { + readonly name: string; + readonly version: string | null; + readonly published: boolean; + }[]; + readonly capabilityTags: readonly CapabilityTag[]; +} + +/** List row for recipes: intent + package set, not full wiring. */ +export interface RecipeListItem { + readonly id: string; + readonly intent: string; + readonly packages: readonly string[]; + readonly fixtureStatus: CatalogRecipe['fixture']['status']; + readonly capabilityTags: readonly CapabilityTag[]; + readonly backlogPriority?: number; +} + +export interface PlanCompositionInput { + /** Structured capability tags from the catalog schema (not free text). */ + readonly capabilityTags: readonly CapabilityTag[]; + /** Prefer adapters for this host when set. */ + readonly host?: 'cloudflare' | 'azure' | 'memory' | 'other'; + /** + * When true (default), omit unpublished components and recipes whose + * required packages are not production-ready. + */ + readonly productionOnly?: boolean; +} + +export interface PlanCompositionResult { + readonly schema: 'pegma.plan_composition.v1'; + readonly catalogGeneratedAt: string; + readonly requested: { + readonly capabilityTags: readonly CapabilityTag[]; + readonly host?: PlanCompositionInput['host']; + readonly productionOnly: boolean; + }; + readonly components: readonly ComponentListItem[]; + readonly recipes: readonly RecipeListItem[]; + readonly packages: readonly { + readonly name: string; + readonly version: string | null; + readonly published: boolean; + readonly componentId: string; + }[]; + readonly notes: readonly string[]; + readonly skipped: readonly { + readonly id: string; + readonly kind: 'component' | 'recipe'; + readonly reason: string; + }[]; +} + +function tagOverlap( + a: readonly CapabilityTag[], + b: readonly CapabilityTag[], +): number { + if (a.length === 0 || b.length === 0) return 0; + const set = new Set(b); + let n = 0; + for (const t of a) { + if (set.has(t)) n += 1; + } + return n; +} + +function toComponentListItem(c: CatalogComponent): ComponentListItem { + return { + id: c.id, + title: c.title, + summary: c.summary, + status: c.status, + publishUsability: c.publishUsability, + packages: c.packages.map((p) => ({ + name: p.name, + version: p.version, + published: p.published, + })), + capabilityTags: c.capabilityTags, + }; +} + +function toRecipeListItem(r: CatalogRecipe): RecipeListItem { + return { + id: r.id, + intent: r.intent, + packages: r.packages, + fixtureStatus: r.fixture.status, + capabilityTags: r.capabilityTags, + ...(r.backlogPriority !== undefined + ? { backlogPriority: r.backlogPriority } + : {}), + }; +} + +/** list_components — id, summary, status, packages (progressive disclosure). */ +export function listComponents( + catalog: CompositionCatalog, +): readonly ComponentListItem[] { + return catalog.components.map(toComponentListItem); +} + +/** get_component — full catalog entry or null when unknown. */ +export function getComponent( + catalog: CompositionCatalog, + id: string, +): CatalogComponent | null { + return catalog.components.find((c) => c.id === id) ?? null; +} + +/** list_recipes — id, intent, package set. */ +export function listRecipes( + catalog: CompositionCatalog, +): readonly RecipeListItem[] { + return catalog.recipes.map(toRecipeListItem); +} + +/** get_recipe — full recipe metadata + fixture citation. */ +export function getRecipe( + catalog: CompositionCatalog, + id: string, +): CatalogRecipe | null { + return catalog.recipes.find((r) => r.id === id) ?? null; +} + +/** + * plan_composition — deterministic recommendation from structured tags + host. + * Rule-based only; not an LLM. Scores recipes/components by capability overlap. + */ +export function planComposition( + catalog: CompositionCatalog, + input: PlanCompositionInput, +): PlanCompositionResult { + const productionOnly = input.productionOnly !== false; + const requestedTags = input.capabilityTags; + const notes: string[] = []; + const skipped: PlanCompositionResult['skipped'][number][] = []; + + if (requestedTags.length === 0) { + notes.push( + 'No capabilityTags provided — return empty recommendations. Pass structured tags from the catalog schema.', + ); + return { + schema: 'pegma.plan_composition.v1', + catalogGeneratedAt: catalog.generatedAt, + requested: { + capabilityTags: requestedTags, + host: input.host, + productionOnly, + }, + components: [], + recipes: [], + packages: [], + notes, + skipped, + }; + } + + // Static-only intent: prefer not recommending accounts/storage stack. + const onlyStatic = + requestedTags.length === 1 && requestedTags[0] === 'static_host'; + + type ScoredComponent = { + component: CatalogComponent; + score: number; + }; + const scoredComponents: ScoredComponent[] = []; + + for (const c of catalog.components) { + let score = tagOverlap(c.capabilityTags, requestedTags); + if (score === 0) continue; + + if (productionOnly && c.publishUsability === 'unpublished') { + skipped.push({ + id: c.id, + kind: 'component', + reason: 'publishUsability=unpublished', + }); + continue; + } + + // Soft boost when the component has an adapter for the requested host. + if ( + input.host && + c.adapters.some((a) => a.host === input.host) + ) { + score += 0.25; + } + + if (onlyStatic && score === 1 && c.capabilityTags.includes('static_host')) { + scoredComponents.push({ component: c, score }); + continue; + } + if (onlyStatic) { + // Only components that are purely static_host / nothing-heavy. + const heavy = c.capabilityTags.some((t) => + ( + [ + 'accounts', + 'passkeys', + 'email_codes', + 'sessions', + 'storage', + 'mail_transactional', + 'webhooks_inbound', + 'support_queue', + ] as CapabilityTag[] + ).includes(t), + ); + if (heavy) { + skipped.push({ + id: c.id, + kind: 'component', + reason: 'static_host intent — skipped heavy capability component', + }); + continue; + } + } + + scoredComponents.push({ component: c, score }); + } + + scoredComponents.sort((a, b) => { + if (b.score !== a.score) return b.score - a.score; + return a.component.id.localeCompare(b.component.id); + }); + + type ScoredRecipe = { recipe: CatalogRecipe; score: number }; + const scoredRecipes: ScoredRecipe[] = []; + + for (const r of catalog.recipes) { + const score = tagOverlap(r.capabilityTags, requestedTags); + if (score === 0) continue; + + if (productionOnly) { + const missingReq = r.requiresPublished.filter((id) => { + const comp = catalog.components.find((c) => c.id === id); + return !comp || !isPublishUsable(comp); + }); + if (missingReq.length > 0) { + skipped.push({ + id: r.id, + kind: 'recipe', + reason: `requiresPublished not usable: ${missingReq.join(', ')}`, + }); + continue; + } + if (!recipePackagesReady(catalog, r)) { + skipped.push({ + id: r.id, + kind: 'recipe', + reason: 'recipe packages not published with pins', + }); + continue; + } + } + + if (input.host) { + const adapterHosts = r.adapters + .map((ref) => { + const comp = catalog.components.find((c) => c.id === ref.componentId); + return comp?.adapters.find((a) => a.id === ref.adapterId)?.host; + }) + .filter((h): h is NonNullable => Boolean(h)); + if ( + adapterHosts.length > 0 && + !adapterHosts.includes(input.host) && + !adapterHosts.includes('memory') + ) { + // Soft demote: still include but lower score for host mismatch. + scoredRecipes.push({ recipe: r, score: score - 0.5 }); + continue; + } + } + + scoredRecipes.push({ recipe: r, score }); + } + + scoredRecipes.sort((a, b) => { + if (b.score !== a.score) return b.score - a.score; + // Prefer green fixtures, then backlog priority (lower = first). + const fixtureRank = (s: CatalogRecipe['fixture']['status']) => + s === 'green' ? 0 : s === 'pending' ? 1 : 2; + const fr = fixtureRank(a.recipe.fixture.status) - fixtureRank(b.recipe.fixture.status); + if (fr !== 0) return fr; + const pa = a.recipe.backlogPriority ?? 999; + const pb = b.recipe.backlogPriority ?? 999; + if (pa !== pb) return pa - pb; + return a.recipe.id.localeCompare(b.recipe.id); + }); + + const selectedComponents = scoredComponents.map((s) => s.component); + const selectedRecipes = scoredRecipes.map((s) => s.recipe); + + // Prefer packages from selected components (published first). + const packages: PlanCompositionResult['packages'][number][] = []; + for (const c of selectedComponents) { + for (const p of c.packages) { + if (productionOnly && !p.published) continue; + packages.push({ + name: p.name, + version: p.version, + published: p.published, + componentId: c.id, + }); + } + } + + // Host-specific adapter hints. + if (input.host) { + for (const c of selectedComponents) { + const match = c.adapters.filter((a) => a.host === input.host); + if (match.length > 0) { + notes.push( + `${c.id}: prefer adapter(s) ${match.map((a) => a.id).join(', ')} for host=${input.host}`, + ); + } + } + } + + // Surface refusals for selected components (hard constraints). + for (const c of selectedComponents.slice(0, 12)) { + if (c.refuses.length > 0) { + notes.push(`${c.id} refuses: ${c.refuses.join('; ')}`); + } + } + + for (const r of selectedRecipes.slice(0, 5)) { + if (r.antiPatterns.length > 0) { + notes.push(`recipe ${r.id} anti-patterns: ${r.antiPatterns.join('; ')}`); + } + if (r.fixture.status !== 'green') { + notes.push( + `recipe ${r.id} fixture is ${r.fixture.status} — do not invent wiring; use component READMEs until green`, + ); + } + } + + if (onlyStatic) { + notes.push( + 'static_host intent: prefer empty composition (no accounts/storage/mail) unless a Worker health probe is required.', + ); + } + + if (productionOnly) { + notes.push( + 'productionOnly=true: unpublished packages and incomplete recipes were skipped. Set productionOnly=false to inspect them.', + ); + } + + notes.push( + 'Pin exact versions from the catalog. Wire at an explicit composition root. Re-fetch catalog.json when package facts may have changed.', + ); + + return { + schema: 'pegma.plan_composition.v1', + catalogGeneratedAt: catalog.generatedAt, + requested: { + capabilityTags: requestedTags, + host: input.host, + productionOnly, + }, + components: selectedComponents.map(toComponentListItem), + recipes: selectedRecipes.map(toRecipeListItem), + packages, + notes, + skipped, + }; +} + +/** Capability tags accepted by plan_composition (mirrors schema). */ +export const CAPABILITY_TAGS = [ + 'accounts', + 'passkeys', + 'email_codes', + 'sessions', + 'authorization', + 'storage', + 'audit', + 'mail_transactional', + 'rate_limit_durable', + 'rate_limit_memory', + 'webhooks_inbound', + 'support_queue', + 'health', + 'logging', + 'events_in_process', + 'cloudflare', + 'azure', + 'static_host', +] as const satisfies readonly CapabilityTag[]; diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 0181115..c5276f7 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -69,6 +69,7 @@ const nav = [ install skill · skill.md · catalog.json · + MCP · llms.txt

diff --git a/src/pages/skill.astro b/src/pages/skill.astro index 6e6c1c0..b6f5ee9 100644 --- a/src/pages/skill.astro +++ b/src/pages/skill.astro @@ -59,6 +59,32 @@ curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md

+
+

Optional MCP surface

+

+ A thin public MCP server exposes the same catalog over Streamable HTTP. + Tools return catalog facts only — no private data plane, no auth for reads. + Endpoint: https://pegma.dev/api/mcp +

+

Tools: list_components, get_component, + list_recipes, get_recipe, + plan_composition (rule-based over structured + capabilityTags — not an LLM).

+

MCP config snippet

+
{`{
+  "mcpServers": {
+    "pegma": {
+      "url": "https://pegma.dev/api/mcp"
+    }
+  }
+}`}
+

+ Clients without native remote MCP can use a local proxy, for example + npx mcp-remote https://pegma.dev/api/mcp. Prefer re-calling + tools over caching package versions. +

+
+

What the skill teaches

    @@ -73,7 +99,8 @@ curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md

    catalog.json · examples · llms.txt · - stack + stack · + MCP

diff --git a/worker/.dev.vars.example b/worker/.dev.vars.example index 701e94d..610199a 100644 --- a/worker/.dev.vars.example +++ b/worker/.dev.vars.example @@ -12,3 +12,6 @@ # Optional: set to "true" to probe Support Desk storage from /health. # SUPPORT_HEALTH_PROBE=true + +# Optional: override catalog URL for local MCP (default https://pegma.dev/catalog.json) +# CATALOG_URL=http://127.0.0.1:4321/catalog.json diff --git a/worker/README.md b/worker/README.md index 3ddf8d1..c847e1f 100644 --- a/worker/README.md +++ b/worker/README.md @@ -1,7 +1,9 @@ # pegma-dev-api Worker Cloudflare Worker composition root for pegma.dev. It preserves the existing -Pegma logging composition and public health endpoint: +Pegma logging composition and public health endpoint, and hosts the public +composition catalog MCP at `POST/GET https://pegma.dev/api/mcp` (Streamable +HTTP; catalog facts only — fetches `https://pegma.dev/catalog.json`). ```ts createTeeLogger(createCloudflareLogger(), createDatadogLogger(submit)); diff --git a/worker/src/index.ts b/worker/src/index.ts index 81035b2..8d5ecae 100644 --- a/worker/src/index.ts +++ b/worker/src/index.ts @@ -32,12 +32,15 @@ import { type SupportRuntimeEnv, } from './support-desk'; import { runSupportMaintenance } from './support-maintenance'; +import { createPegmaMcpHandler } from './mcp-server'; +import type { CatalogFetchEnv } from './mcp-catalog-fetch'; type AppEnv = Env & LoggerEnv & IdentityRuntimeEnv & GitHubReleaseWebhookEnv & - SupportRuntimeEnv; + SupportRuntimeEnv & + CatalogFetchEnv; function createSupportHandler(env: AppEnv, logger: ReturnType) { const identityRuntime = createProductionIdentityRuntime(env, logger); @@ -81,6 +84,28 @@ export default { host: url.host, }); + // Public composition catalog MCP (stateless; catalog facts only). + if (path === '/api/mcp') { + try { + return await createPegmaMcpHandler(env)(request, env, ctx); + } catch (error) { + logger.log('error', 'mcp.unavailable', { + error: error instanceof Error ? error.name : 'unknown', + }); + return Response.json( + { error: 'mcp_unavailable' }, + { + status: 503, + headers: { + 'Cache-Control': 'no-store', + 'Content-Type': 'application/json; charset=utf-8', + 'X-Content-Type-Options': 'nosniff', + }, + }, + ); + } + } + if ( request.method === 'GET' && (path === '/' || path === '/health' || path === '/api/health') diff --git a/worker/src/mcp-catalog-fetch.test.ts b/worker/src/mcp-catalog-fetch.test.ts new file mode 100644 index 0000000..294654d --- /dev/null +++ b/worker/src/mcp-catalog-fetch.test.ts @@ -0,0 +1,88 @@ +import { describe, expect, it, beforeEach } from 'vitest'; +import { + clearCatalogCache, + fetchCompositionCatalog, + CATALOG_CACHE_TTL_MS, + DEFAULT_CATALOG_URL, +} from './mcp-catalog-fetch'; +import type { CompositionCatalog } from '../../src/data/catalog-schema'; + +const sample: CompositionCatalog = { + schemaVersion: '0.1.0', + generatedAt: '2026-07-29T00:00:00.000Z', + components: [], + recipes: [], +}; + +describe('fetchCompositionCatalog', () => { + beforeEach(() => { + clearCatalogCache(); + }); + + it('fetches and caches the catalog', async () => { + let calls = 0; + const fetchImpl = async (input: RequestInfo | URL) => { + calls += 1; + expect(String(input)).toBe(DEFAULT_CATALOG_URL); + return new Response(JSON.stringify(sample), { + status: 200, + headers: { ETag: '"v1"', 'Content-Type': 'application/json' }, + }); + }; + + const a = await fetchCompositionCatalog({}, { fetchImpl, now: 1_000 }); + const b = await fetchCompositionCatalog( + {}, + { fetchImpl, now: 1_000 + CATALOG_CACHE_TTL_MS - 1 }, + ); + expect(a.generatedAt).toBe(sample.generatedAt); + expect(b.generatedAt).toBe(sample.generatedAt); + expect(calls).toBe(1); + }); + + it('revalidates after TTL with If-None-Match', async () => { + let calls = 0; + const fetchImpl = async ( + _input: RequestInfo | URL, + init?: RequestInit, + ) => { + calls += 1; + if (calls === 1) { + return new Response(JSON.stringify(sample), { + status: 200, + headers: { ETag: '"v1"' }, + }); + } + const headers = new Headers(init?.headers); + expect(headers.get('If-None-Match')).toBe('"v1"'); + return new Response(null, { status: 304 }); + }; + + await fetchCompositionCatalog({}, { fetchImpl, now: 0 }); + const again = await fetchCompositionCatalog( + {}, + { fetchImpl, now: CATALOG_CACHE_TTL_MS + 1 }, + ); + expect(again.schemaVersion).toBe('0.1.0'); + expect(calls).toBe(2); + }); + + it('honors CATALOG_URL override', async () => { + const fetchImpl = async (input: RequestInfo | URL) => { + expect(String(input)).toBe('https://example.test/catalog.json'); + return new Response(JSON.stringify(sample), { status: 200 }); + }; + await fetchCompositionCatalog( + { CATALOG_URL: 'https://example.test/catalog.json' }, + { fetchImpl, now: 0 }, + ); + }); + + it('rejects invalid shapes', async () => { + const fetchImpl = async () => + new Response(JSON.stringify({ nope: true }), { status: 200 }); + await expect( + fetchCompositionCatalog({}, { fetchImpl, now: 0 }), + ).rejects.toThrow(/invalid_shape/); + }); +}); diff --git a/worker/src/mcp-catalog-fetch.ts b/worker/src/mcp-catalog-fetch.ts new file mode 100644 index 0000000..5c3dd4c --- /dev/null +++ b/worker/src/mcp-catalog-fetch.ts @@ -0,0 +1,96 @@ +/** + * Fetch the published composition catalog for the public MCP surface. + * Catalog is the system of record (static URL); MCP never invents facts. + */ + +import type { CompositionCatalog } from '../../src/data/catalog-schema'; + +/** Default public catalog URL (site build emit). */ +export const DEFAULT_CATALOG_URL = 'https://pegma.dev/catalog.json'; + +/** In-isolate cache TTL for catalog.json (five minutes). */ +export const CATALOG_CACHE_TTL_MS = 5 * 60 * 1000; + +export interface CatalogFetchEnv { + /** Override catalog URL for local/dev (optional). */ + readonly CATALOG_URL?: string; +} + +interface CacheEntry { + readonly catalog: CompositionCatalog; + readonly fetchedAt: number; + readonly etag: string | null; +} + +let cache: CacheEntry | null = null; + +/** Test helper — clear the module-level catalog cache. */ +export function clearCatalogCache(): void { + cache = null; +} + +function isCompositionCatalog(value: unknown): value is CompositionCatalog { + if (!value || typeof value !== 'object') return false; + const v = value as Record; + return ( + typeof v.schemaVersion === 'string' && + typeof v.generatedAt === 'string' && + Array.isArray(v.components) && + Array.isArray(v.recipes) + ); +} + +/** + * Load the composition catalog, reusing a short in-isolate cache. + * Uses conditional GET when an ETag was previously observed. + */ +export async function fetchCompositionCatalog( + env: CatalogFetchEnv = {}, + options: { + readonly now?: number; + readonly fetchImpl?: typeof fetch; + } = {}, +): Promise { + const now = options.now ?? Date.now(); + const fetchImpl = options.fetchImpl ?? fetch; + const url = env.CATALOG_URL?.trim() || DEFAULT_CATALOG_URL; + + if (cache && now - cache.fetchedAt < CATALOG_CACHE_TTL_MS) { + return cache.catalog; + } + + const headers: Record = { + Accept: 'application/json', + 'User-Agent': 'pegma-dev-api-mcp', + }; + if (cache?.etag) { + headers['If-None-Match'] = cache.etag; + } + + const res = await fetchImpl(url, { + headers, + signal: AbortSignal.timeout(10_000), + }); + + if (res.status === 304 && cache) { + cache = { ...cache, fetchedAt: now }; + return cache.catalog; + } + + if (!res.ok) { + throw new Error(`catalog_fetch_failed:${res.status}`); + } + + const body: unknown = await res.json(); + if (!isCompositionCatalog(body)) { + throw new Error('catalog_fetch_invalid_shape'); + } + + const etag = res.headers.get('ETag'); + cache = { + catalog: body, + fetchedAt: now, + etag, + }; + return body; +} diff --git a/worker/src/mcp-server.ts b/worker/src/mcp-server.ts new file mode 100644 index 0000000..cd5d9ac --- /dev/null +++ b/worker/src/mcp-server.ts @@ -0,0 +1,224 @@ +/** + * Public Pegma composition MCP server (stateless). + * + * Tools return catalog facts only — no private data plane, no auth for reads. + * Hosted on pegma-dev-api at POST/GET /api/mcp (Streamable HTTP). + */ + +import { McpServer } from '@modelcontextprotocol/server'; +import { createMcpHandler } from 'agents/mcp/server'; +import { z } from 'zod'; +import { + CAPABILITY_TAGS, + getComponent, + getRecipe, + listComponents, + listRecipes, + planComposition, + type PlanCompositionInput, +} from '../../src/data/mcp-tools'; +import { + fetchCompositionCatalog, + type CatalogFetchEnv, +} from './mcp-catalog-fetch'; + +const capabilityTagSchema = z.enum( + CAPABILITY_TAGS as unknown as [string, ...string[]], +); + +function jsonText(value: unknown): { content: [{ type: 'text'; text: string }] } { + return { + content: [ + { + type: 'text', + text: JSON.stringify(value, null, 2), + }, + ], + }; +} + +function errorText(message: string): { + content: [{ type: 'text'; text: string }]; + isError: true; +} { + return { + content: [{ type: 'text', text: message }], + isError: true, + }; +} + +/** + * Build a fresh MCP server bound to a catalog loader. + * createMcpHandler requires a factory (new server per request). + */ +export function createPegmaCatalogMcpServer( + loadCatalog: () => Promise>>, +): McpServer { + const server = new McpServer({ + name: 'pegma-catalog', + version: '1.0.0', + }); + + server.registerTool( + 'list_components', + { + description: + 'List Pegma composition catalog components (id, summary, status, packages). Progressive disclosure — use get_component for owns/refuses/deps/adapters.', + inputSchema: {}, + }, + async () => { + try { + const catalog = await loadCatalog(); + return jsonText({ + schemaVersion: catalog.schemaVersion, + generatedAt: catalog.generatedAt, + components: listComponents(catalog), + }); + } catch (error) { + return errorText( + `Failed to load catalog: ${error instanceof Error ? error.message : 'unknown'}`, + ); + } + }, + ); + + server.registerTool( + 'get_component', + { + description: + 'Full catalog entry for one component: owns, refuses, dependencies, adapters, hostMustProvide, packages, links.', + inputSchema: { + id: z.string().min(1).describe('Catalog component id (e.g. identity, storage-core)'), + }, + }, + async ({ id }) => { + try { + const catalog = await loadCatalog(); + const component = getComponent(catalog, id); + if (!component) { + return errorText(`Unknown component id: ${id}`); + } + return jsonText({ + schemaVersion: catalog.schemaVersion, + generatedAt: catalog.generatedAt, + component, + }); + } catch (error) { + return errorText( + `Failed to load catalog: ${error instanceof Error ? error.message : 'unknown'}`, + ); + } + }, + ); + + server.registerTool( + 'list_recipes', + { + description: + 'List synthetic composition recipes (id, intent, packages, fixture status). Use get_recipe for full metadata and fixture citation.', + inputSchema: {}, + }, + async () => { + try { + const catalog = await loadCatalog(); + return jsonText({ + schemaVersion: catalog.schemaVersion, + generatedAt: catalog.generatedAt, + recipes: listRecipes(catalog), + }); + } catch (error) { + return errorText( + `Failed to load catalog: ${error instanceof Error ? error.message : 'unknown'}`, + ); + } + }, + ); + + server.registerTool( + 'get_recipe', + { + description: + 'Full recipe: intent, packages, adapters, host responsibilities, anti-patterns, fixture citation. Synthetic intents only.', + inputSchema: { + id: z.string().min(1).describe('Catalog recipe id (e.g. cf-passkey-accounts)'), + }, + }, + async ({ id }) => { + try { + const catalog = await loadCatalog(); + const recipe = getRecipe(catalog, id); + if (!recipe) { + return errorText(`Unknown recipe id: ${id}`); + } + return jsonText({ + schemaVersion: catalog.schemaVersion, + generatedAt: catalog.generatedAt, + recipe, + }); + } catch (error) { + return errorText( + `Failed to load catalog: ${error instanceof Error ? error.message : 'unknown'}`, + ); + } + }, + ); + + server.registerTool( + 'plan_composition', + { + description: + 'Deterministic package/recipe recommendation from structured capabilityTags and optional host. Rule-based over the catalog — not an LLM. Prefer productionOnly=true for real hosts.', + inputSchema: { + capabilityTags: z + .array(capabilityTagSchema) + .describe('Structured capability tags from the catalog schema'), + host: z + .enum(['cloudflare', 'azure', 'memory', 'other']) + .optional() + .describe('Hosting surface to prefer for adapters'), + productionOnly: z + .boolean() + .optional() + .describe( + 'When true (default), skip unpublished components and incomplete recipes', + ), + }, + }, + async (args) => { + try { + const catalog = await loadCatalog(); + const input: PlanCompositionInput = { + capabilityTags: args.capabilityTags as PlanCompositionInput['capabilityTags'], + host: args.host, + productionOnly: args.productionOnly, + }; + return jsonText(planComposition(catalog, input)); + } catch (error) { + return errorText( + `Failed to plan composition: ${error instanceof Error ? error.message : 'unknown'}`, + ); + } + }, + ); + + return server; +} + +/** Stable Streamable HTTP handler for /api/mcp. */ +export function createPegmaMcpHandler(env: CatalogFetchEnv = {}) { + return createMcpHandler( + () => + createPegmaCatalogMcpServer(() => fetchCompositionCatalog(env)), + { + route: '/api/mcp', + // Custom domain; Origin-less agent clients remain valid. + allowedHostnames: ['pegma.dev', 'localhost', '127.0.0.1'], + // Public catalog facts only — no private data plane. + corsOptions: { + origin: '*', + methods: 'GET, POST, OPTIONS', + headers: 'Content-Type, Accept, MCP-Protocol-Version, MCP-Session-Id', + }, + }, + ); +} diff --git a/worker/tsconfig.json b/worker/tsconfig.json index 2bbce6d..19caf90 100644 --- a/worker/tsconfig.json +++ b/worker/tsconfig.json @@ -4,5 +4,10 @@ "lib": ["ES2023", "WebWorker"], "types": ["@types/node", "./worker-configuration.d.ts"] }, - "include": ["src/**/*.ts", "worker-configuration.d.ts"] + "include": [ + "src/**/*.ts", + "worker-configuration.d.ts", + "../src/data/catalog-schema.ts", + "../src/data/mcp-tools.ts" + ] } From c1fc4d72a4e8acfca0bffad7b60a451be885bd7d Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 11:51:33 -0400 Subject: [PATCH 2/7] [4] Harden plan_composition for deps, green fixtures, logging Close recommended packages over required component dependencies and recipe package owners. Gate production plans on green fixtures. Fix static_host heavy-tag filtering and log MCP error messages. --- src/data/mcp-tools.test.ts | 56 +++++++++++++- src/data/mcp-tools.ts | 146 +++++++++++++++++++++++++++++++++---- worker/src/index.ts | 1 + 3 files changed, 186 insertions(+), 17 deletions(-) diff --git a/src/data/mcp-tools.test.ts b/src/data/mcp-tools.test.ts index 471e461..97678d6 100644 --- a/src/data/mcp-tools.test.ts +++ b/src/data/mcp-tools.test.ts @@ -60,17 +60,22 @@ describe('plan_composition', () => { }); it('scores storage recipes and omits non-overlapping deferred recipes', () => { + // Example catalog fixtures are pending — inspect with productionOnly=false. const plan = planComposition(exampleCatalog, { capabilityTags: ['storage', 'audit', 'mail_transactional'], host: 'cloudflare', + productionOnly: false, }); expect(plan.schema).toBe('pegma.plan_composition.v1'); expect(plan.recipes.map((r) => r.id)).toContain('example-outbox'); // Deferred webhook recipe has no overlapping tags → not a candidate. expect(plan.recipes.map((r) => r.id)).not.toContain('example-deferred'); expect(plan.components.some((c) => c.id === 'example-store')).toBe(true); - expect(plan.components.some((c) => c.id === 'example-inbox')).toBe(false); - expect(plan.packages.every((p) => p.published)).toBe(true); + // Dependency closure pulls example-contracts for example-store. + expect(plan.components.some((c) => c.id === 'example-contracts')).toBe(true); + expect(plan.packages.map((p) => p.name)).toEqual( + expect.arrayContaining(['@example/store', '@example/contracts']), + ); }); it('skips unpublished webhook recipe under productionOnly', () => { @@ -84,6 +89,20 @@ describe('plan_composition', () => { expect(plan.skipped.some((s) => s.id === 'example-inbox')).toBe(true); }); + it('skips pending fixtures when productionOnly', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['storage', 'audit', 'mail_transactional'], + productionOnly: true, + }); + expect(plan.recipes).toEqual([]); + expect( + plan.skipped.some( + (s) => + s.id === 'example-outbox' && s.reason.includes('fixture.status'), + ), + ).toBe(true); + }); + it('includes unpublished when productionOnly=false', () => { const plan = planComposition(exampleCatalog, { capabilityTags: ['webhooks_inbound'], @@ -103,11 +122,42 @@ describe('plan_composition', () => { expect(plan.notes.some((n) => n.includes('static_host'))).toBe(true); }); - it('accounts tags surface account-shaped recipe', () => { + it('accounts tags surface account-shaped recipe when fixtures may be pending', () => { const plan = planComposition(exampleCatalog, { capabilityTags: ['accounts', 'passkeys', 'cloudflare'], host: 'cloudflare', + productionOnly: false, }); expect(plan.recipes[0]?.id).toBe('example-accounts'); + // Closure + recipe packages include store deps, not only tag-matched roots. + expect(plan.packages.map((p) => p.name)).toEqual( + expect.arrayContaining([ + '@example/contracts', + '@example/store', + '@example/store-cloud', + ]), + ); + }); + + it('production plans accept green fixtures and close deps', () => { + const greenCatalog: CompositionCatalog = { + ...exampleCatalog, + recipes: exampleCatalog.recipes.map((r) => + r.id === 'example-outbox' + ? { + ...r, + fixture: { ...r.fixture, status: 'green' as const }, + } + : r, + ), + }; + const plan = planComposition(greenCatalog, { + capabilityTags: ['storage', 'audit', 'mail_transactional'], + productionOnly: true, + }); + expect(plan.recipes.map((r) => r.id)).toEqual(['example-outbox']); + expect(plan.packages.map((p) => p.name)).toEqual( + expect.arrayContaining(['@example/store', '@example/contracts']), + ); }); }); diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index f07b973..e064874 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -7,6 +7,7 @@ import { isPublishUsable, + parsePackageSpecifier, recipePackagesReady, type CapabilityTag, type CatalogComponent, @@ -211,12 +212,9 @@ export function planComposition( score += 0.25; } - if (onlyStatic && score === 1 && c.capabilityTags.includes('static_host')) { - scoredComponents.push({ component: c, score }); - continue; - } if (onlyStatic) { - // Only components that are purely static_host / nothing-heavy. + // static_host intent: never recommend heavy stacks, even if a component + // also carries the static_host tag alongside accounts/storage/etc. const heavy = c.capabilityTags.some((t) => ( [ @@ -257,6 +255,14 @@ export function planComposition( if (score === 0) continue; if (productionOnly) { + if (r.fixture.status !== 'green') { + skipped.push({ + id: r.id, + kind: 'recipe', + reason: `fixture.status=${r.fixture.status} (production plans require green fixtures)`, + }); + continue; + } const missingReq = r.requiresPublished.filter((id) => { const comp = catalog.components.find((c) => c.id === id); return !comp || !isPublishUsable(comp); @@ -313,20 +319,132 @@ export function planComposition( return a.recipe.id.localeCompare(b.recipe.id); }); - const selectedComponents = scoredComponents.map((s) => s.component); const selectedRecipes = scoredRecipes.map((s) => s.recipe); - // Prefer packages from selected components (published first). + // Close the plan over required component dependencies and recipe package + // owners so agents get a buildable package set, not only tag-matched roots. + const componentById = new Map( + catalog.components.map((c) => [c.id, c] as const), + ); + const closed = new Map(); + for (const s of scoredComponents) { + closed.set(s.component.id, s.component); + } + + const queue: string[] = [...closed.keys()]; + while (queue.length > 0) { + const id = queue.pop()!; + const comp = componentById.get(id); + if (!comp) continue; + for (const dep of comp.dependencies) { + if (dep.kind !== 'requires') continue; + if (closed.has(dep.componentId)) continue; + const depComp = componentById.get(dep.componentId); + if (!depComp) { + notes.push( + `missing required dependency ${dep.componentId} referenced by ${id}`, + ); + continue; + } + if (productionOnly && depComp.publishUsability === 'unpublished') { + skipped.push({ + id: depComp.id, + kind: 'component', + reason: `required by ${id} but publishUsability=unpublished`, + }); + continue; + } + closed.set(depComp.id, depComp); + queue.push(depComp.id); + } + } + + // Recipe package owners and requiresPublished also enter the closure. + for (const r of selectedRecipes) { + for (const reqId of r.requiresPublished) { + if (closed.has(reqId)) continue; + const depComp = componentById.get(reqId); + if (!depComp) continue; + if (productionOnly && depComp.publishUsability === 'unpublished') continue; + closed.set(depComp.id, depComp); + queue.push(depComp.id); + } + for (const spec of r.packages) { + const { name } = parsePackageSpecifier(spec); + const owner = catalog.components.find((c) => + c.packages.some((p) => p.name === name), + ); + if (!owner || closed.has(owner.id)) continue; + if (productionOnly && owner.publishUsability === 'unpublished') continue; + closed.set(owner.id, owner); + queue.push(owner.id); + } + } + + // Drain any deps discovered from recipe expansion. + while (queue.length > 0) { + const id = queue.pop()!; + const comp = componentById.get(id); + if (!comp) continue; + for (const dep of comp.dependencies) { + if (dep.kind !== 'requires') continue; + if (closed.has(dep.componentId)) continue; + const depComp = componentById.get(dep.componentId); + if (!depComp) continue; + if (productionOnly && depComp.publishUsability === 'unpublished') { + skipped.push({ + id: depComp.id, + kind: 'component', + reason: `required by ${id} but publishUsability=unpublished`, + }); + continue; + } + closed.set(depComp.id, depComp); + queue.push(depComp.id); + } + } + + const selectedComponents = [...closed.values()].sort((a, b) => + a.id.localeCompare(b.id), + ); + + // Packages from closed components plus explicit recipe package pins. const packages: PlanCompositionResult['packages'][number][] = []; + const seenPkg = new Set(); + const pushPkg = ( + name: string, + version: string | null, + published: boolean, + componentId: string, + ) => { + if (productionOnly && !published) return; + const key = `${componentId}::${name}`; + if (seenPkg.has(key)) return; + seenPkg.add(key); + packages.push({ name, version, published, componentId }); + }; + for (const c of selectedComponents) { for (const p of c.packages) { - if (productionOnly && !p.published) continue; - packages.push({ - name: p.name, - version: p.version, - published: p.published, - componentId: c.id, - }); + pushPkg(p.name, p.version, p.published, c.id); + } + } + + for (const r of selectedRecipes) { + for (const spec of r.packages) { + const { name, version: pinned } = parsePackageSpecifier(spec); + const owner = catalog.components.find((c) => + c.packages.some((p) => p.name === name), + ); + if (!owner) continue; + const pkg = owner.packages.find((p) => p.name === name); + if (!pkg) continue; + pushPkg( + pkg.name, + pinned && pinned.length > 0 ? pinned : pkg.version, + pkg.published, + owner.id, + ); } } diff --git a/worker/src/index.ts b/worker/src/index.ts index 8d5ecae..d152545 100644 --- a/worker/src/index.ts +++ b/worker/src/index.ts @@ -91,6 +91,7 @@ export default { } catch (error) { logger.log('error', 'mcp.unavailable', { error: error instanceof Error ? error.name : 'unknown', + message: error instanceof Error ? error.message : String(error), }); return Response.json( { error: 'mcp_unavailable' }, From 74e1062d576cc5510750078d8133ef7b0a00fc85 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 12:04:03 -0400 Subject: [PATCH 3/7] [4] Prefer primary recipe and host-filtered adapter packages plan_composition no longer unions every partial recipe match into one install set; packages come from the top recipe (or tag match) with requires-closure. Adapter packages are filtered by host. Enrich storage-blobs so it is reachable via the storage capability tag. --- src/data/catalog-enrichment.ts | 32 ++++++++ src/data/mcp-tools.test.ts | 29 ++++++- src/data/mcp-tools.ts | 140 +++++++++++++++++++-------------- 3 files changed, 139 insertions(+), 62 deletions(-) diff --git a/src/data/catalog-enrichment.ts b/src/data/catalog-enrichment.ts index f242c4c..7400e0d 100644 --- a/src/data/catalog-enrichment.ts +++ b/src/data/catalog-enrichment.ts @@ -59,6 +59,38 @@ export const COMPONENT_ENRICHMENT: Readonly> ], capabilityTags: ['storage', 'cloudflare', 'azure'], }, + 'storage-blobs': { + dependencies: [ + { componentId: 'spine', kind: 'requires', note: 'Shared contracts' }, + ], + adapters: [ + { + id: 'azure-blob', + packageName: '@pegma/storage-azure-blob', + host: 'azure', + when: 'Azure Blob Storage for opaque object bytes', + }, + { + id: 'cloudflare-r2', + packageName: '@pegma/storage-cloudflare-r2', + host: 'cloudflare', + when: 'Cloudflare R2 for opaque object bytes', + }, + { + id: 's3', + packageName: '@pegma/storage-s3', + host: 'other', + when: 'S3-compatible endpoints outside Azure/Cloudflare first-party adapters', + }, + ], + hostMustProvide: [ + 'Chosen blob adapter binding (R2 bucket, Azure container, or S3 credentials)', + 'Authorization and malware scanning at the host API — not inside the store', + ], + // Same `storage` tag as record storage so plan_composition can surface it; + // agents still pick packages via host-filtered adapters. + capabilityTags: ['storage', 'cloudflare', 'azure'], + }, 'authorization-core': { dependencies: [ { componentId: 'spine', kind: 'requires' }, diff --git a/src/data/mcp-tools.test.ts b/src/data/mcp-tools.test.ts index 97678d6..51999ae 100644 --- a/src/data/mcp-tools.test.ts +++ b/src/data/mcp-tools.test.ts @@ -67,7 +67,8 @@ describe('plan_composition', () => { productionOnly: false, }); expect(plan.schema).toBe('pegma.plan_composition.v1'); - expect(plan.recipes.map((r) => r.id)).toContain('example-outbox'); + // Primary is best tag overlap (outbox over accounts for these tags). + expect(plan.recipes[0]?.id).toBe('example-outbox'); // Deferred webhook recipe has no overlapping tags → not a candidate. expect(plan.recipes.map((r) => r.id)).not.toContain('example-deferred'); expect(plan.components.some((c) => c.id === 'example-store')).toBe(true); @@ -78,6 +79,32 @@ describe('plan_composition', () => { ); }); + it('does not merge alternative recipes into the package plan', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['storage', 'cloudflare'], + productionOnly: false, + }); + // Both accounts and outbox may match storage+cloudflare; packages come + // only from the primary recipe closure. + expect(plan.recipes.length).toBeGreaterThan(1); + expect(plan.notes.some((n) => n.startsWith('primary recipe:'))).toBe(true); + expect(plan.notes.some((n) => n.includes('alternatives'))).toBe(true); + }); + + it('filters adapter packages by host', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['storage', 'cloudflare'], + host: 'cloudflare', + productionOnly: false, + }); + // example-store has memory + cloud-sql (cloudflare) adapters. + const names = plan.packages.map((p) => p.name); + expect(names).toContain('@example/store-cloud'); + // Memory adapter package is still allowed; there is no azure adapter package + // in the sample. Assert cloud-sql owner is present via primary recipe. + expect(names).toEqual(expect.arrayContaining(['@example/store'])); + }); + it('skips unpublished webhook recipe under productionOnly', () => { const plan = planComposition(exampleCatalog, { capabilityTags: ['webhooks_inbound'], diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index e064874..89a41ae 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -319,69 +319,67 @@ export function planComposition( return a.recipe.id.localeCompare(b.recipe.id); }); + // Ranked recipes for progressive disclosure: primary drives the package plan; + // other matches are alternatives (not unioned into the install set). const selectedRecipes = scoredRecipes.map((s) => s.recipe); + const primaryRecipe = selectedRecipes[0] ?? null; + if (primaryRecipe && selectedRecipes.length > 1) { + notes.push( + `primary recipe: ${primaryRecipe.id}; alternatives (not merged into packages): ${selectedRecipes + .slice(1) + .map((r) => r.id) + .join(', ')}`, + ); + } else if (primaryRecipe) { + notes.push(`primary recipe: ${primaryRecipe.id}`); + } - // Close the plan over required component dependencies and recipe package - // owners so agents get a buildable package set, not only tag-matched roots. + // Close over required deps for either the primary recipe or tag-matched roots. const componentById = new Map( catalog.components.map((c) => [c.id, c] as const), ); const closed = new Map(); - for (const s of scoredComponents) { - closed.set(s.component.id, s.component); - } + const queue: string[] = []; - const queue: string[] = [...closed.keys()]; - while (queue.length > 0) { - const id = queue.pop()!; - const comp = componentById.get(id); - if (!comp) continue; - for (const dep of comp.dependencies) { - if (dep.kind !== 'requires') continue; - if (closed.has(dep.componentId)) continue; - const depComp = componentById.get(dep.componentId); + const admitComponent = (comp: CatalogComponent, reason: string) => { + if (closed.has(comp.id)) return; + if (productionOnly && comp.publishUsability === 'unpublished') { + skipped.push({ + id: comp.id, + kind: 'component', + reason: `${reason} but publishUsability=unpublished`, + }); + return; + } + closed.set(comp.id, comp); + queue.push(comp.id); + }; + + if (primaryRecipe) { + for (const reqId of primaryRecipe.requiresPublished) { + const depComp = componentById.get(reqId); if (!depComp) { notes.push( - `missing required dependency ${dep.componentId} referenced by ${id}`, + `missing requiresPublished component ${reqId} on recipe ${primaryRecipe.id}`, ); continue; } - if (productionOnly && depComp.publishUsability === 'unpublished') { - skipped.push({ - id: depComp.id, - kind: 'component', - reason: `required by ${id} but publishUsability=unpublished`, - }); - continue; - } - closed.set(depComp.id, depComp); - queue.push(depComp.id); - } - } - - // Recipe package owners and requiresPublished also enter the closure. - for (const r of selectedRecipes) { - for (const reqId of r.requiresPublished) { - if (closed.has(reqId)) continue; - const depComp = componentById.get(reqId); - if (!depComp) continue; - if (productionOnly && depComp.publishUsability === 'unpublished') continue; - closed.set(depComp.id, depComp); - queue.push(depComp.id); + admitComponent(depComp, `required by recipe ${primaryRecipe.id}`); } - for (const spec of r.packages) { + for (const spec of primaryRecipe.packages) { const { name } = parsePackageSpecifier(spec); const owner = catalog.components.find((c) => c.packages.some((p) => p.name === name), ); - if (!owner || closed.has(owner.id)) continue; - if (productionOnly && owner.publishUsability === 'unpublished') continue; - closed.set(owner.id, owner); - queue.push(owner.id); + if (!owner) continue; + admitComponent(owner, `package owner for recipe ${primaryRecipe.id}`); + } + } else { + for (const s of scoredComponents) { + admitComponent(s.component, 'tag match'); } } - // Drain any deps discovered from recipe expansion. while (queue.length > 0) { const id = queue.pop()!; const comp = componentById.get(id); @@ -390,17 +388,13 @@ export function planComposition( if (dep.kind !== 'requires') continue; if (closed.has(dep.componentId)) continue; const depComp = componentById.get(dep.componentId); - if (!depComp) continue; - if (productionOnly && depComp.publishUsability === 'unpublished') { - skipped.push({ - id: depComp.id, - kind: 'component', - reason: `required by ${id} but publishUsability=unpublished`, - }); + if (!depComp) { + notes.push( + `missing required dependency ${dep.componentId} referenced by ${id}`, + ); continue; } - closed.set(depComp.id, depComp); - queue.push(depComp.id); + admitComponent(depComp, `required by ${id}`); } } @@ -408,7 +402,29 @@ export function planComposition( a.id.localeCompare(b.id), ); - // Packages from closed components plus explicit recipe package pins. + /** + * When host is set, emit core packages + adapters for that host (and memory). + * Adapter packages for other hosts are omitted so agents do not install + * Azure adapters on a Cloudflare plan (and vice versa). + */ + const packagesForComponent = ( + c: CatalogComponent, + ): readonly CatalogComponent['packages'][number][] => { + if (!input.host || c.adapters.length === 0) { + return c.packages; + } + const adapterByPackage = new Map(); + for (const a of c.adapters) { + if (a.packageName) adapterByPackage.set(a.packageName, a.host); + } + return c.packages.filter((p) => { + const adapterHost = adapterByPackage.get(p.name); + if (!adapterHost) return true; // core / non-adapter package + return adapterHost === input.host || adapterHost === 'memory'; + }); + }; + + // Packages from closed components (host-filtered) plus primary recipe pins. const packages: PlanCompositionResult['packages'][number][] = []; const seenPkg = new Set(); const pushPkg = ( @@ -425,13 +441,13 @@ export function planComposition( }; for (const c of selectedComponents) { - for (const p of c.packages) { + for (const p of packagesForComponent(c)) { pushPkg(p.name, p.version, p.published, c.id); } } - for (const r of selectedRecipes) { - for (const spec of r.packages) { + if (primaryRecipe) { + for (const spec of primaryRecipe.packages) { const { name, version: pinned } = parsePackageSpecifier(spec); const owner = catalog.components.find((c) => c.packages.some((p) => p.name === name), @@ -467,13 +483,15 @@ export function planComposition( } } - for (const r of selectedRecipes.slice(0, 5)) { - if (r.antiPatterns.length > 0) { - notes.push(`recipe ${r.id} anti-patterns: ${r.antiPatterns.join('; ')}`); + if (primaryRecipe) { + if (primaryRecipe.antiPatterns.length > 0) { + notes.push( + `recipe ${primaryRecipe.id} anti-patterns: ${primaryRecipe.antiPatterns.join('; ')}`, + ); } - if (r.fixture.status !== 'green') { + if (primaryRecipe.fixture.status !== 'green') { notes.push( - `recipe ${r.id} fixture is ${r.fixture.status} — do not invent wiring; use component READMEs until green`, + `recipe ${primaryRecipe.id} fixture is ${primaryRecipe.fixture.status} — do not invent wiring; use component READMEs until green`, ); } } From 21bf1ecbe951fc2d6481ce1f2836d63f46455f29 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 12:08:25 -0400 Subject: [PATCH 4/7] [4] Keep tag matches and host-filter recipe pins Include tag-matched components alongside the primary recipe so combined capabilities (e.g. accounts+health) stay in the plan. Skip recipe package pins that are adapters for a different host than requested. --- src/data/mcp-tools.test.ts | 73 ++++++++++++++++++++++++++++++++++++++ src/data/mcp-tools.ts | 19 +++++++--- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/src/data/mcp-tools.test.ts b/src/data/mcp-tools.test.ts index 51999ae..fe0095e 100644 --- a/src/data/mcp-tools.test.ts +++ b/src/data/mcp-tools.test.ts @@ -187,4 +187,77 @@ describe('plan_composition', () => { expect.arrayContaining(['@example/store', '@example/contracts']), ); }); + + it('keeps tag-matched components alongside a primary recipe', () => { + const catalog: CompositionCatalog = { + ...exampleCatalog, + components: [ + ...exampleCatalog.components, + { + id: 'example-health', + title: 'Example Health', + repo: 'example-health', + packages: [ + { + name: '@example/health', + version: '0.0.1', + published: true, + }, + ], + status: 'published', + publishUsability: 'usable', + summary: 'Synthetic health probe for planner tests.', + owns: ['Liveness probes'], + refuses: ['APM'], + dependencies: [], + adapters: [], + hostMustProvide: ['HTTP route'], + capabilityTags: ['health'], + recipeIds: [], + links: { githubRepo: 'https://github.com/example/example-health' }, + }, + ], + recipes: exampleCatalog.recipes.map((r) => + r.id === 'example-accounts' + ? { ...r, fixture: { ...r.fixture, status: 'green' as const } } + : r, + ), + }; + const plan = planComposition(catalog, { + capabilityTags: ['accounts', 'passkeys', 'cloudflare', 'health'], + productionOnly: true, + }); + expect(plan.recipes[0]?.id).toBe('example-accounts'); + expect(plan.components.some((c) => c.id === 'example-health')).toBe(true); + expect(plan.packages.map((p) => p.name)).toContain('@example/health'); + }); + + it('does not re-add host-mismatched recipe adapter pins', () => { + const catalog: CompositionCatalog = { + ...exampleCatalog, + recipes: exampleCatalog.recipes.map((r) => + r.id === 'example-accounts' + ? { + ...r, + fixture: { ...r.fixture, status: 'green' as const }, + // cloud-sql package is a cloudflare adapter on example-store + packages: [ + '@example/contracts', + '@example/store', + '@example/store-cloud', + ], + } + : r, + ), + }; + const plan = planComposition(catalog, { + capabilityTags: ['accounts', 'passkeys', 'cloudflare'], + host: 'azure', + productionOnly: true, + }); + expect(plan.packages.map((p) => p.name)).not.toContain('@example/store-cloud'); + expect( + plan.notes.some((n) => n.includes('skipped recipe pin @example/store-cloud')), + ).toBe(true); + }); }); diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index 89a41ae..f2a2810 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -374,10 +374,12 @@ export function planComposition( if (!owner) continue; admitComponent(owner, `package owner for recipe ${primaryRecipe.id}`); } - } else { - for (const s of scoredComponents) { - admitComponent(s.component, 'tag match'); - } + } + + // Always include tag-matched components (and their requires) so requests like + // accounts+health keep @pegma/health even when a primary recipe is selected. + for (const s of scoredComponents) { + admitComponent(s.component, 'tag match'); } while (queue.length > 0) { @@ -455,6 +457,15 @@ export function planComposition( if (!owner) continue; const pkg = owner.packages.find((p) => p.name === name); if (!pkg) continue; + // Do not re-introduce host-mismatched adapter packages named by the + // recipe when the caller requested a different host. + const allowed = packagesForComponent(owner).some((p) => p.name === name); + if (!allowed) { + notes.push( + `skipped recipe pin ${name} for host=${input.host ?? 'any'} (adapter host mismatch)`, + ); + continue; + } pushPkg( pkg.name, pinned && pinned.length > 0 ? pinned : pkg.version, From 3f11e4d571ad8c9e490f7ec060fe4e772da10113 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 12:19:25 -0400 Subject: [PATCH 5/7] [4] Distinguish storage_blobs capability from record storage Add storage_blobs to the catalog capability tag set and tag storage-blobs with it so plan_composition no longer selects blob packages on generic storage / host-only queries. --- docs/catalog/SCHEMA.md | 6 +++--- src/data/catalog-enrichment.ts | 5 ++--- src/data/catalog-schema.test.ts | 1 + src/data/catalog-schema.ts | 2 ++ src/data/mcp-tools.ts | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/catalog/SCHEMA.md b/docs/catalog/SCHEMA.md index a2cf7e9..e80ed18 100644 --- a/docs/catalog/SCHEMA.md +++ b/docs/catalog/SCHEMA.md @@ -115,9 +115,9 @@ CompositionCatalog Structured flags (not free text) so `plan_composition` can stay rule-based: `accounts`, `passkeys`, `email_codes`, `sessions`, `authorization`, `storage`, -`audit`, `mail_transactional`, `rate_limit_durable`, `rate_limit_memory`, -`webhooks_inbound`, `support_queue`, `health`, `logging`, `events_in_process`, -`cloudflare`, `azure`, `static_host`. +`storage_blobs`, `audit`, `mail_transactional`, `rate_limit_durable`, +`rate_limit_memory`, `webhooks_inbound`, `support_queue`, `health`, `logging`, +`events_in_process`, `cloudflare`, `azure`, `static_host`. ## TypeScript source diff --git a/src/data/catalog-enrichment.ts b/src/data/catalog-enrichment.ts index 7400e0d..8c18d25 100644 --- a/src/data/catalog-enrichment.ts +++ b/src/data/catalog-enrichment.ts @@ -87,9 +87,8 @@ export const COMPONENT_ENRICHMENT: Readonly> 'Chosen blob adapter binding (R2 bucket, Azure container, or S3 credentials)', 'Authorization and malware scanning at the host API — not inside the store', ], - // Same `storage` tag as record storage so plan_composition can surface it; - // agents still pick packages via host-filtered adapters. - capabilityTags: ['storage', 'cloudflare', 'azure'], + // Distinct from record `storage` so generic storage plans do not pull R2/Blob. + capabilityTags: ['storage_blobs', 'cloudflare', 'azure'], }, 'authorization-core': { dependencies: [ diff --git a/src/data/catalog-schema.test.ts b/src/data/catalog-schema.test.ts index 7acbd0d..1c927b0 100644 --- a/src/data/catalog-schema.test.ts +++ b/src/data/catalog-schema.test.ts @@ -56,6 +56,7 @@ const CAPABILITY_TAGS = new Set([ 'sessions', 'authorization', 'storage', + 'storage_blobs', 'audit', 'mail_transactional', 'rate_limit_durable', diff --git a/src/data/catalog-schema.ts b/src/data/catalog-schema.ts index 3649a3d..636bd62 100644 --- a/src/data/catalog-schema.ts +++ b/src/data/catalog-schema.ts @@ -54,6 +54,8 @@ export type CapabilityTag = | 'sessions' | 'authorization' | 'storage' + /** Opaque object/blob bytes (storage-blobs); distinct from record storage. */ + | 'storage_blobs' | 'audit' | 'mail_transactional' | 'rate_limit_durable' diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index f2a2810..8122fda 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -547,6 +547,7 @@ export const CAPABILITY_TAGS = [ 'sessions', 'authorization', 'storage', + 'storage_blobs', 'audit', 'mail_transactional', 'rate_limit_durable', From 2630701561c085f2f6e78766c2f9c77ab0c23972 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 12:32:11 -0400 Subject: [PATCH 6/7] [4] Tighten plan selection and package pins; stale catalog fallback Require meaningful core-tag coverage so incidental single-tag hits do not select heavy recipes. Prefer primary-recipe package pins over dumping every package on multi-package components. Serve stale catalog on revalidation failure when a warm isolate cache exists. --- src/data/mcp-tools.test.ts | 26 +++++- src/data/mcp-tools.ts | 114 ++++++++++++++++++++++++--- worker/src/mcp-catalog-fetch.test.ts | 23 +++++- worker/src/mcp-catalog-fetch.ts | 62 +++++++++------ 4 files changed, 186 insertions(+), 39 deletions(-) diff --git a/src/data/mcp-tools.test.ts b/src/data/mcp-tools.test.ts index fe0095e..db6c183 100644 --- a/src/data/mcp-tools.test.ts +++ b/src/data/mcp-tools.test.ts @@ -80,17 +80,37 @@ describe('plan_composition', () => { }); it('does not merge alternative recipes into the package plan', () => { + // Broad request that meaningfully covers both accounts and outbox recipes. const plan = planComposition(exampleCatalog, { - capabilityTags: ['storage', 'cloudflare'], + capabilityTags: [ + 'accounts', + 'passkeys', + 'storage', + 'audit', + 'mail_transactional', + 'cloudflare', + ], productionOnly: false, }); - // Both accounts and outbox may match storage+cloudflare; packages come - // only from the primary recipe closure. expect(plan.recipes.length).toBeGreaterThan(1); expect(plan.notes.some((n) => n.startsWith('primary recipe:'))).toBe(true); expect(plan.notes.some((n) => n.includes('alternatives'))).toBe(true); }); + it('rejects incidental single-tag recipe selection', () => { + const plan = planComposition(exampleCatalog, { + capabilityTags: ['storage'], + productionOnly: false, + }); + // Accounts recipe shares storage only as an incidental tag — skip it. + expect(plan.recipes.map((r) => r.id)).not.toContain('example-accounts'); + expect( + plan.skipped.some( + (s) => s.id === 'example-accounts' && s.reason.includes('incidental'), + ), + ).toBe(true); + }); + it('filters adapter packages by host', () => { const plan = planComposition(exampleCatalog, { capabilityTags: ['storage', 'cloudflare'], diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index 8122fda..7587564 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -89,6 +89,41 @@ function tagOverlap( return n; } +/** Host / ambient tags that do not alone justify a heavy composition. */ +const AMBIENT_TAGS = new Set([ + 'cloudflare', + 'azure', + 'static_host', + 'logging', + 'events_in_process', +]); + +/** + * Core (non-ambient) tags on a recipe/component. Used to reject selections + * that only share an incidental tag (e.g. accounts recipe via `storage`). + */ +function coreTags(tags: readonly CapabilityTag[]): CapabilityTag[] { + return tags.filter((t) => !AMBIENT_TAGS.has(t)); +} + +/** + * True when the request covers enough of the item's core tags that selecting + * it is not an incidental single-tag hit. + */ +function meaningfulCoverage( + itemTags: readonly CapabilityTag[], + requested: readonly CapabilityTag[], +): boolean { + const core = coreTags(itemTags); + if (core.length === 0) { + // Ambient-only items: require at least one requested ambient match. + return tagOverlap(itemTags, requested) > 0; + } + const covered = tagOverlap(core, requested); + // At least half of the item's core tags must be requested. + return covered * 2 >= core.length; +} + function toComponentListItem(c: CatalogComponent): ComponentListItem { return { id: c.id, @@ -194,6 +229,14 @@ export function planComposition( for (const c of catalog.components) { let score = tagOverlap(c.capabilityTags, requestedTags); if (score === 0) continue; + if (!meaningfulCoverage(c.capabilityTags, requestedTags)) { + skipped.push({ + id: c.id, + kind: 'component', + reason: 'incidental tag overlap only (insufficient core-tag coverage)', + }); + continue; + } if (productionOnly && c.publishUsability === 'unpublished') { skipped.push({ @@ -223,6 +266,7 @@ export function planComposition( 'email_codes', 'sessions', 'storage', + 'storage_blobs', 'mail_transactional', 'webhooks_inbound', 'support_queue', @@ -244,6 +288,10 @@ export function planComposition( scoredComponents.sort((a, b) => { if (b.score !== a.score) return b.score - a.score; + // Prefer more specific components when scores tie. + const sa = a.score / Math.max(1, a.component.capabilityTags.length); + const sb = b.score / Math.max(1, b.component.capabilityTags.length); + if (sb !== sa) return sb - sa; return a.component.id.localeCompare(b.component.id); }); @@ -253,6 +301,14 @@ export function planComposition( for (const r of catalog.recipes) { const score = tagOverlap(r.capabilityTags, requestedTags); if (score === 0) continue; + if (!meaningfulCoverage(r.capabilityTags, requestedTags)) { + skipped.push({ + id: r.id, + kind: 'recipe', + reason: 'incidental tag overlap only (insufficient core-tag coverage)', + }); + continue; + } if (productionOnly) { if (r.fixture.status !== 'green') { @@ -285,6 +341,7 @@ export function planComposition( } } + let finalScore = score; if (input.host) { const adapterHosts = r.adapters .map((ref) => { @@ -298,16 +355,19 @@ export function planComposition( !adapterHosts.includes('memory') ) { // Soft demote: still include but lower score for host mismatch. - scoredRecipes.push({ recipe: r, score: score - 0.5 }); - continue; + finalScore = score - 0.5; } } - scoredRecipes.push({ recipe: r, score }); + scoredRecipes.push({ recipe: r, score: finalScore }); } scoredRecipes.sort((a, b) => { if (b.score !== a.score) return b.score - a.score; + // Prefer more specific recipes when raw overlap ties. + const sa = a.score / Math.max(1, a.recipe.capabilityTags.length); + const sb = b.score / Math.max(1, b.recipe.capabilityTags.length); + if (sb !== sa) return sb - sa; // Prefer green fixtures, then backlog priority (lower = first). const fixtureRank = (s: CatalogRecipe['fixture']['status']) => s === 'green' ? 0 : s === 'pending' ? 1 : 2; @@ -426,8 +486,15 @@ export function planComposition( }); }; - // Packages from closed components (host-filtered) plus primary recipe pins. - const packages: PlanCompositionResult['packages'][number][] = []; + // Install set: when a primary recipe exists, start from its pins (fixture- + // tested). Do not dump every package on multi-package components (Auth0, + // Stripe, …) that happen to be in the requires-closure. + const packages: { + name: string; + version: string | null; + published: boolean; + componentId: string; + }[] = []; const seenPkg = new Set(); const pushPkg = ( name: string, @@ -442,13 +509,31 @@ export function planComposition( packages.push({ name, version, published, componentId }); }; - for (const c of selectedComponents) { - for (const p of packagesForComponent(c)) { + const emitComponentPackages = (c: CatalogComponent) => { + const filtered = packagesForComponent(c); + // Multi-package components without adapter metadata: only the first + // published package unless a recipe pin named more (handled separately). + if (c.packages.length > 2 && c.adapters.length === 0) { + const firstPublished = filtered.find((p) => p.published) ?? filtered[0]; + if (firstPublished) { + pushPkg( + firstPublished.name, + firstPublished.version, + firstPublished.published, + c.id, + ); + } + return; + } + for (const p of filtered) { pushPkg(p.name, p.version, p.published, c.id); } - } + }; if (primaryRecipe) { + const recipeNamedPackages = new Set( + primaryRecipe.packages.map((spec) => parsePackageSpecifier(spec).name), + ); for (const spec of primaryRecipe.packages) { const { name, version: pinned } = parsePackageSpecifier(spec); const owner = catalog.components.find((c) => @@ -457,8 +542,6 @@ export function planComposition( if (!owner) continue; const pkg = owner.packages.find((p) => p.name === name); if (!pkg) continue; - // Do not re-introduce host-mismatched adapter packages named by the - // recipe when the caller requested a different host. const allowed = packagesForComponent(owner).some((p) => p.name === name); if (!allowed) { notes.push( @@ -473,6 +556,17 @@ export function planComposition( owner.id, ); } + // Tag-matched add-ons not named by the recipe (e.g. health with accounts). + for (const s of scoredComponents) { + const c = s.component; + const namedByRecipe = c.packages.some((p) => recipeNamedPackages.has(p.name)); + if (namedByRecipe) continue; + emitComponentPackages(c); + } + } else { + for (const c of selectedComponents) { + emitComponentPackages(c); + } } // Host-specific adapter hints. diff --git a/worker/src/mcp-catalog-fetch.test.ts b/worker/src/mcp-catalog-fetch.test.ts index 294654d..082b131 100644 --- a/worker/src/mcp-catalog-fetch.test.ts +++ b/worker/src/mcp-catalog-fetch.test.ts @@ -78,11 +78,32 @@ describe('fetchCompositionCatalog', () => { ); }); - it('rejects invalid shapes', async () => { + it('rejects invalid shapes when cold', async () => { const fetchImpl = async () => new Response(JSON.stringify({ nope: true }), { status: 200 }); await expect( fetchCompositionCatalog({}, { fetchImpl, now: 0 }), ).rejects.toThrow(/invalid_shape/); }); + + it('serves stale cache when revalidation fails', async () => { + let calls = 0; + const fetchImpl = async () => { + calls += 1; + if (calls === 1) { + return new Response(JSON.stringify(sample), { + status: 200, + headers: { ETag: '"v1"' }, + }); + } + return new Response('down', { status: 503 }); + }; + await fetchCompositionCatalog({}, { fetchImpl, now: 0 }); + const stale = await fetchCompositionCatalog( + {}, + { fetchImpl, now: CATALOG_CACHE_TTL_MS + 1 }, + ); + expect(stale.generatedAt).toBe(sample.generatedAt); + expect(calls).toBe(2); + }); }); diff --git a/worker/src/mcp-catalog-fetch.ts b/worker/src/mcp-catalog-fetch.ts index 5c3dd4c..f33499b 100644 --- a/worker/src/mcp-catalog-fetch.ts +++ b/worker/src/mcp-catalog-fetch.ts @@ -67,30 +67,42 @@ export async function fetchCompositionCatalog( headers['If-None-Match'] = cache.etag; } - const res = await fetchImpl(url, { - headers, - signal: AbortSignal.timeout(10_000), - }); - - if (res.status === 304 && cache) { - cache = { ...cache, fetchedAt: now }; - return cache.catalog; - } - - if (!res.ok) { - throw new Error(`catalog_fetch_failed:${res.status}`); + try { + const res = await fetchImpl(url, { + headers, + signal: AbortSignal.timeout(10_000), + }); + + if (res.status === 304 && cache) { + cache = { ...cache, fetchedAt: now }; + return cache.catalog; + } + + if (!res.ok) { + if (cache) { + // Public fact surface already accepts short staleness; keep serving. + return cache.catalog; + } + throw new Error(`catalog_fetch_failed:${res.status}`); + } + + const body: unknown = await res.json(); + if (!isCompositionCatalog(body)) { + if (cache) return cache.catalog; + throw new Error('catalog_fetch_invalid_shape'); + } + + const etag = res.headers.get('ETag'); + cache = { + catalog: body, + fetchedAt: now, + etag, + }; + return body; + } catch (error) { + if (cache) { + return cache.catalog; + } + throw error; } - - const body: unknown = await res.json(); - if (!isCompositionCatalog(body)) { - throw new Error('catalog_fetch_invalid_shape'); - } - - const etag = res.headers.get('ETag'); - cache = { - catalog: body, - fetchedAt: now, - etag, - }; - return body; } From a54b727da47ae80f8597d570d84499b75f4611cc Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 12:43:39 -0400 Subject: [PATCH 7/7] [4] Fix exclusive-tag coverage, host adapters, catalog backoff Allow singular accounts/passkeys requests while still rejecting incidental storage-only selection of the accounts recipe. Emit host adapter packages beside recipe core pins. On revalidation failure, serve stale catalog and reset TTL to back off. --- src/data/mcp-tools.ts | 85 +++++++++++++++++++++++++-------- worker/src/mcp-catalog-fetch.ts | 9 +++- 2 files changed, 72 insertions(+), 22 deletions(-) diff --git a/src/data/mcp-tools.ts b/src/data/mcp-tools.ts index 7587564..19cc917 100644 --- a/src/data/mcp-tools.ts +++ b/src/data/mcp-tools.ts @@ -99,29 +99,50 @@ const AMBIENT_TAGS = new Set([ ]); /** - * Core (non-ambient) tags on a recipe/component. Used to reject selections - * that only share an incidental tag (e.g. accounts recipe via `storage`). + * Exclusive intent tags. Sharing only a non-exclusive tag (e.g. `storage`) + * must not select a recipe whose exclusive intents were not requested. + */ +const EXCLUSIVE_TAGS = new Set([ + 'accounts', + 'passkeys', + 'email_codes', + 'webhooks_inbound', + 'support_queue', + 'storage_blobs', + 'rate_limit_durable', + 'rate_limit_memory', +]); + +/** + * Core (non-ambient) tags on a recipe/component. */ function coreTags(tags: readonly CapabilityTag[]): CapabilityTag[] { return tags.filter((t) => !AMBIENT_TAGS.has(t)); } /** - * True when the request covers enough of the item's core tags that selecting - * it is not an incidental single-tag hit. + * True when selecting this item for the request is not an incidental tag hit. + * Allows singular requests like `accounts` or `accounts`+`passkeys` to match + * the accounts recipe, while rejecting that recipe for a bare `storage` request. */ function meaningfulCoverage( itemTags: readonly CapabilityTag[], requested: readonly CapabilityTag[], ): boolean { - const core = coreTags(itemTags); - if (core.length === 0) { - // Ambient-only items: require at least one requested ambient match. + const itemCore = coreTags(itemTags); + const reqCore = coreTags(requested); + if (itemCore.length === 0) { return tagOverlap(itemTags, requested) > 0; } - const covered = tagOverlap(core, requested); - // At least half of the item's core tags must be requested. - return covered * 2 >= core.length; + const overlap = tagOverlap(itemCore, reqCore.length > 0 ? reqCore : requested); + if (overlap === 0) return false; + + const unrequestedExclusive = itemCore.filter( + (t) => EXCLUSIVE_TAGS.has(t) && !requested.includes(t), + ); + // More unrequested exclusive intents than overlapping tags → incidental. + if (unrequestedExclusive.length > overlap) return false; + return true; } function toComponentListItem(c: CatalogComponent): ComponentListItem { @@ -511,18 +532,26 @@ export function planComposition( const emitComponentPackages = (c: CatalogComponent) => { const filtered = packagesForComponent(c); - // Multi-package components without adapter metadata: only the first - // published package unless a recipe pin named more (handled separately). + // Multi-package components without adapter metadata: do not invent a + // "primary" package — list published packages and note the host must choose + // integrations. Prefer failing open on names over silently dropping deps. if (c.packages.length > 2 && c.adapters.length === 0) { - const firstPublished = filtered.find((p) => p.published) ?? filtered[0]; - if (firstPublished) { - pushPkg( - firstPublished.name, - firstPublished.version, - firstPublished.published, - c.id, - ); + for (const p of filtered) { + if (!p.published && productionOnly) continue; + // Skip known third-party integration package name suffixes when not + // requested via recipe pins (auth0/stripe/tokens-style integrations). + if ( + /-(auth0|stripe|tokens)$/.test(p.name) || + p.name.endsWith('-auth0') || + p.name.endsWith('-stripe') + ) { + continue; + } + pushPkg(p.name, p.version, p.published, c.id); } + notes.push( + `${c.id}: multi-package component — install set lists published packages without third-party integrations; confirm against the component README`, + ); return; } for (const p of filtered) { @@ -534,6 +563,7 @@ export function planComposition( const recipeNamedPackages = new Set( primaryRecipe.packages.map((spec) => parsePackageSpecifier(spec).name), ); + const recipeOwners = new Set(); for (const spec of primaryRecipe.packages) { const { name, version: pinned } = parsePackageSpecifier(spec); const owner = catalog.components.find((c) => @@ -549,6 +579,7 @@ export function planComposition( ); continue; } + recipeOwners.add(owner.id); pushPkg( pkg.name, pinned && pinned.length > 0 ? pinned : pkg.version, @@ -556,6 +587,20 @@ export function planComposition( owner.id, ); } + // Host adapter packages for recipe owners (e.g. D1 beside storage-core pin). + if (input.host) { + for (const ownerId of recipeOwners) { + const owner = componentById.get(ownerId); + if (!owner) continue; + for (const a of owner.adapters) { + if (a.host !== input.host && a.host !== 'memory') continue; + if (!a.packageName) continue; + const pkg = owner.packages.find((p) => p.name === a.packageName); + if (!pkg) continue; + pushPkg(pkg.name, pkg.version, pkg.published, owner.id); + } + } + } // Tag-matched add-ons not named by the recipe (e.g. health with accounts). for (const s of scoredComponents) { const c = s.component; diff --git a/worker/src/mcp-catalog-fetch.ts b/worker/src/mcp-catalog-fetch.ts index f33499b..e6ccbe6 100644 --- a/worker/src/mcp-catalog-fetch.ts +++ b/worker/src/mcp-catalog-fetch.ts @@ -80,7 +80,8 @@ export async function fetchCompositionCatalog( if (!res.ok) { if (cache) { - // Public fact surface already accepts short staleness; keep serving. + // Back off: keep serving stale and reset TTL so we do not hammer. + cache = { ...cache, fetchedAt: now }; return cache.catalog; } throw new Error(`catalog_fetch_failed:${res.status}`); @@ -88,7 +89,10 @@ export async function fetchCompositionCatalog( const body: unknown = await res.json(); if (!isCompositionCatalog(body)) { - if (cache) return cache.catalog; + if (cache) { + cache = { ...cache, fetchedAt: now }; + return cache.catalog; + } throw new Error('catalog_fetch_invalid_shape'); } @@ -101,6 +105,7 @@ export async function fetchCompositionCatalog( return body; } catch (error) { if (cache) { + cache = { ...cache, fetchedAt: now }; return cache.catalog; } throw error;