mcp-use 2.0.0-beta.18 → 2.0.0-beta.2
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 +0 -2
- package/dist/bin/args.d.ts.map +1 -1
- package/dist/bin/main.d.ts +0 -2
- package/dist/bin/main.d.ts.map +1 -1
- package/dist/bin.js +4 -9
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-IG2BCCMU.js → chunk-Q4PUTBMV.js} +1 -5
- package/dist/chunk-Q4PUTBMV.js.map +1 -0
- package/dist/{chunk-RHITI5QM.js → chunk-RQRT27Q3.js} +16 -190
- package/dist/chunk-RQRT27Q3.js.map +1 -0
- package/dist/{chunk-QUUANIE4.js → chunk-SFI2T6TE.js} +80 -34
- package/dist/chunk-SFI2T6TE.js.map +1 -0
- package/dist/{chunk-O3CUL5VH.js → chunk-UDLRVMML.js} +18 -68
- package/dist/chunk-UDLRVMML.js.map +1 -0
- package/dist/cli/build.d.ts +2 -7
- package/dist/cli/build.d.ts.map +1 -1
- package/dist/cli/dev.d.ts.map +1 -1
- 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 +0 -9
- 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 +5 -7
- package/dist/cli/views.d.ts.map +1 -1
- package/dist/cli/workspace.d.ts +10 -2
- package/dist/cli/workspace.d.ts.map +1 -1
- package/dist/commands/build.js +25 -136
- 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 +15 -110
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/load-client.d.ts +2 -9
- package/dist/commands/load-client.d.ts.map +1 -1
- package/dist/commands/screenshot.js +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/completable.d.ts +0 -9
- package/dist/completable.d.ts.map +1 -1
- package/dist/config.d.ts +4 -125
- package/dist/config.d.ts.map +1 -1
- package/dist/fetch-app.d.ts +0 -43
- package/dist/fetch-app.d.ts.map +1 -1
- package/dist/index.d.ts +5 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +248 -1312
- package/dist/index.js.map +1 -1
- package/dist/inspector-shell.d.ts +6 -19
- package/dist/inspector-shell.d.ts.map +1 -1
- package/dist/mount-mcp.d.ts +4 -0
- package/dist/mount-mcp.d.ts.map +1 -1
- package/dist/oauth/index.js +1 -2
- package/dist/{chunk-SMN75YED.js → public-route-7IK5D7V7.js} +10 -16
- package/dist/public-route-7IK5D7V7.js.map +1 -0
- package/dist/react/components/theme-provider.d.ts +0 -3
- package/dist/react/components/theme-provider.d.ts.map +1 -1
- package/dist/react/hooks/use-host-context.d.ts +0 -5
- package/dist/react/hooks/use-host-context.d.ts.map +1 -1
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -124
- package/dist/react/index.js.map +1 -1
- package/dist/react/runtime/view-runtime.d.ts +0 -23
- package/dist/react/runtime/view-runtime.d.ts.map +1 -1
- package/dist/react/types/register.d.ts +1 -1
- package/dist/react/types/register.d.ts.map +1 -1
- package/dist/resources.d.ts +4 -59
- package/dist/resources.d.ts.map +1 -1
- package/dist/server.d.ts +5 -118
- package/dist/server.d.ts.map +1 -1
- package/dist/tools.d.ts +1 -12
- package/dist/tools.d.ts.map +1 -1
- package/dist/views/document.d.ts +7 -25
- package/dist/views/document.d.ts.map +1 -1
- package/dist/views/index.d.ts +3 -4
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/origin.d.ts +9 -37
- package/dist/views/origin.d.ts.map +1 -1
- package/dist/views/public-route.d.ts +3 -9
- package/dist/views/public-route.d.ts.map +1 -1
- package/dist/views/routes.d.ts +1 -20
- package/dist/views/routes.d.ts.map +1 -1
- package/dist/views/types.d.ts +4 -7
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/wire.d.ts +30 -19
- package/dist/views/wire.d.ts.map +1 -1
- package/package.json +10 -21
- package/dist/branding.d.ts +0 -82
- package/dist/branding.d.ts.map +0 -1
- package/dist/chunk-FC2Z2VFO.js +0 -99
- package/dist/chunk-FC2Z2VFO.js.map +0 -1
- package/dist/chunk-IG2BCCMU.js.map +0 -1
- package/dist/chunk-KIZ72TIK.js +0 -38
- package/dist/chunk-KIZ72TIK.js.map +0 -1
- package/dist/chunk-O3CUL5VH.js.map +0 -1
- package/dist/chunk-QUUANIE4.js.map +0 -1
- package/dist/chunk-RHITI5QM.js.map +0 -1
- package/dist/chunk-SMN75YED.js.map +0 -1
- package/dist/chunk-XUI7QE2D.js +0 -98
- package/dist/chunk-XUI7QE2D.js.map +0 -1
- package/dist/chunk-Z326HADF.js +0 -82
- package/dist/chunk-Z326HADF.js.map +0 -1
- package/dist/chunk-ZJJD33SF.js +0 -741
- package/dist/chunk-ZJJD33SF.js.map +0 -1
- package/dist/cli/mcp-env-declaration.d.ts +0 -20
- package/dist/cli/mcp-env-declaration.d.ts.map +0 -1
- package/dist/internal/resource-completion.js +0 -7
- package/dist/internal/resource-completion.js.map +0 -1
- package/dist/landing-handler-WE66NIGB.js +0 -37
- package/dist/landing-handler-WE66NIGB.js.map +0 -1
- package/dist/landing-handler.d.ts +0 -24
- package/dist/landing-handler.d.ts.map +0 -1
- package/dist/landing.d.ts +0 -67
- package/dist/landing.d.ts.map +0 -1
- package/dist/landing.js +0 -7
- package/dist/landing.js.map +0 -1
- package/dist/middleware/cors.d.ts +0 -11
- package/dist/middleware/cors.d.ts.map +0 -1
- package/dist/middleware/mcp-middleware.d.ts +0 -175
- package/dist/middleware/mcp-middleware.d.ts.map +0 -1
- package/dist/oauth/better-auth.d.ts +0 -29
- package/dist/oauth/better-auth.d.ts.map +0 -1
- package/dist/oauth/better-auth.js +0 -76
- package/dist/oauth/better-auth.js.map +0 -1
- package/dist/proxy-DJYWGTGX.js +0 -282
- package/dist/proxy-DJYWGTGX.js.map +0 -1
- package/dist/proxy.d.ts +0 -153
- package/dist/proxy.d.ts.map +0 -1
- package/dist/public-route-5JEGFEIN.js +0 -9
- package/dist/public-route-5JEGFEIN.js.map +0 -1
- package/dist/react/hooks/use-files.d.ts +0 -25
- package/dist/react/hooks/use-files.d.ts.map +0 -1
- package/dist/react/types/file-types.d.ts +0 -16
- package/dist/react/types/file-types.d.ts.map +0 -1
- package/dist/resource-completion.d.ts +0 -12
- package/dist/resource-completion.d.ts.map +0 -1
- package/dist/views/csp-env.d.ts +0 -37
- package/dist/views/csp-env.d.ts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/LICENSE +0 -216
- package/node_modules/@modelcontextprotocol/client/README.md +0 -26
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs +0 -7069
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-Asx17_Co.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts +0 -1054
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B7GnTXYx.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts +0 -1054
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-B_4czhCS.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs +0 -7086
- package/node_modules/@modelcontextprotocol/client/dist/ajvProvider-DNzBrkxq.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts +0 -59
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-D9GAttn8.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs +0 -970
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-DbU8BxXO.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs +0 -976
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Djgwc46-.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts +0 -59
- package/node_modules/@modelcontextprotocol/client/dist/cfWorkerProvider-Xtj52JOa.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Bnu9O96Y.cjs +0 -60
- package/node_modules/@modelcontextprotocol/client/dist/chunk-Br0eD_fh.mjs +0 -42
- package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts +0 -2675
- package/node_modules/@modelcontextprotocol/client/dist/index-ZagFkUbt.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts +0 -2678
- package/node_modules/@modelcontextprotocol/client/dist/index-gN3EXmil.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +0 -5427
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts +0 -3196
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts +0 -3196
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +0 -5224
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs +0 -14
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsBrowser.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs +0 -14
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsNode.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +0 -21
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts +0 -13
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +0 -20
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs +0 -7331
- package/node_modules/@modelcontextprotocol/client/dist/src-BzzZSQyL.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs +0 -6963
- package/node_modules/@modelcontextprotocol/client/dist/src-DGeA9On3.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +0 -181
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts +0 -87
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts +0 -87
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +0 -176
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts +0 -1099
- package/node_modules/@modelcontextprotocol/client/dist/types-BDNQEPSs.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts +0 -1099
- package/node_modules/@modelcontextprotocol/client/dist/types-DsbMXNFL.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.cjs +0 -5
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/client/dist/validators/ajv.mjs +0 -3
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.cjs +0 -3
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/client/dist/validators/cfWorker.mjs +0 -3
- package/node_modules/@modelcontextprotocol/client/package.json +0 -166
- package/node_modules/@modelcontextprotocol/core/LICENSE +0 -216
- package/node_modules/@modelcontextprotocol/core/README.md +0 -40
- package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts +0 -8198
- package/node_modules/@modelcontextprotocol/core/dist/auth-BUWfrB3C.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs +0 -2862
- package/node_modules/@modelcontextprotocol/core/dist/auth-CEFpHq32.cjs.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts +0 -8198
- package/node_modules/@modelcontextprotocol/core/dist/auth-CNbu4K4a.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs +0 -1653
- package/node_modules/@modelcontextprotocol/core/dist/auth-DFgbUATV.mjs.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +0 -174
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +0 -2
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +0 -2
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +0 -3
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +0 -199
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +0 -87
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +0 -87
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +0 -1
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +0 -3
- package/node_modules/@modelcontextprotocol/core/package.json +0 -85
- package/node_modules/jose/LICENSE.md +0 -21
- package/node_modules/jose/README.md +0 -153
- package/node_modules/jose/dist/types/index.d.ts +0 -55
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +0 -31
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +0 -65
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +0 -31
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +0 -83
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +0 -31
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +0 -74
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +0 -17
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +0 -32
- package/node_modules/jose/dist/types/jwks/local.d.ts +0 -29
- package/node_modules/jose/dist/types/jwks/remote.d.ts +0 -237
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +0 -36
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +0 -33
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +0 -42
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +0 -33
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +0 -53
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +0 -33
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +0 -35
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +0 -91
- package/node_modules/jose/dist/types/jwt/sign.d.ts +0 -43
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +0 -43
- package/node_modules/jose/dist/types/jwt/verify.d.ts +0 -37
- package/node_modules/jose/dist/types/key/export.d.ts +0 -33
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +0 -47
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +0 -35
- package/node_modules/jose/dist/types/key/import.d.ts +0 -83
- package/node_modules/jose/dist/types/types.d.ts +0 -841
- package/node_modules/jose/dist/types/util/base64url.d.ts +0 -9
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +0 -18
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +0 -17
- package/node_modules/jose/dist/types/util/errors.d.ts +0 -213
- package/node_modules/jose/dist/webapi/index.js +0 -32
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +0 -27
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +0 -27
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +0 -165
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +0 -169
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +0 -31
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +0 -187
- package/node_modules/jose/dist/webapi/jwk/embedded.js +0 -17
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +0 -68
- package/node_modules/jose/dist/webapi/jwks/local.js +0 -119
- package/node_modules/jose/dist/webapi/jwks/remote.js +0 -179
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +0 -18
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +0 -21
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +0 -92
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +0 -120
- package/node_modules/jose/dist/webapi/jws/general/sign.js +0 -73
- package/node_modules/jose/dist/webapi/jws/general/verify.js +0 -24
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +0 -23
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +0 -108
- package/node_modules/jose/dist/webapi/jwt/sign.js +0 -52
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +0 -63
- package/node_modules/jose/dist/webapi/jwt/verify.js +0 -15
- package/node_modules/jose/dist/webapi/key/export.js +0 -11
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +0 -97
- package/node_modules/jose/dist/webapi/key/generate_secret.js +0 -40
- package/node_modules/jose/dist/webapi/key/import.js +0 -57
- package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +0 -16
- package/node_modules/jose/dist/webapi/lib/aeskw.js +0 -25
- package/node_modules/jose/dist/webapi/lib/asn1.js +0 -243
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +0 -43
- package/node_modules/jose/dist/webapi/lib/cek.js +0 -19
- package/node_modules/jose/dist/webapi/lib/check_cek_length.js +0 -7
- package/node_modules/jose/dist/webapi/lib/check_iv_length.js +0 -7
- package/node_modules/jose/dist/webapi/lib/check_key_length.js +0 -8
- package/node_modules/jose/dist/webapi/lib/check_key_type.js +0 -122
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -143
- package/node_modules/jose/dist/webapi/lib/decrypt.js +0 -106
- package/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +0 -127
- package/node_modules/jose/dist/webapi/lib/digest.js +0 -4
- package/node_modules/jose/dist/webapi/lib/ecdhes.js +0 -52
- package/node_modules/jose/dist/webapi/lib/encrypt.js +0 -74
- package/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +0 -92
- package/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +0 -12
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -27
- package/node_modules/jose/dist/webapi/lib/is_disjoint.js +0 -21
- package/node_modules/jose/dist/webapi/lib/is_jwk.js +0 -6
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
- package/node_modules/jose/dist/webapi/lib/is_object.js +0 -14
- package/node_modules/jose/dist/webapi/lib/iv.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -109
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +0 -238
- package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +0 -31
- package/node_modules/jose/dist/webapi/lib/normalize_key.js +0 -176
- package/node_modules/jose/dist/webapi/lib/pbes2kw.js +0 -39
- package/node_modules/jose/dist/webapi/lib/private_symbols.js +0 -1
- package/node_modules/jose/dist/webapi/lib/rsaes.js +0 -24
- package/node_modules/jose/dist/webapi/lib/sign.js +0 -9
- package/node_modules/jose/dist/webapi/lib/subtle_dsa.js +0 -31
- package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +0 -10
- package/node_modules/jose/dist/webapi/lib/validate_crit.js +0 -33
- package/node_modules/jose/dist/webapi/lib/verify.js +0 -14
- package/node_modules/jose/dist/webapi/util/base64url.js +0 -30
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +0 -32
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +0 -34
- package/node_modules/jose/dist/webapi/util/errors.js +0 -99
- package/node_modules/jose/package.json +0 -200
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -191
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/locales/index.cjs +0 -17
- package/node_modules/zod/locales/index.d.cts +0 -1
- package/node_modules/zod/locales/index.d.ts +0 -1
- package/node_modules/zod/locales/index.js +0 -1
- package/node_modules/zod/locales/package.json +0 -7
- package/node_modules/zod/mini/index.cjs +0 -32
- package/node_modules/zod/mini/index.d.cts +0 -3
- package/node_modules/zod/mini/index.d.ts +0 -3
- package/node_modules/zod/mini/index.js +0 -3
- package/node_modules/zod/mini/package.json +0 -7
- package/node_modules/zod/package.json +0 -135
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/locales/index.ts +0 -1
- package/node_modules/zod/src/mini/index.ts +0 -3
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5138
- package/node_modules/zod/src/v4/classic/checks.ts +0 -32
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -70
- package/node_modules/zod/src/v4/classic/errors.ts +0 -82
- package/node_modules/zod/src/v4/classic/external.ts +0 -52
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -82
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1823
- package/node_modules/zod/src/v4/core/checks.ts +0 -1293
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -153
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -455
- package/node_modules/zod/src/v4/core/index.ts +0 -16
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
- package/node_modules/zod/src/v4/core/parse.ts +0 -195
- package/node_modules/zod/src/v4/core/regexes.ts +0 -190
- package/node_modules/zod/src/v4/core/registries.ts +0 -105
- package/node_modules/zod/src/v4/core/schemas.ts +0 -4730
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
- package/node_modules/zod/src/v4/core/util.ts +0 -983
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -115
- package/node_modules/zod/src/v4/locales/az.ts +0 -111
- package/node_modules/zod/src/v4/locales/be.ts +0 -176
- package/node_modules/zod/src/v4/locales/bg.ts +0 -128
- package/node_modules/zod/src/v4/locales/ca.ts +0 -116
- package/node_modules/zod/src/v4/locales/cs.ts +0 -118
- package/node_modules/zod/src/v4/locales/da.ts +0 -123
- package/node_modules/zod/src/v4/locales/de.ts +0 -116
- package/node_modules/zod/src/v4/locales/el.ts +0 -121
- package/node_modules/zod/src/v4/locales/en.ts +0 -123
- package/node_modules/zod/src/v4/locales/eo.ts +0 -118
- package/node_modules/zod/src/v4/locales/es.ts +0 -141
- package/node_modules/zod/src/v4/locales/fa.ts +0 -126
- package/node_modules/zod/src/v4/locales/fi.ts +0 -121
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
- package/node_modules/zod/src/v4/locales/fr.ts +0 -132
- package/node_modules/zod/src/v4/locales/he.ts +0 -246
- package/node_modules/zod/src/v4/locales/hr.ts +0 -131
- package/node_modules/zod/src/v4/locales/hu.ts +0 -117
- package/node_modules/zod/src/v4/locales/hy.ts +0 -164
- package/node_modules/zod/src/v4/locales/id.ts +0 -115
- package/node_modules/zod/src/v4/locales/index.ts +0 -52
- package/node_modules/zod/src/v4/locales/is.ts +0 -119
- package/node_modules/zod/src/v4/locales/it.ts +0 -116
- package/node_modules/zod/src/v4/locales/ja.ts +0 -114
- package/node_modules/zod/src/v4/locales/ka.ts +0 -123
- package/node_modules/zod/src/v4/locales/kh.ts +0 -7
- package/node_modules/zod/src/v4/locales/km.ts +0 -119
- package/node_modules/zod/src/v4/locales/ko.ts +0 -121
- package/node_modules/zod/src/v4/locales/lt.ts +0 -239
- package/node_modules/zod/src/v4/locales/mk.ts +0 -118
- package/node_modules/zod/src/v4/locales/ms.ts +0 -115
- package/node_modules/zod/src/v4/locales/nl.ts +0 -121
- package/node_modules/zod/src/v4/locales/no.ts +0 -116
- package/node_modules/zod/src/v4/locales/ota.ts +0 -117
- package/node_modules/zod/src/v4/locales/pl.ts +0 -118
- package/node_modules/zod/src/v4/locales/ps.ts +0 -126
- package/node_modules/zod/src/v4/locales/pt.ts +0 -116
- package/node_modules/zod/src/v4/locales/ro.ts +0 -129
- package/node_modules/zod/src/v4/locales/ru.ts +0 -176
- package/node_modules/zod/src/v4/locales/sl.ts +0 -118
- package/node_modules/zod/src/v4/locales/sv.ts +0 -119
- package/node_modules/zod/src/v4/locales/ta.ts +0 -118
- package/node_modules/zod/src/v4/locales/th.ts +0 -119
- package/node_modules/zod/src/v4/locales/tr.ts +0 -111
- package/node_modules/zod/src/v4/locales/ua.ts +0 -7
- package/node_modules/zod/src/v4/locales/uk.ts +0 -117
- package/node_modules/zod/src/v4/locales/ur.ts +0 -119
- package/node_modules/zod/src/v4/locales/uz.ts +0 -117
- package/node_modules/zod/src/v4/locales/vi.ts +0 -117
- package/node_modules/zod/src/v4/locales/yo.ts +0 -124
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
- package/node_modules/zod/src/v4/mini/external.ts +0 -41
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -66
- package/node_modules/zod/src/v4/mini/parse.ts +0 -14
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
- package/node_modules/zod/src/v4-mini/index.ts +0 -3
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -112
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/package.json +0 -7
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3777
- package/node_modules/zod/v3/types.d.cts +0 -1034
- package/node_modules/zod/v3/types.d.ts +0 -1034
- package/node_modules/zod/v3/types.js +0 -3695
- package/node_modules/zod/v4/classic/checks.cjs +0 -33
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -61
- package/node_modules/zod/v4/classic/compat.d.cts +0 -50
- package/node_modules/zod/v4/classic/compat.d.ts +0 -50
- package/node_modules/zod/v4/classic/compat.js +0 -31
- package/node_modules/zod/v4/classic/errors.cjs +0 -74
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -48
- package/node_modules/zod/v4/classic/external.cjs +0 -73
- package/node_modules/zod/v4/classic/external.d.cts +0 -16
- package/node_modules/zod/v4/classic/external.d.ts +0 -16
- package/node_modules/zod/v4/classic/external.js +0 -20
- package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
- package/node_modules/zod/v4/classic/from-json-schema.js +0 -599
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/package.json +0 -7
- package/node_modules/zod/v4/classic/parse.cjs +0 -41
- package/node_modules/zod/v4/classic/parse.d.cts +0 -31
- package/node_modules/zod/v4/classic/parse.d.ts +0 -31
- package/node_modules/zod/v4/classic/parse.js +0 -15
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1511
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -767
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -767
- package/node_modules/zod/v4/classic/schemas.js +0 -1395
- package/node_modules/zod/v4/core/api.cjs +0 -1227
- package/node_modules/zod/v4/core/api.d.cts +0 -325
- package/node_modules/zod/v4/core/api.d.ts +0 -325
- package/node_modules/zod/v4/core/api.js +0 -1087
- package/node_modules/zod/v4/core/checks.cjs +0 -601
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -575
- package/node_modules/zod/v4/core/core.cjs +0 -85
- package/node_modules/zod/v4/core/core.d.cts +0 -70
- package/node_modules/zod/v4/core/core.d.ts +0 -70
- package/node_modules/zod/v4/core/core.js +0 -78
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -216
- package/node_modules/zod/v4/core/errors.d.cts +0 -221
- package/node_modules/zod/v4/core/errors.d.ts +0 -221
- package/node_modules/zod/v4/core/errors.js +0 -185
- package/node_modules/zod/v4/core/index.cjs +0 -47
- package/node_modules/zod/v4/core/index.d.cts +0 -16
- package/node_modules/zod/v4/core/index.d.ts +0 -16
- package/node_modules/zod/v4/core/index.js +0 -16
- package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
- package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
- package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
- package/node_modules/zod/v4/core/json-schema-processors.js +0 -601
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/package.json +0 -7
- package/node_modules/zod/v4/core/parse.cjs +0 -131
- package/node_modules/zod/v4/core/parse.d.cts +0 -49
- package/node_modules/zod/v4/core/parse.d.ts +0 -49
- package/node_modules/zod/v4/core/parse.js +0 -93
- package/node_modules/zod/v4/core/regexes.cjs +0 -172
- package/node_modules/zod/v4/core/regexes.d.cts +0 -85
- package/node_modules/zod/v4/core/regexes.d.ts +0 -85
- package/node_modules/zod/v4/core/regexes.js +0 -139
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -2270
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1184
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1184
- package/node_modules/zod/v4/core/schemas.js +0 -2239
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
- package/node_modules/zod/v4/core/to-json-schema.js +0 -448
- package/node_modules/zod/v4/core/util.cjs +0 -734
- package/node_modules/zod/v4/core/util.d.cts +0 -200
- package/node_modules/zod/v4/core/util.d.ts +0 -200
- package/node_modules/zod/v4/core/util.js +0 -674
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -133
- package/node_modules/zod/v4/locales/ar.d.cts +0 -5
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -106
- package/node_modules/zod/v4/locales/az.cjs +0 -132
- package/node_modules/zod/v4/locales/az.d.cts +0 -5
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -105
- package/node_modules/zod/v4/locales/be.cjs +0 -183
- package/node_modules/zod/v4/locales/be.d.cts +0 -5
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -156
- package/node_modules/zod/v4/locales/bg.cjs +0 -147
- package/node_modules/zod/v4/locales/bg.d.cts +0 -5
- package/node_modules/zod/v4/locales/bg.d.ts +0 -4
- package/node_modules/zod/v4/locales/bg.js +0 -120
- package/node_modules/zod/v4/locales/ca.cjs +0 -134
- package/node_modules/zod/v4/locales/ca.d.cts +0 -5
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -107
- package/node_modules/zod/v4/locales/cs.cjs +0 -138
- package/node_modules/zod/v4/locales/cs.d.cts +0 -5
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -111
- package/node_modules/zod/v4/locales/da.cjs +0 -142
- package/node_modules/zod/v4/locales/da.d.cts +0 -5
- package/node_modules/zod/v4/locales/da.d.ts +0 -4
- package/node_modules/zod/v4/locales/da.js +0 -115
- package/node_modules/zod/v4/locales/de.cjs +0 -135
- package/node_modules/zod/v4/locales/de.d.cts +0 -5
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -108
- package/node_modules/zod/v4/locales/el.cjs +0 -136
- package/node_modules/zod/v4/locales/el.d.cts +0 -5
- package/node_modules/zod/v4/locales/el.d.ts +0 -4
- package/node_modules/zod/v4/locales/el.js +0 -109
- package/node_modules/zod/v4/locales/en.cjs +0 -140
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -4
- package/node_modules/zod/v4/locales/en.js +0 -113
- package/node_modules/zod/v4/locales/eo.cjs +0 -136
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -4
- package/node_modules/zod/v4/locales/eo.js +0 -109
- package/node_modules/zod/v4/locales/es.cjs +0 -159
- package/node_modules/zod/v4/locales/es.d.cts +0 -5
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -132
- package/node_modules/zod/v4/locales/fa.cjs +0 -141
- package/node_modules/zod/v4/locales/fa.d.cts +0 -5
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -114
- package/node_modules/zod/v4/locales/fi.cjs +0 -139
- package/node_modules/zod/v4/locales/fi.d.cts +0 -5
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -112
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -107
- package/node_modules/zod/v4/locales/fr.cjs +0 -152
- package/node_modules/zod/v4/locales/fr.d.cts +0 -5
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -125
- package/node_modules/zod/v4/locales/he.cjs +0 -241
- package/node_modules/zod/v4/locales/he.d.cts +0 -5
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -214
- package/node_modules/zod/v4/locales/hr.cjs +0 -149
- package/node_modules/zod/v4/locales/hr.d.cts +0 -5
- package/node_modules/zod/v4/locales/hr.d.ts +0 -4
- package/node_modules/zod/v4/locales/hr.js +0 -122
- package/node_modules/zod/v4/locales/hu.cjs +0 -135
- package/node_modules/zod/v4/locales/hu.d.cts +0 -5
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -108
- package/node_modules/zod/v4/locales/hy.cjs +0 -174
- package/node_modules/zod/v4/locales/hy.d.cts +0 -5
- package/node_modules/zod/v4/locales/hy.d.ts +0 -4
- package/node_modules/zod/v4/locales/hy.js +0 -147
- package/node_modules/zod/v4/locales/id.cjs +0 -133
- package/node_modules/zod/v4/locales/id.d.cts +0 -5
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -106
- package/node_modules/zod/v4/locales/index.cjs +0 -111
- package/node_modules/zod/v4/locales/index.d.cts +0 -52
- package/node_modules/zod/v4/locales/index.d.ts +0 -52
- package/node_modules/zod/v4/locales/index.js +0 -52
- package/node_modules/zod/v4/locales/is.cjs +0 -136
- package/node_modules/zod/v4/locales/is.d.cts +0 -5
- package/node_modules/zod/v4/locales/is.d.ts +0 -4
- package/node_modules/zod/v4/locales/is.js +0 -109
- package/node_modules/zod/v4/locales/it.cjs +0 -135
- package/node_modules/zod/v4/locales/it.d.cts +0 -5
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -108
- package/node_modules/zod/v4/locales/ja.cjs +0 -134
- package/node_modules/zod/v4/locales/ja.d.cts +0 -5
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -107
- package/node_modules/zod/v4/locales/ka.cjs +0 -139
- package/node_modules/zod/v4/locales/ka.d.cts +0 -5
- package/node_modules/zod/v4/locales/ka.d.ts +0 -4
- package/node_modules/zod/v4/locales/ka.js +0 -112
- package/node_modules/zod/v4/locales/kh.cjs +0 -12
- package/node_modules/zod/v4/locales/kh.d.cts +0 -5
- package/node_modules/zod/v4/locales/kh.d.ts +0 -5
- package/node_modules/zod/v4/locales/kh.js +0 -5
- package/node_modules/zod/v4/locales/km.cjs +0 -137
- package/node_modules/zod/v4/locales/km.d.cts +0 -5
- package/node_modules/zod/v4/locales/km.d.ts +0 -4
- package/node_modules/zod/v4/locales/km.js +0 -110
- package/node_modules/zod/v4/locales/ko.cjs +0 -138
- package/node_modules/zod/v4/locales/ko.d.cts +0 -5
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -111
- package/node_modules/zod/v4/locales/lt.cjs +0 -230
- package/node_modules/zod/v4/locales/lt.d.cts +0 -5
- package/node_modules/zod/v4/locales/lt.d.ts +0 -4
- package/node_modules/zod/v4/locales/lt.js +0 -203
- package/node_modules/zod/v4/locales/mk.cjs +0 -136
- package/node_modules/zod/v4/locales/mk.d.cts +0 -5
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -109
- package/node_modules/zod/v4/locales/ms.cjs +0 -134
- package/node_modules/zod/v4/locales/ms.d.cts +0 -5
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -107
- package/node_modules/zod/v4/locales/nl.cjs +0 -137
- package/node_modules/zod/v4/locales/nl.d.cts +0 -5
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -110
- package/node_modules/zod/v4/locales/no.cjs +0 -135
- package/node_modules/zod/v4/locales/no.d.cts +0 -5
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -108
- package/node_modules/zod/v4/locales/ota.cjs +0 -136
- package/node_modules/zod/v4/locales/ota.d.cts +0 -5
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -109
- package/node_modules/zod/v4/locales/package.json +0 -7
- package/node_modules/zod/v4/locales/pl.cjs +0 -136
- package/node_modules/zod/v4/locales/pl.d.cts +0 -5
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -109
- package/node_modules/zod/v4/locales/ps.cjs +0 -141
- package/node_modules/zod/v4/locales/ps.d.cts +0 -5
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -114
- package/node_modules/zod/v4/locales/pt.cjs +0 -135
- package/node_modules/zod/v4/locales/pt.d.cts +0 -5
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -108
- package/node_modules/zod/v4/locales/ro.cjs +0 -146
- package/node_modules/zod/v4/locales/ro.d.cts +0 -5
- package/node_modules/zod/v4/locales/ro.d.ts +0 -4
- package/node_modules/zod/v4/locales/ro.js +0 -119
- package/node_modules/zod/v4/locales/ru.cjs +0 -183
- package/node_modules/zod/v4/locales/ru.d.cts +0 -5
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -156
- package/node_modules/zod/v4/locales/sl.cjs +0 -136
- package/node_modules/zod/v4/locales/sl.d.cts +0 -5
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -109
- package/node_modules/zod/v4/locales/sv.cjs +0 -137
- package/node_modules/zod/v4/locales/sv.d.cts +0 -5
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -110
- package/node_modules/zod/v4/locales/ta.cjs +0 -137
- package/node_modules/zod/v4/locales/ta.d.cts +0 -5
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -110
- package/node_modules/zod/v4/locales/th.cjs +0 -137
- package/node_modules/zod/v4/locales/th.d.cts +0 -5
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -110
- package/node_modules/zod/v4/locales/tr.cjs +0 -132
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -4
- package/node_modules/zod/v4/locales/tr.js +0 -105
- package/node_modules/zod/v4/locales/ua.cjs +0 -12
- package/node_modules/zod/v4/locales/ua.d.cts +0 -5
- package/node_modules/zod/v4/locales/ua.d.ts +0 -5
- package/node_modules/zod/v4/locales/ua.js +0 -5
- package/node_modules/zod/v4/locales/uk.cjs +0 -135
- package/node_modules/zod/v4/locales/uk.d.cts +0 -5
- package/node_modules/zod/v4/locales/uk.d.ts +0 -4
- package/node_modules/zod/v4/locales/uk.js +0 -108
- package/node_modules/zod/v4/locales/ur.cjs +0 -137
- package/node_modules/zod/v4/locales/ur.d.cts +0 -5
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -110
- package/node_modules/zod/v4/locales/uz.cjs +0 -137
- package/node_modules/zod/v4/locales/uz.d.cts +0 -5
- package/node_modules/zod/v4/locales/uz.d.ts +0 -4
- package/node_modules/zod/v4/locales/uz.js +0 -110
- package/node_modules/zod/v4/locales/vi.cjs +0 -135
- package/node_modules/zod/v4/locales/vi.d.cts +0 -5
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -108
- package/node_modules/zod/v4/locales/yo.cjs +0 -134
- package/node_modules/zod/v4/locales/yo.d.cts +0 -5
- package/node_modules/zod/v4/locales/yo.d.ts +0 -4
- package/node_modules/zod/v4/locales/yo.js +0 -107
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -109
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -107
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -52
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -22
- package/node_modules/zod/v4/mini/external.cjs +0 -63
- package/node_modules/zod/v4/mini/external.d.cts +0 -13
- package/node_modules/zod/v4/mini/external.d.ts +0 -13
- package/node_modules/zod/v4/mini/external.js +0 -14
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -64
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -34
- package/node_modules/zod/v4/mini/package.json +0 -7
- package/node_modules/zod/v4/mini/parse.cjs +0 -16
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -1083
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -445
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -445
- package/node_modules/zod/v4/mini/schemas.js +0 -961
- package/node_modules/zod/v4/package.json +0 -7
- package/node_modules/zod/v4-mini/index.cjs +0 -32
- package/node_modules/zod/v4-mini/index.d.cts +0 -3
- package/node_modules/zod/v4-mini/index.d.ts +0 -3
- package/node_modules/zod/v4-mini/index.js +0 -3
- package/node_modules/zod/v4-mini/package.json +0 -7
package/dist/index.js
CHANGED
|
@@ -1,49 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolvePublicFilePath,
|
|
3
|
-
servePublicFile
|
|
4
|
-
} from "./chunk-SMN75YED.js";
|
|
5
|
-
import {
|
|
6
|
-
registerOpenAPITools
|
|
7
|
-
} from "./chunk-AATFAERC.js";
|
|
8
|
-
import {
|
|
9
|
-
completable,
|
|
10
|
-
normalizeCompletions
|
|
11
|
-
} from "./chunk-KIZ72TIK.js";
|
|
12
|
-
import {
|
|
13
|
-
synthesizeViewDocument
|
|
14
|
-
} from "./chunk-XUI7QE2D.js";
|
|
15
|
-
import {
|
|
16
|
-
hasExplicitAssetsBase,
|
|
17
|
-
originFromAssetsBase,
|
|
18
|
-
resolveAssetsBase,
|
|
19
|
-
resolveServerOrigin
|
|
20
|
-
} from "./chunk-FC2Z2VFO.js";
|
|
21
1
|
import {
|
|
22
2
|
authInfoFromRequest,
|
|
23
|
-
getOAuthProtectedResourceMetadataUrl,
|
|
24
|
-
oauthMetadata,
|
|
25
|
-
requireBearerAuth
|
|
26
|
-
} from "./chunk-Z326HADF.js";
|
|
27
|
-
import {
|
|
28
3
|
composeFetch,
|
|
4
|
+
getOAuthProtectedResourceMetadataUrl,
|
|
29
5
|
getRequestBag,
|
|
30
6
|
hostValidationMiddleware,
|
|
31
|
-
isHtmlNavigationRequest,
|
|
32
7
|
jsonBodyMiddleware,
|
|
33
8
|
matchesPath,
|
|
34
9
|
matchesPathPrefix,
|
|
10
|
+
oauthMetadata,
|
|
35
11
|
originValidationMiddleware,
|
|
36
|
-
pathUnderBase,
|
|
37
12
|
pathnameOf,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} from "./chunk-
|
|
13
|
+
requireBearerAuth,
|
|
14
|
+
routeFetch
|
|
15
|
+
} from "./chunk-SFI2T6TE.js";
|
|
41
16
|
import {
|
|
42
17
|
getOAuthProviderOptions,
|
|
43
18
|
resolveConfiguredOAuthResource,
|
|
44
19
|
resolveLocalOAuthResource,
|
|
45
20
|
wrapOAuthTokenVerifier
|
|
46
21
|
} from "./chunk-DPL7OEXC.js";
|
|
22
|
+
import {
|
|
23
|
+
registerOpenAPITools
|
|
24
|
+
} from "./chunk-AATFAERC.js";
|
|
47
25
|
|
|
48
26
|
// src/server.ts
|
|
49
27
|
import {
|
|
@@ -51,236 +29,9 @@ import {
|
|
|
51
29
|
localhostAllowedOrigins,
|
|
52
30
|
McpServer as SdkMcpServer,
|
|
53
31
|
ResourceTemplate,
|
|
54
|
-
isInputRequiredResult
|
|
32
|
+
isInputRequiredResult
|
|
55
33
|
} from "@modelcontextprotocol/server";
|
|
56
34
|
|
|
57
|
-
// src/branding.ts
|
|
58
|
-
var FAVICON_CACHE_CONTROL = "public, max-age=31536000, immutable";
|
|
59
|
-
var FAVICON_REDIRECT_CACHE_CONTROL = "public, max-age=300";
|
|
60
|
-
function protocolOf(value) {
|
|
61
|
-
const match = /^([a-z][a-z\d+.-]*):/i.exec(value);
|
|
62
|
-
return match?.[1]?.toLowerCase();
|
|
63
|
-
}
|
|
64
|
-
function publicAssetPath(basePath, source) {
|
|
65
|
-
const prefix = basePath === "/" ? "" : basePath;
|
|
66
|
-
return `${prefix}/_mcp-use/public/${source.split("/").map((segment) => encodeURIComponent(segment)).join("/")}`;
|
|
67
|
-
}
|
|
68
|
-
function isLocalPublicSource(source) {
|
|
69
|
-
return protocolOf(source) === void 0;
|
|
70
|
-
}
|
|
71
|
-
function selectFaviconFromIcons(icons) {
|
|
72
|
-
return icons[0];
|
|
73
|
-
}
|
|
74
|
-
function assertLocalPublicSource(source, field) {
|
|
75
|
-
if (source.startsWith("/") || source.includes("\\") || source.includes("?") || source.includes("#") || source.split("/").some((segment) => segment === "" || segment === "..")) {
|
|
76
|
-
throw new TypeError(
|
|
77
|
-
`${field} must be an http(s) URL, image data URL, or safe path relative to public/`
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function parseDataImage(source, field) {
|
|
82
|
-
const comma = source.indexOf(",");
|
|
83
|
-
if (comma < 0) {
|
|
84
|
-
throw new TypeError(`${field} must be a valid image data URL`);
|
|
85
|
-
}
|
|
86
|
-
const metadata = source.slice(5, comma);
|
|
87
|
-
const payload = source.slice(comma + 1);
|
|
88
|
-
const parts = metadata.split(";");
|
|
89
|
-
const mimeType = parts[0]?.toLowerCase() ?? "";
|
|
90
|
-
if (!mimeType.startsWith("image/")) {
|
|
91
|
-
throw new TypeError(`${field} data URL must use an image MIME type`);
|
|
92
|
-
}
|
|
93
|
-
try {
|
|
94
|
-
if (parts.includes("base64")) {
|
|
95
|
-
const binary = atob(payload);
|
|
96
|
-
return {
|
|
97
|
-
mimeType,
|
|
98
|
-
bytes: Uint8Array.from(binary, (character) => character.charCodeAt(0))
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
mimeType,
|
|
103
|
-
bytes: new TextEncoder().encode(decodeURIComponent(payload))
|
|
104
|
-
};
|
|
105
|
-
} catch {
|
|
106
|
-
throw new TypeError(`${field} must be a valid image data URL`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function assertBrandingSource(source, field) {
|
|
110
|
-
if (typeof source !== "string" || source.length === 0) {
|
|
111
|
-
throw new TypeError(`${field} must be a non-empty string`);
|
|
112
|
-
}
|
|
113
|
-
const protocol = protocolOf(source);
|
|
114
|
-
if (protocol === void 0) {
|
|
115
|
-
assertLocalPublicSource(source, field);
|
|
116
|
-
return source;
|
|
117
|
-
}
|
|
118
|
-
if (protocol === "data") {
|
|
119
|
-
parseDataImage(source, field);
|
|
120
|
-
return source;
|
|
121
|
-
}
|
|
122
|
-
if (protocol !== "http" && protocol !== "https") {
|
|
123
|
-
throw new TypeError(
|
|
124
|
-
`${field} must be an http(s) URL, image data URL, or safe path relative to public/`
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
new URL(source);
|
|
129
|
-
} catch {
|
|
130
|
-
throw new TypeError(`${field} must be a valid absolute http(s) URL`);
|
|
131
|
-
}
|
|
132
|
-
return source;
|
|
133
|
-
}
|
|
134
|
-
function normalizeServerBranding(config) {
|
|
135
|
-
let websiteUrl;
|
|
136
|
-
if (config.websiteUrl !== void 0) {
|
|
137
|
-
if (typeof config.websiteUrl !== "string" || config.websiteUrl.length === 0) {
|
|
138
|
-
throw new TypeError(
|
|
139
|
-
"websiteUrl must be a non-empty absolute http(s) URL"
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
let parsed;
|
|
143
|
-
try {
|
|
144
|
-
parsed = new URL(config.websiteUrl);
|
|
145
|
-
} catch {
|
|
146
|
-
throw new TypeError(
|
|
147
|
-
"websiteUrl must be a non-empty absolute http(s) URL"
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
151
|
-
throw new TypeError(
|
|
152
|
-
"websiteUrl must be a non-empty absolute http(s) URL"
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
websiteUrl = config.websiteUrl;
|
|
156
|
-
}
|
|
157
|
-
let icons;
|
|
158
|
-
if (config.icons !== void 0) {
|
|
159
|
-
if (!Array.isArray(config.icons)) {
|
|
160
|
-
throw new TypeError("icons must be an array of MCP Icon objects");
|
|
161
|
-
}
|
|
162
|
-
icons = Object.freeze(
|
|
163
|
-
config.icons.map((value, index) => {
|
|
164
|
-
if (typeof value !== "object" || value === null) {
|
|
165
|
-
throw new TypeError(`icons[${index}] must be an MCP Icon object`);
|
|
166
|
-
}
|
|
167
|
-
const icon = value;
|
|
168
|
-
const src = assertBrandingSource(icon["src"], `icons[${index}].src`);
|
|
169
|
-
const mimeType = icon["mimeType"];
|
|
170
|
-
if (mimeType !== void 0 && (typeof mimeType !== "string" || !mimeType.toLowerCase().startsWith("image/"))) {
|
|
171
|
-
throw new TypeError(
|
|
172
|
-
`icons[${index}].mimeType must be an image MIME type when provided`
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
const sizes = icon["sizes"];
|
|
176
|
-
if (sizes !== void 0 && (!Array.isArray(sizes) || sizes.some((size) => typeof size !== "string" || size.length === 0))) {
|
|
177
|
-
throw new TypeError(
|
|
178
|
-
`icons[${index}].sizes must be an array of non-empty strings when provided`
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
const normalizedSizes = sizes === void 0 ? void 0 : sizes.map((size) => size);
|
|
182
|
-
const theme = icon["theme"];
|
|
183
|
-
if (theme !== void 0 && theme !== "light" && theme !== "dark") {
|
|
184
|
-
throw new TypeError(
|
|
185
|
-
`icons[${index}].theme must be "light" or "dark" when provided`
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
return Object.freeze({
|
|
189
|
-
src,
|
|
190
|
-
...mimeType !== void 0 && { mimeType },
|
|
191
|
-
...normalizedSizes !== void 0 && {
|
|
192
|
-
sizes: Object.freeze(normalizedSizes)
|
|
193
|
-
},
|
|
194
|
-
...theme !== void 0 && { theme }
|
|
195
|
-
});
|
|
196
|
-
})
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
const explicitFavicon = config.favicon === void 0 ? void 0 : assertBrandingSource(config.favicon, "favicon");
|
|
200
|
-
const inferred = explicitFavicon === void 0 ? selectFaviconFromIcons(icons ?? []) : void 0;
|
|
201
|
-
const favicon = explicitFavicon ?? inferred?.src;
|
|
202
|
-
const faviconMimeType = inferred?.mimeType ?? icons?.find((icon) => icon.src === explicitFavicon)?.mimeType;
|
|
203
|
-
return Object.freeze({
|
|
204
|
-
...favicon !== void 0 && { favicon },
|
|
205
|
-
...faviconMimeType !== void 0 && { faviconMimeType },
|
|
206
|
-
...icons !== void 0 && { icons },
|
|
207
|
-
...websiteUrl !== void 0 && { websiteUrl }
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
function resolveImplementationIcons(icons, request, basePath) {
|
|
211
|
-
if (icons === void 0) {
|
|
212
|
-
return void 0;
|
|
213
|
-
}
|
|
214
|
-
return icons.map((icon) => ({
|
|
215
|
-
...icon,
|
|
216
|
-
src: request !== void 0 && isLocalPublicSource(icon.src) ? `${resolveAssetsBase(request)}${publicAssetPath(basePath, icon.src)}` : icon.src,
|
|
217
|
-
...icon.sizes !== void 0 && { sizes: [...icon.sizes] }
|
|
218
|
-
}));
|
|
219
|
-
}
|
|
220
|
-
function hasLocalBrandingAsset(branding) {
|
|
221
|
-
return branding.favicon !== void 0 && isLocalPublicSource(branding.favicon) || branding.icons?.some((icon) => isLocalPublicSource(icon.src)) === true;
|
|
222
|
-
}
|
|
223
|
-
function createFaviconHandler(branding, options) {
|
|
224
|
-
const source = branding.favicon;
|
|
225
|
-
if (source === void 0) {
|
|
226
|
-
return void 0;
|
|
227
|
-
}
|
|
228
|
-
return async (request) => {
|
|
229
|
-
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
230
|
-
return new Response("Method Not Allowed", {
|
|
231
|
-
status: 405,
|
|
232
|
-
headers: { Allow: "GET, HEAD" }
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
if (new URL(request.url).pathname !== "/favicon.ico") {
|
|
236
|
-
return new Response("Not Found", { status: 404 });
|
|
237
|
-
}
|
|
238
|
-
const protocol = protocolOf(source);
|
|
239
|
-
if (protocol === "http" || protocol === "https") {
|
|
240
|
-
return new Response(null, {
|
|
241
|
-
status: 307,
|
|
242
|
-
headers: {
|
|
243
|
-
Location: source,
|
|
244
|
-
"Cache-Control": FAVICON_REDIRECT_CACHE_CONTROL
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
if (protocol === "data") {
|
|
249
|
-
const data = parseDataImage(source, "favicon");
|
|
250
|
-
return new Response(
|
|
251
|
-
request.method === "HEAD" ? null : data.bytes.buffer,
|
|
252
|
-
{
|
|
253
|
-
status: 200,
|
|
254
|
-
headers: {
|
|
255
|
-
"Content-Type": branding.faviconMimeType ?? data.mimeType,
|
|
256
|
-
"Cache-Control": FAVICON_CACHE_CONTROL,
|
|
257
|
-
"X-Content-Type-Options": "nosniff"
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
const { join } = await import("path");
|
|
263
|
-
const publicRoot = options.dev ? join(options.projectRoot, "public") : join(options.projectRoot, ".mcp-use/build/views/public");
|
|
264
|
-
const diskPath = await resolvePublicFilePath(publicRoot, source);
|
|
265
|
-
if (diskPath === null) {
|
|
266
|
-
return new Response("Not Found", {
|
|
267
|
-
status: 404,
|
|
268
|
-
headers: { "Cache-Control": "no-store" }
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
const response = await servePublicFile(diskPath, {
|
|
272
|
-
...options.deferCors === true && { deferCors: true },
|
|
273
|
-
...request.method === "HEAD" && { head: true }
|
|
274
|
-
});
|
|
275
|
-
response.headers.set("Cache-Control", FAVICON_CACHE_CONTROL);
|
|
276
|
-
response.headers.set("X-Content-Type-Options", "nosniff");
|
|
277
|
-
if (branding.faviconMimeType !== void 0) {
|
|
278
|
-
response.headers.set("Content-Type", branding.faviconMimeType);
|
|
279
|
-
}
|
|
280
|
-
return response;
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
|
|
284
35
|
// src/config.ts
|
|
285
36
|
function assertServerConfig(config) {
|
|
286
37
|
if (config.basePath !== void 0) {
|
|
@@ -471,317 +222,12 @@ function toAuthenticatedRequestContext(ctx) {
|
|
|
471
222
|
};
|
|
472
223
|
}
|
|
473
224
|
|
|
474
|
-
// src/middleware/cors.ts
|
|
475
|
-
var DEFAULT_METHODS = ["GET", "HEAD", "POST", "OPTIONS"];
|
|
476
|
-
var DEFAULT_ALLOWED_HEADERS = [
|
|
477
|
-
"Content-Type",
|
|
478
|
-
"Authorization",
|
|
479
|
-
"mcp-protocol-version",
|
|
480
|
-
"mcp-method",
|
|
481
|
-
"mcp-name"
|
|
482
|
-
];
|
|
483
|
-
function resolveAllowedOrigin(origin, requestOrigin) {
|
|
484
|
-
if (origin === void 0) {
|
|
485
|
-
return requestOrigin;
|
|
486
|
-
}
|
|
487
|
-
if (typeof origin === "function") {
|
|
488
|
-
return origin(requestOrigin);
|
|
489
|
-
}
|
|
490
|
-
if (origin === "*") {
|
|
491
|
-
return "*";
|
|
492
|
-
}
|
|
493
|
-
if (Array.isArray(origin)) {
|
|
494
|
-
if (requestOrigin !== null && origin.includes(requestOrigin)) {
|
|
495
|
-
return requestOrigin;
|
|
496
|
-
}
|
|
497
|
-
return null;
|
|
498
|
-
}
|
|
499
|
-
return origin;
|
|
500
|
-
}
|
|
501
|
-
function corsHeaders(options, request) {
|
|
502
|
-
if (request.headers.has("Access-Control-Allow-Origin")) {
|
|
503
|
-
return void 0;
|
|
504
|
-
}
|
|
505
|
-
const requestOrigin = request.headers.get("Origin");
|
|
506
|
-
const allowedOrigin = resolveAllowedOrigin(options.origin, requestOrigin);
|
|
507
|
-
if (allowedOrigin === null) {
|
|
508
|
-
return void 0;
|
|
509
|
-
}
|
|
510
|
-
const headers = {
|
|
511
|
-
"Access-Control-Allow-Origin": allowedOrigin,
|
|
512
|
-
"Access-Control-Allow-Methods": options.methods.join(", "),
|
|
513
|
-
"Access-Control-Allow-Headers": options.allowedHeaders.join(", ")
|
|
514
|
-
};
|
|
515
|
-
if (options.credentials) {
|
|
516
|
-
headers["Access-Control-Allow-Credentials"] = "true";
|
|
517
|
-
}
|
|
518
|
-
if (allowedOrigin !== "*") {
|
|
519
|
-
headers.Vary = "Origin";
|
|
520
|
-
}
|
|
521
|
-
return headers;
|
|
522
|
-
}
|
|
523
|
-
function mergeCorsHeaders(response, headers) {
|
|
524
|
-
if (response.headers.has("Access-Control-Allow-Origin")) {
|
|
525
|
-
return response;
|
|
526
|
-
}
|
|
527
|
-
const merged = new Headers(response.headers);
|
|
528
|
-
const corsHeaders2 = new Headers(headers);
|
|
529
|
-
corsHeaders2.forEach((value, key) => {
|
|
530
|
-
merged.set(key, value);
|
|
531
|
-
});
|
|
532
|
-
return new Response(response.body, {
|
|
533
|
-
status: response.status,
|
|
534
|
-
statusText: response.statusText,
|
|
535
|
-
headers: merged
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
function corsFetchMiddleware(options) {
|
|
539
|
-
const enabled = options.enabled !== false;
|
|
540
|
-
if (!enabled) {
|
|
541
|
-
return async (_request, next) => next();
|
|
542
|
-
}
|
|
543
|
-
const resolved = {
|
|
544
|
-
...options.origin !== void 0 && { origin: options.origin },
|
|
545
|
-
methods: options.methods ?? DEFAULT_METHODS,
|
|
546
|
-
allowedHeaders: options.allowedHeaders ?? DEFAULT_ALLOWED_HEADERS,
|
|
547
|
-
credentials: options.credentials ?? false
|
|
548
|
-
};
|
|
549
|
-
return async (request, next) => {
|
|
550
|
-
const headers = corsHeaders(resolved, request);
|
|
551
|
-
if (headers === void 0) {
|
|
552
|
-
return next();
|
|
553
|
-
}
|
|
554
|
-
if (request.method === "OPTIONS") {
|
|
555
|
-
return new Response(null, { status: 204, headers });
|
|
556
|
-
}
|
|
557
|
-
const response = await next();
|
|
558
|
-
return mergeCorsHeaders(response, headers);
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
function isGlobalCorsEnabled(cors) {
|
|
562
|
-
return cors !== void 0 && cors.enabled !== false;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
// src/middleware/mcp-middleware.ts
|
|
566
|
-
import {
|
|
567
|
-
CallToolResultSchema,
|
|
568
|
-
GetPromptResultSchema,
|
|
569
|
-
ListPromptsResultSchema,
|
|
570
|
-
ListResourcesResultSchema,
|
|
571
|
-
ListToolsResultSchema,
|
|
572
|
-
ReadResourceResultSchema
|
|
573
|
-
} from "@modelcontextprotocol/core";
|
|
574
|
-
import { isInputRequiredResult } from "@modelcontextprotocol/server";
|
|
575
|
-
var MCP_MIDDLEWARE_METHODS = [
|
|
576
|
-
"tools/call",
|
|
577
|
-
"tools/list",
|
|
578
|
-
"resources/read",
|
|
579
|
-
"resources/list",
|
|
580
|
-
"prompts/get",
|
|
581
|
-
"prompts/list"
|
|
582
|
-
];
|
|
583
|
-
function withMcpMiddlewareParams(request, params) {
|
|
584
|
-
if (typeof request !== "object" || request === null || Array.isArray(request)) {
|
|
585
|
-
throw new TypeError(
|
|
586
|
-
"[mcp-use] MCP middleware received an invalid downstream request"
|
|
587
|
-
);
|
|
588
|
-
}
|
|
589
|
-
return { ...request, params };
|
|
590
|
-
}
|
|
591
|
-
function createMcpMiddlewareEntry(pattern, handler) {
|
|
592
|
-
const normalizedPattern = normalizeMcpMiddlewarePattern(pattern);
|
|
593
|
-
const invoke = handler;
|
|
594
|
-
if (normalizedPattern !== "*" && !isMcpMiddlewareMethod(normalizedPattern)) {
|
|
595
|
-
throw new TypeError(
|
|
596
|
-
`Unsupported MCP middleware pattern "${pattern}". Use an exact MCP method or "mcp:*".`
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
if (normalizedPattern === "*") {
|
|
600
|
-
return {
|
|
601
|
-
pattern: normalizedPattern,
|
|
602
|
-
handler: async (ctx, next) => {
|
|
603
|
-
let downstreamCalled = false;
|
|
604
|
-
let downstreamResult;
|
|
605
|
-
await invoke(ctx, async () => {
|
|
606
|
-
downstreamResult = await next();
|
|
607
|
-
downstreamCalled = true;
|
|
608
|
-
});
|
|
609
|
-
if (!downstreamCalled) {
|
|
610
|
-
throw new Error(
|
|
611
|
-
`Wildcard MCP middleware "${normalizedPattern}" must call next()`
|
|
612
|
-
);
|
|
613
|
-
}
|
|
614
|
-
return downstreamResult;
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
return {
|
|
619
|
-
pattern: normalizedPattern,
|
|
620
|
-
handler: (ctx, next) => invoke(ctx, next)
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
function createMcpEventListenerEntry(pattern, handler) {
|
|
624
|
-
const { pattern: normalizedPattern, phase } = parseMcpPattern(pattern);
|
|
625
|
-
const invoke = handler;
|
|
626
|
-
return {
|
|
627
|
-
pattern: normalizedPattern,
|
|
628
|
-
phase,
|
|
629
|
-
handler: (ctx, result) => invoke(ctx, result)
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
function matchesPattern(pattern, method) {
|
|
633
|
-
if (pattern === "*") return true;
|
|
634
|
-
if (pattern.endsWith("/*")) {
|
|
635
|
-
const prefix = pattern.slice(0, -1);
|
|
636
|
-
return method.startsWith(prefix);
|
|
637
|
-
}
|
|
638
|
-
return pattern === method;
|
|
639
|
-
}
|
|
640
|
-
function isMcpMiddlewareMethod(value) {
|
|
641
|
-
return MCP_MIDDLEWARE_METHODS.some((method) => method === value);
|
|
642
|
-
}
|
|
643
|
-
function composeMiddleware(entries, method, innerFn) {
|
|
644
|
-
const matching = entries.filter(
|
|
645
|
-
(entry) => matchesPattern(entry.pattern, method)
|
|
646
|
-
);
|
|
647
|
-
if (matching.length === 0) {
|
|
648
|
-
return (_ctx) => innerFn();
|
|
649
|
-
}
|
|
650
|
-
return (ctx) => {
|
|
651
|
-
let index = -1;
|
|
652
|
-
const dispatch = (i) => {
|
|
653
|
-
if (i <= index) {
|
|
654
|
-
return Promise.reject(new Error("next() called multiple times"));
|
|
655
|
-
}
|
|
656
|
-
index = i;
|
|
657
|
-
if (i === matching.length) {
|
|
658
|
-
return innerFn();
|
|
659
|
-
}
|
|
660
|
-
const entry = matching[i];
|
|
661
|
-
return entry.handler(ctx, () => dispatch(i + 1));
|
|
662
|
-
};
|
|
663
|
-
return dispatch(0);
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
function freezeMiddlewareContext(ctx) {
|
|
667
|
-
return Object.freeze({
|
|
668
|
-
method: ctx.method,
|
|
669
|
-
params: Object.freeze({ ...ctx.params }),
|
|
670
|
-
...ctx.session !== void 0 && {
|
|
671
|
-
session: Object.freeze({ ...ctx.session })
|
|
672
|
-
},
|
|
673
|
-
...ctx.auth !== void 0 && { auth: ctx.auth },
|
|
674
|
-
state: new Map(ctx.state)
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
async function runMcpOperation(middlewares, events, method, ctx, innerFn) {
|
|
678
|
-
dispatchMcpEvents(events, method, "before", ctx);
|
|
679
|
-
const chained = composeMiddleware(middlewares, method, innerFn);
|
|
680
|
-
const result = await chained(ctx);
|
|
681
|
-
assertValidMiddlewareResult(method, result);
|
|
682
|
-
dispatchMcpEvents(events, method, "complete", ctx, result);
|
|
683
|
-
return result;
|
|
684
|
-
}
|
|
685
|
-
function assertValidMiddlewareResult(method, result) {
|
|
686
|
-
if ((method === "tools/call" || method === "resources/read" || method === "prompts/get") && isInputRequiredResult(result)) {
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
const validation = (() => {
|
|
690
|
-
switch (method) {
|
|
691
|
-
case "tools/call":
|
|
692
|
-
assertArrayProperty(method, result, "content");
|
|
693
|
-
return CallToolResultSchema.safeParse(result);
|
|
694
|
-
case "tools/list":
|
|
695
|
-
assertArrayResult(method, result);
|
|
696
|
-
return ListToolsResultSchema.safeParse({ tools: result });
|
|
697
|
-
case "resources/read":
|
|
698
|
-
assertArrayProperty(method, result, "contents");
|
|
699
|
-
return ReadResourceResultSchema.safeParse(result);
|
|
700
|
-
case "resources/list":
|
|
701
|
-
assertArrayResult(method, result);
|
|
702
|
-
return ListResourcesResultSchema.safeParse({ resources: result });
|
|
703
|
-
case "prompts/get":
|
|
704
|
-
assertArrayProperty(method, result, "messages");
|
|
705
|
-
return GetPromptResultSchema.safeParse(result);
|
|
706
|
-
case "prompts/list":
|
|
707
|
-
assertArrayResult(method, result);
|
|
708
|
-
return ListPromptsResultSchema.safeParse({ prompts: result });
|
|
709
|
-
default:
|
|
710
|
-
throw new TypeError(`Unsupported MCP middleware method "${method}"`);
|
|
711
|
-
}
|
|
712
|
-
})();
|
|
713
|
-
if (!validation.success) {
|
|
714
|
-
throw new TypeError(
|
|
715
|
-
`[mcp-use] ${method} middleware returned an invalid result: ${validation.error.message}`
|
|
716
|
-
);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
function assertArrayResult(method, result) {
|
|
720
|
-
if (!Array.isArray(result)) {
|
|
721
|
-
throw new TypeError(
|
|
722
|
-
`[mcp-use] ${method} middleware returned an invalid result: expected an array`
|
|
723
|
-
);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
function assertArrayProperty(method, result, property) {
|
|
727
|
-
if (typeof result !== "object" || result === null || !Array.isArray(result[property])) {
|
|
728
|
-
throw new TypeError(
|
|
729
|
-
`[mcp-use] ${method} middleware returned an invalid result: expected a ${property} array`
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
function dispatchMcpEvents(events, method, phase, ctx, result) {
|
|
734
|
-
const frozen = freezeMiddlewareContext(ctx);
|
|
735
|
-
for (const entry of events) {
|
|
736
|
-
if (entry.phase !== phase || !matchesPattern(entry.pattern, method)) {
|
|
737
|
-
continue;
|
|
738
|
-
}
|
|
739
|
-
try {
|
|
740
|
-
entry.handler(frozen, result);
|
|
741
|
-
} catch (error) {
|
|
742
|
-
console.error(
|
|
743
|
-
`[mcp-use] MCP event listener for "${entry.pattern}" (${phase}) threw:`,
|
|
744
|
-
error
|
|
745
|
-
);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
function parseMcpPattern(raw) {
|
|
750
|
-
const pattern = raw.startsWith("mcp:") ? raw.slice(4) : raw;
|
|
751
|
-
if (pattern.endsWith(":complete")) {
|
|
752
|
-
return {
|
|
753
|
-
pattern: pattern.slice(0, -":complete".length),
|
|
754
|
-
phase: "complete"
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
return { pattern, phase: "before" };
|
|
758
|
-
}
|
|
759
|
-
function normalizeMcpMiddlewarePattern(raw) {
|
|
760
|
-
return raw.startsWith("mcp:") ? raw.slice(4) : raw;
|
|
761
|
-
}
|
|
762
|
-
|
|
763
225
|
// src/inspector-shell.ts
|
|
764
226
|
var INSPECTOR_TAG = "beta";
|
|
765
227
|
var DEFAULT_INSPECTOR_ASSETS_URL = `https://cdn.jsdelivr.net/npm/@mcp-use/inspector@${INSPECTOR_TAG}/dist/cdn/inspector.js`;
|
|
766
228
|
function inspectorStylesUrl(assetsUrl) {
|
|
767
229
|
return assetsUrl.replace(/\.js(?=$|[?#])/, ".css");
|
|
768
230
|
}
|
|
769
|
-
function isDefaultJsdelivrInspectorUrl(url) {
|
|
770
|
-
return url.startsWith("https://cdn.jsdelivr.net/npm/@mcp-use/inspector@");
|
|
771
|
-
}
|
|
772
|
-
function withInspectorCacheBust(assetsUrl) {
|
|
773
|
-
if (!isDefaultJsdelivrInspectorUrl(assetsUrl)) return assetsUrl;
|
|
774
|
-
const sep = assetsUrl.includes("?") ? "&" : "?";
|
|
775
|
-
return `${assetsUrl}${sep}cb=${crypto.randomUUID()}`;
|
|
776
|
-
}
|
|
777
|
-
function matchesInspectorShellPath(pathname, basePath) {
|
|
778
|
-
const prefix = pathUnderBase(basePath, "inspector");
|
|
779
|
-
if (pathname !== prefix && !pathname.startsWith(`${prefix}/`)) {
|
|
780
|
-
return false;
|
|
781
|
-
}
|
|
782
|
-
const suffix = pathname.slice(prefix.length);
|
|
783
|
-
return suffix !== "/api" && !suffix.startsWith("/api/");
|
|
784
|
-
}
|
|
785
231
|
function escapeHtml(value) {
|
|
786
232
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
787
233
|
}
|
|
@@ -789,18 +235,10 @@ function serializeForInlineScript(value) {
|
|
|
789
235
|
return JSON.stringify(value).replaceAll("<", "\\u003c");
|
|
790
236
|
}
|
|
791
237
|
function renderInspectorShell(options) {
|
|
792
|
-
const {
|
|
793
|
-
serverName,
|
|
794
|
-
basePath,
|
|
795
|
-
faviconHref,
|
|
796
|
-
faviconType,
|
|
797
|
-
assetsUrl,
|
|
798
|
-
manufactChatUrl
|
|
799
|
-
} = options;
|
|
238
|
+
const { serverName, basePath, assetsUrl, manufactChatUrl } = options;
|
|
800
239
|
const serializedBasePath = serializeForInlineScript(basePath);
|
|
801
240
|
const serializedManufactChatUrl = manufactChatUrl ? serializeForInlineScript(manufactChatUrl) : null;
|
|
802
|
-
const
|
|
803
|
-
const bundleUrl = withInspectorCacheBust(rawUrl);
|
|
241
|
+
const bundleUrl = assetsUrl ?? DEFAULT_INSPECTOR_ASSETS_URL;
|
|
804
242
|
const scriptSrc = escapeHtml(bundleUrl);
|
|
805
243
|
const stylesHref = escapeHtml(inspectorStylesUrl(bundleUrl));
|
|
806
244
|
return `<!doctype html>
|
|
@@ -809,7 +247,6 @@ function renderInspectorShell(options) {
|
|
|
809
247
|
<meta charset="utf-8" />
|
|
810
248
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
811
249
|
<title>${escapeHtml(serverName)} \u2014 MCP Inspector</title>
|
|
812
|
-
${faviconHref !== void 0 ? `<link rel="icon"${faviconType !== void 0 ? ` type="${escapeHtml(faviconType)}"` : ""} href="${escapeHtml(faviconHref)}" />` : ""}
|
|
813
250
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
814
251
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
815
252
|
<link
|
|
@@ -820,65 +257,10 @@ function renderInspectorShell(options) {
|
|
|
820
257
|
<style>
|
|
821
258
|
:root { color-scheme: light dark; }
|
|
822
259
|
html, body { height: 100%; margin: 0; background-color: #f3f3f3; }
|
|
823
|
-
#root { height: 100%; }
|
|
824
|
-
.mcp-boot {
|
|
825
|
-
display: flex;
|
|
826
|
-
height: 100%;
|
|
827
|
-
align-items: center;
|
|
828
|
-
justify-content: center;
|
|
829
|
-
background-color: #f3f3f3;
|
|
830
|
-
}
|
|
831
|
-
.mcp-boot-inner {
|
|
832
|
-
display: flex;
|
|
833
|
-
flex-direction: column;
|
|
834
|
-
align-items: center;
|
|
835
|
-
gap: 16px;
|
|
836
|
-
}
|
|
837
|
-
.mcp-boot-spinner {
|
|
838
|
-
width: 32px;
|
|
839
|
-
height: 32px;
|
|
840
|
-
color: #52525b;
|
|
841
|
-
animation: mcp-boot-spin 1s linear infinite;
|
|
842
|
-
}
|
|
843
|
-
.mcp-boot-label {
|
|
844
|
-
margin: 0;
|
|
845
|
-
font-family: Ubuntu, sans-serif;
|
|
846
|
-
font-size: 0.875rem;
|
|
847
|
-
line-height: 1.25rem;
|
|
848
|
-
color: #52525b;
|
|
849
|
-
}
|
|
850
|
-
@keyframes mcp-boot-spin {
|
|
851
|
-
to { transform: rotate(360deg); }
|
|
852
|
-
}
|
|
853
|
-
@media (prefers-color-scheme: dark) {
|
|
854
|
-
html, body { background-color: #000; }
|
|
855
|
-
.mcp-boot { background-color: #000; }
|
|
856
|
-
.mcp-boot-spinner, .mcp-boot-label { color: #a1a1aa; }
|
|
857
|
-
}
|
|
858
260
|
</style>
|
|
859
261
|
</head>
|
|
860
262
|
<body>
|
|
861
|
-
<div id="root">
|
|
862
|
-
<div class="mcp-boot">
|
|
863
|
-
<div class="mcp-boot-inner">
|
|
864
|
-
<svg
|
|
865
|
-
class="mcp-boot-spinner"
|
|
866
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
867
|
-
viewBox="0 0 24 24"
|
|
868
|
-
fill="none"
|
|
869
|
-
stroke="currentColor"
|
|
870
|
-
stroke-width="2"
|
|
871
|
-
stroke-linecap="round"
|
|
872
|
-
stroke-linejoin="round"
|
|
873
|
-
role="status"
|
|
874
|
-
aria-label="Loading"
|
|
875
|
-
>
|
|
876
|
-
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
|
|
877
|
-
</svg>
|
|
878
|
-
<p class="mcp-boot-label">Connecting to MCP server...</p>
|
|
879
|
-
</div>
|
|
880
|
-
</div>
|
|
881
|
-
</div>
|
|
263
|
+
<div id="root"></div>
|
|
882
264
|
<script>
|
|
883
265
|
(function () {
|
|
884
266
|
var basePath = ${serializedBasePath};
|
|
@@ -890,7 +272,6 @@ function renderInspectorShell(options) {
|
|
|
890
272
|
};
|
|
891
273
|
// Read by the current inspector bundle to derive its own URLs.
|
|
892
274
|
window.__MCP_BASE_PATH__ = basePath;
|
|
893
|
-
${process.env.MCP_USE_DEV_CLI === "1" ? "window.__MCP_DEV_CLI__ = true;" : ""}
|
|
894
275
|
${serializedManufactChatUrl ? `window.__MANUFACT_CHAT_URL__ = ${serializedManufactChatUrl};` : ""}
|
|
895
276
|
// The bundle carries Node-flavored dependencies that touch \`process\`
|
|
896
277
|
// at module scope; give them the same browser polyfill the v1
|
|
@@ -923,27 +304,22 @@ function createInspectorHandler(inspector, options) {
|
|
|
923
304
|
const { assetsUrl: configAssetsUrl, manufactChatUrl: configManufactChatUrl } = inspector ?? {};
|
|
924
305
|
const assetsUrl = configAssetsUrl ?? process.env["MCP_USE_INSPECTOR_ASSETS_URL"] ?? void 0;
|
|
925
306
|
const manufactChatUrl = configManufactChatUrl ?? process.env["MANUFACT_CHAT_URL"] ?? void 0;
|
|
926
|
-
const
|
|
307
|
+
const html = renderInspectorShell({
|
|
927
308
|
serverName: options.serverName,
|
|
928
309
|
basePath: options.basePath,
|
|
929
|
-
...options.faviconHref !== void 0 && {
|
|
930
|
-
faviconHref: options.faviconHref
|
|
931
|
-
},
|
|
932
|
-
...options.faviconType !== void 0 && {
|
|
933
|
-
faviconType: options.faviconType
|
|
934
|
-
},
|
|
935
310
|
assetsUrl,
|
|
936
311
|
manufactChatUrl
|
|
937
|
-
};
|
|
312
|
+
});
|
|
313
|
+
const path = `${options.basePath}/inspector`;
|
|
314
|
+
const slashPath = `${path}/`;
|
|
938
315
|
return async (request) => {
|
|
939
316
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
940
317
|
return new Response("Method Not Allowed", { status: 405 });
|
|
941
318
|
}
|
|
942
319
|
const pathname = new URL(request.url).pathname;
|
|
943
|
-
if (
|
|
320
|
+
if (pathname !== path && pathname !== slashPath) {
|
|
944
321
|
return new Response("Not Found", { status: 404 });
|
|
945
322
|
}
|
|
946
|
-
const html = renderInspectorShell(shellOptions);
|
|
947
323
|
return new Response(request.method === "HEAD" ? null : html, {
|
|
948
324
|
status: 200,
|
|
949
325
|
headers: { "content-type": "text/html; charset=utf-8" }
|
|
@@ -1333,6 +709,9 @@ function createMcpMount(factory, options = {}) {
|
|
|
1333
709
|
};
|
|
1334
710
|
return { handler, fetch };
|
|
1335
711
|
}
|
|
712
|
+
function mountMcp(factory, options = {}) {
|
|
713
|
+
return createMcpMount(factory, options);
|
|
714
|
+
}
|
|
1336
715
|
|
|
1337
716
|
// src/tools.ts
|
|
1338
717
|
function resolveToolInputSchema(definition) {
|
|
@@ -1342,148 +721,117 @@ function resolveToolInputSchema(definition) {
|
|
|
1342
721
|
// src/views/register.ts
|
|
1343
722
|
var registerViews = /* @__PURE__ */ Symbol("mcp-use/registerViews");
|
|
1344
723
|
|
|
1345
|
-
// src/views/
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
};
|
|
1352
|
-
function parseDomainList(raw) {
|
|
1353
|
-
if (raw === void 0 || raw.trim() === "") {
|
|
1354
|
-
return [];
|
|
724
|
+
// src/views/document.ts
|
|
725
|
+
function resolveAssetUrl(assetPath, origin) {
|
|
726
|
+
if (!assetPath.startsWith("/")) {
|
|
727
|
+
throw new Error(
|
|
728
|
+
`View manifest asset path must be origin-absolute (start with "/"); got ${JSON.stringify(assetPath)}`
|
|
729
|
+
);
|
|
1355
730
|
}
|
|
1356
|
-
return
|
|
731
|
+
return `${origin}${assetPath}`;
|
|
1357
732
|
}
|
|
1358
|
-
function
|
|
1359
|
-
|
|
1360
|
-
return void 0;
|
|
1361
|
-
}
|
|
1362
|
-
const raw = process.env[name];
|
|
1363
|
-
if (raw === void 0 || raw.trim() === "") {
|
|
1364
|
-
return void 0;
|
|
1365
|
-
}
|
|
1366
|
-
return parseDomainList(raw);
|
|
733
|
+
function resolvePublicBase(origin, basePath) {
|
|
734
|
+
return `${origin}${basePath}/_mcp-use/public/`;
|
|
1367
735
|
}
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
736
|
+
function escapeInlineScript(code) {
|
|
737
|
+
return code.replaceAll(/<\/script/gi, "<\\/script").replaceAll("<!--", "\\x3C!--");
|
|
1370
738
|
}
|
|
1371
|
-
function
|
|
1372
|
-
|
|
1373
|
-
if (perCategory !== void 0) {
|
|
1374
|
-
return perCategory;
|
|
1375
|
-
}
|
|
1376
|
-
return readCspUrlsShortcut();
|
|
739
|
+
function escapeInlineStyle(css) {
|
|
740
|
+
return css.replaceAll(/<\/style/gi, "<\\/style");
|
|
1377
741
|
}
|
|
1378
|
-
function
|
|
1379
|
-
|
|
1380
|
-
const out = [];
|
|
1381
|
-
for (const segment of segments) {
|
|
1382
|
-
for (const domain of segment) {
|
|
1383
|
-
if (!seen.has(domain)) {
|
|
1384
|
-
seen.add(domain);
|
|
1385
|
-
out.push(domain);
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
return out;
|
|
742
|
+
function escapeHtml2(value) {
|
|
743
|
+
return value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">");
|
|
1390
744
|
}
|
|
1391
|
-
function
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
745
|
+
function synthesizeViewDocument(entry, origin, basePath) {
|
|
746
|
+
const viewConfig = {
|
|
747
|
+
publicBase: resolvePublicBase(origin, basePath)
|
|
748
|
+
};
|
|
749
|
+
const configScript = `<script>globalThis.__mcpUseViewConfig=${JSON.stringify(viewConfig)};</script>`;
|
|
750
|
+
if (entry.kind === "inline") {
|
|
751
|
+
const styleTag = entry.css.length > 0 ? `<style>${escapeInlineStyle(entry.css)}</style>` : "";
|
|
752
|
+
const moduleScript = `<script type="module">${escapeInlineScript(entry.js)}</script>`;
|
|
753
|
+
return `<!doctype html>
|
|
754
|
+
<html>
|
|
755
|
+
<head>
|
|
756
|
+
<meta charset="utf-8">
|
|
757
|
+
${configScript}
|
|
758
|
+
${styleTag}
|
|
759
|
+
</head>
|
|
760
|
+
<body>
|
|
761
|
+
<div id="root"></div>
|
|
762
|
+
${moduleScript}
|
|
763
|
+
</body>
|
|
764
|
+
</html>`;
|
|
765
|
+
}
|
|
766
|
+
const cssLinks = entry.css.map(
|
|
767
|
+
(path) => `<link rel="stylesheet" href="${escapeHtml2(resolveAssetUrl(path, origin))}">`
|
|
768
|
+
).join("\n");
|
|
769
|
+
const scriptTags = (entry.scripts ?? []).map(
|
|
770
|
+
(path) => `<script type="module" src="${escapeHtml2(resolveAssetUrl(path, origin))}"></script>`
|
|
771
|
+
).join("\n");
|
|
772
|
+
const entryUrl = resolveAssetUrl(entry.entry, origin);
|
|
773
|
+
return `<!doctype html>
|
|
774
|
+
<html>
|
|
775
|
+
<head>
|
|
776
|
+
<meta charset="utf-8">
|
|
777
|
+
${configScript}
|
|
778
|
+
${cssLinks}
|
|
779
|
+
</head>
|
|
780
|
+
<body>
|
|
781
|
+
<div id="root"></div>
|
|
782
|
+
${scriptTags}
|
|
783
|
+
<script type="module" src="${escapeHtml2(entryUrl)}"></script>
|
|
784
|
+
</body>
|
|
785
|
+
</html>`;
|
|
1399
786
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
787
|
+
|
|
788
|
+
// src/views/origin.ts
|
|
789
|
+
function resolveRequestOrigin(request) {
|
|
790
|
+
const forwarded = request.headers.get("forwarded");
|
|
791
|
+
if (forwarded !== null) {
|
|
792
|
+
const fromForwarded = parseForwardedHeader(forwarded);
|
|
793
|
+
if (fromForwarded !== void 0) {
|
|
794
|
+
return fromForwarded;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
const proto = request.headers.get("x-forwarded-proto");
|
|
798
|
+
const host = request.headers.get("x-forwarded-host");
|
|
799
|
+
if (proto !== null && host !== null) {
|
|
800
|
+
const firstHost = host.split(",")[0]?.trim();
|
|
801
|
+
const firstProto = proto.split(",")[0]?.trim();
|
|
802
|
+
if (firstHost !== void 0 && firstProto !== void 0 && firstHost !== "") {
|
|
803
|
+
return `${firstProto}://${firstHost}`;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return new URL(request.url).origin;
|
|
807
|
+
}
|
|
808
|
+
function parseForwardedHeader(header) {
|
|
809
|
+
for (const part of header.split(",")) {
|
|
810
|
+
const params = /* @__PURE__ */ new Map();
|
|
811
|
+
for (const token of part.split(";")) {
|
|
812
|
+
const [key, ...rest] = token.trim().split("=");
|
|
813
|
+
if (key === void 0 || rest.length === 0) {
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
params.set(key.toLowerCase(), rest.join("=").replace(/^"|"$/g, ""));
|
|
817
|
+
}
|
|
818
|
+
const proto = params.get("proto");
|
|
819
|
+
const host = params.get("host");
|
|
820
|
+
if (proto !== void 0 && host !== void 0) {
|
|
821
|
+
return `${proto}://${host}`;
|
|
1407
822
|
}
|
|
1408
823
|
}
|
|
1409
|
-
|
|
1410
|
-
const resourceOrigin = options.explicitAssetsBase ? options.assetsOrigin : options.serverOrigin;
|
|
1411
|
-
if (resourceOrigin !== "") {
|
|
1412
|
-
mcpResourceAuto.push(resourceOrigin);
|
|
1413
|
-
}
|
|
1414
|
-
const connectDomains = mergeDomainLists(
|
|
1415
|
-
author?.connectDomains ?? [],
|
|
1416
|
-
readEnvDomainsForCategory("connectDomains"),
|
|
1417
|
-
mcpConnectAuto
|
|
1418
|
-
);
|
|
1419
|
-
const resourceDomains = mergeDomainLists(
|
|
1420
|
-
author?.resourceDomains ?? [],
|
|
1421
|
-
readEnvDomainsForCategory("resourceDomains"),
|
|
1422
|
-
mcpResourceAuto
|
|
1423
|
-
);
|
|
1424
|
-
const frameDomains = mergeDomainLists(
|
|
1425
|
-
author?.frameDomains ?? [],
|
|
1426
|
-
readEnvDomainsForCategory("frameDomains")
|
|
1427
|
-
);
|
|
1428
|
-
const baseUriDomains = mergeDomainLists(
|
|
1429
|
-
author?.baseUriDomains ?? [],
|
|
1430
|
-
readEnvDomainsForCategory("baseUriDomains")
|
|
1431
|
-
);
|
|
1432
|
-
return {
|
|
1433
|
-
...author,
|
|
1434
|
-
connectDomains,
|
|
1435
|
-
resourceDomains,
|
|
1436
|
-
frameDomains,
|
|
1437
|
-
baseUriDomains
|
|
1438
|
-
};
|
|
824
|
+
return void 0;
|
|
1439
825
|
}
|
|
1440
826
|
|
|
1441
827
|
// src/views/routes.ts
|
|
1442
828
|
var PUBLIC_BUILD_DIR = ".mcp-use/build/views/public";
|
|
1443
829
|
var PUBLIC_DEV_DIR = "public";
|
|
1444
|
-
var VIEW_ASSETS_BUILD_ROOT = ".mcp-use/build/views";
|
|
1445
|
-
function createViewAssetsHandler(basePath, views, options) {
|
|
1446
|
-
if (views.size === 0) {
|
|
1447
|
-
return void 0;
|
|
1448
|
-
}
|
|
1449
|
-
const assetsPrefix = pathUnderBase(basePath, "_mcp-use/views");
|
|
1450
|
-
const projectRoot = options?.projectRoot ?? process.cwd();
|
|
1451
|
-
return async (request) => {
|
|
1452
|
-
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
1453
|
-
return new Response("Method Not Allowed", { status: 405 });
|
|
1454
|
-
}
|
|
1455
|
-
if (!matchesPathPrefix(request, assetsPrefix)) {
|
|
1456
|
-
return new Response("Not Found", { status: 404 });
|
|
1457
|
-
}
|
|
1458
|
-
const pathname = pathnameOf(request);
|
|
1459
|
-
const remainder = pathname.slice(assetsPrefix.length + 1);
|
|
1460
|
-
const slash = remainder.indexOf("/");
|
|
1461
|
-
if (slash <= 0 || slash === remainder.length - 1) {
|
|
1462
|
-
return new Response("Not Found", { status: 404 });
|
|
1463
|
-
}
|
|
1464
|
-
const viewName = remainder.slice(0, slash);
|
|
1465
|
-
const subpath = remainder.slice(slash + 1);
|
|
1466
|
-
const entry = views.get(viewName);
|
|
1467
|
-
if (entry === void 0 || entry.kind !== "external") {
|
|
1468
|
-
return new Response("Not Found", { status: 404 });
|
|
1469
|
-
}
|
|
1470
|
-
const [{ join }, { resolvePublicFilePath: resolvePublicFilePath2, servePublicFile: servePublicFile2 }] = await Promise.all([import("path"), import("./public-route-5JEGFEIN.js")]);
|
|
1471
|
-
const viewRoot = join(projectRoot, VIEW_ASSETS_BUILD_ROOT, viewName);
|
|
1472
|
-
const diskPath = await resolvePublicFilePath2(viewRoot, subpath);
|
|
1473
|
-
if (diskPath === null) {
|
|
1474
|
-
return new Response("Not Found", { status: 404 });
|
|
1475
|
-
}
|
|
1476
|
-
return await servePublicFile2(diskPath, {
|
|
1477
|
-
...options?.deferCors === true && { deferCors: true },
|
|
1478
|
-
...request.method === "HEAD" && { head: true }
|
|
1479
|
-
});
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
830
|
function createViewPublicHandler(basePath, views, options) {
|
|
1483
|
-
if (views.size === 0
|
|
831
|
+
if (views.size === 0) {
|
|
1484
832
|
return void 0;
|
|
1485
833
|
}
|
|
1486
|
-
const publicPrefix =
|
|
834
|
+
const publicPrefix = `${basePath}/_mcp-use/public`;
|
|
1487
835
|
const subdir = options?.dev === true ? PUBLIC_DEV_DIR : PUBLIC_BUILD_DIR;
|
|
1488
836
|
const projectRoot = options?.projectRoot ?? process.cwd();
|
|
1489
837
|
return async (request) => {
|
|
@@ -1494,53 +842,34 @@ function createViewPublicHandler(basePath, views, options) {
|
|
|
1494
842
|
return new Response("Not Found", { status: 404 });
|
|
1495
843
|
}
|
|
1496
844
|
const pathname = pathnameOf(request);
|
|
1497
|
-
const
|
|
1498
|
-
let subpath;
|
|
1499
|
-
try {
|
|
1500
|
-
subpath = decodeURIComponent(encodedSubpath);
|
|
1501
|
-
} catch {
|
|
1502
|
-
return new Response("Not Found", { status: 404 });
|
|
1503
|
-
}
|
|
845
|
+
const subpath = pathname.slice(publicPrefix.length + 1);
|
|
1504
846
|
if (subpath.length === 0) {
|
|
1505
847
|
return new Response("Not Found", { status: 404 });
|
|
1506
848
|
}
|
|
1507
|
-
const [{ join }, { resolvePublicFilePath
|
|
849
|
+
const [{ join }, { resolvePublicFilePath, servePublicFile }] = await Promise.all([import("path"), import("./public-route-7IK5D7V7.js")]);
|
|
1508
850
|
const publicRoot = join(projectRoot, subdir);
|
|
1509
|
-
const diskPath = await
|
|
851
|
+
const diskPath = await resolvePublicFilePath(publicRoot, subpath);
|
|
1510
852
|
if (diskPath === null) {
|
|
1511
853
|
return new Response("Not Found", { status: 404 });
|
|
1512
854
|
}
|
|
1513
|
-
return await
|
|
1514
|
-
...options?.deferCors === true && { deferCors: true },
|
|
1515
|
-
...request.method === "HEAD" && { head: true }
|
|
1516
|
-
});
|
|
855
|
+
return await servePublicFile(diskPath);
|
|
1517
856
|
};
|
|
1518
857
|
}
|
|
1519
858
|
|
|
1520
859
|
// src/views/wire.ts
|
|
1521
|
-
function buildToolUiMeta(viewName, visibility
|
|
1522
|
-
if (viewName === void 0 && visibility === void 0
|
|
860
|
+
function buildToolUiMeta(viewName, visibility) {
|
|
861
|
+
if (viewName === void 0 && visibility === void 0) {
|
|
1523
862
|
return void 0;
|
|
1524
863
|
}
|
|
1525
|
-
const
|
|
1526
|
-
const
|
|
1527
|
-
const existingUiIsObject = typeof existingUi === "object" && existingUi !== null && !Array.isArray(existingUi);
|
|
1528
|
-
const ui = existingUiIsObject ? { ...existingUi } : {};
|
|
864
|
+
const ui = {};
|
|
865
|
+
const meta = { [UI_META_KEY]: ui };
|
|
1529
866
|
if (viewName !== void 0) {
|
|
1530
867
|
const resourceUri = viewResourceUri(viewName);
|
|
1531
868
|
ui["resourceUri"] = resourceUri;
|
|
1532
869
|
meta[UI_RESOURCE_URI_META_KEY] = resourceUri;
|
|
1533
|
-
} else {
|
|
1534
|
-
delete ui["resourceUri"];
|
|
1535
|
-
delete meta[UI_RESOURCE_URI_META_KEY];
|
|
1536
870
|
}
|
|
1537
871
|
if (visibility !== void 0) {
|
|
1538
872
|
ui["visibility"] = [visibility];
|
|
1539
|
-
} else {
|
|
1540
|
-
delete ui["visibility"];
|
|
1541
|
-
}
|
|
1542
|
-
if (viewName !== void 0 || visibility !== void 0 || existingUiIsObject) {
|
|
1543
|
-
meta[UI_META_KEY] = ui;
|
|
1544
873
|
}
|
|
1545
874
|
return meta;
|
|
1546
875
|
}
|
|
@@ -1551,20 +880,36 @@ function buildToolResultUiMeta(viewName) {
|
|
|
1551
880
|
[UI_RESOURCE_URI_META_KEY]: resourceUri
|
|
1552
881
|
};
|
|
1553
882
|
}
|
|
1554
|
-
function
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
...options?.hmrWs === true ? { hmrWs: true } : {}
|
|
1563
|
-
};
|
|
883
|
+
function toWebSocketOrigin(servingOrigin) {
|
|
884
|
+
if (servingOrigin.startsWith("https://")) {
|
|
885
|
+
return `wss://${servingOrigin.slice("https://".length)}`;
|
|
886
|
+
}
|
|
887
|
+
if (servingOrigin.startsWith("http://")) {
|
|
888
|
+
return `ws://${servingOrigin.slice("http://".length)}`;
|
|
889
|
+
}
|
|
890
|
+
return servingOrigin;
|
|
1564
891
|
}
|
|
1565
|
-
function buildResourceUiMeta(authorFacts, options) {
|
|
1566
|
-
const
|
|
1567
|
-
const
|
|
892
|
+
function buildResourceUiMeta(authorFacts, servingOrigin, options) {
|
|
893
|
+
const authorResourceDomains = authorFacts?.csp?.resourceDomains ?? [];
|
|
894
|
+
const resourceDomains = [
|
|
895
|
+
...authorResourceDomains,
|
|
896
|
+
...servingOrigin !== "" ? [servingOrigin] : []
|
|
897
|
+
];
|
|
898
|
+
const authorConnectDomains = authorFacts?.csp?.connectDomains ?? [];
|
|
899
|
+
const connectDomains = [...authorConnectDomains];
|
|
900
|
+
if (options?.hmrWs === true && servingOrigin !== "") {
|
|
901
|
+
const wsOrigin = toWebSocketOrigin(servingOrigin);
|
|
902
|
+
if (!connectDomains.includes(wsOrigin)) {
|
|
903
|
+
connectDomains.push(wsOrigin);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
const ui = {
|
|
907
|
+
csp: {
|
|
908
|
+
...authorFacts?.csp,
|
|
909
|
+
connectDomains,
|
|
910
|
+
resourceDomains
|
|
911
|
+
}
|
|
912
|
+
};
|
|
1568
913
|
if (authorFacts?.permissions !== void 0) {
|
|
1569
914
|
ui["permissions"] = authorFacts.permissions;
|
|
1570
915
|
}
|
|
@@ -1576,35 +921,19 @@ function buildResourceUiMeta(authorFacts, options) {
|
|
|
1576
921
|
}
|
|
1577
922
|
return { [UI_META_KEY]: ui };
|
|
1578
923
|
}
|
|
1579
|
-
function viewResourceConfig(_viewName, _entry, authorFacts, options) {
|
|
924
|
+
function viewResourceConfig(_viewName, _entry, authorFacts, servingOrigin, options) {
|
|
1580
925
|
return {
|
|
1581
926
|
mimeType: UI_MIME_TYPE,
|
|
1582
927
|
...authorFacts?.description !== void 0 && {
|
|
1583
928
|
description: authorFacts.description
|
|
1584
929
|
},
|
|
1585
|
-
_meta: buildResourceUiMeta(authorFacts, options)
|
|
930
|
+
_meta: buildResourceUiMeta(authorFacts, servingOrigin, options)
|
|
1586
931
|
};
|
|
1587
932
|
}
|
|
1588
933
|
|
|
1589
934
|
// src/server.ts
|
|
1590
|
-
function omitRootSchemaDialect(schema) {
|
|
1591
|
-
if (typeof schema !== "object" || schema === null || Array.isArray(schema) || !("$schema" in schema)) {
|
|
1592
|
-
return schema;
|
|
1593
|
-
}
|
|
1594
|
-
const emittedSchema = { ...schema };
|
|
1595
|
-
delete emittedSchema["$schema"];
|
|
1596
|
-
return emittedSchema;
|
|
1597
|
-
}
|
|
1598
|
-
function omitToolSchemaDialects(tools) {
|
|
1599
|
-
return tools.map((tool) => ({
|
|
1600
|
-
...tool,
|
|
1601
|
-
inputSchema: omitRootSchemaDialect(tool.inputSchema),
|
|
1602
|
-
...tool.outputSchema === void 0 ? {} : { outputSchema: omitRootSchemaDialect(tool.outputSchema) }
|
|
1603
|
-
}));
|
|
1604
|
-
}
|
|
1605
935
|
var MCPServer = class _MCPServer {
|
|
1606
936
|
#config;
|
|
1607
|
-
#branding;
|
|
1608
937
|
#tools = /* @__PURE__ */ new Map();
|
|
1609
938
|
#resources = /* @__PURE__ */ new Map();
|
|
1610
939
|
#resourceTemplates = /* @__PURE__ */ new Map();
|
|
@@ -1629,14 +958,6 @@ var MCPServer = class _MCPServer {
|
|
|
1629
958
|
#oauthResourceConfigurationAbsent = false;
|
|
1630
959
|
/** Whether the mounted app validates Host headers (fixed at first mount). */
|
|
1631
960
|
#hostValidated = false;
|
|
1632
|
-
#mcpMiddlewares = [];
|
|
1633
|
-
#mcpEventListeners = [];
|
|
1634
|
-
/** Client instances created by {@link MCPServer.proxy} and owned by this server. */
|
|
1635
|
-
#proxyOwners = [];
|
|
1636
|
-
/** Proxy registrations that {@link close} must let finish before cleanup. */
|
|
1637
|
-
#proxyOperations = /* @__PURE__ */ new Set();
|
|
1638
|
-
/** Whether terminal shutdown has begun. */
|
|
1639
|
-
#closed = false;
|
|
1640
961
|
/**
|
|
1641
962
|
* Create an MCP server from a parsed, bundled OpenAPI document.
|
|
1642
963
|
*
|
|
@@ -1676,7 +997,6 @@ var MCPServer = class _MCPServer {
|
|
|
1676
997
|
constructor(config) {
|
|
1677
998
|
assertServerConfig(config);
|
|
1678
999
|
this.#config = config;
|
|
1679
|
-
this.#branding = normalizeServerBranding(config);
|
|
1680
1000
|
if (config.oauth !== void 0) {
|
|
1681
1001
|
const mcpUrl = typeof process === "undefined" ? void 0 : process.env["MCP_URL"];
|
|
1682
1002
|
const resource = resolveConfiguredOAuthResource({
|
|
@@ -1699,24 +1019,6 @@ var MCPServer = class _MCPServer {
|
|
|
1699
1019
|
get basePath() {
|
|
1700
1020
|
return this.#basePath();
|
|
1701
1021
|
}
|
|
1702
|
-
/**
|
|
1703
|
-
* Immutable normalized branding shared by MCP identity and browser pages.
|
|
1704
|
-
*
|
|
1705
|
-
* `favicon` is the final source after explicit-favicon and icon-selection
|
|
1706
|
-
* precedence. Landing-page integrations can use this accessor and link to
|
|
1707
|
-
* the server's root-level `/favicon.ico` route without reading private
|
|
1708
|
-
* configuration or depending on the inspector/view layers.
|
|
1709
|
-
*
|
|
1710
|
-
* @example
|
|
1711
|
-
* ```ts
|
|
1712
|
-
* if (server.branding.favicon) {
|
|
1713
|
-
* console.log("Browser favicon: /favicon.ico");
|
|
1714
|
-
* }
|
|
1715
|
-
* ```
|
|
1716
|
-
*/
|
|
1717
|
-
get branding() {
|
|
1718
|
-
return this.#branding;
|
|
1719
|
-
}
|
|
1720
1022
|
/**
|
|
1721
1023
|
* Register a tool. Input is validated against `inputSchema` before the callback
|
|
1722
1024
|
* runs; results carrying `structuredContent` are type-checked against
|
|
@@ -1796,10 +1098,8 @@ var MCPServer = class _MCPServer {
|
|
|
1796
1098
|
*/
|
|
1797
1099
|
resourceTemplate(definition, callback) {
|
|
1798
1100
|
this.#assertNotStarted("resourceTemplate", definition.name);
|
|
1799
|
-
const complete = definition.complete === void 0 ? void 0 : normalizeCompletions(definition.complete);
|
|
1800
1101
|
this.#resourceTemplates.set(definition.name, {
|
|
1801
1102
|
definition,
|
|
1802
|
-
...complete !== void 0 && { complete },
|
|
1803
1103
|
callback
|
|
1804
1104
|
});
|
|
1805
1105
|
return this;
|
|
@@ -1816,23 +1116,6 @@ var MCPServer = class _MCPServer {
|
|
|
1816
1116
|
});
|
|
1817
1117
|
return this;
|
|
1818
1118
|
}
|
|
1819
|
-
async proxy(input) {
|
|
1820
|
-
this.#assertOpen("proxy()");
|
|
1821
|
-
const operation = (async () => {
|
|
1822
|
-
const { isProxyConnection, mountProxyConnection, mountProxyServers } = await import("./proxy-DJYWGTGX.js");
|
|
1823
|
-
if (isProxyConnection(input)) {
|
|
1824
|
-
await mountProxyConnection(this.#proxyHost(), input);
|
|
1825
|
-
return;
|
|
1826
|
-
}
|
|
1827
|
-
await mountProxyServers(this.#proxyHost(), input);
|
|
1828
|
-
})();
|
|
1829
|
-
this.#proxyOperations.add(operation);
|
|
1830
|
-
try {
|
|
1831
|
-
await operation;
|
|
1832
|
-
} finally {
|
|
1833
|
-
this.#proxyOperations.delete(operation);
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
1119
|
/**
|
|
1837
1120
|
* Web-standard request handler for the whole app (MCP endpoint included) —
|
|
1838
1121
|
* usable directly on serverless/edge runtimes or in tests.
|
|
@@ -1856,68 +1139,8 @@ var MCPServer = class _MCPServer {
|
|
|
1856
1139
|
* ```
|
|
1857
1140
|
*/
|
|
1858
1141
|
getHandler(options = {}) {
|
|
1859
|
-
this.#assertOpen("getHandler()");
|
|
1860
1142
|
const { fetch } = this.#ensureMounted("handler", void 0, options.bus);
|
|
1861
|
-
return
|
|
1862
|
-
}
|
|
1863
|
-
/**
|
|
1864
|
-
* Node `(req, res) => void` handler for composing with an existing
|
|
1865
|
-
* `http.Server`. Uses the same internal `toNodeHandler` bridge as
|
|
1866
|
-
* {@link MCPServer.listen}; MCPServer users do not need to import
|
|
1867
|
-
* `mcp-use/node`.
|
|
1868
|
-
*
|
|
1869
|
-
* @example
|
|
1870
|
-
* ```ts
|
|
1871
|
-
* import { createServer } from "node:http";
|
|
1872
|
-
* const httpServer = createServer(await server.getNodeHandler());
|
|
1873
|
-
* httpServer.listen(3000);
|
|
1874
|
-
* ```
|
|
1875
|
-
*/
|
|
1876
|
-
async getNodeHandler() {
|
|
1877
|
-
const { fetch } = this.#ensureMounted("handler");
|
|
1878
|
-
const { toNodeHandler } = await import("./node-bridge.js");
|
|
1879
|
-
return toNodeHandler({ fetch });
|
|
1880
|
-
}
|
|
1881
|
-
/**
|
|
1882
|
-
* Register MCP operation middleware that intercepts JSON-RPC dispatch.
|
|
1883
|
-
*
|
|
1884
|
-
* Patterns use an `mcp:` prefix (for example `mcp:tools/call`, `mcp:*`).
|
|
1885
|
-
* Exact methods may transform their typed result. The global `mcp:*` pattern
|
|
1886
|
-
* is pass-through middleware. Middleware runs in registration order; call
|
|
1887
|
-
* `next()` to continue the chain.
|
|
1888
|
-
*
|
|
1889
|
-
* @example
|
|
1890
|
-
* ```ts
|
|
1891
|
-
* server.use("mcp:tools/call", async (ctx, next) => {
|
|
1892
|
-
* console.log(`Calling tool: ${ctx.params.name}`);
|
|
1893
|
-
* return next();
|
|
1894
|
-
* });
|
|
1895
|
-
* ```
|
|
1896
|
-
*/
|
|
1897
|
-
use(pattern, handler) {
|
|
1898
|
-
this.#assertNotStarted("middleware", pattern);
|
|
1899
|
-
this.#mcpMiddlewares.push(createMcpMiddlewareEntry(pattern, handler));
|
|
1900
|
-
return this;
|
|
1901
|
-
}
|
|
1902
|
-
/**
|
|
1903
|
-
* Register a read-only MCP observer. Unlike {@link MCPServer.use}, listeners
|
|
1904
|
-
* cannot block, override, or mutate params. Throwing is logged and does not
|
|
1905
|
-
* fail the request.
|
|
1906
|
-
*
|
|
1907
|
-
* Append `:complete` to run after the handler (for example
|
|
1908
|
-
* `mcp:tools/call:complete`).
|
|
1909
|
-
*
|
|
1910
|
-
* @example
|
|
1911
|
-
* ```ts
|
|
1912
|
-
* server.on("mcp:tools/call", (ctx) => {
|
|
1913
|
-
* metrics.increment("tools.call", { tool: ctx.params.name });
|
|
1914
|
-
* });
|
|
1915
|
-
* ```
|
|
1916
|
-
*/
|
|
1917
|
-
on(pattern, handler) {
|
|
1918
|
-
this.#assertNotStarted("event listener", pattern);
|
|
1919
|
-
this.#mcpEventListeners.push(createMcpEventListenerEntry(pattern, handler));
|
|
1920
|
-
return this;
|
|
1143
|
+
return fetch;
|
|
1921
1144
|
}
|
|
1922
1145
|
/**
|
|
1923
1146
|
* Publish a tools-list change to v2 clients with active subscriptions.
|
|
@@ -1969,8 +1192,9 @@ var MCPServer = class _MCPServer {
|
|
|
1969
1192
|
* Serve over HTTP on Node. Pass port `0` for an ephemeral port.
|
|
1970
1193
|
*
|
|
1971
1194
|
* Binds `config.host` (default `127.0.0.1`). Localhost-class binds get
|
|
1972
|
-
* DNS-rebinding
|
|
1973
|
-
*
|
|
1195
|
+
* DNS-rebinding protection automatically: `Host` on every request,
|
|
1196
|
+
* `Origin` only on non-GET/HEAD (sandboxed view iframes send
|
|
1197
|
+
* `Origin: null` on asset GETs). To serve publicly set `host: "0.0.0.0"`;
|
|
1974
1198
|
* behind a platform edge that is all that's needed, and `allowedHosts`
|
|
1975
1199
|
* restricts direct exposure (additive — localhost-class values stay allowed).
|
|
1976
1200
|
*
|
|
@@ -1984,7 +1208,6 @@ var MCPServer = class _MCPServer {
|
|
|
1984
1208
|
* already mounted the app without Host validation.
|
|
1985
1209
|
*/
|
|
1986
1210
|
async listen(port = 3e3) {
|
|
1987
|
-
this.#assertOpen("listen()");
|
|
1988
1211
|
this.#assertListenOAuthConfiguration();
|
|
1989
1212
|
const { createServer } = await import("http");
|
|
1990
1213
|
const { toNodeHandler } = await import("./node-bridge.js");
|
|
@@ -2049,42 +1272,14 @@ var MCPServer = class _MCPServer {
|
|
|
2049
1272
|
* instance to serve again.
|
|
2050
1273
|
*/
|
|
2051
1274
|
async close() {
|
|
2052
|
-
this.#
|
|
2053
|
-
await Promise.allSettled([...this.#proxyOperations]);
|
|
2054
|
-
const errors = [];
|
|
2055
|
-
const proxyOwners = this.#proxyOwners.splice(0);
|
|
2056
|
-
const ownerResults = await Promise.allSettled(
|
|
2057
|
-
proxyOwners.map((owner) => owner.close())
|
|
2058
|
-
);
|
|
2059
|
-
for (const result of ownerResults) {
|
|
2060
|
-
if (result.status === "rejected") errors.push(result.reason);
|
|
2061
|
-
}
|
|
2062
|
-
try {
|
|
2063
|
-
await this.#handler?.close();
|
|
2064
|
-
} catch (error) {
|
|
2065
|
-
errors.push(error);
|
|
2066
|
-
}
|
|
1275
|
+
await this.#handler?.close();
|
|
2067
1276
|
const httpServer = this.#httpServer;
|
|
2068
1277
|
if (httpServer !== void 0) {
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
this.#httpServer = void 0;
|
|
2074
|
-
} catch (error) {
|
|
2075
|
-
errors.push(error);
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
if (errors.length > 0) {
|
|
2079
|
-
throw new AggregateError(errors, "Failed to close MCP server cleanly");
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
#assertOpen(operation) {
|
|
2083
|
-
if (!this.#closed) return;
|
|
2084
|
-
if (operation !== void 0) {
|
|
2085
|
-
throw new Error(`Cannot call ${operation} after the server has closed.`);
|
|
1278
|
+
await new Promise((resolve, reject) => {
|
|
1279
|
+
httpServer.close((err) => err ? reject(err) : resolve());
|
|
1280
|
+
});
|
|
1281
|
+
this.#httpServer = void 0;
|
|
2086
1282
|
}
|
|
2087
|
-
throw new Error("Cannot use the server after it has closed.");
|
|
2088
1283
|
}
|
|
2089
1284
|
#basePath() {
|
|
2090
1285
|
return this.#config.basePath ?? "/mcp";
|
|
@@ -2131,79 +1326,40 @@ var MCPServer = class _MCPServer {
|
|
|
2131
1326
|
);
|
|
2132
1327
|
}
|
|
2133
1328
|
}
|
|
2134
|
-
#proxyHost() {
|
|
2135
|
-
return {
|
|
2136
|
-
isStarted: () => this.#handler !== void 0,
|
|
2137
|
-
hasTool: (name) => this.#tools.has(name),
|
|
2138
|
-
hasResource: (name) => this.#resources.has(name),
|
|
2139
|
-
hasPrompt: (name) => this.#prompts.has(name),
|
|
2140
|
-
registerTool: (definition, callback) => {
|
|
2141
|
-
this.#assertNotStarted("tool", definition.name);
|
|
2142
|
-
this.#tools.set(definition.name, {
|
|
2143
|
-
definition,
|
|
2144
|
-
callback
|
|
2145
|
-
});
|
|
2146
|
-
},
|
|
2147
|
-
registerResource: (definition, callback) => {
|
|
2148
|
-
this.#assertNotStarted("resource", definition.name);
|
|
2149
|
-
this.#resources.set(definition.name, {
|
|
2150
|
-
definition,
|
|
2151
|
-
callback
|
|
2152
|
-
});
|
|
2153
|
-
},
|
|
2154
|
-
registerPrompt: (definition, callback) => {
|
|
2155
|
-
this.#assertNotStarted("prompt", definition.name);
|
|
2156
|
-
this.#prompts.set(definition.name, {
|
|
2157
|
-
definition,
|
|
2158
|
-
callback
|
|
2159
|
-
});
|
|
2160
|
-
},
|
|
2161
|
-
trackOwner: (owner) => {
|
|
2162
|
-
this.#proxyOwners.push(owner);
|
|
2163
|
-
}
|
|
2164
|
-
};
|
|
2165
|
-
}
|
|
2166
1329
|
/**
|
|
2167
1330
|
* Effective Host/Origin allowlists for a mount mode; `undefined` means the
|
|
2168
1331
|
* corresponding validation is off.
|
|
2169
1332
|
*
|
|
2170
1333
|
* Configured lists are additive to the localhost-class allowlists, so local
|
|
2171
1334
|
* runs keep working when a deployment hostname is added. With nothing
|
|
2172
|
-
* configured, `listen()` on a localhost-class bind validates
|
|
1335
|
+
* configured, `listen()` on a localhost-class bind validates against the
|
|
2173
1336
|
* localhost lists (the DNS-rebinding threat model), while `getHandler()` —
|
|
2174
|
-
* which never binds — applies no validation.
|
|
2175
|
-
*
|
|
2176
|
-
*
|
|
1337
|
+
* which never binds — applies no validation. `allowedOrigins` defaults to
|
|
1338
|
+
* mirroring the effective Host allowlist. Origin validation runs only on
|
|
1339
|
+
* non-GET/HEAD requests.
|
|
2177
1340
|
*/
|
|
2178
1341
|
#validationPolicy(mode) {
|
|
2179
1342
|
const { host = "127.0.0.1", allowedHosts, allowedOrigins } = this.#config;
|
|
2180
1343
|
const localhostBind = ["127.0.0.1", "localhost", "::1"].includes(host);
|
|
2181
1344
|
const hosts = allowedHosts !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedHostnames(), ...allowedHosts])] : mode === "listen" && localhostBind ? localhostAllowedHostnames() : void 0;
|
|
2182
|
-
const origins = allowedOrigins !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedOrigins(), ...allowedOrigins])] :
|
|
1345
|
+
const origins = allowedOrigins !== void 0 ? [.../* @__PURE__ */ new Set([...localhostAllowedOrigins(), ...allowedOrigins])] : hosts;
|
|
2183
1346
|
return { hosts, origins };
|
|
2184
1347
|
}
|
|
2185
1348
|
#ensureMounted(mode, listenPort, bus) {
|
|
2186
|
-
this.#assertOpen();
|
|
2187
1349
|
if (this.#fetchHandler === void 0 || this.#handler === void 0) {
|
|
2188
1350
|
const { hosts, origins } = this.#validationPolicy(mode);
|
|
2189
1351
|
const basePath = this.#basePath();
|
|
2190
|
-
const nestedBasePath = basePath === "/" ? "" : basePath;
|
|
2191
1352
|
const middlewares = [
|
|
2192
1353
|
jsonBodyMiddleware(),
|
|
2193
1354
|
requestLogger(this.#config.logging)
|
|
2194
1355
|
];
|
|
2195
|
-
const corsConfig = this.#config.cors;
|
|
2196
|
-
if (corsConfig !== void 0) {
|
|
2197
|
-
middlewares.unshift(corsFetchMiddleware(corsConfig));
|
|
2198
|
-
}
|
|
2199
|
-
const deferViewCors = isGlobalCorsEnabled(corsConfig);
|
|
2200
1356
|
if (hosts !== void 0) {
|
|
2201
1357
|
middlewares.unshift(hostValidationMiddleware(hosts));
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
1358
|
+
middlewares.push(originValidationMiddleware(origins ?? hosts));
|
|
1359
|
+
} else {
|
|
1360
|
+
if (origins !== void 0) {
|
|
1361
|
+
middlewares.push(originValidationMiddleware(origins));
|
|
1362
|
+
}
|
|
2207
1363
|
if (mode === "listen") {
|
|
2208
1364
|
console.warn(
|
|
2209
1365
|
`[mcp-use] listen() is serving on ${this.#config.host} without Host validation. Behind a platform edge that only routes your own domains this is expected; if this process is reachable directly, set allowedHosts to restrict it.`
|
|
@@ -2233,7 +1389,7 @@ var MCPServer = class _MCPServer {
|
|
|
2233
1389
|
}
|
|
2234
1390
|
}
|
|
2235
1391
|
);
|
|
2236
|
-
let
|
|
1392
|
+
let mcpRouteHandler = mcpFetch;
|
|
2237
1393
|
if (resource !== void 0) {
|
|
2238
1394
|
const provider = this.#config.oauth;
|
|
2239
1395
|
const providerOptions = getOAuthProviderOptions(provider);
|
|
@@ -2244,89 +1400,32 @@ var MCPServer = class _MCPServer {
|
|
|
2244
1400
|
requiredScopes: providerOptions.requiredScopes
|
|
2245
1401
|
}
|
|
2246
1402
|
});
|
|
2247
|
-
|
|
1403
|
+
mcpRouteHandler = async (request) => {
|
|
2248
1404
|
const result = await gate(request);
|
|
2249
1405
|
if (result instanceof Response) {
|
|
2250
1406
|
return result;
|
|
2251
1407
|
}
|
|
2252
1408
|
const bag = getRequestBag(request);
|
|
2253
1409
|
bag.authInfo = result;
|
|
2254
|
-
return
|
|
1410
|
+
return mcpFetch(request);
|
|
2255
1411
|
};
|
|
2256
1412
|
}
|
|
2257
|
-
const mcpRouteHandler = (request) => protectWithBearer(request, () => mcpFetch(request));
|
|
2258
|
-
const endpointHandler = async (request) => {
|
|
2259
|
-
if (!isHtmlNavigationRequest(request)) {
|
|
2260
|
-
return mcpRouteHandler(request);
|
|
2261
|
-
}
|
|
2262
|
-
const respond = async () => {
|
|
2263
|
-
const { createLandingPageResponse } = await import("./landing-handler-WE66NIGB.js");
|
|
2264
|
-
return createLandingPageResponse(
|
|
2265
|
-
request,
|
|
2266
|
-
basePath,
|
|
2267
|
-
this.#config,
|
|
2268
|
-
this.#branding,
|
|
2269
|
-
this.#tools.values(),
|
|
2270
|
-
this.#prompts.values(),
|
|
2271
|
-
this.#resources.values()
|
|
2272
|
-
);
|
|
2273
|
-
};
|
|
2274
|
-
if (resource !== void 0 && this.#config.publicLandingPage !== true) {
|
|
2275
|
-
return protectWithBearer(request, respond);
|
|
2276
|
-
}
|
|
2277
|
-
return respond();
|
|
2278
|
-
};
|
|
2279
1413
|
const routes = [];
|
|
2280
|
-
const brandingDevMode = this.#viewsPrimed ? this.#viewsDevMode : process.env["NODE_ENV"] !== "production";
|
|
2281
|
-
const faviconHandler = createFaviconHandler(this.#branding, {
|
|
2282
|
-
dev: brandingDevMode,
|
|
2283
|
-
projectRoot: this.#viewsProjectRoot,
|
|
2284
|
-
deferCors: deferViewCors
|
|
2285
|
-
});
|
|
2286
|
-
if (faviconHandler !== void 0) {
|
|
2287
|
-
routes.push({
|
|
2288
|
-
match: (request) => new URL(request.url).pathname === "/favicon.ico",
|
|
2289
|
-
handler: faviconHandler
|
|
2290
|
-
});
|
|
2291
|
-
}
|
|
2292
1414
|
const viewHandler = createViewPublicHandler(basePath, this.#views, {
|
|
2293
|
-
dev: this.#
|
|
2294
|
-
projectRoot: this.#viewsProjectRoot
|
|
2295
|
-
enabled: hasLocalBrandingAsset(this.#branding),
|
|
2296
|
-
deferCors: deferViewCors
|
|
1415
|
+
dev: this.#viewsDevMode,
|
|
1416
|
+
projectRoot: this.#viewsProjectRoot
|
|
2297
1417
|
});
|
|
2298
1418
|
if (viewHandler !== void 0) {
|
|
2299
1419
|
routes.push({
|
|
2300
1420
|
match: (request) => request.method === "GET" || request.method === "HEAD" ? new URL(request.url).pathname.startsWith(
|
|
2301
|
-
`${
|
|
1421
|
+
`${basePath}/_mcp-use/public/`
|
|
2302
1422
|
) : false,
|
|
2303
1423
|
handler: viewHandler
|
|
2304
1424
|
});
|
|
2305
1425
|
}
|
|
2306
|
-
if (!this.#viewsDevMode) {
|
|
2307
|
-
const viewAssetsHandler = createViewAssetsHandler(
|
|
2308
|
-
basePath,
|
|
2309
|
-
this.#views,
|
|
2310
|
-
{ projectRoot: this.#viewsProjectRoot, deferCors: deferViewCors }
|
|
2311
|
-
);
|
|
2312
|
-
if (viewAssetsHandler !== void 0) {
|
|
2313
|
-
routes.push({
|
|
2314
|
-
match: (request) => request.method === "GET" || request.method === "HEAD" ? new URL(request.url).pathname.startsWith(
|
|
2315
|
-
`${nestedBasePath}/_mcp-use/views/`
|
|
2316
|
-
) : false,
|
|
2317
|
-
handler: viewAssetsHandler
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
1426
|
const inspectorHandler = createInspectorHandler(this.#config.inspector, {
|
|
2322
1427
|
serverName: this.#config.name,
|
|
2323
|
-
basePath
|
|
2324
|
-
...faviconHandler !== void 0 && {
|
|
2325
|
-
faviconHref: "/favicon.ico",
|
|
2326
|
-
...this.#branding.faviconMimeType !== void 0 && {
|
|
2327
|
-
faviconType: this.#branding.faviconMimeType
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
1428
|
+
basePath
|
|
2330
1429
|
});
|
|
2331
1430
|
if (inspectorHandler !== void 0) {
|
|
2332
1431
|
routes.push({
|
|
@@ -2335,14 +1434,14 @@ var MCPServer = class _MCPServer {
|
|
|
2335
1434
|
return false;
|
|
2336
1435
|
}
|
|
2337
1436
|
const pathname = new URL(request.url).pathname;
|
|
2338
|
-
return
|
|
1437
|
+
return pathname === `${basePath}/inspector` || pathname === `${basePath}/inspector/`;
|
|
2339
1438
|
},
|
|
2340
1439
|
handler: inspectorHandler
|
|
2341
1440
|
});
|
|
2342
1441
|
}
|
|
2343
1442
|
routes.push({
|
|
2344
1443
|
match: (request) => matchesPath(request, basePath),
|
|
2345
|
-
handler:
|
|
1444
|
+
handler: mcpRouteHandler
|
|
2346
1445
|
});
|
|
2347
1446
|
const terminal = routeFetch(routes);
|
|
2348
1447
|
this.#fetchHandler = composeFetch(terminal, ...middlewares);
|
|
@@ -2415,17 +1514,7 @@ var MCPServer = class _MCPServer {
|
|
|
2415
1514
|
name,
|
|
2416
1515
|
version,
|
|
2417
1516
|
...title !== void 0 && { title },
|
|
2418
|
-
...description !== void 0 && { description }
|
|
2419
|
-
...this.#branding.websiteUrl !== void 0 && {
|
|
2420
|
-
websiteUrl: this.#branding.websiteUrl
|
|
2421
|
-
},
|
|
2422
|
-
...this.#branding.icons !== void 0 && {
|
|
2423
|
-
icons: resolveImplementationIcons(
|
|
2424
|
-
this.#branding.icons,
|
|
2425
|
-
ctx.requestInfo,
|
|
2426
|
-
this.#basePath()
|
|
2427
|
-
)
|
|
2428
|
-
}
|
|
1517
|
+
...description !== void 0 && { description }
|
|
2429
1518
|
},
|
|
2430
1519
|
{
|
|
2431
1520
|
capabilities: {
|
|
@@ -2441,7 +1530,7 @@ var MCPServer = class _MCPServer {
|
|
|
2441
1530
|
}
|
|
2442
1531
|
);
|
|
2443
1532
|
const request = ctx.requestInfo;
|
|
2444
|
-
const
|
|
1533
|
+
const servingOrigin = request !== void 0 ? resolveRequestOrigin(request) : "";
|
|
2445
1534
|
const basePath = this.#basePath();
|
|
2446
1535
|
for (const entry of this.#tools.values()) {
|
|
2447
1536
|
this.#registerTool(server, entry);
|
|
@@ -2460,108 +1549,15 @@ var MCPServer = class _MCPServer {
|
|
|
2460
1549
|
server,
|
|
2461
1550
|
viewName,
|
|
2462
1551
|
viewEntry,
|
|
2463
|
-
|
|
1552
|
+
servingOrigin,
|
|
2464
1553
|
basePath
|
|
2465
1554
|
);
|
|
2466
1555
|
}
|
|
2467
|
-
this.#wrapListHandlers(server);
|
|
2468
1556
|
return server;
|
|
2469
1557
|
}
|
|
2470
|
-
#createMiddlewareContext(method, params, ctx) {
|
|
2471
|
-
return {
|
|
2472
|
-
method,
|
|
2473
|
-
params,
|
|
2474
|
-
...ctx.sessionId !== void 0 && {
|
|
2475
|
-
session: { sessionId: ctx.sessionId }
|
|
2476
|
-
},
|
|
2477
|
-
...ctx.http?.authInfo !== void 0 && { auth: ctx.http.authInfo },
|
|
2478
|
-
state: /* @__PURE__ */ new Map()
|
|
2479
|
-
};
|
|
2480
|
-
}
|
|
2481
|
-
#runMcpHook(method, ctx, innerFn) {
|
|
2482
|
-
return runMcpOperation(
|
|
2483
|
-
this.#mcpMiddlewares,
|
|
2484
|
-
this.#mcpEventListeners,
|
|
2485
|
-
method,
|
|
2486
|
-
ctx,
|
|
2487
|
-
innerFn
|
|
2488
|
-
);
|
|
2489
|
-
}
|
|
2490
|
-
/**
|
|
2491
|
-
* Wrap native SDK list handlers with the MCP middleware chain.
|
|
2492
|
-
*
|
|
2493
|
-
* ponytail: uses SDK-private `_requestHandlers`; pin compile-time test.
|
|
2494
|
-
*
|
|
2495
|
-
* @internal
|
|
2496
|
-
*/
|
|
2497
|
-
#wrapListHandlers(server) {
|
|
2498
|
-
const handlers = server.server._requestHandlers;
|
|
2499
|
-
if (handlers === void 0) {
|
|
2500
|
-
return;
|
|
2501
|
-
}
|
|
2502
|
-
const wrapListMethod = (method, resultKey, transform) => {
|
|
2503
|
-
const original = handlers.get(method);
|
|
2504
|
-
if (original === void 0) {
|
|
2505
|
-
return;
|
|
2506
|
-
}
|
|
2507
|
-
if (original.__mcpListWrapped) {
|
|
2508
|
-
return;
|
|
2509
|
-
}
|
|
2510
|
-
const wrapped = async (request, extra) => {
|
|
2511
|
-
const serverContext = extra;
|
|
2512
|
-
const params = request.params ?? {};
|
|
2513
|
-
const mwCtx = this.#createMiddlewareContext(
|
|
2514
|
-
method,
|
|
2515
|
-
params,
|
|
2516
|
-
serverContext
|
|
2517
|
-
);
|
|
2518
|
-
let originalEnvelope;
|
|
2519
|
-
const innerFn = async () => {
|
|
2520
|
-
const downstreamRequest = withMcpMiddlewareParams(
|
|
2521
|
-
request,
|
|
2522
|
-
mwCtx.params
|
|
2523
|
-
);
|
|
2524
|
-
const result = await original(downstreamRequest, extra);
|
|
2525
|
-
if (typeof result !== "object" || result === null) {
|
|
2526
|
-
throw new TypeError(
|
|
2527
|
-
`[mcp-use] ${method} handler returned a non-object result`
|
|
2528
|
-
);
|
|
2529
|
-
}
|
|
2530
|
-
originalEnvelope = result;
|
|
2531
|
-
const items = originalEnvelope[resultKey];
|
|
2532
|
-
if (!Array.isArray(items)) {
|
|
2533
|
-
throw new TypeError(
|
|
2534
|
-
`[mcp-use] ${method} handler result is missing a ${resultKey} array`
|
|
2535
|
-
);
|
|
2536
|
-
}
|
|
2537
|
-
return items;
|
|
2538
|
-
};
|
|
2539
|
-
const filtered = await this.#runMcpHook(method, mwCtx, innerFn);
|
|
2540
|
-
if (!Array.isArray(filtered)) {
|
|
2541
|
-
throw new TypeError(
|
|
2542
|
-
`[mcp-use] ${method} middleware must return a ${resultKey} array`
|
|
2543
|
-
);
|
|
2544
|
-
}
|
|
2545
|
-
const emitted = transform?.(filtered) ?? filtered;
|
|
2546
|
-
return {
|
|
2547
|
-
...originalEnvelope,
|
|
2548
|
-
[resultKey]: emitted
|
|
2549
|
-
};
|
|
2550
|
-
};
|
|
2551
|
-
wrapped.__mcpListWrapped = true;
|
|
2552
|
-
handlers.set(method, wrapped);
|
|
2553
|
-
};
|
|
2554
|
-
wrapListMethod("tools/list", "tools", omitToolSchemaDialects);
|
|
2555
|
-
wrapListMethod("resources/list", "resources");
|
|
2556
|
-
wrapListMethod("prompts/list", "prompts");
|
|
2557
|
-
}
|
|
2558
1558
|
#registerTool(server, { definition, callback }) {
|
|
2559
1559
|
const view = definition.view;
|
|
2560
|
-
const
|
|
2561
|
-
view?.name,
|
|
2562
|
-
definition.visibility,
|
|
2563
|
-
definition._meta
|
|
2564
|
-
);
|
|
1560
|
+
const toolUiMeta = buildToolUiMeta(view?.name, definition.visibility);
|
|
2565
1561
|
const config = {
|
|
2566
1562
|
...definition.title !== void 0 && { title: definition.title },
|
|
2567
1563
|
...definition.description !== void 0 && {
|
|
@@ -2573,60 +1569,51 @@ var MCPServer = class _MCPServer {
|
|
|
2573
1569
|
...definition.outputSchema !== void 0 && {
|
|
2574
1570
|
outputSchema: definition.outputSchema
|
|
2575
1571
|
},
|
|
2576
|
-
...
|
|
1572
|
+
...toolUiMeta !== void 0 && { _meta: toolUiMeta }
|
|
2577
1573
|
};
|
|
2578
1574
|
const wireResultMeta = view !== void 0 ? buildToolResultUiMeta(view.name) : void 0;
|
|
2579
1575
|
const inputSchema = resolveToolInputSchema(definition);
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
{
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
1576
|
+
if (inputSchema !== void 0) {
|
|
1577
|
+
server.registerTool(
|
|
1578
|
+
definition.name,
|
|
1579
|
+
{ ...config, inputSchema },
|
|
1580
|
+
async (args, ctx) => {
|
|
1581
|
+
const params = args;
|
|
1582
|
+
const result = await callback(params, this.#toRequestContext(ctx));
|
|
1583
|
+
if (isInputRequiredResult(result) || wireResultMeta === void 0 || result.isError === true) {
|
|
1584
|
+
return result;
|
|
1585
|
+
}
|
|
1586
|
+
return {
|
|
1587
|
+
...result,
|
|
1588
|
+
_meta: { ...result._meta, ...wireResultMeta }
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
2589
1591
|
);
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
const result = await callback(
|
|
2593
|
-
|
|
2594
|
-
this.#toRequestContext(ctx)
|
|
2595
|
-
);
|
|
2596
|
-
if (isInputRequiredResult2(result) || wireResultMeta === void 0 || result.isError === true) {
|
|
1592
|
+
} else {
|
|
1593
|
+
server.registerTool(definition.name, config, async (ctx) => {
|
|
1594
|
+
const result = await callback({}, this.#toRequestContext(ctx));
|
|
1595
|
+
if (isInputRequiredResult(result) || wireResultMeta === void 0 || result.isError === true) {
|
|
2597
1596
|
return result;
|
|
2598
1597
|
}
|
|
2599
1598
|
return {
|
|
2600
1599
|
...result,
|
|
2601
1600
|
_meta: { ...result._meta, ...wireResultMeta }
|
|
2602
1601
|
};
|
|
2603
|
-
};
|
|
2604
|
-
return await this.#runMcpHook("tools/call", mwCtx, innerFn);
|
|
2605
|
-
};
|
|
2606
|
-
if (inputSchema !== void 0) {
|
|
2607
|
-
server.registerTool(
|
|
2608
|
-
definition.name,
|
|
2609
|
-
{ ...config, inputSchema },
|
|
2610
|
-
async (args, ctx) => invokeTool(args, ctx)
|
|
2611
|
-
);
|
|
2612
|
-
} else {
|
|
2613
|
-
server.registerTool(
|
|
2614
|
-
definition.name,
|
|
2615
|
-
config,
|
|
2616
|
-
async (ctx) => invokeTool({}, ctx)
|
|
2617
|
-
);
|
|
1602
|
+
});
|
|
2618
1603
|
}
|
|
2619
1604
|
}
|
|
2620
|
-
#registerViewResource(server, viewName, entry,
|
|
1605
|
+
#registerViewResource(server, viewName, entry, servingOrigin, basePath) {
|
|
2621
1606
|
const uri = viewResourceUri(viewName);
|
|
2622
1607
|
const authorFacts = this.#viewResourceFacts(
|
|
2623
1608
|
this.#viewBindings.get(viewName)?.config
|
|
2624
1609
|
);
|
|
1610
|
+
const hmrWs = this.#viewsDevMode;
|
|
2625
1611
|
const resourceConfig = viewResourceConfig(
|
|
2626
1612
|
viewName,
|
|
2627
1613
|
entry,
|
|
2628
1614
|
authorFacts,
|
|
2629
|
-
|
|
1615
|
+
servingOrigin,
|
|
1616
|
+
{ hmrWs }
|
|
2630
1617
|
);
|
|
2631
1618
|
server.registerResource(
|
|
2632
1619
|
viewName,
|
|
@@ -2634,24 +1621,15 @@ var MCPServer = class _MCPServer {
|
|
|
2634
1621
|
resourceConfig,
|
|
2635
1622
|
async (readUri, ctx) => {
|
|
2636
1623
|
const req = ctx.http?.req;
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2639
|
-
...metaOptions.hmrWs === true ? { hmrWs: true } : {}
|
|
2640
|
-
} : metaOptions.hmrWs === true ? { hmrWs: true } : {};
|
|
2641
|
-
const assetsBase = req !== void 0 ? resolveAssetsBase(req) : metaOptions.request !== void 0 ? resolveAssetsBase(metaOptions.request) : "";
|
|
2642
|
-
const html = synthesizeViewDocument(
|
|
2643
|
-
entry,
|
|
2644
|
-
assetsBase,
|
|
2645
|
-
basePath,
|
|
2646
|
-
viewName
|
|
2647
|
-
);
|
|
1624
|
+
const origin = req !== void 0 ? resolveRequestOrigin(req) : servingOrigin;
|
|
1625
|
+
const html = synthesizeViewDocument(entry, origin, basePath);
|
|
2648
1626
|
return {
|
|
2649
1627
|
contents: [
|
|
2650
1628
|
{
|
|
2651
1629
|
uri: readUri.href,
|
|
2652
1630
|
mimeType: resourceConfig.mimeType,
|
|
2653
1631
|
text: html,
|
|
2654
|
-
_meta: buildResourceUiMeta(authorFacts,
|
|
1632
|
+
_meta: buildResourceUiMeta(authorFacts, origin, { hmrWs })
|
|
2655
1633
|
}
|
|
2656
1634
|
]
|
|
2657
1635
|
};
|
|
@@ -2669,36 +1647,14 @@ var MCPServer = class _MCPServer {
|
|
|
2669
1647
|
},
|
|
2670
1648
|
...definition.mimeType !== void 0 && {
|
|
2671
1649
|
mimeType: definition.mimeType
|
|
2672
|
-
},
|
|
2673
|
-
...definition.annotations !== void 0 && {
|
|
2674
|
-
annotations: definition.annotations
|
|
2675
|
-
},
|
|
2676
|
-
...definition._meta !== void 0 && {
|
|
2677
|
-
_meta: { ...definition._meta }
|
|
2678
1650
|
}
|
|
2679
1651
|
},
|
|
2680
|
-
async (uri, ctx) =>
|
|
2681
|
-
const mwCtx = this.#createMiddlewareContext(
|
|
2682
|
-
"resources/read",
|
|
2683
|
-
{
|
|
2684
|
-
uri: uri.href,
|
|
2685
|
-
...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
|
|
2686
|
-
},
|
|
2687
|
-
ctx
|
|
2688
|
-
);
|
|
2689
|
-
const innerFn = async () => callback(uri, this.#toRequestContext(ctx));
|
|
2690
|
-
return await this.#runMcpHook(
|
|
2691
|
-
"resources/read",
|
|
2692
|
-
mwCtx,
|
|
2693
|
-
innerFn
|
|
2694
|
-
);
|
|
2695
|
-
}
|
|
1652
|
+
async (uri, ctx) => callback(uri, this.#toRequestContext(ctx))
|
|
2696
1653
|
);
|
|
2697
1654
|
}
|
|
2698
|
-
#registerResourceTemplate(server, { definition, callback
|
|
1655
|
+
#registerResourceTemplate(server, { definition, callback }) {
|
|
2699
1656
|
const template = new ResourceTemplate(definition.uriTemplate, {
|
|
2700
|
-
list: void 0
|
|
2701
|
-
...complete !== void 0 && { complete }
|
|
1657
|
+
list: void 0
|
|
2702
1658
|
});
|
|
2703
1659
|
server.registerResource(
|
|
2704
1660
|
definition.name,
|
|
@@ -2710,34 +1666,13 @@ var MCPServer = class _MCPServer {
|
|
|
2710
1666
|
},
|
|
2711
1667
|
...definition.mimeType !== void 0 && {
|
|
2712
1668
|
mimeType: definition.mimeType
|
|
2713
|
-
},
|
|
2714
|
-
...definition.annotations !== void 0 && {
|
|
2715
|
-
annotations: definition.annotations
|
|
2716
|
-
},
|
|
2717
|
-
...definition._meta !== void 0 && {
|
|
2718
|
-
_meta: { ...definition._meta }
|
|
2719
1669
|
}
|
|
2720
1670
|
},
|
|
2721
|
-
async (uri, variables, ctx) =>
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
|
|
2727
|
-
},
|
|
2728
|
-
ctx
|
|
2729
|
-
);
|
|
2730
|
-
const innerFn = async () => callback(
|
|
2731
|
-
uri,
|
|
2732
|
-
variables,
|
|
2733
|
-
this.#toRequestContext(ctx)
|
|
2734
|
-
);
|
|
2735
|
-
return await this.#runMcpHook(
|
|
2736
|
-
"resources/read",
|
|
2737
|
-
mwCtx,
|
|
2738
|
-
innerFn
|
|
2739
|
-
);
|
|
2740
|
-
}
|
|
1671
|
+
async (uri, variables, ctx) => callback(
|
|
1672
|
+
uri,
|
|
1673
|
+
variables,
|
|
1674
|
+
this.#toRequestContext(ctx)
|
|
1675
|
+
)
|
|
2741
1676
|
);
|
|
2742
1677
|
}
|
|
2743
1678
|
#viewResourceFacts(viewConfig) {
|
|
@@ -2765,30 +1700,17 @@ var MCPServer = class _MCPServer {
|
|
|
2765
1700
|
description: definition.description
|
|
2766
1701
|
}
|
|
2767
1702
|
};
|
|
2768
|
-
const invokePrompt = async (args, ctx) => {
|
|
2769
|
-
const mwCtx = this.#createMiddlewareContext(
|
|
2770
|
-
"prompts/get",
|
|
2771
|
-
{
|
|
2772
|
-
name: definition.name,
|
|
2773
|
-
arguments: args,
|
|
2774
|
-
...ctx.mcpReq._meta !== void 0 && { _meta: ctx.mcpReq._meta }
|
|
2775
|
-
},
|
|
2776
|
-
ctx
|
|
2777
|
-
);
|
|
2778
|
-
const innerFn = async () => {
|
|
2779
|
-
const effectiveArgs = mwCtx.params.arguments ?? {};
|
|
2780
|
-
return callback(effectiveArgs, this.#toRequestContext(ctx));
|
|
2781
|
-
};
|
|
2782
|
-
return await this.#runMcpHook("prompts/get", mwCtx, innerFn);
|
|
2783
|
-
};
|
|
2784
1703
|
if (definition.schema !== void 0) {
|
|
2785
1704
|
server.registerPrompt(
|
|
2786
1705
|
definition.name,
|
|
2787
1706
|
{ ...config, argsSchema: definition.schema },
|
|
2788
|
-
async (args, ctx) =>
|
|
1707
|
+
async (args, ctx) => {
|
|
1708
|
+
const params = args;
|
|
1709
|
+
return callback(params, this.#toRequestContext(ctx));
|
|
1710
|
+
}
|
|
2789
1711
|
);
|
|
2790
1712
|
} else {
|
|
2791
|
-
const handler = async (ctx) =>
|
|
1713
|
+
const handler = async (ctx) => callback({}, this.#toRequestContext(ctx));
|
|
2792
1714
|
server.registerPrompt(
|
|
2793
1715
|
definition.name,
|
|
2794
1716
|
config,
|
|
@@ -2810,32 +1732,46 @@ import {
|
|
|
2810
1732
|
createRequestStateCodec,
|
|
2811
1733
|
inputRequired as inputRequired2,
|
|
2812
1734
|
inputResponse as inputResponse2,
|
|
2813
|
-
isInputRequiredResult as
|
|
1735
|
+
isInputRequiredResult as isInputRequiredResult2
|
|
2814
1736
|
} from "@modelcontextprotocol/server";
|
|
1737
|
+
|
|
1738
|
+
// src/completable.ts
|
|
1739
|
+
import {
|
|
1740
|
+
completable as sdkCompletable
|
|
1741
|
+
} from "@modelcontextprotocol/server";
|
|
1742
|
+
function completable(schema, complete) {
|
|
1743
|
+
if (typeof complete === "function") {
|
|
1744
|
+
return sdkCompletable(
|
|
1745
|
+
schema,
|
|
1746
|
+
(value, context) => complete(String(value ?? ""), context)
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
const values = complete.map(String);
|
|
1750
|
+
return sdkCompletable(schema, (value) => {
|
|
1751
|
+
const prefix = String(value ?? "").toLowerCase();
|
|
1752
|
+
return values.filter((v) => v.toLowerCase().startsWith(prefix));
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
2815
1755
|
export {
|
|
2816
1756
|
MCPServer,
|
|
2817
1757
|
acceptedContent,
|
|
2818
1758
|
completable,
|
|
2819
1759
|
composeFetch,
|
|
2820
|
-
composeMiddleware,
|
|
2821
|
-
createMcpEventListenerEntry,
|
|
2822
|
-
createMcpMiddlewareEntry,
|
|
2823
1760
|
createMcpMount,
|
|
2824
1761
|
createRequestStateCodec,
|
|
2825
1762
|
getRequestBag,
|
|
2826
1763
|
hostValidationMiddleware,
|
|
2827
1764
|
inputRequired2 as inputRequired,
|
|
2828
1765
|
inputResponse2 as inputResponse,
|
|
2829
|
-
|
|
1766
|
+
isInputRequiredResult2 as isInputRequiredResult,
|
|
2830
1767
|
jsonBodyMiddleware,
|
|
2831
1768
|
matchesPath,
|
|
2832
1769
|
matchesPathPrefix,
|
|
2833
|
-
|
|
1770
|
+
mountMcp,
|
|
2834
1771
|
originValidationMiddleware,
|
|
2835
1772
|
pathnameOf,
|
|
2836
1773
|
registerViews,
|
|
2837
1774
|
requestLogger,
|
|
2838
|
-
routeFetch
|
|
2839
|
-
toFrameworkHandler
|
|
1775
|
+
routeFetch
|
|
2840
1776
|
};
|
|
2841
1777
|
//# sourceMappingURL=index.js.map
|