@spotlightjs/spotlight 4.6.0 → 4.7.1
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/_virtual/_commonjsHelpers.js +9 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/_sentry-release-injection-file.js +11 -0
- package/dist/_virtual/_sentry-release-injection-file.js.map +1 -0
- package/dist/_virtual/cache.js +8 -0
- package/dist/_virtual/cache.js.map +1 -1
- package/dist/_virtual/index.js +8 -0
- package/dist/_virtual/index.js.map +1 -1
- package/dist/_virtual/uri.all.js +8 -0
- package/dist/_virtual/uri.all.js.map +1 -1
- package/dist/instrument.js +9 -0
- package/dist/instrument.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +8 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js +47 -39
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js +18 -9
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js +24 -15
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js +14 -5
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/ucs2length.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/ucs2length.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/required.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/required.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js +9 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json.js +8 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json.js.map +1 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/json-schema-draft-07.json.js +8 -0
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/json-schema-draft-07.json.js.map +1 -1
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +9 -0
- package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js.map +1 -1
- package/dist/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js +9 -0
- package/dist/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js.map +1 -1
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/helper/streaming/sse.js +8 -0
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/helper/streaming/sse.js.map +1 -1
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/middleware/cors/index.js +8 -0
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/middleware/cors/index.js.map +1 -1
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/utils/html.js +8 -0
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/utils/html.js.map +1 -1
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/utils/stream.js +8 -0
- package/dist/node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/utils/stream.js.map +1 -1
- package/dist/node_modules/.pnpm/json-schema-traverse@0.4.1/node_modules/json-schema-traverse/index.js +9 -0
- package/dist/node_modules/.pnpm/json-schema-traverse@0.4.1/node_modules/json-schema-traverse/index.js.map +1 -1
- package/dist/node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js +9 -1
- package/dist/node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +8 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -1
- package/dist/run.js +10 -0
- package/dist/run.js.map +1 -1
- package/dist/sentry-config.js +12 -2
- package/dist/sentry-config.js.map +1 -1
- package/dist/server/cli/help.js +17 -0
- package/dist/server/cli/help.js.map +1 -1
- package/dist/server/cli/mcp.d.ts +1 -1
- package/dist/server/cli/mcp.js +21 -9
- package/dist/server/cli/mcp.js.map +1 -1
- package/dist/server/cli/run.d.ts +1 -1
- package/dist/server/cli/run.js +28 -3
- package/dist/server/cli/run.js.map +1 -1
- package/dist/server/cli/server.d.ts +1 -1
- package/dist/server/cli/server.js +12 -2
- package/dist/server/cli/server.js.map +1 -1
- package/dist/server/cli/tail.d.ts +1 -1
- package/dist/server/cli/tail.js +18 -2
- package/dist/server/cli/tail.js.map +1 -1
- package/dist/server/cli.d.ts +1 -0
- package/dist/server/cli.js +30 -4
- package/dist/server/cli.js.map +1 -1
- package/dist/server/constants.js +9 -0
- package/dist/server/constants.js.map +1 -1
- package/dist/server/formatters/human/errors.js +9 -0
- package/dist/server/formatters/human/errors.js.map +1 -1
- package/dist/server/formatters/human/index.js +9 -0
- package/dist/server/formatters/human/index.js.map +1 -1
- package/dist/server/formatters/human/logs.js +9 -0
- package/dist/server/formatters/human/logs.js.map +1 -1
- package/dist/server/formatters/human/traces.js +9 -0
- package/dist/server/formatters/human/traces.js.map +1 -1
- package/dist/server/formatters/human/utils.js +9 -0
- package/dist/server/formatters/human/utils.js.map +1 -1
- package/dist/server/formatters/index.js +9 -0
- package/dist/server/formatters/index.js.map +1 -1
- package/dist/server/formatters/json/errors.js +9 -0
- package/dist/server/formatters/json/errors.js.map +1 -1
- package/dist/server/formatters/json/index.js +9 -0
- package/dist/server/formatters/json/index.js.map +1 -1
- package/dist/server/formatters/json/logs.js +9 -0
- package/dist/server/formatters/json/logs.js.map +1 -1
- package/dist/server/formatters/json/traces.js +9 -0
- package/dist/server/formatters/json/traces.js.map +1 -1
- package/dist/server/formatters/logfmt/errors.js +9 -0
- package/dist/server/formatters/logfmt/errors.js.map +1 -1
- package/dist/server/formatters/logfmt/index.js +9 -0
- package/dist/server/formatters/logfmt/index.js.map +1 -1
- package/dist/server/formatters/logfmt/logs.js +9 -0
- package/dist/server/formatters/logfmt/logs.js.map +1 -1
- package/dist/server/formatters/logfmt/traces.js +9 -0
- package/dist/server/formatters/logfmt/traces.js.map +1 -1
- package/dist/server/formatters/md/errors.js +9 -0
- package/dist/server/formatters/md/errors.js.map +1 -1
- package/dist/server/formatters/md/event.js +9 -0
- package/dist/server/formatters/md/event.js.map +1 -1
- package/dist/server/formatters/md/index.js +9 -0
- package/dist/server/formatters/md/index.js.map +1 -1
- package/dist/server/formatters/md/logs.js +9 -0
- package/dist/server/formatters/md/logs.js.map +1 -1
- package/dist/server/formatters/md/traces.js +9 -0
- package/dist/server/formatters/md/traces.js.map +1 -1
- package/dist/server/formatters/shared/data-builders.js +9 -0
- package/dist/server/formatters/shared/data-builders.js.map +1 -1
- package/dist/server/formatters/types.js +9 -0
- package/dist/server/formatters/types.js.map +1 -1
- package/dist/server/formatters/utils.js +9 -0
- package/dist/server/formatters/utils.js.map +1 -1
- package/dist/server/handlers/fileToServe.js +9 -0
- package/dist/server/handlers/fileToServe.js.map +1 -1
- package/dist/server/logger.js +9 -0
- package/dist/server/logger.js.map +1 -1
- package/dist/server/main.d.ts +1 -1
- package/dist/server/main.js +22 -4
- package/dist/server/main.js.map +1 -1
- package/dist/server/mcp/constants.js +9 -0
- package/dist/server/mcp/constants.js.map +1 -1
- package/dist/server/mcp/mcp.js +13 -1
- package/dist/server/mcp/mcp.js.map +1 -1
- package/dist/server/messageBuffer.js +9 -0
- package/dist/server/messageBuffer.js.map +1 -1
- package/dist/server/parser/helpers.js +9 -0
- package/dist/server/parser/helpers.js.map +1 -1
- package/dist/server/parser/processEnvelope.js +9 -0
- package/dist/server/parser/processEnvelope.js.map +1 -1
- package/dist/server/routes/clear.js +12 -0
- package/dist/server/routes/clear.js.map +1 -1
- package/dist/server/routes/contextlines/index.js +9 -0
- package/dist/server/routes/contextlines/index.js.map +1 -1
- package/dist/server/routes/contextlines/utils.js +9 -0
- package/dist/server/routes/contextlines/utils.js.map +1 -1
- package/dist/server/routes/health.js +9 -0
- package/dist/server/routes/health.js.map +1 -1
- package/dist/server/routes/index.js +9 -0
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/routes/mcp.js +9 -0
- package/dist/server/routes/mcp.js.map +1 -1
- package/dist/server/routes/open.js +9 -0
- package/dist/server/routes/open.js.map +1 -1
- package/dist/server/routes/stream/debugLogging.js +9 -0
- package/dist/server/routes/stream/debugLogging.js.map +1 -1
- package/dist/server/routes/stream/index.js +18 -3
- package/dist/server/routes/stream/index.js.map +1 -1
- package/dist/server/routes/stream/streaming.js +9 -0
- package/dist/server/routes/stream/streaming.js.map +1 -1
- package/dist/server/routes/stream/userAgent.js +9 -0
- package/dist/server/routes/stream/userAgent.js.map +1 -1
- package/dist/server/sdk.d.ts +1 -1
- package/dist/server/sdk.js +9 -0
- package/dist/server/sdk.js.map +1 -1
- package/dist/server/types/cli.d.ts +1 -0
- package/dist/server/types/utils.d.ts +12 -0
- package/dist/server/utils/cors.d.ts +35 -5
- package/dist/server/utils/cors.js +179 -6
- package/dist/server/utils/cors.js.map +1 -1
- package/dist/server/utils/docker-compose-parser.js +9 -0
- package/dist/server/utils/docker-compose-parser.js.map +1 -1
- package/dist/server/utils/docker-compose.js +10 -1
- package/dist/server/utils/docker-compose.js.map +1 -1
- package/dist/server/utils/eventContainer.js +9 -0
- package/dist/server/utils/eventContainer.js.map +1 -1
- package/dist/server/utils/extras.js +9 -0
- package/dist/server/utils/extras.js.map +1 -1
- package/dist/server/utils/getBuffer.js +9 -0
- package/dist/server/utils/getBuffer.js.map +1 -1
- package/dist/shared/constants.js +9 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/ui/assets/andromeeda.js +2 -1
- package/dist/ui/assets/andromeeda.js.map +1 -0
- package/dist/ui/assets/angular-html.js +2 -1
- package/dist/ui/assets/angular-html.js.map +1 -0
- package/dist/ui/assets/angular-ts.js +2 -1
- package/dist/ui/assets/angular-ts.js.map +1 -0
- package/dist/ui/assets/astro.js +2 -1
- package/dist/ui/assets/astro.js.map +1 -0
- package/dist/ui/assets/aurora-x.js +2 -1
- package/dist/ui/assets/aurora-x.js.map +1 -0
- package/dist/ui/assets/ayu-dark.js +2 -1
- package/dist/ui/assets/ayu-dark.js.map +1 -0
- package/dist/ui/assets/blade.js +2 -1
- package/dist/ui/assets/blade.js.map +1 -0
- package/dist/ui/assets/c.js +2 -1
- package/dist/ui/assets/c.js.map +1 -0
- package/dist/ui/assets/catppuccin-frappe.js +2 -1
- package/dist/ui/assets/catppuccin-frappe.js.map +1 -0
- package/dist/ui/assets/catppuccin-latte.js +2 -1
- package/dist/ui/assets/catppuccin-latte.js.map +1 -0
- package/dist/ui/assets/catppuccin-macchiato.js +2 -1
- package/dist/ui/assets/catppuccin-macchiato.js.map +1 -0
- package/dist/ui/assets/catppuccin-mocha.js +2 -1
- package/dist/ui/assets/catppuccin-mocha.js.map +1 -0
- package/dist/ui/assets/coffee.js +2 -1
- package/dist/ui/assets/coffee.js.map +1 -0
- package/dist/ui/assets/cpp.js +2 -1
- package/dist/ui/assets/cpp.js.map +1 -0
- package/dist/ui/assets/css.js +2 -1
- package/dist/ui/assets/css.js.map +1 -0
- package/dist/ui/assets/dark-plus.js +2 -1
- package/dist/ui/assets/dark-plus.js.map +1 -0
- package/dist/ui/assets/dracula-soft.js +2 -1
- package/dist/ui/assets/dracula-soft.js.map +1 -0
- package/dist/ui/assets/dracula.js +2 -1
- package/dist/ui/assets/dracula.js.map +1 -0
- package/dist/ui/assets/everforest-dark.js +2 -1
- package/dist/ui/assets/everforest-dark.js.map +1 -0
- package/dist/ui/assets/everforest-light.js +2 -1
- package/dist/ui/assets/everforest-light.js.map +1 -0
- package/dist/ui/assets/github-dark-default.js +2 -1
- package/dist/ui/assets/github-dark-default.js.map +1 -0
- package/dist/ui/assets/github-dark-dimmed.js +2 -1
- package/dist/ui/assets/github-dark-dimmed.js.map +1 -0
- package/dist/ui/assets/github-dark-high-contrast.js +2 -1
- package/dist/ui/assets/github-dark-high-contrast.js.map +1 -0
- package/dist/ui/assets/github-dark.js +2 -1
- package/dist/ui/assets/github-dark.js.map +1 -0
- package/dist/ui/assets/github-light-default.js +2 -1
- package/dist/ui/assets/github-light-default.js.map +1 -0
- package/dist/ui/assets/github-light-high-contrast.js +2 -1
- package/dist/ui/assets/github-light-high-contrast.js.map +1 -0
- package/dist/ui/assets/github-light.js +2 -1
- package/dist/ui/assets/github-light.js.map +1 -0
- package/dist/ui/assets/glsl.js +2 -1
- package/dist/ui/assets/glsl.js.map +1 -0
- package/dist/ui/assets/graphql.js +2 -1
- package/dist/ui/assets/graphql.js.map +1 -0
- package/dist/ui/assets/gruvbox-dark-hard.js +2 -1
- package/dist/ui/assets/gruvbox-dark-hard.js.map +1 -0
- package/dist/ui/assets/gruvbox-dark-medium.js +2 -1
- package/dist/ui/assets/gruvbox-dark-medium.js.map +1 -0
- package/dist/ui/assets/gruvbox-dark-soft.js +2 -1
- package/dist/ui/assets/gruvbox-dark-soft.js.map +1 -0
- package/dist/ui/assets/gruvbox-light-hard.js +2 -1
- package/dist/ui/assets/gruvbox-light-hard.js.map +1 -0
- package/dist/ui/assets/gruvbox-light-medium.js +2 -1
- package/dist/ui/assets/gruvbox-light-medium.js.map +1 -0
- package/dist/ui/assets/gruvbox-light-soft.js +2 -1
- package/dist/ui/assets/gruvbox-light-soft.js.map +1 -0
- package/dist/ui/assets/haml.js +2 -1
- package/dist/ui/assets/haml.js.map +1 -0
- package/dist/ui/assets/handlebars.js +2 -1
- package/dist/ui/assets/handlebars.js.map +1 -0
- package/dist/ui/assets/houston.js +2 -1
- package/dist/ui/assets/houston.js.map +1 -0
- package/dist/ui/assets/html-derivative.js +2 -1
- package/dist/ui/assets/html-derivative.js.map +1 -0
- package/dist/ui/assets/html.js +2 -1
- package/dist/ui/assets/html.js.map +1 -0
- package/dist/ui/assets/http.js +2 -1
- package/dist/ui/assets/http.js.map +1 -0
- package/dist/ui/assets/imba.js +2 -1
- package/dist/ui/assets/imba.js.map +1 -0
- package/dist/ui/assets/index.js +46 -45
- package/dist/ui/assets/index.js.map +1 -0
- package/dist/ui/assets/index2.js +2 -1
- package/dist/ui/assets/index2.js.map +1 -0
- package/dist/ui/assets/instrumentation.js +12 -11
- package/dist/ui/assets/instrumentation.js.map +1 -0
- package/dist/ui/assets/java.js +2 -1
- package/dist/ui/assets/java.js.map +1 -0
- package/dist/ui/assets/javascript.js +2 -1
- package/dist/ui/assets/javascript.js.map +1 -0
- package/dist/ui/assets/jinja.js +2 -1
- package/dist/ui/assets/jinja.js.map +1 -0
- package/dist/ui/assets/jison.js +2 -1
- package/dist/ui/assets/jison.js.map +1 -0
- package/dist/ui/assets/json.js +2 -1
- package/dist/ui/assets/json.js.map +1 -0
- package/dist/ui/assets/json5.js +2 -1
- package/dist/ui/assets/json5.js.map +1 -0
- package/dist/ui/assets/jsonc.js +2 -1
- package/dist/ui/assets/jsonc.js.map +1 -0
- package/dist/ui/assets/jsonl.js +2 -1
- package/dist/ui/assets/jsonl.js.map +1 -0
- package/dist/ui/assets/jsx.js +2 -1
- package/dist/ui/assets/jsx.js.map +1 -0
- package/dist/ui/assets/julia.js +2 -1
- package/dist/ui/assets/julia.js.map +1 -0
- package/dist/ui/assets/kanagawa-dragon.js +2 -1
- package/dist/ui/assets/kanagawa-dragon.js.map +1 -0
- package/dist/ui/assets/kanagawa-lotus.js +2 -1
- package/dist/ui/assets/kanagawa-lotus.js.map +1 -0
- package/dist/ui/assets/kanagawa-wave.js +2 -1
- package/dist/ui/assets/kanagawa-wave.js.map +1 -0
- package/dist/ui/assets/laserwave.js +2 -1
- package/dist/ui/assets/laserwave.js.map +1 -0
- package/dist/ui/assets/less.js +2 -1
- package/dist/ui/assets/less.js.map +1 -0
- package/dist/ui/assets/light-plus.js +2 -1
- package/dist/ui/assets/light-plus.js.map +1 -0
- package/dist/ui/assets/main.css +1 -1
- package/dist/ui/assets/main.js +3 -2
- package/dist/ui/assets/main.js.map +1 -0
- package/dist/ui/assets/markdown.js +2 -1
- package/dist/ui/assets/markdown.js.map +1 -0
- package/dist/ui/assets/marko.js +2 -1
- package/dist/ui/assets/marko.js.map +1 -0
- package/dist/ui/assets/material-theme-darker.js +2 -1
- package/dist/ui/assets/material-theme-darker.js.map +1 -0
- package/dist/ui/assets/material-theme-lighter.js +2 -1
- package/dist/ui/assets/material-theme-lighter.js.map +1 -0
- package/dist/ui/assets/material-theme-ocean.js +2 -1
- package/dist/ui/assets/material-theme-ocean.js.map +1 -0
- package/dist/ui/assets/material-theme-palenight.js +2 -1
- package/dist/ui/assets/material-theme-palenight.js.map +1 -0
- package/dist/ui/assets/material-theme.js +2 -1
- package/dist/ui/assets/material-theme.js.map +1 -0
- package/dist/ui/assets/mdc.js +2 -1
- package/dist/ui/assets/mdc.js.map +1 -0
- package/dist/ui/assets/mdx.js +2 -1
- package/dist/ui/assets/mdx.js.map +1 -0
- package/dist/ui/assets/min-dark.js +2 -1
- package/dist/ui/assets/min-dark.js.map +1 -0
- package/dist/ui/assets/min-light.js +2 -1
- package/dist/ui/assets/min-light.js.map +1 -0
- package/dist/ui/assets/monokai.js +2 -1
- package/dist/ui/assets/monokai.js.map +1 -0
- package/dist/ui/assets/night-owl.js +2 -1
- package/dist/ui/assets/night-owl.js.map +1 -0
- package/dist/ui/assets/nord.js +2 -1
- package/dist/ui/assets/nord.js.map +1 -0
- package/dist/ui/assets/one-dark-pro.js +2 -1
- package/dist/ui/assets/one-dark-pro.js.map +1 -0
- package/dist/ui/assets/one-light.js +2 -1
- package/dist/ui/assets/one-light.js.map +1 -0
- package/dist/ui/assets/php.js +2 -1
- package/dist/ui/assets/php.js.map +1 -0
- package/dist/ui/assets/plastic.js +2 -1
- package/dist/ui/assets/plastic.js.map +1 -0
- package/dist/ui/assets/poimandres.js +2 -1
- package/dist/ui/assets/poimandres.js.map +1 -0
- package/dist/ui/assets/postcss.js +2 -1
- package/dist/ui/assets/postcss.js.map +1 -0
- package/dist/ui/assets/pug.js +2 -1
- package/dist/ui/assets/pug.js.map +1 -0
- package/dist/ui/assets/python.js +2 -1
- package/dist/ui/assets/python.js.map +1 -0
- package/dist/ui/assets/r.js +2 -1
- package/dist/ui/assets/r.js.map +1 -0
- package/dist/ui/assets/red.js +2 -1
- package/dist/ui/assets/red.js.map +1 -0
- package/dist/ui/assets/regexp.js +2 -1
- package/dist/ui/assets/regexp.js.map +1 -0
- package/dist/ui/assets/rose-pine-dawn.js +2 -1
- package/dist/ui/assets/rose-pine-dawn.js.map +1 -0
- package/dist/ui/assets/rose-pine-moon.js +2 -1
- package/dist/ui/assets/rose-pine-moon.js.map +1 -0
- package/dist/ui/assets/rose-pine.js +2 -1
- package/dist/ui/assets/rose-pine.js.map +1 -0
- package/dist/ui/assets/sass.js +2 -1
- package/dist/ui/assets/sass.js.map +1 -0
- package/dist/ui/assets/scss.js +2 -1
- package/dist/ui/assets/scss.js.map +1 -0
- package/dist/ui/assets/serverTimingMeta.js +51 -0
- package/dist/ui/assets/serverTimingMeta.js.map +1 -0
- package/dist/ui/assets/shellscript.js +2 -1
- package/dist/ui/assets/shellscript.js.map +1 -0
- package/dist/ui/assets/slack-dark.js +2 -1
- package/dist/ui/assets/slack-dark.js.map +1 -0
- package/dist/ui/assets/slack-ochin.js +2 -1
- package/dist/ui/assets/slack-ochin.js.map +1 -0
- package/dist/ui/assets/snazzy-light.js +2 -1
- package/dist/ui/assets/snazzy-light.js.map +1 -0
- package/dist/ui/assets/solarized-dark.js +2 -1
- package/dist/ui/assets/solarized-dark.js.map +1 -0
- package/dist/ui/assets/solarized-light.js +2 -1
- package/dist/ui/assets/solarized-light.js.map +1 -0
- package/dist/ui/assets/sql.js +2 -1
- package/dist/ui/assets/sql.js.map +1 -0
- package/dist/ui/assets/stylus.js +2 -1
- package/dist/ui/assets/stylus.js.map +1 -0
- package/dist/ui/assets/svelte.js +2 -1
- package/dist/ui/assets/svelte.js.map +1 -0
- package/dist/ui/assets/synthwave-84.js +2 -1
- package/dist/ui/assets/synthwave-84.js.map +1 -0
- package/dist/ui/assets/tokyo-night.js +2 -1
- package/dist/ui/assets/tokyo-night.js.map +1 -0
- package/dist/ui/assets/ts-tags.js +2 -1
- package/dist/ui/assets/ts-tags.js.map +1 -0
- package/dist/ui/assets/tsx.js +2 -1
- package/dist/ui/assets/tsx.js.map +1 -0
- package/dist/ui/assets/typescript.js +2 -1
- package/dist/ui/assets/typescript.js.map +1 -0
- package/dist/ui/assets/vesper.js +2 -1
- package/dist/ui/assets/vesper.js.map +1 -0
- package/dist/ui/assets/vitesse-black.js +2 -1
- package/dist/ui/assets/vitesse-black.js.map +1 -0
- package/dist/ui/assets/vitesse-dark.js +2 -1
- package/dist/ui/assets/vitesse-dark.js.map +1 -0
- package/dist/ui/assets/vitesse-light.js +2 -1
- package/dist/ui/assets/vitesse-light.js.map +1 -0
- package/dist/ui/assets/vue-html.js +2 -1
- package/dist/ui/assets/vue-html.js.map +1 -0
- package/dist/ui/assets/vue-vine.js +2 -1
- package/dist/ui/assets/vue-vine.js.map +1 -0
- package/dist/ui/assets/vue.js +2 -1
- package/dist/ui/assets/vue.js.map +1 -0
- package/dist/ui/assets/wasm.js +2 -1
- package/dist/ui/assets/wasm.js.map +1 -0
- package/dist/ui/assets/wasm2.js +2 -1
- package/dist/ui/assets/wasm2.js.map +1 -0
- package/dist/ui/assets/wgsl.js +2 -1
- package/dist/ui/assets/wgsl.js.map +1 -0
- package/dist/ui/assets/wit.js +2 -1
- package/dist/ui/assets/wit.js.map +1 -0
- package/dist/ui/assets/xml.js +2 -1
- package/dist/ui/assets/xml.js.map +1 -0
- package/dist/ui/assets/yaml.js +2 -1
- package/dist/ui/assets/yaml.js.map +1 -0
- package/dist/ui/manifest.json +17 -25
- package/package.json +3 -3
- package/dist/_virtual/re.js +0 -5
- package/dist/_virtual/re.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js +0 -123
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js +0 -388
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js +0 -277
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js +0 -11
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js +0 -53
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js +0 -46
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js +0 -42
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js +0 -20
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js +0 -11
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js +0 -15
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js +0 -11
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js +0 -135
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js +0 -29
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js +0 -7
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js +0 -22
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js +0 -35
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js +0 -16
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js +0 -91
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js +0 -12
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js +0 -28
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js +0 -28
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js +0 -57
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js +0 -74
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js +0 -49
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js +0 -163
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js +0 -8
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js.map +0 -1
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js +0 -14
- package/dist/node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js.map +0 -1
- package/dist/ui/assets/client.js +0 -50
- package/dist/ui/assets/electron-index.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.js","sources":["../../../src/server/routes/open.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { Hono } from \"hono\";\nimport launchEditor from \"launch-editor\";\nimport { logger } from \"../logger.ts\";\nimport type { HonoEnv } from \"../types/index.ts\";\n\nconst router = new Hono<HonoEnv>();\n\n// ASK: Will this still be used in a desktop app? And if so, do we still have a base path and cwd?\nrouter.post(\"/\", async ctx => {\n const basePath = ctx.get(\"basePath\") ?? process.cwd();\n\n const requestBody = await ctx.req.text();\n const targetPath = resolve(basePath, requestBody);\n logger.debug(`Launching editor for ${targetPath}`);\n launchEditor(\n // filename:line:column\n // both line and column are optional\n targetPath,\n // callback if failed to launch (optional)\n (fileName, errorMsg) => {\n logger.error(`Failed to launch editor for ${fileName}: ${errorMsg}`);\n },\n );\n return ctx.body(null, 204);\n});\n\nexport default router;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"open.js","sources":["../../../src/server/routes/open.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { Hono } from \"hono\";\nimport launchEditor from \"launch-editor\";\nimport { logger } from \"../logger.ts\";\nimport type { HonoEnv } from \"../types/index.ts\";\n\nconst router = new Hono<HonoEnv>();\n\n// ASK: Will this still be used in a desktop app? And if so, do we still have a base path and cwd?\nrouter.post(\"/\", async ctx => {\n const basePath = ctx.get(\"basePath\") ?? process.cwd();\n\n const requestBody = await ctx.req.text();\n const targetPath = resolve(basePath, requestBody);\n logger.debug(`Launching editor for ${targetPath}`);\n launchEditor(\n // filename:line:column\n // both line and column are optional\n targetPath,\n // callback if failed to launch (optional)\n (fileName, errorMsg) => {\n logger.error(`Failed to launch editor for ${fileName}: ${errorMsg}`);\n },\n );\n return ctx.body(null, 204);\n});\n\nexport default router;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAMA,MAAM,SAAS,IAAI,KAAA;AAGnB,OAAO,KAAK,KAAK,OAAM,QAAO;AAC5B,QAAM,WAAW,IAAI,IAAI,UAAU,KAAK,QAAQ,IAAA;AAEhD,QAAM,cAAc,MAAM,IAAI,IAAI,KAAA;AAClC,QAAM,aAAa,QAAQ,UAAU,WAAW;AAChD,SAAO,MAAM,wBAAwB,UAAU,EAAE;AACjD;AAAA;AAAA;AAAA,IAGE;AAAA;AAAA,IAEA,CAAC,UAAU,aAAa;AACtB,aAAO,MAAM,+BAA+B,QAAQ,KAAK,QAAQ,EAAE;AAAA,IACrE;AAAA,EAAA;AAEF,SAAO,IAAI,KAAK,MAAM,GAAG;AAC3B,CAAC;"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "faef59ab-afce-40e0-b027-ea31b42dfa6e", e._sentryDebugIdIdentifier = "sentry-dbid-faef59ab-afce-40e0-b027-ea31b42dfa6e");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { isDebugEnabled, logger } from "../../logger.js";
|
|
2
10
|
import { isErrorEvent } from "../../parser/helpers.js";
|
|
3
11
|
import "uuidv7";
|
|
12
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
4
13
|
function logIncomingEvent(container) {
|
|
5
14
|
if (!isDebugEnabled()) return;
|
|
6
15
|
const contentType = container.getContentType();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugLogging.js","sources":["../../../../src/server/routes/stream/debugLogging.ts"],"sourcesContent":["import { isDebugEnabled, logger } from \"../../logger.ts\";\nimport { type ParsedEnvelope, type SentryErrorEvent, type SentryEvent, isErrorEvent } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\n\n/**\n * Logs incoming event details when debug mode is enabled\n * Uses the container's parsed data if available\n */\nexport function logIncomingEvent(container: EventContainer): void {\n if (!isDebugEnabled()) return;\n\n const contentType = container.getContentType();\n\n if (contentType === \"application/x-sentry-envelope\") {\n const parsedEnvelope = container.getParsedEnvelope();\n\n if (!parsedEnvelope) {\n // Still log something useful even if parsing failed\n const data = container.getData();\n const size = data.length;\n // Only show first line of envelope header for safety (should be JSON metadata, not user data)\n const firstNewline = data.indexOf(\"\\n\");\n const headerPreview =\n firstNewline > 0 && firstNewline < 200\n ? data.toString(\"utf-8\", 0, firstNewline).replace(/\\n/g, \"\\\\n\")\n : \"header not found\";\n logger.debug(`→ envelope (parse error, ${size} bytes) | ${headerPreview}`);\n return;\n }\n\n // Build complete log message with all details\n let logMessage = `→ ${formatEnvelopeMetadata(parsedEnvelope.envelope)}`;\n\n // Add error event details to the same log message\n for (const item of parsedEnvelope.envelope[1]) {\n if (isErrorEvent(item[1] as SentryEvent)) {\n logMessage += `\\n └ ${formatErrorDetails(item[1] as SentryErrorEvent)}`;\n }\n }\n\n // Single atomic log statement\n logger.debug(logMessage);\n } else {\n logger.debug(`→ ${contentType || \"unknown\"}`);\n }\n}\n\n/**\n * Logs outgoing event to client when debug mode is enabled\n * Uses the container's already-parsed data if available\n */\nexport function logOutgoingEvent(container: EventContainer, clientId: string): void {\n if (!isDebugEnabled()) return;\n\n // Use the container's event type string (which uses cached parsed data)\n const typeInfo = container.getEventTypesString();\n\n // If it's an envelope that failed to parse, add size info\n if (typeInfo === \"envelope\" && container.getContentType() === \"application/x-sentry-envelope\") {\n const size = container.getData().length;\n logger.debug(`← envelope (${size} bytes) to ${clientId}`);\n } else {\n logger.debug(`← ${typeInfo} to ${clientId}`);\n }\n}\n\n/**\n * Formats envelope metadata for logging\n */\nfunction formatEnvelopeMetadata(envelope: ParsedEnvelope[\"envelope\"]): string {\n const eventTypes = envelope[1].map(item => item[0].type).filter(Boolean);\n\n const typePrefix = eventTypes.length > 0 ? eventTypes.join(\"+\") : \"envelope\";\n const sdk = envelope[0].sdk?.name || \"unknown\";\n const eventId = envelope[0].event_id;\n\n return `${typePrefix} | sdk: ${sdk}${eventId ? ` | id: ${eventId}` : \"\"}`;\n}\n\n/**\n * Formats error event details for logging\n */\nfunction formatErrorDetails(payload: SentryErrorEvent): string {\n const platform = payload.platform || \"unknown\";\n const environment = payload.environment || \"unknown\";\n const level = \"level\" in payload ? payload.level : \"error\";\n\n const errorMsg = payload.exception?.values?.[0]?.value || String(payload.message) || \"No error message\";\n\n const errorType = payload.exception?.values?.[0]?.type || \"Error\";\n\n const truncatedMsg = errorMsg.substring(0, 80) + (errorMsg.length > 80 ? \"...\" : \"\");\n\n return `${level} [${platform}/${environment}] ${errorType}: ${truncatedMsg}`;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debugLogging.js","sources":["../../../../src/server/routes/stream/debugLogging.ts"],"sourcesContent":["import { isDebugEnabled, logger } from \"../../logger.ts\";\nimport { type ParsedEnvelope, type SentryErrorEvent, type SentryEvent, isErrorEvent } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\n\n/**\n * Logs incoming event details when debug mode is enabled\n * Uses the container's parsed data if available\n */\nexport function logIncomingEvent(container: EventContainer): void {\n if (!isDebugEnabled()) return;\n\n const contentType = container.getContentType();\n\n if (contentType === \"application/x-sentry-envelope\") {\n const parsedEnvelope = container.getParsedEnvelope();\n\n if (!parsedEnvelope) {\n // Still log something useful even if parsing failed\n const data = container.getData();\n const size = data.length;\n // Only show first line of envelope header for safety (should be JSON metadata, not user data)\n const firstNewline = data.indexOf(\"\\n\");\n const headerPreview =\n firstNewline > 0 && firstNewline < 200\n ? data.toString(\"utf-8\", 0, firstNewline).replace(/\\n/g, \"\\\\n\")\n : \"header not found\";\n logger.debug(`→ envelope (parse error, ${size} bytes) | ${headerPreview}`);\n return;\n }\n\n // Build complete log message with all details\n let logMessage = `→ ${formatEnvelopeMetadata(parsedEnvelope.envelope)}`;\n\n // Add error event details to the same log message\n for (const item of parsedEnvelope.envelope[1]) {\n if (isErrorEvent(item[1] as SentryEvent)) {\n logMessage += `\\n └ ${formatErrorDetails(item[1] as SentryErrorEvent)}`;\n }\n }\n\n // Single atomic log statement\n logger.debug(logMessage);\n } else {\n logger.debug(`→ ${contentType || \"unknown\"}`);\n }\n}\n\n/**\n * Logs outgoing event to client when debug mode is enabled\n * Uses the container's already-parsed data if available\n */\nexport function logOutgoingEvent(container: EventContainer, clientId: string): void {\n if (!isDebugEnabled()) return;\n\n // Use the container's event type string (which uses cached parsed data)\n const typeInfo = container.getEventTypesString();\n\n // If it's an envelope that failed to parse, add size info\n if (typeInfo === \"envelope\" && container.getContentType() === \"application/x-sentry-envelope\") {\n const size = container.getData().length;\n logger.debug(`← envelope (${size} bytes) to ${clientId}`);\n } else {\n logger.debug(`← ${typeInfo} to ${clientId}`);\n }\n}\n\n/**\n * Formats envelope metadata for logging\n */\nfunction formatEnvelopeMetadata(envelope: ParsedEnvelope[\"envelope\"]): string {\n const eventTypes = envelope[1].map(item => item[0].type).filter(Boolean);\n\n const typePrefix = eventTypes.length > 0 ? eventTypes.join(\"+\") : \"envelope\";\n const sdk = envelope[0].sdk?.name || \"unknown\";\n const eventId = envelope[0].event_id;\n\n return `${typePrefix} | sdk: ${sdk}${eventId ? ` | id: ${eventId}` : \"\"}`;\n}\n\n/**\n * Formats error event details for logging\n */\nfunction formatErrorDetails(payload: SentryErrorEvent): string {\n const platform = payload.platform || \"unknown\";\n const environment = payload.environment || \"unknown\";\n const level = \"level\" in payload ? payload.level : \"error\";\n\n const errorMsg = payload.exception?.values?.[0]?.value || String(payload.message) || \"No error message\";\n\n const errorType = payload.exception?.values?.[0]?.type || \"Error\";\n\n const truncatedMsg = errorMsg.substring(0, 80) + (errorMsg.length > 80 ? \"...\" : \"\");\n\n return `${level} [${platform}/${environment}] ${errorType}: ${truncatedMsg}`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAQO,SAAS,iBAAiB,WAAiC;AAChE,MAAI,CAAC,iBAAkB;AAEvB,QAAM,cAAc,UAAU,eAAA;AAE9B,MAAI,gBAAgB,iCAAiC;AACnD,UAAM,iBAAiB,UAAU,kBAAA;AAEjC,QAAI,CAAC,gBAAgB;AAEnB,YAAM,OAAO,UAAU,QAAA;AACvB,YAAM,OAAO,KAAK;AAElB,YAAM,eAAe,KAAK,QAAQ,IAAI;AACtC,YAAM,gBACJ,eAAe,KAAK,eAAe,MAC/B,KAAK,SAAS,SAAS,GAAG,YAAY,EAAE,QAAQ,OAAO,KAAK,IAC5D;AACN,aAAO,MAAM,4BAA4B,IAAI,aAAa,aAAa,EAAE;AACzE;AAAA,IACF;AAGA,QAAI,aAAa,KAAK,uBAAuB,eAAe,QAAQ,CAAC;AAGrE,eAAW,QAAQ,eAAe,SAAS,CAAC,GAAG;AAC7C,UAAI,aAAa,KAAK,CAAC,CAAgB,GAAG;AACxC,sBAAc;AAAA,MAAS,mBAAmB,KAAK,CAAC,CAAqB,CAAC;AAAA,MACxE;AAAA,IACF;AAGA,WAAO,MAAM,UAAU;AAAA,EACzB,OAAO;AACL,WAAO,MAAM,KAAK,eAAe,SAAS,EAAE;AAAA,EAC9C;AACF;AAMO,SAAS,iBAAiB,WAA2B,UAAwB;AAClF,MAAI,CAAC,iBAAkB;AAGvB,QAAM,WAAW,UAAU,oBAAA;AAG3B,MAAI,aAAa,cAAc,UAAU,eAAA,MAAqB,iCAAiC;AAC7F,UAAM,OAAO,UAAU,QAAA,EAAU;AACjC,WAAO,MAAM,eAAe,IAAI,cAAc,QAAQ,EAAE;AAAA,EAC1D,OAAO;AACL,WAAO,MAAM,KAAK,QAAQ,OAAO,QAAQ,EAAE;AAAA,EAC7C;AACF;AAKA,SAAS,uBAAuB,UAA8C;AAC5E,QAAM,aAAa,SAAS,CAAC,EAAE,IAAI,CAAA,SAAQ,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,OAAO;AAEvE,QAAM,aAAa,WAAW,SAAS,IAAI,WAAW,KAAK,GAAG,IAAI;AAClE,QAAM,MAAM,SAAS,CAAC,EAAE,KAAK,QAAQ;AACrC,QAAM,UAAU,SAAS,CAAC,EAAE;AAE5B,SAAO,GAAG,UAAU,WAAW,GAAG,GAAG,UAAU,UAAU,OAAO,KAAK,EAAE;AACzE;AAKA,SAAS,mBAAmB,SAAmC;AAC7D,QAAM,WAAW,QAAQ,YAAY;AACrC,QAAM,cAAc,QAAQ,eAAe;AAC3C,QAAM,QAAQ,WAAW,UAAU,QAAQ,QAAQ;AAEnD,QAAM,WAAW,QAAQ,WAAW,SAAS,CAAC,GAAG,SAAS,OAAO,QAAQ,OAAO,KAAK;AAErF,QAAM,YAAY,QAAQ,WAAW,SAAS,CAAC,GAAG,QAAQ;AAE1D,QAAM,eAAe,SAAS,UAAU,GAAG,EAAE,KAAK,SAAS,SAAS,KAAK,QAAQ;AAEjF,SAAO,GAAG,KAAK,KAAK,QAAQ,IAAI,WAAW,KAAK,SAAS,KAAK,YAAY;AAC5E;"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c8123de6-5e77-41da-8100-10d99b558d5f", e._sentryDebugIdIdentifier = "sentry-dbid-c8123de6-5e77-41da-8100-10d99b558d5f");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { createWriteStream } from "node:fs";
|
|
2
|
-
import { decompressBody, pushToSpotlightBuffer } from "../../sdk.js";
|
|
3
|
-
import { SENTRY_CONTENT_TYPE } from "../../../shared/constants.js";
|
|
4
10
|
import { Hono } from "hono";
|
|
11
|
+
import { SENTRY_CONTENT_TYPE } from "../../../shared/constants.js";
|
|
5
12
|
import { logger } from "../../logger.js";
|
|
13
|
+
import { decompressBody, pushToSpotlightBuffer } from "../../sdk.js";
|
|
6
14
|
import { getBuffer } from "../../utils/getBuffer.js";
|
|
7
15
|
import "../../parser/helpers.js";
|
|
8
16
|
import "uuidv7";
|
|
17
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
9
18
|
import "node:http";
|
|
10
19
|
import "@sentry/node";
|
|
20
|
+
import "node:dns/promises";
|
|
21
|
+
import "node:net";
|
|
22
|
+
import "node:os";
|
|
11
23
|
import { logOutgoingEvent, logIncomingEvent } from "./debugLogging.js";
|
|
12
24
|
import { streamSSE } from "./streaming.js";
|
|
13
25
|
import { parseBrowserFromUserAgent } from "./userAgent.js";
|
|
@@ -57,7 +69,10 @@ const router = new Hono().get("/stream", (ctx) => {
|
|
|
57
69
|
if (ctx.req.query("sentry_client")?.startsWith("sentry.javascript.browser") && ctx.req.header("Origin")) {
|
|
58
70
|
contentType = SENTRY_CONTENT_TYPE;
|
|
59
71
|
}
|
|
60
|
-
const body = decompressBody(
|
|
72
|
+
const body = decompressBody(
|
|
73
|
+
Buffer.from(await ctx.req.arrayBuffer()),
|
|
74
|
+
ctx.req.header("Content-Encoding")
|
|
75
|
+
);
|
|
61
76
|
const container = pushToSpotlightBuffer({
|
|
62
77
|
body,
|
|
63
78
|
spotlightBuffer: getBuffer(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/server/routes/stream/index.ts"],"sourcesContent":["import { createWriteStream } from \"node:fs\";\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/server/routes/stream/index.ts"],"sourcesContent":["import { createWriteStream } from \"node:fs\";\nimport { Hono } from \"hono\";\nimport { SENTRY_CONTENT_TYPE } from \"../../../shared/constants.ts\";\nimport { logger } from \"../../logger.ts\";\nimport { decompressBody, pushToSpotlightBuffer } from \"../../sdk.ts\";\nimport type { ContentEncoding } from \"../../sdk.ts\";\nimport type { HonoEnv } from \"../../types/env.ts\";\nimport { getBuffer } from \"../../utils/index.ts\";\nimport { logIncomingEvent, logOutgoingEvent } from \"./debugLogging.ts\";\nimport { streamSSE } from \"./streaming.ts\";\nimport { parseBrowserFromUserAgent } from \"./userAgent.ts\";\n\nconst router = new Hono<HonoEnv>()\n .get(\"/stream\", ctx => {\n const buffer = getBuffer();\n\n const useBase64 = ctx.req.query(\"base64\") != null;\n const base64Indicator = useBase64 ? \";base64\" : \"\";\n\n // Capture client information for debug logging\n let clientId = ctx.req.query(\"client\");\n if (!clientId) {\n // Fallback to parsing User-Agent if no client param\n const userAgent = ctx.req.header(\"User-Agent\") || \"unknown\";\n clientId = parseBrowserFromUserAgent(userAgent);\n }\n // Sanitize to prevent log injection - keep only safe printable characters\n // Allow alphanumeric, spaces, dots, dashes, underscores, slashes, parentheses\n clientId = clientId.replace(/[^\\w\\s.\\-/()]/g, \"\");\n // Ensure we always have a non-empty clientId\n if (!clientId) clientId = \"unknown\";\n\n return streamSSE(ctx, async stream => {\n // Check for Last-Event-ID header to support reconnection\n const lastEventId = ctx.req.header(\"Last-Event-ID\");\n\n // Subscribe to events, optionally starting from after the lastEventId\n const sub = buffer.subscribe(container => {\n logOutgoingEvent(container, clientId);\n\n const parsedEnvelope = container.getParsedEnvelope();\n if (parsedEnvelope) {\n stream.writeSSE({\n id: parsedEnvelope.envelope[0].__spotlight_envelope_id.toString(),\n event: `${container.getContentType()}${base64Indicator}`,\n data: JSON.stringify(parsedEnvelope.envelope),\n });\n }\n }, lastEventId);\n\n stream.onAbort(() => {\n buffer.unsubscribe(sub);\n });\n });\n })\n .get(\"/envelope/:id\", ctx => {\n const buffer = getBuffer();\n\n const envelopeId = ctx.req.param(\"id\");\n const container = buffer.read({ envelopeId });\n\n if (container.length === 0) {\n return ctx.notFound();\n }\n\n return ctx.body(new Uint8Array(container[0].getData()), 200, {\n \"Content-Type\": container[0].getContentType(),\n \"Cache-Control\": \"no-cache\",\n \"Content-Disposition\": `attachment; filename=\"${envelopeId}.bin\"`,\n Connection: \"keep-alive\",\n });\n })\n .on(\"POST\", [\"/stream\", \"/api/:id/envelope\"], async ctx => {\n let contentType = ctx.req.header(\"content-type\")?.split(\";\")[0].toLocaleLowerCase();\n if (ctx.req.query(\"sentry_client\")?.startsWith(\"sentry.javascript.browser\") && ctx.req.header(\"Origin\")) {\n // This is a correction we make as Sentry Browser SDK may send messages with text/plain to avoid CORS issues\n contentType = SENTRY_CONTENT_TYPE;\n }\n\n // manually decompress body to use it below without another decompression\n const body = decompressBody(\n Buffer.from(await ctx.req.arrayBuffer()),\n ctx.req.header(\"Content-Encoding\") as ContentEncoding,\n );\n\n const container = pushToSpotlightBuffer({\n body,\n spotlightBuffer: getBuffer(),\n contentType,\n userAgent: ctx.req.header(\"User-Agent\"),\n });\n\n if (container) {\n // Log incoming event details when debug is enabled\n logIncomingEvent(container);\n } else {\n logger.warn(\"No content type, skipping payload...\");\n }\n\n const incomingPayload = ctx.get(\"incomingPayload\");\n\n if (process.env.SPOTLIGHT_CAPTURE || incomingPayload) {\n const contentType = container?.getContentType();\n const timestamp = BigInt(Date.now()) * 1_000_000n + (process.hrtime.bigint() % 1_000_000n);\n const filename = `${contentType?.replace(/[^a-z0-9]/gi, \"_\") || \"no_content_type\"}-${timestamp}.txt`;\n\n if (incomingPayload) {\n incomingPayload(body.toString(\"binary\"));\n } else {\n const stream = createWriteStream(filename);\n stream.on(\"error\", err => {\n logger.error(`Failed to save data to ${filename}: ${err}`);\n stream.destroy();\n });\n stream.end(body, () => {\n logger.info(`🗃️ Saved data to ${filename}`);\n });\n }\n }\n\n // 204 would be more appropriate but returning 200 to match what /envelope returns\n return ctx.body(null, 200, {\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n });\n });\n\nexport default router;\n"],"names":["contentType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,SAAS,IAAI,KAAA,EAChB,IAAI,WAAW,CAAA,QAAO;AACrB,QAAM,SAAS,UAAA;AAEf,QAAM,YAAY,IAAI,IAAI,MAAM,QAAQ,KAAK;AAC7C,QAAM,kBAAkB,YAAY,YAAY;AAGhD,MAAI,WAAW,IAAI,IAAI,MAAM,QAAQ;AACrC,MAAI,CAAC,UAAU;AAEb,UAAM,YAAY,IAAI,IAAI,OAAO,YAAY,KAAK;AAClD,eAAW,0BAA0B,SAAS;AAAA,EAChD;AAGA,aAAW,SAAS,QAAQ,kBAAkB,EAAE;AAEhD,MAAI,CAAC,SAAU,YAAW;AAE1B,SAAO,UAAU,KAAK,OAAM,WAAU;AAEpC,UAAM,cAAc,IAAI,IAAI,OAAO,eAAe;AAGlD,UAAM,MAAM,OAAO,UAAU,CAAA,cAAa;AACxC,uBAAiB,WAAW,QAAQ;AAEpC,YAAM,iBAAiB,UAAU,kBAAA;AACjC,UAAI,gBAAgB;AAClB,eAAO,SAAS;AAAA,UACd,IAAI,eAAe,SAAS,CAAC,EAAE,wBAAwB,SAAA;AAAA,UACvD,OAAO,GAAG,UAAU,eAAA,CAAgB,GAAG,eAAe;AAAA,UACtD,MAAM,KAAK,UAAU,eAAe,QAAQ;AAAA,QAAA,CAC7C;AAAA,MACH;AAAA,IACF,GAAG,WAAW;AAEd,WAAO,QAAQ,MAAM;AACnB,aAAO,YAAY,GAAG;AAAA,IACxB,CAAC;AAAA,EACH,CAAC;AACH,CAAC,EACA,IAAI,iBAAiB,CAAA,QAAO;AAC3B,QAAM,SAAS,UAAA;AAEf,QAAM,aAAa,IAAI,IAAI,MAAM,IAAI;AACrC,QAAM,YAAY,OAAO,KAAK,EAAE,YAAY;AAE5C,MAAI,UAAU,WAAW,GAAG;AAC1B,WAAO,IAAI,SAAA;AAAA,EACb;AAEA,SAAO,IAAI,KAAK,IAAI,WAAW,UAAU,CAAC,EAAE,SAAS,GAAG,KAAK;AAAA,IAC3D,gBAAgB,UAAU,CAAC,EAAE,eAAA;AAAA,IAC7B,iBAAiB;AAAA,IACjB,uBAAuB,yBAAyB,UAAU;AAAA,IAC1D,YAAY;AAAA,EAAA,CACb;AACH,CAAC,EACA,GAAG,QAAQ,CAAC,WAAW,mBAAmB,GAAG,OAAM,QAAO;AACzD,MAAI,cAAc,IAAI,IAAI,OAAO,cAAc,GAAG,MAAM,GAAG,EAAE,CAAC,EAAE,kBAAA;AAChE,MAAI,IAAI,IAAI,MAAM,eAAe,GAAG,WAAW,2BAA2B,KAAK,IAAI,IAAI,OAAO,QAAQ,GAAG;AAEvG,kBAAc;AAAA,EAChB;AAGA,QAAM,OAAO;AAAA,IACX,OAAO,KAAK,MAAM,IAAI,IAAI,aAAa;AAAA,IACvC,IAAI,IAAI,OAAO,kBAAkB;AAAA,EAAA;AAGnC,QAAM,YAAY,sBAAsB;AAAA,IACtC;AAAA,IACA,iBAAiB,UAAA;AAAA,IACjB;AAAA,IACA,WAAW,IAAI,IAAI,OAAO,YAAY;AAAA,EAAA,CACvC;AAED,MAAI,WAAW;AAEb,qBAAiB,SAAS;AAAA,EAC5B,OAAO;AACL,WAAO,KAAK,sCAAsC;AAAA,EACpD;AAEA,QAAM,kBAAkB,IAAI,IAAI,iBAAiB;AAEjD,MAAI,QAAQ,IAAI,qBAAqB,iBAAiB;AACpD,UAAMA,eAAc,WAAW,eAAA;AAC/B,UAAM,YAAY,OAAO,KAAK,IAAA,CAAK,IAAI,WAAc,QAAQ,OAAO,OAAA,IAAW;AAC/E,UAAM,WAAW,GAAGA,cAAa,QAAQ,eAAe,GAAG,KAAK,iBAAiB,IAAI,SAAS;AAE9F,QAAI,iBAAiB;AACnB,sBAAgB,KAAK,SAAS,QAAQ,CAAC;AAAA,IACzC,OAAO;AACL,YAAM,SAAS,kBAAkB,QAAQ;AACzC,aAAO,GAAG,SAAS,CAAA,QAAO;AACxB,eAAO,MAAM,0BAA0B,QAAQ,KAAK,GAAG,EAAE;AACzD,eAAO,QAAA;AAAA,MACT,CAAC;AACD,aAAO,IAAI,MAAM,MAAM;AACrB,eAAO,KAAK,qBAAqB,QAAQ,EAAE;AAAA,MAC7C,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO,IAAI,KAAK,MAAM,KAAK;AAAA,IACzB,iBAAiB;AAAA,IACjB,YAAY;AAAA,EAAA,CACb;AACH,CAAC;"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fe8af0d5-27a9-4341-90d6-e57e107c3c7d", e._sentryDebugIdIdentifier = "sentry-dbid-fe8af0d5-27a9-4341-90d6-e57e107c3c7d");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { captureException } from "@sentry/node";
|
|
2
10
|
import { SSEStreamingApi } from "../../../node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/helper/streaming/sse.js";
|
|
11
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
3
12
|
const run = async (stream, cb, onError) => {
|
|
4
13
|
try {
|
|
5
14
|
await cb(stream);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sources":["../../../../src/server/routes/stream/streaming.ts"],"sourcesContent":["import { captureException } from \"@sentry/node\";\nimport type { Context } from \"hono\";\nimport { SSEStreamingApi } from \"hono/streaming\";\n\nconst run = async (\n stream: SSEStreamingApi,\n cb: (stream: SSEStreamingApi) => Promise<void>,\n onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>,\n): Promise<void> => {\n try {\n await cb(stream);\n } catch (e) {\n if (e instanceof Error && onError) {\n await onError(e, stream);\n\n await stream.writeSSE({\n event: \"error\",\n data: e.message,\n });\n } else {\n captureException(e, { extra: { context: \"Unhandled error in SSE stream\" } });\n }\n }\n};\n\nexport const streamSSE = (\n c: Context,\n cb: (stream: SSEStreamingApi) => Promise<void>,\n onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>,\n): Response => {\n const { readable, writable } = new TransformStream();\n const stream = new SSEStreamingApi(writable, readable);\n\n c.header(\"Transfer-Encoding\", \"chunked\");\n c.header(\"Content-Type\", \"text/event-stream\");\n c.header(\"Cache-Control\", \"no-cache\");\n c.header(\"Connection\", \"keep-alive\");\n\n // Send something in the body to trigger the `open` event\n // This is mostly for Firefox -- see #376\n stream.writeln(\"\");\n\n run(stream, cb, onError);\n\n return c.newResponse(stream.responseReadable);\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streaming.js","sources":["../../../../src/server/routes/stream/streaming.ts"],"sourcesContent":["import { captureException } from \"@sentry/node\";\nimport type { Context } from \"hono\";\nimport { SSEStreamingApi } from \"hono/streaming\";\n\nconst run = async (\n stream: SSEStreamingApi,\n cb: (stream: SSEStreamingApi) => Promise<void>,\n onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>,\n): Promise<void> => {\n try {\n await cb(stream);\n } catch (e) {\n if (e instanceof Error && onError) {\n await onError(e, stream);\n\n await stream.writeSSE({\n event: \"error\",\n data: e.message,\n });\n } else {\n captureException(e, { extra: { context: \"Unhandled error in SSE stream\" } });\n }\n }\n};\n\nexport const streamSSE = (\n c: Context,\n cb: (stream: SSEStreamingApi) => Promise<void>,\n onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>,\n): Response => {\n const { readable, writable } = new TransformStream();\n const stream = new SSEStreamingApi(writable, readable);\n\n c.header(\"Transfer-Encoding\", \"chunked\");\n c.header(\"Content-Type\", \"text/event-stream\");\n c.header(\"Cache-Control\", \"no-cache\");\n c.header(\"Connection\", \"keep-alive\");\n\n // Send something in the body to trigger the `open` event\n // This is mostly for Firefox -- see #376\n stream.writeln(\"\");\n\n run(stream, cb, onError);\n\n return c.newResponse(stream.responseReadable);\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAIA,MAAM,MAAM,OACV,QACA,IACA,YACkB;AAClB,MAAI;AACF,UAAM,GAAG,MAAM;AAAA,EACjB,SAAS,GAAG;AAQH;AACL,uBAAiB,GAAG,EAAE,OAAO,EAAE,SAAS,gCAAA,GAAmC;AAAA,IAC7E;AAAA,EACF;AACF;AAEO,MAAM,YAAY,CACvB,GACA,IACA,YACa;AACb,QAAM,EAAE,UAAU,SAAA,IAAa,IAAI,gBAAA;AACnC,QAAM,SAAS,IAAI,gBAAgB,UAAU,QAAQ;AAErD,IAAE,OAAO,qBAAqB,SAAS;AACvC,IAAE,OAAO,gBAAgB,mBAAmB;AAC5C,IAAE,OAAO,iBAAiB,UAAU;AACpC,IAAE,OAAO,cAAc,YAAY;AAInC,SAAO,QAAQ,EAAE;AAEjB,MAAI,QAAQ,EAAW;AAEvB,SAAO,EAAE,YAAY,OAAO,gBAAgB;AAC9C;"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "973355d8-c9ea-4dc7-b5bb-32f849e751bc", e._sentryDebugIdIdentifier = "sentry-dbid-973355d8-c9ea-4dc7-b5bb-32f849e751bc");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
1
10
|
function parseBrowserFromUserAgent(userAgent) {
|
|
2
11
|
if (!userAgent) return "unknown";
|
|
3
12
|
if (userAgent.includes("Chrome/") && !userAgent.includes("Edg/")) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userAgent.js","sources":["../../../../src/server/routes/stream/userAgent.ts"],"sourcesContent":["/**\n * Extracts browser name and major version from a User-Agent string\n * Returns format like \"Chrome/131\" or \"Firefox/122\"\n */\nexport function parseBrowserFromUserAgent(userAgent: string): string {\n if (!userAgent) return \"unknown\";\n\n // Check for Chrome (but not Edge which also contains Chrome)\n if (userAgent.includes(\"Chrome/\") && !userAgent.includes(\"Edg/\")) {\n const match = userAgent.match(/Chrome\\/([\\d]+)/);\n return match ? `Chrome/${match[1]}` : \"Chrome\";\n }\n\n // Check for Firefox\n if (userAgent.includes(\"Firefox/\")) {\n const match = userAgent.match(/Firefox\\/([\\d]+)/);\n return match ? `Firefox/${match[1]}` : \"Firefox\";\n }\n\n // Check for Safari (but not Chrome which also contains Safari)\n if (userAgent.includes(\"Safari/\") && !userAgent.includes(\"Chrome\")) {\n const match = userAgent.match(/Version\\/([\\d]+)/);\n return match ? `Safari/${match[1]}` : \"Safari\";\n }\n\n // Check for Edge\n if (userAgent.includes(\"Edg/\")) {\n const match = userAgent.match(/Edg\\/([\\d]+)/);\n return match ? `Edge/${match[1]}` : \"Edge\";\n }\n\n // Generic fallback - try to extract first meaningful part\n const match = userAgent.match(/^([^\\/\\s\\(]+)/);\n return match ? match[1] : \"unknown\";\n}\n\n/**\n * Builds a client identifier from browser info and optional hostname\n * Format: clientName/version (metadata)\n * Example: \"ui/Chrome/131 (example.com)\"\n */\nexport function buildClientIdentifier(clientName: string, userAgent?: string, hostname?: string): string {\n let clientId = clientName;\n\n if (userAgent) {\n const browserInfo = parseBrowserFromUserAgent(userAgent);\n if (browserInfo !== \"unknown\") {\n clientId = `${clientName}/${browserInfo}`;\n }\n }\n\n if (hostname && hostname !== \"localhost\") {\n clientId += ` (${hostname})`;\n }\n\n return clientId;\n}\n"],"names":["match"],"mappings":"AAIO,SAAS,0BAA0B,WAA2B;AACnE,MAAI,CAAC,UAAW,QAAO;AAGvB,MAAI,UAAU,SAAS,SAAS,KAAK,CAAC,UAAU,SAAS,MAAM,GAAG;AAChE,UAAMA,SAAQ,UAAU,MAAM,iBAAiB;AAC/C,WAAOA,SAAQ,UAAUA,OAAM,CAAC,CAAC,KAAK;AAAA,EACxC;AAGA,MAAI,UAAU,SAAS,UAAU,GAAG;AAClC,UAAMA,SAAQ,UAAU,MAAM,kBAAkB;AAChD,WAAOA,SAAQ,WAAWA,OAAM,CAAC,CAAC,KAAK;AAAA,EACzC;AAGA,MAAI,UAAU,SAAS,SAAS,KAAK,CAAC,UAAU,SAAS,QAAQ,GAAG;AAClE,UAAMA,SAAQ,UAAU,MAAM,kBAAkB;AAChD,WAAOA,SAAQ,UAAUA,OAAM,CAAC,CAAC,KAAK;AAAA,EACxC;AAGA,MAAI,UAAU,SAAS,MAAM,GAAG;AAC9B,UAAMA,SAAQ,UAAU,MAAM,cAAc;AAC5C,WAAOA,SAAQ,QAAQA,OAAM,CAAC,CAAC,KAAK;AAAA,EACtC;AAGA,QAAM,QAAQ,UAAU,MAAM,eAAe;AAC7C,SAAO,QAAQ,MAAM,CAAC,IAAI;AAC5B;"}
|
|
1
|
+
{"version":3,"file":"userAgent.js","sources":["../../../../src/server/routes/stream/userAgent.ts"],"sourcesContent":["/**\n * Extracts browser name and major version from a User-Agent string\n * Returns format like \"Chrome/131\" or \"Firefox/122\"\n */\nexport function parseBrowserFromUserAgent(userAgent: string): string {\n if (!userAgent) return \"unknown\";\n\n // Check for Chrome (but not Edge which also contains Chrome)\n if (userAgent.includes(\"Chrome/\") && !userAgent.includes(\"Edg/\")) {\n const match = userAgent.match(/Chrome\\/([\\d]+)/);\n return match ? `Chrome/${match[1]}` : \"Chrome\";\n }\n\n // Check for Firefox\n if (userAgent.includes(\"Firefox/\")) {\n const match = userAgent.match(/Firefox\\/([\\d]+)/);\n return match ? `Firefox/${match[1]}` : \"Firefox\";\n }\n\n // Check for Safari (but not Chrome which also contains Safari)\n if (userAgent.includes(\"Safari/\") && !userAgent.includes(\"Chrome\")) {\n const match = userAgent.match(/Version\\/([\\d]+)/);\n return match ? `Safari/${match[1]}` : \"Safari\";\n }\n\n // Check for Edge\n if (userAgent.includes(\"Edg/\")) {\n const match = userAgent.match(/Edg\\/([\\d]+)/);\n return match ? `Edge/${match[1]}` : \"Edge\";\n }\n\n // Generic fallback - try to extract first meaningful part\n const match = userAgent.match(/^([^\\/\\s\\(]+)/);\n return match ? match[1] : \"unknown\";\n}\n\n/**\n * Builds a client identifier from browser info and optional hostname\n * Format: clientName/version (metadata)\n * Example: \"ui/Chrome/131 (example.com)\"\n */\nexport function buildClientIdentifier(clientName: string, userAgent?: string, hostname?: string): string {\n let clientId = clientName;\n\n if (userAgent) {\n const browserInfo = parseBrowserFromUserAgent(userAgent);\n if (browserInfo !== \"unknown\") {\n clientId = `${clientName}/${browserInfo}`;\n }\n }\n\n if (hostname && hostname !== \"localhost\") {\n clientId += ` (${hostname})`;\n }\n\n return clientId;\n}\n"],"names":["match"],"mappings":";;;;;;;;;AAIO,SAAS,0BAA0B,WAA2B;AACnE,MAAI,CAAC,UAAW,QAAO;AAGvB,MAAI,UAAU,SAAS,SAAS,KAAK,CAAC,UAAU,SAAS,MAAM,GAAG;AAChE,UAAMA,SAAQ,UAAU,MAAM,iBAAiB;AAC/C,WAAOA,SAAQ,UAAUA,OAAM,CAAC,CAAC,KAAK;AAAA,EACxC;AAGA,MAAI,UAAU,SAAS,UAAU,GAAG;AAClC,UAAMA,SAAQ,UAAU,MAAM,kBAAkB;AAChD,WAAOA,SAAQ,WAAWA,OAAM,CAAC,CAAC,KAAK;AAAA,EACzC;AAGA,MAAI,UAAU,SAAS,SAAS,KAAK,CAAC,UAAU,SAAS,QAAQ,GAAG;AAClE,UAAMA,SAAQ,UAAU,MAAM,kBAAkB;AAChD,WAAOA,SAAQ,UAAUA,OAAM,CAAC,CAAC,KAAK;AAAA,EACxC;AAGA,MAAI,UAAU,SAAS,MAAM,GAAG;AAC9B,UAAMA,SAAQ,UAAU,MAAM,cAAc;AAC5C,WAAOA,SAAQ,QAAQA,OAAM,CAAC,CAAC,KAAK;AAAA,EACtC;AAGA,QAAM,QAAQ,UAAU,MAAM,eAAe;AAC7C,SAAO,QAAQ,MAAM,CAAC,IAAI;AAC5B;"}
|
package/dist/server/sdk.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MessageBuffer } from './messageBuffer.ts';
|
|
2
2
|
import { EventContainer } from './utils/eventContainer.ts';
|
|
3
3
|
declare const decompressors: Record<"gzip" | "deflate" | "br", (buf: Buffer) => Buffer>;
|
|
4
|
-
type ContentEncoding = keyof typeof decompressors;
|
|
4
|
+
export type ContentEncoding = keyof typeof decompressors;
|
|
5
5
|
export declare function createSpotlightBuffer(): MessageBuffer<EventContainer>;
|
|
6
6
|
type PushToSpotlightBufferOptions = {
|
|
7
7
|
spotlightBuffer: MessageBuffer<EventContainer>;
|
package/dist/server/sdk.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "75ed20dd-d677-4ccd-a15b-af93d9a30db1", e._sentryDebugIdIdentifier = "sentry-dbid-75ed20dd-d677-4ccd-a15b-af93d9a30db1");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { brotliDecompressSync, inflateSync, gunzipSync } from "node:zlib";
|
|
2
10
|
import { MessageBuffer } from "./messageBuffer.js";
|
|
3
11
|
import { EventContainer } from "./utils/eventContainer.js";
|
|
12
|
+
import "../_virtual/_sentry-release-injection-file.js";
|
|
4
13
|
const decompressors = {
|
|
5
14
|
gzip: gunzipSync,
|
|
6
15
|
deflate: inflateSync,
|
package/dist/server/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../src/server/sdk.ts"],"sourcesContent":["import { brotliDecompressSync, gunzipSync, inflateSync } from \"node:zlib\";\nimport { MessageBuffer } from \"./messageBuffer.ts\";\nimport { EventContainer } from \"./utils/eventContainer.ts\";\n\nconst decompressors: Record<\"gzip\" | \"deflate\" | \"br\", (buf: Buffer) => Buffer> = {\n gzip: gunzipSync,\n deflate: inflateSync,\n br: brotliDecompressSync,\n};\
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../src/server/sdk.ts"],"sourcesContent":["import { brotliDecompressSync, gunzipSync, inflateSync } from \"node:zlib\";\nimport { MessageBuffer } from \"./messageBuffer.ts\";\nimport { EventContainer } from \"./utils/eventContainer.ts\";\n\nconst decompressors: Record<\"gzip\" | \"deflate\" | \"br\", (buf: Buffer) => Buffer> = {\n gzip: gunzipSync,\n deflate: inflateSync,\n br: brotliDecompressSync,\n};\n\nexport type ContentEncoding = keyof typeof decompressors;\n\nexport function createSpotlightBuffer() {\n return new MessageBuffer<EventContainer>();\n}\n\ntype PushToSpotlightBufferOptions = {\n spotlightBuffer: MessageBuffer<EventContainer>;\n body: Buffer;\n encoding?: ContentEncoding;\n contentType?: string;\n userAgent?: string;\n};\n\nexport function pushToSpotlightBuffer(options: PushToSpotlightBufferOptions) {\n const body = decompressBody(options.body, options.encoding);\n\n const contentType = options.contentType?.split(\";\")[0].toLocaleLowerCase();\n\n if (contentType) {\n // Create event container and add to buffer\n const container = new EventContainer(contentType, body, options.userAgent);\n\n // Add to buffer - this will automatically trigger all subscribers\n // including the onEnvelope callback if one is registered\n options.spotlightBuffer.put(container);\n\n return container;\n }\n}\n\nexport function decompressBody(body: Buffer, contentEncoding?: ContentEncoding) {\n if (!contentEncoding) {\n return body;\n }\n return decompressors[contentEncoding](body);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAM,gBAA4E;AAAA,EAChF,MAAM;AAAA,EACN,SAAS;AAAA,EACT,IAAI;AACN;AAIO,SAAS,wBAAwB;AACtC,SAAO,IAAI,cAAA;AACb;AAUO,SAAS,sBAAsB,SAAuC;AAC3E,QAAM,OAAO,eAAe,QAAQ,MAAM,QAAQ,QAAQ;AAE1D,QAAM,cAAc,QAAQ,aAAa,MAAM,GAAG,EAAE,CAAC,EAAE,kBAAA;AAEvD,MAAI,aAAa;AAEf,UAAM,YAAY,IAAI,eAAe,aAAa,MAAM,QAAQ,SAAS;AAIzE,YAAQ,gBAAgB,IAAI,SAAS;AAErC,WAAO;AAAA,EACT;AACF;AAEO,SAAS,eAAe,MAAc,iBAAmC;AAC9E,MAAI,CAAC,iBAAiB;AACpB,WAAO;AAAA,EACT;AACA,SAAO,cAAc,eAAe,EAAE,IAAI;AAC5C;"}
|
|
@@ -9,6 +9,7 @@ export type CLIHandlerOptions = {
|
|
|
9
9
|
format?: FormatterType;
|
|
10
10
|
basePath?: SideCarOptions["basePath"];
|
|
11
11
|
filesToServe?: SideCarOptions["filesToServe"];
|
|
12
|
+
allowedOrigins?: SideCarOptions["allowedOrigins"];
|
|
12
13
|
};
|
|
13
14
|
export type CLIHandlerReturnType = Promise<any> | any;
|
|
14
15
|
export type CLIHandler = ((options: CLIHandlerOptions) => CLIHandlerReturnType) | (() => CLIHandlerReturnType);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ParsedEnvelope } from '../parser/processEnvelope.ts';
|
|
2
|
+
import { NormalizedAllowedOrigins } from '../utils/cors.ts';
|
|
2
3
|
export type IncomingPayloadCallback = (body: string) => void;
|
|
3
4
|
export type OnEnvelopeCallback = (envelope: ParsedEnvelope["envelope"]) => void;
|
|
4
5
|
export type SidecarLogger = {
|
|
@@ -38,7 +39,18 @@ export type SideCarOptions = {
|
|
|
38
39
|
onEnvelope?: OnEnvelopeCallback;
|
|
39
40
|
isStandalone?: boolean;
|
|
40
41
|
stdioMCP?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Additional origins to allow for CORS requests.
|
|
44
|
+
* Useful for custom local domains, tunnels, etc.
|
|
45
|
+
*
|
|
46
|
+
* Accepts two formats:
|
|
47
|
+
* - Full origins (e.g., "https://ngrok.io:443") for strict matching
|
|
48
|
+
* - Plain domains (e.g., "myapp.local") to allow any protocol/port
|
|
49
|
+
*/
|
|
50
|
+
allowedOrigins?: string[];
|
|
41
51
|
};
|
|
42
52
|
export type StartServerOptions = Pick<SideCarOptions, "basePath" | "filesToServe" | "incomingPayload"> & {
|
|
43
53
|
port: number;
|
|
54
|
+
/** Pre-normalized allowed origins for CORS (use normalizeAllowedOrigins() to create) */
|
|
55
|
+
normalizedAllowedOrigins?: NormalizedAllowedOrigins;
|
|
44
56
|
};
|
|
@@ -1,12 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-normalized allowed origins for efficient matching.
|
|
3
|
+
* Call normalizeAllowedOrigins() once at server startup to create this structure.
|
|
4
|
+
*/
|
|
5
|
+
export interface NormalizedAllowedOrigins {
|
|
6
|
+
/** Full origins (lowercased, trailing slash removed) for exact matching */
|
|
7
|
+
fullOrigins: Set<string>;
|
|
8
|
+
/** Plain domains (lowercased) for permissive matching */
|
|
9
|
+
domains: Set<string>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Normalize and classify allowed origins for efficient matching.
|
|
13
|
+
* Call this once at server startup, then pass the result to isAllowedOrigin().
|
|
14
|
+
*
|
|
15
|
+
* @param allowedOrigins - Raw list of allowed origins/domains from config
|
|
16
|
+
* @returns Pre-normalized structure for O(1) lookups
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeAllowedOrigins(allowedOrigins: string[]): NormalizedAllowedOrigins;
|
|
19
|
+
/**
|
|
20
|
+
* Clear the DNS cache, pending resolutions, and machine IPs cache. Useful for testing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearDnsCache(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current DNS cache size. Useful for testing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDnsCacheSize(): number;
|
|
1
27
|
/**
|
|
2
28
|
* Validates if an origin should be allowed to access the Sidecar.
|
|
3
29
|
*
|
|
4
30
|
* Allowed origins:
|
|
5
|
-
* - localhost
|
|
6
|
-
* -
|
|
7
|
-
* - https
|
|
31
|
+
* - localhost (RFC 6761 reserved name, always trusted)
|
|
32
|
+
* - Any origin whose hostname resolves to this machine's IPs (with TTL >= 1h)
|
|
33
|
+
* - https://spotlightjs.com and subdomains (HTTPS only, default port)
|
|
34
|
+
* - Custom origins/domains from the normalizedAllowedOrigins list
|
|
35
|
+
*
|
|
36
|
+
* For DNS rebinding protection details, see the TTL Constants section above.
|
|
8
37
|
*
|
|
9
38
|
* @param origin - The origin to validate
|
|
10
|
-
* @
|
|
39
|
+
* @param normalizedAllowedOrigins - Optional pre-normalized allowed origins (from normalizeAllowedOrigins())
|
|
40
|
+
* @returns Promise<boolean> - true if the origin is allowed, false otherwise
|
|
11
41
|
*/
|
|
12
|
-
export declare function isAllowedOrigin(origin: string): boolean
|
|
42
|
+
export declare function isAllowedOrigin(origin: string, normalizedAllowedOrigins?: NormalizedAllowedOrigins): Promise<boolean>;
|
|
@@ -1,22 +1,195 @@
|
|
|
1
|
-
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4dd6e253-0d5e-4edb-bdeb-58750d0d4592", e._sentryDebugIdIdentifier = "sentry-dbid-4dd6e253-0d5e-4edb-bdeb-58750d0d4592");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import dns from "node:dns/promises";
|
|
10
|
+
import net from "node:net";
|
|
11
|
+
import os__default from "node:os";
|
|
12
|
+
import "../../_virtual/_sentry-release-injection-file.js";
|
|
13
|
+
const dnsCache = /* @__PURE__ */ new Map();
|
|
14
|
+
const pendingResolutions = /* @__PURE__ */ new Map();
|
|
15
|
+
const MIN_TTL_SECONDS = 60 * 60;
|
|
16
|
+
const DEFAULT_TTL_MS = 60 * 60 * 1e3;
|
|
17
|
+
const FAILURE_TTL_MS = 5 * 60 * 1e3;
|
|
18
|
+
let machineIPsCache = null;
|
|
19
|
+
let machineIPsCacheTime = 0;
|
|
20
|
+
const MACHINE_IPS_CACHE_TTL_MS = 60 * 1e3;
|
|
21
|
+
function getMachineIPs() {
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
if (machineIPsCache && now - machineIPsCacheTime < MACHINE_IPS_CACHE_TTL_MS) {
|
|
24
|
+
return machineIPsCache;
|
|
25
|
+
}
|
|
26
|
+
const ips = /* @__PURE__ */ new Set();
|
|
27
|
+
const interfaces = os__default.networkInterfaces();
|
|
28
|
+
for (const name in interfaces) {
|
|
29
|
+
const addresses = interfaces[name];
|
|
30
|
+
if (addresses) {
|
|
31
|
+
for (const addr of addresses) {
|
|
32
|
+
ips.add(addr.address);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
machineIPsCache = ips;
|
|
37
|
+
machineIPsCacheTime = now;
|
|
38
|
+
return ips;
|
|
39
|
+
}
|
|
40
|
+
function isIPAddress(hostname) {
|
|
41
|
+
const cleanHostname = hostname.startsWith("[") && hostname.endsWith("]") ? hostname.slice(1, -1) : hostname;
|
|
42
|
+
return net.isIP(cleanHostname) !== 0;
|
|
43
|
+
}
|
|
44
|
+
function isLocalMachineIP(ip) {
|
|
45
|
+
const cleanIP = ip.startsWith("[") && ip.endsWith("]") ? ip.slice(1, -1) : ip;
|
|
46
|
+
const machineIPs = getMachineIPs();
|
|
47
|
+
return machineIPs.has(cleanIP);
|
|
48
|
+
}
|
|
49
|
+
async function resolveHostname(hostname) {
|
|
50
|
+
const dnsAddresses = [];
|
|
51
|
+
const hostsFileAddresses = [];
|
|
52
|
+
let minTtl;
|
|
53
|
+
const [resolve4Result, resolve6Result, lookupResult] = await Promise.allSettled([
|
|
54
|
+
dns.resolve4(hostname, { ttl: true }),
|
|
55
|
+
dns.resolve6(hostname, { ttl: true }),
|
|
56
|
+
dns.lookup(hostname, { all: true })
|
|
57
|
+
]);
|
|
58
|
+
const dnsSucceeded = resolve4Result.status === "fulfilled" || resolve6Result.status === "fulfilled";
|
|
59
|
+
if (resolve4Result.status === "fulfilled") {
|
|
60
|
+
for (const record of resolve4Result.value) {
|
|
61
|
+
dnsAddresses.push({ address: record.address, ttl: record.ttl });
|
|
62
|
+
if (record.ttl !== void 0) {
|
|
63
|
+
minTtl = minTtl === void 0 ? record.ttl : Math.min(minTtl, record.ttl);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (resolve6Result.status === "fulfilled") {
|
|
68
|
+
for (const record of resolve6Result.value) {
|
|
69
|
+
dnsAddresses.push({ address: record.address, ttl: record.ttl });
|
|
70
|
+
if (record.ttl !== void 0) {
|
|
71
|
+
minTtl = minTtl === void 0 ? record.ttl : Math.min(minTtl, record.ttl);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!dnsSucceeded && lookupResult.status === "fulfilled") {
|
|
76
|
+
const lookupAddresses = Array.isArray(lookupResult.value) ? lookupResult.value : [lookupResult.value];
|
|
77
|
+
for (const record of lookupAddresses) {
|
|
78
|
+
hostsFileAddresses.push(record.address);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { dnsAddresses, hostsFileAddresses, minTtl };
|
|
82
|
+
}
|
|
83
|
+
async function resolveAndCacheHostname(hostname) {
|
|
84
|
+
try {
|
|
85
|
+
const { dnsAddresses, hostsFileAddresses, minTtl } = await resolveHostname(hostname);
|
|
86
|
+
const hostsLocal = hostsFileAddresses.some((addr) => isLocalMachineIP(addr));
|
|
87
|
+
if (hostsLocal) {
|
|
88
|
+
dnsCache.set(hostname, {
|
|
89
|
+
isLocal: true,
|
|
90
|
+
expiresAt: Date.now() + DEFAULT_TTL_MS
|
|
91
|
+
});
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
const dnsLocal = dnsAddresses.some((result) => isLocalMachineIP(result.address));
|
|
95
|
+
if (dnsLocal) {
|
|
96
|
+
if (minTtl !== void 0 && minTtl < MIN_TTL_SECONDS) {
|
|
97
|
+
dnsCache.set(hostname, {
|
|
98
|
+
isLocal: false,
|
|
99
|
+
expiresAt: Date.now() + FAILURE_TTL_MS
|
|
100
|
+
});
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const cacheTtl2 = minTtl !== void 0 ? minTtl * 1e3 : DEFAULT_TTL_MS;
|
|
104
|
+
dnsCache.set(hostname, {
|
|
105
|
+
isLocal: true,
|
|
106
|
+
expiresAt: Date.now() + cacheTtl2
|
|
107
|
+
});
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const cacheTtl = minTtl !== void 0 ? minTtl * 1e3 : DEFAULT_TTL_MS;
|
|
111
|
+
dnsCache.set(hostname, {
|
|
112
|
+
isLocal: false,
|
|
113
|
+
expiresAt: Date.now() + cacheTtl
|
|
114
|
+
});
|
|
115
|
+
return false;
|
|
116
|
+
} catch {
|
|
117
|
+
dnsCache.set(hostname, {
|
|
118
|
+
isLocal: false,
|
|
119
|
+
expiresAt: Date.now() + FAILURE_TTL_MS
|
|
120
|
+
});
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function isHostnameLocal(hostname) {
|
|
125
|
+
const cached = dnsCache.get(hostname);
|
|
126
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
127
|
+
return cached.isLocal;
|
|
128
|
+
}
|
|
129
|
+
const pending = pendingResolutions.get(hostname);
|
|
130
|
+
if (pending) {
|
|
131
|
+
return pending;
|
|
132
|
+
}
|
|
133
|
+
const resolution = resolveAndCacheHostname(hostname);
|
|
134
|
+
pendingResolutions.set(hostname, resolution);
|
|
135
|
+
try {
|
|
136
|
+
return await resolution;
|
|
137
|
+
} finally {
|
|
138
|
+
pendingResolutions.delete(hostname);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function isSpotlightOrigin(url, hostname) {
|
|
142
|
+
if (hostname === "spotlightjs.com" || hostname.endsWith(".spotlightjs.com")) {
|
|
143
|
+
return url.protocol === "https:" && (url.port === "" || url.port === "443");
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
function normalizeAllowedOrigins(allowedOrigins) {
|
|
148
|
+
const fullOrigins = /* @__PURE__ */ new Set();
|
|
149
|
+
const domains = /* @__PURE__ */ new Set();
|
|
150
|
+
for (const entry of allowedOrigins) {
|
|
151
|
+
const normalized = entry.toLowerCase();
|
|
152
|
+
if (normalized.includes("://")) {
|
|
153
|
+
fullOrigins.add(normalized.replace(/\/$/, ""));
|
|
154
|
+
} else {
|
|
155
|
+
domains.add(normalized);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return { fullOrigins, domains };
|
|
159
|
+
}
|
|
160
|
+
function isCustomAllowedOrigin(origin, hostname, normalized) {
|
|
161
|
+
if (normalized.domains.has(hostname)) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
const normalizedOrigin = origin.toLowerCase().replace(/\/$/, "");
|
|
165
|
+
return normalized.fullOrigins.has(normalizedOrigin);
|
|
166
|
+
}
|
|
167
|
+
async function isAllowedOrigin(origin, normalizedAllowedOrigins) {
|
|
2
168
|
if (!origin) {
|
|
3
169
|
return false;
|
|
4
170
|
}
|
|
5
171
|
try {
|
|
6
172
|
const url = new URL(origin);
|
|
7
173
|
const hostname = url.hostname.toLowerCase();
|
|
8
|
-
if (hostname === "localhost"
|
|
174
|
+
if (hostname === "localhost") {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
if (isSpotlightOrigin(url, hostname)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
if (normalizedAllowedOrigins && isCustomAllowedOrigin(origin, hostname, normalizedAllowedOrigins)) {
|
|
9
181
|
return true;
|
|
10
182
|
}
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
183
|
+
if (isIPAddress(hostname)) {
|
|
184
|
+
return isLocalMachineIP(hostname);
|
|
13
185
|
}
|
|
14
|
-
return hostname
|
|
186
|
+
return isHostnameLocal(hostname);
|
|
15
187
|
} catch {
|
|
16
188
|
return false;
|
|
17
189
|
}
|
|
18
190
|
}
|
|
19
191
|
export {
|
|
20
|
-
isAllowedOrigin
|
|
192
|
+
isAllowedOrigin,
|
|
193
|
+
normalizeAllowedOrigins
|
|
21
194
|
};
|
|
22
195
|
//# sourceMappingURL=cors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.js","sources":["../../../src/server/utils/cors.ts"],"sourcesContent":["/**\n * Validates if an origin should be allowed to access the Sidecar.\n *\n * Allowed origins:\n * - localhost with any port or protocol (http/https)\n * - https://spotlightjs.com (HTTPS only, default port)\n * - https://*.spotlightjs.com (HTTPS only, default port)\n *\n * @param origin - The origin to validate\n * @returns true if the origin is allowed, false otherwise\n */\nexport function isAllowedOrigin(origin: string): boolean {\n if (!origin) {\n return false;\n }\n\n try {\n const url = new URL(origin);\n const hostname = url.hostname.toLowerCase();\n\n // Allow localhost with any port and protocol (http or https)\n // Check both [::1] and ::1 formats for IPv6 localhost compatibility\n if (hostname === \"localhost\" || hostname === \"127.0.0.1\" || hostname === \"[::1]\" || hostname === \"::1\") {\n return true;\n }\n\n // Check for spotlightjs.com domains - must be HTTPS with default port\n if (url.protocol !== \"https:\" || (url.port !== \"\" && url.port !== \"443\")) {\n return false;\n }\n\n return hostname === \"spotlightjs.com\" || hostname.endsWith(\".spotlightjs.com\");\n } catch {\n // Invalid URL\n return false;\n }\n}\n"],"names":[],"mappings":"AAWO,SAAS,gBAAgB,QAAyB;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,MAAM,IAAI,IAAI,MAAM;AAC1B,UAAM,WAAW,IAAI,SAAS,YAAA;AAI9B,QAAI,aAAa,eAAe,aAAa,eAAe,aAAa,WAAW,aAAa,OAAO;AACtG,aAAO;AAAA,IACT;AAGA,QAAI,IAAI,aAAa,YAAa,IAAI,SAAS,MAAM,IAAI,SAAS,OAAQ;AACxE,aAAO;AAAA,IACT;AAEA,WAAO,aAAa,qBAAqB,SAAS,SAAS,kBAAkB;AAAA,EAC/E,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;"}
|
|
1
|
+
{"version":3,"file":"cors.js","sources":["../../../src/server/utils/cors.ts"],"sourcesContent":["import dns from \"node:dns/promises\";\nimport net from \"node:net\";\nimport os from \"node:os\";\n\n/**\n * DNS Resolution Cache Entry\n */\ninterface CacheEntry {\n isLocal: boolean;\n expiresAt: number;\n}\n\n/**\n * DNS Resolution Result with optional TTL\n */\ninterface DnsResult {\n address: string;\n ttl?: number;\n}\n\n/**\n * Cache for DNS resolution results.\n * Key: lowercase hostname\n * Value: { isLocal, expiresAt }\n */\nconst dnsCache = new Map<string, CacheEntry>();\n\n/**\n * In-flight DNS resolutions for request coalescing.\n * Prevents duplicate DNS lookups when multiple requests come in\n * for the same hostname before the first one completes.\n */\nconst pendingResolutions = new Map<string, Promise<boolean>>();\n\n/**\n * TTL Constants (in milliseconds)\n *\n * DNS Rebinding Attack Protection:\n * ================================\n * A DNS rebinding attack works by:\n * 1. Attacker controls evil.com with a short TTL\n * 2. User visits evil.com, which initially resolves to attacker's server\n * 3. Attacker's page loads malicious JavaScript\n * 4. Attacker rebinds evil.com to 127.0.0.1\n * 5. JavaScript makes requests to evil.com (now 127.0.0.1), bypassing same-origin policy\n *\n * Our mitigation: Reject DNS records with TTL < 1 hour.\n * This means an attacker would need to set a TTL >= 1 hour, making their\n * site inaccessible for that duration after rebinding. This makes the attack\n * impractical for real-world exploitation.\n */\nconst MIN_TTL_SECONDS = 60 * 60; // 1 hour - reject DNS records with lower TTL\nconst DEFAULT_TTL_MS = 60 * 60 * 1000; // 1 hour - used when DNS doesn't provide TTL (e.g., /etc/hosts)\nconst FAILURE_TTL_MS = 5 * 60 * 1000; // 5 minutes - cache failed lookups to avoid hammering DNS\n\n/**\n * DNS resolution notes:\n * We use both resolve4/6 AND lookup because:\n * - dns.resolve4/6: Queries DNS servers directly, can return TTL\n * - dns.lookup: Uses OS resolver (getaddrinfo), checks /etc/hosts first, then DNS\n *\n * A hostname in /etc/hosts won't be found by resolve4/6, hence we need both.\n * We can only trust lookup results when DNS (resolve4/6) fails - that means\n * the result came from /etc/hosts rather than DNS.\n */\n\n/**\n * Cache for machine's own IP addresses.\n * Refreshed periodically as network interfaces can change.\n */\nlet machineIPsCache: Set<string> | null = null;\nlet machineIPsCacheTime = 0;\nconst MACHINE_IPS_CACHE_TTL_MS = 60 * 1000; // 1 minute - refresh periodically for network changes\n\n/**\n * Get all IP addresses assigned to this machine's network interfaces.\n * This includes:\n * - Loopback (127.0.0.1, ::1)\n * - Local/private IPs (192.168.x.x, 10.x.x.x, etc.)\n * - VPN IPs (e.g., Tailscale 100.x.x.x, Zerotier IPs)\n *\n * Results are cached for 1 minute to handle network changes while\n * avoiding repeated system calls.\n */\nfunction getMachineIPs(): Set<string> {\n const now = Date.now();\n if (machineIPsCache && now - machineIPsCacheTime < MACHINE_IPS_CACHE_TTL_MS) {\n return machineIPsCache;\n }\n\n const ips = new Set<string>();\n const interfaces = os.networkInterfaces();\n\n for (const name in interfaces) {\n const addresses = interfaces[name];\n if (addresses) {\n for (const addr of addresses) {\n ips.add(addr.address);\n }\n }\n }\n\n machineIPsCache = ips;\n machineIPsCacheTime = now;\n return ips;\n}\n\n/**\n * Check if a string is an IP address (IPv4 or IPv6).\n */\nfunction isIPAddress(hostname: string): boolean {\n // Handle bracketed IPv6 (e.g., [::1])\n const cleanHostname = hostname.startsWith(\"[\") && hostname.endsWith(\"]\") ? hostname.slice(1, -1) : hostname;\n return net.isIP(cleanHostname) !== 0;\n}\n\n/**\n * Check if an IP address belongs to this machine.\n * See getMachineIPs() for details on what IPs are considered local.\n */\nfunction isLocalMachineIP(ip: string): boolean {\n // Handle bracketed IPv6\n const cleanIP = ip.startsWith(\"[\") && ip.endsWith(\"]\") ? ip.slice(1, -1) : ip;\n const machineIPs = getMachineIPs();\n return machineIPs.has(cleanIP);\n}\n\n/**\n * Resolution result with source information for trust decisions.\n */\ninterface ResolutionResult {\n /** Addresses from dns.resolve4/6() with TTL */\n dnsAddresses: DnsResult[];\n /** Addresses from dns.lookup() when DNS failed - these are from /etc/hosts */\n hostsFileAddresses: string[];\n /** Minimum TTL from DNS results (seconds) */\n minTtl?: number;\n}\n\n/**\n * Resolve a hostname to IP addresses using both DNS and OS resolver.\n *\n * Why both dns.resolve() and dns.lookup()?\n * - dns.resolve4/6: Direct DNS query, returns TTL when available\n * - dns.lookup: Uses OS resolver (getaddrinfo), which reads /etc/hosts\n *\n * A hostname in /etc/hosts won't be found by resolve4/6, hence we need both.\n *\n * Trust model:\n * - If dns.resolve() succeeds → result is from DNS, needs TTL validation\n * - If dns.resolve() fails but dns.lookup() succeeds → result is from /etc/hosts, trusted\n *\n * We can only trust lookup results when DNS failed, because lookup also queries\n * DNS servers (via the OS resolver) if the hostname isn't in /etc/hosts.\n */\nasync function resolveHostname(hostname: string): Promise<ResolutionResult> {\n const dnsAddresses: DnsResult[] = [];\n const hostsFileAddresses: string[] = [];\n let minTtl: number | undefined;\n\n // Run all resolution methods in parallel for efficiency\n const [resolve4Result, resolve6Result, lookupResult] = await Promise.allSettled([\n dns.resolve4(hostname, { ttl: true }),\n dns.resolve6(hostname, { ttl: true }),\n dns.lookup(hostname, { all: true }),\n ]);\n\n const dnsSucceeded = resolve4Result.status === \"fulfilled\" || resolve6Result.status === \"fulfilled\";\n\n // Process IPv4 DNS results (with TTL)\n if (resolve4Result.status === \"fulfilled\") {\n for (const record of resolve4Result.value) {\n dnsAddresses.push({ address: record.address, ttl: record.ttl });\n if (record.ttl !== undefined) {\n minTtl = minTtl === undefined ? record.ttl : Math.min(minTtl, record.ttl);\n }\n }\n }\n\n // Process IPv6 DNS results (with TTL)\n if (resolve6Result.status === \"fulfilled\") {\n for (const record of resolve6Result.value) {\n dnsAddresses.push({ address: record.address, ttl: record.ttl });\n if (record.ttl !== undefined) {\n minTtl = minTtl === undefined ? record.ttl : Math.min(minTtl, record.ttl);\n }\n }\n }\n\n // Process OS resolver results - ONLY trusted if DNS failed\n // If DNS succeeded, lookup would return the same DNS result (not trusted separately)\n // If DNS failed but lookup succeeded, it must be from /etc/hosts (trusted)\n if (!dnsSucceeded && lookupResult.status === \"fulfilled\") {\n const lookupAddresses = Array.isArray(lookupResult.value) ? lookupResult.value : [lookupResult.value];\n for (const record of lookupAddresses) {\n hostsFileAddresses.push(record.address);\n }\n }\n\n return { dnsAddresses, hostsFileAddresses, minTtl };\n}\n\n/**\n * Perform the actual DNS resolution and cache the result.\n * This is separated from isHostnameLocal to enable request coalescing.\n */\nasync function resolveAndCacheHostname(hostname: string): Promise<boolean> {\n try {\n const { dnsAddresses, hostsFileAddresses, minTtl } = await resolveHostname(hostname);\n\n // First check /etc/hosts addresses (trusted - DNS failed, so these must be from hosts file)\n // These are under local control and don't need TTL validation\n const hostsLocal = hostsFileAddresses.some(addr => isLocalMachineIP(addr));\n if (hostsLocal) {\n // /etc/hosts entry resolves to local - cache and allow\n dnsCache.set(hostname, {\n isLocal: true,\n expiresAt: Date.now() + DEFAULT_TTL_MS,\n });\n return true;\n }\n\n // Check DNS addresses (need TTL validation for rebinding protection)\n const dnsLocal = dnsAddresses.some(result => isLocalMachineIP(result.address));\n\n if (dnsLocal) {\n // DNS rebinding protection: reject records with TTL < 1 hour\n if (minTtl !== undefined && minTtl < MIN_TTL_SECONDS) {\n // Low TTL is suspicious - reject and cache as non-local\n dnsCache.set(hostname, {\n isLocal: false,\n expiresAt: Date.now() + FAILURE_TTL_MS,\n });\n return false;\n }\n\n // DNS resolves to local with safe TTL\n const cacheTtl = minTtl !== undefined ? minTtl * 1000 : DEFAULT_TTL_MS;\n dnsCache.set(hostname, {\n isLocal: true,\n expiresAt: Date.now() + cacheTtl,\n });\n return true;\n }\n\n // Not a local address - cache the negative result\n const cacheTtl = minTtl !== undefined ? minTtl * 1000 : DEFAULT_TTL_MS;\n dnsCache.set(hostname, {\n isLocal: false,\n expiresAt: Date.now() + cacheTtl,\n });\n return false;\n } catch {\n // DNS resolution failed - cache the failure briefly\n dnsCache.set(hostname, {\n isLocal: false,\n expiresAt: Date.now() + FAILURE_TTL_MS,\n });\n return false;\n }\n}\n\n/**\n * Check if a hostname resolves to this machine, with DNS rebinding protection.\n *\n * Returns true if the hostname resolves to a local IP AND has a safe TTL.\n * DNS records with TTL < 1 hour are rejected to prevent rebinding attacks.\n * Results are cached to avoid repeated DNS lookups.\n *\n * Uses request coalescing: if multiple requests come in for the same hostname\n * before the first resolution completes, they all share the same promise.\n */\nasync function isHostnameLocal(hostname: string): Promise<boolean> {\n // Check cache first\n const cached = dnsCache.get(hostname);\n if (cached && cached.expiresAt > Date.now()) {\n return cached.isLocal;\n }\n\n // Check if there's already an in-flight resolution for this hostname\n const pending = pendingResolutions.get(hostname);\n if (pending) {\n return pending;\n }\n\n // Start a new resolution and track it\n const resolution = resolveAndCacheHostname(hostname);\n pendingResolutions.set(hostname, resolution);\n\n try {\n return await resolution;\n } finally {\n pendingResolutions.delete(hostname);\n }\n}\n\n/**\n * Check if an origin is from spotlightjs.com (HTTPS only, default port).\n */\nfunction isSpotlightOrigin(url: URL, hostname: string): boolean {\n if (hostname === \"spotlightjs.com\" || hostname.endsWith(\".spotlightjs.com\")) {\n return url.protocol === \"https:\" && (url.port === \"\" || url.port === \"443\");\n }\n return false;\n}\n\n/**\n * Pre-normalized allowed origins for efficient matching.\n * Call normalizeAllowedOrigins() once at server startup to create this structure.\n */\nexport interface NormalizedAllowedOrigins {\n /** Full origins (lowercased, trailing slash removed) for exact matching */\n fullOrigins: Set<string>;\n /** Plain domains (lowercased) for permissive matching */\n domains: Set<string>;\n}\n\n/**\n * Normalize and classify allowed origins for efficient matching.\n * Call this once at server startup, then pass the result to isAllowedOrigin().\n *\n * @param allowedOrigins - Raw list of allowed origins/domains from config\n * @returns Pre-normalized structure for O(1) lookups\n */\nexport function normalizeAllowedOrigins(allowedOrigins: string[]): NormalizedAllowedOrigins {\n const fullOrigins = new Set<string>();\n const domains = new Set<string>();\n\n for (const entry of allowedOrigins) {\n const normalized = entry.toLowerCase();\n if (normalized.includes(\"://\")) {\n // Full origin - normalize by removing trailing slash\n fullOrigins.add(normalized.replace(/\\/$/, \"\"));\n } else {\n // Plain domain\n domains.add(normalized);\n }\n }\n\n return { fullOrigins, domains };\n}\n\n/**\n * Check if an origin matches an entry in the pre-normalized allowed origins.\n *\n * Supports two formats:\n * - Full origins (e.g., \"https://ngrok.io:443\") - exact match required\n * - Plain domains (e.g., \"myapp.local\") - matches any protocol/port\n *\n * @param origin - The origin to check (e.g., \"https://myapp.local:3000\")\n * @param hostname - The lowercase hostname from the origin URL\n * @param normalized - Pre-normalized allowed origins\n */\nfunction isCustomAllowedOrigin(origin: string, hostname: string, normalized: NormalizedAllowedOrigins): boolean {\n // Check plain domain match first (more common case)\n if (normalized.domains.has(hostname)) {\n return true;\n }\n\n // Check full origin match\n const normalizedOrigin = origin.toLowerCase().replace(/\\/$/, \"\");\n return normalized.fullOrigins.has(normalizedOrigin);\n}\n\n/**\n * Clear the DNS cache, pending resolutions, and machine IPs cache. Useful for testing.\n */\nexport function clearDnsCache(): void {\n dnsCache.clear();\n pendingResolutions.clear();\n machineIPsCache = null;\n machineIPsCacheTime = 0;\n}\n\n/**\n * Get the current DNS cache size. Useful for testing.\n */\nexport function getDnsCacheSize(): number {\n return dnsCache.size;\n}\n\n/**\n * Validates if an origin should be allowed to access the Sidecar.\n *\n * Allowed origins:\n * - localhost (RFC 6761 reserved name, always trusted)\n * - Any origin whose hostname resolves to this machine's IPs (with TTL >= 1h)\n * - https://spotlightjs.com and subdomains (HTTPS only, default port)\n * - Custom origins/domains from the normalizedAllowedOrigins list\n *\n * For DNS rebinding protection details, see the TTL Constants section above.\n *\n * @param origin - The origin to validate\n * @param normalizedAllowedOrigins - Optional pre-normalized allowed origins (from normalizeAllowedOrigins())\n * @returns Promise<boolean> - true if the origin is allowed, false otherwise\n */\nexport async function isAllowedOrigin(\n origin: string,\n normalizedAllowedOrigins?: NormalizedAllowedOrigins,\n): Promise<boolean> {\n if (!origin) {\n return false;\n }\n\n try {\n const url = new URL(origin);\n const hostname = url.hostname.toLowerCase();\n\n // Fast path: localhost is always allowed (RFC 6761 reserved name)\n // This is safe because \"localhost\" is guaranteed to resolve to loopback\n // and cannot be registered as a public domain name.\n if (hostname === \"localhost\") {\n return true;\n }\n\n // Fast path: spotlightjs.com domains (no DNS lookup needed)\n if (isSpotlightOrigin(url, hostname)) {\n return true;\n }\n\n // Fast path: Check custom allowed origins (no DNS lookup needed)\n if (normalizedAllowedOrigins && isCustomAllowedOrigin(origin, hostname, normalizedAllowedOrigins)) {\n return true;\n }\n\n // Fast path: If hostname is already an IP address, check directly\n if (isIPAddress(hostname)) {\n return isLocalMachineIP(hostname);\n }\n\n // Resolve hostname and check if it's local (with caching and TTL validation)\n return isHostnameLocal(hostname);\n } catch {\n // Invalid URL\n return false;\n }\n}\n"],"names":["os","cacheTtl"],"mappings":"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"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "27b39d5b-e60f-435f-945d-efc94ca1a964", e._sentryDebugIdIdentifier = "sentry-dbid-27b39d5b-e60f-435f-945d-efc94ca1a964");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { accessSync, constants, readFileSync } from "node:fs";
|
|
2
10
|
import { delimiter } from "node:path";
|
|
3
11
|
import { parse } from "yaml";
|
|
4
12
|
import { logger } from "../logger.js";
|
|
13
|
+
import "../../_virtual/_sentry-release-injection-file.js";
|
|
5
14
|
const COMPOSE_FILE_BASE_NAMES = ["docker-compose", "compose"];
|
|
6
15
|
const COMPOSE_FILE_EXTENSIONS = [".yml", ".yaml"];
|
|
7
16
|
function getComposeFilesFromEnv() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-compose-parser.js","sources":["../../../src/server/utils/docker-compose-parser.ts"],"sourcesContent":["import { constants, accessSync, readFileSync } from \"node:fs\";\nimport { delimiter } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { logger } from \"../logger.ts\";\n\nconst COMPOSE_FILE_BASE_NAMES = [\"docker-compose\", \"compose\"] as const;\nconst COMPOSE_FILE_EXTENSIONS = [\".yml\", \".yaml\"] as const;\n\n/**\n * Get compose files from COMPOSE_FILE environment variable\n * Returns an array of file paths if the variable is set, null otherwise\n */\nexport function getComposeFilesFromEnv(): string[] | null {\n const composeFileEnv = process.env.COMPOSE_FILE;\n if (!composeFileEnv) {\n return null;\n }\n\n // Split by platform-specific path delimiter (: on Unix, ; on Windows)\n const files = composeFileEnv\n .split(delimiter)\n .map(f => f.trim())\n .filter(Boolean);\n\n return files.length > 0 ? files : null;\n}\n\n/**\n * Find the compose file in the current directory by trying all combinations\n * of base names and extensions.\n */\nexport function findComposeFile(): string | null {\n for (const baseName of COMPOSE_FILE_BASE_NAMES) {\n for (const ext of COMPOSE_FILE_EXTENSIONS) {\n const fileName = `${baseName}${ext}`;\n try {\n accessSync(fileName, constants.R_OK);\n return fileName;\n } catch {\n // File doesn't exist or isn't readable, continue searching\n }\n }\n }\n return null;\n}\n\n/**\n * Find the override file for a given compose file.\n * Docker Compose looks for an override file with the same base name and extension.\n * For example: docker-compose.yml -> docker-compose.override.yml\n */\nexport function findOverrideFile(composeFile: string): string | null {\n // Extract extension from the original file to maintain consistency\n const ext = composeFile.endsWith(\".yaml\") ? \".yaml\" : \".yml\";\n const baseName = composeFile.replace(/\\.(yaml|yml)$/, \"\");\n const overrideFile = `${baseName}.override${ext}`;\n\n try {\n accessSync(overrideFile, constants.R_OK);\n return overrideFile;\n } catch {\n // File doesn't exist or isn't readable\n return null;\n }\n}\n\n/**\n * Parse compose file and extract service names\n */\nexport function getDockerComposeServices(filePath: string): string[] {\n try {\n const content = readFileSync(filePath, \"utf-8\");\n const parsed = parseYaml(content);\n\n if (!parsed || typeof parsed !== \"object\" || !(\"services\" in parsed)) {\n logger.error(`Invalid compose file: ${filePath} - missing 'services' key`);\n return [];\n }\n\n const services = parsed.services as Record<string, unknown>;\n return Object.keys(services);\n } catch (error) {\n logger.error(`Failed to parse compose file: ${filePath}`);\n logger.error(error);\n return [];\n }\n}\n"],"names":["parseYaml"],"mappings":"
|
|
1
|
+
{"version":3,"file":"docker-compose-parser.js","sources":["../../../src/server/utils/docker-compose-parser.ts"],"sourcesContent":["import { constants, accessSync, readFileSync } from \"node:fs\";\nimport { delimiter } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport { logger } from \"../logger.ts\";\n\nconst COMPOSE_FILE_BASE_NAMES = [\"docker-compose\", \"compose\"] as const;\nconst COMPOSE_FILE_EXTENSIONS = [\".yml\", \".yaml\"] as const;\n\n/**\n * Get compose files from COMPOSE_FILE environment variable\n * Returns an array of file paths if the variable is set, null otherwise\n */\nexport function getComposeFilesFromEnv(): string[] | null {\n const composeFileEnv = process.env.COMPOSE_FILE;\n if (!composeFileEnv) {\n return null;\n }\n\n // Split by platform-specific path delimiter (: on Unix, ; on Windows)\n const files = composeFileEnv\n .split(delimiter)\n .map(f => f.trim())\n .filter(Boolean);\n\n return files.length > 0 ? files : null;\n}\n\n/**\n * Find the compose file in the current directory by trying all combinations\n * of base names and extensions.\n */\nexport function findComposeFile(): string | null {\n for (const baseName of COMPOSE_FILE_BASE_NAMES) {\n for (const ext of COMPOSE_FILE_EXTENSIONS) {\n const fileName = `${baseName}${ext}`;\n try {\n accessSync(fileName, constants.R_OK);\n return fileName;\n } catch {\n // File doesn't exist or isn't readable, continue searching\n }\n }\n }\n return null;\n}\n\n/**\n * Find the override file for a given compose file.\n * Docker Compose looks for an override file with the same base name and extension.\n * For example: docker-compose.yml -> docker-compose.override.yml\n */\nexport function findOverrideFile(composeFile: string): string | null {\n // Extract extension from the original file to maintain consistency\n const ext = composeFile.endsWith(\".yaml\") ? \".yaml\" : \".yml\";\n const baseName = composeFile.replace(/\\.(yaml|yml)$/, \"\");\n const overrideFile = `${baseName}.override${ext}`;\n\n try {\n accessSync(overrideFile, constants.R_OK);\n return overrideFile;\n } catch {\n // File doesn't exist or isn't readable\n return null;\n }\n}\n\n/**\n * Parse compose file and extract service names\n */\nexport function getDockerComposeServices(filePath: string): string[] {\n try {\n const content = readFileSync(filePath, \"utf-8\");\n const parsed = parseYaml(content);\n\n if (!parsed || typeof parsed !== \"object\" || !(\"services\" in parsed)) {\n logger.error(`Invalid compose file: ${filePath} - missing 'services' key`);\n return [];\n }\n\n const services = parsed.services as Record<string, unknown>;\n return Object.keys(services);\n } catch (error) {\n logger.error(`Failed to parse compose file: ${filePath}`);\n logger.error(error);\n return [];\n }\n}\n"],"names":["parseYaml"],"mappings":";;;;;;;;;;;;;AAKA,MAAM,0BAA0B,CAAC,kBAAkB,SAAS;AAC5D,MAAM,0BAA0B,CAAC,QAAQ,OAAO;AAMzC,SAAS,yBAA0C;AACxD,QAAM,iBAAiB,QAAQ,IAAI;AACnC,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA,EACT;AAGA,QAAM,QAAQ,eACX,MAAM,SAAS,EACf,IAAI,CAAA,MAAK,EAAE,KAAA,CAAM,EACjB,OAAO,OAAO;AAEjB,SAAO,MAAM,SAAS,IAAI,QAAQ;AACpC;AAMO,SAAS,kBAAiC;AAC/C,aAAW,YAAY,yBAAyB;AAC9C,eAAW,OAAO,yBAAyB;AACzC,YAAM,WAAW,GAAG,QAAQ,GAAG,GAAG;AAClC,UAAI;AACF,mBAAW,UAAU,UAAU,IAAI;AACnC,eAAO;AAAA,MACT,QAAQ;AAAA,MAER;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAOO,SAAS,iBAAiB,aAAoC;AAEnE,QAAM,MAAM,YAAY,SAAS,OAAO,IAAI,UAAU;AACtD,QAAM,WAAW,YAAY,QAAQ,iBAAiB,EAAE;AACxD,QAAM,eAAe,GAAG,QAAQ,YAAY,GAAG;AAE/C,MAAI;AACF,eAAW,cAAc,UAAU,IAAI;AACvC,WAAO;AAAA,EACT,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;AAKO,SAAS,yBAAyB,UAA4B;AACnE,MAAI;AACF,UAAM,UAAU,aAAa,UAAU,OAAO;AAC9C,UAAM,SAASA,MAAU,OAAO;AAEhC,QAAI,CAAC,UAAU,OAAO,WAAW,YAAY,EAAE,cAAc,SAAS;AACpE,aAAO,MAAM,yBAAyB,QAAQ,2BAA2B;AACzE,aAAO,CAAA;AAAA,IACT;AAEA,UAAM,WAAW,OAAO;AACxB,WAAO,OAAO,KAAK,QAAQ;AAAA,EAC7B,SAAS,OAAO;AACd,WAAO,MAAM,iCAAiC,QAAQ,EAAE;AACxD,WAAO,MAAM,KAAK;AAClB,WAAO,CAAA;AAAA,EACT;AACF;"}
|