@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":"event.js","sources":["../../../../src/server/formatters/md/event.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type {\n ErrorEntrySchema,\n EventSchema,\n FrameInterface,\n MessageEntrySchema,\n RequestEntrySchema,\n ThreadsEntrySchema,\n} from \"../schema.ts\";\n\nexport type Event = z.infer<typeof EventSchema>;\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [[/^(java\\.|com\\.|org\\.)/, \"java\"]];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(frame: z.infer<typeof FrameInterface>, platform?: string | null): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nfunction formatFrameHeader(frame: z.infer<typeof FrameInterface>, frameIndex?: number, platform?: string | null) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file = frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter(i => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find(e => e.type === \"message\");\n const exceptionEntry = event.entries.find(e => e.type === \"exception\");\n const threadsEntry = event.entries.find(e => e.type === \"threads\");\n const requestEntry = event.entries.find(e => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(event, messageEntry.data as z.infer<typeof MessageEntrySchema>);\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(event, exceptionEntry.data as z.infer<typeof ErrorEntrySchema>);\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(event, threadsEntry.data as z.infer<typeof ThreadsEntrySchema>);\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(event, requestEntry.data as z.infer<typeof RequestEntrySchema>);\n }\n\n output += formatTags(event.tags);\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(frame: z.infer<typeof FrameInterface>, event: Event): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(event: Event, data: z.infer<typeof ErrorEntrySchema>) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(getExceptionChainMessage(event.platform || null, index, exceptions.length));\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map(frame => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(platform: string | null, index: number, _totalExceptions: number): string {\n // Default message for unknown platforms\n const defaultMessage = \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(_event: Event, data: z.infer<typeof RequestEntrySchema>) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(_event: Event, data: z.infer<typeof MessageEntrySchema>) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(event: Event, data: z.infer<typeof ThreadsEntrySchema>) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find(t => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map(frame => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(frame: z.infer<typeof FrameInterface>, contextSize = 3): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(...frame.context.map(([lineNo]) => lineNo.toString().length));\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns markdown string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(frames: z.infer<typeof FrameInterface>[]): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatTags(tags: z.infer<typeof EventSchema>[\"tags\"]) {\n if (!tags || tags.length === 0) {\n return \"\";\n }\n return `### Tags\\n\\n${tags.map(tag => `**${tag.key}**: ${tag.value}`).join(\"\\n\")}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n"],"names":[],"mappings":"AAoBA,MAAM,sBAA8C;AAAA,EAClD,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,2BAAoD,CAAC,CAAC,yBAAyB,MAAM,CAAC;AAU5F,SAAS,eAAe,OAAuC,UAAkC;AAE/F,MAAI,MAAM,UAAU;AAClB,UAAM,MAAM,MAAM,SAAS,YAAA,EAAc,MAAM,UAAU,IAAI,CAAC;AAC9D,QAAI,OAAO,oBAAoB,GAAG,GAAG;AACnC,aAAO,oBAAoB,GAAG;AAAA,IAChC;AAAA,EACF;AAGA,MAAI,MAAM,QAAQ;AAChB,eAAW,CAAC,SAAS,QAAQ,KAAK,0BAA0B;AAC1D,UAAI,QAAQ,KAAK,MAAM,MAAM,GAAG;AAC9B,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAGA,SAAO,YAAY;AACrB;AAWA,SAAS,kBAAkB,OAAuC,YAAq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AK,EAAE,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAClF;AAEA,SAAS,eAAe,UAAmD;AACzE,MAAI,CAAC,YAAY,OAAO,KAAK,QAAQ,EAAE,WAAW,GAAG;AACnD,WAAO;AAAA,EACT;AACA,SAAO;AAAA;AAAA;AAAA;AAAA,EAAgI,OAAO;AAAA,IAC5I;AAAA,EAAA,EAEC;AAAA,IACC,CAAC,CAAC,MAAM,IAAI,MACV,KAAK,IAAI;AAAA,EAAO,OAAO,QAAQ,IAAI,EAChC,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQ,MAAM,EACnC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACrB,aAAO,GAAG,GAAG,KAAK,KAAK,UAAU,OAAO,QAAW,CAAC,CAAC;AAAA,IACvD,CAAC,EACA,KAAK,IAAI,CAAC;AAAA,EAAA,EAEhB,KAAK,MAAM,CAAC;AAAA;AAAA;AACjB;"}
|
|
1
|
+
{"version":3,"file":"event.js","sources":["../../../../src/server/formatters/md/event.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type {\n ErrorEntrySchema,\n EventSchema,\n FrameInterface,\n MessageEntrySchema,\n RequestEntrySchema,\n ThreadsEntrySchema,\n} from \"../schema.ts\";\n\nexport type Event = z.infer<typeof EventSchema>;\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [[/^(java\\.|com\\.|org\\.)/, \"java\"]];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(frame: z.infer<typeof FrameInterface>, platform?: string | null): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nfunction formatFrameHeader(frame: z.infer<typeof FrameInterface>, frameIndex?: number, platform?: string | null) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file = frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter(i => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find(e => e.type === \"message\");\n const exceptionEntry = event.entries.find(e => e.type === \"exception\");\n const threadsEntry = event.entries.find(e => e.type === \"threads\");\n const requestEntry = event.entries.find(e => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(event, messageEntry.data as z.infer<typeof MessageEntrySchema>);\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(event, exceptionEntry.data as z.infer<typeof ErrorEntrySchema>);\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(event, threadsEntry.data as z.infer<typeof ThreadsEntrySchema>);\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(event, requestEntry.data as z.infer<typeof RequestEntrySchema>);\n }\n\n output += formatTags(event.tags);\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(frame: z.infer<typeof FrameInterface>, event: Event): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(event: Event, data: z.infer<typeof ErrorEntrySchema>) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(getExceptionChainMessage(event.platform || null, index, exceptions.length));\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map(frame => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(platform: string | null, index: number, _totalExceptions: number): string {\n // Default message for unknown platforms\n const defaultMessage = \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(_event: Event, data: z.infer<typeof RequestEntrySchema>) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(_event: Event, data: z.infer<typeof MessageEntrySchema>) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(event: Event, data: z.infer<typeof ThreadsEntrySchema>) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find(t => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map(frame => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(frame: z.infer<typeof FrameInterface>, contextSize = 3): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(...frame.context.map(([lineNo]) => lineNo.toString().length));\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns markdown string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(frames: z.infer<typeof FrameInterface>[]): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatTags(tags: z.infer<typeof EventSchema>[\"tags\"]) {\n if (!tags || tags.length === 0) {\n return \"\";\n }\n return `### Tags\\n\\n${tags.map(tag => `**${tag.key}**: ${tag.value}`).join(\"\\n\")}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;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vD,CAAC,EACA,KAAK,IAAI,CAAC;AAAA,EAAA,EAEhB,KAAK,MAAM,CAAC;AAAA;AAAA;AACjB;"}
|
|
@@ -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] = "07c7f71c-5201-4f0b-ad81-eae990612a3f", e._sentryDebugIdIdentifier = "sentry-dbid-07c7f71c-5201-4f0b-ad81-eae990612a3f");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { isTraceEvent, isLogEvent, isErrorEvent } from "../../parser/helpers.js";
|
|
2
10
|
import { formatError } from "./errors.js";
|
|
3
11
|
import { formatLog } from "./logs.js";
|
|
4
12
|
import { formatTrace } from "./traces.js";
|
|
13
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
5
14
|
const formatters = {
|
|
6
15
|
event: { typeGuard: isErrorEvent, format: formatError },
|
|
7
16
|
log: { typeGuard: isLogEvent, format: formatLog },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/server/formatters/md/index.ts"],"sourcesContent":["import { isErrorEvent, isLogEvent, isTraceEvent } from \"../../parser/helpers.ts\";\nimport type { FormatterRegistry } from \"../types.ts\";\nimport { formatError } from \"./errors.ts\";\nimport { formatLog } from \"./logs.ts\";\nimport { formatTrace } from \"./traces.ts\";\n\nexport const formatters: FormatterRegistry = {\n event: { typeGuard: isErrorEvent, format: formatError },\n log: { typeGuard: isLogEvent, format: formatLog },\n transaction: { typeGuard: isTraceEvent, format: formatTrace },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/server/formatters/md/index.ts"],"sourcesContent":["import { isErrorEvent, isLogEvent, isTraceEvent } from \"../../parser/helpers.ts\";\nimport type { FormatterRegistry } from \"../types.ts\";\nimport { formatError } from \"./errors.ts\";\nimport { formatLog } from \"./logs.ts\";\nimport { formatTrace } from \"./traces.ts\";\n\nexport const formatters: FormatterRegistry = {\n event: { typeGuard: isErrorEvent, format: formatError },\n log: { typeGuard: isLogEvent, format: formatLog },\n transaction: { typeGuard: isTraceEvent, format: formatTrace },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAMO,MAAM,aAAgC;AAAA,EAC3C,OAAO,EAAE,WAAW,cAAc,QAAQ,YAAA;AAAA,EAC1C,KAAK,EAAE,WAAW,YAAY,QAAQ,UAAA;AAAA,EACtC,aAAa,EAAE,WAAW,cAAc,QAAQ,YAAA;AAClD;"}
|
|
@@ -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] = "a4a9c10c-673c-4a61-94d6-4a6109e6d754", e._sentryDebugIdIdentifier = "sentry-dbid-a4a9c10c-673c-4a61-94d6-4a6109e6d754");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { isLogEvent } from "../../parser/helpers.js";
|
|
2
10
|
import "uuidv7";
|
|
11
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
3
12
|
import { formatTimestamp } from "../utils.js";
|
|
4
13
|
function formatLogEnvelope(container) {
|
|
5
14
|
const parsedEnvelope = container.getParsedEnvelope();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sources":["../../../../src/server/formatters/md/logs.ts"],"sourcesContent":["import type { Envelope, EnvelopeItem, SerializedLog } from \"@sentry/core\";\nimport { type SentryEvent, type SentryLogEvent, isLogEvent } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\nimport { formatTimestamp } from \"../utils.ts\";\n\nexport function formatLogEnvelope(container: EventContainer) {\n const parsedEnvelope = container.getParsedEnvelope();\n\n const {\n envelope: [envelopeHeader, items],\n } = parsedEnvelope;\n\n const formatted: string[] = [];\n for (const item of items) {\n const [{ type }, payload] = item;\n\n if (type === \"log\" && isLogEvent(payload as SentryEvent)) {\n formatted.push(...formatLog(payload, envelopeHeader));\n }\n }\n\n return formatted;\n}\n\n/**\n * Format a single log entry to markdown string\n */\nfunction formatSingleLog(event: SerializedLog): string {\n let attr = \"\";\n for (const [key, property] of Object.entries(event.attributes ?? {})) {\n if (key.startsWith(\"sentry.\")) {\n continue;\n }\n\n attr += `${key}: ${property.value} (${property.type})\\n`;\n }\n\n return `${formatTimestamp(event.timestamp)} ${event.level} ${event.body}\nAttributes:\n${attr}`;\n}\n\n/**\n * Format a log event to markdown string\n */\nexport function formatLog(payload: EnvelopeItem[1], _envelopeHeader: Envelope[0]): string[] {\n const event = payload as SentryLogEvent;\n return event.items.map(formatSingleLog);\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logs.js","sources":["../../../../src/server/formatters/md/logs.ts"],"sourcesContent":["import type { Envelope, EnvelopeItem, SerializedLog } from \"@sentry/core\";\nimport { type SentryEvent, type SentryLogEvent, isLogEvent } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\nimport { formatTimestamp } from \"../utils.ts\";\n\nexport function formatLogEnvelope(container: EventContainer) {\n const parsedEnvelope = container.getParsedEnvelope();\n\n const {\n envelope: [envelopeHeader, items],\n } = parsedEnvelope;\n\n const formatted: string[] = [];\n for (const item of items) {\n const [{ type }, payload] = item;\n\n if (type === \"log\" && isLogEvent(payload as SentryEvent)) {\n formatted.push(...formatLog(payload, envelopeHeader));\n }\n }\n\n return formatted;\n}\n\n/**\n * Format a single log entry to markdown string\n */\nfunction formatSingleLog(event: SerializedLog): string {\n let attr = \"\";\n for (const [key, property] of Object.entries(event.attributes ?? {})) {\n if (key.startsWith(\"sentry.\")) {\n continue;\n }\n\n attr += `${key}: ${property.value} (${property.type})\\n`;\n }\n\n return `${formatTimestamp(event.timestamp)} ${event.level} ${event.body}\nAttributes:\n${attr}`;\n}\n\n/**\n * Format a log event to markdown string\n */\nexport function formatLog(payload: EnvelopeItem[1], _envelopeHeader: Envelope[0]): string[] {\n const event = payload as SentryLogEvent;\n return event.items.map(formatSingleLog);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAKO,SAAS,kBAAkB,WAA2B;AAC3D,QAAM,iBAAiB,UAAU,kBAAA;AAEjC,QAAM;AAAA,IACJ,UAAU,CAAC,gBAAgB,KAAK;AAAA,EAAA,IAC9B;AAEJ,QAAM,YAAsB,CAAA;AAC5B,aAAW,QAAQ,OAAO;AACxB,UAAM,CAAC,EAAE,QAAQ,OAAO,IAAI;AAE5B,QAAI,SAAS,SAAS,WAAW,OAAsB,GAAG;AACxD,gBAAU,KAAK,GAAG,UAAU,OAAuB,CAAC;AAAA,IACtD;AAAA,EACF;AAEA,SAAO;AACT;AAKA,SAAS,gBAAgB,OAA8B;AACrD,MAAI,OAAO;AACX,aAAW,CAAC,KAAK,QAAQ,KAAK,OAAO,QAAQ,MAAM,cAAc,CAAA,CAAE,GAAG;AACpE,QAAI,IAAI,WAAW,SAAS,GAAG;AAC7B;AAAA,IACF;AAEA,YAAQ,GAAG,GAAG,KAAK,SAAS,KAAK,KAAK,SAAS,IAAI;AAAA;AAAA,EACrD;AAEA,SAAO,GAAG,gBAAgB,MAAM,SAAS,CAAC,IAAI,MAAM,KAAK,IAAI,MAAM,IAAI;AAAA;AAAA,EAEvE,IAAI;AACN;AAKO,SAAS,UAAU,SAA0B,iBAAwC;AAC1F,QAAM,QAAQ;AACd,SAAO,MAAM,MAAM,IAAI,eAAe;AACxC;"}
|
|
@@ -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] = "835b0cc8-38ea-43fb-9fb0-d5a5d778a8ed", e._sentryDebugIdIdentifier = "sentry-dbid-835b0cc8-38ea-43fb-9fb0-d5a5d778a8ed");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { captureException } from "@sentry/node";
|
|
2
10
|
import "../../parser/helpers.js";
|
|
3
11
|
import { processEnvelope } from "../../parser/processEnvelope.js";
|
|
12
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
4
13
|
import { formatTimestamp, getDuration } from "../utils.js";
|
|
5
14
|
function extractTracesFromEnvelopes(containers) {
|
|
6
15
|
const traces = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traces.js","sources":["../../../../src/server/formatters/md/traces.ts"],"sourcesContent":["import type { Envelope, EnvelopeItem } from \"@sentry/core\";\nimport { captureException } from \"@sentry/node\";\nimport { type SentryTransactionEvent, processEnvelope } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\nimport { formatTimestamp, getDuration } from \"../utils.ts\";\n\nexport interface TraceContext {\n trace_id: string;\n span_id: string;\n parent_span_id?: string;\n}\n\nexport interface SpanData {\n span_id: string;\n parent_span_id?: string;\n trace_id: string;\n op?: string;\n description?: string;\n start_timestamp?: number;\n timestamp?: number;\n duration?: number;\n status?: string;\n data?: Record<string, unknown>;\n}\n\nexport interface TraceEvent {\n event_id: string;\n type: string;\n timestamp?: number;\n start_timestamp?: number;\n transaction?: string;\n trace_context?: TraceContext;\n spans?: SpanData[];\n level?: string;\n platform?: string;\n message?: string;\n exception?: {\n values?: Array<{\n type?: string;\n value?: string;\n }>;\n };\n}\n\nexport interface TraceSummary {\n trace_id: string;\n root_transaction?: string;\n start_timestamp?: number;\n duration?: number;\n span_count: number;\n error_count: number;\n events: TraceEvent[];\n}\n\n/**\n * Extract trace events from envelopes and group by trace ID\n */\nexport function extractTracesFromEnvelopes(containers: EventContainer[]): Map<string, TraceSummary> {\n const traces = new Map<string, TraceSummary>();\n\n for (const container of containers) {\n try {\n const events = extractTraceEventsFromContainer(container);\n\n for (const event of events) {\n if (!event.trace_context?.trace_id) continue;\n\n const traceId = event.trace_context.trace_id;\n\n if (!traces.has(traceId)) {\n traces.set(traceId, {\n trace_id: traceId,\n span_count: 0,\n error_count: 0,\n events: [],\n });\n }\n\n const trace = traces.get(traceId)!;\n trace.events.push(event);\n\n // Update trace statistics\n if (event.type === \"error\") {\n trace.error_count++;\n }\n\n if (event.spans) {\n trace.span_count += event.spans.length;\n }\n\n // Set root transaction and timing info\n if (event.transaction && !trace.root_transaction) {\n trace.root_transaction = event.transaction;\n }\n\n // Use start_timestamp if available (for transactions), otherwise fall back to timestamp\n const eventStartTime = event.start_timestamp || event.timestamp;\n if (eventStartTime) {\n if (!trace.start_timestamp || eventStartTime < trace.start_timestamp) {\n trace.start_timestamp = eventStartTime;\n }\n }\n }\n } catch (err) {\n captureException(err, { extra: { context: \"Error extracting trace events\" } });\n }\n }\n\n // Calculate durations and finalize traces\n for (const trace of traces.values()) {\n calculateTraceDuration(trace);\n }\n\n return traces;\n}\n\n/**\n * Extract trace-related events from a single envelope container\n */\nfunction extractTraceEventsFromContainer(container: EventContainer): TraceEvent[] {\n const events: TraceEvent[] = [];\n\n try {\n const parsed = processEnvelope({\n contentType: container.getContentType(),\n data: container.getData(),\n });\n\n const [, items] = parsed!.envelope;\n\n for (const item of items) {\n const [{ type }, payload] = item;\n\n if (type === \"event\" && payload && typeof payload === \"object\") {\n const event = payload as any;\n\n // Only include events that have trace context\n if (event.contexts?.trace?.trace_id) {\n // Determine event type - error events have exception or level === \"error\"\n let eventType = \"unknown\";\n if (event.exception || event.level === \"error\") {\n eventType = \"error\";\n } else if (event.type) {\n eventType = event.type;\n }\n\n events.push({\n event_id: event.event_id || \"\",\n type: eventType,\n timestamp: event.timestamp,\n start_timestamp: event.start_timestamp,\n transaction: event.transaction,\n trace_context: event.contexts.trace,\n spans: event.spans,\n level: event.level,\n platform: event.platform,\n message: event.message,\n exception: event.exception,\n });\n }\n }\n\n // Handle transaction items\n if (type === \"transaction\" && payload && typeof payload === \"object\") {\n const transaction = payload as any;\n\n if (transaction.contexts?.trace?.trace_id) {\n events.push(convertPayloadToTraceEvent(transaction));\n }\n }\n }\n } catch (err) {\n captureException(err, { extra: { context: \"Error parsing envelope for traces\" } });\n }\n\n return events;\n}\n\n/**\n * Calculate trace duration from start to latest event\n */\nfunction calculateTraceDuration(trace: TraceSummary): void {\n if (!trace.start_timestamp) return;\n\n let latestTimestamp = trace.start_timestamp;\n\n for (const event of trace.events) {\n if (event.timestamp && event.timestamp > latestTimestamp) {\n latestTimestamp = event.timestamp;\n }\n\n // Also check span end times\n if (event.spans) {\n for (const span of event.spans) {\n if (span.timestamp && span.timestamp > latestTimestamp) {\n latestTimestamp = span.timestamp;\n }\n }\n }\n }\n\n trace.duration = getDuration(latestTimestamp, trace.start_timestamp);\n}\n\n/**\n * Build a hierarchical span tree from trace events\n */\nexport interface SpanNode {\n span_id: string;\n parent_span_id?: string;\n op?: string;\n description?: string;\n duration?: number;\n status?: string;\n is_transaction?: boolean;\n children: SpanNode[];\n level: number;\n event_id?: string;\n}\n\nexport function buildSpanTree(trace: TraceSummary): SpanNode[] {\n const allSpans: SpanNode[] = [];\n const spanMap = new Map<string, SpanNode>();\n\n // Collect all spans from all events in the trace\n for (const event of trace.events) {\n // Add the transaction/event itself as a span node\n if (event.trace_context) {\n const eventSpan: SpanNode = {\n span_id: event.trace_context.span_id,\n parent_span_id: event.trace_context.parent_span_id,\n op: event.type === \"transaction\" ? \"transaction\" : event.type,\n description: event.transaction || event.message || \"unnamed\",\n is_transaction: event.type === \"transaction\" || !!event.transaction,\n children: [],\n level: 0,\n event_id: event.event_id,\n duration: getDuration(event.timestamp, event.start_timestamp),\n };\n\n allSpans.push(eventSpan);\n spanMap.set(eventSpan.span_id, eventSpan);\n }\n\n // Add individual spans from the event - but only if they're not duplicates\n if (event.spans && Array.isArray(event.spans)) {\n for (const span of event.spans) {\n // Skip if we already have this span\n if (spanMap.has(span.span_id)) continue;\n\n const spanNode: SpanNode = {\n span_id: span.span_id,\n parent_span_id: span.parent_span_id || event.trace_context?.span_id, // Default to event's span as parent\n op: span.op,\n description: span.description || \"unnamed\",\n duration: span.duration !== undefined ? span.duration : getDuration(span.timestamp, span.start_timestamp),\n status: span.status,\n children: [],\n level: 0,\n };\n\n allSpans.push(spanNode);\n spanMap.set(spanNode.span_id, spanNode);\n }\n }\n }\n\n // Build parent-child relationships\n const rootSpans: SpanNode[] = [];\n const orphanedByParentId = new Map<string, SpanNode[]>();\n\n // First pass: identify roots and orphans\n for (const span of allSpans) {\n if (!span.parent_span_id) {\n // No parent ID - it's a root\n rootSpans.push(span);\n } else if (spanMap.has(span.parent_span_id)) {\n // Parent exists - attach as child\n const parent = spanMap.get(span.parent_span_id)!;\n parent.children.push(span);\n span.level = parent.level + 1;\n } else {\n // Parent doesn't exist - it's an orphan\n // Group orphans by their missing parent ID\n if (!orphanedByParentId.has(span.parent_span_id)) {\n orphanedByParentId.set(span.parent_span_id, []);\n }\n orphanedByParentId.get(span.parent_span_id)!.push(span);\n }\n }\n\n // Helper function to recursively update levels\n function updateLevels(node: SpanNode, newLevel: number) {\n node.level = newLevel;\n for (const child of node.children) {\n updateLevels(child, newLevel + 1);\n }\n }\n\n // Create orphan parent spans for grouped orphans (like the UI does)\n for (const [parentId, orphans] of orphanedByParentId) {\n const orphanParent: SpanNode = {\n span_id: parentId,\n op: \"orphan\",\n description: \"missing or unknown parent span\",\n children: orphans,\n level: 0,\n is_transaction: false,\n };\n\n // Try to find a root to attach this orphan parent to\n const parentRoot = rootSpans.length === 1 ? rootSpans[0] : null;\n if (parentRoot) {\n parentRoot.children.push(orphanParent);\n // Update levels recursively relative to parent\n updateLevels(orphanParent, parentRoot.level + 1);\n } else {\n // No single root - add as a root itself\n rootSpans.push(orphanParent);\n // Update levels recursively for all children\n updateLevels(orphanParent, 0);\n }\n }\n\n // Sort children by start timestamp (like the UI) or duration\n for (const span of allSpans) {\n span.children.sort((a, b) => {\n // Sort by duration if available, otherwise by description\n if (a.duration !== undefined && b.duration !== undefined) {\n return b.duration - a.duration;\n }\n return 0;\n });\n }\n\n // If we have multiple roots, create a synthetic trace root\n if (rootSpans.length > 1) {\n const syntheticRoot: SpanNode = {\n span_id: trace.trace_id.substring(0, 16),\n description: `Trace ${trace.trace_id.substring(0, 8)}`,\n op: \"trace\",\n is_transaction: false,\n children: rootSpans.sort((a, b) => (b.duration || 0) - (a.duration || 0)),\n level: 0,\n duration: trace.duration,\n };\n // Update all root spans to be level 1 under synthetic root\n for (const root of rootSpans) {\n updateLevels(root, 1);\n }\n return [syntheticRoot];\n }\n\n return rootSpans;\n}\n\n/**\n * Format a transaction payload for CLI output\n */\nexport function formatTransactionEvent(event: SentryTransactionEvent): string[] {\n const traceEvent = convertPayloadToTraceEvent(event);\n return processTraceEvent(traceEvent);\n}\n\n/**\n * Format a trace/transaction event to markdown string\n */\nexport function formatTrace(payload: EnvelopeItem[1], _envelopeHeader: Envelope[0]): string[] {\n const event = payload as SentryTransactionEvent;\n return formatTransactionEvent(event);\n}\n\n/**\n * Convert a transaction payload to TraceEvent\n */\nfunction convertPayloadToTraceEvent(payload: any): TraceEvent {\n return {\n event_id: payload.event_id || \"\",\n type: \"transaction\",\n timestamp: payload.timestamp,\n start_timestamp: payload.start_timestamp,\n transaction: payload.transaction,\n trace_context: payload.contexts.trace,\n spans: payload.spans,\n level: payload.level,\n platform: payload.platform,\n };\n}\n\n/**\n * Process a single trace event for CLI output\n */\nexport function processTraceEvent(event: TraceEvent): string[] {\n if (!event.trace_context?.trace_id) {\n return [\"No trace context available\"];\n }\n\n const trace: TraceSummary = {\n trace_id: event.trace_context.trace_id,\n root_transaction: event.transaction,\n start_timestamp: event.start_timestamp || event.timestamp,\n span_count: event.spans?.length || 0,\n error_count: 0,\n events: [event],\n };\n\n calculateTraceDuration(trace);\n\n const spanTree = buildSpanTree(trace);\n const lines = renderSpanTree(spanTree);\n\n return lines;\n}\n\n/**\n * Format trace summary for display\n */\nexport function formatTraceSummary(trace: TraceSummary): string {\n const duration = trace.duration ? `${Math.round(trace.duration)}ms` : \"unknown\";\n const transaction = trace.root_transaction || \"unnamed\";\n const timestamp = formatTimestamp(trace.start_timestamp);\n\n return `**${trace.trace_id.substring(0, 8)}** | ${transaction} | ${duration} | ${trace.span_count} spans | ${trace.error_count} errors | ${timestamp}`;\n}\n\n/**\n * Render span tree as hierarchical text\n */\nexport function renderSpanTree(spans: SpanNode[]): string[] {\n const lines: string[] = [];\n\n function formatSpanDisplayName(span: SpanNode): string {\n // For transaction spans, use the transaction name\n if (span.is_transaction) {\n return span.description || \"unnamed transaction\";\n }\n\n // For regular spans, use description or fallback to operation\n return span.description || span.op || \"unnamed\";\n }\n\n function renderSpan(span: SpanNode, prefix = \"\", isLast = true): void {\n const shortId = span.span_id.substring(0, 8);\n const connector = prefix === \"\" ? \"\" : isLast ? \"└─ \" : \"├─ \";\n const displayName = formatSpanDisplayName(span);\n\n // Format similar to sentry-mcp\n if (span.is_transaction) {\n // For transactions, show without operation since it's redundant\n const duration = span.duration ? `${Math.round(span.duration)}ms` : \"unknown\";\n lines.push(`${prefix}${connector}${displayName} [${shortId} · ${duration}]`);\n } else {\n const duration = span.duration ? `${Math.round(span.duration)}ms` : \"unknown\";\n\n // Don't show 'default' or 'unknown' operations as they're not meaningful\n const opDisplay =\n span.op && span.op !== \"default\" && span.op !== \"unknown\" && span.op !== \"transaction\" ? ` · ${span.op}` : \"\";\n lines.push(`${prefix}${connector}${displayName} [${shortId}${opDisplay} · ${duration}]`);\n }\n\n // Render all children with proper tree indentation\n for (let i = 0; i < span.children.length; i++) {\n const child = span.children[i];\n const isLastChild = i === span.children.length - 1;\n const childPrefix = prefix + (isLast ? \" \" : \"│ \");\n renderSpan(child, childPrefix, isLastChild);\n }\n }\n\n // Render all root spans\n for (let i = 0; i < spans.length; i++) {\n const span = spans[i];\n const isLastRoot = i === spans.length - 1;\n renderSpan(span, \"\", isLastRoot);\n }\n\n return lines;\n}\n"],"names":[],"mappings":";;;;AAyDO,SAAS,2BAA2B,YAAyD;AAClG,QAAM,6BAAa,IAAA;AAEnB,aAAW,aAAa,YAAY;AAClC,QAAI;AACF,YAAM,SAAS,gCAAgC,SAAS;AAExD,iBAAW,SAAS,QAAQ;AAC1B,YAAI,CAAC,MAAM,eAAe,SAAU;AAEpC,cAAM,UAAU,MAAM,cAAc;AAEpC,YAAI,CAAC,OAAO,IAAI,OAAO,GAAG;AACxB,iBAAO,IAAI,SAAS;AAAA,YAClB,UAAU;AAAA,YACV,YAAY;AAAA,YACZ,aAAa;AAAA,YACb,QAAQ,CAAA;AAAA,UAAC,CACV;AAAA,QACH;AAEA,cAAM,QAAQ,OAAO,IAAI,OAAO;AAChC,cAAM,OAAO,KAAK,KAAK;AAGvB,YAAI,MAAM,SAAS,SAAS;AAC1B,gBAAM;AAAA,QACR;AAEA,YAAI,MAAM,OAAO;AACf,gBAAM,cAAc,MAAM,MAAM;AAAA,QAClC;AAGA,YAAI,MAAM,eAAe,CAAC,MAAM,kBAAkB;AAChD,gBAAM,mBAAmB,MAAM;AAAA,QACjC;AAGA,cAAM,iBAAiB,MAAM,mBAAmB,MAAM;AACtD,YAAI,gBAAgB;AAClB,cAAI,CAAC,MAAM,mBAAmB,iBAAiB,MAAM,iBAAiB;AACpE,kBAAM,kBAAkB;AAAA,UAC1B;AAAA,QACF;AAAA,MACF;AAAA,IACF,SAAS,KAAK;AACZ,uBAAiB,KAAK,EAAE,OAAO,EAAE,SAAS,gCAAA,GAAmC;AAA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AG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,OAAO,MAAM,QAAQ,GAAG;AAAA,IAC7E,OAAO;AACL,YAAM,WAAW,KAAK,WAAW,GAAG,KAAK,MAAM,KAAK,QAAQ,CAAC,OAAO;AAGpE,YAAM,YACJ,KAAK,MAAM,KAAK,OAAO,aAAa,KAAK,OAAO,aAAa,KAAK,OAAO,gBAAgB,MAAM,KAAK,EAAE,KAAK;AAC7G,YAAM,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,OAAO,GAAG,SAAS,MAAM,QAAQ,GAAG;AAAA,IACzF;AAGA,aAAS,IAAI,GAAG,IAAI,KAAK,SAAS,QAAQ,KAAK;AAC7C,YAAM,QAAQ,KAAK,SAAS,CAAC;AAC7B,YAAM,cAAc,MAAM,KAAK,SAAS,SAAS;AACjD,YAAM,cAAc,UAAU,SAAS,QAAQ;AAC/C,iBAAW,OAAO,aAAa,WAAW;AAAA,IAC5C;AAAA,EACF;AAGA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC;AACpB,UAAM,aAAa,MAAM,MAAM,SAAS;AACxC,eAAW,MAAM,IAAI,UAAU;AAAA,EACjC;AAEA,SAAO;AACT;"}
|
|
1
|
+
{"version":3,"file":"traces.js","sources":["../../../../src/server/formatters/md/traces.ts"],"sourcesContent":["import type { Envelope, EnvelopeItem } from \"@sentry/core\";\nimport { captureException } from \"@sentry/node\";\nimport { type SentryTransactionEvent, processEnvelope } from \"../../parser/index.ts\";\nimport type { EventContainer } from \"../../utils/index.ts\";\nimport { formatTimestamp, getDuration } from \"../utils.ts\";\n\nexport interface TraceContext {\n trace_id: string;\n span_id: string;\n parent_span_id?: string;\n}\n\nexport interface SpanData {\n span_id: string;\n parent_span_id?: string;\n trace_id: string;\n op?: string;\n description?: string;\n start_timestamp?: number;\n timestamp?: number;\n duration?: number;\n status?: string;\n data?: Record<string, unknown>;\n}\n\nexport interface TraceEvent {\n event_id: string;\n type: string;\n timestamp?: number;\n start_timestamp?: number;\n transaction?: string;\n trace_context?: TraceContext;\n spans?: SpanData[];\n level?: string;\n platform?: string;\n message?: string;\n exception?: {\n values?: Array<{\n type?: string;\n value?: string;\n }>;\n };\n}\n\nexport interface TraceSummary {\n trace_id: string;\n root_transaction?: string;\n start_timestamp?: number;\n duration?: number;\n span_count: number;\n error_count: number;\n events: TraceEvent[];\n}\n\n/**\n * Extract trace events from envelopes and group by trace ID\n */\nexport function extractTracesFromEnvelopes(containers: EventContainer[]): Map<string, TraceSummary> {\n const traces = new Map<string, TraceSummary>();\n\n for (const container of containers) {\n try {\n const events = extractTraceEventsFromContainer(container);\n\n for (const event of events) {\n if (!event.trace_context?.trace_id) continue;\n\n const traceId = event.trace_context.trace_id;\n\n if (!traces.has(traceId)) {\n traces.set(traceId, {\n trace_id: traceId,\n span_count: 0,\n error_count: 0,\n events: [],\n });\n }\n\n const trace = traces.get(traceId)!;\n trace.events.push(event);\n\n // Update trace statistics\n if (event.type === \"error\") {\n trace.error_count++;\n }\n\n if (event.spans) {\n trace.span_count += event.spans.length;\n }\n\n // Set root transaction and timing info\n if (event.transaction && !trace.root_transaction) {\n trace.root_transaction = event.transaction;\n }\n\n // Use start_timestamp if available (for transactions), otherwise fall back to timestamp\n const eventStartTime = event.start_timestamp || event.timestamp;\n if (eventStartTime) {\n if (!trace.start_timestamp || eventStartTime < trace.start_timestamp) {\n trace.start_timestamp = eventStartTime;\n }\n }\n }\n } catch (err) {\n captureException(err, { extra: { context: \"Error extracting trace events\" } });\n }\n }\n\n // Calculate durations and finalize traces\n for (const trace of traces.values()) {\n calculateTraceDuration(trace);\n }\n\n return traces;\n}\n\n/**\n * Extract trace-related events from a single envelope container\n */\nfunction extractTraceEventsFromContainer(container: EventContainer): TraceEvent[] {\n const events: TraceEvent[] = [];\n\n try {\n const parsed = processEnvelope({\n contentType: container.getContentType(),\n data: container.getData(),\n });\n\n const [, items] = parsed!.envelope;\n\n for (const item of items) {\n const [{ type }, payload] = item;\n\n if (type === \"event\" && payload && typeof payload === \"object\") {\n const event = payload as any;\n\n // Only include events that have trace context\n if (event.contexts?.trace?.trace_id) {\n // Determine event type - error events have exception or level === \"error\"\n let eventType = \"unknown\";\n if (event.exception || event.level === \"error\") {\n eventType = \"error\";\n } else if (event.type) {\n eventType = event.type;\n }\n\n events.push({\n event_id: event.event_id || \"\",\n type: eventType,\n timestamp: event.timestamp,\n start_timestamp: event.start_timestamp,\n transaction: event.transaction,\n trace_context: event.contexts.trace,\n spans: event.spans,\n level: event.level,\n platform: event.platform,\n message: event.message,\n exception: event.exception,\n });\n }\n }\n\n // Handle transaction items\n if (type === \"transaction\" && payload && typeof payload === \"object\") {\n const transaction = payload as any;\n\n if (transaction.contexts?.trace?.trace_id) {\n events.push(convertPayloadToTraceEvent(transaction));\n }\n }\n }\n } catch (err) {\n captureException(err, { extra: { context: \"Error parsing envelope for traces\" } });\n }\n\n return events;\n}\n\n/**\n * Calculate trace duration from start to latest event\n */\nfunction calculateTraceDuration(trace: TraceSummary): void {\n if (!trace.start_timestamp) return;\n\n let latestTimestamp = trace.start_timestamp;\n\n for (const event of trace.events) {\n if (event.timestamp && event.timestamp > latestTimestamp) {\n latestTimestamp = event.timestamp;\n }\n\n // Also check span end times\n if (event.spans) {\n for (const span of event.spans) {\n if (span.timestamp && span.timestamp > latestTimestamp) {\n latestTimestamp = span.timestamp;\n }\n }\n }\n }\n\n trace.duration = getDuration(latestTimestamp, trace.start_timestamp);\n}\n\n/**\n * Build a hierarchical span tree from trace events\n */\nexport interface SpanNode {\n span_id: string;\n parent_span_id?: string;\n op?: string;\n description?: string;\n duration?: number;\n status?: string;\n is_transaction?: boolean;\n children: SpanNode[];\n level: number;\n event_id?: string;\n}\n\nexport function buildSpanTree(trace: TraceSummary): SpanNode[] {\n const allSpans: SpanNode[] = [];\n const spanMap = new Map<string, SpanNode>();\n\n // Collect all spans from all events in the trace\n for (const event of trace.events) {\n // Add the transaction/event itself as a span node\n if (event.trace_context) {\n const eventSpan: SpanNode = {\n span_id: event.trace_context.span_id,\n parent_span_id: event.trace_context.parent_span_id,\n op: event.type === \"transaction\" ? \"transaction\" : event.type,\n description: event.transaction || event.message || \"unnamed\",\n is_transaction: event.type === \"transaction\" || !!event.transaction,\n children: [],\n level: 0,\n event_id: event.event_id,\n duration: getDuration(event.timestamp, event.start_timestamp),\n };\n\n allSpans.push(eventSpan);\n spanMap.set(eventSpan.span_id, eventSpan);\n }\n\n // Add individual spans from the event - but only if they're not duplicates\n if (event.spans && Array.isArray(event.spans)) {\n for (const span of event.spans) {\n // Skip if we already have this span\n if (spanMap.has(span.span_id)) continue;\n\n const spanNode: SpanNode = {\n span_id: span.span_id,\n parent_span_id: span.parent_span_id || event.trace_context?.span_id, // Default to event's span as parent\n op: span.op,\n description: span.description || \"unnamed\",\n duration: span.duration !== undefined ? span.duration : getDuration(span.timestamp, span.start_timestamp),\n status: span.status,\n children: [],\n level: 0,\n };\n\n allSpans.push(spanNode);\n spanMap.set(spanNode.span_id, spanNode);\n }\n }\n }\n\n // Build parent-child relationships\n const rootSpans: SpanNode[] = [];\n const orphanedByParentId = new Map<string, SpanNode[]>();\n\n // First pass: identify roots and orphans\n for (const span of allSpans) {\n if (!span.parent_span_id) {\n // No parent ID - it's a root\n rootSpans.push(span);\n } else if (spanMap.has(span.parent_span_id)) {\n // Parent exists - attach as child\n const parent = spanMap.get(span.parent_span_id)!;\n parent.children.push(span);\n span.level = parent.level + 1;\n } else {\n // Parent doesn't exist - it's an orphan\n // Group orphans by their missing parent ID\n if (!orphanedByParentId.has(span.parent_span_id)) {\n orphanedByParentId.set(span.parent_span_id, []);\n }\n orphanedByParentId.get(span.parent_span_id)!.push(span);\n }\n }\n\n // Helper function to recursively update levels\n function updateLevels(node: SpanNode, newLevel: number) {\n node.level = newLevel;\n for (const child of node.children) {\n updateLevels(child, newLevel + 1);\n }\n }\n\n // Create orphan parent spans for grouped orphans (like the UI does)\n for (const [parentId, orphans] of orphanedByParentId) {\n const orphanParent: SpanNode = {\n span_id: parentId,\n op: \"orphan\",\n description: \"missing or unknown parent span\",\n children: orphans,\n level: 0,\n is_transaction: false,\n };\n\n // Try to find a root to attach this orphan parent to\n const parentRoot = rootSpans.length === 1 ? rootSpans[0] : null;\n if (parentRoot) {\n parentRoot.children.push(orphanParent);\n // Update levels recursively relative to parent\n updateLevels(orphanParent, parentRoot.level + 1);\n } else {\n // No single root - add as a root itself\n rootSpans.push(orphanParent);\n // Update levels recursively for all children\n updateLevels(orphanParent, 0);\n }\n }\n\n // Sort children by start timestamp (like the UI) or duration\n for (const span of allSpans) {\n span.children.sort((a, b) => {\n // Sort by duration if available, otherwise by description\n if (a.duration !== undefined && b.duration !== undefined) {\n return b.duration - a.duration;\n }\n return 0;\n });\n }\n\n // If we have multiple roots, create a synthetic trace root\n if (rootSpans.length > 1) {\n const syntheticRoot: SpanNode = {\n span_id: trace.trace_id.substring(0, 16),\n description: `Trace ${trace.trace_id.substring(0, 8)}`,\n op: \"trace\",\n is_transaction: false,\n children: rootSpans.sort((a, b) => (b.duration || 0) - (a.duration || 0)),\n level: 0,\n duration: trace.duration,\n };\n // Update all root spans to be level 1 under synthetic root\n for (const root of rootSpans) {\n updateLevels(root, 1);\n }\n return [syntheticRoot];\n }\n\n return rootSpans;\n}\n\n/**\n * Format a transaction payload for CLI output\n */\nexport function formatTransactionEvent(event: SentryTransactionEvent): string[] {\n const traceEvent = convertPayloadToTraceEvent(event);\n return processTraceEvent(traceEvent);\n}\n\n/**\n * Format a trace/transaction event to markdown string\n */\nexport function formatTrace(payload: EnvelopeItem[1], _envelopeHeader: Envelope[0]): string[] {\n const event = payload as SentryTransactionEvent;\n return formatTransactionEvent(event);\n}\n\n/**\n * Convert a transaction payload to TraceEvent\n */\nfunction convertPayloadToTraceEvent(payload: any): TraceEvent {\n return {\n event_id: payload.event_id || \"\",\n type: \"transaction\",\n timestamp: payload.timestamp,\n start_timestamp: payload.start_timestamp,\n transaction: payload.transaction,\n trace_context: payload.contexts.trace,\n spans: payload.spans,\n level: payload.level,\n platform: payload.platform,\n };\n}\n\n/**\n * Process a single trace event for CLI output\n */\nexport function processTraceEvent(event: TraceEvent): string[] {\n if (!event.trace_context?.trace_id) {\n return [\"No trace context available\"];\n }\n\n const trace: TraceSummary = {\n trace_id: event.trace_context.trace_id,\n root_transaction: event.transaction,\n start_timestamp: event.start_timestamp || event.timestamp,\n span_count: event.spans?.length || 0,\n error_count: 0,\n events: [event],\n };\n\n calculateTraceDuration(trace);\n\n const spanTree = buildSpanTree(trace);\n const lines = renderSpanTree(spanTree);\n\n return lines;\n}\n\n/**\n * Format trace summary for display\n */\nexport function formatTraceSummary(trace: TraceSummary): string {\n const duration = trace.duration ? `${Math.round(trace.duration)}ms` : \"unknown\";\n const transaction = trace.root_transaction || \"unnamed\";\n const timestamp = formatTimestamp(trace.start_timestamp);\n\n return `**${trace.trace_id.substring(0, 8)}** | ${transaction} | ${duration} | ${trace.span_count} spans | ${trace.error_count} errors | ${timestamp}`;\n}\n\n/**\n * Render span tree as hierarchical text\n */\nexport function renderSpanTree(spans: SpanNode[]): string[] {\n const lines: string[] = [];\n\n function formatSpanDisplayName(span: SpanNode): string {\n // For transaction spans, use the transaction name\n if (span.is_transaction) {\n return span.description || \"unnamed transaction\";\n }\n\n // For regular spans, use description or fallback to operation\n return span.description || span.op || \"unnamed\";\n }\n\n function renderSpan(span: SpanNode, prefix = \"\", isLast = true): void {\n const shortId = span.span_id.substring(0, 8);\n const connector = prefix === \"\" ? \"\" : isLast ? \"└─ \" : \"├─ \";\n const displayName = formatSpanDisplayName(span);\n\n // Format similar to sentry-mcp\n if (span.is_transaction) {\n // For transactions, show without operation since it's redundant\n const duration = span.duration ? `${Math.round(span.duration)}ms` : \"unknown\";\n lines.push(`${prefix}${connector}${displayName} [${shortId} · ${duration}]`);\n } else {\n const duration = span.duration ? `${Math.round(span.duration)}ms` : \"unknown\";\n\n // Don't show 'default' or 'unknown' operations as they're not meaningful\n const opDisplay =\n span.op && span.op !== \"default\" && span.op !== \"unknown\" && span.op !== \"transaction\" ? ` · ${span.op}` : \"\";\n lines.push(`${prefix}${connector}${displayName} [${shortId}${opDisplay} · ${duration}]`);\n }\n\n // Render all children with proper tree indentation\n for (let i = 0; i < span.children.length; i++) {\n const child = span.children[i];\n const isLastChild = i === span.children.length - 1;\n const childPrefix = prefix + (isLast ? \" \" : \"│ \");\n renderSpan(child, childPrefix, isLastChild);\n }\n }\n\n // Render all root spans\n for (let i = 0; i < spans.length; i++) {\n const span = spans[i];\n const isLastRoot = i === spans.length - 1;\n renderSpan(span, \"\", isLastRoot);\n }\n\n return lines;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyDO,SAAS,2BAA2B,YAAyD;AAClG,QAAM,6BAAa,IAAA;AAEnB,aAAW,aAAa,YAAY;AAClC,QAAI;AACF,YAAM,SAAS,gCAAgC,SAAS;AAExD,iBAAW,SAAS,QAAQ;AAC1B,YAAI,CAAC,MAAM,eAAe,SAAU;AAEpC,cAAM,UAAU,MAAM,cAAc;AAEpC,YAAI,CAAC,OAAO,IAAI,OAAO,GAAG;AACxB,iBAAO,IAAI,SAAS;AAAA,YAClB,UAAU;AAAA,YACV,YAAY;AAAA,YACZ,aAAa;AAAA,YACb,QAAQ,CAAA;AAAA,UAAC,CACV;AAAA,QACH;AAEA,cAAM,QAAQ,OAAO,IAAI,OAAO;AAChC,cAAM,OAAO,KAAK,KAAK;AAGvB,YAAI,MAAM,SAAS,SAAS;AAC1B,gBAAM;AAAA,QACR;AAEA,YAAI,MAAM,OAAO;AACf,gBAAM,cAAc,MAAM,MAAM;AAAA,QAClC;AAGA,YAAI,MAAM,eAAe,CAAC,MAAM,kBAAkB;AAChD,gBAAM,mBAAmB,MAAM;AAAA,QACjC;AAGA,cAAM,iBAAiB,MAAM,mBAAmB,MAAM;AACtD,YAAI,gBAAgB;AAClB,cAAI,CAAC,MAAM,mBAAmB,iBAAiB,MAAM,iBAAiB;AACpE,kBAAM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,IAAI;AAG9C,QAAI,KAAK,gBAAgB;AAEvB,YAAM,WAAW,KAAK,WAAW,GAAG,KAAK,MAAM,KAAK,QAAQ,CAAC,OAAO;AACpE,YAAM,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,OAAO,MAAM,QAAQ,GAAG;AAAA,IAC7E,OAAO;AACL,YAAM,WAAW,KAAK,WAAW,GAAG,KAAK,MAAM,KAAK,QAAQ,CAAC,OAAO;AAGpE,YAAM,YACJ,KAAK,MAAM,KAAK,OAAO,aAAa,KAAK,OAAO,aAAa,KAAK,OAAO,gBAAgB,MAAM,KAAK,EAAE,KAAK;AAC7G,YAAM,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,KAAK,OAAO,GAAG,SAAS,MAAM,QAAQ,GAAG;AAAA,IACzF;AAGA,aAAS,IAAI,GAAG,IAAI,KAAK,SAAS,QAAQ,KAAK;AAC7C,YAAM,QAAQ,KAAK,SAAS,CAAC;AAC7B,YAAM,cAAc,MAAM,KAAK,SAAS,SAAS;AACjD,YAAM,cAAc,UAAU,SAAS,QAAQ;AAC/C,iBAAW,OAAO,aAAa,WAAW;AAAA,IAC5C;AAAA,EACF;AAGA,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC;AACpB,UAAM,aAAa,MAAM,MAAM,SAAS;AACxC,eAAW,MAAM,IAAI,UAAU;AAAA,EACjC;AAEA,SAAO;AACT;"}
|
|
@@ -1,4 +1,13 @@
|
|
|
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] = "89c3d3b4-c7cc-4279-b476-4b41021acd0b", e._sentryDebugIdIdentifier = "sentry-dbid-89c3d3b4-c7cc-4279-b476-4b41021acd0b");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { formatTimestamp, mapFields, getDuration, mapSdkFields, mapTags } from "../utils.js";
|
|
10
|
+
import "../../../_virtual/_sentry-release-injection-file.js";
|
|
2
11
|
function buildErrorData(event) {
|
|
3
12
|
const data = {
|
|
4
13
|
timestamp: formatTimestamp(event.timestamp),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-builders.js","sources":["../../../../src/server/formatters/shared/data-builders.ts"],"sourcesContent":["import { formatTimestamp, getDuration, mapFields, mapSdkFields, mapTags } from \"../utils.ts\";\n\n/**\n * Build error event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildErrorData(event: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(event.timestamp),\n type: \"error\",\n level: event.level || \"error\",\n event_id: event.event_id,\n };\n\n const message = event.message || event.logentry?.message;\n if (message) {\n data.message = message;\n }\n\n const exc = event.exception?.values?.[0];\n if (exc) {\n mapFields(exc, data, {\n exception_type: \"type\",\n exception_value: \"value\",\n });\n\n const frames = exc.stacktrace?.frames;\n if (frames?.length) {\n const frame = frames.find((f: any) => f.in_app) || frames[frames.length - 1];\n mapFields(frame, data, {\n filename: \"filename\",\n lineno: \"lineno\",\n colno: \"colno\",\n function: \"function\",\n });\n }\n }\n\n const trace = event.contexts?.trace;\n if (trace?.trace_id) {\n mapFields(trace, data, {\n trace_id: \"trace_id\",\n span_id: \"span_id\",\n });\n }\n\n mapFields(event, data, {\n environment: \"environment\",\n release: \"release\",\n dist: \"dist\",\n platform: \"platform\",\n transaction: \"transaction\",\n logger: \"logger\",\n server_name: \"server_name\",\n user_id: \"user.id\",\n user_email: \"user.email\",\n user_username: \"user.username\",\n request_url: \"request.url\",\n request_method: \"request.method\",\n });\n\n mapSdkFields(event, data);\n\n if (event.breadcrumbs?.length) data.breadcrumb_length = event.breadcrumbs.length;\n if (event.spans?.length) data.span_length = event.spans.length;\n mapTags(event, data);\n\n return data;\n}\n\n/**\n * Build log event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildLogData(log: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(log.timestamp),\n type: \"log\",\n level: log.level,\n };\n\n mapFields(log, data, {\n message: \"body\",\n trace_id: \"trace_id\",\n severity_number: \"severity_number\",\n });\n\n if (log.attributes) {\n for (const [key, attr] of Object.entries(log.attributes)) {\n data[key] = (attr as any).value;\n }\n }\n\n return data;\n}\n\n/**\n * Build trace/transaction event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildTraceData(event: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(event.timestamp),\n type: \"trace\",\n event_id: event.event_id,\n };\n\n const trace = event.contexts?.trace;\n if (trace?.trace_id) {\n mapFields(trace, data, {\n trace_id: \"trace_id\",\n span_id: \"span_id\",\n parent_span_id: \"parent_span_id\",\n op: \"op\",\n status: \"status\",\n description: \"description\",\n });\n }\n\n const duration = getDuration(event.timestamp, event.start_timestamp);\n if (duration !== undefined) {\n data.duration_ms = duration;\n }\n\n if (event.spans?.length) data.span_count = event.spans.length;\n\n mapFields(event, data, {\n transaction: \"transaction\",\n environment: \"environment\",\n release: \"release\",\n platform: \"platform\",\n server_name: \"server_name\",\n });\n\n mapSdkFields(event, data);\n\n if (event.measurements) {\n for (const [key, measurement] of Object.entries(event.measurements)) {\n if ((measurement as any)?.value !== undefined) {\n data[`measurement.${key}`] = (measurement as any).value;\n }\n }\n }\n\n mapTags(event, data);\n\n return data;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-builders.js","sources":["../../../../src/server/formatters/shared/data-builders.ts"],"sourcesContent":["import { formatTimestamp, getDuration, mapFields, mapSdkFields, mapTags } from \"../utils.ts\";\n\n/**\n * Build error event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildErrorData(event: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(event.timestamp),\n type: \"error\",\n level: event.level || \"error\",\n event_id: event.event_id,\n };\n\n const message = event.message || event.logentry?.message;\n if (message) {\n data.message = message;\n }\n\n const exc = event.exception?.values?.[0];\n if (exc) {\n mapFields(exc, data, {\n exception_type: \"type\",\n exception_value: \"value\",\n });\n\n const frames = exc.stacktrace?.frames;\n if (frames?.length) {\n const frame = frames.find((f: any) => f.in_app) || frames[frames.length - 1];\n mapFields(frame, data, {\n filename: \"filename\",\n lineno: \"lineno\",\n colno: \"colno\",\n function: \"function\",\n });\n }\n }\n\n const trace = event.contexts?.trace;\n if (trace?.trace_id) {\n mapFields(trace, data, {\n trace_id: \"trace_id\",\n span_id: \"span_id\",\n });\n }\n\n mapFields(event, data, {\n environment: \"environment\",\n release: \"release\",\n dist: \"dist\",\n platform: \"platform\",\n transaction: \"transaction\",\n logger: \"logger\",\n server_name: \"server_name\",\n user_id: \"user.id\",\n user_email: \"user.email\",\n user_username: \"user.username\",\n request_url: \"request.url\",\n request_method: \"request.method\",\n });\n\n mapSdkFields(event, data);\n\n if (event.breadcrumbs?.length) data.breadcrumb_length = event.breadcrumbs.length;\n if (event.spans?.length) data.span_length = event.spans.length;\n mapTags(event, data);\n\n return data;\n}\n\n/**\n * Build log event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildLogData(log: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(log.timestamp),\n type: \"log\",\n level: log.level,\n };\n\n mapFields(log, data, {\n message: \"body\",\n trace_id: \"trace_id\",\n severity_number: \"severity_number\",\n });\n\n if (log.attributes) {\n for (const [key, attr] of Object.entries(log.attributes)) {\n data[key] = (attr as any).value;\n }\n }\n\n return data;\n}\n\n/**\n * Build trace/transaction event data object.\n * Used by both logfmt and json formatters.\n */\nexport function buildTraceData(event: any): Record<string, any> {\n const data: Record<string, any> = {\n timestamp: formatTimestamp(event.timestamp),\n type: \"trace\",\n event_id: event.event_id,\n };\n\n const trace = event.contexts?.trace;\n if (trace?.trace_id) {\n mapFields(trace, data, {\n trace_id: \"trace_id\",\n span_id: \"span_id\",\n parent_span_id: \"parent_span_id\",\n op: \"op\",\n status: \"status\",\n description: \"description\",\n });\n }\n\n const duration = getDuration(event.timestamp, event.start_timestamp);\n if (duration !== undefined) {\n data.duration_ms = duration;\n }\n\n if (event.spans?.length) data.span_count = event.spans.length;\n\n mapFields(event, data, {\n transaction: \"transaction\",\n environment: \"environment\",\n release: \"release\",\n platform: \"platform\",\n server_name: \"server_name\",\n });\n\n mapSdkFields(event, data);\n\n if (event.measurements) {\n for (const [key, measurement] of Object.entries(event.measurements)) {\n if ((measurement as any)?.value !== undefined) {\n data[`measurement.${key}`] = (measurement as any).value;\n }\n }\n }\n\n mapTags(event, data);\n\n return data;\n}\n"],"names":[],"mappings":";;;;;;;;;;AAMO,SAAS,eAAe,OAAiC;AAC9D,QAAM,OAA4B;AAAA,IAChC,WAAW,gBAAgB,MAAM,SAAS;AAAA,IAC1C,MAAM;AAAA,IACN,OAAO,MAAM,SAAS;AAAA,IACtB,UAAU,MAAM;AAAA,EAAA;AAGlB,QAAM,UAAU,MAAM,WAAW,MAAM,UAAU;AACjD,MAAI,SAAS;AACX,SAAK,UAAU;AAAA,EACjB;AAEA,QAAM,MAAM,MAAM,WAAW,SAAS,CAAC;AACvC,MAAI,KAAK;AACP,cAAU,KAAK,MAAM;AAAA,MACnB,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,IAAA,CAClB;AAED,UAAM,SAAS,IAAI,YAAY;AAC/B,QAAI,QAAQ,QAAQ;AAClB,YAAM,QAAQ,OAAO,KAAK,CAAC,MAAW,EAAE,MAAM,KAAK,OAAO,OAAO,SAAS,CAAC;AAC3E,gBAAU,OAAO,MAAM;AAAA,QACrB,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IACH;AAAA,EACF;AAEA,QAAM,QAAQ,MAAM,UAAU;AAC9B,MAAI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AQ;AAAA,MACR,aAAa;AAAA,IAAA,CACd;AAAA,EACH;AAEA,QAAM,WAAW,YAAY,MAAM,WAAW,MAAM,eAAe;AACnE,MAAI,aAAa,QAAW;AAC1B,SAAK,cAAc;AAAA,EACrB;AAEA,MAAI,MAAM,OAAO,OAAQ,MAAK,aAAa,MAAM,MAAM;AAEvD,YAAU,OAAO,MAAM;AAAA,IACrB,aAAa;AAAA,IACb,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,EAAA,CACd;AAED,eAAa,OAAO,IAAI;AAExB,MAAI,MAAM,cAAc;AACtB,eAAW,CAAC,KAAK,WAAW,KAAK,OAAO,QAAQ,MAAM,YAAY,GAAG;AACnE,UAAK,aAAqB,UAAU,QAAW;AAC7C,aAAK,eAAe,GAAG,EAAE,IAAK,YAAoB;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AAEA,UAAQ,OAAO,IAAI;AAEnB,SAAO;AACT;"}
|
|
@@ -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] = "2ef6bcda-ca6a-4140-81f3-5046ca60521e", e._sentryDebugIdIdentifier = "sentry-dbid-2ef6bcda-ca6a-4140-81f3-5046ca60521e");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import "../../_virtual/_sentry-release-injection-file.js";
|
|
1
10
|
const AVAILABLE_FORMATTERS = ["md", "logfmt", "json", "human"];
|
|
2
11
|
export {
|
|
3
12
|
AVAILABLE_FORMATTERS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/server/formatters/types.ts"],"sourcesContent":["import type { Envelope } from \"@sentry/core\";\nimport type { SentryErrorEvent, SentryEvent, SentryLogEvent, SentryTransactionEvent } from \"../parser/types.ts\";\n\n/**\n * Strongly-typed formatter functions (no type guards needed in implementation)\n */\nexport type ErrorFormatterFn = (event: SentryErrorEvent, envelopeHeader: Envelope[0]) => string[];\nexport type LogFormatterFn = (event: SentryLogEvent, envelopeHeader: Envelope[0]) => string[];\nexport type TraceFormatterFn = (event: SentryTransactionEvent, envelopeHeader: Envelope[0]) => string[];\n\n/**\n * Registry entry that bundles the formatter with its type guard\n */\nexport type FormatterEntry<T extends SentryEvent> = {\n typeGuard: (event: SentryEvent) => event is T;\n format: (event: T, envelopeHeader: Envelope[0]) => string[];\n};\n\n/**\n * The formatter registry structure - this IS the formatters object\n */\nexport type FormatterRegistry = {\n event: FormatterEntry<SentryErrorEvent>;\n log: FormatterEntry<SentryLogEvent>;\n transaction: FormatterEntry<SentryTransactionEvent>;\n};\n\n/**\n * Available formatter types.\n * Add new formatters here as they are implemented.\n */\nexport type FormatterType = \"md\" | \"logfmt\" | \"json\" | \"human\";\n\n/**\n * Runtime array of valid formatter types for validation.\n * Keep in sync with FormatterType.\n */\nexport const AVAILABLE_FORMATTERS: readonly FormatterType[] = [\"md\", \"logfmt\", \"json\", \"human\"] as const;\n"],"names":[],"mappings":"AAqCO,MAAM,uBAAiD,CAAC,MAAM,UAAU,QAAQ,OAAO;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/server/formatters/types.ts"],"sourcesContent":["import type { Envelope } from \"@sentry/core\";\nimport type { SentryErrorEvent, SentryEvent, SentryLogEvent, SentryTransactionEvent } from \"../parser/types.ts\";\n\n/**\n * Strongly-typed formatter functions (no type guards needed in implementation)\n */\nexport type ErrorFormatterFn = (event: SentryErrorEvent, envelopeHeader: Envelope[0]) => string[];\nexport type LogFormatterFn = (event: SentryLogEvent, envelopeHeader: Envelope[0]) => string[];\nexport type TraceFormatterFn = (event: SentryTransactionEvent, envelopeHeader: Envelope[0]) => string[];\n\n/**\n * Registry entry that bundles the formatter with its type guard\n */\nexport type FormatterEntry<T extends SentryEvent> = {\n typeGuard: (event: SentryEvent) => event is T;\n format: (event: T, envelopeHeader: Envelope[0]) => string[];\n};\n\n/**\n * The formatter registry structure - this IS the formatters object\n */\nexport type FormatterRegistry = {\n event: FormatterEntry<SentryErrorEvent>;\n log: FormatterEntry<SentryLogEvent>;\n transaction: FormatterEntry<SentryTransactionEvent>;\n};\n\n/**\n * Available formatter types.\n * Add new formatters here as they are implemented.\n */\nexport type FormatterType = \"md\" | \"logfmt\" | \"json\" | \"human\";\n\n/**\n * Runtime array of valid formatter types for validation.\n * Keep in sync with FormatterType.\n */\nexport const AVAILABLE_FORMATTERS: readonly FormatterType[] = [\"md\", \"logfmt\", \"json\", \"human\"] as const;\n"],"names":[],"mappings":";;;;;;;;;AAqCO,MAAM,uBAAiD,CAAC,MAAM,UAAU,QAAQ,OAAO;"}
|
|
@@ -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] = "a2776571-26b0-4703-8106-9dbf5eaf1ff6", e._sentryDebugIdIdentifier = "sentry-dbid-a2776571-26b0-4703-8106-9dbf5eaf1ff6");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import "../../_virtual/_sentry-release-injection-file.js";
|
|
1
10
|
function formatTimestamp(timestamp) {
|
|
2
11
|
const date = timestamp ? new Date(timestamp * 1e3) : /* @__PURE__ */ new Date(0);
|
|
3
12
|
return date.toISOString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/server/formatters/utils.ts"],"sourcesContent":["/**\n * Format a Sentry timestamp (in seconds) to ISO string.\n * Sentry timestamps are Unix timestamps in seconds, so we multiply by 1000 to convert to milliseconds.\n * Falls back to epoch (1970-01-01T00:00:00.000Z) if timestamp is missing/invalid.\n */\nexport function formatTimestamp(timestamp?: number): string {\n const date = timestamp ? new Date(timestamp * 1000) : new Date(0);\n return date.toISOString();\n}\n\n/**\n * Get the duration in milliseconds between two Sentry timestamps.\n * Accepts timestamps in seconds (as numbers or strings).\n * Returns undefined if either timestamp is missing or invalid.\n */\n\nexport function getDuration(endTimestamp?: number | string, startTimestamp?: number | string): number | undefined {\n const end = typeof endTimestamp === \"string\" ? Number.parseFloat(endTimestamp) : endTimestamp;\n const start = typeof startTimestamp === \"string\" ? Number.parseFloat(startTimestamp) : startTimestamp;\n\n if (typeof end === \"number\" && typeof start === \"number\" && !Number.isNaN(end) && !Number.isNaN(start)) {\n return Math.round((end - start) * 1000);\n }\n\n return undefined;\n}\n\n/**\n * Map simple fields from source to data object.\n * Only sets fields if the source value is truthy.\n */\nexport function mapFields(source: any, data: Record<string, any>, fieldMappings: Record<string, string>): void {\n for (const [outputKey, sourcePath] of Object.entries(fieldMappings)) {\n const value = getNestedValue(source, sourcePath);\n if (value !== undefined && value !== null) {\n data[outputKey] = value;\n }\n }\n}\n\n/**\n * Map SDK name and version fields\n */\nexport function mapSdkFields(source: any, data: Record<string, any>): void {\n if (source.sdk?.name) {\n data.sdk = source.sdk.name;\n if (source.sdk.version) {\n data.sdk_version = source.sdk.version;\n }\n }\n}\n\n/**\n * Map tags directly to data object\n */\nexport function mapTags(source: any, data: Record<string, any>): void {\n if (source.tags) {\n for (const [key, value] of Object.entries(source.tags)) {\n data[key] = value;\n }\n }\n}\n\n/**\n * Get nested value from object using dot notation path\n */\nfunction getNestedValue(obj: any, path: string): any {\n return path.split(\".\").reduce((current, key) => current?.[key], obj);\n}\n"],"names":[],"mappings":"AAKO,SAAS,gBAAgB,WAA4B;AAC1D,QAAM,OAAO,YAAY,IAAI,KAAK,YAAY,GAAI,IAAI,oBAAI,KAAK,CAAC;AAChE,SAAO,KAAK,YAAA;AACd;AAQO,SAAS,YAAY,cAAgC,gBAAsD;AAChH,QAAM,MAAM,OAAO,iBAAiB,WAAW,OAAO,WAAW,YAAY,IAAI;AACjF,QAAM,QAAQ,OAAO,mBAAmB,WAAW,OAAO,WAAW,cAAc,IAAI;AAEvF,MAAI,OAAO,QAAQ,YAAY,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,GAAG,KAAK,CAAC,OAAO,MAAM,KAAK,GAAG;AACtG,WAAO,KAAK,OAAO,MAAM,SAAS,GAAI;AAAA,EACxC;AAEA,SAAO;AACT;AAMO,SAAS,UAAU,QAAa,MAA2B,eAA6C;AAC7G,aAAW,CAAC,WAAW,UAAU,KAAK,OAAO,QAAQ,aAAa,GAAG;AACnE,UAAM,QAAQ,eAAe,QAAQ,UAAU;AAC/C,QAAI,UAAU,UAAa,UAAU,MAAM;AACzC,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,EACF;AACF;AAKO,SAAS,aAAa,QAAa,MAAiC;AACzE,MAAI,OAAO,KAAK,MAAM;AACpB,SAAK,MAAM,OAAO,IAAI;AACtB,QAAI,OAAO,IAAI,SAAS;AACtB,WAAK,cAAc,OAAO,IAAI;AAAA,IAChC;AAAA,EACF;AACF;AAKO,SAAS,QAAQ,QAAa,MAAiC;AACpE,MAAI,OAAO,MAAM;AACf,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,IAAI,GAAG;AACtD,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AACF;AAKA,SAAS,eAAe,KAAU,MAAmB;AACnD,SAAO,KAAK,MAAM,GAAG,EAAE,OAAO,CAAC,SAAS,QAAQ,UAAU,GAAG,GAAG,GAAG;AACrE;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/server/formatters/utils.ts"],"sourcesContent":["/**\n * Format a Sentry timestamp (in seconds) to ISO string.\n * Sentry timestamps are Unix timestamps in seconds, so we multiply by 1000 to convert to milliseconds.\n * Falls back to epoch (1970-01-01T00:00:00.000Z) if timestamp is missing/invalid.\n */\nexport function formatTimestamp(timestamp?: number): string {\n const date = timestamp ? new Date(timestamp * 1000) : new Date(0);\n return date.toISOString();\n}\n\n/**\n * Get the duration in milliseconds between two Sentry timestamps.\n * Accepts timestamps in seconds (as numbers or strings).\n * Returns undefined if either timestamp is missing or invalid.\n */\n\nexport function getDuration(endTimestamp?: number | string, startTimestamp?: number | string): number | undefined {\n const end = typeof endTimestamp === \"string\" ? Number.parseFloat(endTimestamp) : endTimestamp;\n const start = typeof startTimestamp === \"string\" ? Number.parseFloat(startTimestamp) : startTimestamp;\n\n if (typeof end === \"number\" && typeof start === \"number\" && !Number.isNaN(end) && !Number.isNaN(start)) {\n return Math.round((end - start) * 1000);\n }\n\n return undefined;\n}\n\n/**\n * Map simple fields from source to data object.\n * Only sets fields if the source value is truthy.\n */\nexport function mapFields(source: any, data: Record<string, any>, fieldMappings: Record<string, string>): void {\n for (const [outputKey, sourcePath] of Object.entries(fieldMappings)) {\n const value = getNestedValue(source, sourcePath);\n if (value !== undefined && value !== null) {\n data[outputKey] = value;\n }\n }\n}\n\n/**\n * Map SDK name and version fields\n */\nexport function mapSdkFields(source: any, data: Record<string, any>): void {\n if (source.sdk?.name) {\n data.sdk = source.sdk.name;\n if (source.sdk.version) {\n data.sdk_version = source.sdk.version;\n }\n }\n}\n\n/**\n * Map tags directly to data object\n */\nexport function mapTags(source: any, data: Record<string, any>): void {\n if (source.tags) {\n for (const [key, value] of Object.entries(source.tags)) {\n data[key] = value;\n }\n }\n}\n\n/**\n * Get nested value from object using dot notation path\n */\nfunction getNestedValue(obj: any, path: string): any {\n return path.split(\".\").reduce((current, key) => current?.[key], obj);\n}\n"],"names":[],"mappings":";;;;;;;;;AAKO,SAAS,gBAAgB,WAA4B;AAC1D,QAAM,OAAO,YAAY,IAAI,KAAK,YAAY,GAAI,IAAI,oBAAI,KAAK,CAAC;AAChE,SAAO,KAAK,YAAA;AACd;AAQO,SAAS,YAAY,cAAgC,gBAAsD;AAChH,QAAM,MAAM,OAAO,iBAAiB,WAAW,OAAO,WAAW,YAAY,IAAI;AACjF,QAAM,QAAQ,OAAO,mBAAmB,WAAW,OAAO,WAAW,cAAc,IAAI;AAEvF,MAAI,OAAO,QAAQ,YAAY,OAAO,UAAU,YAAY,CAAC,OAAO,MAAM,GAAG,KAAK,CAAC,OAAO,MAAM,KAAK,GAAG;AACtG,WAAO,KAAK,OAAO,MAAM,SAAS,GAAI;AAAA,EACxC;AAEA,SAAO;AACT;AAMO,SAAS,UAAU,QAAa,MAA2B,eAA6C;AAC7G,aAAW,CAAC,WAAW,UAAU,KAAK,OAAO,QAAQ,aAAa,GAAG;AACnE,UAAM,QAAQ,eAAe,QAAQ,UAAU;AAC/C,QAAI,UAAU,UAAa,UAAU,MAAM;AACzC,WAAK,SAAS,IAAI;AAAA,IACpB;AAAA,EACF;AACF;AAKO,SAAS,aAAa,QAAa,MAAiC;AACzE,MAAI,OAAO,KAAK,MAAM;AACpB,SAAK,MAAM,OAAO,IAAI;AACtB,QAAI,OAAO,IAAI,SAAS;AACtB,WAAK,cAAc,OAAO,IAAI;AAAA,IAChC;AAAA,EACF;AACF;AAKO,SAAS,QAAQ,QAAa,MAAiC;AACpE,MAAI,OAAO,MAAM;AACf,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,IAAI,GAAG;AACtD,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AACF;AAKA,SAAS,eAAe,KAAU,MAAmB;AACnD,SAAO,KAAK,MAAM,GAAG,EAAE,OAAO,CAAC,SAAS,QAAQ,UAAU,GAAG,GAAG,GAAG;AACrE;"}
|
|
@@ -1,4 +1,13 @@
|
|
|
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] = "f0e110b1-9ed4-4703-abe1-74d6a3ab773b", e._sentryDebugIdIdentifier = "sentry-dbid-f0e110b1-9ed4-4703-abe1-74d6a3ab773b");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { extname } from "node:path";
|
|
10
|
+
import "../../_virtual/_sentry-release-injection-file.js";
|
|
2
11
|
const extensionsToContentType = {
|
|
3
12
|
".js": "text/javascript",
|
|
4
13
|
".css": "text/css",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileToServe.js","sources":["../../../src/server/handlers/fileToServe.ts"],"sourcesContent":["import { extname } from \"node:path\";\nimport type { Handler } from \"hono\";\n\nconst extensionsToContentType: Record<string, string | undefined> = {\n \".js\": \"text/javascript\",\n \".css\": \"text/css\",\n \".json\": \"application/json\",\n};\n\nexport function serveFilesHandler(filesToServe: Record<string, Buffer>): Handler {\n return ctx => {\n let filePath = `${ctx.req.path || ctx.req.url}`;\n\n // The `/telemetry` route is handled by the React app with the location\n // router. This is kind of a hack to avoid a 404 when the user refreshes\n // the page or directly navigates to `/telemetry`. Should probably find\n // a better way to share routes from the UI to the server later on.\n if (filePath === \"/\" || filePath.startsWith(\"/telemetry\")) {\n filePath = \"/index.html\";\n }\n\n filePath = filePath.slice(1);\n\n const extName = extname(filePath);\n const contentType = extensionsToContentType[extName] ?? \"text/html\";\n\n if (!Object.hasOwn(filesToServe, filePath) || !filesToServe[filePath]) {\n return ctx.notFound();\n }\n\n // Enable profiling in browser\n ctx.header(\"Document-Policy\", \"js-profiling\");\n ctx.header(\"Content-Type\", contentType);\n\n return ctx.body(new Uint8Array(filesToServe[filePath]));\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fileToServe.js","sources":["../../../src/server/handlers/fileToServe.ts"],"sourcesContent":["import { extname } from \"node:path\";\nimport type { Handler } from \"hono\";\n\nconst extensionsToContentType: Record<string, string | undefined> = {\n \".js\": \"text/javascript\",\n \".css\": \"text/css\",\n \".json\": \"application/json\",\n};\n\nexport function serveFilesHandler(filesToServe: Record<string, Buffer>): Handler {\n return ctx => {\n let filePath = `${ctx.req.path || ctx.req.url}`;\n\n // The `/telemetry` route is handled by the React app with the location\n // router. This is kind of a hack to avoid a 404 when the user refreshes\n // the page or directly navigates to `/telemetry`. Should probably find\n // a better way to share routes from the UI to the server later on.\n if (filePath === \"/\" || filePath.startsWith(\"/telemetry\")) {\n filePath = \"/index.html\";\n }\n\n filePath = filePath.slice(1);\n\n const extName = extname(filePath);\n const contentType = extensionsToContentType[extName] ?? \"text/html\";\n\n if (!Object.hasOwn(filesToServe, filePath) || !filesToServe[filePath]) {\n return ctx.notFound();\n }\n\n // Enable profiling in browser\n ctx.header(\"Document-Policy\", \"js-profiling\");\n ctx.header(\"Content-Type\", contentType);\n\n return ctx.body(new Uint8Array(filesToServe[filePath]));\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AAGA,MAAM,0BAA8D;AAAA,EAClE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,SAAS,kBAAkB,cAA+C;AAC/E,SAAO,CAAA,QAAO;AACZ,QAAI,WAAW,GAAG,IAAI,IAAI,QAAQ,IAAI,IAAI,GAAG;AAM7C,QAAI,aAAa,OAAO,SAAS,WAAW,YAAY,GAAG;AACzD,iBAAW;AAAA,IACb;AAEA,eAAW,SAAS,MAAM,CAAC;AAE3B,UAAM,UAAU,QAAQ,QAAQ;AAChC,UAAM,cAAc,wBAAwB,OAAO,KAAK;AAExD,QAAI,CAAC,OAAO,OAAO,cAAc,QAAQ,KAAK,CAAC,aAAa,QAAQ,GAAG;AACrE,aAAO,IAAI,SAAA;AAAA,IACb;AAGA,QAAI,OAAO,mBAAmB,cAAc;AAC5C,QAAI,OAAO,gBAAgB,WAAW;AAEtC,WAAO,IAAI,KAAK,IAAI,WAAW,aAAa,QAAQ,CAAC,CAAC;AAAA,EACxD;AACF;"}
|
package/dist/server/logger.js
CHANGED
|
@@ -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] = "ab1cf84c-2e45-4016-8a2d-77d6767f206e", e._sentryDebugIdIdentifier = "sentry-dbid-ab1cf84c-2e45-4016-8a2d-77d6767f206e");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import "../_virtual/_sentry-release-injection-file.js";
|
|
1
10
|
const SPOTLIGHT_PREFIX = "🔎 [Spotlight]";
|
|
2
11
|
const defaultLogger = {
|
|
3
12
|
info: (message) => console.error(SPOTLIGHT_PREFIX, message),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sources":["../../src/server/logger.ts"],"sourcesContent":["import type { SidecarLogger } from \"./types/index.ts\";\n\nconst SPOTLIGHT_PREFIX = \"🔎 [Spotlight]\";\n\nconst defaultLogger: SidecarLogger = {\n info: message => console.error(SPOTLIGHT_PREFIX, message),\n warn: message => console.error(SPOTLIGHT_PREFIX, message),\n error: message => console.error(SPOTLIGHT_PREFIX, message),\n debug: message => debugEnabled && console.error(SPOTLIGHT_PREFIX, message),\n};\n\nlet injectedLogger: SidecarLogger | undefined = undefined;\nlet debugEnabled = false;\n\nexport function activateLogger(logger: SidecarLogger): void {\n injectedLogger = logger;\n}\n\nexport function enableDebugLogging(debug: boolean): void {\n debugEnabled = debug;\n}\n\nexport function isDebugEnabled(): boolean {\n return debugEnabled;\n}\n\nexport const logger: SidecarLogger = {\n info: message => (injectedLogger || defaultLogger).info(message),\n warn: message => (injectedLogger || defaultLogger).warn(message),\n error: message => (injectedLogger || defaultLogger).error(message),\n debug: message => (injectedLogger || defaultLogger).debug(message),\n};\n"],"names":["logger"],"mappings":"AAEA,MAAM,mBAAmB;AAEzB,MAAM,gBAA+B;AAAA,EACnC,MAAM,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACxD,MAAM,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACxD,OAAO,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACzD,OAAO,CAAA,YAAW,gBAAgB,QAAQ,MAAM,kBAAkB,OAAO;AAC3E;AAEA,IAAI,iBAA4C;AAChD,IAAI,eAAe;AAEZ,SAAS,eAAeA,SAA6B;AAC1D,mBAAiBA;AACnB;AAEO,SAAS,mBAAmB,OAAsB;AACvD,iBAAe;AACjB;AAEO,SAAS,iBAA0B;AACxC,SAAO;AACT;AAEO,MAAM,SAAwB;AAAA,EACnC,MAAM,CAAA,aAAY,kBAAkB,eAAe,KAAK,OAAO;AAAA,EAC/D,MAAM,CAAA,aAAY,kBAAkB,eAAe,KAAK,OAAO;AAAA,EAC/D,OAAO,CAAA,aAAY,kBAAkB,eAAe,MAAM,OAAO;AAAA,EACjE,OAAO,CAAA,aAAY,kBAAkB,eAAe,MAAM,OAAO;AACnE;"}
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../src/server/logger.ts"],"sourcesContent":["import type { SidecarLogger } from \"./types/index.ts\";\n\nconst SPOTLIGHT_PREFIX = \"🔎 [Spotlight]\";\n\nconst defaultLogger: SidecarLogger = {\n info: message => console.error(SPOTLIGHT_PREFIX, message),\n warn: message => console.error(SPOTLIGHT_PREFIX, message),\n error: message => console.error(SPOTLIGHT_PREFIX, message),\n debug: message => debugEnabled && console.error(SPOTLIGHT_PREFIX, message),\n};\n\nlet injectedLogger: SidecarLogger | undefined = undefined;\nlet debugEnabled = false;\n\nexport function activateLogger(logger: SidecarLogger): void {\n injectedLogger = logger;\n}\n\nexport function enableDebugLogging(debug: boolean): void {\n debugEnabled = debug;\n}\n\nexport function isDebugEnabled(): boolean {\n return debugEnabled;\n}\n\nexport const logger: SidecarLogger = {\n info: message => (injectedLogger || defaultLogger).info(message),\n warn: message => (injectedLogger || defaultLogger).warn(message),\n error: message => (injectedLogger || defaultLogger).error(message),\n debug: message => (injectedLogger || defaultLogger).debug(message),\n};\n"],"names":["logger"],"mappings":";;;;;;;;;AAEA,MAAM,mBAAmB;AAEzB,MAAM,gBAA+B;AAAA,EACnC,MAAM,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACxD,MAAM,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACxD,OAAO,CAAA,YAAW,QAAQ,MAAM,kBAAkB,OAAO;AAAA,EACzD,OAAO,CAAA,YAAW,gBAAgB,QAAQ,MAAM,kBAAkB,OAAO;AAC3E;AAEA,IAAI,iBAA4C;AAChD,IAAI,eAAe;AAEZ,SAAS,eAAeA,SAA6B;AAC1D,mBAAiBA;AACnB;AAEO,SAAS,mBAAmB,OAAsB;AACvD,iBAAe;AACjB;AAEO,SAAS,iBAA0B;AACxC,SAAO;AACT;AAEO,MAAM,SAAwB;AAAA,EACnC,MAAM,CAAA,aAAY,kBAAkB,eAAe,KAAK,OAAO;AAAA,EAC/D,MAAM,CAAA,aAAY,kBAAkB,eAAe,KAAK,OAAO;AAAA,EAC/D,OAAO,CAAA,aAAY,kBAAkB,eAAe,MAAM,OAAO;AAAA,EACjE,OAAO,CAAA,aAAY,kBAAkB,eAAe,MAAM,OAAO;AACnE;"}
|
package/dist/server/main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server } from 'node:http';
|
|
2
2
|
import { SideCarOptions, StartServerOptions } from './types/index.ts';
|
|
3
3
|
export declare function startServer(options: StartServerOptions): Promise<Server>;
|
|
4
|
-
export declare function setupSpotlight({ port, logger: customLogger, basePath, filesToServe, incomingPayload, isStandalone }?: SideCarOptions): Promise<Server | undefined>;
|
|
4
|
+
export declare function setupSpotlight({ port, logger: customLogger, basePath, filesToServe, incomingPayload, isStandalone, allowedOrigins, }?: SideCarOptions): Promise<Server | undefined>;
|
|
5
5
|
export declare function clearBuffer(): void;
|
|
6
6
|
export declare function setShutdownHandlers(server: Server): void;
|
package/dist/server/main.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
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] = "09e2099c-a6f2-448b-8210-12c9009fd846", e._sentryDebugIdIdentifier = "sentry-dbid-09e2099c-a6f2-448b-8210-12c9009fd846");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
1
9
|
import { readFileSync } from "node:fs";
|
|
2
10
|
import { join } from "node:path";
|
|
3
11
|
import { serve } from "@hono/node-server";
|
|
@@ -6,13 +14,14 @@ import { Hono } from "hono";
|
|
|
6
14
|
import { cors } from "../node_modules/.pnpm/hono@4.10.3/node_modules/hono/dist/middleware/cors/index.js";
|
|
7
15
|
import { DEFAULT_PORT, SERVER_IDENTIFIER } from "./constants.js";
|
|
8
16
|
import { serveFilesHandler } from "./handlers/fileToServe.js";
|
|
17
|
+
import "../_virtual/_sentry-release-injection-file.js";
|
|
9
18
|
import { activateLogger, logger } from "./logger.js";
|
|
10
19
|
import router from "./routes/index.js";
|
|
11
20
|
import { getBuffer } from "./utils/getBuffer.js";
|
|
12
21
|
import "./parser/helpers.js";
|
|
13
22
|
import "uuidv7";
|
|
14
23
|
import { isValidPort, isSidecarRunning, logSpotlightUrl } from "./utils/extras.js";
|
|
15
|
-
import { isAllowedOrigin } from "./utils/cors.js";
|
|
24
|
+
import { normalizeAllowedOrigins, isAllowedOrigin } from "./utils/cors.js";
|
|
16
25
|
let portInUseRetryTimeout = null;
|
|
17
26
|
const MAX_RETRIES = 3;
|
|
18
27
|
async function startServer(options) {
|
|
@@ -29,7 +38,7 @@ async function startServer(options) {
|
|
|
29
38
|
}
|
|
30
39
|
const app = new Hono().use(
|
|
31
40
|
cors({
|
|
32
|
-
origin: (origin) => isAllowedOrigin(origin) ? origin : null
|
|
41
|
+
origin: async (origin) => await isAllowedOrigin(origin, options.normalizedAllowedOrigins) ? origin : null
|
|
33
42
|
})
|
|
34
43
|
);
|
|
35
44
|
app.use(async (ctx, next) => {
|
|
@@ -118,7 +127,15 @@ async function startServer(options) {
|
|
|
118
127
|
}
|
|
119
128
|
return promise;
|
|
120
129
|
}
|
|
121
|
-
async function setupSpotlight({
|
|
130
|
+
async function setupSpotlight({
|
|
131
|
+
port,
|
|
132
|
+
logger: customLogger,
|
|
133
|
+
basePath,
|
|
134
|
+
filesToServe,
|
|
135
|
+
incomingPayload,
|
|
136
|
+
isStandalone,
|
|
137
|
+
allowedOrigins
|
|
138
|
+
} = {
|
|
122
139
|
port: DEFAULT_PORT
|
|
123
140
|
}) {
|
|
124
141
|
if (!isStandalone) {
|
|
@@ -142,7 +159,8 @@ async function setupSpotlight({ port, logger: customLogger, basePath, filesToSer
|
|
|
142
159
|
port,
|
|
143
160
|
basePath,
|
|
144
161
|
filesToServe,
|
|
145
|
-
incomingPayload
|
|
162
|
+
incomingPayload,
|
|
163
|
+
normalizedAllowedOrigins: allowedOrigins ? normalizeAllowedOrigins(allowedOrigins) : void 0
|
|
146
164
|
});
|
|
147
165
|
setShutdownHandlers(serverInstance);
|
|
148
166
|
return serverInstance;
|