@weavecode/weave 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
- package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +3 -3
- package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
- package/node_modules/@weavecode/cli/package.json +5 -5
- package/node_modules/@weavecode/core/dist/harness.d.ts +78 -0
- package/node_modules/@weavecode/core/dist/harness.js +1 -1
- package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/core/dist/index.js +1 -1
- package/node_modules/@weavecode/core/package.json +1 -1
- package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
- package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
- package/node_modules/@weavecode/harness/dist/driver.d.ts +6 -0
- package/node_modules/@weavecode/harness/dist/zcode/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/zcode/capture.js +3 -3
- package/node_modules/@weavecode/harness/dist/zcode/mcp.js +2 -2
- package/node_modules/@weavecode/harness/package.json +2 -2
- package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/launch.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +6 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
- package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
- package/node_modules/@weavecode/server/dist/daemon/server.d.ts +2 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
- package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
- package/node_modules/@weavecode/server/dist/db/db.js +2 -2
- package/node_modules/@weavecode/server/dist/db/paths.d.ts +4 -0
- package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
- package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/index.js +1 -1
- package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +6 -0
- package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
- package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
- package/node_modules/@weavecode/server/package.json +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-t5OQjhuS.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{arc-CRZTRyjb.js → arc-De-uH_Q9.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-ImPclD43.js +36 -0
- package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-BIH8mSIZ.js → blockDiagram-RJAE7QA3-B5xEQs6X.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-5YoKWFOD.js → c4Diagram-XDPPPE54-DP8MjIgJ.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/channel-C0RGiobt.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-B653kMXt.js → chunk-2E7WHVMD-C3UFIDyj.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-f_A4_eDz.js → chunk-2Q5K7J3B-Bgw-3YfG.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-v5j5qNGj.js → chunk-4EMNKR2T-Dy_Wq9qn.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D32C0DXX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-BeROhLXN.js → chunk-5VM5RSS4-Dpmi-9Gi.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-D6dXb_jr.js → chunk-JWPE2WC7-CEYXaZDX.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CnHdSEMi.js → chunk-VQ5W62QI-A616Pgzo.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-CnxFMLWV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-BhjCTig8.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-DQe1b_k8.js → classDiagram-v2-4MYWR3UA-rzlq5tPv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-CxWQXzj8.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-OZotFKUu.js → cynefin-EF2NZ3EQ-AFHjx2wU.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-Bp_Oaf9U.js +62 -0
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-7oUPIU35.js +4 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D_rS_rSY.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Duc_cKMb.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-D9A6W8oB.js → diagram-ODIL2UCW-DA0XFVXm.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-PeI-eyu2.js → diagram-PFBEJUXE-D1U0Xhtt.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-CbDFY871.js +41 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-D5KieEw5.js → diagram-TYUNFSNR-jPg9AxQv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-ZHfGTB0N.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-D3xrVg0U.js → elk-QONTBCTQ-C-ESJrUi.js} +3 -3
- package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-y_V1cor7.js → erDiagram-KYQIGQAA-DGK7TeHj.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-BJ8Z0MkF.js → flowDiagram-IUGLLWBU-CVV4rL8v.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-CuAwNvbm.js +292 -0
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-D_15Wtf-.js +106 -0
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-ClqhbrCa.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-ChEnND76.js → ishikawaDiagram-HPEHV2GE-CUJ891JX.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-DHcNtpYF.js → journeyDiagram-BOSHW7O7-B4skiMu-.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-Dft7qpW5.js → kanban-definition-FNSA4HC5-UNGJR_y_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-BEB-UwbR.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-B_0jS_Gz.js +1096 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-Czzlavi4.css +11 -0
- package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D_Dp_Kl2.js → mermaid.core-knGXJfjz.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-CM6OAd_-.js → mindmap-definition-6OY57UG3-CEldbr3a.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-cNCkGLx3.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pet-DJCpIDM5.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-CfMEFiQD.js +39 -0
- package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-D8pQ_PU2.js → quadrantDiagram-D57K4MC3-knmi2rwP.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-BJ7AzhEo.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-C90DU5Ny.js → requirementDiagram-EQYSW5RA-Dte2LGQM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-B_poYGgJ.js → sankeyDiagram-SY24JHO5-3noLaWgd.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-DDW7b2Dn.js → sequenceDiagram-BLEHNHQU-CclOWTTc.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-B82sbLhA.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-CkVMAyxG.js → stateDiagram-v2-A6IESKWZ-BXfVDwSN.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-D4lKZaeV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DbdFh_d6.js +8 -0
- package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-DnhkRGLb.js → timeline-definition-JXYKGLGB-D6H6zP5b.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-_TdIjC6Z.js → usecaseDiagram-WPOLBNNX-D2J2bKo_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-FzgsymXB.js → vennDiagram-Q3Y3IDCW-pdRbIkpB.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-BwqimStC.js → wardleyDiagram-IVAIDKWA-Cyd2QPMf.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-CFjjVPIV.js → xychartDiagram-4URNHDU4-Bd4BkwVM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/index.html +3 -2
- package/node_modules/@weavecode/server/web/dist/pet.html +60 -0
- package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
- package/node_modules/@weavecode/templates/dist/index.js +1 -1
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/scripts/assemble-pet.mjs +308 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
- package/node_modules/@weavecode/templates/package.json +2 -2
- package/package.json +11 -7
- package/scripts/preinstall.mjs +70 -0
- package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-DDeQkTf5.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-Dj54DE3O.js +0 -36
- package/node_modules/@weavecode/server/web/dist/assets/channel-5VM93AJ8.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-CgEqeP7j.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-BkG_e6PE.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-DxR-fxzs.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-DThrA8S5.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-DJjq2hfT.js +0 -62
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-C2vH93HT.js +0 -4
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-DrF_ScM-.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-D1qoUJ4t.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-DITY0Rd8.js +0 -41
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-DDylK-gz.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-C0q-CS1T.js +0 -292
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-BYTComiB.js +0 -106
- package/node_modules/@weavecode/server/web/dist/assets/index-BKxAxaVG.js +0 -1091
- package/node_modules/@weavecode/server/web/dist/assets/index-C0Sd4MH7.css +0 -11
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-DtixgjLP.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-DEo11t-X.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-_QkY0h8Q.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-ZGr5vtDj.js +0 -39
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-DUIo-WmA.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-CmKoqX6K.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Dm_Omzky.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-Bjj8ZA4d.js +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_middleware_serve_static_index = require("../../middleware/serve-static/index.js");
|
|
3
|
-
let node_fs_promises = require("node:fs/promises");
|
|
4
3
|
let node_path = require("node:path");
|
|
4
|
+
let node_fs_promises = require("node:fs/promises");
|
|
5
5
|
//#region src/adapter/bun/serve-static.ts
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_adapter_bun_server = require("./server.js");
|
|
3
2
|
const require_helper_websocket_index = require("../../helper/websocket/index.js");
|
|
3
|
+
const require_adapter_bun_server = require("./server.js");
|
|
4
4
|
//#region src/adapter/bun/websocket.ts
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -198,7 +198,7 @@ var Context = class {
|
|
|
198
198
|
* ```
|
|
199
199
|
*/
|
|
200
200
|
header = (name, value, options) => {
|
|
201
|
-
if (this.finalized) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
201
|
+
if (this.finalized && !this.#res.bodyUsed) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
202
202
|
const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
|
|
203
203
|
if (value === void 0) headers.delete(name);
|
|
204
204
|
else if (options?.append) headers.append(name, value);
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js
CHANGED
|
@@ -80,10 +80,8 @@ const buildStyleString = (strings, values) => {
|
|
|
80
80
|
for (let j = 0, len = vArray.length; j < len; j++) {
|
|
81
81
|
let value = vArray[j];
|
|
82
82
|
if (typeof value === "boolean" || value === null || value === void 0) continue;
|
|
83
|
-
if (typeof value === "string")
|
|
84
|
-
|
|
85
|
-
else styleString += value;
|
|
86
|
-
} else if (typeof value === "number") styleString += value;
|
|
83
|
+
if (typeof value === "string") styleString += value.replace(/[\\"']/g, "\\$&");
|
|
84
|
+
else if (typeof value === "number") styleString += value;
|
|
87
85
|
else if (value[CSS_ESCAPED]) styleString += value[CSS_ESCAPED];
|
|
88
86
|
else if (value[CLASS_NAME].startsWith("@keyframes ")) {
|
|
89
87
|
selectors.push(value);
|
|
@@ -108,7 +106,7 @@ const buildStyleString = (strings, values) => {
|
|
|
108
106
|
}
|
|
109
107
|
return [
|
|
110
108
|
label,
|
|
111
|
-
minify(styleString),
|
|
109
|
+
minify(styleString).replace(/<\//g, "<\\/"),
|
|
112
110
|
selectors,
|
|
113
111
|
externalClassNames
|
|
114
112
|
];
|
|
@@ -4,6 +4,7 @@ const require_utils_url = require("./utils/url.js");
|
|
|
4
4
|
const require_context = require("./context.js");
|
|
5
5
|
const require_router = require("./router.js");
|
|
6
6
|
const require_utils_constants = require("./utils/constants.js");
|
|
7
|
+
const require_utils_mount = require("./utils/mount.js");
|
|
7
8
|
//#region src/hono-base.ts
|
|
8
9
|
/**
|
|
9
10
|
* @module
|
|
@@ -228,17 +229,10 @@ var Hono = class Hono {
|
|
|
228
229
|
} catch {}
|
|
229
230
|
return [c.env, executionContext];
|
|
230
231
|
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
234
|
-
return (request) => {
|
|
235
|
-
const url = new URL(request.url);
|
|
236
|
-
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
237
|
-
return new Request(url, request);
|
|
238
|
-
};
|
|
239
|
-
})();
|
|
232
|
+
const mergedPath = require_utils_url.mergePath(this._basePath, path);
|
|
233
|
+
const defaultReplaceRequest = (c) => require_utils_mount.createMountedRequest(c, mergedPath.replace(/\/$/, ""), require_utils_url.mergePath(mergedPath, "*"));
|
|
240
234
|
const handler = async (c, next) => {
|
|
241
|
-
const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
|
|
235
|
+
const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
|
|
242
236
|
if (res) return res;
|
|
243
237
|
await next();
|
|
244
238
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_hono_base = require("./hono-base.js");
|
|
3
3
|
const require_router_reg_exp_router_router = require("./router/reg-exp-router/router.js");
|
|
4
|
-
require("./router/reg-exp-router/index.js");
|
|
5
4
|
const require_router_smart_router_router = require("./router/smart-router/router.js");
|
|
6
5
|
const require_router_trie_router_router = require("./router/trie-router/router.js");
|
|
7
6
|
require("./router/trie-router/index.js");
|
|
@@ -81,7 +81,7 @@ const basicAuth = (options, ...users) => {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
const status = 401;
|
|
84
|
-
const headers = { "WWW-Authenticate": "Basic realm=\"" + options.realm?.replace(/"/g, "
|
|
84
|
+
const headers = { "WWW-Authenticate": "Basic realm=\"" + options.realm?.replace(/[\\"]/g, "\\$&") + "\"" };
|
|
85
85
|
const responseMessage = typeof options.invalidUserMessage === "function" ? await options.invalidUserMessage(ctx) : options.invalidUserMessage;
|
|
86
86
|
const res = typeof responseMessage === "string" ? new Response(responseMessage, {
|
|
87
87
|
status,
|
|
@@ -45,7 +45,7 @@ const bearerAuth = (options) => {
|
|
|
45
45
|
if (!("token" in options || "verifyToken" in options)) throw new Error("bearer auth middleware requires options for \"token\" or \"verifyToken\"");
|
|
46
46
|
if (!options.realm) options.realm = "";
|
|
47
47
|
if (options.prefix === void 0) options.prefix = PREFIX;
|
|
48
|
-
const realm = options.realm?.replace(/"/g, "
|
|
48
|
+
const realm = options.realm?.replace(/[\\"]/g, "\\$&");
|
|
49
49
|
const prefix = options.prefix;
|
|
50
50
|
const tokenRegexp = new RegExp(`^${TOKEN_STRINGS}$`);
|
|
51
51
|
const wwwAuthenticatePrefix = prefix === "" ? "" : `${prefix} `;
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const secFetchSiteValues = [
|
|
|
9
9
|
];
|
|
10
10
|
const isSecFetchSite = (value) => secFetchSiteValues.includes(value);
|
|
11
11
|
const isSafeMethodRe = /^(GET|HEAD|OPTIONS)$/;
|
|
12
|
-
const
|
|
12
|
+
const isCsrfContentTypeRe = /^\b(application\/x-www-form-urlencoded|multipart\/form-data|text\/(?:plain|ping))\b/i;
|
|
13
13
|
/**
|
|
14
14
|
* CSRF Protection Middleware for Hono.
|
|
15
15
|
*
|
|
@@ -95,7 +95,7 @@ const csrf = (options) => {
|
|
|
95
95
|
return await secFetchSiteHandler(secFetchSite, c);
|
|
96
96
|
};
|
|
97
97
|
return async function csrf(c, next) {
|
|
98
|
-
if (!isSafeMethodRe.test(c.req.method) &&
|
|
98
|
+
if (!isSafeMethodRe.test(c.req.method) && isCsrfContentTypeRe.test(c.req.header("content-type") || "text/plain") && !await isAllowedSecFetchSite(c.req.header("sec-fetch-site"), c) && !await isAllowedOrigin(c.req.header("origin"), c)) {
|
|
99
99
|
const res = new Response("Forbidden", { status: 403 });
|
|
100
100
|
throw new require_http_exception.HTTPException(403, { res });
|
|
101
101
|
}
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js
CHANGED
|
@@ -110,8 +110,8 @@ const jwk = (options, init) => {
|
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
function unauthorizedResponse(opts) {
|
|
113
|
-
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "
|
|
114
|
-
const errDescription = opts.errDescription.replace(/"/g, "
|
|
113
|
+
const realm = (opts.realm ?? opts.ctx.req.url).replace(/[\\"]/g, "\\$&");
|
|
114
|
+
const errDescription = opts.errDescription.replace(/[\\"]/g, "\\$&");
|
|
115
115
|
return new Response("Unauthorized", {
|
|
116
116
|
status: 401,
|
|
117
117
|
statusText: opts.statusText,
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js
CHANGED
|
@@ -104,8 +104,8 @@ const jwt = (options) => {
|
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
106
|
function unauthorizedResponse(opts) {
|
|
107
|
-
const realm = (opts.realm ?? opts.ctx.req.url).replace(/"/g, "
|
|
108
|
-
const errDescription = opts.errDescription.replace(/"/g, "
|
|
107
|
+
const realm = (opts.realm ?? opts.ctx.req.url).replace(/[\\"]/g, "\\$&");
|
|
108
|
+
const errDescription = opts.errDescription.replace(/[\\"]/g, "\\$&");
|
|
109
109
|
return new Response("Unauthorized", {
|
|
110
110
|
status: 401,
|
|
111
111
|
statusText: opts.statusText,
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils_mount = require("../../utils/mount.js");
|
|
2
3
|
const require_helper_route_index = require("../../helper/route/index.js");
|
|
3
4
|
//#region src/middleware/mount/index.ts
|
|
4
5
|
const defaultReplaceRequest = (c) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
url.pathname = c.req.path.slice(pathPrefix.length) || "/";
|
|
8
|
-
return new Request(url, c.req.raw);
|
|
6
|
+
const path = require_helper_route_index.routePath(c);
|
|
7
|
+
return require_utils_mount.createMountedRequest(c, path.replace(/\/?\*$/, ""), path);
|
|
9
8
|
};
|
|
10
9
|
const defaultGetOptions = (c) => {
|
|
11
10
|
let executionContext = void 0;
|
|
@@ -22,6 +21,7 @@ const defaultGetOptions = (c) => {
|
|
|
22
21
|
* @param {Function} applicationHandler - other Request Handler
|
|
23
22
|
* @param {MountOptions} [options] - options of `mount()`
|
|
24
23
|
* @returns {MiddlewareHandler} handler to register with `app.all()`
|
|
24
|
+
* @throws {Error} If the route ends with a wildcard inside a segment (e.g. `/assets*`), or automatic request rewriting encounters duplicate path parameter names.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```ts
|
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_router_utils = require("../utils.js");
|
|
3
3
|
//#region src/router/reg-exp-router/node.ts
|
|
4
4
|
const LABEL_REG_EXP_STR = "[^/]+";
|
|
5
|
-
const ONLY_WILDCARD_REG_EXP_STR = "
|
|
6
|
-
const TAIL_WILDCARD_REG_EXP_STR = "(
|
|
5
|
+
const ONLY_WILDCARD_REG_EXP_STR = "[^]*";
|
|
6
|
+
const TAIL_WILDCARD_REG_EXP_STR = "(?:|/[^]*)";
|
|
7
7
|
const PATH_ERROR = Symbol();
|
|
8
8
|
const regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
|
|
9
9
|
/**
|
|
@@ -16,8 +16,8 @@ const regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
|
|
|
16
16
|
function compareKey(a, b) {
|
|
17
17
|
if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
|
|
18
18
|
if (b.length === 1) return 1;
|
|
19
|
-
if (a === "
|
|
20
|
-
else if (b === "
|
|
19
|
+
if (a === "[^]*" || a === "(?:|/[^]*)") return b === "[^]*" ? -1 : 1;
|
|
20
|
+
else if (b === "[^]*" || b === "(?:|/[^]*)") return -1;
|
|
21
21
|
if (a === "[^/]+") return 1;
|
|
22
22
|
else if (b === "[^/]+") return -1;
|
|
23
23
|
return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
|
|
@@ -26,14 +26,14 @@ var Node = class Node {
|
|
|
26
26
|
#index;
|
|
27
27
|
#varIndex;
|
|
28
28
|
#children = require_router_utils.createNullObject();
|
|
29
|
-
insert(tokens, index, paramMap, context,
|
|
29
|
+
insert(tokens, index, paramMap, context, keys) {
|
|
30
30
|
let node = this;
|
|
31
31
|
for (let i = 0, len = tokens.length; i < len; i++) {
|
|
32
32
|
const token = tokens[i];
|
|
33
33
|
const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? [
|
|
34
34
|
"",
|
|
35
35
|
"",
|
|
36
|
-
|
|
36
|
+
ONLY_WILDCARD_REG_EXP_STR
|
|
37
37
|
] : [
|
|
38
38
|
"",
|
|
39
39
|
"",
|
|
@@ -48,15 +48,16 @@ var Node = class Node {
|
|
|
48
48
|
const name = pattern[1];
|
|
49
49
|
let regexpStr = pattern[2] || "[^/]+";
|
|
50
50
|
if (name && pattern[2]) {
|
|
51
|
-
if (regexpStr
|
|
51
|
+
if (new RegExp(regexpStr).test("")) throw PATH_ERROR;
|
|
52
52
|
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
|
|
53
53
|
if (/\((?!\?:)/.test(regexpStr)) throw PATH_ERROR;
|
|
54
54
|
if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) throw PATH_ERROR;
|
|
55
55
|
}
|
|
56
|
+
keys.push(regexpStr);
|
|
56
57
|
nextNode = node.#children[regexpStr];
|
|
57
58
|
if (!nextNode) {
|
|
58
|
-
if (regexpStr !== "
|
|
59
|
-
for (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== "
|
|
59
|
+
if (regexpStr !== "[^]*" && regexpStr !== "(?:|/[^]*)") {
|
|
60
|
+
for (const k in node.#children) if ((regexpStr.length > 1 || k.length > 1) && k !== "[^]*" && k !== "(?:|/[^]*)") throw PATH_ERROR;
|
|
60
61
|
}
|
|
61
62
|
nextNode = node.#children[regexpStr] = new Node();
|
|
62
63
|
}
|
|
@@ -65,16 +66,17 @@ var Node = class Node {
|
|
|
65
66
|
paramMap.push([name, nextNode.#varIndex]);
|
|
66
67
|
}
|
|
67
68
|
} else {
|
|
69
|
+
keys.push(token);
|
|
68
70
|
nextNode = node.#children[token];
|
|
69
71
|
if (!nextNode) {
|
|
70
|
-
for (const k in node.#children) if (k.length > 1 && k !== "
|
|
72
|
+
for (const k in node.#children) if (k.length > 1 && k !== "[^]*" && k !== "(?:|/[^]*)") throw PATH_ERROR;
|
|
71
73
|
nextNode = node.#children[token] = new Node();
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
node = nextNode;
|
|
75
77
|
}
|
|
76
78
|
if (node.#index !== void 0) throw PATH_ERROR;
|
|
77
|
-
node.#index =
|
|
79
|
+
node.#index = index;
|
|
78
80
|
}
|
|
79
81
|
buildRegExpStr() {
|
|
80
82
|
const strList = Object.keys(this.#children).sort(compareKey).map((k) => {
|
|
@@ -28,7 +28,7 @@ var PreparedRegExpRouter = class {
|
|
|
28
28
|
if (!this.#matchers[method]) {
|
|
29
29
|
const all = this.#matchers["ALL"];
|
|
30
30
|
const staticMap = {};
|
|
31
|
-
for (const key in all[2]) staticMap[key] = [all[2][key][0].slice(),
|
|
31
|
+
for (const key in all[2]) staticMap[key] = [all[2][key][0].slice(), all[2][key][1]];
|
|
32
32
|
this.#matchers[method] = [
|
|
33
33
|
all[0],
|
|
34
34
|
all[1].map((list) => Array.isArray(list) ? list.slice() : 0),
|
|
@@ -72,7 +72,7 @@ const buildInitParams = ({ paths }) => {
|
|
|
72
72
|
...map
|
|
73
73
|
};
|
|
74
74
|
else relocateMap[path] = [[[], map]];
|
|
75
|
-
if (relocateMap[path][0][0].
|
|
75
|
+
if (!relocateMap[path][0][0].includes(i)) relocateMap[path][0][0].push(i);
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -80,7 +80,7 @@ const buildInitParams = ({ paths }) => {
|
|
|
80
80
|
if (p === path) {
|
|
81
81
|
relocateMap[path] ||= [[[]]];
|
|
82
82
|
const value = path2 === path ? "" : path2;
|
|
83
|
-
if (relocateMap[path][0][0].
|
|
83
|
+
if (!relocateMap[path][0][0].includes(value)) relocateMap[path][0][0].push(value);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -89,7 +89,7 @@ const buildInitParams = ({ paths }) => {
|
|
|
89
89
|
return [matchers, relocateMap];
|
|
90
90
|
};
|
|
91
91
|
const serializeInitParams = ([matchers, relocateMap]) => {
|
|
92
|
-
return `[${JSON.stringify(matchers, (_, value) => value instanceof RegExp ? `##${value
|
|
92
|
+
return `[${JSON.stringify(matchers, (_, value) => value instanceof RegExp || value === void 0 ? `##${value}##` : value).replace(/"##(.+?)##"/g, (_, str) => str.replace(/\\\\/g, "\\"))},${JSON.stringify(relocateMap)}]`;
|
|
93
93
|
};
|
|
94
94
|
//#endregion
|
|
95
95
|
exports.PreparedRegExpRouter = PreparedRegExpRouter;
|
|
@@ -6,21 +6,21 @@ const require_router_reg_exp_router_matcher = require("./matcher.js");
|
|
|
6
6
|
const require_router_reg_exp_router_node = require("./node.js");
|
|
7
7
|
const require_router_reg_exp_router_trie = require("./trie.js");
|
|
8
8
|
//#region src/router/reg-exp-router/router.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
9
|
+
function endsWithWildcard(keys) {
|
|
10
|
+
const tail = keys[keys.length - 1];
|
|
11
|
+
return tail === "[^]*" || tail === "(?:|/[^]*)";
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
13
|
+
function covers(wildcard, target) {
|
|
14
|
+
const last = wildcard.length - 1;
|
|
15
|
+
for (let i = 0; i < last; i++) if (wildcard[i] !== target[i]) return false;
|
|
16
|
+
return wildcard[last] === "[^]*" || target.length === last || target[last] === "/";
|
|
15
17
|
}
|
|
16
18
|
var RegExpRouter = class {
|
|
17
19
|
name = "RegExpRouter";
|
|
18
|
-
#
|
|
19
|
-
#routes;
|
|
20
|
+
#handlers;
|
|
20
21
|
#tries;
|
|
21
22
|
constructor() {
|
|
22
|
-
this.#
|
|
23
|
-
this.#routes = { ["ALL"]: require_router_utils.createNullObject() };
|
|
23
|
+
this.#handlers = { ["ALL"]: [] };
|
|
24
24
|
this.#tries = { ["ALL"]: new require_router_reg_exp_router_trie.Trie() };
|
|
25
25
|
}
|
|
26
26
|
#insertPath(method, path) {
|
|
@@ -31,65 +31,53 @@ var RegExpRouter = class {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
add(method, path, handler) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
for (const p in handlerMap["ALL"]) {
|
|
42
|
-
handlerMap[method][p] = [...handlerMap["ALL"][p]];
|
|
43
|
-
this.#insertPath(method, p);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
34
|
+
const handlers = this.#handlers;
|
|
35
|
+
if (!handlers) throw new Error(require_router.MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
36
|
+
const tries = this.#tries;
|
|
37
|
+
if (!handlers[method]) {
|
|
38
|
+
tries[method] = new require_router_reg_exp_router_trie.Trie();
|
|
39
|
+
handlers[method] = [...handlers["ALL"]];
|
|
40
|
+
for (const p in tries["ALL"].paths) this.#insertPath(method, p);
|
|
46
41
|
}
|
|
47
42
|
if (path === "/*") path = "*";
|
|
48
|
-
const methods = method === "ALL" ? Object.keys(
|
|
49
|
-
if (/\*$/.test(path)) {
|
|
50
|
-
const re = buildWildcardRegExp(path);
|
|
51
|
-
for (const m of methods) if (!middleware[m][path]) {
|
|
52
|
-
this.#insertPath(m, path);
|
|
53
|
-
middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
|
|
54
|
-
}
|
|
55
|
-
for (const handlerMap of [middleware, routes]) for (const m of methods) for (const p in handlerMap[m]) re.test(p) && handlerMap[m][p].push([handler, path]);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
43
|
+
const methods = method === "ALL" ? Object.keys(handlers) : [method];
|
|
58
44
|
const paths = require_utils_url.checkOptionalParameter(path) || [path];
|
|
59
45
|
for (const path of paths) for (const m of methods) {
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
routes[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware["ALL"], path) || [];
|
|
63
|
-
}
|
|
64
|
-
routes[m][path].push([handler, path]);
|
|
46
|
+
if (!tries[m].paths[path]) this.#insertPath(m, path);
|
|
47
|
+
handlers[m].push([handler, path]);
|
|
65
48
|
}
|
|
66
49
|
}
|
|
67
50
|
match = require_router_reg_exp_router_matcher.match;
|
|
68
51
|
buildAllMatchers() {
|
|
69
52
|
const matchers = require_router_utils.createNullObject();
|
|
70
|
-
for (const method of Object.keys(this.#
|
|
71
|
-
this.#
|
|
72
|
-
wildcardRegExpCache = require_router_utils.createNullObject();
|
|
53
|
+
for (const method of Object.keys(this.#handlers)) matchers[method] = this.#buildMatcher(method);
|
|
54
|
+
this.#handlers = this.#tries = void 0;
|
|
73
55
|
return matchers;
|
|
74
56
|
}
|
|
75
57
|
#buildMatcher(method) {
|
|
76
|
-
const
|
|
77
|
-
const routes = this.#routes[method];
|
|
58
|
+
const handlers = this.#handlers[method];
|
|
78
59
|
const trie = this.#tries[method];
|
|
79
60
|
const staticMap = require_router_utils.createNullObject();
|
|
80
61
|
const handlerData = [];
|
|
81
62
|
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
handlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [h, trie.paths[handlerPath][1].reduceRight((map, [key], i) => {
|
|
90
|
-
map[key] = paramReplacementMap[pathData[1][i][1]];
|
|
63
|
+
const own = require_router_utils.createNullObject();
|
|
64
|
+
const entries = handlers.map(([h, p], i) => {
|
|
65
|
+
(own[p] ??= []).push(i);
|
|
66
|
+
return [h, trie.paths[p][1].reduceRight((map, [key, varIndex]) => {
|
|
67
|
+
map[key] = paramReplacementMap[varIndex];
|
|
91
68
|
return map;
|
|
92
|
-
}, require_router_utils.createNullObject())]
|
|
69
|
+
}, require_router_utils.createNullObject())];
|
|
70
|
+
});
|
|
71
|
+
const wildcards = Object.keys(own).filter((p) => endsWithWildcard(trie.paths[p][2]));
|
|
72
|
+
for (const path in trie.paths) {
|
|
73
|
+
const [index, , keys] = trie.paths[path];
|
|
74
|
+
const indexes = [...own[path]];
|
|
75
|
+
for (const p of wildcards) if (p !== path && covers(trie.paths[p][2], keys)) indexes.push(...own[p]);
|
|
76
|
+
const data = indexes.sort((a, b) => a - b).map((i) => entries[i]);
|
|
77
|
+
if (index === -1) {
|
|
78
|
+
const last = Math.max(-1, ...data.flatMap(([, map]) => Object.values(map)));
|
|
79
|
+
staticMap[path] = [data, last === -1 ? require_router_reg_exp_router_matcher.emptyParam : path.match(regexp).slice(0, last + 1)];
|
|
80
|
+
} else handlerData[index] = data;
|
|
93
81
|
}
|
|
94
82
|
return [
|
|
95
83
|
regexp,
|
|
@@ -8,8 +8,14 @@ var Trie = class {
|
|
|
8
8
|
#index = 0;
|
|
9
9
|
paths = require_router_utils.createNullObject();
|
|
10
10
|
insert(path, isStatic) {
|
|
11
|
+
const keys = [];
|
|
11
12
|
if (isStatic) {
|
|
12
|
-
this.#root.insert(path.split(""),
|
|
13
|
+
this.#root.insert(path.split(""), -1, [], this.#context, keys);
|
|
14
|
+
this.paths[path] = [
|
|
15
|
+
-1,
|
|
16
|
+
[],
|
|
17
|
+
keys
|
|
18
|
+
];
|
|
13
19
|
return;
|
|
14
20
|
}
|
|
15
21
|
const paramAssoc = [];
|
|
@@ -17,7 +23,7 @@ var Trie = class {
|
|
|
17
23
|
let markedPath = path;
|
|
18
24
|
for (let i = 0;;) {
|
|
19
25
|
let replaced = false;
|
|
20
|
-
markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => {
|
|
26
|
+
markedPath = markedPath.replace(/\{(?:\{[\d,]+\}|[^}])+\}/g, (m) => {
|
|
21
27
|
const mark = `@\\${i}`;
|
|
22
28
|
groups[i] = [mark, m];
|
|
23
29
|
i++;
|
|
@@ -31,7 +37,7 @@ var Trie = class {
|
|
|
31
37
|
* - /* wildcard
|
|
32
38
|
* - character
|
|
33
39
|
*/
|
|
34
|
-
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./
|
|
40
|
+
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./gs) || [];
|
|
35
41
|
for (let i = groups.length - 1; i >= 0; i--) {
|
|
36
42
|
const [mark] = groups[i];
|
|
37
43
|
for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
|
|
@@ -39,8 +45,12 @@ var Trie = class {
|
|
|
39
45
|
break;
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
|
-
this.#root.insert(tokens, this.#index, paramAssoc, this.#context,
|
|
43
|
-
this.paths[path] = [
|
|
48
|
+
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, keys);
|
|
49
|
+
this.paths[path] = [
|
|
50
|
+
this.#index++,
|
|
51
|
+
paramAssoc,
|
|
52
|
+
keys
|
|
53
|
+
];
|
|
44
54
|
}
|
|
45
55
|
buildRegExp() {
|
|
46
56
|
let regexp = this.#root.buildRegExpStr();
|
|
@@ -16,7 +16,7 @@ const decodeJwtPart = (part) => JSON.parse(require_utils_jwt_utf8.utf8Decoder.de
|
|
|
16
16
|
function isTokenHeader(obj) {
|
|
17
17
|
if (typeof obj === "object" && obj !== null) {
|
|
18
18
|
const objWithAlg = obj;
|
|
19
|
-
return "alg" in objWithAlg && Object.values(require_utils_jwt_jwa.AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT");
|
|
19
|
+
return "alg" in objWithAlg && Object.values(require_utils_jwt_jwa.AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT") && !("crit" in objWithAlg);
|
|
20
20
|
}
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
@@ -67,6 +67,7 @@ const verify = async (token, publicKey, algOrOptions) => {
|
|
|
67
67
|
if (!(Array.isArray(payload.aud) ? payload.aud : [payload.aud]).some((payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud))) throw new require_utils_jwt_types.JwtTokenAudience(aud, payload.aud);
|
|
68
68
|
}
|
|
69
69
|
const headerPayload = token.substring(0, token.lastIndexOf("."));
|
|
70
|
+
if (!/^[A-Za-z0-9_-]*={0,2}$/.test(tokenParts[2])) throw new require_utils_jwt_types.JwtTokenInvalid(token);
|
|
70
71
|
let signature;
|
|
71
72
|
try {
|
|
72
73
|
signature = require_utils_encode.decodeBase64Url(tokenParts[2]);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_request_constants = require("../request/constants.js");
|
|
3
|
+
const require_utils_url = require("./url.js");
|
|
4
|
+
//#region src/utils/mount.ts
|
|
5
|
+
const getPathPrefixLength = (c, pathPrefix, routePath) => {
|
|
6
|
+
if (!/[:*]/.test(pathPrefix)) return pathPrefix.length;
|
|
7
|
+
const path = c.req.path;
|
|
8
|
+
const matchResult = c.req[require_request_constants.GET_MATCH_RESULT];
|
|
9
|
+
const paramNames = /* @__PURE__ */ new Set();
|
|
10
|
+
let length = 0;
|
|
11
|
+
for (const part of require_utils_url.splitRoutingPath(pathPrefix)) {
|
|
12
|
+
const pattern = require_utils_url.getPattern(part);
|
|
13
|
+
if (pattern && pattern !== "*") {
|
|
14
|
+
const name = pattern[1];
|
|
15
|
+
if (paramNames.has(name)) throw new Error(`mount(): Duplicate path parameter "${name}" in "${routePath}".`);
|
|
16
|
+
paramNames.add(name);
|
|
17
|
+
}
|
|
18
|
+
if (pattern && pattern !== "*" && pattern[2] !== true) {
|
|
19
|
+
const value = matchResult.length === 2 ? matchResult[1][matchResult[0][c.req.routeIndex][1][pattern[1]]] : matchResult[0][c.req.routeIndex][1][pattern[1]];
|
|
20
|
+
length += value.length + 1;
|
|
21
|
+
} else if (pattern || part.endsWith("*")) {
|
|
22
|
+
const end = path.indexOf("/", length + 1);
|
|
23
|
+
length = end === -1 ? path.length : end;
|
|
24
|
+
} else length += part.length + 1;
|
|
25
|
+
}
|
|
26
|
+
return length;
|
|
27
|
+
};
|
|
28
|
+
const createMountedRequest = (c, pathPrefix, routePath) => {
|
|
29
|
+
if (/[^/]\*$/.test(routePath)) throw new Error(`mount(): Wildcard must follow "/" in "${routePath}".`);
|
|
30
|
+
const url = new URL(c.req.raw.url);
|
|
31
|
+
url.pathname = require_utils_url.stripPathPrefix(url.pathname, c.req.path, getPathPrefixLength(c, pathPrefix, routePath));
|
|
32
|
+
return new Request(url, c.req.raw);
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.createMountedRequest = createMountedRequest;
|
|
@@ -111,6 +111,15 @@ const getPathNoStrict = (request) => {
|
|
|
111
111
|
const result = getPath(request);
|
|
112
112
|
return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
|
|
113
113
|
};
|
|
114
|
+
const stripPathPrefix = (rawPath, decodedPath, prefixLength) => {
|
|
115
|
+
if (rawPath.at(-1) === "/" && decodedPath.at(-1) !== "/") rawPath = rawPath.slice(0, -1);
|
|
116
|
+
let index = 0;
|
|
117
|
+
for (let i = decodedPath.indexOf("/"); i !== -1 && i < prefixLength; i = decodedPath.indexOf("/", i + 1)) {
|
|
118
|
+
index = rawPath.indexOf("/", index + 1);
|
|
119
|
+
if (index === -1) return "/";
|
|
120
|
+
}
|
|
121
|
+
return rawPath.slice(index) || "/";
|
|
122
|
+
};
|
|
114
123
|
/**
|
|
115
124
|
* Merge paths.
|
|
116
125
|
* @param {string[]} ...paths - The paths to merge.
|
|
@@ -215,6 +224,7 @@ exports.getQueryStrings = getQueryStrings;
|
|
|
215
224
|
exports.mergePath = mergePath;
|
|
216
225
|
exports.splitPath = splitPath;
|
|
217
226
|
exports.splitRoutingPath = splitRoutingPath;
|
|
227
|
+
exports.stripPathPrefix = stripPathPrefix;
|
|
218
228
|
exports.tryDecode = tryDecode;
|
|
219
229
|
exports.tryDecodeURI = tryDecodeURI;
|
|
220
230
|
exports.tryDecodeURIComponent = tryDecodeURIComponent;
|
package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js
CHANGED
|
@@ -4,7 +4,7 @@ const require_utils_buffer = require("../utils/buffer.js");
|
|
|
4
4
|
const require_helper_cookie_index = require("../helper/cookie/index.js");
|
|
5
5
|
//#region src/validator/validator.ts
|
|
6
6
|
const jsonRegex = /^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
|
|
7
|
-
const multipartRegex = /^multipart\/form-data(;\s
|
|
7
|
+
const multipartRegex = /^multipart\/form-data(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
|
|
8
8
|
const urlencodedRegex = /^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i;
|
|
9
9
|
const validator = (target, validationFunc) => {
|
|
10
10
|
return async (c, next) => {
|
|
@@ -197,7 +197,7 @@ var Context = class {
|
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
199
|
header = (name, value, options) => {
|
|
200
|
-
if (this.finalized) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
200
|
+
if (this.finalized && !this.#res.bodyUsed) this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
201
201
|
const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
|
|
202
202
|
if (value === void 0) headers.delete(name);
|
|
203
203
|
else if (options?.append) headers.append(name, value);
|
|
@@ -79,10 +79,8 @@ const buildStyleString = (strings, values) => {
|
|
|
79
79
|
for (let j = 0, len = vArray.length; j < len; j++) {
|
|
80
80
|
let value = vArray[j];
|
|
81
81
|
if (typeof value === "boolean" || value === null || value === void 0) continue;
|
|
82
|
-
if (typeof value === "string")
|
|
83
|
-
|
|
84
|
-
else styleString += value;
|
|
85
|
-
} else if (typeof value === "number") styleString += value;
|
|
82
|
+
if (typeof value === "string") styleString += value.replace(/[\\"']/g, "\\$&");
|
|
83
|
+
else if (typeof value === "number") styleString += value;
|
|
86
84
|
else if (value[CSS_ESCAPED]) styleString += value[CSS_ESCAPED];
|
|
87
85
|
else if (value[CLASS_NAME].startsWith("@keyframes ")) {
|
|
88
86
|
selectors.push(value);
|
|
@@ -107,7 +105,7 @@ const buildStyleString = (strings, values) => {
|
|
|
107
105
|
}
|
|
108
106
|
return [
|
|
109
107
|
label,
|
|
110
|
-
minify(styleString),
|
|
108
|
+
minify(styleString).replace(/<\//g, "<\\/"),
|
|
111
109
|
selectors,
|
|
112
110
|
externalClassNames
|
|
113
111
|
];
|
|
@@ -3,6 +3,7 @@ import { getPath, getPathNoStrict, mergePath } from "./utils/url.js";
|
|
|
3
3
|
import { Context } from "./context.js";
|
|
4
4
|
import { METHODS } from "./router.js";
|
|
5
5
|
import { COMPOSED_HANDLER } from "./utils/constants.js";
|
|
6
|
+
import { createMountedRequest } from "./utils/mount.js";
|
|
6
7
|
//#region src/hono-base.ts
|
|
7
8
|
/**
|
|
8
9
|
* @module
|
|
@@ -227,17 +228,10 @@ var Hono = class Hono {
|
|
|
227
228
|
} catch {}
|
|
228
229
|
return [c.env, executionContext];
|
|
229
230
|
};
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
233
|
-
return (request) => {
|
|
234
|
-
const url = new URL(request.url);
|
|
235
|
-
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
236
|
-
return new Request(url, request);
|
|
237
|
-
};
|
|
238
|
-
})();
|
|
231
|
+
const mergedPath = mergePath(this._basePath, path);
|
|
232
|
+
const defaultReplaceRequest = (c) => createMountedRequest(c, mergedPath.replace(/\/$/, ""), mergePath(mergedPath, "*"));
|
|
239
233
|
const handler = async (c, next) => {
|
|
240
|
-
const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
|
|
234
|
+
const res = await applicationHandler(replaceRequest ? replaceRequest(c.req.raw) : defaultReplaceRequest(c), ...getOptions(c));
|
|
241
235
|
if (res) return res;
|
|
242
236
|
await next();
|
|
243
237
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HonoBase as Hono$1 } from "./hono-base.js";
|
|
2
2
|
import { RegExpRouter } from "./router/reg-exp-router/router.js";
|
|
3
|
-
import "./router/reg-exp-router/index.js";
|
|
4
3
|
import { SmartRouter } from "./router/smart-router/router.js";
|
|
5
4
|
import { TrieRouter } from "./router/trie-router/router.js";
|
|
6
5
|
import "./router/trie-router/index.js";
|