@j0hanz/superfetch 2.1.4 → 2.1.5
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/cache.d.ts +1 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +1 -0
- package/dist/cache.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -0
- package/dist/crypto.d.ts +1 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +1 -0
- package/dist/crypto.js.map +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -0
- package/dist/fetch.d.ts +1 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +1 -0
- package/dist/fetch.js.map +1 -0
- package/dist/http.d.ts +1 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +1 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +1 -0
- package/dist/mcp.js.map +1 -0
- package/dist/observability.d.ts +1 -0
- package/dist/observability.d.ts.map +1 -0
- package/dist/observability.js +1 -0
- package/dist/observability.js.map +1 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +1 -0
- package/dist/tools.js.map +1 -0
- package/dist/transform.d.ts +1 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/transform.js +1 -0
- package/dist/transform.js.map +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -0
- package/dist/workers/transform-worker.d.ts +1 -0
- package/dist/workers/transform-worker.d.ts.map +1 -0
- package/dist/workers/transform-worker.js +1 -0
- package/dist/workers/transform-worker.js.map +1 -0
- package/package.json +5 -2
- package/dist/config/auth-config.d.ts +0 -16
- package/dist/config/auth-config.js +0 -53
- package/dist/config/constants.d.ts +0 -17
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js +0 -22
- package/dist/config/constants.js.map +0 -1
- package/dist/config/env-parsers.d.ts +0 -8
- package/dist/config/env-parsers.js +0 -96
- package/dist/config/formatting.d.ts +0 -7
- package/dist/config/formatting.d.ts.map +0 -1
- package/dist/config/formatting.js +0 -9
- package/dist/config/formatting.js.map +0 -1
- package/dist/config/index.d.ts +0 -61
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -107
- package/dist/config/index.js.map +0 -1
- package/dist/config/types/content.d.ts +0 -41
- package/dist/config/types/content.d.ts.map +0 -1
- package/dist/config/types/content.js +0 -1
- package/dist/config/types/content.js.map +0 -1
- package/dist/config/types/runtime.d.ts +0 -72
- package/dist/config/types/runtime.d.ts.map +0 -1
- package/dist/config/types/runtime.js +0 -1
- package/dist/config/types/runtime.js.map +0 -1
- package/dist/config/types/tools.d.ts +0 -28
- package/dist/config/types/tools.d.ts.map +0 -1
- package/dist/config/types/tools.js +0 -1
- package/dist/config/types/tools.js.map +0 -1
- package/dist/config/types.d.ts +0 -4
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -2
- package/dist/config/types.js.map +0 -1
- package/dist/errors/app-error.d.ts +0 -7
- package/dist/errors/app-error.d.ts.map +0 -1
- package/dist/errors/app-error.js +0 -16
- package/dist/errors/app-error.js.map +0 -1
- package/dist/errors/index.d.ts +0 -2
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -2
- package/dist/errors/index.js.map +0 -1
- package/dist/http/accept-policy.d.ts +0 -3
- package/dist/http/accept-policy.js +0 -45
- package/dist/http/async-handler.d.ts +0 -2
- package/dist/http/async-handler.js +0 -5
- package/dist/http/auth-introspection.d.ts +0 -2
- package/dist/http/auth-introspection.js +0 -141
- package/dist/http/auth-static.d.ts +0 -2
- package/dist/http/auth-static.js +0 -23
- package/dist/http/auth.d.ts +0 -3
- package/dist/http/auth.d.ts.map +0 -1
- package/dist/http/auth.js +0 -269
- package/dist/http/auth.js.map +0 -1
- package/dist/http/base-middleware.d.ts +0 -7
- package/dist/http/base-middleware.js +0 -143
- package/dist/http/cors.d.ts +0 -2
- package/dist/http/cors.d.ts.map +0 -1
- package/dist/http/cors.js +0 -9
- package/dist/http/cors.js.map +0 -1
- package/dist/http/download-routes.d.ts +0 -2
- package/dist/http/download-routes.d.ts.map +0 -1
- package/dist/http/download-routes.js +0 -104
- package/dist/http/download-routes.js.map +0 -1
- package/dist/http/error-handler.d.ts +0 -2
- package/dist/http/error-handler.js +0 -55
- package/dist/http/host-allowlist.d.ts +0 -3
- package/dist/http/host-allowlist.js +0 -117
- package/dist/http/jsonrpc-http.d.ts +0 -2
- package/dist/http/jsonrpc-http.js +0 -10
- package/dist/http/mcp-routes.d.ts +0 -9
- package/dist/http/mcp-routes.d.ts.map +0 -1
- package/dist/http/mcp-routes.js +0 -204
- package/dist/http/mcp-routes.js.map +0 -1
- package/dist/http/mcp-session-eviction.d.ts +0 -3
- package/dist/http/mcp-session-eviction.js +0 -24
- package/dist/http/mcp-session-helpers.d.ts +0 -12
- package/dist/http/mcp-session-helpers.d.ts.map +0 -1
- package/dist/http/mcp-session-helpers.js +0 -64
- package/dist/http/mcp-session-helpers.js.map +0 -1
- package/dist/http/mcp-session-init.d.ts +0 -7
- package/dist/http/mcp-session-init.js +0 -94
- package/dist/http/mcp-session-slots.d.ts +0 -17
- package/dist/http/mcp-session-slots.js +0 -55
- package/dist/http/mcp-session-transport-init.d.ts +0 -7
- package/dist/http/mcp-session-transport-init.js +0 -41
- package/dist/http/mcp-session-transport.d.ts +0 -7
- package/dist/http/mcp-session-transport.js +0 -57
- package/dist/http/mcp-session-types.d.ts +0 -5
- package/dist/http/mcp-session-types.js +0 -1
- package/dist/http/mcp-session.d.ts +0 -10
- package/dist/http/mcp-session.d.ts.map +0 -1
- package/dist/http/mcp-session.js +0 -23
- package/dist/http/mcp-session.js.map +0 -1
- package/dist/http/mcp-sessions.d.ts +0 -41
- package/dist/http/mcp-sessions.js +0 -392
- package/dist/http/mcp-validation.d.ts +0 -3
- package/dist/http/mcp-validation.d.ts.map +0 -1
- package/dist/http/mcp-validation.js +0 -14
- package/dist/http/mcp-validation.js.map +0 -1
- package/dist/http/protocol-policy.d.ts +0 -2
- package/dist/http/protocol-policy.js +0 -31
- package/dist/http/rate-limit.d.ts +0 -12
- package/dist/http/rate-limit.d.ts.map +0 -1
- package/dist/http/rate-limit.js +0 -93
- package/dist/http/rate-limit.js.map +0 -1
- package/dist/http/server-config.d.ts +0 -1
- package/dist/http/server-config.js +0 -40
- package/dist/http/server-middleware.d.ts +0 -7
- package/dist/http/server-middleware.d.ts.map +0 -1
- package/dist/http/server-middleware.js +0 -52
- package/dist/http/server-middleware.js.map +0 -1
- package/dist/http/server-shutdown.d.ts +0 -4
- package/dist/http/server-shutdown.js +0 -43
- package/dist/http/server-tuning.d.ts +0 -9
- package/dist/http/server-tuning.js +0 -45
- package/dist/http/server.d.ts +0 -3
- package/dist/http/server.d.ts.map +0 -1
- package/dist/http/server.js +0 -291
- package/dist/http/server.js.map +0 -1
- package/dist/http/session-cleanup.d.ts +0 -2
- package/dist/http/session-cleanup.d.ts.map +0 -1
- package/dist/http/session-cleanup.js +0 -40
- package/dist/http/session-cleanup.js.map +0 -1
- package/dist/http/sessions.d.ts +0 -14
- package/dist/http/sessions.d.ts.map +0 -1
- package/dist/http/sessions.js +0 -63
- package/dist/http/sessions.js.map +0 -1
- package/dist/middleware/error-handler.d.ts +0 -2
- package/dist/middleware/error-handler.d.ts.map +0 -1
- package/dist/middleware/error-handler.js +0 -56
- package/dist/middleware/error-handler.js.map +0 -1
- package/dist/middleware/rate-limiter.d.ts +0 -16
- package/dist/middleware/rate-limiter.d.ts.map +0 -1
- package/dist/middleware/rate-limiter.js +0 -111
- package/dist/middleware/rate-limiter.js.map +0 -1
- package/dist/parsers/base-html-element-parser.d.ts +0 -43
- package/dist/parsers/base-html-element-parser.d.ts.map +0 -1
- package/dist/parsers/base-html-element-parser.js +0 -59
- package/dist/parsers/base-html-element-parser.js.map +0 -1
- package/dist/parsers/heading-element-parser.d.ts +0 -14
- package/dist/parsers/heading-element-parser.d.ts.map +0 -1
- package/dist/parsers/heading-element-parser.js +0 -26
- package/dist/parsers/heading-element-parser.js.map +0 -1
- package/dist/parsers/image-element-parser.d.ts +0 -16
- package/dist/parsers/image-element-parser.d.ts.map +0 -1
- package/dist/parsers/image-element-parser.js +0 -33
- package/dist/parsers/image-element-parser.js.map +0 -1
- package/dist/parsers/link-element-parser.d.ts +0 -15
- package/dist/parsers/link-element-parser.d.ts.map +0 -1
- package/dist/parsers/link-element-parser.js +0 -28
- package/dist/parsers/link-element-parser.js.map +0 -1
- package/dist/parsers/open-graph-parser.d.ts +0 -17
- package/dist/parsers/open-graph-parser.d.ts.map +0 -1
- package/dist/parsers/open-graph-parser.js +0 -41
- package/dist/parsers/open-graph-parser.js.map +0 -1
- package/dist/parsers/schema-org-parser.d.ts +0 -17
- package/dist/parsers/schema-org-parser.d.ts.map +0 -1
- package/dist/parsers/schema-org-parser.js +0 -32
- package/dist/parsers/schema-org-parser.js.map +0 -1
- package/dist/parsers/standard-meta-parser.d.ts +0 -18
- package/dist/parsers/standard-meta-parser.d.ts.map +0 -1
- package/dist/parsers/standard-meta-parser.js +0 -32
- package/dist/parsers/standard-meta-parser.js.map +0 -1
- package/dist/parsers/twitter-card-parser.d.ts +0 -17
- package/dist/parsers/twitter-card-parser.d.ts.map +0 -1
- package/dist/parsers/twitter-card-parser.js +0 -41
- package/dist/parsers/twitter-card-parser.js.map +0 -1
- package/dist/prompts/index.d.ts +0 -3
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js +0 -73
- package/dist/prompts/index.js.map +0 -1
- package/dist/resources/cached-content-params.d.ts +0 -5
- package/dist/resources/cached-content-params.js +0 -36
- package/dist/resources/cached-content.d.ts +0 -2
- package/dist/resources/cached-content.d.ts.map +0 -1
- package/dist/resources/cached-content.js +0 -132
- package/dist/resources/cached-content.js.map +0 -1
- package/dist/resources/index.d.ts +0 -2
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/resources/index.js +0 -4
- package/dist/resources/index.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -94
- package/dist/server.js.map +0 -1
- package/dist/services/cache-events.d.ts +0 -8
- package/dist/services/cache-events.js +0 -19
- package/dist/services/cache-keys.d.ts +0 -7
- package/dist/services/cache-keys.js +0 -57
- package/dist/services/cache.d.ts +0 -17
- package/dist/services/cache.d.ts.map +0 -1
- package/dist/services/cache.js +0 -145
- package/dist/services/cache.js.map +0 -1
- package/dist/services/cache.service.d.ts +0 -52
- package/dist/services/cache.service.d.ts.map +0 -1
- package/dist/services/cache.service.js +0 -113
- package/dist/services/cache.service.js.map +0 -1
- package/dist/services/card-extractor.d.ts +0 -6
- package/dist/services/card-extractor.d.ts.map +0 -1
- package/dist/services/card-extractor.js +0 -199
- package/dist/services/card-extractor.js.map +0 -1
- package/dist/services/context.d.ts +0 -10
- package/dist/services/context.d.ts.map +0 -1
- package/dist/services/context.js +0 -14
- package/dist/services/context.js.map +0 -1
- package/dist/services/extractor.d.ts +0 -5
- package/dist/services/extractor.d.ts.map +0 -1
- package/dist/services/extractor.js +0 -142
- package/dist/services/extractor.js.map +0 -1
- package/dist/services/extractor.service.d.ts +0 -18
- package/dist/services/extractor.service.d.ts.map +0 -1
- package/dist/services/extractor.service.js +0 -75
- package/dist/services/extractor.service.js.map +0 -1
- package/dist/services/fetcher/agents.d.ts +0 -3
- package/dist/services/fetcher/agents.d.ts.map +0 -1
- package/dist/services/fetcher/agents.js +0 -100
- package/dist/services/fetcher/agents.js.map +0 -1
- package/dist/services/fetcher/dns-selection.d.ts +0 -2
- package/dist/services/fetcher/dns-selection.js +0 -72
- package/dist/services/fetcher/errors.d.ts +0 -4
- package/dist/services/fetcher/errors.d.ts.map +0 -1
- package/dist/services/fetcher/errors.js +0 -70
- package/dist/services/fetcher/errors.js.map +0 -1
- package/dist/services/fetcher/headers.d.ts +0 -2
- package/dist/services/fetcher/headers.d.ts.map +0 -1
- package/dist/services/fetcher/headers.js +0 -6
- package/dist/services/fetcher/headers.js.map +0 -1
- package/dist/services/fetcher/interceptors.d.ts +0 -10
- package/dist/services/fetcher/interceptors.d.ts.map +0 -1
- package/dist/services/fetcher/interceptors.js +0 -108
- package/dist/services/fetcher/interceptors.js.map +0 -1
- package/dist/services/fetcher/redirects.d.ts +0 -4
- package/dist/services/fetcher/redirects.d.ts.map +0 -1
- package/dist/services/fetcher/redirects.js +0 -78
- package/dist/services/fetcher/redirects.js.map +0 -1
- package/dist/services/fetcher/response.d.ts +0 -4
- package/dist/services/fetcher/response.d.ts.map +0 -1
- package/dist/services/fetcher/response.js +0 -104
- package/dist/services/fetcher/response.js.map +0 -1
- package/dist/services/fetcher/retry-policy.d.ts +0 -1
- package/dist/services/fetcher/retry-policy.d.ts.map +0 -1
- package/dist/services/fetcher/retry-policy.js +0 -131
- package/dist/services/fetcher/retry-policy.js.map +0 -1
- package/dist/services/fetcher.d.ts +0 -25
- package/dist/services/fetcher.d.ts.map +0 -1
- package/dist/services/fetcher.js +0 -607
- package/dist/services/fetcher.js.map +0 -1
- package/dist/services/fetcher.service.d.ts +0 -18
- package/dist/services/fetcher.service.d.ts.map +0 -1
- package/dist/services/fetcher.service.js +0 -122
- package/dist/services/fetcher.service.js.map +0 -1
- package/dist/services/fifo-queue.d.ts +0 -8
- package/dist/services/fifo-queue.js +0 -25
- package/dist/services/logger.d.ts +0 -5
- package/dist/services/logger.d.ts.map +0 -1
- package/dist/services/logger.js +0 -52
- package/dist/services/logger.js.map +0 -1
- package/dist/services/logger.service.d.ts +0 -5
- package/dist/services/logger.service.d.ts.map +0 -1
- package/dist/services/logger.service.js +0 -57
- package/dist/services/logger.service.js.map +0 -1
- package/dist/services/metadata-collector.d.ts +0 -2
- package/dist/services/metadata-collector.js +0 -80
- package/dist/services/parser.d.ts +0 -6
- package/dist/services/parser.d.ts.map +0 -1
- package/dist/services/parser.js +0 -278
- package/dist/services/parser.js.map +0 -1
- package/dist/services/parser.service.d.ts +0 -42
- package/dist/services/parser.service.d.ts.map +0 -1
- package/dist/services/parser.service.js +0 -209
- package/dist/services/parser.service.js.map +0 -1
- package/dist/services/session-manager.d.ts +0 -18
- package/dist/services/session-manager.d.ts.map +0 -1
- package/dist/services/session-manager.js +0 -73
- package/dist/services/session-manager.js.map +0 -1
- package/dist/services/telemetry.d.ts +0 -19
- package/dist/services/telemetry.js +0 -43
- package/dist/services/transform-worker-pool.d.ts +0 -11
- package/dist/services/transform-worker-pool.js +0 -244
- package/dist/services/transform-worker-types.d.ts +0 -32
- package/dist/services/transform-worker-types.js +0 -14
- package/dist/strategies/exponential-backoff-strategy.d.ts +0 -13
- package/dist/strategies/exponential-backoff-strategy.d.ts.map +0 -1
- package/dist/strategies/exponential-backoff-strategy.js +0 -32
- package/dist/strategies/exponential-backoff-strategy.js.map +0 -1
- package/dist/tools/handlers/fetch-links/link-extractor.d.ts +0 -4
- package/dist/tools/handlers/fetch-links/link-extractor.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-links/link-extractor.js +0 -159
- package/dist/tools/handlers/fetch-links/link-extractor.js.map +0 -1
- package/dist/tools/handlers/fetch-links.tool.d.ts +0 -5
- package/dist/tools/handlers/fetch-links.tool.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-links.tool.js +0 -98
- package/dist/tools/handlers/fetch-links.tool.js.map +0 -1
- package/dist/tools/handlers/fetch-markdown.tool.d.ts +0 -11
- package/dist/tools/handlers/fetch-markdown.tool.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-markdown.tool.js +0 -97
- package/dist/tools/handlers/fetch-markdown.tool.js.map +0 -1
- package/dist/tools/handlers/fetch-single.shared.d.ts +0 -31
- package/dist/tools/handlers/fetch-single.shared.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-single.shared.js +0 -223
- package/dist/tools/handlers/fetch-single.shared.js.map +0 -1
- package/dist/tools/handlers/fetch-url.tool.d.ts +0 -10
- package/dist/tools/handlers/fetch-url.tool.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-url.tool.js +0 -119
- package/dist/tools/handlers/fetch-url.tool.js.map +0 -1
- package/dist/tools/handlers/fetch-urls/processor.d.ts +0 -13
- package/dist/tools/handlers/fetch-urls/processor.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-urls/processor.js +0 -153
- package/dist/tools/handlers/fetch-urls/processor.js.map +0 -1
- package/dist/tools/handlers/fetch-urls/response.d.ts +0 -3
- package/dist/tools/handlers/fetch-urls/response.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-urls/response.js +0 -79
- package/dist/tools/handlers/fetch-urls/response.js.map +0 -1
- package/dist/tools/handlers/fetch-urls/validation.d.ts +0 -5
- package/dist/tools/handlers/fetch-urls/validation.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-urls/validation.js +0 -18
- package/dist/tools/handlers/fetch-urls/validation.js.map +0 -1
- package/dist/tools/handlers/fetch-urls.tool.d.ts +0 -5
- package/dist/tools/handlers/fetch-urls.tool.d.ts.map +0 -1
- package/dist/tools/handlers/fetch-urls.tool.js +0 -124
- package/dist/tools/handlers/fetch-urls.tool.js.map +0 -1
- package/dist/tools/index.d.ts +0 -3
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -37
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/schemas.d.ts +0 -12
- package/dist/tools/schemas.d.ts.map +0 -1
- package/dist/tools/schemas.js +0 -21
- package/dist/tools/schemas.js.map +0 -1
- package/dist/tools/utils/cache-vary.d.ts +0 -1
- package/dist/tools/utils/cache-vary.d.ts.map +0 -1
- package/dist/tools/utils/cache-vary.js +0 -12
- package/dist/tools/utils/cache-vary.js.map +0 -1
- package/dist/tools/utils/cached-markdown.d.ts +0 -5
- package/dist/tools/utils/cached-markdown.js +0 -46
- package/dist/tools/utils/common.d.ts +0 -5
- package/dist/tools/utils/common.d.ts.map +0 -1
- package/dist/tools/utils/common.js +0 -42
- package/dist/tools/utils/common.js.map +0 -1
- package/dist/tools/utils/content-shaping.d.ts +0 -4
- package/dist/tools/utils/content-shaping.js +0 -67
- package/dist/tools/utils/content-transform-async.d.ts +0 -6
- package/dist/tools/utils/content-transform-async.js +0 -33
- package/dist/tools/utils/content-transform-core.d.ts +0 -5
- package/dist/tools/utils/content-transform-core.js +0 -180
- package/dist/tools/utils/content-transform-workers.d.ts +0 -1
- package/dist/tools/utils/content-transform-workers.js +0 -1
- package/dist/tools/utils/content-transform.d.ts +0 -3
- package/dist/tools/utils/content-transform.d.ts.map +0 -1
- package/dist/tools/utils/content-transform.js +0 -41
- package/dist/tools/utils/content-transform.js.map +0 -1
- package/dist/tools/utils/fetch-pipeline.d.ts +0 -2
- package/dist/tools/utils/fetch-pipeline.d.ts.map +0 -1
- package/dist/tools/utils/fetch-pipeline.js +0 -98
- package/dist/tools/utils/fetch-pipeline.js.map +0 -1
- package/dist/tools/utils/frontmatter.d.ts +0 -3
- package/dist/tools/utils/frontmatter.js +0 -73
- package/dist/tools/utils/index.d.ts +0 -4
- package/dist/tools/utils/index.d.ts.map +0 -1
- package/dist/tools/utils/index.js +0 -3
- package/dist/tools/utils/index.js.map +0 -1
- package/dist/tools/utils/inline-content.d.ts +0 -10
- package/dist/tools/utils/inline-content.d.ts.map +0 -1
- package/dist/tools/utils/inline-content.js +0 -35
- package/dist/tools/utils/inline-content.js.map +0 -1
- package/dist/tools/utils/markdown-heuristics.d.ts +0 -1
- package/dist/tools/utils/markdown-heuristics.js +0 -19
- package/dist/tools/utils/markdown-signals.d.ts +0 -1
- package/dist/tools/utils/markdown-signals.js +0 -19
- package/dist/tools/utils/markdown-toc.d.ts +0 -3
- package/dist/tools/utils/markdown-toc.d.ts.map +0 -1
- package/dist/tools/utils/markdown-toc.js +0 -35
- package/dist/tools/utils/markdown-toc.js.map +0 -1
- package/dist/tools/utils/raw-markdown-frontmatter.d.ts +0 -3
- package/dist/tools/utils/raw-markdown-frontmatter.js +0 -73
- package/dist/tools/utils/raw-markdown.d.ts +0 -6
- package/dist/tools/utils/raw-markdown.js +0 -149
- package/dist/tools/utils/response-builder.d.ts +0 -3
- package/dist/tools/utils/response-builder.d.ts.map +0 -1
- package/dist/tools/utils/response-builder.js +0 -24
- package/dist/tools/utils/response-builder.js.map +0 -1
- package/dist/tools/utils/tool-response.d.ts +0 -9
- package/dist/tools/utils/tool-response.d.ts.map +0 -1
- package/dist/tools/utils/tool-response.js +0 -19
- package/dist/tools/utils/tool-response.js.map +0 -1
- package/dist/transformers/jsonl.transformer.d.ts +0 -2
- package/dist/transformers/jsonl.transformer.d.ts.map +0 -1
- package/dist/transformers/jsonl.transformer.js +0 -75
- package/dist/transformers/jsonl.transformer.js.map +0 -1
- package/dist/transformers/markdown/fenced-code-rule.d.ts +0 -2
- package/dist/transformers/markdown/fenced-code-rule.js +0 -38
- package/dist/transformers/markdown/frontmatter.d.ts +0 -2
- package/dist/transformers/markdown/frontmatter.js +0 -45
- package/dist/transformers/markdown/noise-rule.d.ts +0 -2
- package/dist/transformers/markdown/noise-rule.js +0 -80
- package/dist/transformers/markdown/turndown-instance.d.ts +0 -2
- package/dist/transformers/markdown/turndown-instance.js +0 -19
- package/dist/transformers/markdown.d.ts +0 -5
- package/dist/transformers/markdown.js +0 -314
- package/dist/transformers/markdown.transformer.d.ts +0 -2
- package/dist/transformers/markdown.transformer.d.ts.map +0 -1
- package/dist/transformers/markdown.transformer.js +0 -14
- package/dist/transformers/markdown.transformer.js.map +0 -1
- package/dist/types/content.types.d.ts +0 -63
- package/dist/types/content.types.d.ts.map +0 -1
- package/dist/types/content.types.js +0 -2
- package/dist/types/content.types.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/schemas.d.ts +0 -49
- package/dist/types/schemas.d.ts.map +0 -1
- package/dist/types/schemas.js +0 -5
- package/dist/types/schemas.js.map +0 -1
- package/dist/utils/cached-payload.d.ts +0 -7
- package/dist/utils/cached-payload.js +0 -36
- package/dist/utils/cancellation.d.ts +0 -1
- package/dist/utils/cancellation.js +0 -18
- package/dist/utils/code-language-bash.d.ts +0 -1
- package/dist/utils/code-language-bash.js +0 -48
- package/dist/utils/code-language-core.d.ts +0 -2
- package/dist/utils/code-language-core.js +0 -13
- package/dist/utils/code-language-detectors.d.ts +0 -5
- package/dist/utils/code-language-detectors.js +0 -142
- package/dist/utils/code-language-helpers.d.ts +0 -5
- package/dist/utils/code-language-helpers.js +0 -62
- package/dist/utils/code-language-parsing.d.ts +0 -5
- package/dist/utils/code-language-parsing.js +0 -62
- package/dist/utils/code-language.d.ts +0 -2
- package/dist/utils/code-language.d.ts.map +0 -1
- package/dist/utils/code-language.js +0 -260
- package/dist/utils/code-language.js.map +0 -1
- package/dist/utils/concurrency.d.ts +0 -3
- package/dist/utils/concurrency.d.ts.map +0 -1
- package/dist/utils/concurrency.js +0 -38
- package/dist/utils/concurrency.js.map +0 -1
- package/dist/utils/content-cleaner.d.ts +0 -5
- package/dist/utils/content-cleaner.d.ts.map +0 -1
- package/dist/utils/content-cleaner.js +0 -77
- package/dist/utils/content-cleaner.js.map +0 -1
- package/dist/utils/crypto.d.ts +0 -2
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js +0 -32
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/download-url.d.ts +0 -16
- package/dist/utils/download-url.d.ts.map +0 -1
- package/dist/utils/download-url.js +0 -30
- package/dist/utils/download-url.js.map +0 -1
- package/dist/utils/error-details.d.ts +0 -3
- package/dist/utils/error-details.js +0 -12
- package/dist/utils/error-utils.d.ts +0 -3
- package/dist/utils/error-utils.d.ts.map +0 -1
- package/dist/utils/error-utils.js +0 -12
- package/dist/utils/error-utils.js.map +0 -1
- package/dist/utils/filename-generator.d.ts +0 -1
- package/dist/utils/filename-generator.d.ts.map +0 -1
- package/dist/utils/filename-generator.js +0 -81
- package/dist/utils/filename-generator.js.map +0 -1
- package/dist/utils/guards.d.ts +0 -1
- package/dist/utils/guards.js +0 -3
- package/dist/utils/header-normalizer.d.ts +0 -5
- package/dist/utils/header-normalizer.d.ts.map +0 -1
- package/dist/utils/header-normalizer.js +0 -31
- package/dist/utils/header-normalizer.js.map +0 -1
- package/dist/utils/host-normalizer.d.ts +0 -1
- package/dist/utils/host-normalizer.js +0 -37
- package/dist/utils/html-truncator.d.ts +0 -1
- package/dist/utils/html-truncator.d.ts.map +0 -1
- package/dist/utils/html-truncator.js +0 -13
- package/dist/utils/html-truncator.js.map +0 -1
- package/dist/utils/ip-address.d.ts +0 -4
- package/dist/utils/ip-address.js +0 -6
- package/dist/utils/language-detector.d.ts +0 -2
- package/dist/utils/language-detector.d.ts.map +0 -1
- package/dist/utils/language-detector.js +0 -39
- package/dist/utils/language-detector.js.map +0 -1
- package/dist/utils/sanitizer.d.ts +0 -2
- package/dist/utils/sanitizer.d.ts.map +0 -1
- package/dist/utils/sanitizer.js +0 -20
- package/dist/utils/sanitizer.js.map +0 -1
- package/dist/utils/tool-error-handler.d.ts +0 -3
- package/dist/utils/tool-error-handler.d.ts.map +0 -1
- package/dist/utils/tool-error-handler.js +0 -31
- package/dist/utils/tool-error-handler.js.map +0 -1
- package/dist/utils/url-redactor.d.ts +0 -1
- package/dist/utils/url-redactor.js +0 -13
- package/dist/utils/url-sanitizer.d.ts +0 -2
- package/dist/utils/url-sanitizer.d.ts.map +0 -1
- package/dist/utils/url-sanitizer.js +0 -12
- package/dist/utils/url-sanitizer.js.map +0 -1
- package/dist/utils/url-transformer.d.ts +0 -7
- package/dist/utils/url-transformer.js +0 -147
- package/dist/utils/url-validator.d.ts +0 -6
- package/dist/utils/url-validator.d.ts.map +0 -1
- package/dist/utils/url-validator.js +0 -156
- package/dist/utils/url-validator.js.map +0 -1
- package/dist/workers/content-transform.worker.d.ts +0 -1
- package/dist/workers/content-transform.worker.js +0 -40
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface MetadataBlock {
|
|
2
|
-
type: 'metadata';
|
|
3
|
-
title?: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
author?: string;
|
|
6
|
-
url: string;
|
|
7
|
-
fetchedAt: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ExtractedArticle {
|
|
10
|
-
title?: string;
|
|
11
|
-
byline?: string;
|
|
12
|
-
content: string;
|
|
13
|
-
textContent: string;
|
|
14
|
-
excerpt?: string;
|
|
15
|
-
siteName?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface CacheEntry {
|
|
18
|
-
url: string;
|
|
19
|
-
title?: string;
|
|
20
|
-
content: string;
|
|
21
|
-
fetchedAt: string;
|
|
22
|
-
expiresAt: string;
|
|
23
|
-
}
|
|
24
|
-
export interface ExtractedMetadata {
|
|
25
|
-
title?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
author?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface ExtractionResult {
|
|
30
|
-
article: ExtractedArticle | null;
|
|
31
|
-
metadata: ExtractedMetadata;
|
|
32
|
-
}
|
|
33
|
-
export interface MarkdownTransformResult {
|
|
34
|
-
markdown: string;
|
|
35
|
-
title: string | undefined;
|
|
36
|
-
truncated: boolean;
|
|
37
|
-
}
|
|
38
|
-
export interface TransformOptions {
|
|
39
|
-
includeMetadata: boolean;
|
|
40
|
-
signal?: AbortSignal;
|
|
41
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/config/types/content.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GACjB,UAAU,GACV,SAAS,GACT,WAAW,GACX,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,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M,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/config/types/content.ts"],"names":[],"mappings":""}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
2
|
-
export interface RateLimitEntry {
|
|
3
|
-
count: number;
|
|
4
|
-
resetTime: number;
|
|
5
|
-
lastAccessed: number;
|
|
6
|
-
}
|
|
7
|
-
export interface RateLimiterOptions {
|
|
8
|
-
maxRequests: number;
|
|
9
|
-
windowMs: number;
|
|
10
|
-
cleanupIntervalMs: number;
|
|
11
|
-
}
|
|
12
|
-
export type ToolContentBlock = {
|
|
13
|
-
type: 'text';
|
|
14
|
-
text: string;
|
|
15
|
-
} | {
|
|
16
|
-
type: 'resource_link';
|
|
17
|
-
uri: string;
|
|
18
|
-
name: string;
|
|
19
|
-
title?: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
mimeType?: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'resource';
|
|
24
|
-
resource: {
|
|
25
|
-
uri: string;
|
|
26
|
-
mimeType?: string;
|
|
27
|
-
text: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export interface FetchOptions {
|
|
31
|
-
signal?: AbortSignal;
|
|
32
|
-
}
|
|
33
|
-
export interface SessionEntry {
|
|
34
|
-
readonly transport: StreamableHTTPServerTransport;
|
|
35
|
-
createdAt: number;
|
|
36
|
-
lastSeen: number;
|
|
37
|
-
}
|
|
38
|
-
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
39
|
-
export type LogMetadata = Record<string, unknown>;
|
|
40
|
-
export interface McpRequestParams {
|
|
41
|
-
_meta?: Record<string, unknown>;
|
|
42
|
-
[key: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface McpRequestBody {
|
|
45
|
-
jsonrpc: '2.0';
|
|
46
|
-
method: string;
|
|
47
|
-
id?: string | number;
|
|
48
|
-
params?: McpRequestParams;
|
|
49
|
-
}
|
|
50
|
-
export interface FetchPipelineOptions<T> {
|
|
51
|
-
/** URL to fetch */
|
|
52
|
-
url: string;
|
|
53
|
-
/** Cache namespace (e.g., 'markdown') */
|
|
54
|
-
cacheNamespace: string;
|
|
55
|
-
/** Optional: AbortSignal for request cancellation */
|
|
56
|
-
signal?: AbortSignal;
|
|
57
|
-
/** Optional: cache variation input for headers/flags */
|
|
58
|
-
cacheVary?: Record<string, unknown> | string;
|
|
59
|
-
/** Transform function to process HTML into desired format */
|
|
60
|
-
transform: (html: string, url: string) => T | Promise<T>;
|
|
61
|
-
/** Optional: serialize result for caching (defaults to JSON.stringify) */
|
|
62
|
-
serialize?: (result: T) => string;
|
|
63
|
-
/** Optional: deserialize cached content */
|
|
64
|
-
deserialize?: (cached: string) => T | undefined;
|
|
65
|
-
}
|
|
66
|
-
export interface PipelineResult<T> {
|
|
67
|
-
data: T;
|
|
68
|
-
fromCache: boolean;
|
|
69
|
-
url: string;
|
|
70
|
-
fetchedAt: string;
|
|
71
|
-
cacheKey?: string | null;
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/config/types/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAExG,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kB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0,0 @@
|
|
|
1
|
-
import type { ToolContentBlock } from './runtime.js';
|
|
2
|
-
export interface FetchUrlInput {
|
|
3
|
-
url: string;
|
|
4
|
-
}
|
|
5
|
-
export interface ErrorResponse {
|
|
6
|
-
error: {
|
|
7
|
-
message: string;
|
|
8
|
-
code: string;
|
|
9
|
-
statusCode: number;
|
|
10
|
-
details?: Record<string, unknown>;
|
|
11
|
-
stack?: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export interface ToolErrorResponse {
|
|
15
|
-
[x: string]: unknown;
|
|
16
|
-
content: ToolContentBlock[];
|
|
17
|
-
structuredContent: {
|
|
18
|
-
error: string;
|
|
19
|
-
url: string;
|
|
20
|
-
};
|
|
21
|
-
isError: true;
|
|
22
|
-
}
|
|
23
|
-
export interface ToolResponseBase {
|
|
24
|
-
[x: string]: unknown;
|
|
25
|
-
content: ToolContentBlock[];
|
|
26
|
-
structuredContent?: Record<string, unknown>;
|
|
27
|
-
isError?: boolean;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/config/types/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,UAAU,cAAc;IACtB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/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/tools.ts"],"names":[],"mappings":""}
|
package/dist/config/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,kBAAkB,CAAC"}
|
package/dist/config/types.js
DELETED
package/dist/config/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare class FetchError extends Error {
|
|
2
|
-
readonly url: string;
|
|
3
|
-
readonly statusCode: number;
|
|
4
|
-
readonly code: string;
|
|
5
|
-
readonly details: Readonly<Record<string, unknown>>;
|
|
6
|
-
constructor(message: string, url: string, httpStatus?: number, details?: Record<string, unknown>);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-error.d.ts","sourceRoot":"","sources":["../../src/errors/app-error.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAW,SAAQ,KAAK;IAOjC,QAAQ,CAAC,GAAG,EAAE,MAAM;IANtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;gBAGlD,OAAO,EAAE,MAAM,EACN,GAAG,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CASxC"}
|
package/dist/errors/app-error.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const DEFAULT_HTTP_STATUS = 502;
|
|
2
|
-
export class FetchError extends Error {
|
|
3
|
-
url;
|
|
4
|
-
statusCode;
|
|
5
|
-
code;
|
|
6
|
-
details;
|
|
7
|
-
constructor(message, url, httpStatus, details = {}) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.url = url;
|
|
10
|
-
this.name = 'FetchError';
|
|
11
|
-
this.statusCode = httpStatus ?? DEFAULT_HTTP_STATUS;
|
|
12
|
-
this.code = httpStatus ? `HTTP_${httpStatus}` : 'FETCH_ERROR';
|
|
13
|
-
this.details = Object.freeze({ url, httpStatus, ...details });
|
|
14
|
-
Error.captureStackTrace(this, this.constructor);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-error.js","sourceRoot":"","sources":["../../src/errors/app-error.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,KAAK;IAOxB;IANF,UAAU,CAAS;IACnB,IAAI,CAAS;IACb,OAAO,CAAoC;IAEpD,YACE,OAAe,EACN,GAAW,EACpB,UAAmB,EACnB,UAAmC,EAAE;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,QAAG,GAAH,GAAG,CAAQ;QAKpB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,mBAAmB,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAC9D,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CACF"}
|
package/dist/errors/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/errors/index.js
DELETED
package/dist/errors/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
function getAcceptHeader(req) {
|
|
2
|
-
const value = req.headers.accept;
|
|
3
|
-
if (typeof value === 'string')
|
|
4
|
-
return value;
|
|
5
|
-
return '';
|
|
6
|
-
}
|
|
7
|
-
function setAcceptHeader(req, value) {
|
|
8
|
-
req.headers.accept = value;
|
|
9
|
-
const { rawHeaders } = req;
|
|
10
|
-
if (!Array.isArray(rawHeaders))
|
|
11
|
-
return;
|
|
12
|
-
for (let i = 0; i + 1 < rawHeaders.length; i += 2) {
|
|
13
|
-
const key = rawHeaders[i];
|
|
14
|
-
if (typeof key === 'string' && key.toLowerCase() === 'accept') {
|
|
15
|
-
rawHeaders[i + 1] = value;
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
rawHeaders.push('Accept', value);
|
|
20
|
-
}
|
|
21
|
-
function hasToken(header, token) {
|
|
22
|
-
return header
|
|
23
|
-
.split(',')
|
|
24
|
-
.map((part) => part.trim().toLowerCase())
|
|
25
|
-
.some((part) => part === token || part.startsWith(`${token};`));
|
|
26
|
-
}
|
|
27
|
-
export function ensurePostAcceptHeader(req) {
|
|
28
|
-
const accept = getAcceptHeader(req);
|
|
29
|
-
// Some clients send */* or omit Accept; the SDK transport is picky.
|
|
30
|
-
if (!accept || hasToken(accept, '*/*')) {
|
|
31
|
-
setAcceptHeader(req, 'application/json, text/event-stream');
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const hasJson = hasToken(accept, 'application/json');
|
|
35
|
-
const hasSse = hasToken(accept, 'text/event-stream');
|
|
36
|
-
if (!hasJson || !hasSse) {
|
|
37
|
-
setAcceptHeader(req, 'application/json, text/event-stream');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export function acceptsEventStream(req) {
|
|
41
|
-
const accept = getAcceptHeader(req);
|
|
42
|
-
if (!accept)
|
|
43
|
-
return false;
|
|
44
|
-
return hasToken(accept, 'text/event-stream');
|
|
45
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { InvalidTokenError, ServerError, } from '@modelcontextprotocol/sdk/server/auth/errors.js';
|
|
2
|
-
import { config } from '../config/index.js';
|
|
3
|
-
import { isRecord } from '../utils/guards.js';
|
|
4
|
-
function stripHash(url) {
|
|
5
|
-
const copy = new URL(url.href);
|
|
6
|
-
copy.hash = '';
|
|
7
|
-
return copy.href;
|
|
8
|
-
}
|
|
9
|
-
function parseScopes(value) {
|
|
10
|
-
if (typeof value === 'string') {
|
|
11
|
-
return value
|
|
12
|
-
.split(' ')
|
|
13
|
-
.map((scope) => scope.trim())
|
|
14
|
-
.filter((scope) => scope.length > 0);
|
|
15
|
-
}
|
|
16
|
-
if (Array.isArray(value)) {
|
|
17
|
-
return value.filter((scope) => typeof scope === 'string');
|
|
18
|
-
}
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
function parseResourceUrl(value) {
|
|
22
|
-
if (typeof value !== 'string')
|
|
23
|
-
return undefined;
|
|
24
|
-
if (!URL.canParse(value))
|
|
25
|
-
return undefined;
|
|
26
|
-
return new URL(value);
|
|
27
|
-
}
|
|
28
|
-
function parseAudResource(aud) {
|
|
29
|
-
if (typeof aud === 'string') {
|
|
30
|
-
return parseResourceUrl(aud);
|
|
31
|
-
}
|
|
32
|
-
if (Array.isArray(aud)) {
|
|
33
|
-
for (const entry of aud) {
|
|
34
|
-
const parsed = parseResourceUrl(entry);
|
|
35
|
-
if (parsed)
|
|
36
|
-
return parsed;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
function extractResource(data) {
|
|
42
|
-
const resource = parseResourceUrl(data.resource);
|
|
43
|
-
if (resource)
|
|
44
|
-
return resource;
|
|
45
|
-
return parseAudResource(data.aud);
|
|
46
|
-
}
|
|
47
|
-
function extractScopes(data) {
|
|
48
|
-
if (data.scope !== undefined) {
|
|
49
|
-
return parseScopes(data.scope);
|
|
50
|
-
}
|
|
51
|
-
if (data.scopes !== undefined) {
|
|
52
|
-
return parseScopes(data.scopes);
|
|
53
|
-
}
|
|
54
|
-
if (data.scp !== undefined) {
|
|
55
|
-
return parseScopes(data.scp);
|
|
56
|
-
}
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
function readExpiresAt(data) {
|
|
60
|
-
const expiresAt = typeof data.exp === 'number' ? data.exp : Number.NaN;
|
|
61
|
-
if (!Number.isFinite(expiresAt)) {
|
|
62
|
-
throw new InvalidTokenError('Token has no expiration time');
|
|
63
|
-
}
|
|
64
|
-
return expiresAt;
|
|
65
|
-
}
|
|
66
|
-
function resolveClientId(data) {
|
|
67
|
-
if (typeof data.client_id === 'string')
|
|
68
|
-
return data.client_id;
|
|
69
|
-
if (typeof data.cid === 'string')
|
|
70
|
-
return data.cid;
|
|
71
|
-
if (typeof data.sub === 'string')
|
|
72
|
-
return data.sub;
|
|
73
|
-
return 'unknown';
|
|
74
|
-
}
|
|
75
|
-
function ensureResourceMatch(resource) {
|
|
76
|
-
if (resource && stripHash(resource) !== stripHash(config.auth.resourceUrl)) {
|
|
77
|
-
throw new InvalidTokenError('Token resource mismatch');
|
|
78
|
-
}
|
|
79
|
-
return resource;
|
|
80
|
-
}
|
|
81
|
-
function buildIntrospectionAuthInfo(token, data) {
|
|
82
|
-
const resource = ensureResourceMatch(extractResource(data));
|
|
83
|
-
return {
|
|
84
|
-
token,
|
|
85
|
-
clientId: resolveClientId(data),
|
|
86
|
-
scopes: extractScopes(data),
|
|
87
|
-
expiresAt: readExpiresAt(data),
|
|
88
|
-
resource: resource ?? config.auth.resourceUrl,
|
|
89
|
-
extra: data,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function buildBasicAuthHeader(clientId, clientSecret) {
|
|
93
|
-
const secret = clientSecret ?? '';
|
|
94
|
-
const basic = Buffer.from(`${clientId}:${secret}`, 'utf8').toString('base64');
|
|
95
|
-
return `Basic ${basic}`;
|
|
96
|
-
}
|
|
97
|
-
function buildIntrospectionRequest(token, resourceUrl, clientId, clientSecret) {
|
|
98
|
-
const body = new URLSearchParams({
|
|
99
|
-
token,
|
|
100
|
-
token_type_hint: 'access_token',
|
|
101
|
-
resource: stripHash(resourceUrl),
|
|
102
|
-
}).toString();
|
|
103
|
-
const headers = {
|
|
104
|
-
'content-type': 'application/x-www-form-urlencoded',
|
|
105
|
-
};
|
|
106
|
-
if (clientId) {
|
|
107
|
-
headers.authorization = buildBasicAuthHeader(clientId, clientSecret);
|
|
108
|
-
}
|
|
109
|
-
return { body, headers };
|
|
110
|
-
}
|
|
111
|
-
async function requestIntrospection(introspectionUrl, request, timeoutMs) {
|
|
112
|
-
const response = await fetch(introspectionUrl, {
|
|
113
|
-
method: 'POST',
|
|
114
|
-
headers: request.headers,
|
|
115
|
-
body: request.body,
|
|
116
|
-
signal: AbortSignal.timeout(timeoutMs),
|
|
117
|
-
});
|
|
118
|
-
if (!response.ok) {
|
|
119
|
-
await response.body?.cancel();
|
|
120
|
-
throw new ServerError(`Token introspection failed: ${response.status}`);
|
|
121
|
-
}
|
|
122
|
-
return response.json();
|
|
123
|
-
}
|
|
124
|
-
function parseIntrospectionPayload(payload) {
|
|
125
|
-
if (!isRecord(payload) || Array.isArray(payload)) {
|
|
126
|
-
throw new ServerError('Invalid introspection response');
|
|
127
|
-
}
|
|
128
|
-
if (payload.active !== true) {
|
|
129
|
-
throw new InvalidTokenError('Token is inactive');
|
|
130
|
-
}
|
|
131
|
-
return payload;
|
|
132
|
-
}
|
|
133
|
-
export async function verifyWithIntrospection(token) {
|
|
134
|
-
const { auth } = config;
|
|
135
|
-
if (!auth.introspectionUrl) {
|
|
136
|
-
throw new ServerError('Token introspection is not configured');
|
|
137
|
-
}
|
|
138
|
-
const request = buildIntrospectionRequest(token, auth.resourceUrl, auth.clientId, auth.clientSecret);
|
|
139
|
-
const payload = await requestIntrospection(auth.introspectionUrl, request, auth.introspectionTimeoutMs);
|
|
140
|
-
return buildIntrospectionAuthInfo(token, parseIntrospectionPayload(payload));
|
|
141
|
-
}
|
package/dist/http/auth-static.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InvalidTokenError } from '@modelcontextprotocol/sdk/server/auth/errors.js';
|
|
2
|
-
import { config } from '../config/index.js';
|
|
3
|
-
import { timingSafeEqualUtf8 } from '../utils/crypto.js';
|
|
4
|
-
const STATIC_TOKEN_TTL_SECONDS = 60 * 60 * 24;
|
|
5
|
-
function buildStaticAuthInfo(token) {
|
|
6
|
-
return {
|
|
7
|
-
token,
|
|
8
|
-
clientId: 'static-token',
|
|
9
|
-
scopes: config.auth.requiredScopes,
|
|
10
|
-
expiresAt: Math.floor(Date.now() / 1000) + STATIC_TOKEN_TTL_SECONDS,
|
|
11
|
-
resource: config.auth.resourceUrl,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function verifyStaticToken(token) {
|
|
15
|
-
if (config.auth.staticTokens.length === 0) {
|
|
16
|
-
throw new InvalidTokenError('No static tokens configured');
|
|
17
|
-
}
|
|
18
|
-
const matched = config.auth.staticTokens.some((candidate) => timingSafeEqualUtf8(candidate, token));
|
|
19
|
-
if (!matched) {
|
|
20
|
-
throw new InvalidTokenError('Invalid token');
|
|
21
|
-
}
|
|
22
|
-
return buildStaticAuthInfo(token);
|
|
23
|
-
}
|
package/dist/http/auth.d.ts
DELETED
package/dist/http/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/http/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAsC/D,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,GAChB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAa3D"}
|