mcp-use 2.0.0-beta.2 → 2.0.0-beta.21
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/dist/.tsbuildinfo +1 -1
- package/dist/bin/args.d.ts +10 -0
- package/dist/bin/args.d.ts.map +1 -1
- package/dist/bin/main.d.ts +8 -0
- package/dist/bin/main.d.ts.map +1 -1
- package/dist/bin/start.d.ts.map +1 -1
- package/dist/bin.js +22 -6
- package/dist/bin.js.map +1 -1
- package/dist/branding.d.ts +82 -0
- package/dist/branding.d.ts.map +1 -0
- package/dist/chunk-22Y3WIJP.js +62 -0
- package/dist/chunk-22Y3WIJP.js.map +1 -0
- package/dist/chunk-EAPJUSK7.js +98 -0
- package/dist/chunk-EAPJUSK7.js.map +1 -0
- package/dist/chunk-FC2Z2VFO.js +99 -0
- package/dist/chunk-FC2Z2VFO.js.map +1 -0
- package/dist/{public-route-7IK5D7V7.js → chunk-G62AMJHS.js} +17 -12
- package/dist/chunk-G62AMJHS.js.map +1 -0
- package/dist/{chunk-UDLRVMML.js → chunk-IGVT7UV6.js} +94 -23
- package/dist/chunk-IGVT7UV6.js.map +1 -0
- package/dist/chunk-KIZ72TIK.js +38 -0
- package/dist/chunk-KIZ72TIK.js.map +1 -0
- package/dist/{chunk-Q4PUTBMV.js → chunk-QBAJXPRQ.js} +21 -1
- package/dist/chunk-QBAJXPRQ.js.map +1 -0
- package/dist/{chunk-SFI2T6TE.js → chunk-QUUANIE4.js} +34 -80
- package/dist/chunk-QUUANIE4.js.map +1 -0
- package/dist/{chunk-RQRT27Q3.js → chunk-RHITI5QM.js} +190 -16
- package/dist/chunk-RHITI5QM.js.map +1 -0
- package/dist/chunk-Z326HADF.js +82 -0
- package/dist/chunk-Z326HADF.js.map +1 -0
- package/dist/chunk-ZJJD33SF.js +741 -0
- package/dist/chunk-ZJJD33SF.js.map +1 -0
- package/dist/cli/build.d.ts +21 -15
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/dev.d.ts +4 -0
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/entry.d.ts +1 -1
- package/dist/cli/entry.d.ts.map +1 -1
- package/dist/cli/mcp-env-declaration.d.ts +20 -0
- package/dist/cli/mcp-env-declaration.d.ts.map +1 -0
- package/dist/cli/next-compat.d.ts +21 -0
- package/dist/cli/next-compat.d.ts.map +1 -0
- package/dist/cli/next-server-shims.d.ts +52 -0
- package/dist/cli/next-server-shims.d.ts.map +1 -0
- package/dist/cli/port.d.ts.map +1 -1
- package/dist/cli/tunnel.d.ts.map +1 -1
- package/dist/cli/views-bindings.d.ts +9 -0
- package/dist/cli/views-bindings.d.ts.map +1 -1
- package/dist/cli/views-plugin.d.ts.map +1 -1
- package/dist/cli/views.d.ts +23 -8
- package/dist/cli/views.d.ts.map +1 -1
- package/dist/cli/workspace.d.ts +4 -9
- package/dist/cli/workspace.d.ts.map +1 -1
- package/dist/commands/build.js +171 -34
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/client.js +1 -1
- package/dist/commands/dev.js +145 -40
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/load-client.d.ts +9 -2
- package/dist/commands/load-client.d.ts.map +1 -1
- package/dist/commands/screenshot.js +1 -1
- package/dist/commands/start.js +5 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/completable.d.ts +9 -0
- package/dist/completable.d.ts.map +1 -1
- package/dist/config.d.ts +125 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/fetch-app.d.ts +43 -0
- package/dist/fetch-app.d.ts.map +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1318 -251
- package/dist/index.js.map +1 -1
- package/dist/inspector-shell.d.ts +19 -6
- package/dist/inspector-shell.d.ts.map +1 -1
- package/dist/internal/resource-completion.js +7 -0
- package/dist/internal/resource-completion.js.map +1 -0
- package/dist/landing-handler-WE66NIGB.js +37 -0
- package/dist/landing-handler-WE66NIGB.js.map +1 -0
- package/dist/landing-handler.d.ts +24 -0
- package/dist/landing-handler.d.ts.map +1 -0
- package/dist/landing.d.ts +67 -0
- package/dist/landing.d.ts.map +1 -0
- package/dist/landing.js +7 -0
- package/dist/landing.js.map +1 -0
- package/dist/mcp-proxy-5YQJJ4RT.js +282 -0
- package/dist/mcp-proxy-5YQJJ4RT.js.map +1 -0
- package/dist/mcp-proxy.d.ts +153 -0
- package/dist/mcp-proxy.d.ts.map +1 -0
- package/dist/middleware/cors.d.ts +11 -0
- package/dist/middleware/cors.d.ts.map +1 -0
- package/dist/middleware/mcp-middleware.d.ts +179 -0
- package/dist/middleware/mcp-middleware.d.ts.map +1 -0
- package/dist/mount-mcp.d.ts +0 -4
- package/dist/mount-mcp.d.ts.map +1 -1
- package/dist/next/config.d.ts +39 -0
- package/dist/next/config.d.ts.map +1 -0
- package/dist/next/handler.d.ts +17 -0
- package/dist/next/handler.d.ts.map +1 -0
- package/dist/next/index.d.ts +5 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +172 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next-server-shims.js +108 -0
- package/dist/next-server-shims.js.map +1 -0
- package/dist/oauth/better-auth.d.ts +29 -0
- package/dist/oauth/better-auth.d.ts.map +1 -0
- package/dist/oauth/better-auth.js +76 -0
- package/dist/oauth/better-auth.js.map +1 -0
- package/dist/oauth/index.js +2 -1
- package/dist/public-route-RWJVJQTX.js +9 -0
- package/dist/public-route-RWJVJQTX.js.map +1 -0
- package/dist/react/components/theme-provider.d.ts +3 -0
- package/dist/react/components/theme-provider.d.ts.map +1 -1
- package/dist/react/hooks/use-files.d.ts +25 -0
- package/dist/react/hooks/use-files.d.ts.map +1 -0
- package/dist/react/hooks/use-host-context.d.ts +5 -0
- package/dist/react/hooks/use-host-context.d.ts.map +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +124 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/runtime/view-runtime.d.ts +23 -0
- package/dist/react/runtime/view-runtime.d.ts.map +1 -1
- package/dist/react/types/file-types.d.ts +16 -0
- package/dist/react/types/file-types.d.ts.map +1 -0
- package/dist/react/types/register.d.ts +1 -1
- package/dist/react/types/register.d.ts.map +1 -1
- package/dist/resource-completion.d.ts +12 -0
- package/dist/resource-completion.d.ts.map +1 -0
- package/dist/resources.d.ts +59 -4
- package/dist/resources.d.ts.map +1 -1
- package/dist/server.d.ts +120 -7
- package/dist/server.d.ts.map +1 -1
- package/dist/tools.d.ts +21 -10
- package/dist/tools.d.ts.map +1 -1
- package/dist/views/constants.d.ts +1 -1
- package/dist/views/csp-env.d.ts +37 -0
- package/dist/views/csp-env.d.ts.map +1 -0
- package/dist/views/document.d.ts +30 -13
- package/dist/views/document.d.ts.map +1 -1
- package/dist/views/index.d.ts +4 -3
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/origin.d.ts +37 -9
- package/dist/views/origin.d.ts.map +1 -1
- package/dist/views/public-route.d.ts +10 -4
- package/dist/views/public-route.d.ts.map +1 -1
- package/dist/views/register.d.ts +1 -1
- package/dist/views/routes.d.ts +20 -1
- package/dist/views/routes.d.ts.map +1 -1
- package/dist/views/types.d.ts +23 -14
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/wire.d.ts +26 -36
- package/dist/views/wire.d.ts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/client/README.md +26 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs +7069 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts +1054 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts +1054 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs +7086 -0
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts +59 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs +970 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs +976 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts +59 -0
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts +2675 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts +2678 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +5427 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +3196 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +3196 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +5224 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +14 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +21 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +13 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +20 -0
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs +7331 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs +6963 -0
- package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +181 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +87 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +87 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +176 -0
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/client/package.json +166 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +8198 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +2862 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +8198 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +1653 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +174 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +199 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +87 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +87 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/jose/README.md +153 -0
- package/node_modules/jose/dist/types/index.d.ts +55 -0
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +31 -0
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +65 -0
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +31 -0
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +83 -0
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +31 -0
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +17 -0
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +32 -0
- package/node_modules/jose/dist/types/jwks/local.d.ts +29 -0
- package/node_modules/jose/dist/types/jwks/remote.d.ts +237 -0
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +36 -0
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +33 -0
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +42 -0
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +33 -0
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +53 -0
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +33 -0
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +35 -0
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +91 -0
- package/node_modules/jose/dist/types/jwt/sign.d.ts +43 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +43 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/key/export.d.ts +33 -0
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +47 -0
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +35 -0
- package/node_modules/jose/dist/types/key/import.d.ts +83 -0
- package/node_modules/jose/dist/types/types.d.ts +841 -0
- package/node_modules/jose/dist/types/util/base64url.d.ts +9 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +18 -0
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +17 -0
- package/node_modules/jose/dist/types/util/errors.d.ts +213 -0
- package/node_modules/jose/dist/webapi/index.js +32 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +27 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +165 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +169 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +31 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +187 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +17 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +119 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +179 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +18 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +21 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +92 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +120 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +73 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +24 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +108 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +52 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +63 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/node_modules/jose/dist/webapi/key/export.js +11 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +97 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
- package/node_modules/jose/dist/webapi/key/import.js +57 -0
- package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +16 -0
- package/node_modules/jose/dist/webapi/lib/aeskw.js +25 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +243 -0
- package/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +43 -0
- package/node_modules/jose/dist/webapi/lib/cek.js +19 -0
- package/node_modules/jose/dist/webapi/lib/check_cek_length.js +7 -0
- package/node_modules/jose/dist/webapi/lib/check_iv_length.js +7 -0
- package/node_modules/jose/dist/webapi/lib/check_key_length.js +8 -0
- package/node_modules/jose/dist/webapi/lib/check_key_type.js +122 -0
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +143 -0
- package/node_modules/jose/dist/webapi/lib/decrypt.js +106 -0
- package/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +127 -0
- package/node_modules/jose/dist/webapi/lib/digest.js +4 -0
- package/node_modules/jose/dist/webapi/lib/ecdhes.js +52 -0
- package/node_modules/jose/dist/webapi/lib/encrypt.js +74 -0
- package/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +92 -0
- package/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +12 -0
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +27 -0
- package/node_modules/jose/dist/webapi/lib/is_disjoint.js +21 -0
- package/node_modules/jose/dist/webapi/lib/is_jwk.js +6 -0
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/node_modules/jose/dist/webapi/lib/is_object.js +14 -0
- package/node_modules/jose/dist/webapi/lib/iv.js +19 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +109 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +238 -0
- package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +31 -0
- package/node_modules/jose/dist/webapi/lib/normalize_key.js +176 -0
- package/node_modules/jose/dist/webapi/lib/pbes2kw.js +39 -0
- package/node_modules/jose/dist/webapi/lib/private_symbols.js +1 -0
- package/node_modules/jose/dist/webapi/lib/rsaes.js +24 -0
- package/node_modules/jose/dist/webapi/lib/sign.js +9 -0
- package/node_modules/jose/dist/webapi/lib/subtle_dsa.js +31 -0
- package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +10 -0
- package/node_modules/jose/dist/webapi/lib/validate_crit.js +33 -0
- package/node_modules/jose/dist/webapi/lib/verify.js +14 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +30 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +34 -0
- package/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/node_modules/jose/package.json +200 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +26 -10
- package/dist/chunk-Q4PUTBMV.js.map +0 -1
- package/dist/chunk-RQRT27Q3.js.map +0 -1
- package/dist/chunk-SFI2T6TE.js.map +0 -1
- package/dist/chunk-UDLRVMML.js.map +0 -1
- package/dist/public-route-7IK5D7V7.js.map +0 -1
package/dist/commands/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/dev.ts","../../src/cli/port.ts","../../src/cli/dev-api.ts","../../src/cli/tunnel.ts"],"sourcesContent":["/**\n * `mcp-use dev` — a single long-lived dev process (CLI_SPEC.md § Commands →\n * dev): a Vite dev server (Environment API, node/SSR environment only) loads\n * the entry through the module runner; one HTTP listener delegates every\n * request to an atomically swappable handler reference.\n *\n * When views exist, the same Vite server gains a client environment with real\n * HMR for view files; the CLI primes views on each entry reload via the\n * internal {@link registerViews} API (VIEWS_SPEC.md § Dev).\n *\n * Reload, not HMR: on file change the entry is re-imported and the handler\n * reference swapped — no registration diffing or running-registry mutation.\n * All handler generations share one event bus, so a successful swap invalidates\n * the tool, prompt, and resource lists for subscribed development clients.\n *\n * This module is reached only through the bin's dedicated dynamic dev import,\n * so library consumers and production startup never evaluate Vite.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { createServer as createNodeServer } from \"node:http\";\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { existsSync } from \"node:fs\";\nimport { networkInterfaces } from \"node:os\";\nimport { join } from \"node:path\";\nimport tailwindcss from \"@tailwindcss/vite\";\nimport react from \"@vitejs/plugin-react\";\nimport { createServer, createServerModuleRunner } from \"vite\";\nimport {\n InMemoryServerEventBus,\n localhostAllowedHostnames,\n localhostAllowedOrigins,\n type ServerEventBus,\n validateHostHeader,\n validateOriginHeader,\n} from \"@modelcontextprotocol/server\";\n\nimport { resolvePort as resolvePreferredPort } from \"../bin/args.js\";\nimport { discoverEntry } from \"./entry.js\";\nimport { resolvePort } from \"./port.js\";\nimport { resolveTailwindCss, resolveUserViteConfig } from \"./vite-config.js\";\nimport { createDevApiHandler } from \"./dev-api.js\";\nimport { createTunnelManager } from \"./tunnel.js\";\nimport { resolveWorkspacePaths } from \"./workspace.js\";\nimport { mcpUseViewsPlugin } from \"./views-plugin.js\";\nimport {\n buildDevViewsManifest,\n discoverViews,\n isViewPath,\n type DiscoveredView,\n} from \"./views.js\";\nimport type { ViewsManifest } from \"../views/types.js\";\n\n/** Web-standard request handler, as returned by `MCPServer.getHandler()`. */\ntype FetchHandler = (request: Request) => Promise<Response>;\n\n/**\n * The duck-typed shape the entry's default export must satisfy: an\n * `MCPServer` instance (checked structurally so the runner may load its own\n * copy of `mcp-use`).\n */\ninterface ServerLike {\n getHandler(options?: { bus?: ServerEventBus }): FetchHandler;\n /** URL path prefix the MCP endpoint is mounted at (default `\"/mcp\"`). */\n readonly basePath?: string;\n __primeViews(\n views: ViewsManifest,\n options?: { dev?: boolean; projectRoot?: string }\n ): void;\n}\n\n/**\n * Options for {@link runDev}.\n *\n * @internal\n */\nexport interface DevOptions {\n /** Absolute path to the project root. */\n cwd: string;\n /**\n * Explicit entry path (the `--entry` flag), absolute or relative to `cwd`.\n *\n * @defaultValue Conventional discovery: `src/index.ts`, `src/server.ts`,\n * `index.ts`, `server.ts` — first hit wins.\n */\n entry?: string;\n /**\n * Preferred port. When taken, the next free port upward is used (and the\n * substitution logged).\n *\n * @defaultValue The `PORT` environment variable, else `3000`.\n */\n port?: number;\n /**\n * Interface address to bind — `\"0.0.0.0\"` exposes the dev server to the\n * local network (phones, containers, teammates); the default keeps it\n * machine-local. Printed and auto-opened URLs use `localhost` for\n * loopback/wildcard binds and the given host verbatim otherwise.\n *\n * Localhost-class binds get DNS-rebinding protection: every request's\n * `Host` is validated (plus the active tunnel hostname); `Origin` only on\n * non-GET/HEAD. Non-localhost binds skip validation — the legitimate\n * hostnames are unknowable here — and log a warning instead.\n *\n * @defaultValue `\"127.0.0.1\"` (matching the server's localhost-first posture).\n */\n host?: string;\n /**\n * Abort signal for embedding and tests: aborting shuts the dev process\n * down gracefully (same path as SIGINT/SIGTERM). The CLI itself does not\n * pass this.\n */\n signal?: AbortSignal;\n /**\n * When `true`, start a public tunnel as soon as the HTTP listener is bound\n * (same as the inspector \"Start Tunnel\" control, but at startup).\n *\n * @defaultValue `false`\n */\n tunnel?: boolean;\n /**\n * Auto-open the inspector in the default browser once the listener is\n * bound (`--no-open` sets this to `false`). Opening is additionally\n * skipped when stdout is not a TTY — agents and CI never get a spurious\n * browser launch or a \"failed to open\" error.\n *\n * @defaultValue `true`\n */\n open?: boolean;\n}\n\n/**\n * Best-effort open of `url` in the platform's default browser.\n *\n * Dependency-free (`open`/`start`/`xdg-open` via spawn), detached, and\n * error-swallowing: a missing opener (headless Linux, containers) must never\n * crash or log noise into the dev process.\n */\nfunction openInBrowser(url: string): void {\n const [command, args]: [string, string[]] =\n process.platform === \"darwin\"\n ? [\"open\", [url]]\n : process.platform === \"win32\"\n ? // `start` is a cmd built-in; the empty string is the window title.\n [\"cmd\", [\"/c\", \"start\", \"\", url]]\n : [\"xdg-open\", [url]];\n try {\n const child = spawn(command, args, { stdio: \"ignore\", detached: true });\n child.on(\"error\", () => {\n // Swallow: auto-open is a convenience, never a failure.\n });\n child.unref();\n } catch {\n // Synchronous spawn failures are equally non-fatal.\n }\n}\n\n/**\n * First non-internal IPv4 address of this machine, for the \"Network:\" line\n * printed on wildcard binds — `undefined` when offline.\n */\nfunction lanAddress(): string | undefined {\n for (const addresses of Object.values(networkInterfaces())) {\n for (const address of addresses ?? []) {\n if (!address.internal && address.family === \"IPv4\") {\n return address.address;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Merge `Origin` into an existing `Vary` header without duplicating it.\n *\n * @param res - Node response whose `Vary` may already list other tokens.\n */\nfunction appendVaryOrigin(res: ServerResponse): void {\n const existing = res.getHeader(\"Vary\");\n const current =\n typeof existing === \"string\"\n ? existing\n : Array.isArray(existing)\n ? existing.join(\", \")\n : existing !== undefined\n ? String(existing)\n : \"\";\n if (\n current\n .split(\",\")\n .map((token) => token.trim().toLowerCase())\n .includes(\"origin\")\n ) {\n return;\n }\n res.setHeader(\"Vary\", current === \"\" ? \"Origin\" : `${current}, Origin`);\n}\n\n/**\n * CORS for Vite-served module-graph URLs on the dev listener.\n *\n * Tunnel active → `Access-Control-Allow-Origin: *` (foreign / opaque hosts).\n * No tunnel on a localhost bind → reflect a validated loopback `Origin`\n * (exact value) and set `Vary: Origin`; reflect `null` for opaque sandbox\n * iframes; foreign or missing Origin get no ACAO.\n *\n * @param req - Incoming request (reads `Origin`).\n * @param res - Response to receive CORS headers.\n * @param options - `tunnelActive` when a public tunnel URL is set;\n * `localhostBind` when the listener is on a loopback host.\n */\nfunction applyViteModuleCors(\n req: IncomingMessage,\n res: ServerResponse,\n options: { tunnelActive: boolean; localhostBind: boolean }\n): void {\n if (options.tunnelActive) {\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n return;\n }\n if (!options.localhostBind) {\n return;\n }\n const originHeader = req.headers.origin;\n // Sandboxed MCP App iframes (opaque origin) send `Origin: null` on module GETs.\n if (originHeader === \"null\") {\n res.setHeader(\"Access-Control-Allow-Origin\", \"null\");\n return;\n }\n // validateOriginHeader treats a missing Origin as ok (no header to check);\n // CORS reflection requires a concrete loopback origin string.\n if (typeof originHeader !== \"string\" || originHeader === \"\") {\n return;\n }\n const result = validateOriginHeader(originHeader, localhostAllowedOrigins());\n if (!result.ok || result.origin === undefined) {\n return;\n }\n res.setHeader(\"Access-Control-Allow-Origin\", result.origin);\n appendVaryOrigin(res);\n}\n\n/**\n * Validate the entry module's default export and return it as a\n * {@link ServerLike}.\n */\nfunction serverFrom(moduleExports: Record<string, unknown>): ServerLike {\n const server = moduleExports[\"default\"];\n if (server === null || typeof server !== \"object\") {\n throw new Error(\n \"The server entry must default-export the MCPServer instance \" +\n \"(`export default server`) and never call listen() itself — \" +\n \"`mcp-use dev` owns the socket.\"\n );\n }\n const candidate = server as Partial<ServerLike>;\n if (typeof candidate.getHandler !== \"function\") {\n throw new Error(\n \"The entry's default export has no getHandler() — it must be the \" +\n \"MCPServer instance (`export default server`).\"\n );\n }\n return candidate as ServerLike;\n}\n\n/**\n * Run the dev server: import the entry through Vite's module runner (full\n * TS/alias support), serve `server.getHandler()` on one long-lived HTTP\n * listener, and swap the handler on file change.\n *\n * A throwing re-import keeps the previous handler alive and prints the error\n * — the dev process never crashes on a bad save. `.env` (if present) is\n * loaded from `cwd` via `process.loadEnvFile()` before the entry is first\n * imported.\n *\n * The returned promise resolves after a graceful shutdown (SIGINT/SIGTERM or\n * `options.signal` aborting).\n *\n * @param options - Project root, optional entry override, port and host.\n * @throws If no entry is found, if the initial import fails, if the entry's\n * default export is not an `MCPServer` (see the entry contract in\n * CLI_SPEC.md), or if `vite` is not installed (`mcp-use dev` requires it as a\n * devDependency).\n *\n * @internal Reached only via the bin's dedicated dev command chunk — not\n * re-exported from the package's \".\" entry.\n */\nexport async function runDev(options: DevOptions): Promise<void> {\n const host = options.host ?? \"127.0.0.1\";\n const paths = resolveWorkspacePaths(options.cwd);\n const eventBus = new InMemoryServerEventBus((error) => {\n console.error(\"[mcp-use] notification delivery failed:\", error);\n });\n\n const envPath = join(options.cwd, \".env\");\n if (existsSync(envPath)) {\n process.loadEnvFile(envPath);\n }\n\n // Resolve the listener before importing the entry so module-scope OAuth\n // configuration observes the canonical port that this CLI will own.\n // The HTTP listener is a raw node:http server with the vendored\n // toNodeHandler bridge — same role as the old @hono/node-server\n // getRequestListener, without a hono dependency.\n // Connect-style ((req, res, next)) with no fetch-shaped equivalent, so\n // splicing it in front of the swappable fetch handler needs the raw Node\n // request boundary. Creating the (not-yet-listening) server up front also\n // lets Vite attach its HMR websocket to this same socket (`hmr.server`\n // below) — one port total, so several `mcp-use dev` processes coexist\n // without websocket port collisions.\n const httpServer = createNodeServer();\n\n const { port, requested } = await resolvePort(\n resolvePreferredPort(options.port),\n host\n );\n if (port !== requested) {\n console.log(`[mcp-use] port ${requested} is taken, using ${port}`);\n }\n process.env[\"PORT\"] = String(port);\n\n const localFallbackMcpUrl =\n process.env[\"MCP_URL\"] === undefined &&\n (host === \"127.0.0.1\" || host === \"localhost\" || host === \"::1\")\n ? `http://localhost:${port}`\n : undefined;\n\n const entry = discoverEntry(options.cwd, options.entry);\n let currentViews: DiscoveredView[] = discoverViews(options.cwd);\n // The Vite client environment (views plugin, Fast Refresh, HMR socket,\n // asset origin) is configured once, from this snapshot. `currentViews`\n // stays live for request routing and re-priming, but a project that starts\n // with zero views needs a dev-server restart to pick up its first view.\n const viewsAtStartup = currentViews.length > 0;\n const userViteConfig = resolveUserViteConfig(options.cwd);\n\n // The bind address is not always a browsable address: `0.0.0.0`/`::`\n // accept connections on every interface but are not valid request hosts\n // in every browser, and `127.0.0.1` reads worse than `localhost` in logs.\n // Anything else (a LAN IP, a hostname) is browsable as itself; bare IPv6\n // addresses need brackets in URLs.\n const loopbackOrWildcard = [\"127.0.0.1\", \"localhost\", \"0.0.0.0\", \"::\", \"::1\"];\n const browsableHost = loopbackOrWildcard.includes(host) ? \"localhost\" : host;\n const devOrigin = `http://${\n browsableHost.includes(\":\") ? `[${browsableHost}]` : browsableHost\n }:${port}`;\n\n const vite = await createServer({\n root: options.cwd,\n configFile: viewsAtStartup ? userViteConfig : false,\n envFile: false,\n logLevel: \"warn\",\n cacheDir: paths.cache,\n resolve: { alias: { tailwindcss: resolveTailwindCss() } },\n plugins: viewsAtStartup\n ? [\n tailwindcss(),\n mcpUseViewsPlugin({\n getViews: () => currentViews,\n dev: { reactRefresh: true },\n }),\n react(),\n ]\n : [],\n server: {\n middlewareMode: true,\n // Absolute asset URLs in dev: without `origin`, Vite emits root-relative\n // paths that resolve against the host page inside srcdoc iframes.\n ...(viewsAtStartup && { origin: devOrigin }),\n // CORS on module URLs is owned by onRequest below (permissive ACAO\n // only while the tunnel is active), not by Vite's own middleware —\n // whose default localhost-only policy would block tunnel-rendering\n // hosts, and whose headers would fight the tunnel-gated ones.\n cors: false,\n // View HMR rides the one HTTP listener: Vite attaches its websocket\n // upgrade handler to our server, so no dedicated HMR port exists to\n // collide when several dev processes run side by side.\n hmr: viewsAtStartup ? { server: httpServer } : false,\n },\n ssr: {\n external: true,\n },\n });\n\n const ssrEnvironment = vite.environments.ssr;\n const runner = createServerModuleRunner(ssrEnvironment, {\n hmr: false,\n sourcemapInterceptor: \"node\",\n });\n\n const importServer = async (): Promise<ServerLike> => {\n const load = async (): Promise<ServerLike> => {\n const moduleExports = (await runner.import(entry)) as Record<\n string,\n unknown\n >;\n const server = serverFrom(moduleExports);\n\n if (currentViews.length > 0) {\n const viewsManifest = buildDevViewsManifest(currentViews);\n if (typeof server.__primeViews !== \"function\") {\n throw new Error(\n \"Loaded MCPServer instance does not support __primeViews.\"\n );\n }\n server.__primeViews(viewsManifest, {\n dev: true,\n projectRoot: options.cwd,\n });\n }\n\n return server;\n };\n\n if (localFallbackMcpUrl === undefined) {\n return load();\n }\n\n // This is safe only because this CLI selected and will bind this local\n // listener. Never derive OAuth identity from an untrusted request Host.\n // Scope it to entry evaluation: MCPServer freezes the trusted canonical\n // resource during construction, while later runtime code must not inherit\n // this CLI-owned synthetic environment value.\n const previousMcpUrl = process.env[\"MCP_URL\"];\n try {\n process.env[\"MCP_URL\"] = localFallbackMcpUrl;\n return await load();\n } finally {\n if (previousMcpUrl === undefined) {\n delete process.env[\"MCP_URL\"];\n } else {\n process.env[\"MCP_URL\"] = previousMcpUrl;\n }\n }\n };\n\n let currentHandler: FetchHandler;\n let basePath: string;\n try {\n const server = await importServer();\n currentHandler = server.getHandler({ bus: eventBus });\n basePath = server.basePath ?? \"/mcp\";\n } catch (error) {\n await runner.close();\n await vite.close();\n throw error;\n }\n\n let reloading = false;\n let dirty = false;\n const reload = (): void => {\n if (reloading) {\n dirty = true;\n return;\n }\n reloading = true;\n void (async () => {\n do {\n dirty = false;\n try {\n runner.evaluatedModules.clear();\n const server = await importServer();\n const nextHandler = server.getHandler({ bus: eventBus });\n currentHandler = nextHandler;\n basePath = server.basePath ?? \"/mcp\";\n eventBus.publish({ kind: \"tools_list_changed\" });\n eventBus.publish({ kind: \"prompts_list_changed\" });\n eventBus.publish({ kind: \"resources_list_changed\" });\n console.log(\"[mcp-use] reloaded server entry\");\n } catch (error) {\n console.error(\n \"[mcp-use] reload failed — keeping the previous server:\\n\",\n error\n );\n }\n } while (dirty);\n reloading = false;\n })();\n };\n\n const onSsrFileEvent = (file: string): void => {\n if (isViewPath(file, options.cwd)) {\n return;\n }\n const modules = ssrEnvironment.moduleGraph.getModulesByFile(file);\n if (modules === undefined || modules.size === 0) {\n return;\n }\n for (const mod of modules) {\n ssrEnvironment.moduleGraph.invalidateModule(mod);\n }\n reload();\n };\n\n const onViewFilesystemEvent = (file: string): void => {\n if (!isViewPath(file, options.cwd)) {\n return;\n }\n\n const previousViews = currentViews;\n currentViews = discoverViews(options.cwd);\n\n const viewsChanged =\n previousViews.length !== currentViews.length ||\n previousViews.some(\n (v, i) =>\n v.name !== currentViews[i]?.name ||\n v.entryPath !== currentViews[i]?.entryPath\n );\n\n if (viewsChanged) {\n reload();\n }\n };\n\n const onFileAddOrUnlink = (file: string): void => {\n onViewFilesystemEvent(file);\n onSsrFileEvent(file);\n };\n\n // A `change` event cannot add or remove a view directory, so only\n // `add`/`unlink` rescan `resources/` — content edits never pay for the\n // synchronous filesystem walk in discoverViews().\n vite.watcher.on(\"change\", onSsrFileEvent);\n vite.watcher.on(\"add\", onFileAddOrUnlink);\n vite.watcher.on(\"unlink\", onFileAddOrUnlink);\n\n // --- One long-lived HTTP listener delegating to the current handler. -----\n const tunnelManager = createTunnelManager(paths.tunnel);\n\n // Vite owns the upgrade listener and validates Host before our HTTP request\n // guard runs. The public tunnel has already been validated by the proxy and\n // tunnel manager, so present only that active host as the local listener.\n httpServer.prependListener(\"upgrade\", (req) => {\n const tunnelUrl = tunnelManager.status().url;\n if (tunnelUrl === null) return;\n const tunnelHost = new URL(tunnelUrl).hostname;\n const requestHost = req.headers.host?.split(\":\")[0];\n if (requestHost === tunnelHost) {\n req.headers.host = `localhost:${port}`;\n }\n });\n\n // --- DNS-rebinding protection. --------------------------------------------\n // getHandler() applies no Host/Origin validation (its contract assumes a\n // platform edge in front); in dev this process *is* the edge, so\n // localhost-class binds get the same localhost-allowlist checks listen()\n // applies — extended with the active tunnel hostname, since tunnel traffic\n // arrives with the tunnel's public Host. The check runs before any routing,\n // covering the MCP endpoint, the dev API (tunnel control), and Vite-served\n // module URLs alike. Non-localhost binds get no validation (the legitimate\n // hostnames are unknowable here) — a startup warning below says so.\n //\n // Host is validated on every request: rebinding works by making the\n // attacker's page same-origin with this server, and the Host header is\n // where that shows up. Origin is validated only on side-effect-bearing\n // methods (the MCP wire and the dev API are all POST): sandboxed view\n // iframes have an opaque origin, so their module/asset GETs legitimately\n // carry `Origin: null` — and external hosts rendering views through the\n // tunnel fetch assets with their own origins. Those cross-origin loads also\n // need CORS: the MCP server's view asset/public routes always emit\n // `Access-Control-Allow-Origin: *`. Vite-served module URLs (onRequest\n // below) emit `*` while a tunnel is active; without a tunnel, localhost\n // binds reflect a validated loopback Origin (exact value + `Vary: Origin`)\n // so a local MCP host can load the module graph, while foreign / opaque /\n // missing Origin get no ACAO.\n const localhostBind = [\"127.0.0.1\", \"localhost\", \"::1\"].includes(host);\n const rejectDisallowedRequest = (\n req: IncomingMessage,\n res: ServerResponse\n ): boolean => {\n const tunnelUrl = tunnelManager.status().url;\n const tunnelHost = tunnelUrl !== null ? new URL(tunnelUrl).hostname : null;\n const extra = tunnelHost !== null ? [tunnelHost] : [];\n const readOnly = req.method === \"GET\" || req.method === \"HEAD\";\n const hostResult = validateHostHeader(req.headers.host, [\n ...localhostAllowedHostnames(),\n ...extra,\n ]);\n const result =\n hostResult.ok && !readOnly\n ? validateOriginHeader(req.headers.origin, [\n ...localhostAllowedOrigins(),\n ...extra,\n ])\n : hostResult;\n if (result.ok) {\n return false;\n }\n // Same JSON-RPC 403 shape the SDK's own validation responses use.\n res.writeHead(403, { \"content-type\": \"application/json\" });\n res.end(\n JSON.stringify({\n jsonrpc: \"2.0\",\n error: { code: -32000, message: result.message },\n id: null,\n })\n );\n return true;\n };\n\n /**\n * Tear down everything the running dev process owns, in dependency order:\n * watcher subscriptions, tunnel, HTTP listener, module runner, Vite.\n */\n const teardown = async (): Promise<void> => {\n vite.watcher.off(\"change\", onSsrFileEvent);\n vite.watcher.off(\"add\", onFileAddOrUnlink);\n vite.watcher.off(\"unlink\", onFileAddOrUnlink);\n await tunnelManager.stop();\n await new Promise<void>((done) => httpServer.close(() => done()));\n await runner.close();\n await vite.close();\n };\n\n const devFetch = createDevApiHandler(\n {\n getBasePath: () => basePath,\n port,\n tunnel: tunnelManager,\n },\n (request) => currentHandler(request)\n );\n\n // Vendored Node bridge — same adapter serve() used internally.\n const { toNodeHandler } = await import(\"../node-bridge.js\");\n const nodeListener = toNodeHandler({ fetch: devFetch });\n\n const onRequest = (req: IncomingMessage, res: ServerResponse): void => {\n if (localhostBind && rejectDisallowedRequest(req, res)) {\n return;\n }\n const url = req.url ?? \"/\";\n const pathname = new URL(url, \"http://127.0.0.1\").pathname;\n // Routing to Vite requires both the client environment (configured only\n // when views existed at startup) and a currently non-empty registry.\n const viewsEnabled = viewsAtStartup && currentViews.length > 0;\n // Vite sees module-graph URLs (/@vite/client, /@id/virtual:…,\n // /.mcp-use/cache/deps/…, view files under /resources/…) plus standard\n // node_modules pre-bundles; everything else — the MCP endpoint included —\n // goes straight to the Hono handler.\n const isViteRequest =\n req.method === \"GET\" &&\n (pathname.startsWith(\"/@\") ||\n pathname.startsWith(\"/node_modules/\") ||\n pathname.startsWith(\"/.mcp-use/\") ||\n (viewsEnabled && pathname.startsWith(\"/resources/\")));\n\n if (viewsEnabled && isViteRequest) {\n // CORS for Vite module URLs: tunnel → `*`; else localhost bind with a\n // validated loopback Origin → reflect that origin (+ Vary). Foreign /\n // opaque / missing Origin stay without ACAO so the source module graph\n // is not readable to arbitrary websites.\n applyViteModuleCors(req, res, {\n tunnelActive: tunnelManager.status().url !== null,\n localhostBind,\n });\n vite.middlewares(req, res, () => {\n void nodeListener(req, res);\n });\n } else {\n void nodeListener(req, res);\n }\n };\n httpServer.on(\"request\", onRequest);\n\n await new Promise<void>((resolve, reject) => {\n httpServer.once(\"error\", reject);\n httpServer.listen(port, host, () => resolve());\n });\n\n console.log(`[mcp-use] dev server ready`);\n if (currentViews.length > 0) {\n console.log(\n ` ➜ Views: ${currentViews.map((v) => v.name).join(\", \")}`\n );\n }\n console.log(` ➜ MCP endpoint: ${devOrigin}${basePath}`);\n console.log(` ➜ Inspector: ${devOrigin}${basePath}/inspector`);\n if (host === \"0.0.0.0\" || host === \"::\") {\n const lan = lanAddress();\n if (lan !== undefined) {\n console.log(` ➜ Network: http://${lan}:${port}${basePath}`);\n }\n }\n if (!localhostBind) {\n console.warn(\n `[mcp-use] --host ${host} serves beyond this machine without Host ` +\n `validation or authentication — anyone with network access can call ` +\n `the MCP endpoint and dev routes.`\n );\n }\n\n if (options.tunnel === true) {\n try {\n const { url } = await tunnelManager.start(port);\n console.log(` ➜ Tunnel: ${url}${basePath}`);\n } catch (error) {\n await teardown();\n throw error;\n }\n }\n\n // Auto-open the inspector — unless disabled (`--no-open`) or stdout is not\n // a TTY (agents/CI: no browser to open, and no error to fail on).\n if (options.open !== false && process.stdout.isTTY === true) {\n openInBrowser(`${devOrigin}${basePath}/inspector`);\n }\n\n // --- Graceful shutdown (SIGINT/SIGTERM or options.signal). ---------------\n await new Promise<void>((resolve) => {\n let closing = false;\n const shutdown = (): void => {\n if (closing) return;\n closing = true;\n process.off(\"SIGINT\", shutdown);\n process.off(\"SIGTERM\", shutdown);\n void (async () => {\n await teardown();\n resolve();\n })();\n };\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n if (options.signal !== undefined) {\n if (options.signal.aborted) {\n shutdown();\n } else {\n options.signal.addEventListener(\"abort\", shutdown, { once: true });\n }\n }\n });\n}\n","/**\n * Port resolution for `mcp-use dev`: `--port`, else `PORT` env, else 3000 — probing\n * upward when the requested port is taken.\n */\n\nimport { createServer } from \"node:net\";\n\n/** How many consecutive ports to probe before giving up. */\nconst MAX_PROBES = 100;\n\n/**\n * Outcome of {@link resolvePort}.\n *\n * @internal\n */\nexport interface ResolvedPort {\n /** The free port to bind. */\n port: number;\n /** The port that was originally requested (differs when probing moved on). */\n requested: number;\n}\n\n/** Check whether `port` is free to bind on `host`. */\nfunction isPortFree(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const probe = createServer();\n probe.unref();\n probe.once(\"error\", () => resolve(false));\n probe.listen({ port, host }, () => {\n probe.close(() => resolve(true));\n });\n });\n}\n\n/**\n * Resolve the port to bind: take `requested` (already reduced from\n * `--port` / `PORT` / the default by the caller) and probe upward until a\n * free port is found.\n *\n * @param requested - The preferred port.\n * @param host - The host the server will bind (probing binds the same host).\n * @returns The first free port at or above `requested`, plus the original\n * request so callers can log the substitution.\n * @throws If no free port is found within {@link MAX_PROBES} attempts.\n *\n * @internal\n */\nexport async function resolvePort(\n requested: number,\n host: string\n): Promise<ResolvedPort> {\n for (let port = requested; port < requested + MAX_PROBES; port++) {\n if (await isPortFree(port, host)) {\n return { port, requested };\n }\n }\n throw new Error(\n `No free port found between ${requested} and ${requested + MAX_PROBES - 1} on ${host}.`\n );\n}\n","/**\n * Dev-only inspector API routes intercepted by `mcp-use dev` before the MCP\n * handler — tunnel controls and session metadata for the inspector UI.\n */\n\nimport type { TunnelManager } from \"./tunnel.js\";\n\n/** Web-standard request handler, as returned by `MCPServer.getHandler()`. */\ntype FetchHandler = (request: Request) => Promise<Response>;\n\n/**\n * Dependencies for {@link createDevApiHandler}.\n *\n * @internal\n */\nexport interface DevApiHandlerOptions {\n /** Returns the current MCP mount path (may change after a dev reload). */\n getBasePath: () => string;\n /** Port the dev HTTP listener is bound to. */\n port: number;\n /** Tunnel lifecycle manager owned by the dev process. */\n tunnel: TunnelManager;\n}\n\n/** JSON body for `GET …/inspector/api/dev/info`. */\nexport interface DevInfoResponse {\n /** Full MCP endpoint URL when a tunnel is active; otherwise `null`. */\n mcpUrl: string | null;\n /** Port the dev server listens on. */\n port: number;\n /** Whether the request is served by `mcp-use dev` (always `true` here). */\n fromCli: true;\n /** Public tunnel origin URL, or `null` when no tunnel is running. */\n tunnelUrl: string | null;\n}\n\n/**\n * Wrap an MCP {@link FetchHandler} so dev-only inspector API routes are\n * answered in-process before delegating everything else.\n *\n * @param options - Base path, bound port, and tunnel manager.\n * @param fallback - Handler to invoke when the request is not a dev API route.\n *\n * @example\n * ```ts\n * const handler = createDevApiHandler(\n * { getBasePath: () => \"/mcp\", port: 3000, tunnel },\n * server.getHandler()\n * );\n * ```\n */\nexport function createDevApiHandler(\n options: DevApiHandlerOptions,\n fallback: FetchHandler\n): FetchHandler {\n const devInfo = (): DevInfoResponse => {\n const basePath = options.getBasePath();\n const { url: tunnelUrl } = options.tunnel.status();\n return {\n mcpUrl:\n tunnelUrl !== null\n ? `${tunnelUrl.replace(/\\/+$/, \"\")}${basePath}`\n : null,\n port: options.port,\n fromCli: true,\n tunnelUrl,\n };\n };\n\n return async (request: Request): Promise<Response> => {\n const basePath = options.getBasePath();\n const infoPath = `${basePath}/inspector/api/dev/info`;\n const startPath = `${basePath}/inspector/api/dev/start-tunnel`;\n const stopPath = `${basePath}/inspector/api/dev/stop-tunnel`;\n const pathname = new URL(request.url).pathname;\n\n if (request.method === \"GET\" && pathname === infoPath) {\n return Response.json(devInfo());\n }\n\n if (request.method === \"POST\" && pathname === startPath) {\n try {\n await options.tunnel.start(options.port);\n return Response.json({ ok: true, restarting: false });\n } catch (error) {\n const message =\n error instanceof Error ? error.message : \"Failed to start tunnel\";\n return Response.json({ error: message }, { status: 500 });\n }\n }\n\n if (request.method === \"POST\" && pathname === stopPath) {\n await options.tunnel.stop();\n return Response.json({ ok: true });\n }\n\n return fallback(request);\n };\n}\n","/**\n * Tunnel lifecycle for `mcp-use dev` — spawns `@mcp-use/tunnel`,\n * parses the public URL from stdout, persists the subdomain under\n * `.mcp-use/state/tunnel.json`, and releases it through the tunnel API before\n * reuse.\n */\n\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { spawn, type ChildProcess } from \"node:child_process\";\nimport { dirname } from \"node:path\";\n\n/** Default base URL for the tunnel reservation/release API. */\nconst DEFAULT_TUNNEL_API = \"https://local.mcp-use.run\";\n\n/**\n * Base URL of the tunnel API (subdomain reservation/release). Overridable via\n * the `MCP_USE_TUNNEL_API` environment variable.\n */\nexport function tunnelApiBase(): string {\n return process.env[\"MCP_USE_TUNNEL_API\"] ?? DEFAULT_TUNNEL_API;\n}\n\n/** On-disk shape of `.mcp-use/state/tunnel.json`. */\ninterface TunnelStateFile {\n /** Last successfully assigned tunnel subdomain. */\n subdomain: string;\n}\n\n/**\n * Minimal tunnel manager surface used by {@link createDevApiHandler} and\n * {@link runDev}.\n */\nexport interface TunnelManager {\n /**\n * Start (or attach) a tunnel targeting `port` and return the public origin\n * URL and assigned subdomain.\n */\n start(port: number): Promise<{ url: string; subdomain: string }>;\n /** Stop the tunnel child process and release the subdomain. */\n stop(): Promise<void>;\n /** Current tunnel public origin URL, or `null` when no tunnel is active. */\n status(): { url: string | null };\n}\n\n/**\n * Create a tunnel manager that reads and writes subdomain state at\n * `stateFilePath` (typically `.mcp-use/state/tunnel.json`).\n *\n * @param stateFilePath - Absolute path to the tunnel state JSON file.\n *\n * @example\n * ```ts\n * const tunnel = createTunnelManager(paths.tunnel);\n * const { url } = await tunnel.start(3000);\n * console.log(url); // https://happy-cat.local.mcp-use.run\n * ```\n */\nexport function createTunnelManager(stateFilePath: string): TunnelManager {\n let proc: ChildProcess | undefined;\n let currentUrl: string | null = null;\n let currentSubdomain: string | undefined;\n\n const markShutdown = (): void => {\n if (\n proc !== undefined &&\n \"markShutdown\" in proc &&\n typeof (proc as { markShutdown?: () => void }).markShutdown === \"function\"\n ) {\n (proc as { markShutdown: () => void }).markShutdown();\n }\n };\n\n const releaseSubdomain = async (subdomain: string): Promise<void> => {\n try {\n await fetch(`${tunnelApiBase()}/api/tunnels/${subdomain}`, {\n method: \"DELETE\",\n signal: AbortSignal.timeout(2_000),\n });\n } catch {\n // Best-effort cleanup; ignore DELETE failures.\n }\n };\n\n const loadSavedSubdomain = async (): Promise<string | undefined> => {\n try {\n const content = await readFile(stateFilePath, \"utf8\");\n const state = JSON.parse(content) as Partial<TunnelStateFile>;\n return typeof state.subdomain === \"string\" ? state.subdomain : undefined;\n } catch {\n return undefined;\n }\n };\n\n const persistSubdomain = async (subdomain: string): Promise<void> => {\n try {\n await mkdir(dirname(stateFilePath), { recursive: true });\n await writeFile(\n stateFilePath,\n JSON.stringify({ subdomain } satisfies TunnelStateFile, null, 2),\n \"utf8\"\n );\n } catch (error) {\n console.warn(\n `[mcp-use] failed to save tunnel subdomain: ${\n error instanceof Error ? error.message : String(error)\n }`\n );\n }\n };\n\n const spawnTunnel = (\n port: number,\n subdomain?: string\n ): Promise<{ url: string; subdomain: string; process: ChildProcess }> =>\n new Promise((resolve, reject) => {\n console.log(`[mcp-use] starting tunnel for port ${port}…`);\n\n const userAgent = process.env[\"npm_config_user_agent\"] ?? \"\";\n const [tunnelCommand, tunnelArgs] = userAgent.startsWith(\"pnpm/\")\n ? [\"pnpm\", [\"--silent\", \"dlx\", \"@mcp-use/tunnel\", String(port)]]\n : userAgent.startsWith(\"bun/\")\n ? [\"bunx\", [\"@mcp-use/tunnel\", String(port)]]\n : [\n \"npx\",\n [\"--yes\", \"--prefer-offline\", \"@mcp-use/tunnel\", String(port)],\n ];\n if (subdomain !== undefined) {\n tunnelArgs.push(\"--subdomain\", subdomain);\n }\n\n const child = spawn(tunnelCommand, tunnelArgs, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n shell: process.platform === \"win32\",\n });\n\n let resolved = false;\n let shuttingDown = false;\n\n const markChildShutdown = (): void => {\n shuttingDown = true;\n };\n (child as unknown as { markShutdown: () => void }).markShutdown =\n markChildShutdown;\n\n child.stdout.on(\"data\", (data: Buffer) => {\n const text = data.toString();\n const isShutdownMessage =\n text.includes(\"Shutting down\") || text.includes(\"🛑\");\n const isErrorMessage = text.includes(\"✖\") || text.includes(\"Error:\");\n\n if (!shuttingDown && !isShutdownMessage && !isErrorMessage) {\n process.stdout.write(text);\n }\n\n const urlMatch = text.match(/https?:\\/\\/([a-z0-9-]+\\.[a-z0-9.-]+)/i);\n if (urlMatch !== null && !resolved) {\n const url = urlMatch[0];\n const fullDomain = urlMatch[1] ?? \"\";\n const subdomainMatch = fullDomain.match(/^([a-z0-9-]+)\\./i);\n let extractedSubdomain =\n subdomainMatch?.[1] ?? fullDomain.split(\".\")[0] ?? \"\";\n if (!/^[a-z0-9-]+$/i.test(extractedSubdomain)) {\n console.warn(\n `[mcp-use] warning: extracted subdomain \"${extractedSubdomain}\" does not match expected format`\n );\n extractedSubdomain = \"\";\n }\n resolved = true;\n clearTimeout(setupTimeout);\n // No log here — the tunnel child's own stdout (passed through\n // above) already announces the public URL.\n resolve({ url, subdomain: extractedSubdomain, process: child });\n }\n });\n\n child.stderr.on(\"data\", (data: Buffer) => {\n const text = data.toString();\n if (\n !shuttingDown &&\n !text.includes(\"INFO\") &&\n !text.includes(\"bore_cli\") &&\n !text.includes(\"Shutting down\") &&\n // npx inherits pnpm-only npm_config_* env vars (e.g.\n // minimum-release-age, verify-deps-before-run) and warns about\n // every key it doesn't recognize — pure noise for the user.\n !/npm warn Unknown (?:env|project|user|builtin) config/.test(text)\n ) {\n process.stderr.write(data);\n }\n });\n\n child.on(\"error\", (error) => {\n if (!resolved) {\n clearTimeout(setupTimeout);\n reject(new Error(`Failed to start tunnel: ${error.message}`));\n }\n });\n\n child.on(\"exit\", (code) => {\n if (code !== 0 && code !== null && !resolved) {\n clearTimeout(setupTimeout);\n reject(new Error(`Tunnel process exited with code ${code}`));\n }\n // The tunnel CLI can exit after setup when its bore connection or\n // server-side registration disappears. Do not keep reporting a dead\n // public URL through dev/info.\n if (proc === child) {\n proc = undefined;\n currentUrl = null;\n currentSubdomain = undefined;\n }\n });\n\n const setupTimeout = setTimeout(() => {\n if (!resolved) {\n child.kill();\n reject(new Error(\"Tunnel setup timed out\"));\n }\n }, 30_000);\n });\n\n return {\n status(): { url: string | null } {\n return { url: currentUrl };\n },\n\n async start(port: number): Promise<{ url: string; subdomain: string }> {\n if (currentUrl !== null) {\n return {\n url: currentUrl,\n subdomain: currentSubdomain ?? \"\",\n };\n }\n\n const existingSubdomain = await loadSavedSubdomain();\n if (existingSubdomain !== undefined) {\n console.log(`[mcp-use] found existing subdomain: ${existingSubdomain}`);\n await releaseSubdomain(existingSubdomain);\n }\n\n let tunnelInfo: Awaited<ReturnType<typeof spawnTunnel>>;\n try {\n tunnelInfo = await spawnTunnel(port, existingSubdomain);\n } catch (error) {\n if (existingSubdomain !== undefined) {\n console.log(\n `[mcp-use] subdomain \"${existingSubdomain}\" unavailable, requesting a new one…`\n );\n tunnelInfo = await spawnTunnel(port, undefined);\n } else {\n throw error;\n }\n }\n\n proc = tunnelInfo.process;\n currentUrl = tunnelInfo.url;\n currentSubdomain = tunnelInfo.subdomain;\n await persistSubdomain(tunnelInfo.subdomain);\n\n return { url: tunnelInfo.url, subdomain: tunnelInfo.subdomain };\n },\n\n async stop(): Promise<void> {\n markShutdown();\n\n if (currentSubdomain !== undefined) {\n await releaseSubdomain(currentSubdomain);\n }\n\n if (proc !== undefined) {\n proc.kill(\"SIGINT\");\n proc = undefined;\n }\n\n currentUrl = null;\n currentSubdomain = undefined;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAS,SAAAA,cAAa;AACtB,SAAS,gBAAgB,wBAAwB;AAEjD,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,YAAY;AACrB,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,SAAS,gBAAAC,eAAc,gCAAgC;AACvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;;;AC9BP,SAAS,oBAAoB;AAG7B,IAAM,aAAa;AAenB,SAAS,WAAW,MAAc,MAAgC;AAChE,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,QAAQ,aAAa;AAC3B,UAAM,MAAM;AACZ,UAAM,KAAK,SAAS,MAAM,QAAQ,KAAK,CAAC;AACxC,UAAM,OAAO,EAAE,MAAM,KAAK,GAAG,MAAM;AACjC,YAAM,MAAM,MAAM,QAAQ,IAAI,CAAC;AAAA,IACjC,CAAC;AAAA,EACH,CAAC;AACH;AAeA,eAAsBC,aACpB,WACA,MACuB;AACvB,WAAS,OAAO,WAAW,OAAO,YAAY,YAAY,QAAQ;AAChE,QAAI,MAAM,WAAW,MAAM,IAAI,GAAG;AAChC,aAAO,EAAE,MAAM,UAAU;AAAA,IAC3B;AAAA,EACF;AACA,QAAM,IAAI;AAAA,IACR,8BAA8B,SAAS,QAAQ,YAAY,aAAa,CAAC,OAAO,I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AA,IACnE;AAAA,EACF;AACA,MAAI,CAAC,eAAe;AAClB,YAAQ;AAAA,MACN,oBAAoB,IAAI;AAAA,IAG1B;AAAA,EACF;AAEA,MAAI,QAAQ,WAAW,MAAM;AAC3B,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,MAAM,cAAc,MAAM,IAAI;AAC9C,cAAQ,IAAI,2BAAsB,GAAG,GAAG,QAAQ,EAAE;AAAA,IACpD,SAAS,OAAO;AACd,YAAM,SAAS;AACf,YAAM;AAAA,IACR;AAAA,EACF;AAIA,MAAI,QAAQ,SAAS,SAAS,QAAQ,OAAO,UAAU,MAAM;AAC3D,kBAAc,GAAG,SAAS,GAAG,QAAQ,YAAY;AAAA,EACnD;AAGA,QAAM,IAAI,QAAc,CAAC,YAAY;AACnC,QAAI,UAAU;AACd,UAAM,WAAW,MAAY;AAC3B,UAAI,QAAS;AACb,gBAAU;AACV,cAAQ,IAAI,UAAU,QAAQ;AAC9B,cAAQ,IAAI,WAAW,QAAQ;AAC/B,YAAM,YAAY;AAChB,cAAM,SAAS;AACf,gBAAQ;AAAA,MACV,GAAG;AAAA,IACL;AACA,YAAQ,GAAG,UAAU,QAAQ;AAC7B,YAAQ,GAAG,WAAW,QAAQ;AAC9B,QAAI,QAAQ,WAAW,QAAW;AAChC,UAAI,QAAQ,OAAO,SAAS;AAC1B,iBAAS;AAAA,MACX,OAAO;AACL,gBAAQ,OAAO,iBAAiB,SAAS,UAAU,EAAE,MAAM,KAAK,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":["spawn","createServer","resolvePort","spawn","resolvePort","createServer"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/dev.ts","../../src/cli/port.ts","../../src/cli/dev-api.ts","../../src/cli/tunnel.ts"],"sourcesContent":["/**\n * `mcp-use dev` — a single long-lived dev process (CLI_SPEC.md § Commands →\n * dev): a Vite dev server (Environment API, node/SSR environment only) loads\n * the entry through the module runner; one HTTP listener delegates every\n * request to an atomically swappable handler reference.\n *\n * When views exist, the same Vite server gains a client environment with real\n * HMR for view files; the CLI primes views on each entry reload via the\n * internal {@link registerViews} API (VIEWS_SPEC.md § Dev).\n *\n * Reload, not HMR: on file change the entry is re-imported and the handler\n * reference swapped — no registration diffing or running-registry mutation.\n * All handler generations share one event bus, so a successful swap invalidates\n * the tool, prompt, and resource lists for subscribed development clients.\n *\n * This module is reached only through the bin's dedicated dynamic dev import,\n * so library consumers and production startup never evaluate Vite.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { createServer as createNodeServer } from \"node:http\";\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { networkInterfaces } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport tailwindcss from \"@tailwindcss/vite\";\nimport react from \"@vitejs/plugin-react\";\nimport { createServer, createServerModuleRunner } from \"vite\";\nimport {\n InMemoryServerEventBus,\n localhostAllowedHostnames,\n localhostAllowedOrigins,\n type ServerEventBus,\n validateHostHeader,\n validateOriginHeader,\n} from \"@modelcontextprotocol/server\";\n\nimport { resolvePort as resolvePreferredPort } from \"../bin/args.js\";\nimport { discoverEntry } from \"./entry.js\";\nimport {\n loadProjectEnv,\n nextStandaloneCompatPlugin,\n nextStandaloneSsrOptions,\n} from \"./next-compat.js\";\nimport { resolvePort } from \"./port.js\";\nimport { resolveTailwindCss, resolveUserViteConfig } from \"./vite-config.js\";\nimport { createDevApiHandler } from \"./dev-api.js\";\nimport { createTunnelManager } from \"./tunnel.js\";\nimport { ensureMcpEnvDeclaration } from \"./mcp-env-declaration.js\";\nimport { resolveWorkspacePaths } from \"./workspace.js\";\nimport { mcpUseViewsPlugin } from \"./views-plugin.js\";\nimport {\n buildDevViewsManifest,\n discoverViews,\n isViewPath,\n type DiscoveredView,\n} from \"./views.js\";\nimport type { ViewsManifest } from \"../views/types.js\";\n\n/** Universal web handler returned by `MCPServer.getHandler()`. */\ntype FrameworkHandler = (\n input: Request | { req: { raw: Request } }\n) => Promise<Response>;\n\n/**\n * The duck-typed shape the entry's default export must satisfy: an\n * `MCPServer` instance (checked structurally so the runner may load its own\n * copy of `mcp-use`).\n */\ninterface ServerLike {\n getHandler(options?: { bus?: ServerEventBus }): FrameworkHandler;\n /** URL path prefix the MCP endpoint is mounted at (default `\"/mcp\"`). */\n readonly basePath?: string;\n __primeViews(\n views: ViewsManifest,\n options?: { dev?: boolean; projectRoot?: string }\n ): void;\n}\n\n/**\n * Options for {@link runDev}.\n *\n * @internal\n */\nexport interface DevOptions {\n /** Absolute path to the project root. */\n cwd: string;\n /**\n * Explicit entry path (the `--entry` flag), absolute or relative to `cwd`.\n *\n * @defaultValue Conventional discovery: `src/index.ts`, `src/server.ts`,\n * `index.ts`, `server.ts` — first hit wins.\n */\n entry?: string;\n /** Directory containing the conventional entry and, by default, views/. */\n mcpDir?: string;\n /** Explicit views directory, absolute or relative to `cwd`. */\n viewsDir?: string;\n /**\n * Preferred port. When taken, the next free port upward is used (and the\n * substitution logged).\n *\n * @defaultValue The `PORT` environment variable, else `3000`.\n */\n port?: number;\n /**\n * Interface address to bind — `\"0.0.0.0\"` exposes the dev server to the\n * local network (phones, containers, teammates); the default keeps it\n * machine-local. Printed and auto-opened URLs use `localhost` for\n * loopback/wildcard binds and the given host verbatim otherwise.\n *\n * Localhost-class binds get DNS-rebinding protection: every request's\n * `Host` is validated (plus the active tunnel hostname); `Origin` only on\n * non-GET/HEAD. Non-localhost binds skip validation — the legitimate\n * hostnames are unknowable here — and log a warning instead.\n *\n * @defaultValue `\"127.0.0.1\"` (matching the server's localhost-first posture).\n */\n host?: string;\n /**\n * Abort signal for embedding and tests: aborting shuts the dev process\n * down gracefully (same path as SIGINT/SIGTERM). The CLI itself does not\n * pass this.\n */\n signal?: AbortSignal;\n /**\n * When `true`, start a public tunnel as soon as the HTTP listener is bound\n * (same as the inspector \"Start Tunnel\" control, but at startup).\n *\n * @defaultValue `false`\n */\n tunnel?: boolean;\n /**\n * Auto-open the inspector in the default browser once the listener is\n * bound (`--no-open` sets this to `false`). Opening is additionally\n * skipped when stdout is not a TTY — agents and CI never get a spurious\n * browser launch or a \"failed to open\" error.\n *\n * @defaultValue `true`\n */\n open?: boolean;\n}\n\n/**\n * Best-effort open of `url` in the platform's default browser.\n *\n * Dependency-free (`open`/`start`/`xdg-open` via spawn), detached, and\n * error-swallowing: a missing opener (headless Linux, containers) must never\n * crash or log noise into the dev process.\n */\nfunction openInBrowser(url: string): void {\n const [command, args]: [string, string[]] =\n process.platform === \"darwin\"\n ? [\"open\", [url]]\n : process.platform === \"win32\"\n ? // `start` is a cmd built-in; the empty string is the window title.\n [\"cmd\", [\"/c\", \"start\", \"\", url]]\n : [\"xdg-open\", [url]];\n try {\n const child = spawn(command, args, { stdio: \"ignore\", detached: true });\n child.on(\"error\", () => {\n // Swallow: auto-open is a convenience, never a failure.\n });\n child.unref();\n } catch {\n // Synchronous spawn failures are equally non-fatal.\n }\n}\n\n/**\n * First non-internal IPv4 address of this machine, for the \"Network:\" line\n * printed on wildcard binds — `undefined` when offline.\n */\nfunction lanAddress(): string | undefined {\n for (const addresses of Object.values(networkInterfaces())) {\n for (const address of addresses ?? []) {\n if (!address.internal && address.family === \"IPv4\") {\n return address.address;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Merge `Origin` into an existing `Vary` header without duplicating it.\n *\n * @param res - Node response whose `Vary` may already list other tokens.\n */\nfunction appendVaryOrigin(res: ServerResponse): void {\n const existing = res.getHeader(\"Vary\");\n const current =\n typeof existing === \"string\"\n ? existing\n : Array.isArray(existing)\n ? existing.join(\", \")\n : existing !== undefined\n ? String(existing)\n : \"\";\n if (\n current\n .split(\",\")\n .map((token) => token.trim().toLowerCase())\n .includes(\"origin\")\n ) {\n return;\n }\n res.setHeader(\"Vary\", current === \"\" ? \"Origin\" : `${current}, Origin`);\n}\n\n/**\n * CORS for Vite-served module-graph URLs on the dev listener.\n *\n * Tunnel active → `Access-Control-Allow-Origin: *` (foreign / opaque hosts).\n * No tunnel on a localhost bind → reflect a validated loopback `Origin`\n * (exact value) and set `Vary: Origin`; reflect `null` for opaque sandbox\n * iframes; foreign or missing Origin get no ACAO.\n *\n * @param req - Incoming request (reads `Origin`).\n * @param res - Response to receive CORS headers.\n * @param options - `tunnelActive` when a public tunnel URL is set;\n * `localhostBind` when the listener is on a loopback host.\n */\nfunction applyViteModuleCors(\n req: IncomingMessage,\n res: ServerResponse,\n options: { tunnelActive: boolean; localhostBind: boolean }\n): void {\n if (options.tunnelActive) {\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n return;\n }\n if (!options.localhostBind) {\n return;\n }\n const originHeader = req.headers.origin;\n // Sandboxed MCP App iframes (opaque origin) send `Origin: null` on module GETs.\n if (originHeader === \"null\") {\n res.setHeader(\"Access-Control-Allow-Origin\", \"null\");\n return;\n }\n // validateOriginHeader treats a missing Origin as ok (no header to check);\n // CORS reflection requires a concrete loopback origin string.\n if (typeof originHeader !== \"string\" || originHeader === \"\") {\n return;\n }\n const result = validateOriginHeader(originHeader, localhostAllowedOrigins());\n if (!result.ok || result.origin === undefined) {\n return;\n }\n res.setHeader(\"Access-Control-Allow-Origin\", result.origin);\n appendVaryOrigin(res);\n}\n\n/**\n * Validate the entry module's default export and return it as a\n * {@link ServerLike}.\n */\nfunction serverFrom(moduleExports: Record<string, unknown>): ServerLike {\n const server = moduleExports[\"default\"];\n if (server === null || typeof server !== \"object\") {\n throw new Error(\n \"The server entry must default-export the MCPServer instance \" +\n \"(`export default server`) and never call listen() itself — \" +\n \"`mcp-use dev` owns the socket.\"\n );\n }\n const candidate = server as Partial<ServerLike>;\n if (typeof candidate.getHandler !== \"function\") {\n throw new Error(\n \"The entry's default export has no getHandler() — it must be the \" +\n \"MCPServer instance (`export default server`).\"\n );\n }\n return candidate as ServerLike;\n}\n\n/**\n * Run the dev server: import the entry through Vite's module runner (full\n * TS/alias support), serve `server.getHandler()` on one long-lived HTTP\n * listener, and swap the handler on file change.\n *\n * A throwing re-import keeps the previous handler alive and prints the error\n * — the dev process never crashes on a bad save. `.env` (if present) is\n * loaded from `cwd` via `process.loadEnvFile()` before the entry is first\n * imported.\n *\n * The returned promise resolves after a graceful shutdown (SIGINT/SIGTERM or\n * `options.signal` aborting).\n *\n * @param options - Project root, optional entry override, port and host.\n * @throws If no entry is found, if the initial import fails, if the entry's\n * default export is not an `MCPServer` (see the entry contract in\n * CLI_SPEC.md), or if `vite` is not installed (`mcp-use dev` requires it as a\n * devDependency).\n *\n * @internal Reached only via the bin's dedicated dev command chunk — not\n * re-exported from the package's \".\" entry.\n */\nexport async function runDev(options: DevOptions): Promise<void> {\n process.env.MCP_USE_DEV_CLI = \"1\";\n const host = options.host ?? \"127.0.0.1\";\n const paths = resolveWorkspacePaths(options.cwd);\n const eventBus = new InMemoryServerEventBus((error) => {\n console.error(\"[mcp-use] notification delivery failed:\", error);\n });\n\n loadProjectEnv(options.cwd, \"development\");\n\n // Resolve the listener before importing the entry so module-scope OAuth\n // configuration observes the canonical port that this CLI will own.\n // The HTTP listener is a raw node:http server with the vendored\n // toNodeHandler bridge — same role as the old @hono/node-server\n // getRequestListener, without a hono dependency.\n // Connect-style ((req, res, next)) with no fetch-shaped equivalent, so\n // splicing it in front of the swappable fetch handler needs the raw Node\n // request boundary. Creating the (not-yet-listening) server up front also\n // lets Vite attach its HMR websocket to this same socket (`hmr.server`\n // below) — one port total, so several `mcp-use dev` processes coexist\n // without websocket port collisions.\n const httpServer = createNodeServer();\n\n const { port, requested } = await resolvePort(\n resolvePreferredPort(options.port),\n host\n );\n if (port !== requested) {\n console.log(`[mcp-use] port ${requested} is taken, using ${port}`);\n }\n process.env[\"PORT\"] = String(port);\n\n const localFallbackMcpUrl =\n process.env[\"MCP_URL\"] === undefined &&\n (host === \"127.0.0.1\" || host === \"localhost\" || host === \"::1\")\n ? `http://localhost:${port}`\n : undefined;\n\n const sourceRoot =\n options.mcpDir === undefined\n ? options.cwd\n : resolve(options.cwd, options.mcpDir);\n const entry =\n options.entry === undefined\n ? discoverEntry(sourceRoot)\n : discoverEntry(options.cwd, options.entry);\n if (await ensureMcpEnvDeclaration(options.cwd, entry)) {\n console.log(\"[mcp-use] created mcp-env.d.ts\");\n }\n const viewsDirectory =\n options.viewsDir ??\n (options.mcpDir === undefined ? undefined : join(options.mcpDir, \"views\"));\n let currentViews: DiscoveredView[] = discoverViews(\n options.cwd,\n viewsDirectory\n );\n // The Vite client environment (views plugin, Fast Refresh, HMR socket,\n // asset origin) is configured once, from this snapshot. `currentViews`\n // stays live for request routing and re-priming, but a project that starts\n // with zero views needs a dev-server restart to pick up its first view.\n const viewsAtStartup = currentViews.length > 0;\n const userViteConfig = resolveUserViteConfig(options.cwd);\n\n // The bind address is not always a browsable address: `0.0.0.0`/`::`\n // accept connections on every interface but are not valid request hosts\n // in every browser, and `127.0.0.1` reads worse than `localhost` in logs.\n // Anything else (a LAN IP, a hostname) is browsable as itself; bare IPv6\n // addresses need brackets in URLs.\n const loopbackOrWildcard = [\"127.0.0.1\", \"localhost\", \"0.0.0.0\", \"::\", \"::1\"];\n const browsableHost = loopbackOrWildcard.includes(host) ? \"localhost\" : host;\n const devOrigin = `http://${\n browsableHost.includes(\":\") ? `[${browsableHost}]` : browsableHost\n }:${port}`;\n\n const vite = await createServer({\n root: options.cwd,\n configFile: viewsAtStartup ? userViteConfig : false,\n envDir: false,\n logLevel: \"warn\",\n cacheDir: paths.cache,\n resolve: {\n tsconfigPaths: true,\n alias: { tailwindcss: resolveTailwindCss() },\n },\n plugins: viewsAtStartup\n ? [\n nextStandaloneCompatPlugin(options.cwd),\n tailwindcss(),\n mcpUseViewsPlugin({\n getViews: () => currentViews,\n dev: { reactRefresh: true },\n }),\n react(),\n ]\n : [nextStandaloneCompatPlugin(options.cwd)],\n server: {\n middlewareMode: true,\n // Absolute asset URLs in dev: without `origin`, Vite emits root-relative\n // paths that resolve against the host page inside srcdoc iframes.\n ...(viewsAtStartup && { origin: devOrigin }),\n // CORS on module URLs is owned by onRequest below (permissive ACAO\n // only while the tunnel is active), not by Vite's own middleware —\n // whose default localhost-only policy would block tunnel-rendering\n // hosts, and whose headers would fight the tunnel-gated ones.\n cors: false,\n // View HMR rides the one HTTP listener: Vite attaches its websocket\n // upgrade handler to our server, so no dedicated HMR port exists to\n // collide when several dev processes run side by side.\n hmr: viewsAtStartup ? { server: httpServer } : false,\n },\n ssr: {\n ...nextStandaloneSsrOptions(options.cwd),\n },\n });\n\n const ssrEnvironment = vite.environments.ssr;\n const runner = createServerModuleRunner(ssrEnvironment, {\n hmr: false,\n sourcemapInterceptor: \"node\",\n });\n\n const importServer = async (): Promise<ServerLike> => {\n const load = async (): Promise<ServerLike> => {\n const moduleExports = (await runner.import(entry)) as Record<\n string,\n unknown\n >;\n const server = serverFrom(moduleExports);\n\n if (currentViews.length > 0) {\n const viewsManifest = buildDevViewsManifest(currentViews);\n if (typeof server.__primeViews !== \"function\") {\n throw new Error(\n \"Loaded MCPServer instance does not support __primeViews.\"\n );\n }\n server.__primeViews(viewsManifest, {\n dev: true,\n projectRoot: options.cwd,\n });\n }\n\n return server;\n };\n\n if (localFallbackMcpUrl === undefined) {\n return load();\n }\n\n // This is safe only because this CLI selected and will bind this local\n // listener. Never derive OAuth identity from an untrusted request Host.\n // Scope it to entry evaluation: MCPServer freezes the trusted canonical\n // resource during construction, while later runtime code must not inherit\n // this CLI-owned synthetic environment value.\n const previousMcpUrl = process.env[\"MCP_URL\"];\n try {\n process.env[\"MCP_URL\"] = localFallbackMcpUrl;\n return await load();\n } finally {\n if (previousMcpUrl === undefined) {\n delete process.env[\"MCP_URL\"];\n } else {\n process.env[\"MCP_URL\"] = previousMcpUrl;\n }\n }\n };\n\n let currentHandler: FrameworkHandler;\n let basePath: string;\n try {\n const server = await importServer();\n currentHandler = server.getHandler({ bus: eventBus });\n basePath = server.basePath ?? \"/mcp\";\n } catch (error) {\n await runner.close();\n await vite.close();\n throw error;\n }\n\n let reloading = false;\n let dirty = false;\n const reload = (): void => {\n if (reloading) {\n dirty = true;\n return;\n }\n reloading = true;\n void (async () => {\n do {\n dirty = false;\n try {\n runner.evaluatedModules.clear();\n const server = await importServer();\n const nextHandler = server.getHandler({ bus: eventBus });\n currentHandler = nextHandler;\n basePath = server.basePath ?? \"/mcp\";\n eventBus.publish({ kind: \"tools_list_changed\" });\n eventBus.publish({ kind: \"prompts_list_changed\" });\n eventBus.publish({ kind: \"resources_list_changed\" });\n console.log(\"[mcp-use] reloaded server entry\");\n } catch (error) {\n console.error(\n \"[mcp-use] reload failed — keeping the previous server:\\n\",\n error\n );\n }\n } while (dirty);\n reloading = false;\n })();\n };\n\n const onSsrFileEvent = (file: string): void => {\n if (isViewPath(file, options.cwd, viewsDirectory)) {\n return;\n }\n const modules = ssrEnvironment.moduleGraph.getModulesByFile(file);\n if (modules === undefined || modules.size === 0) {\n return;\n }\n for (const mod of modules) {\n ssrEnvironment.moduleGraph.invalidateModule(mod);\n }\n reload();\n };\n\n const onViewFilesystemEvent = (file: string): void => {\n if (!isViewPath(file, options.cwd, viewsDirectory)) {\n return;\n }\n\n const previousViews = currentViews;\n currentViews = discoverViews(options.cwd, viewsDirectory);\n\n const viewsChanged =\n previousViews.length !== currentViews.length ||\n previousViews.some(\n (v, i) =>\n v.name !== currentViews[i]?.name ||\n v.entryPath !== currentViews[i]?.entryPath\n );\n\n if (viewsChanged) {\n reload();\n }\n };\n\n const onFileAddOrUnlink = (file: string): void => {\n onViewFilesystemEvent(file);\n onSsrFileEvent(file);\n };\n\n // A `change` event cannot add or remove a view directory, so only\n // `add`/`unlink` rescan `views/` — content edits never pay for the\n // synchronous filesystem walk in discoverViews().\n vite.watcher.on(\"change\", onSsrFileEvent);\n vite.watcher.on(\"add\", onFileAddOrUnlink);\n vite.watcher.on(\"unlink\", onFileAddOrUnlink);\n\n // --- One long-lived HTTP listener delegating to the current handler. -----\n const tunnelManager = createTunnelManager(paths.tunnel);\n\n // Vite owns the upgrade listener and validates Host before our HTTP request\n // guard runs. The public tunnel has already been validated by the proxy and\n // tunnel manager, so present only that active host as the local listener.\n httpServer.prependListener(\"upgrade\", (req) => {\n const tunnelUrl = tunnelManager.status().url;\n if (tunnelUrl === null) return;\n const tunnelHost = new URL(tunnelUrl).hostname;\n const requestHost = req.headers.host?.split(\":\")[0];\n if (requestHost === tunnelHost) {\n req.headers.host = `localhost:${port}`;\n }\n });\n\n // --- DNS-rebinding protection. --------------------------------------------\n // getHandler() applies no Host/Origin validation (its contract assumes a\n // platform edge in front); in dev this process *is* the edge, so\n // localhost-class binds get the same localhost-allowlist checks listen()\n // applies — extended with the active tunnel hostname, since tunnel traffic\n // arrives with the tunnel's public Host. The check runs before any routing,\n // covering the MCP endpoint, the dev API (tunnel control), and Vite-served\n // module URLs alike. Non-localhost binds get no validation (the legitimate\n // hostnames are unknowable here) — a startup warning below says so.\n //\n // Host is validated on every request: rebinding works by making the\n // attacker's page same-origin with this server, and the Host header is\n // where that shows up. Origin is not validated here (SDK-aligned default);\n // set `allowedOrigins` on the MCPServer to opt in — the handler middleware\n // enforces it. Sandboxed view iframes have an opaque origin, so their\n // module/asset GETs legitimately carry `Origin: null` — and external hosts\n // rendering views through the tunnel fetch assets with their own origins.\n // Those cross-origin loads also need CORS: the MCP server's view asset/public\n // routes always emit `Access-Control-Allow-Origin: *`. Vite-served module\n // URLs (onRequest below) emit `*` while a tunnel is active; without a tunnel,\n // localhost binds reflect a validated loopback Origin (exact value +\n // `Vary: Origin`) so a local MCP host can load the module graph, while\n // foreign / opaque / missing Origin get no ACAO.\n const localhostBind = [\"127.0.0.1\", \"localhost\", \"::1\"].includes(host);\n const rejectDisallowedRequest = (\n req: IncomingMessage,\n res: ServerResponse\n ): boolean => {\n const tunnelUrl = tunnelManager.status().url;\n const tunnelHost = tunnelUrl !== null ? new URL(tunnelUrl).hostname : null;\n const extra = tunnelHost !== null ? [tunnelHost] : [];\n const result = validateHostHeader(req.headers.host, [\n ...localhostAllowedHostnames(),\n ...extra,\n ]);\n if (result.ok) {\n return false;\n }\n // Same JSON-RPC 403 shape the SDK's own validation responses use.\n res.writeHead(403, { \"content-type\": \"application/json\" });\n res.end(\n JSON.stringify({\n jsonrpc: \"2.0\",\n error: { code: -32000, message: result.message },\n id: null,\n })\n );\n return true;\n };\n\n /**\n * Tear down everything the running dev process owns, in dependency order:\n * watcher subscriptions, tunnel, HTTP listener, module runner, Vite.\n */\n const teardown = async (): Promise<void> => {\n vite.watcher.off(\"change\", onSsrFileEvent);\n vite.watcher.off(\"add\", onFileAddOrUnlink);\n vite.watcher.off(\"unlink\", onFileAddOrUnlink);\n await tunnelManager.stop();\n await new Promise<void>((done) => httpServer.close(() => done()));\n await runner.close();\n await vite.close();\n };\n\n const devFetch = createDevApiHandler(\n {\n getBasePath: () => basePath,\n port,\n tunnel: tunnelManager,\n },\n (request) => currentHandler(request)\n );\n\n // Vendored Node bridge — same adapter serve() used internally.\n const { toNodeHandler } = await import(\"../node-bridge.js\");\n const nodeListener = toNodeHandler({ fetch: devFetch });\n\n const onRequest = (req: IncomingMessage, res: ServerResponse): void => {\n if (localhostBind && rejectDisallowedRequest(req, res)) {\n return;\n }\n const url = req.url ?? \"/\";\n const pathname = new URL(url, \"http://127.0.0.1\").pathname;\n // Routing to Vite requires both the client environment (configured only\n // when views existed at startup) and a currently non-empty registry.\n const viewsEnabled = viewsAtStartup && currentViews.length > 0;\n // Vite sees module-graph URLs (/@vite/client, /@id/virtual:…,\n // /.mcp-use/cache/deps/…, view files under /views/…) plus standard\n // node_modules pre-bundles; everything else — the MCP endpoint included —\n // goes straight to the fetch handler.\n const isViteRequest =\n req.method === \"GET\" &&\n (pathname.startsWith(\"/@\") ||\n pathname.startsWith(\"/node_modules/\") ||\n pathname.startsWith(\"/.mcp-use/\") ||\n (viewsEnabled && pathname.startsWith(\"/views/\")));\n\n if (viewsEnabled && isViteRequest) {\n // CORS for Vite module URLs: tunnel → `*`; else localhost bind with a\n // validated loopback Origin → reflect that origin (+ Vary). Foreign /\n // opaque / missing Origin stay without ACAO so the source module graph\n // is not readable to arbitrary websites.\n applyViteModuleCors(req, res, {\n tunnelActive: tunnelManager.status().url !== null,\n localhostBind,\n });\n vite.middlewares(req, res, () => {\n void nodeListener(req, res);\n });\n } else {\n void nodeListener(req, res);\n }\n };\n httpServer.on(\"request\", onRequest);\n\n await new Promise<void>((resolve, reject) => {\n httpServer.once(\"error\", reject);\n httpServer.listen(port, host, () => resolve());\n });\n\n console.log(`[mcp-use] dev server ready`);\n if (currentViews.length > 0) {\n console.log(\n ` ➜ Views: ${currentViews.map((v) => v.name).join(\", \")}`\n );\n }\n console.log(` ➜ MCP endpoint: ${devOrigin}${basePath}`);\n console.log(` ➜ Inspector: ${devOrigin}${basePath}/inspector`);\n if (host === \"0.0.0.0\" || host === \"::\") {\n const lan = lanAddress();\n if (lan !== undefined) {\n console.log(` ➜ Network: http://${lan}:${port}${basePath}`);\n }\n }\n if (!localhostBind) {\n console.warn(\n `[mcp-use] --host ${host} serves beyond this machine without Host ` +\n `validation or authentication — anyone with network access can call ` +\n `the MCP endpoint and dev routes.`\n );\n }\n\n if (options.tunnel === true) {\n try {\n const { url } = await tunnelManager.start(port);\n console.log(` ➜ Tunnel: ${url}${basePath}`);\n } catch (error) {\n await teardown();\n throw error;\n }\n }\n\n // Auto-open the inspector — unless disabled (`--no-open`) or stdout is not\n // a TTY (agents/CI: no browser to open, and no error to fail on).\n if (options.open !== false && process.stdout.isTTY === true) {\n openInBrowser(`${devOrigin}${basePath}/inspector`);\n }\n\n // --- Graceful shutdown (SIGINT/SIGTERM or options.signal). ---------------\n await new Promise<void>((resolve) => {\n let closing = false;\n const shutdown = (): void => {\n if (closing) return;\n closing = true;\n process.off(\"SIGINT\", shutdown);\n process.off(\"SIGTERM\", shutdown);\n void (async () => {\n await teardown();\n resolve();\n })();\n };\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n if (options.signal !== undefined) {\n if (options.signal.aborted) {\n shutdown();\n } else {\n options.signal.addEventListener(\"abort\", shutdown, { once: true });\n }\n }\n });\n}\n","/**\n * Port resolution for `mcp-use dev`: `--port`, else `PORT` env, else 3000 — probing\n * upward when the requested port is taken.\n */\n\nimport { connect, createServer } from \"node:net\";\n\n/** How many consecutive ports to probe before giving up. */\nconst MAX_PROBES = 100;\n\n/** Short timeout for loopback connect probes (ms). */\nconst CONNECT_PROBE_MS = 300;\n\n/**\n * Outcome of {@link resolvePort}.\n *\n * @internal\n */\nexport interface ResolvedPort {\n /** The free port to bind. */\n port: number;\n /** The port that was originally requested (differs when probing moved on). */\n requested: number;\n}\n\nconst LOOPBACK_HOSTS = new Set([\"127.0.0.1\", \"localhost\", \"::1\"]);\n\n/** Check whether `port` is free to bind on `host`. */\nfunction isPortFree(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const probe = createServer();\n probe.unref();\n probe.once(\"error\", () => resolve(false));\n probe.listen({ port, host }, () => {\n probe.close(() => resolve(true));\n });\n });\n}\n\n/** Whether a TCP connect to `host:port` succeeds within {@link CONNECT_PROBE_MS}. */\nfunction canConnect(port: number, host: string): Promise<boolean> {\n return new Promise((resolve) => {\n const socket = connect({ port, host });\n socket.setTimeout(CONNECT_PROBE_MS);\n socket.once(\"connect\", () => {\n socket.destroy();\n resolve(true);\n });\n socket.once(\"timeout\", () => {\n socket.destroy();\n resolve(false);\n });\n socket.once(\"error\", () => {\n socket.destroy();\n resolve(false);\n });\n });\n}\n\n/**\n * On loopback binds, a wildcard listener on `*:port` (IPv6) can still accept\n * `localhost` traffic while `127.0.0.1:port` bind-probes succeed — macOS dual-stack.\n * Treat the port as taken when either loopback address already accepts connections.\n */\nasync function loopbackPortInUse(port: number): Promise<boolean> {\n return (\n (await canConnect(port, \"127.0.0.1\")) || (await canConnect(port, \"::1\"))\n );\n}\n\n/**\n * Resolve the port to bind: take `requested` (already reduced from\n * `--port` / `PORT` / the default by the caller) and probe upward until a\n * free port is found.\n *\n * @param requested - The preferred port.\n * @param host - The host the server will bind (probing binds the same host).\n * @returns The first free port at or above `requested`, plus the original\n * request so callers can log the substitution.\n * @throws If no free port is found within {@link MAX_PROBES} attempts.\n *\n * @internal\n */\nexport async function resolvePort(\n requested: number,\n host: string\n): Promise<ResolvedPort> {\n for (let port = requested; port < requested + MAX_PROBES; port++) {\n if (!(await isPortFree(port, host))) continue;\n if (LOOPBACK_HOSTS.has(host) && (await loopbackPortInUse(port))) continue;\n return { port, requested };\n }\n throw new Error(\n `No free port found between ${requested} and ${requested + MAX_PROBES - 1} on ${host}.`\n );\n}\n","/**\n * Dev-only inspector API routes intercepted by `mcp-use dev` before the MCP\n * handler — tunnel controls and session metadata for the inspector UI.\n */\n\nimport type { TunnelManager } from \"./tunnel.js\";\n\n/** Web-standard request handler, as returned by `MCPServer.getHandler()`. */\ntype FetchHandler = (request: Request) => Promise<Response>;\n\n/**\n * Dependencies for {@link createDevApiHandler}.\n *\n * @internal\n */\nexport interface DevApiHandlerOptions {\n /** Returns the current MCP mount path (may change after a dev reload). */\n getBasePath: () => string;\n /** Port the dev HTTP listener is bound to. */\n port: number;\n /** Tunnel lifecycle manager owned by the dev process. */\n tunnel: TunnelManager;\n}\n\n/** JSON body for `GET …/inspector/api/dev/info`. */\nexport interface DevInfoResponse {\n /** Full MCP endpoint URL when a tunnel is active; otherwise `null`. */\n mcpUrl: string | null;\n /** Port the dev server listens on. */\n port: number;\n /** Whether the request is served by `mcp-use dev` (always `true` here). */\n fromCli: true;\n /** Public tunnel origin URL, or `null` when no tunnel is running. */\n tunnelUrl: string | null;\n}\n\n/**\n * Wrap an MCP {@link FetchHandler} so dev-only inspector API routes are\n * answered in-process before delegating everything else.\n *\n * @param options - Base path, bound port, and tunnel manager.\n * @param fallback - Handler to invoke when the request is not a dev API route.\n *\n * @example\n * ```ts\n * const handler = createDevApiHandler(\n * { getBasePath: () => \"/mcp\", port: 3000, tunnel },\n * server.getHandler()\n * );\n * ```\n */\nexport function createDevApiHandler(\n options: DevApiHandlerOptions,\n fallback: FetchHandler\n): FetchHandler {\n const devInfo = (): DevInfoResponse => {\n const basePath = options.getBasePath();\n const { url: tunnelUrl } = options.tunnel.status();\n return {\n mcpUrl:\n tunnelUrl !== null\n ? `${tunnelUrl.replace(/\\/+$/, \"\")}${basePath}`\n : null,\n port: options.port,\n fromCli: true,\n tunnelUrl,\n };\n };\n\n return async (request: Request): Promise<Response> => {\n const basePath = options.getBasePath();\n const infoPath = `${basePath}/inspector/api/dev/info`;\n const startPath = `${basePath}/inspector/api/dev/start-tunnel`;\n const stopPath = `${basePath}/inspector/api/dev/stop-tunnel`;\n const pathname = new URL(request.url).pathname;\n\n if (request.method === \"GET\" && pathname === infoPath) {\n return Response.json(devInfo());\n }\n\n if (request.method === \"POST\" && pathname === startPath) {\n try {\n await options.tunnel.start(options.port);\n return Response.json({ ok: true, restarting: false });\n } catch (error) {\n const message =\n error instanceof Error ? error.message : \"Failed to start tunnel\";\n return Response.json({ error: message }, { status: 500 });\n }\n }\n\n if (request.method === \"POST\" && pathname === stopPath) {\n await options.tunnel.stop();\n return Response.json({ ok: true });\n }\n\n return fallback(request);\n };\n}\n","/**\n * Tunnel lifecycle for `mcp-use dev` — spawns `@mcp-use/tunnel`,\n * parses the public URL from stdout, persists the subdomain under\n * `.mcp-use/state/tunnel.json`, and releases it through the tunnel API before\n * reuse.\n */\n\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { spawn, type ChildProcess } from \"node:child_process\";\nimport { dirname } from \"node:path\";\n\n/** Default base URL for the tunnel reservation/release API. */\nconst DEFAULT_TUNNEL_API = \"https://local.mcp-use.run\";\n\n/**\n * Base URL of the tunnel API (subdomain reservation/release). Overridable via\n * the `MCP_USE_TUNNEL_API` environment variable.\n */\nexport function tunnelApiBase(): string {\n return process.env[\"MCP_USE_TUNNEL_API\"] ?? DEFAULT_TUNNEL_API;\n}\n\n/** On-disk shape of `.mcp-use/state/tunnel.json`. */\ninterface TunnelStateFile {\n /** Last successfully assigned tunnel subdomain. */\n subdomain: string;\n}\n\n/**\n * Minimal tunnel manager surface used by {@link createDevApiHandler} and\n * {@link runDev}.\n */\nexport interface TunnelManager {\n /**\n * Start (or attach) a tunnel targeting `port` and return the public origin\n * URL and assigned subdomain.\n */\n start(port: number): Promise<{ url: string; subdomain: string }>;\n /** Stop the tunnel child process and release the subdomain. */\n stop(): Promise<void>;\n /** Current tunnel public origin URL, or `null` when no tunnel is active. */\n status(): { url: string | null };\n}\n\nconst RESPAWN_BACKOFF_INITIAL_MS = 1_000;\nconst RESPAWN_BACKOFF_MAX_MS = 30_000;\n\n/**\n * Create a tunnel manager that reads and writes subdomain state at\n * `stateFilePath` (typically `.mcp-use/state/tunnel.json`).\n *\n * @param stateFilePath - Absolute path to the tunnel state JSON file.\n *\n * @example\n * ```ts\n * const tunnel = createTunnelManager(paths.tunnel);\n * const { url } = await tunnel.start(3000);\n * console.log(url); // https://happy-cat.local.mcp-use.run\n * ```\n */\nexport function createTunnelManager(stateFilePath: string): TunnelManager {\n let proc: ChildProcess | undefined;\n let currentUrl: string | null = null;\n let currentSubdomain: string | undefined;\n let activePort: number | undefined;\n let intentionalStop = false;\n let respawnInFlight: Promise<void> | undefined;\n let respawnBackoffMs = RESPAWN_BACKOFF_INITIAL_MS;\n\n const sleep = (ms: number): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n\n const markShutdown = (): void => {\n if (\n proc !== undefined &&\n \"markShutdown\" in proc &&\n typeof (proc as { markShutdown?: () => void }).markShutdown === \"function\"\n ) {\n (proc as { markShutdown: () => void }).markShutdown();\n }\n };\n\n const releaseSubdomain = async (subdomain: string): Promise<void> => {\n try {\n await fetch(`${tunnelApiBase()}/api/tunnels/${subdomain}`, {\n method: \"DELETE\",\n signal: AbortSignal.timeout(2_000),\n });\n } catch {\n // Best-effort cleanup; ignore DELETE failures.\n }\n };\n\n const loadSavedSubdomain = async (): Promise<string | undefined> => {\n try {\n const content = await readFile(stateFilePath, \"utf8\");\n const state = JSON.parse(content) as Partial<TunnelStateFile>;\n return typeof state.subdomain === \"string\" ? state.subdomain : undefined;\n } catch {\n return undefined;\n }\n };\n\n const persistSubdomain = async (subdomain: string): Promise<void> => {\n try {\n await mkdir(dirname(stateFilePath), { recursive: true });\n await writeFile(\n stateFilePath,\n JSON.stringify({ subdomain } satisfies TunnelStateFile, null, 2),\n \"utf8\"\n );\n } catch (error) {\n console.warn(\n `[mcp-use] failed to save tunnel subdomain: ${\n error instanceof Error ? error.message : String(error)\n }`\n );\n }\n };\n\n let scheduleRespawn: () => void = () => {};\n\n const spawnTunnel = (\n port: number,\n subdomain?: string\n ): Promise<{ url: string; subdomain: string; process: ChildProcess }> =>\n new Promise((resolve, reject) => {\n console.log(`[mcp-use] starting tunnel for port ${port}…`);\n\n const userAgent = process.env[\"npm_config_user_agent\"] ?? \"\";\n const [tunnelCommand, tunnelArgs] = userAgent.startsWith(\"pnpm/\")\n ? [\"pnpm\", [\"--silent\", \"dlx\", \"@mcp-use/tunnel\", String(port)]]\n : userAgent.startsWith(\"bun/\")\n ? [\"bunx\", [\"@mcp-use/tunnel\", String(port)]]\n : [\n \"npx\",\n [\"--yes\", \"--prefer-offline\", \"@mcp-use/tunnel\", String(port)],\n ];\n if (subdomain !== undefined) {\n tunnelArgs.push(\"--subdomain\", subdomain);\n }\n\n const child = spawn(tunnelCommand, tunnelArgs, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n shell: process.platform === \"win32\",\n });\n\n let resolved = false;\n let shuttingDown = false;\n\n const markChildShutdown = (): void => {\n shuttingDown = true;\n };\n (child as unknown as { markShutdown: () => void }).markShutdown =\n markChildShutdown;\n\n child.stdout.on(\"data\", (data: Buffer) => {\n const text = data.toString();\n const isShutdownMessage =\n text.includes(\"Shutting down\") || text.includes(\"🛑\");\n const isErrorMessage = text.includes(\"✖\") || text.includes(\"Error:\");\n\n if (!shuttingDown && !isShutdownMessage && !isErrorMessage) {\n process.stdout.write(text);\n }\n\n const urlMatch = text.match(/https?:\\/\\/([a-z0-9-]+\\.[a-z0-9.-]+)/i);\n if (urlMatch !== null && !resolved) {\n const url = urlMatch[0];\n const fullDomain = urlMatch[1] ?? \"\";\n const subdomainMatch = fullDomain.match(/^([a-z0-9-]+)\\./i);\n let extractedSubdomain =\n subdomainMatch?.[1] ?? fullDomain.split(\".\")[0] ?? \"\";\n if (!/^[a-z0-9-]+$/i.test(extractedSubdomain)) {\n console.warn(\n `[mcp-use] warning: extracted subdomain \"${extractedSubdomain}\" does not match expected format`\n );\n extractedSubdomain = \"\";\n }\n resolved = true;\n clearTimeout(setupTimeout);\n // No log here — the tunnel child's own stdout (passed through\n // above) already announces the public URL.\n resolve({ url, subdomain: extractedSubdomain, process: child });\n }\n });\n\n child.stderr.on(\"data\", (data: Buffer) => {\n const text = data.toString();\n if (\n !shuttingDown &&\n !text.includes(\"INFO\") &&\n !text.includes(\"bore_cli\") &&\n !text.includes(\"Shutting down\") &&\n // npx inherits pnpm-only npm_config_* env vars (e.g.\n // minimum-release-age, verify-deps-before-run) and warns about\n // every key it doesn't recognize — pure noise for the user.\n !/npm warn Unknown (?:env|project|user|builtin) config/.test(text)\n ) {\n process.stderr.write(data);\n }\n });\n\n child.on(\"error\", (error) => {\n if (!resolved) {\n clearTimeout(setupTimeout);\n reject(new Error(`Failed to start tunnel: ${error.message}`));\n }\n });\n\n child.on(\"exit\", (code) => {\n if (code !== 0 && code !== null && !resolved) {\n clearTimeout(setupTimeout);\n reject(new Error(`Tunnel process exited with code ${code}`));\n }\n // The tunnel CLI can exit after setup when its bore connection or\n // server-side registration disappears. Do not keep reporting a dead\n // public URL through dev/info; respawn while dev is still running.\n if (proc === child) {\n proc = undefined;\n currentUrl = null;\n if (intentionalStop) {\n currentSubdomain = undefined;\n } else {\n scheduleRespawn();\n }\n }\n });\n\n const setupTimeout = setTimeout(() => {\n if (!resolved) {\n child.kill();\n reject(new Error(\"Tunnel setup timed out\"));\n }\n }, 30_000);\n });\n\n scheduleRespawn = (): void => {\n if (intentionalStop || activePort === undefined || currentUrl !== null) {\n return;\n }\n if (respawnInFlight !== undefined) {\n return;\n }\n\n respawnInFlight = (async (): Promise<void> => {\n while (\n !intentionalStop &&\n activePort !== undefined &&\n currentUrl === null\n ) {\n console.log(\"[mcp-use] tunnel disconnected, restarting…\");\n const subdomain = currentSubdomain ?? (await loadSavedSubdomain());\n try {\n if (subdomain !== undefined) {\n await releaseSubdomain(subdomain);\n }\n\n let tunnelInfo: Awaited<ReturnType<typeof spawnTunnel>>;\n try {\n tunnelInfo = await spawnTunnel(activePort, subdomain);\n } catch (error) {\n if (subdomain !== undefined) {\n console.log(\n `[mcp-use] subdomain \"${subdomain}\" unavailable, requesting a new one…`\n );\n tunnelInfo = await spawnTunnel(activePort, undefined);\n } else {\n throw error;\n }\n }\n\n proc = tunnelInfo.process;\n currentUrl = tunnelInfo.url;\n currentSubdomain = tunnelInfo.subdomain;\n await persistSubdomain(tunnelInfo.subdomain);\n respawnBackoffMs = RESPAWN_BACKOFF_INITIAL_MS;\n return;\n } catch (error) {\n console.warn(\n `[mcp-use] tunnel restart failed: ${\n error instanceof Error ? error.message : String(error)\n }`\n );\n await sleep(respawnBackoffMs);\n respawnBackoffMs = Math.min(\n respawnBackoffMs * 2,\n RESPAWN_BACKOFF_MAX_MS\n );\n }\n }\n })().finally(() => {\n respawnInFlight = undefined;\n });\n };\n\n return {\n status(): { url: string | null } {\n return { url: currentUrl };\n },\n\n async start(port: number): Promise<{ url: string; subdomain: string }> {\n intentionalStop = false;\n activePort = port;\n\n if (currentUrl !== null) {\n return {\n url: currentUrl,\n subdomain: currentSubdomain ?? \"\",\n };\n }\n\n const existingSubdomain = await loadSavedSubdomain();\n if (existingSubdomain !== undefined) {\n console.log(`[mcp-use] found existing subdomain: ${existingSubdomain}`);\n await releaseSubdomain(existingSubdomain);\n }\n\n let tunnelInfo: Awaited<ReturnType<typeof spawnTunnel>>;\n try {\n tunnelInfo = await spawnTunnel(port, existingSubdomain);\n } catch (error) {\n if (existingSubdomain !== undefined) {\n console.log(\n `[mcp-use] subdomain \"${existingSubdomain}\" unavailable, requesting a new one…`\n );\n tunnelInfo = await spawnTunnel(port, undefined);\n } else {\n throw error;\n }\n }\n\n proc = tunnelInfo.process;\n currentUrl = tunnelInfo.url;\n currentSubdomain = tunnelInfo.subdomain;\n await persistSubdomain(tunnelInfo.subdomain);\n\n return { url: tunnelInfo.url, subdomain: tunnelInfo.subdomain };\n },\n\n async stop(): Promise<void> {\n intentionalStop = true;\n markShutdown();\n\n if (respawnInFlight !== undefined) {\n await respawnInFlight;\n }\n\n if (currentSubdomain !== undefined) {\n await releaseSubdomain(currentSubdomain);\n }\n\n if (proc !== undefined) {\n proc.kill(\"SIGINT\");\n proc = undefined;\n }\n\n activePort = undefined;\n currentUrl = null;\n currentSubdomain = undefined;\n respawnBackoffMs = RESPAWN_BACKOFF_INITIAL_MS;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,SAAAA,cAAa;AACtB,SAAS,gBAAgB,wBAAwB;AAEjD,SAAS,yBAAyB;AAClC,SAAS,MAAM,eAAe;AAC9B,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,SAAS,gBAAAC,eAAc,gCAAgC;AACvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;;;AC7BP,SAAS,SAAS,oBAAoB;AAGtC,IAAM,aAAa;AAGnB,IAAM,mBAAmB;AAczB,IAAM,iBAAiB,oBAAI,IAAI,CAAC,aAAa,aAAa,KAAK,CAAC;AAGhE,SAAS,WAAW,MAAc,MAAgC;AAChE,SAAO,IAAI,QAAQ,CAACC,aAAY;AAC9B,UAAM,QAAQ,aAAa;AAC3B,UAAM,MAAM;AACZ,UAAM,KAAK,SAAS,MAAMA,SAAQ,KAAK,CAAC;AACxC,UAAM,OAAO,EAAE,MAAM,KAAK,GAAG,MAAM;AACjC,YAAM,MAAM,MAAMA,SAAQ,IAAI,CAAC;AAAA,IACjC,CAAC;AAAA,EACH,CAAC;AACH;AAGA,SAAS,WAAW,MAAc,MAAgC;AAChE,SAAO,IAAI,QAAQ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F;AACA,MAAI,CAAC,eAAe;AAClB,YAAQ;AAAA,MACN,oBAAoB,IAAI;AAAA,IAG1B;AAAA,EACF;AAEA,MAAI,QAAQ,WAAW,MAAM;AAC3B,QAAI;AACF,YAAM,EAAE,IAAI,IAAI,MAAM,cAAc,MAAM,IAAI;AAC9C,cAAQ,IAAI,2BAAsB,GAAG,GAAG,QAAQ,EAAE;AAAA,IACpD,SAAS,OAAO;AACd,YAAM,SAAS;AACf,YAAM;AAAA,IACR;AAAA,EACF;AAIA,MAAI,QAAQ,SAAS,SAAS,QAAQ,OAAO,UAAU,MAAM;AAC3D,kBAAc,GAAG,SAAS,GAAG,QAAQ,YAAY;AAAA,EACnD;AAGA,QAAM,IAAI,QAAc,CAACA,aAAY;AACnC,QAAI,UAAU;AACd,UAAM,WAAW,MAAY;AAC3B,UAAI,QAAS;AACb,gBAAU;AACV,cAAQ,IAAI,UAAU,QAAQ;AAC9B,cAAQ,IAAI,WAAW,QAAQ;AAC/B,YAAM,YAAY;AAChB,cAAM,SAAS;AACf,QAAAA,SAAQ;AAAA,MACV,GAAG;AAAA,IACL;AACA,YAAQ,GAAG,UAAU,QAAQ;AAC7B,YAAQ,GAAG,WAAW,QAAQ;AAC9B,QAAI,QAAQ,WAAW,QAAW;AAChC,UAAI,QAAQ,OAAO,SAAS;AAC1B,iBAAS;AAAA,MACX,OAAO;AACL,gBAAQ,OAAO,iBAAiB,SAAS,UAAU,EAAE,MAAM,KAAK,CAAC;AAAA,MACnE;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":["spawn","createServer","resolve","resolvePort","resolve","spawn","resolvePort","createServer","resolve"]}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/** Runtime surface loaded from the independently published client SDK. */
|
|
2
2
|
export type ClientPackage = typeof import("@mcp-use/client");
|
|
3
|
+
/**
|
|
4
|
+
* Walk upward from `startDir` for the nearest directory containing
|
|
5
|
+
* `package.json`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function findProjectRoot(startDir: string): Promise<string | undefined>;
|
|
3
8
|
/**
|
|
4
9
|
* Load `@mcp-use/client` on demand so the framework library entry does not
|
|
5
10
|
* pull the client SDK (or legacy v1 transitive deps) into every install.
|
|
6
11
|
*
|
|
7
|
-
* @throws {@link UsageError} When the package is not installed
|
|
8
|
-
*
|
|
12
|
+
* @throws {@link UsageError} When the package is not installed and auto-install
|
|
13
|
+
* fails or the retry import still cannot resolve it.
|
|
9
14
|
*/
|
|
10
15
|
export declare function loadClientPackage(): Promise<ClientPackage>;
|
|
16
|
+
/** @internal Imported from project `node_modules` after auto-install. */
|
|
17
|
+
export declare function importProjectClientModule(projectRoot: string): Promise<ClientPackage>;
|
|
11
18
|
//# sourceMappingURL=load-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-client.d.ts","sourceRoot":"","sources":["../../src/commands/load-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-client.d.ts","sourceRoot":"","sources":["../../src/commands/load-client.ts"],"names":[],"mappings":"AAcA,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,cAAc,iBAAiB,CAAC,CAAC;AAkB7D;;;GAGG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAQ7B;AAQD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC,CAkBhE;AA+ED,yEAAyE;AACzE,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC,CAIxB"}
|
package/dist/commands/start.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadProjectEnv
|
|
3
|
+
} from "../chunk-22Y3WIJP.js";
|
|
1
4
|
import {
|
|
2
5
|
resolvePort
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-QBAJXPRQ.js";
|
|
4
7
|
|
|
5
8
|
// src/bin/start.ts
|
|
6
9
|
import { readFile } from "fs/promises";
|
|
@@ -36,6 +39,7 @@ Re-run \`mcp-use build\`.`
|
|
|
36
39
|
);
|
|
37
40
|
}
|
|
38
41
|
process.env.NODE_ENV ??= "production";
|
|
42
|
+
loadProjectEnv(options.cwd, "production");
|
|
39
43
|
const entryPath = join(buildDir, entryPoint);
|
|
40
44
|
const entryUrl = pathToFileURL(entryPath).href;
|
|
41
45
|
const entryModule = await import(entryUrl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/start.ts"],"sourcesContent":["/**\n * Inline implementation of `mcp-use start` (specs/CLI_SPEC.md).\n *\n * Serves a production build from `.mcp-use/build/` with zero toolchain\n * dependencies: read the manifest, import the built entry, call `listen()`\n * on its default-exported server.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nimport { resolvePort } from \"./args.js\";\n\n/*\n * Workspace constants, re-declared per CLI_SPEC.md (\"Same names,\n * re-declared\") — never imported from the old `mcp-use` package.\n */\nconst WORKSPACE_DIR_NAME = \".mcp-use\";\nconst BUILD_SUBDIR_NAME = \"build\";\nconst BUILD_MANIFEST_NAME = \"manifest.json\";\n\n/**\n * The duck-typed contract `start` needs from the built entry's default\n * export — satisfied by an `MCPServer` instance. Checked at runtime, not by\n * an `instanceof`, so a build made against a different copy of the package\n * still starts.\n */\ninterface ListenableServer {\n listen(port?: number): Promise<unknown>;\n close?(): unknown;\n}\n\n/**\n * Options for {@link runStart}.\n *\n * @internal\n */\nexport interface StartOptions {\n /** Project root containing the `.mcp-use/` workspace. */\n cwd: string;\n /** Port from the `--port`/`-p` flag; falls back to `PORT` env, then 3000. */\n port?: number | undefined;\n}\n\n/**\n * Handle to a server started by {@link runStart}.\n *\n * @internal\n */\nexport interface StartedServer {\n /** Port the server reported it bound. */\n port: number;\n /** URL of the MCP endpoint, as reported by the server's `listen()`. */\n url: string;\n /** Stop the server (delegates to the instance's `close()`, if present). */\n close(): Promise<void>;\n}\n\n/**\n * Run `mcp-use start`: serve the production build under\n * `<cwd>/.mcp-use/build/`.\n *\n * Reads the build manifest, sets `NODE_ENV=production` (only if unset),\n * imports the built entry, and calls `listen()` on its default export.\n *\n * @param options - Project root and optional port override.\n * @throws Error with an actionable message when the manifest is missing\n * (pointing at `mcp-use build`), malformed, or the entry's default export is\n * not a server.\n *\n * @internal\n */\nexport async function runStart(options: StartOptions): Promise<StartedServer> {\n const buildDir = join(options.cwd, WORKSPACE_DIR_NAME, BUILD_SUBDIR_NAME);\n const manifestPath = join(buildDir, BUILD_MANIFEST_NAME);\n\n let rawManifest: string;\n try {\n rawManifest = await readFile(manifestPath, \"utf8\");\n } catch {\n throw new Error(\n `No production build found (missing ${manifestPath}).\\n` +\n `Run \\`mcp-use build\\` first, then \\`mcp-use start\\`.`\n );\n }\n\n let entryPoint: string;\n try {\n const manifest = JSON.parse(rawManifest) as { entryPoint?: unknown };\n if (typeof manifest.entryPoint !== \"string\" || manifest.entryPoint === \"\") {\n throw new Error(\"missing entryPoint\");\n }\n entryPoint = manifest.entryPoint;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `Invalid build manifest at ${manifestPath} (${reason}).\\n` +\n `Re-run \\`mcp-use build\\`.`\n );\n }\n\n // Production posture, but never clobber an explicit NODE_ENV.\n process.env.NODE_ENV ??= \"production\";\n\n const entryPath = join(buildDir, entryPoint);\n const entryUrl = pathToFileURL(entryPath).href;\n const entryModule = (await import(entryUrl)) as { default?: unknown };\n\n if (!(\"default\" in entryModule) || entryModule.default === undefined) {\n throw new Error(\n `The built entry (${entryPath}) has no default export.\\n` +\n `The server entry must \\`export default\\` its MCPServer instance ` +\n `(see the mcp-use entry contract).`\n );\n }\n const candidate = entryModule.default;\n if (!isListenable(candidate)) {\n throw new Error(\n `The default export of ${entryPath} is not an MCPServer: it has no ` +\n `listen() method. Export the MCPServer instance as the default export.`\n );\n }\n\n const port = resolvePort(options.port);\n const result = (await candidate.listen(port)) as\n | { port?: unknown; url?: unknown }\n | undefined;\n const boundPort = typeof result?.port === \"number\" ? result.port : port;\n const url =\n typeof result?.url === \"string\"\n ? result.url\n : `http://localhost:${boundPort}`;\n\n return {\n port: boundPort,\n url,\n close: async () => {\n await candidate.close?.();\n },\n };\n}\n\n/** Duck-check that a value looks like a server we can `listen()` on. */\nfunction isListenable(value: unknown): value is ListenableServer {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as { listen?: unknown }).listen === \"function\"\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/bin/start.ts"],"sourcesContent":["/**\n * Inline implementation of `mcp-use start` (specs/CLI_SPEC.md).\n *\n * Serves a production build from `.mcp-use/build/` with zero toolchain\n * dependencies: read the manifest, import the built entry, call `listen()`\n * on its default-exported server.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nimport { resolvePort } from \"./args.js\";\nimport { loadProjectEnv } from \"../cli/next-compat.js\";\n\n/*\n * Workspace constants, re-declared per CLI_SPEC.md (\"Same names,\n * re-declared\") — never imported from the old `mcp-use` package.\n */\nconst WORKSPACE_DIR_NAME = \".mcp-use\";\nconst BUILD_SUBDIR_NAME = \"build\";\nconst BUILD_MANIFEST_NAME = \"manifest.json\";\n\n/**\n * The duck-typed contract `start` needs from the built entry's default\n * export — satisfied by an `MCPServer` instance. Checked at runtime, not by\n * an `instanceof`, so a build made against a different copy of the package\n * still starts.\n */\ninterface ListenableServer {\n listen(port?: number): Promise<unknown>;\n close?(): unknown;\n}\n\n/**\n * Options for {@link runStart}.\n *\n * @internal\n */\nexport interface StartOptions {\n /** Project root containing the `.mcp-use/` workspace. */\n cwd: string;\n /** Port from the `--port`/`-p` flag; falls back to `PORT` env, then 3000. */\n port?: number | undefined;\n}\n\n/**\n * Handle to a server started by {@link runStart}.\n *\n * @internal\n */\nexport interface StartedServer {\n /** Port the server reported it bound. */\n port: number;\n /** URL of the MCP endpoint, as reported by the server's `listen()`. */\n url: string;\n /** Stop the server (delegates to the instance's `close()`, if present). */\n close(): Promise<void>;\n}\n\n/**\n * Run `mcp-use start`: serve the production build under\n * `<cwd>/.mcp-use/build/`.\n *\n * Reads the build manifest, sets `NODE_ENV=production` (only if unset),\n * imports the built entry, and calls `listen()` on its default export.\n *\n * @param options - Project root and optional port override.\n * @throws Error with an actionable message when the manifest is missing\n * (pointing at `mcp-use build`), malformed, or the entry's default export is\n * not a server.\n *\n * @internal\n */\nexport async function runStart(options: StartOptions): Promise<StartedServer> {\n const buildDir = join(options.cwd, WORKSPACE_DIR_NAME, BUILD_SUBDIR_NAME);\n const manifestPath = join(buildDir, BUILD_MANIFEST_NAME);\n\n let rawManifest: string;\n try {\n rawManifest = await readFile(manifestPath, \"utf8\");\n } catch {\n throw new Error(\n `No production build found (missing ${manifestPath}).\\n` +\n `Run \\`mcp-use build\\` first, then \\`mcp-use start\\`.`\n );\n }\n\n let entryPoint: string;\n try {\n const manifest = JSON.parse(rawManifest) as { entryPoint?: unknown };\n if (typeof manifest.entryPoint !== \"string\" || manifest.entryPoint === \"\") {\n throw new Error(\"missing entryPoint\");\n }\n entryPoint = manifest.entryPoint;\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n throw new Error(\n `Invalid build manifest at ${manifestPath} (${reason}).\\n` +\n `Re-run \\`mcp-use build\\`.`\n );\n }\n\n // Production posture, but never clobber an explicit NODE_ENV.\n process.env.NODE_ENV ??= \"production\";\n loadProjectEnv(options.cwd, \"production\");\n\n const entryPath = join(buildDir, entryPoint);\n const entryUrl = pathToFileURL(entryPath).href;\n const entryModule = (await import(entryUrl)) as { default?: unknown };\n\n if (!(\"default\" in entryModule) || entryModule.default === undefined) {\n throw new Error(\n `The built entry (${entryPath}) has no default export.\\n` +\n `The server entry must \\`export default\\` its MCPServer instance ` +\n `(see the mcp-use entry contract).`\n );\n }\n const candidate = entryModule.default;\n if (!isListenable(candidate)) {\n throw new Error(\n `The default export of ${entryPath} is not an MCPServer: it has no ` +\n `listen() method. Export the MCPServer instance as the default export.`\n );\n }\n\n const port = resolvePort(options.port);\n const result = (await candidate.listen(port)) as\n | { port?: unknown; url?: unknown }\n | undefined;\n const boundPort = typeof result?.port === \"number\" ? result.port : port;\n const url =\n typeof result?.url === \"string\"\n ? result.url\n : `http://localhost:${boundPort}`;\n\n return {\n port: boundPort,\n url,\n close: async () => {\n await candidate.close?.();\n },\n };\n}\n\n/** Duck-check that a value looks like a server we can `listen()` on. */\nfunction isListenable(value: unknown): value is ListenableServer {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as { listen?: unknown }).listen === \"function\"\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAS9B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAC1B,IAAM,sBAAsB;AAqD5B,eAAsB,SAAS,SAA+C;AAC5E,QAAM,WAAW,KAAK,QAAQ,KAAK,oBAAoB,iBAAiB;AACxE,QAAM,eAAe,KAAK,UAAU,mBAAmB;AAEvD,MAAI;AACJ,MAAI;AACF,kBAAc,MAAM,SAAS,cAAc,MAAM;AAAA,EACnD,QAAQ;AACN,UAAM,IAAI;AAAA,MACR,sCAAsC,YAAY;AAAA;AAAA,IAEpD;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,UAAM,WAAW,KAAK,MAAM,WAAW;AACvC,QAAI,OAAO,SAAS,eAAe,YAAY,SAAS,eAAe,IAAI;AACzE,YAAM,IAAI,MAAM,oBAAoB;AAAA,IACtC;AACA,iBAAa,SAAS;AAAA,EACxB,SAAS,OAAO;AACd,UAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACpE,UAAM,IAAI;AAAA,MACR,6BAA6B,YAAY,KAAK,MAAM;AAAA;AAAA,IAEtD;AAAA,EACF;AAGA,UAAQ,IAAI,aAAa;AACzB,iBAAe,QAAQ,KAAK,YAAY;AAExC,QAAM,YAAY,KAAK,UAAU,UAAU;AAC3C,QAAM,WAAW,cAAc,SAAS,EAAE;AAC1C,QAAM,cAAe,MAAM,OAAO;AAElC,MAAI,EAAE,aAAa,gBAAgB,YAAY,YAAY,QAAW;AACpE,UAAM,IAAI;AAAA,MACR,oBAAoB,SAAS;AAAA;AAAA,IAG/B;AAAA,EACF;AACA,QAAM,YAAY,YAAY;AAC9B,MAAI,CAAC,aAAa,SAAS,GAAG;AAC5B,UAAM,IAAI;AAAA,MACR,yBAAyB,SAAS;AAAA,IAEpC;AAAA,EACF;AAEA,QAAM,OAAO,YAAY,QAAQ,IAAI;AACrC,QAAM,SAAU,MAAM,UAAU,OAAO,IAAI;AAG3C,QAAM,YAAY,OAAO,QAAQ,SAAS,WAAW,OAAO,OAAO;AACnE,QAAM,MACJ,OAAO,QAAQ,QAAQ,WACnB,OAAO,MACP,oBAAoB,SAAS;AAEnC,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,OAAO,YAAY;AACjB,YAAM,UAAU,QAAQ;AAAA,IAC1B;AAAA,EACF;AACF;AAGA,SAAS,aAAa,OAA2C;AAC/D,SACE,OAAO,UAAU,YACjB,UAAU,QACV,OAAQ,MAA+B,WAAW;AAEtD;","names":[]}
|
package/dist/completable.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ export interface CompletionContext {
|
|
|
6
6
|
}
|
|
7
7
|
/** Callback form: return suggestions for the current (partial) value. */
|
|
8
8
|
export type CompletionCallback = (value: string, context?: CompletionContext) => string[] | Promise<string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Build the shared case-insensitive prefix completer used by static values.
|
|
11
|
+
*
|
|
12
|
+
* @param values - Values retained in declaration order and stringified once.
|
|
13
|
+
* @returns A callback that filters the values against an untrimmed prefix.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function createPrefixCompletion(values: ReadonlyArray<string | number | boolean>): (value: unknown) => string[];
|
|
9
18
|
/**
|
|
10
19
|
* Make a schema field completable so clients can request autocomplete
|
|
11
20
|
* suggestions via `completion/complete`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../src/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,cAAc,EAC7B,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,iBAAiB,KACxB,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,gBAAgB,EACpD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,kBAAkB,GACtE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"completable.d.ts","sourceRoot":"","sources":["../src/completable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,cAAc,EAC7B,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,iBAAiB,KACxB,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAElC;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAC/C,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,EAAE,CAQ9B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,gBAAgB,EACpD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,kBAAkB,GACtE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAOtC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServerOptions } from "@modelcontextprotocol/server";
|
|
1
|
+
import type { Icon, ServerOptions } from "@modelcontextprotocol/server";
|
|
2
2
|
import type { LoggingOptions } from "./logging.js";
|
|
3
3
|
import type { OAuthProvider } from "./oauth/index.js";
|
|
4
4
|
/**
|
|
@@ -47,6 +47,74 @@ interface BaseServerConfig {
|
|
|
47
47
|
* implementation metadata during negotiation.
|
|
48
48
|
*/
|
|
49
49
|
description?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Browser favicon source.
|
|
52
|
+
*
|
|
53
|
+
* Accepts a safe path relative to the project `public/` directory, an
|
|
54
|
+
* absolute HTTP(S) URL, or an image data URL. The selected image is served
|
|
55
|
+
* at the root-level `/favicon.ico` route. When omitted, the first entry in
|
|
56
|
+
* `icons` selects the favicon. An explicit value always wins; an empty
|
|
57
|
+
* string is invalid.
|
|
58
|
+
*
|
|
59
|
+
* @defaultValue Inferred from `icons`, or no favicon when `icons` is absent
|
|
60
|
+
* or empty.
|
|
61
|
+
* @throws TypeError When the value is empty, uses an unsupported URL scheme,
|
|
62
|
+
* or is an unsafe local path.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* new MCPServer({
|
|
67
|
+
* name: "my-server",
|
|
68
|
+
* version: "1.0.0",
|
|
69
|
+
* favicon: "brand/favicon.svg",
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
favicon?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Server icons reported to clients in MCP implementation metadata.
|
|
76
|
+
*
|
|
77
|
+
* Uses the official SDK {@link Icon} shape. Each `src` accepts a safe path
|
|
78
|
+
* relative to `public/`, an absolute HTTP(S) URL, or an image data URL.
|
|
79
|
+
* Local paths become request-scoped absolute URLs under
|
|
80
|
+
* `${basePath}/_mcp-use/public/`; author order is preserved on the wire.
|
|
81
|
+
* When `favicon` is omitted, the first icon in this array also selects
|
|
82
|
+
* `/favicon.ico`. An empty array is valid and selects no favicon.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue `undefined`
|
|
85
|
+
* @throws TypeError When an icon has an invalid source, MIME type, sizes,
|
|
86
|
+
* or theme.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* new MCPServer({
|
|
91
|
+
* name: "my-server",
|
|
92
|
+
* version: "1.0.0",
|
|
93
|
+
* icons: [
|
|
94
|
+
* { src: "brand/icon.svg", mimeType: "image/svg+xml" },
|
|
95
|
+
* { src: "brand/icon-32.png", mimeType: "image/png", sizes: ["32x32"] },
|
|
96
|
+
* ],
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
icons?: Icon[];
|
|
101
|
+
/**
|
|
102
|
+
* Absolute HTTP(S) URL for the server's website or documentation, reported
|
|
103
|
+
* to clients in MCP implementation metadata.
|
|
104
|
+
*
|
|
105
|
+
* @defaultValue `undefined`
|
|
106
|
+
* @throws TypeError When the value is empty, relative, or not HTTP(S).
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* new MCPServer({
|
|
111
|
+
* name: "my-server",
|
|
112
|
+
* version: "1.0.0",
|
|
113
|
+
* websiteUrl: "https://example.com/my-server",
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
websiteUrl?: string;
|
|
50
118
|
/** Usage instructions surfaced to the model by clients. */
|
|
51
119
|
instructions?: string;
|
|
52
120
|
/**
|
|
@@ -81,9 +149,9 @@ interface BaseServerConfig {
|
|
|
81
149
|
/**
|
|
82
150
|
* Extra allowed origin hostnames for Origin-header validation
|
|
83
151
|
* (port-agnostic, additive to the localhost-class origins). When unset,
|
|
84
|
-
*
|
|
85
|
-
* non-GET/HEAD requests (sandboxed view iframes send `Origin: null`
|
|
86
|
-
* asset GETs; the MCP wire is POST). Requests without an `Origin` header
|
|
152
|
+
* Origin validation is off (SDK-aligned). When set, Origin is validated
|
|
153
|
+
* only on non-GET/HEAD requests (sandboxed view iframes send `Origin: null`
|
|
154
|
+
* on asset GETs; the MCP wire is POST). Requests without an `Origin` header
|
|
87
155
|
* always pass (non-browser MCP clients don't send one).
|
|
88
156
|
*/
|
|
89
157
|
allowedOrigins?: string[];
|
|
@@ -99,6 +167,18 @@ interface BaseServerConfig {
|
|
|
99
167
|
* @defaultValue `"stateless"`
|
|
100
168
|
*/
|
|
101
169
|
legacy?: "stateless" | "reject";
|
|
170
|
+
/**
|
|
171
|
+
* Expose the HTML landing page without bearer authentication when OAuth is
|
|
172
|
+
* configured.
|
|
173
|
+
*
|
|
174
|
+
* The landing page itself is always mounted at `basePath` for browser GET
|
|
175
|
+
* and HEAD requests that explicitly accept `text/html`. Without OAuth it is
|
|
176
|
+
* public. With OAuth, it requires a valid bearer token unless this option is
|
|
177
|
+
* `true`. MCP protocol requests remain protected in either case.
|
|
178
|
+
*
|
|
179
|
+
* @defaultValue `false`
|
|
180
|
+
*/
|
|
181
|
+
publicLandingPage?: boolean;
|
|
102
182
|
/**
|
|
103
183
|
* Inspector shell route at `${basePath}/inspector` — a browser UI for
|
|
104
184
|
* exploring and calling the server's tools, resources, and prompts.
|
|
@@ -165,6 +245,47 @@ interface BaseServerConfig {
|
|
|
165
245
|
* @defaultValue `undefined`
|
|
166
246
|
*/
|
|
167
247
|
requestState?: ServerOptions["requestState"];
|
|
248
|
+
/**
|
|
249
|
+
* Optional CORS headers on every route served by `getHandler()` / `listen()`
|
|
250
|
+
* (MCP endpoint, view assets, inspector, OAuth metadata). Off when omitted.
|
|
251
|
+
*
|
|
252
|
+
* Pair with {@link BaseServerConfig.allowedOrigins | allowedOrigins} for
|
|
253
|
+
* browser clients: CORS tells the browser it may read the response; Origin
|
|
254
|
+
* validation decides whether the server accepts the request.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* new MCPServer({
|
|
259
|
+
* name: "api",
|
|
260
|
+
* version: "1.0.0",
|
|
261
|
+
* allowedOrigins: ["app.example.com"],
|
|
262
|
+
* cors: {
|
|
263
|
+
* origin: "https://app.example.com",
|
|
264
|
+
* credentials: true,
|
|
265
|
+
* },
|
|
266
|
+
* });
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
cors?: CorsOptions;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* CORS configuration for routes owned by mcp-use (`getHandler()` / `listen()`).
|
|
273
|
+
*
|
|
274
|
+
* Omit `cors` entirely for the current no-CORS behavior. Pass `cors: {}` to
|
|
275
|
+
* enable with defaults (reflects the request `Origin` when present; wildcard
|
|
276
|
+
* `origin: "*"` requires an explicit opt-in).
|
|
277
|
+
*/
|
|
278
|
+
export interface CorsOptions {
|
|
279
|
+
/** @defaultValue `true` when `cors` is set; ignored when `cors` is omitted */
|
|
280
|
+
enabled?: boolean;
|
|
281
|
+
/** Allowed Origin(s). Reflect matching `Origin` header, or `"*"` when set. */
|
|
282
|
+
origin?: string | string[] | ((origin: string | null) => string | null);
|
|
283
|
+
/** @defaultValue `["GET", "HEAD", "POST", "OPTIONS"]` */
|
|
284
|
+
methods?: string[];
|
|
285
|
+
/** @defaultValue common MCP + JSON headers */
|
|
286
|
+
allowedHeaders?: string[];
|
|
287
|
+
/** @defaultValue `false` */
|
|
288
|
+
credentials?: boolean;
|
|
168
289
|
}
|
|
169
290
|
/**
|
|
170
291
|
* Runtime checks for optional {@link ServerConfig} fields that TypeScript
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,UAAU,gBAAgB;IACxB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf;;;;;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