@interfere/types 9.0.2 → 9.0.3-canary.0

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.
Files changed (173) hide show
  1. package/dist/data/frame.cjs +1 -0
  2. package/dist/data/frame.d.cts +27 -0
  3. package/dist/data/frame.d.mts +2 -1
  4. package/dist/data/frame.mjs +2 -1
  5. package/dist/data/session.cjs +1 -0
  6. package/dist/data/session.d.cts +8 -0
  7. package/dist/data/session.d.mts +2 -1
  8. package/dist/data/session.mjs +2 -1
  9. package/dist/data/source-maps.cjs +1 -0
  10. package/dist/data/source-maps.d.cts +151 -0
  11. package/dist/data/source-maps.d.mts +7 -2
  12. package/dist/data/source-maps.mjs +2 -1
  13. package/dist/events/error.cjs +1 -0
  14. package/dist/events/error.d.cts +196 -0
  15. package/dist/events/error.d.mts +2 -1
  16. package/dist/events/error.mjs +2 -1
  17. package/dist/events/pageleave.cjs +1 -0
  18. package/dist/events/pageleave.d.cts +13 -0
  19. package/dist/events/pageleave.d.mts +2 -1
  20. package/dist/events/pageleave.mjs +2 -1
  21. package/dist/events/pageview.cjs +1 -0
  22. package/dist/events/pageview.d.cts +14 -0
  23. package/dist/events/pageview.d.mts +2 -1
  24. package/dist/events/pageview.mjs +2 -1
  25. package/dist/integrations/index.cjs +1 -0
  26. package/dist/integrations/index.d.cts +48 -0
  27. package/dist/integrations/index.d.mts +2 -1
  28. package/dist/integrations/index.mjs +2 -1
  29. package/dist/integrations/platforms/cli.cjs +1 -0
  30. package/dist/integrations/platforms/cli.d.cts +12 -0
  31. package/dist/integrations/platforms/cli.d.mts +12 -0
  32. package/dist/integrations/platforms/cli.mjs +2 -0
  33. package/dist/integrations/platforms/github.cjs +1 -0
  34. package/dist/integrations/platforms/github.d.cts +16 -0
  35. package/dist/integrations/platforms/github.d.mts +2 -1
  36. package/dist/integrations/platforms/github.mjs +2 -1
  37. package/dist/integrations/platforms/slack.cjs +1 -0
  38. package/dist/integrations/platforms/slack.d.cts +33 -0
  39. package/dist/integrations/platforms/slack.d.mts +2 -1
  40. package/dist/integrations/platforms/slack.mjs +2 -1
  41. package/dist/integrations/platforms/vercel.cjs +1 -0
  42. package/dist/integrations/platforms/vercel.d.cts +47 -0
  43. package/dist/integrations/platforms/vercel.d.mts +2 -1
  44. package/dist/integrations/platforms/vercel.mjs +2 -1
  45. package/dist/releases/definition.cjs +1 -0
  46. package/dist/releases/definition.d.cts +57 -0
  47. package/dist/releases/definition.d.mts +2 -1
  48. package/dist/releases/definition.mjs +2 -1
  49. package/dist/releases/slug.cjs +1 -0
  50. package/dist/releases/slug.d.cts +24 -0
  51. package/dist/releases/slug.d.mts +3 -1
  52. package/dist/releases/slug.mjs +2 -1
  53. package/dist/sdk/env.cjs +1 -0
  54. package/dist/sdk/env.d.cts +6 -0
  55. package/dist/sdk/env.d.mts +2 -1
  56. package/dist/sdk/env.mjs +2 -1
  57. package/dist/sdk/envelope.cjs +1 -0
  58. package/dist/sdk/envelope.d.cts +1489 -0
  59. package/dist/sdk/envelope.d.mts +2 -1
  60. package/dist/sdk/envelope.mjs +2 -1
  61. package/dist/sdk/errors.cjs +2 -0
  62. package/dist/sdk/errors.d.cts +154 -0
  63. package/dist/sdk/errors.d.mts +2 -1
  64. package/dist/sdk/errors.mjs +3 -2
  65. package/dist/sdk/geo.cjs +1 -0
  66. package/dist/sdk/geo.d.cts +11 -0
  67. package/dist/sdk/geo.d.mts +2 -1
  68. package/dist/sdk/geo.mjs +2 -1
  69. package/dist/sdk/identify.cjs +1 -0
  70. package/dist/sdk/identify.d.cts +35 -0
  71. package/dist/sdk/identify.d.mts +2 -1
  72. package/dist/sdk/identify.mjs +2 -1
  73. package/dist/sdk/plugins/context/browser.cjs +1 -0
  74. package/dist/sdk/plugins/context/browser.d.cts +92 -0
  75. package/dist/sdk/plugins/context/browser.d.mts +2 -1
  76. package/dist/sdk/plugins/context/browser.mjs +2 -1
  77. package/dist/sdk/plugins/context/edge.cjs +1 -0
  78. package/dist/sdk/plugins/context/edge.d.cts +10 -0
  79. package/dist/sdk/plugins/context/edge.d.mts +2 -1
  80. package/dist/sdk/plugins/context/edge.mjs +2 -1
  81. package/dist/sdk/plugins/context/next.cjs +1 -0
  82. package/dist/sdk/plugins/context/next.d.cts +62 -0
  83. package/dist/sdk/plugins/context/next.d.mts +2 -1
  84. package/dist/sdk/plugins/context/next.mjs +2 -1
  85. package/dist/sdk/plugins/context/node.cjs +1 -0
  86. package/dist/sdk/plugins/context/node.d.cts +13 -0
  87. package/dist/sdk/plugins/context/node.d.mts +2 -1
  88. package/dist/sdk/plugins/context/node.mjs +2 -1
  89. package/dist/sdk/plugins/manifest.cjs +1 -0
  90. package/dist/sdk/plugins/manifest.d.cts +60 -0
  91. package/dist/sdk/plugins/manifest.d.mts +2 -1
  92. package/dist/sdk/plugins/manifest.mjs +2 -1
  93. package/dist/sdk/plugins/payload/errors.cjs +1 -0
  94. package/dist/sdk/plugins/payload/errors.d.cts +65 -0
  95. package/dist/sdk/plugins/payload/errors.d.mts +2 -1
  96. package/dist/sdk/plugins/payload/errors.mjs +2 -1
  97. package/dist/sdk/plugins/payload/page-events.cjs +1 -0
  98. package/dist/sdk/plugins/payload/page-events.d.cts +20 -0
  99. package/dist/sdk/plugins/payload/page-events.d.mts +2 -1
  100. package/dist/sdk/plugins/payload/page-events.mjs +2 -1
  101. package/dist/sdk/plugins/payload/rage-click.cjs +1 -0
  102. package/dist/sdk/plugins/payload/rage-click.d.cts +16 -0
  103. package/dist/sdk/plugins/payload/rage-click.d.mts +2 -1
  104. package/dist/sdk/plugins/payload/rage-click.mjs +2 -1
  105. package/dist/sdk/plugins/payload/replay.cjs +1 -0
  106. package/dist/sdk/plugins/payload/replay.d.cts +14 -0
  107. package/dist/sdk/plugins/payload/replay.d.mts +2 -1
  108. package/dist/sdk/plugins/payload/replay.mjs +2 -1
  109. package/dist/sdk/remote-config.cjs +1 -0
  110. package/dist/sdk/remote-config.d.cts +39 -0
  111. package/dist/sdk/remote-config.d.mts +2 -1
  112. package/dist/sdk/remote-config.mjs +2 -1
  113. package/dist/sdk/runtime.cjs +1 -0
  114. package/dist/sdk/runtime.d.cts +22 -0
  115. package/dist/sdk/runtime.d.mts +2 -1
  116. package/dist/sdk/runtime.mjs +2 -1
  117. package/package.json +115 -40
  118. package/dist/data/frame.d.mts.map +0 -1
  119. package/dist/data/frame.mjs.map +0 -1
  120. package/dist/data/session.d.mts.map +0 -1
  121. package/dist/data/session.mjs.map +0 -1
  122. package/dist/data/source-maps.d.mts.map +0 -1
  123. package/dist/data/source-maps.mjs.map +0 -1
  124. package/dist/events/error.d.mts.map +0 -1
  125. package/dist/events/error.mjs.map +0 -1
  126. package/dist/events/pageleave.d.mts.map +0 -1
  127. package/dist/events/pageleave.mjs.map +0 -1
  128. package/dist/events/pageview.d.mts.map +0 -1
  129. package/dist/events/pageview.mjs.map +0 -1
  130. package/dist/integrations/index.d.mts.map +0 -1
  131. package/dist/integrations/index.mjs.map +0 -1
  132. package/dist/integrations/platforms/github.d.mts.map +0 -1
  133. package/dist/integrations/platforms/github.mjs.map +0 -1
  134. package/dist/integrations/platforms/slack.d.mts.map +0 -1
  135. package/dist/integrations/platforms/slack.mjs.map +0 -1
  136. package/dist/integrations/platforms/vercel.d.mts.map +0 -1
  137. package/dist/integrations/platforms/vercel.mjs.map +0 -1
  138. package/dist/releases/definition.d.mts.map +0 -1
  139. package/dist/releases/definition.mjs.map +0 -1
  140. package/dist/releases/slug.d.mts.map +0 -1
  141. package/dist/releases/slug.mjs.map +0 -1
  142. package/dist/sdk/env.d.mts.map +0 -1
  143. package/dist/sdk/env.mjs.map +0 -1
  144. package/dist/sdk/envelope.d.mts.map +0 -1
  145. package/dist/sdk/envelope.mjs.map +0 -1
  146. package/dist/sdk/errors.d.mts.map +0 -1
  147. package/dist/sdk/errors.mjs.map +0 -1
  148. package/dist/sdk/geo.d.mts.map +0 -1
  149. package/dist/sdk/geo.mjs.map +0 -1
  150. package/dist/sdk/identify.d.mts.map +0 -1
  151. package/dist/sdk/identify.mjs.map +0 -1
  152. package/dist/sdk/plugins/context/browser.d.mts.map +0 -1
  153. package/dist/sdk/plugins/context/browser.mjs.map +0 -1
  154. package/dist/sdk/plugins/context/edge.d.mts.map +0 -1
  155. package/dist/sdk/plugins/context/edge.mjs.map +0 -1
  156. package/dist/sdk/plugins/context/next.d.mts.map +0 -1
  157. package/dist/sdk/plugins/context/next.mjs.map +0 -1
  158. package/dist/sdk/plugins/context/node.d.mts.map +0 -1
  159. package/dist/sdk/plugins/context/node.mjs.map +0 -1
  160. package/dist/sdk/plugins/manifest.d.mts.map +0 -1
  161. package/dist/sdk/plugins/manifest.mjs.map +0 -1
  162. package/dist/sdk/plugins/payload/errors.d.mts.map +0 -1
  163. package/dist/sdk/plugins/payload/errors.mjs.map +0 -1
  164. package/dist/sdk/plugins/payload/page-events.d.mts.map +0 -1
  165. package/dist/sdk/plugins/payload/page-events.mjs.map +0 -1
  166. package/dist/sdk/plugins/payload/rage-click.d.mts.map +0 -1
  167. package/dist/sdk/plugins/payload/rage-click.mjs.map +0 -1
  168. package/dist/sdk/plugins/payload/replay.d.mts.map +0 -1
  169. package/dist/sdk/plugins/payload/replay.mjs.map +0 -1
  170. package/dist/sdk/remote-config.d.mts.map +0 -1
  171. package/dist/sdk/remote-config.mjs.map +0 -1
  172. package/dist/sdk/runtime.d.mts.map +0 -1
  173. package/dist/sdk/runtime.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-maps.mjs","names":[],"sources":["../../src/data/source-maps.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Source-map / manifest R2 keys live in\n// `@interfere/internal-schemas/pipeline/r2-keys` now — they're internal\n// to the producer/consumer contract between the collector and the\n// enrichment service, not part of the public SDK surface. Anything in\n// this package that needed them imported the old `getSourceMapPath` /\n// `getManifestPath` helpers; those have been removed and call sites\n// reach for `r2Keys.sourceMaps.{file,manifest}` directly.\n\n/**\n * Bundler that produced this source-map upload. Reported back in the\n * SDK `bundler` upload metric for diagnostics. Mandatory now —\n * server-side suffix-matching against `chunkUrl` is uniform across\n * bundlers, but knowing which bundler produced the manifest is still\n * useful for diagnostics (different bundlers exhibit different stack\n * shapes; we want that pivot when investigating resolution issues).\n */\nexport const manifestBundlerSchema = z\n .enum([\"webpack\", \"turbopack\", \"tsc\"])\n .meta({ id: \"ManifestBundler\", title: \"ManifestBundler\" });\n\nexport type ManifestBundler = z.infer<typeof manifestBundlerSchema>;\n\nconst sourceMapManifestEntrySchema = z.object({\n /**\n * Public path the runtime loads this chunk from — `_next/static/\n * chunks/<hash>.js` for Next, or any deploy-relative path the\n * bundler emits. Stored as the build-time relative path (not the\n * fully-qualified deployed URL) because preview / production /\n * branch deploys all share the same dist tree but resolve to\n * different origins, so the build can't know the runtime URL up\n * front. The server-side resolver pairs `frame.fileName` (an\n * absolute runtime URL) to this field by suffix-matching the\n * content-hashed filename, which works on either form. Always\n * populated for both bundlers; turbopack discovery extends to\n * walk JS chunks (in addition to .map files) so it can record\n * this. Replaces the old `generatedFile` field, whose semantics\n * differed by bundler.\n */\n chunkUrl: z.string(),\n /**\n * UUID injected into the chunk content (`//# debugId=…` comment) and\n * the source-map JSON (`debugId` field) at build time. Mandatory\n * now — server-side parsing depends on a chunk-side debugId comment\n * being present so the manifest can resolve every chunk uniquely.\n */\n debugId: z.string(),\n /** R2 object key for the source-map content. */\n objectKey: z.string(),\n /** sha256 of the source-map content for integrity / cache validation. */\n mapHash: z.string(),\n});\n\nexport const sourceMapManifestSchema = z.object({\n releaseSlug: z.string(),\n surfaceId: z.string(),\n organizationId: z.string(),\n bundler: manifestBundlerSchema,\n createdAt: z.number(),\n files: z.array(sourceMapManifestEntrySchema),\n});\n\nexport type SourceMapManifest = z.infer<typeof sourceMapManifestSchema>;\n\n/**\n * Per-entry metadata for the legacy multipart upload endpoint\n * (`POST /v1/releases/:slug/source-maps`). One entry per source-map file\n * in the multipart body, paired by `path` matching the multipart filename.\n *\n * Every entry carries `chunkUrl` (the public URL the runtime loads the\n * chunk from) and `debugId` — both mandatory now. The legacy multipart\n * endpoint accepts the same shape as the new presigned-URL flow.\n */\nexport const uploadSourceMapEntry = z\n .object({\n path: z.string().min(1),\n hash: z.string(),\n debugId: z.string(),\n /**\n * Build-time relative chunk path (`_next/static/chunks/<hash>.js`,\n * etc.) — see `sourceMapManifestEntrySchema.chunkUrl` for why\n * this isn't an absolute URL.\n */\n chunkUrl: z.string(),\n })\n .meta({ id: \"UploadSourceMapEntry\", title: \"UploadSourceMapEntry\" });\n\nexport type UploadSourceMapEntry = z.infer<typeof uploadSourceMapEntry>;\n\n/**\n * Multipart metadata for the legacy upload endpoint. The `files` field\n * carries the actual JSON bodies as multipart File parts; this `metadata`\n * object travels alongside as a JSON-encoded form field.\n *\n * This endpoint is deprecated in favour of the `/sign` + direct R2 PUT\n * + `/complete` flow, which scales beyond the body-size limits of any\n * worker / load balancer in front of the collector. Kept for backwards\n * compatibility with deployed SDKs during the deprecation window.\n *\n * @deprecated\n */\nexport const uploadSourceMapsMetadata = z\n .object({\n entries: z.array(uploadSourceMapEntry),\n sourceFileCount: z.number().int().nonnegative().optional(),\n bundler: manifestBundlerSchema,\n })\n .meta({\n id: \"UploadSourceMapsMetadata\",\n title: \"UploadSourceMapsMetadata\",\n description: \"Metadata attached alongside uploaded source map files.\",\n });\n\nexport type UploadSourceMapsMetadata = z.infer<typeof uploadSourceMapsMetadata>;\n\nexport const uploadSourceMapsResponse = z\n .object({\n ok: z.boolean(),\n processed: z.number().int().nonnegative(),\n message: z.string(),\n fileCount: z.number().int().nonnegative(),\n })\n .meta({ id: \"UploadSourceMapsResponse\", title: \"UploadSourceMapsResponse\" });\n\nexport type UploadSourceMapsResponse = z.infer<typeof uploadSourceMapsResponse>;\n\nexport const signSourceMapFile = z\n .object({\n path: z.string().min(1),\n sizeBytes: z.number().int().nonnegative(),\n hasSourcesContent: z.boolean(),\n hasNames: z.boolean(),\n hasFile: z.boolean(),\n mappingsPresent: z.boolean(),\n })\n .meta({ id: \"SignSourceMapFile\", title: \"SignSourceMapFile\" });\n\nexport const signSourceMapsRequest = z\n .object({\n files: z.array(signSourceMapFile),\n })\n .meta({\n id: \"SignSourceMapsRequest\",\n title: \"SignSourceMapsRequest\",\n description:\n \"Per-file metadata the SDK uses to obtain presigned PUT URLs. The server validates per-file size and total file count, then issues short-lived URLs scoped to the release's R2 prefix. The SDK uploads to R2 directly and follows up with a `complete` call to materialize the manifest.\",\n });\n\nexport type SignSourceMapsRequest = z.infer<typeof signSourceMapsRequest>;\n\nexport const signSourceMapUpload = z\n .object({\n path: z.string(),\n objectKey: z.string(),\n presignedUrl: z.string(),\n })\n .meta({ id: \"SignSourceMapUpload\", title: \"SignSourceMapUpload\" });\n\nexport const signSourceMapsResponse = z\n .object({\n uploads: z.array(signSourceMapUpload),\n expiresAt: z.number().int(),\n })\n .meta({\n id: \"SignSourceMapsResponse\",\n title: \"SignSourceMapsResponse\",\n });\n\nexport type SignSourceMapsResponse = z.infer<typeof signSourceMapsResponse>;\n\nexport const completeSourceMapFile = z\n .object({\n path: z.string().min(1),\n hash: z.string(),\n debugId: z.string(),\n /**\n * Build-time relative chunk path. See\n * `sourceMapManifestEntrySchema.chunkUrl` for the rationale —\n * preview / prod / branch deploys share dist trees but resolve\n * to different runtime origins, and the build doesn't know\n * which one it'll be.\n */\n chunkUrl: z.string(),\n })\n .meta({ id: \"CompleteSourceMapFile\", title: \"CompleteSourceMapFile\" });\n\nexport const completeSourceMapsRequest = z\n .object({\n files: z.array(completeSourceMapFile),\n sourceFileCount: z.number().int().nonnegative().optional(),\n bundler: manifestBundlerSchema,\n })\n .meta({\n id: \"CompleteSourceMapsRequest\",\n title: \"CompleteSourceMapsRequest\",\n description:\n \"Finalizes a presigned-URL upload batch. Writes the source-map manifest and updates the release's `sourceMapCount` / `sourceFileCount`. Idempotent — safe to retry.\",\n });\n\nexport type CompleteSourceMapsRequest = z.infer<\n typeof completeSourceMapsRequest\n>;\n\nexport const completeSourceMapsResponse = z\n .object({\n ok: z.boolean(),\n fileCount: z.number().int().nonnegative(),\n })\n .meta({\n id: \"CompleteSourceMapsResponse\",\n title: \"CompleteSourceMapsResponse\",\n });\n\nexport type CompleteSourceMapsResponse = z.infer<\n typeof completeSourceMapsResponse\n>;\n"],"mappings":"wBAkBA,MAAa,EAAwB,EAClC,KAAK,CAAC,UAAW,YAAa,MAAM,CAAC,CACrC,KAAK,CAAE,GAAI,kBAAmB,MAAO,kBAAmB,CAAC,CAItD,EAA+B,EAAE,OAAO,CAgB5C,SAAU,EAAE,QAAQ,CAOpB,QAAS,EAAE,QAAQ,CAEnB,UAAW,EAAE,QAAQ,CAErB,QAAS,EAAE,QAAQ,CACpB,CAAC,CAEW,EAA0B,EAAE,OAAO,CAC9C,YAAa,EAAE,QAAQ,CACvB,UAAW,EAAE,QAAQ,CACrB,eAAgB,EAAE,QAAQ,CAC1B,QAAS,EACT,UAAW,EAAE,QAAQ,CACrB,MAAO,EAAE,MAAM,EAA6B,CAC7C,CAAC,CAaW,EAAuB,EACjC,OAAO,CACN,KAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CACvB,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,QAAQ,CAMnB,SAAU,EAAE,QAAQ,CACrB,CAAC,CACD,KAAK,CAAE,GAAI,uBAAwB,MAAO,uBAAwB,CAAC,CAgBzD,EAA2B,EACrC,OAAO,CACN,QAAS,EAAE,MAAM,EAAqB,CACtC,gBAAiB,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAC1D,QAAS,EACV,CAAC,CACD,KAAK,CACJ,GAAI,2BACJ,MAAO,2BACP,YAAa,yDACd,CAAC,CAIS,EAA2B,EACrC,OAAO,CACN,GAAI,EAAE,SAAS,CACf,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CACzC,QAAS,EAAE,QAAQ,CACnB,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAC1C,CAAC,CACD,KAAK,CAAE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,UAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAC1C,CAAC,CACD,KAAK,CACJ,GAAI,6BACJ,MAAO,6BACR,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.mts","names":[],"sources":["../../src/events/error.ts"],"mappings":";;;cA4BM,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAQnB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;cAId,mBAAA,EAAmB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KAKpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAC/B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAC/B,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAMrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyElB,kBAAA,EAAkB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKnB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.mjs","names":[],"sources":["../../src/events/error.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ingestedFrame } from \"#data/frame\";\n\n/**\n * One stack frame after enrichment's source-map resolution stage.\n *\n * Discriminated on `resolved` — when source-map resolution succeeded\n * (`resolved: true`) the `original*` fields carry the post-resolution\n * positions; the `file` / `line` / `column` / `fn` fields keep the\n * pre-resolution (minified) positions for debugging. When resolution\n * couldn't run (`resolved: false`) the only positions available are\n * the pre-resolution ones, and the `original*` fields aren't on the\n * shape — the type system enforces it.\n *\n * `ingestedId` references back to the originating `IngestedFrame.id`\n * so consumers can pair pre/post-resolution frames without relying\n * on array index.\n */\nconst baseEnrichedFrameSchema = z.object({\n ingestedId: z.string(),\n inApp: z.boolean(),\n file: z.string().nullable(),\n line: z.number().nullable(),\n column: z.number().nullable(),\n fn: z.string().nullable(),\n});\n\nconst resolvedFrameSchema = baseEnrichedFrameSchema.extend({\n resolved: z.literal(true),\n originalFile: z.string().nullable(),\n originalLine: z.number().nullable(),\n originalColumn: z.number().nullable(),\n originalName: z.string().nullable(),\n});\n\nconst unresolvedFrameSchema = baseEnrichedFrameSchema.extend({\n resolved: z.literal(false),\n});\n\nexport const enrichedFrameSchema = z.discriminatedUnion(\"resolved\", [\n resolvedFrameSchema,\n unresolvedFrameSchema,\n]);\n\nexport type EnrichedFrame = z.infer<typeof enrichedFrameSchema>;\nexport type ResolvedFrame = z.infer<typeof resolvedFrameSchema>;\nexport type UnresolvedFrame = z.infer<typeof unresolvedFrameSchema>;\n\nexport const errorMechanismSchema = z.object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n});\n\nexport type ErrorMechanism = z.infer<typeof errorMechanismSchema>;\n\nexport const errorContextSchema = z.object({\n framework: z.string().optional(),\n routerKind: z.enum([\"Pages Router\", \"App Router\"]).optional(),\n routePath: z.string().optional(),\n routeType: z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .optional(),\n renderSource: z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .optional(),\n revalidateReason: z.enum([\"on-demand\", \"stale\"]).optional(),\n renderType: z.enum([\"dynamic\", \"dynamic-resume\"]).optional(),\n requestPath: z.string().optional(),\n requestMethod: z.string().optional(),\n errorDigest: z.string().optional(),\n});\n\n/**\n * Wire-shape payload for an exception event captured by the SDK.\n * Discriminated on `capture`:\n *\n * - `\"error\"` — a real `Error` (or string coerced to one). Carries\n * parsed `frames` and the standard `name` / `message` / `stack`.\n * Production RSC sanitisation may reduce stack to just the header,\n * in which case the collector's stack parser drops the frames.\n *\n * - `\"non-error\"` — `Promise.reject({...})`, `Promise.reject(42)`,\n * etc. The frames here are from the catch site (where the rejection\n * was observed) since the rejected value carries no stack of its\n * own; the original payload rides on `serialized` so dashboards +\n * agent can render the structured value directly.\n *\n * The discriminator name (`capture`) is distinct from the\n * `ClassifierInput.event.kind` discriminator (which says \"this is a\n * triage flow for errors\"). `capture` says \"how the SDK saw it\".\n */\nconst errorPayloadCommonSchema = z.object({\n message: z.string().nullable(),\n name: z.string().nullable(),\n stack: z.string().nullable(),\n context: errorContextSchema.optional(),\n mechanism: errorMechanismSchema.optional(),\n captureSource: z.string().optional(),\n runtime: z.string().optional(),\n frames: z.array(ingestedFrame),\n});\n\nconst errorPayloadFromErrorSchema = errorPayloadCommonSchema.extend({\n capture: z.literal(\"error\"),\n});\n\nconst errorPayloadFromNonErrorSchema = errorPayloadCommonSchema.extend({\n capture: z.literal(\"non-error\"),\n /**\n * Original rejected payload preserved verbatim, depth-bounded +\n * circular-safe — see `serializeBoundedDepth` in\n * `@interfere/types/sdk/errors`. Only present on the `non-error`\n * variant; the type system prevents reading it on error-shaped\n * captures.\n *\n * Typed as `z.json()` (recursive JSON-encodable union) rather than\n * `z.unknown()` so the wire schema honestly advertises that this\n * field is always JSON-serializable — `serializeBoundedDepth` is\n * the source of that invariant. Reflects properly into JSON Schema\n * as well, where `z.unknown()` would emit `{}` (\"any value\").\n */\n serialized: z.json(),\n});\n\nexport const errorPayloadSchema = z.discriminatedUnion(\"capture\", [\n errorPayloadFromErrorSchema,\n errorPayloadFromNonErrorSchema,\n]);\n\nexport type ErrorPayload = z.infer<typeof errorPayloadSchema>;\n"],"mappings":"oEAmBA,MAAM,EAA0B,EAAE,OAAO,CACvC,WAAY,EAAE,QAAQ,CACtB,MAAO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O,CACxC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC5B,QAAS,EAAmB,UAAU,CACtC,UAAW,EAAqB,UAAU,CAC1C,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,OAAQ,EAAE,MAAM,EAAc,CAC/B,CAAC,CAEI,EAA8B,EAAyB,OAAO,CAClE,QAAS,EAAE,QAAQ,QAAQ,CAC5B,CAAC,CAEI,EAAiC,EAAyB,OAAO,CACrE,QAAS,EAAE,QAAQ,YAAY,CAc/B,WAAY,EAAE,MAAM,CACrB,CAAC,CAEW,EAAqB,EAAE,mBAAmB,UAAW,CAChE,EACA,EACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageleave.d.mts","names":[],"sources":["../../src/events/pageleave.ts"],"mappings":";;;cAEa,2BAAA,EAA2B,CAAA,CAAA,SAAA;;;;;;KAO5B,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,2BAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageleave.mjs","names":[],"sources":["../../src/events/pageleave.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageleaveFactsPayloadSchema = z.object({\n url: z.url(),\n durationMs: z.number().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageleaveFactsPayload = z.infer<typeof pageleaveFactsPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAA8B,EAAE,OAAO,CAClD,IAAK,EAAE,KAAK,CACZ,WAAY,EAAE,QAAQ,CAAC,UAAU,CACjC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAC5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageview.d.mts","names":[],"sources":["../../src/events/pageview.ts"],"mappings":";;;cAEa,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;KAY3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageview.mjs","names":[],"sources":["../../src/events/pageview.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const pageviewFactsPayloadSchema = z.object({\n url: z.url(),\n title: z.string().optional(),\n // `referrer` is `document.referrer`, which is \"\" (empty string)\n // when navigation came from a non-referring source — RFC-ish URL\n // validation would reject those legitimate cases. Keep as plain\n // string and validate at consumption sites that need it.\n referrer: z.string().optional(),\n runtime: z.string().optional(),\n releaseId: z.string().nullable().optional(),\n});\n\nexport type PageviewFactsPayload = z.infer<typeof pageviewFactsPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAA6B,EAAE,OAAO,CACjD,IAAK,EAAE,KAAK,CACZ,MAAO,EAAE,QAAQ,CAAC,UAAU,CAK5B,SAAU,EAAE,QAAQ,CAAC,UAAU,CAC/B,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAC5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/integrations/index.ts"],"mappings":";;;cAKa,yBAAA,EAAyB,CAAA,CAAA,SAAA;;;;;;cAazB,2BAAA,EAA2B,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;KAI5B,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,2BAAA;AAAA,cAEtC,8BAAA,EAA8B,CAAA,CAAA,SAAA;;;;;;;;;cAgB9B,gCAAA,EAAgC,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;KAIjC,0BAAA,GAA6B,CAAA,CAAE,KAAA,QAClC,gCAAA;AAAA,cAGI,oBAAA,EAAoB,CAAA,CAAA,OAAA;;;KAGrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,yBAAA,EAAyB,CAAA,CAAA,OAAA;;;KAG1B,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,yBAAA;AAAA,cAQpC,sBAAA;AAAA,cAQA,2BAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/integrations/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { githubSourceIdEnvKeys } from \"./platforms/github.js\";\nimport { vercelDestinationIdEnvKeys } from \"./platforms/vercel.js\";\n\nexport const githubReleaseSourceSchema = z\n .object({\n provider: z.literal(\"github\"),\n commitMessage: z.string(),\n branch: z.string(),\n commitSha: z.string().nullable(),\n })\n .meta({\n id: \"GithubReleaseSource\",\n title: \"GithubReleaseSource\",\n description: \"Release source metadata coming from GitHub.\",\n });\n\nexport const releaseSourceMetadataSchema = z\n .discriminatedUnion(\"provider\", [githubReleaseSourceSchema])\n .meta({ id: \"ReleaseSource\", title: \"ReleaseSource\" });\n\nexport type ReleaseSourceMetadata = z.infer<typeof releaseSourceMetadataSchema>;\n\nexport const vercelReleaseDestinationSchema = z\n .object({\n provider: z.literal(\"vercel\"),\n destinationReleaseId: z.string().nullable(),\n environment: z.string().nullable(),\n deploymentId: z.string().nullable(),\n deploymentUrl: z.string().nullable(),\n environmentName: z.string().nullable(),\n environmentTarget: z.string().nullable(),\n })\n .meta({\n id: \"VercelReleaseDestination\",\n title: \"VercelReleaseDestination\",\n description: \"Release destination metadata for a Vercel deployment.\",\n });\n\nexport const releaseDestinationMetadataSchema = z\n .discriminatedUnion(\"provider\", [vercelReleaseDestinationSchema])\n .meta({ id: \"ReleaseDestination\", title: \"ReleaseDestination\" });\n\nexport type ReleaseDestinationMetadata = z.infer<\n typeof releaseDestinationMetadataSchema\n>;\n\nexport const sourceProviderSchema = z\n .enum([\"github\"])\n .meta({ id: \"SourceProvider\", title: \"SourceProvider\" });\nexport type SourceProvider = z.infer<typeof sourceProviderSchema>;\n\nexport const destinationProviderSchema = z\n .enum([\"vercel\"])\n .meta({ id: \"DestinationProvider\", title: \"DestinationProvider\" });\nexport type DestinationProvider = z.infer<typeof destinationProviderSchema>;\n\nconst releaseSourceIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_BUILD_ID\",\n \"INTERFERE_SOURCE_ID\",\n \"NEXT_BUILD_ID\",\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseSourceIdEnvKeys = releaseSourceIdEnvKeySchema.options;\n\nconst releaseDestinationIdEnvKeySchema = z.enum([\n \"NEXT_PUBLIC_INTERFERE_RELEASE_ID\",\n \"INTERFERE_DESTINATION_ID\",\n ...vercelDestinationIdEnvKeys,\n ...githubSourceIdEnvKeys,\n]);\nexport const releaseDestinationIdEnvKeys =\n releaseDestinationIdEnvKeySchema.options;\n"],"mappings":"2JAKA,MAAa,EAA4B,EACtC,OAAO,CACN,SAAU,EAAE,QAAQ,SAAS,CAC7B,cAAe,EAAE,QAAQ,CACzB,OAAQ,EAAE,QAAQ,CAClB,UAAW,EAAE,QAAQ,CAAC,UAAU,CACjC,CAAC,CACD,KAAK,CACJ,GAAI,sBACJ,MAAO,sBACP,YAAa,8CACd,CAAC,CAES,EAA8B,EACxC,mBAAmB,WAAY,CAAC,EAA0B,CAAC,CAC3D,KAAK,CAAE,GAAI,gBAAiB,MAAO,gBAAiB,CAAC,CAI3C,EAAiC,EAC3C,OAAO,CACN,SAAU,EAAE,QAAQ,SAAS,CAC7B,qBAAsB,EAAE,QAAQ,CAAC,UAAU,CAC3C,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,aAAc,EAAE,QAAQ,CAAC,UAAU,CACnC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,kBAAmB,EAAE,QAAQ,CAAC,UAAU,CACzC,CAAC,CACD,KAAK,CACJ,GAAI,2BACJ,MAAO,2BACP,YAAa,wDACd,CAAC,CAES,EAAmC,EAC7C,mBAAmB,WAAY,CAAC,EAA+B,CAAC,CAChE,KAAK,CAAE,GAAI,qBAAsB,MAAO,qBAAsB,CAAC,CAMrD,EAAuB,EACjC,KAAK,CAAC,SAAS,CAAC,CAChB,KAAK,CAAE,GAAI,iBAAkB,MAAO,iBAAkB,CAAC,CAG7C,EAA4B,EACtC,KAAK,CAAC,SAAS,CAAC,CAChB,KAAK,CAAE,GAAI,sBAAuB,MAAO,sBAAuB,CAAC,CASvD,EANuB,EAAE,KAAK,CACzC,iCACA,sBACA,gBACA,GAAG,EACJ,CACqC,CAA4B,QAQrD,EAN4B,EAAE,KAAK,CAC9C,mCACA,2BACA,GAAG,EACH,GAAG,EACJ,CAEC,CAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"github.d.mts","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"mappings":";;;cAMa,qBAAA;AAAA,cAEA,iBAAA,EAAiB,CAAA,CAAA,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"github.mjs","names":[],"sources":["../../../src/integrations/platforms/github.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst githubSourceIdEnvKeySchema = z.enum([\n \"VERCEL_GIT_COMMIT_SHA\",\n \"GITHUB_SHA\",\n]);\nexport const githubSourceIdEnvKeys = githubSourceIdEnvKeySchema.options;\n\nexport const githubIntegration = z.object({\n name: z.literal(\"github\"),\n metadata: z.object({\n accountType: z.string(),\n avatarUrl: z.string().nullable().default(null),\n repositories: z.record(z.string(), z.string()),\n installationUrl: z.string().nullable(),\n }),\n});\n"],"mappings":"wBAMA,MAAa,EAJsB,EAAE,KAAK,CACxC,wBACA,aACD,CACoC,CAA2B,QAEnD,EAAoB,EAAE,OAAO,CACxC,KAAM,EAAE,QAAQ,SAAS,CACzB,SAAU,EAAE,OAAO,CACjB,YAAa,EAAE,QAAQ,CACvB,UAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CAC9C,aAAc,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,QAAQ,CAAC,CAC9C,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACvC,CAAC,CACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slack.d.mts","names":[],"sources":["../../../src/integrations/platforms/slack.ts"],"mappings":";;;cAEa,sBAAA,EAAsB,CAAA,CAAA,OAAA;;;;;KAKvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,cAEjC,2BAAA,EAA2B,CAAA,CAAA,SAAA;;;;KAI5B,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,2BAAA;AAAA,cAEtC,gBAAA,EAAgB,CAAA,CAAA,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slack.mjs","names":[],"sources":["../../../src/integrations/platforms/slack.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const routableCategorySchema = z.enum([\n \"problems\",\n \"team\",\n \"collaboration\",\n]);\nexport type RoutableCategory = z.infer<typeof routableCategorySchema>;\n\nexport const slackChatRoutingEntrySchema = z.object({\n channelId: z.string(),\n channelName: z.string(),\n});\nexport type SlackChatRoutingEntry = z.infer<typeof slackChatRoutingEntrySchema>;\n\nexport const slackIntegration = z.object({\n name: z.literal(\"slack\"),\n metadata: z.object({\n teamId: z.string(),\n teamName: z.string(),\n installationUrl: z.string().nullable(),\n chatRouting: z\n .partialRecord(routableCategorySchema, slackChatRoutingEntrySchema)\n .default({}),\n }),\n});\n"],"mappings":"wBAEA,MAAa,EAAyB,EAAE,KAAK,CAC3C,WACA,OACA,gBACD,CAAC,CAGW,EAA8B,EAAE,OAAO,CAClD,UAAW,EAAE,QAAQ,CACrB,YAAa,EAAE,QAAQ,CACxB,CAAC,CAGW,EAAmB,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,QAAQ,CACxB,SAAU,EAAE,OAAO,CACjB,OAAQ,EAAE,QAAQ,CAClB,SAAU,EAAE,QAAQ,CACpB,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,YAAa,EACV,cAAc,EAAwB,EAA4B,CAClE,QAAQ,EAAE,CAAC,CACf,CAAC,CACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel.d.mts","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"mappings":";;;cAGa,0BAAA;AAAA,cAUA,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;cAMlB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;cAYlB,iBAAA,EAAiB,CAAA,CAAA,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel.mjs","names":[],"sources":["../../../src/integrations/platforms/vercel.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst vercelDestinationIdEnvKeySchema = z.enum([\"VERCEL_DEPLOYMENT_ID\"]);\nexport const vercelDestinationIdEnvKeys =\n vercelDestinationIdEnvKeySchema.options;\n\nconst vercelMetadataBase = z.object({\n avatar: z.string().nullable().default(null),\n name: z.string().nullable().default(null),\n installationUrl: z.string().nullable(),\n projects: z.record(z.string(), z.string()).default({}),\n});\n\nexport const vercelTeamMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"team\"),\n id: z.string(),\n slug: z.string(),\n});\n\nexport const vercelUserMetadata = vercelMetadataBase.extend({\n accountType: z.literal(\"user\"),\n id: z.string(),\n username: z.string(),\n email: z.string(),\n});\n\nconst vercelMetadataSchema = z.discriminatedUnion(\"accountType\", [\n vercelTeamMetadata,\n vercelUserMetadata,\n]);\n\nexport const vercelIntegration = z.object({\n name: z.literal(\"vercel\"),\n metadata: vercelMetadataSchema,\n});\n"],"mappings":"wBAGA,MAAa,EAD2B,EAAE,KAAK,CAAC,uBAAuB,CAErE,CAAgC,QAE5B,EAAqB,EAAE,OAAO,CAClC,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CAC3C,KAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,KAAK,CACzC,gBAAiB,EAAE,QAAQ,CAAC,UAAU,CACtC,SAAU,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CACvD,CAAC,CAEW,EAAqB,EAAmB,OAAO,CAC1D,YAAa,EAAE,QAAQ,OAAO,CAC9B,GAAI,EAAE,QAAQ,CACd,KAAM,EAAE,QAAQ,CACjB,CAAC,CAEW,EAAqB,EAAmB,OAAO,CAC1D,YAAa,EAAE,QAAQ,OAAO,CAC9B,GAAI,EAAE,QAAQ,CACd,SAAU,EAAE,QAAQ,CACpB,MAAO,EAAE,QAAQ,CAClB,CAAC,CAEI,EAAuB,EAAE,mBAAmB,cAAe,CAC/D,EACA,EACD,CAAC,CAEW,EAAoB,EAAE,OAAO,CACxC,KAAM,EAAE,QAAQ,SAAS,CACzB,SAAU,EACX,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"definition.d.mts","names":[],"sources":["../../src/releases/definition.ts"],"mappings":";;;cAQa,mBAAA,EAAmB,CAAA,CAAA,OAAA;;;;;;;KAIpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAgB9B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;KAsBrB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAErC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KA4BtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"definition.mjs","names":[],"sources":["../../src/releases/definition.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport {\n releaseDestinationMetadataSchema,\n releaseSourceMetadataSchema,\n} from \"../integrations\";\nimport { releaseSlugSchema } from \"./slug\";\n\nexport const releaseStatusSchema = z\n .enum([\"pending\", \"building\", \"ready\", \"errored\", \"canceled\"])\n .meta({ id: \"ReleaseStatus\", title: \"ReleaseStatus\" });\n\nexport type ReleaseStatus = z.infer<typeof releaseStatusSchema>;\n\nconst orgRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"OrgRef\", title: \"OrgRef\" });\n\nconst surfaceRefSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n })\n .meta({ id: \"SurfaceRef\", title: \"SurfaceRef\" });\n\nexport const createReleaseRequest = z\n .object({\n source: releaseSourceMetadataSchema,\n destination: releaseDestinationMetadataSchema.nullable(),\n buildId: z.string(),\n /**\n * Client-supplied release slug. The SDK build plugin derives this from\n * the commit SHA (`rel_<first 16 hex>`) and stamps it into the bundle\n * as `__INTERFERE_RELEASE_SLUG__`, so server and client converge on the\n * same value with no shared secret. Optional only so direct API\n * callers (integration tests, scripts) can omit it; in that case the\n * server derives the same value from `buildId`.\n */\n slug: z.string().optional(),\n producerVersion: z.string().optional(),\n })\n .meta({\n id: \"CreateReleaseRequest\",\n title: \"CreateReleaseRequest\",\n description: \"Request body for creating a release.\",\n });\n\nexport type CreateReleaseRequest = z.infer<typeof createReleaseRequest>;\n\nexport const createReleaseResponse = z\n .object({\n org: orgRefSchema,\n surface: surfaceRefSchema,\n source: z\n .object({\n id: z.string(),\n })\n .meta({ id: \"ReleaseSourceRef\", title: \"ReleaseSourceRef\" }),\n destination: z\n .object({\n id: z.string(),\n slug: releaseSlugSchema,\n environment: z.string().nullable(),\n })\n .meta({ id: \"ReleaseDestinationRef\", title: \"ReleaseDestinationRef\" }),\n build: z\n .object({\n hash: z.string(),\n })\n .meta({ id: \"ReleaseBuildRef\", title: \"ReleaseBuildRef\" }),\n })\n .meta({\n id: \"CreateReleaseResponse\",\n title: \"CreateReleaseResponse\",\n description: \"Response body returned after creating a release.\",\n });\n\nexport type CreateReleaseResponse = z.infer<typeof createReleaseResponse>;\n"],"mappings":"qLAQA,MAAa,EAAsB,EAChC,KAAK,CAAC,UAAW,WAAY,QAAS,UAAW,WAAW,CAAC,CAC7D,KAAK,C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CAAE,KAAA,QAAa,iBAAA;AAJzC;;;;;;;;;;;AAIA;;;AAJA,iBAoBgB,iBAAA,CAAkB,SAAA,WAAoB,WAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"slug.mjs","names":[],"sources":["../../src/releases/slug.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst SLUG_PREFIX = \"rel_\";\nconst SLUG_HEX_LEN = 16;\n\nexport const releaseSlugSchema = z\n .templateLiteral([SLUG_PREFIX, z.string().regex(/^[0-9a-f]{16}$/)])\n .brand<\"ReleaseSlug\">();\n\nexport type ReleaseSlug = z.infer<typeof releaseSlugSchema>;\n\n/**\n * Derives a release slug from a commit SHA. Both ends of the wire — the\n * build step that stamps the slug into the bundle, and any server-side\n * upsert that reaches the same commit — compute the same `rel_<16hex>`\n * shape with no shared secret, so no round-trip negotiation is needed.\n *\n * Git commit SHAs are uniformly distributed hex; the leading 16 chars give\n * 64 bits of entropy, which is the same width the collector regex enforces.\n * Cross-surface collisions on the same commit are intentional (eyeball-\n * correlate slug to commit) — lookups are scoped by `(surfaceId, slug)`.\n *\n * Return type is `ReleaseSlug` (template-literal branded) so consumers\n * can pass the result into branded sites without a re-validate.\n */\nexport function deriveReleaseSlug(commitSha: string): ReleaseSlug {\n return releaseSlugSchema.parse(\n `${SLUG_PREFIX}${commitSha.toLowerCase().slice(0, SLUG_HEX_LEN)}`\n );\n}\n"],"mappings":"wBAEA,MAAM,EAAc,OAGP,EAAoB,EAC9B,gBAAgB,CAAC,EAAa,EAAE,QAAQ,CAAC,MAAM,iBAAiB,CAAC,CAAC,CAClE,OAAsB,CAkBzB,SAAgB,EAAkB,EAAgC,CAChE,OAAO,EAAkB,MACvB,GAAG,IAAc,EAAU,aAAa,CAAC,MAAM,EAAG,GAAa,GAChE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.mts","names":[],"sources":["../../src/sdk/env.ts"],"mappings":";iBAIgB,aAAA,CAAc,KAAA;AAAA,iBASd,iBAAA,CACd,GAAA,EAAK,MAAA,8BACL,IAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.mjs","names":[],"sources":["../../src/sdk/env.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst interfereEnvValueSchema = z.string().trim().min(1);\n\nexport function parseEnvValue(value: unknown) {\n const parsed = interfereEnvValueSchema.safeParse(value);\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n}\n\nexport function readFirstEnvValue(\n env: Record<string, string | undefined>,\n keys: readonly string[]\n) {\n for (const key of keys) {\n const value = parseEnvValue(env[key]);\n if (value !== null) {\n return value;\n }\n }\n\n return null;\n}\n"],"mappings":"wBAEA,MAAM,EAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAExD,SAAgB,EAAc,EAAgB,CAC5C,IAAM,EAAS,EAAwB,UAAU,EAAM,CAKvD,OAJK,EAAO,QAIL,EAAO,KAHL,KAMX,SAAgB,EACd,EACA,EACA,CACA,IAAK,IAAM,KAAO,EAAM,CACtB,IAAM,EAAQ,EAAc,EAAI,GAAK,CACrC,GAAI,IAAU,KACZ,OAAO,EAIX,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"envelope.d.mts","names":[],"sources":["../../src/sdk/envelope.ts"],"mappings":";;;;;AAyBA;;;;;;cAAa,mBAAA,EAAmB,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;;KASpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAE9B,qBAAA,EAAqB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAatB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAiBhC,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAetB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,KAEvB,SAAA,GAAY,YAAA;AAAA,KAEZ,QAAA,WAAmB,SAAA,4BAC7B,CAAA,SAAU,SAAA,GAAY,OAAA,CAAQ,YAAA;EAAgB,IAAA,EAAM,CAAA;AAAA,KAAO,YAAA;AAAA,KAEjD,eAAA,WAA0B,SAAA,IAAa,QAAA,CAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"envelope.mjs","names":[],"sources":["../../src/sdk/envelope.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { sessionIdSchema } from \"#data/session\";\nimport { browserContextSchema } from \"#sdk/plugins/context/browser\";\nimport { edgeContextSchema } from \"#sdk/plugins/context/edge\";\nimport { nextjsContextSchema } from \"#sdk/plugins/context/next\";\nimport { nodeContextSchema } from \"#sdk/plugins/context/node\";\nimport { errorEnvelopePayloadSchema } from \"#sdk/plugins/payload/errors\";\nimport {\n pageleavePayloadSchema,\n pageviewPayloadSchema,\n uiEventPayloadSchema,\n} from \"#sdk/plugins/payload/page-events\";\nimport { rageClickPayloadSchema } from \"#sdk/plugins/payload/rage-click\";\nimport { replayChunkPayloadSchema } from \"#sdk/plugins/payload/replay\";\nimport { envSchema, runtimeSchema } from \"#sdk/runtime\";\n\n/**\n * Indicates how the sessionId was resolved on the server.\n *\n * - \"header\": Extracted from x-interfere-request header (ideal case)\n * - \"async_context\": Retrieved from AsyncLocalStorage context\n * - \"fallback\": Generated as server-side fallback (breaks session continuity)\n * - \"client\": Session ID was set on the client (browser SDK)\n */\nexport const sessionSourceSchema = z\n .enum([\"header\", \"async_context\", \"fallback\", \"client\"])\n .optional()\n .meta({\n id: \"SessionSource\",\n title: \"SessionSource\",\n description: \"How the server resolved the sessionId for this envelope.\",\n });\n\nexport type SessionSource = z.infer<typeof sessionSourceSchema>;\n\nexport const envelopeContextSchema = z\n .discriminatedUnion(\"runtime\", [\n browserContextSchema,\n nextjsContextSchema,\n edgeContextSchema,\n nodeContextSchema,\n ])\n .meta({\n id: \"EnvelopeContext\",\n title: \"EnvelopeContext\",\n description: \"Runtime-specific request context attached to every envelope.\",\n });\n\nexport type EnvelopeContext = z.infer<typeof envelopeContextSchema>;\n\nconst envelopeHeadersShape = {\n buildId: z.string(),\n clientTs: z.int(),\n context: envelopeContextSchema.optional(),\n environment: envSchema,\n producerVersion: z.string().optional(),\n releaseId: z.string().nullable(),\n runtime: runtimeSchema,\n sdkStack: z.array(z.string()).optional(),\n sessionId: sessionIdSchema.nullable(),\n sessionSource: sessionSourceSchema,\n uuid: z.uuidv7(),\n v: z.literal(0),\n} as const;\n\nexport const errorEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"error\"),\n payload: errorEnvelopePayloadSchema,\n })\n .meta({ id: \"ErrorEnvelope\", title: \"ErrorEnvelope\" });\n\nexport const pageviewEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"pageview\"),\n payload: pageviewPayloadSchema,\n })\n .meta({ id: \"PageviewEnvelope\", title: \"PageviewEnvelope\" });\n\nexport const pageleaveEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"pageleave\"),\n payload: pageleavePayloadSchema,\n })\n .meta({ id: \"PageleaveEnvelope\", title: \"PageleaveEnvelope\" });\n\nexport const uiEventEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"ui_event\"),\n payload: uiEventPayloadSchema,\n })\n .meta({ id: \"UiEventEnvelope\", title: \"UiEventEnvelope\" });\n\nexport const replayChunkEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"replay_chunk\"),\n payload: replayChunkPayloadSchema,\n })\n .meta({ id: \"ReplayChunkEnvelope\", title: \"ReplayChunkEnvelope\" });\n\nexport const rageClickEnvelopeSchema = z\n .object({\n ...envelopeHeadersShape,\n type: z.literal(\"rage_click\"),\n payload: rageClickPayloadSchema,\n })\n .meta({ id: \"RageClickEnvelope\", title: \"RageClickEnvelope\" });\n\nexport const envelopeSchema = z\n .discriminatedUnion(\"type\", [\n errorEnvelopeSchema,\n pageviewEnvelopeSchema,\n pageleaveEnvelopeSchema,\n uiEventEnvelopeSchema,\n replayChunkEnvelopeSchema,\n rageClickEnvelopeSchema,\n ])\n .meta({\n id: \"Envelope\",\n title: \"Envelope\",\n description: \"A single event envelope accepted by the collector.\",\n });\n\ntype EnvelopeBase = z.infer<typeof envelopeSchema>;\n\nexport type EventType = EnvelopeBase[\"type\"];\n\nexport type Envelope<T extends EventType | undefined = undefined> =\n T extends EventType ? Extract<EnvelopeBase, { type: T }> : EnvelopeBase;\n\nexport type EnvelopePayload<T extends EventType> = Envelope<T>[\"payload\"];\n"],"mappings":"4tBAyBA,MAAa,EAAsB,EAChC,KAAK,CAAC,SAAU,gBAAiB,WAAY,SAAS,CAAC,CACvD,UAAU,CACV,KAAK,CACJ,GAAI,gBACJ,MAAO,gBACP,YAAa,2DAC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,KAAM,EAAE,QAAQ,aAAa,CAC7B,QAAS,EACV,CAAC,CACD,KAAK,CAAE,GAAI,oBAAqB,MAAO,oBAAqB,CAAC,CAEnD,EAAiB,EAC3B,mBAAmB,OAAQ,CAC1B,EACA,EACA,EACA,EACA,EACA,EACD,CAAC,CACD,KAAK,CACJ,GAAI,WACJ,MAAO,WACP,YAAa,qDACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/sdk/errors.ts"],"mappings":";;;;;;AAoBA;;;;;;;;;;;;cAAa,cAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;IAiHG;;;;AAgDhB;;;;;AAmEA;;;;;;;iBAlLgB,+BAAA,CACd,MAAA;;;AAmTF;;;;iBA5RgB,2BAAA,CACd,MAAA;;;;;AAgTF;;;;;;;;iBA1QgB,wBAAA,CACd,cAAA,WACC,aAAA;AA6RH;;;;;;;;;;;;;AAAA,iBA/OgB,OAAA,CAAQ,KAAA,YAAiB,KAAA;;;;;;;;;;;;UAmExB,iBAAA;EAAA,SACN,IAAA;;;;;;WAMA,UAAA;;;;;;;WAOA,IAAA;;;;;;WAMA,KAAA;AAAA;;;;;;;;;;;;;iBA8GK,WAAA,CAAY,KAAA,YAAiB,KAAA,GAAQ,iBAAA;AAAA,iBAqBrC,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAA;;;;;;;;;;;;iBAmBI,YAAA,CACd,KAAA,EAAO,KAAA,GAAQ,iBAAA,EACf,SAAA,EAAW,cAAA,GACV,cAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.mjs","names":[],"sources":["../../src/sdk/errors.ts"],"sourcesContent":["import type { IngestedFrame } from \"#data/frame\";\nimport type {\n ErrorMechanism,\n ExceptionValue,\n} from \"#sdk/plugins/payload/errors\";\n\n/**\n * Structured taxonomy of capture sources, tagged onto each\n * `ErrorMechanism.type`. Follows the `auto.<surface>.<library>.<method>`\n * convention Sentry also uses, so downstream analytics / classification can\n * group on common prefixes:\n *\n * `auto.browser.*` — captured by SDK global handlers in the browser\n * `auto.function.*` — captured by SDK functions (boundaries, callbacks,\n * server wrappers)\n *\n * Leaves (`.onerror`, `.error_boundary`, `.on_request_error`, …) identify\n * the specific capture site, which lets the agent's skill classifier reason\n * about what \"kind\" of event this is without string-matching loose names.\n */\nexport const MECHANISM_TYPE = {\n browser: {\n onerror: \"auto.browser.global_handlers.onerror\",\n onunhandledrejection: \"auto.browser.global_handlers.onunhandledrejection\",\n consoleError: \"auto.browser.console.error\",\n },\n react: {\n errorBoundary: \"auto.function.react.error_boundary\",\n captureBoundary: \"auto.function.react.capture_boundary\",\n caughtError: \"auto.function.react.caught_error\",\n uncaughtError: \"auto.function.react.uncaught_error\",\n recoverableError: \"auto.function.react.recoverable_error\",\n },\n nextjs: {\n onRequestError: \"auto.function.nextjs.on_request_error\",\n captureError: \"auto.function.nextjs.capture_error\",\n },\n node: {\n captureError: \"auto.function.node.capture_error\",\n uncaughtException: \"auto.node.global_handlers.uncaught_exception\",\n unhandledRejection: \"auto.node.global_handlers.unhandled_rejection\",\n },\n manual: {\n /** Customer called `capture(error)` from `@interfere/react/api`. */\n capture: \"manual.api.capture\",\n },\n} as const;\n\n/**\n * Browser-extension URL schemes seen in stack-frame `fileName` values.\n * Includes Safari's `webkit-masked-url://` (introduced under ITP to mask\n * the origin of content scripts) — same noise-filtering target as the\n * `*-extension://` schemes.\n */\nconst EXTENSION_URL_RE =\n /\\b(?:chrome|moz|safari-web|safari|ms-browser|webkit-masked)-(?:extension|url):\\/\\//;\n\n/**\n * True when the raw stack mentions any browser-extension URL scheme\n * anywhere. Catches extension-only stacks, extension interceptors\n * (extension frames above app), and app errors whose stack still\n * includes extension code (e.g. extension hydration). Cause-chain\n * variants are caught by passing the chain entries' stacks to this\n * check separately.\n *\n * Server-side parsing has full structured fidelity, but the noise\n * filter runs at capture time before a parsed stack exists — regex\n * over the raw string is sufficient and avoids pulling a parser into\n * the customer bundle.\n */\nexport function shouldDropBrowserExtensionNoise(\n stacks: readonly string[]\n): boolean {\n return stacks.some((stack) => EXTENSION_URL_RE.test(stack));\n}\n\n/**\n * Anchors that prove a stack frame has a real source location: a URL\n * scheme (`https://`, `webpack-internal://`, etc.) or a V8-style\n * `at fn (path:LINE)` parenthesised location. Stacks whose every frame\n * lacks both anchors come from inline `<script>` blocks\n * (`at <anonymous>:N:M`), `eval()` / `new Function()`, CORS-masked\n * cross-origin scripts (`\"Script error.\"`), or browser-internal code —\n * structurally uninvestigatable, so we drop at capture time.\n */\nconst HAS_SOURCE_LOCATION_RE =\n /(?:https?|file|blob|webpack-internal):\\/\\/|\\sat\\s+[\\w$.<>]+\\s+\\([^)]+:\\d/;\n\n/**\n * True when **none** of the supplied stacks (head + cause chain entries)\n * carries any source-location anchor. Non-Error rejections (no stack at\n * all) are exempt at the call site — they ship structured payloads the\n * agent can reason over without frames.\n */\nexport function shouldDropUnresolvableStack(\n stacks: readonly string[]\n): boolean {\n if (stacks.length === 0) {\n return false;\n }\n for (const stack of stacks) {\n if (HAS_SOURCE_LOCATION_RE.test(stack)) {\n return false;\n }\n }\n return true;\n}\n\nconst MAX_CAUSE_DEPTH = 5;\n\n/**\n * Matches one React component-stack line. Captures:\n * 1. component name\n * 2. optional file name (required to have a line number, to avoid matching\n * \"(created by Parent)\" annotations emitted by React 16-18)\n * 3. optional line number\n * 4. optional column number\n */\nconst COMPONENT_STACK_RE =\n /^(?:in|at)\\s+([^\\s(]+)(?:\\s+\\(([^\\s:)]+):(\\d+)(?::(\\d+))?\\))?/;\n\n/**\n * Parses a React `errorInfo.componentStack` string into synthetic frames.\n * Server-side stack parsing handles JS frames; component-stack frames are\n * supplementary context React emits separately and have a different shape,\n * so they're parsed at capture time and shipped via `appendFrames`.\n *\n * React produces different formats across versions:\n * - React 16–18 legacy: ` in ComponentName`\n * ` in ComponentName (created by Parent)`\n * - React 19 owner stacks: ` at ComponentName`\n * ` at ComponentName (file.tsx:10:5)`\n */\nexport function parseReactComponentStack(\n componentStack: string\n): IngestedFrame[] {\n const frames: IngestedFrame[] = [];\n for (const rawLine of componentStack.split(\"\\n\")) {\n const line = rawLine.trim();\n if (!line) {\n continue;\n }\n const match = COMPONENT_STACK_RE.exec(line);\n if (!match) {\n continue;\n }\n const [, name, fileName, lineStr, colStr] = match;\n if (!name) {\n continue;\n }\n const frame: IngestedFrame = {\n id: `react-${frames.length}`,\n fn: name,\n };\n if (fileName) {\n frame.file = fileName;\n }\n if (lineStr) {\n frame.line = Number(lineStr);\n }\n if (colStr) {\n frame.column = Number(colStr);\n }\n frames.push(frame);\n }\n return frames;\n}\n\n/**\n * Coerces any thrown value into an `Error` instance, preferring a nested\n * `Error` inside a plain-object rejection over a stringified fallback.\n *\n * Motivated by the common `Promise.reject({ error: realErr })` pattern\n * (tRPC, GraphQL clients, some fetch wrappers). Without this, the captured\n * exception would be `new Error(\"[object Object]\")` and the nested Error's\n * stack/message would be lost entirely.\n *\n * When multiple candidate Error values exist on the object, the first one\n * found (in declaration order) wins. `cause` is preferred if present, since\n * it's the documented ES2022 convention.\n */\nexport function toError(error: unknown): Error {\n if (error instanceof Error) {\n return error;\n }\n\n if (typeof error === \"string\") {\n return new Error(error);\n }\n\n if (error !== null && typeof error === \"object\") {\n const nested = tryUnwrapNestedError(error as Record<string, unknown>);\n if (nested) {\n return nested;\n }\n\n // No nested Error — preserve the original shape as a JSON-encoded\n // message under a tagged name so downstream readers can tell this\n // came from `Promise.reject({ ... })` rather than a real `Error`\n // instance. Stringification ignores cycles by falling back to the\n // value's `String(...)` representation. Prefer `toException` for\n // new code — it preserves the structured payload as a separate\n // field instead of cramming JSON into the message.\n return tagAsNonError(safeJson(error) ?? String(error));\n }\n\n return tagAsNonError(String(error));\n}\n\nfunction tryUnwrapNestedError(\n record: Record<string, unknown>\n): Error | undefined {\n if (record[\"cause\"] instanceof Error) {\n return record[\"cause\"];\n }\n for (const value of Object.values(record)) {\n if (value instanceof Error) {\n return value;\n }\n }\n return;\n}\n\nfunction tagAsNonError(message: string): Error {\n const e = new Error(message);\n e.name = \"NonError\";\n return e;\n}\n\nfunction safeJson(value: unknown): string | null {\n try {\n return JSON.stringify(value);\n } catch {\n return null;\n }\n}\n\n/**\n * Capture-side variant for thrown values that aren't Errors and don't\n * carry a nested Error (e.g. `Promise.reject({ code: 401, body: \"...\" })`,\n * `Promise.reject(42)`). The structured payload rides on `serialized`\n * so downstream consumers can render the original shape instead of\n * parsing JSON back out of an Error's message string.\n *\n * Strings are *not* represented here — `Promise.reject(\"boom\")` maps\n * cleanly to `new Error(\"boom\")` without lying about the shape, so it\n * goes through `toException`'s Error branch.\n */\nexport interface NonErrorException {\n readonly kind: \"non-error\";\n /**\n * Original payload, depth-bounded and circular-safe. Anything beyond\n * `MAX_NON_ERROR_DEPTH` is collapsed to `\"[depth-limit]\"`; circular\n * back-edges become `\"[circular]\"`. Primitives pass through unchanged.\n */\n readonly serialized: unknown;\n /**\n * Stable label for grouping. `\"PlainObject\"` / `\"Array\"` / `\"number\"`\n * etc. — derived from the value's structural class, not its content,\n * so two `Promise.reject({ code: 401 })` calls land in the same group\n * regardless of which keys the object carries.\n */\n readonly type: string;\n /**\n * Best-effort one-liner. For objects: a sorted list of keys. For\n * primitives: `String(value)`. The dashboard shows this; the\n * `serialized` field carries the actual payload.\n */\n readonly value: string;\n}\n\n/**\n * Maximum depth `serializeBoundedDepth` recurses into nested objects /\n * arrays before collapsing the rest to `\"[depth-limit]\"`. 4 covers\n * typical fetch-error shapes (`{ response: { headers: { ... } } }`)\n * without giving an attacker a way to exhaust memory by sending us a\n * deeply nested payload.\n */\nconst MAX_NON_ERROR_DEPTH = 4;\n\nconst DEPTH_LIMIT_SENTINEL = \"[depth-limit]\";\nconst CIRCULAR_SENTINEL = \"[circular]\";\n\n/**\n * Returns a label suitable for grouping. Mirrors `Object.prototype.toString`'s\n * `[object X]` tag for objects (so plain objects, arrays, dates, regexes\n * and custom classes all get distinct stable labels) and falls back to\n * `typeof` for primitives.\n */\nfunction classify(value: unknown): string {\n if (value === null) {\n return \"null\";\n }\n const t = typeof value;\n if (t !== \"object\") {\n return t;\n }\n // `[object Foo]` → `Foo`. Custom classes inherit the default `Object`\n // tag unless they override `Symbol.toStringTag`; that's fine for\n // grouping — we want the structural class, not the constructor name.\n const tag = Object.prototype.toString.call(value).slice(8, -1);\n return tag === \"Object\" ? \"PlainObject\" : tag;\n}\n\n/**\n * Best-effort one-liner description. For objects, lists the sorted keys\n * so two same-shaped rejections render identically regardless of\n * attribute ordering. For primitives, `String(value)`.\n */\nfunction describe(value: unknown): string {\n if (value === null || value === undefined) {\n return `Non-Error captured: ${String(value)}`;\n }\n if (typeof value === \"object\") {\n const keys = Object.keys(value as object).sort();\n if (keys.length === 0) {\n return \"Non-Error captured: empty object\";\n }\n return `Non-Error captured with keys: ${keys.join(\", \")}`;\n }\n return `Non-Error captured: ${String(value)}`;\n}\n\n/**\n * Depth-bounded, circular-safe clone. Primitives + null/undefined pass\n * through as-is. Objects and arrays recurse up to `MAX_NON_ERROR_DEPTH`\n * before collapsing to `DEPTH_LIMIT_SENTINEL`; back-edges become\n * `CIRCULAR_SENTINEL`. Functions, symbols, and other non-serialisable\n * values are coerced via `String(...)` so the dashboard can render\n * something rather than dropping the field.\n */\nfunction serializeBoundedDepth(value: unknown, maxDepth: number): unknown {\n const seen = new WeakSet<object>();\n const walk = (current: unknown, depth: number): unknown => {\n if (current === null) {\n return null;\n }\n const t = typeof current;\n if (t === \"string\" || t === \"number\" || t === \"boolean\") {\n return current;\n }\n if (t === \"undefined\") {\n return;\n }\n if (t === \"function\" || t === \"symbol\" || t === \"bigint\") {\n return String(current);\n }\n if (depth > maxDepth) {\n return DEPTH_LIMIT_SENTINEL;\n }\n if (seen.has(current as object)) {\n return CIRCULAR_SENTINEL;\n }\n seen.add(current as object);\n if (Array.isArray(current)) {\n return current.map((item) => walk(item, depth + 1));\n }\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(current as Record<string, unknown>)) {\n out[k] = walk(v, depth + 1);\n }\n return out;\n };\n return walk(value, 0);\n}\n\n/**\n * Coerces any thrown value into either an `Error` (when one is\n * recoverable — direct Error, or nested Error inside an object via\n * `cause` / first-Error-valued property — or a string, which maps\n * cleanly to `new Error(str)`) or a structured `NonErrorException`\n * carrying the original payload.\n *\n * Replaces `toError` for capture sites that handle both branches\n * (today: `unhandledrejection`). `toError` is kept for callers that\n * specifically need an `Error` (`<ErrorBoundary>` interop, browser\n * APIs that take Error-typed args).\n */\nexport function toException(value: unknown): Error | NonErrorException {\n if (value instanceof Error) {\n return value;\n }\n if (typeof value === \"string\") {\n return new Error(value);\n }\n if (value !== null && typeof value === \"object\") {\n const nested = tryUnwrapNestedError(value as Record<string, unknown>);\n if (nested) {\n return nested;\n }\n }\n return {\n kind: \"non-error\",\n type: classify(value),\n value: describe(value),\n serialized: serializeBoundedDepth(value, MAX_NON_ERROR_DEPTH),\n };\n}\n\nexport function isNonErrorException(\n value: unknown\n): value is NonErrorException {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { kind?: unknown }).kind === \"non-error\"\n );\n}\n\n/**\n * Walks `Error.cause` to flatten the chain into the wire shape the\n * collector expects. Each entry carries `type` / `value` / `mechanism?`\n * plus the raw `stack` string — the SDK ships **no parsed frames**.\n * Server-side ingest parses `stack` into structured `IngestedFrame[]`\n * via the collector's stack parser (see\n * `src/services/collector/src/lib/stack-parser.ts`).\n *\n * Non-Error rejections short-circuit to a single `kind: \"non-error\"`\n * entry with the structured payload on `serialized`.\n */\nexport function toExceptions(\n value: Error | NonErrorException,\n mechanism: ErrorMechanism\n): ExceptionValue[] {\n if (isNonErrorException(value)) {\n return [\n {\n kind: \"non-error\",\n type: value.type,\n value: value.value,\n mechanism,\n serialized: value.serialized,\n },\n ];\n }\n\n const exceptions: ExceptionValue[] = [];\n let current: Error | undefined = value;\n\n for (let depth = 0; current && depth < MAX_CAUSE_DEPTH; depth += 1) {\n exceptions.push({\n kind: \"error\",\n type: current.name,\n value: current.message,\n mechanism: depth === 0 ? mechanism : undefined,\n stack: current.stack ?? \"\",\n });\n\n current = current.cause instanceof Error ? current.cause : undefined;\n }\n\n return exceptions;\n}\n"],"mappings":"AAoBA,MAAa,EAAiB,CAC5B,QAAS,CACP,QAAS,uCACT,qBAAsB,oDACtB,aAAc,6BACf,CACD,MAAO,CACL,cAAe,qCACf,gBAAiB,uCACjB,YAAa,mCACb,cAAe,qCACf,iBAAkB,wCACnB,CACD,OAAQ,CACN,eAAgB,wCAChB,aAAc,qCACf,CACD,KAAM,CACJ,aAAc,mCACd,kBAAmB,+CACnB,mBAAoB,gDACrB,CACD,OAAQ,CAEN,QAAS,qBACV,CACF,CAQK,EACJ,qFAeF,SAAgB,EACd,EACS,CACT,OAAO,EAAO,KAAM,GAAU,EAAiB,KAAK,EAAM,CAAC,CAY7D,MAAM,EACJ,2EAQF,SAAgB,EACd,EACS,CACT,GAAI,EAAO,SAAW,EACpB,MAAO,GAET,IAAK,IAAM,KAAS,EAClB,GAAI,EAAuB,KAAK,EAAM,CACpC,MAAO,GAGX,MAAO,GAGT,MAUM,EACJ,gEAcF,SAAgB,EACd,EACiB,CACjB,IAAM,EAA0B,EAAE,CAClC,IAAK,IAAM,KAAW,EAAe,MAAM;EAAK,CAAE,CAChD,IAAM,EAAO,EAAQ,MAAM,CAC3B,GAAI,CAAC,EACH,SAEF,IAAM,EAAQ,EAAmB,KAAK,EAAK,CAC3C,GAAI,CAAC,EACH,SAEF,GAAM,EAAG,EAAM,EAAU,EAAS,GAAU,EAC5C,GAAI,CAAC,EACH,SAEF,IAAM,EAAuB,CAC3B,GAAI,SAAS,EAAO,SACpB,GAAI,EACL,CACG,IACF,EAAM,KAAO,GAEX,IACF,EAAM,KAAO,OAAO,EAAQ,EAE1B,IACF,EAAM,OAAS,OAAO,EAAO,EAE/B,EAAO,KAAK,EAAM,CAEpB,OAAO,EAgBT,SAAgB,EAAQ,EAAuB,CAyB7C,OAxBI,aAAiB,MACZ,EAGL,OAAO,GAAU,SACR,M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src/sdk/geo.ts"],"mappings":";;;cAEa,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;KAItB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,iBAQ7B,oBAAA,CAAqB,OAAA,EAAS,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"geo.mjs","names":[],"sources":["../../src/sdk/geo.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const cloudflareTraceSchema = z\n .object({ loc: z.string().length(2) })\n .loose();\n\nexport type CloudflareTrace = z.infer<typeof cloudflareTraceSchema>;\n\nconst GEO_COUNTRY_HEADERS = [\n \"cf-ipcountry\",\n \"x-vercel-ip-country\",\n \"x-country-code\",\n] as const;\n\nexport function extractCountryHeader(request: Request): string | null {\n for (const header of GEO_COUNTRY_HEADERS) {\n const value = request.headers.get(header);\n if (value && value.length === 2) {\n return value.toUpperCase();\n }\n }\n return null;\n}\n"],"mappings":"wBAEA,MAAa,EAAwB,EAClC,OAAO,CAAE,IAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAE,CAAC,CACrC,OAAO,CAIJ,EAAsB,CAC1B,eACA,sBACA,iBACD,CAED,SAAgB,EAAqB,EAAiC,CACpE,IAAK,IAAM,KAAU,EAAqB,CACxC,IAAM,EAAQ,EAAQ,QAAQ,IAAI,EAAO,CACzC,GAAI,GAAS,EAAM,SAAW,EAC5B,OAAO,EAAM,aAAa,CAG9B,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"identify.d.mts","names":[],"sources":["../../src/sdk/identify.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;KAkBrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAyB/B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;KAerB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"identify.mjs","names":[],"sources":["../../src/sdk/identify.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const identifySourceSchema = z\n .discriminatedUnion(\"type\", [\n z\n .object({ type: z.literal(\"clerk\"), name: z.literal(\"Clerk\") })\n .meta({ id: \"ClerkIdentifySource\", title: \"ClerkIdentifySource\" }),\n z\n .object({ type: z.literal(\"auth0\"), name: z.literal(\"Auth0\") })\n .meta({ id: \"Auth0IdentifySource\", title: \"Auth0IdentifySource\" }),\n z\n .object({ type: z.literal(\"custom\"), name: z.string() })\n .meta({ id: \"CustomIdentifySource\", title: \"CustomIdentifySource\" }),\n ])\n .meta({\n id: \"IdentifySource\",\n title: \"IdentifySource\",\n description: \"Auth provider that surfaced this identification.\",\n });\n\nexport type IdentifySource = z.infer<typeof identifySourceSchema>;\n\n/**\n * Schema for the `traits` bag attached to an identify call. Modelled as\n * a flat `Record<string, unknown>` rather than the fully recursive\n * `z.json()` because:\n *\n * - Speakeasy's TS generator panics on self-recursive `$ref` cycles\n * (\"Multiple types for the same registration ID JsonValue\") even\n * when the doc is otherwise lint-clean.\n * - The wire is already JSON-parsed before reaching this validator, so\n * the recursive shape only affected the SDK's nominal type — values\n * nested arbitrarily deep still flow through unchanged.\n *\n * If the SDK ever needs to expose a recursive JSON-value type, do it\n * with a hand-written TypeScript alias rather than a recursive Zod\n * schema, until Speakeasy supports the cycle.\n */\nconst traitsSchema = z.record(z.string(), z.unknown()).meta({\n id: \"IdentifyTraits\",\n title: \"IdentifyTraits\",\n description:\n \"Free-form key/value bag of user attributes attached when identifying a session.\",\n});\n\nexport const identifyParamsSchema = z\n .object({\n avatar: z.string().optional(),\n email: z.email().optional(),\n identifier: z.string(),\n name: z.string().optional(),\n source: identifySourceSchema,\n traits: traitsSchema.optional(),\n })\n .meta({\n id: \"IdentifyParams\",\n title: \"IdentifyParams\",\n description: \"User attributes attached when identifying a session.\",\n });\n\nexport type IdentifyParams = z.infer<typeof identifyParamsSchema>;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;;;;;;KAYf,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/browser.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst deviceBrowserSchema = z\n .object({\n major: z.string().optional(),\n name: z.string().optional(),\n type: z.string().optional(),\n version: z.string().optional(),\n fullVersion: z.string().optional(),\n })\n .meta({ id: \"DeviceBrowser\", title: \"DeviceBrowser\" });\n\nconst deviceCpuSchema = z\n .object({\n architecture: z.string().optional(),\n bitness: z.string().optional(),\n })\n .meta({ id: \"DeviceCpu\", title: \"DeviceCpu\" });\n\nconst deviceInfoSchema = z\n .object({\n model: z.string().optional(),\n type: z.string().optional(),\n vendor: z.string().optional(),\n })\n .meta({ id: \"DeviceInfo\", title: \"DeviceInfo\" });\n\nconst deviceEngineSchema = z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n })\n .meta({ id: \"DeviceEngine\", title: \"DeviceEngine\" });\n\nconst deviceOsSchema = z\n .object({\n name: z.string().optional(),\n version: z.string().optional(),\n versionFull: z.string().optional(),\n })\n .meta({ id: \"DeviceOs\", title: \"DeviceOs\" });\n\nexport const deviceMetadataSchema = z\n .object({\n browser: deviceBrowserSchema,\n cpu: deviceCpuSchema,\n device: deviceInfoSchema,\n engine: deviceEngineSchema,\n os: deviceOsSchema,\n ua: z.string(),\n /**\n * `true` when the UA string has been reduced under Chrome's\n * UA-reduction (frozen UA). Indicates that fields parsed solely from\n * the UA string are unreliable on this UA and that any high-fidelity\n * data came from Client Hints.\n */\n frozenUa: z.boolean().optional(),\n })\n .meta({\n id: \"DeviceMetadata\",\n title: \"DeviceMetadata\",\n description: \"Device/browser metadata extracted from the user agent.\",\n });\n\nexport type DeviceMetadata = z.infer<typeof deviceMetadataSchema>;\n\nconst displayScreenSchema = z\n .object({\n height: z.number(),\n width: z.number(),\n orientation: z.string().optional(),\n })\n .meta({ id: \"Screen\", title: \"Screen\" });\n\nconst displaySchema = z\n .object({\n screen: displayScreenSchema,\n })\n .meta({ id: \"Display\", title: \"Display\" });\n\nconst browserMetadataSchema = z\n .object({\n language: z.string().optional(),\n timezone: z.string().optional(),\n display: displaySchema,\n })\n .meta({\n id: \"BrowserMetadata\",\n title: \"BrowserMetadata\",\n description: \"Browser locale and display metadata.\",\n });\n\nexport type BrowserMetadata = z.infer<typeof browserMetadataSchema>;\n\nexport const browserContextSchema = z\n .object({\n runtime: z.literal(\"browser\"),\n browser: browserMetadataSchema.nullable(),\n device: deviceMetadataSchema.nullable(),\n })\n .meta({\n id: \"BrowserContext\",\n title: \"BrowserContext\",\n description: \"Request context for the browser runtime.\",\n });\n\nexport type BrowserContext = z.infer<typeof browserContextSchema>;\n"],"mappings":"wBAEA,MAAM,EAAsB,EACzB,OAAO,CACN,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC5B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC9B,YAAa,EAAE,QAAQ,CAAC,UAAU,CACnC,CAAC,CACD,KAAK,CAAE,GAAI,gBAAiB,MAAO,gBAAiB,CAAC,CAElD,EAAkB,EACrB,OAAO,CACN,aAAc,EAAE,QAAQ,CAAC,UAAU,CACnC,QAAS,EAAE,QAAQ,CAAC,UAAU,CAC/B,CAAC,CACD,KAAK,CAAE,GAAI,YAAa,MAAO,YAAa,CAAC,CAE1C,EAAmB,EACtB,OAAO,CACN,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC5B,KAAM,EAAE,QAAQ,CAAC,UAAU,CAC3B,OAAQ,EAAE,QAAQ,CAAC,UAAU,CAC9B,CAAC,C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AO,iBACP,YAAa,2CACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"mappings":";;;cAEa,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;KAUlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/edge.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const edgeContextSchema = z\n .object({\n runtime: z.literal(\"edge\"),\n })\n .meta({\n id: \"EdgeContext\",\n title: \"EdgeContext\",\n description: \"Request context for the Edge runtime.\",\n });\n\nexport type EdgeContext = z.infer<typeof edgeContextSchema>;\n"],"mappings":"wBAEA,MAAa,EAAoB,EAC9B,OAAO,CACN,QAAS,EAAE,QAAQ,OAAO,CAC3B,CAAC,CACD,KAAK,CACJ,GAAI,cACJ,MAAO,cACP,YAAa,wCACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"next.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"mappings":";;;cAEa,kBAAA,EAAkB,CAAA,CAAA,OAAA;;;;;cAQlB,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;cAIhB,sBAAA,EAAsB,CAAA,CAAA,OAAA;;;;cAItB,eAAA,EAAe,CAAA,CAAA,OAAA;;;;;;;cAIf,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;cAIhB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmBpB,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"next.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/next.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const renderSourceSchema = z\n .enum([\n \"react-server-components\",\n \"react-server-components-payload\",\n \"server-rendering\",\n ])\n .meta({ id: \"RenderSource\", title: \"RenderSource\" });\n\nexport const renderTypeSchema = z\n .enum([\"dynamic\", \"dynamic-resume\"])\n .meta({ id: \"RenderType\", title: \"RenderType\" });\n\nexport const revalidateReasonSchema = z\n .enum([\"on-demand\", \"stale\"])\n .meta({ id: \"RevalidateReason\", title: \"RevalidateReason\" });\n\nexport const routeTypeSchema = z\n .enum([\"render\", \"route\", \"action\", \"middleware\", \"proxy\"])\n .meta({ id: \"RouteType\", title: \"RouteType\" });\n\nexport const routerKindSchema = z\n .enum([\"Pages Router\", \"App Router\"])\n .meta({ id: \"RouterKind\", title: \"RouterKind\" });\n\nexport const nextjsContextSchema = z\n .object({\n errorDigest: z.string().optional(),\n renderSource: renderSourceSchema.optional(),\n renderType: renderTypeSchema.optional(),\n requestMethod: z.string().optional(),\n requestPath: z.string().optional(),\n revalidateReason: revalidateReasonSchema.optional(),\n routePath: z.string().optional(),\n routeType: routeTypeSchema.optional(),\n routerKind: routerKindSchema.optional(),\n runtime: z.literal(\"nextjs\"),\n })\n .meta({\n id: \"NextjsContext\",\n title: \"NextjsContext\",\n description: \"Request context for the Next.js runtime.\",\n });\n\nexport type NextjsContext = z.infer<typeof nextjsContextSchema>;\n"],"mappings":"wBAEA,MAAa,EAAqB,EAC/B,KAAK,CACJ,0BACA,kCACA,mBACD,CAAC,CACD,KAAK,CAAE,GAAI,eAAgB,MAAO,eAAgB,CAAC,CAEzC,EAAmB,EAC7B,KAAK,CAAC,UAAW,iBAAiB,CAAC,CACnC,KAAK,CAAE,GAAI,aAAc,MAAO,aAAc,CAAC,CAErC,EAAyB,EACnC,KAAK,CAAC,YAAa,QAAQ,CAAC,CAC5B,KAAK,CAAE,GAAI,mBAAoB,MAAO,mBAAoB,CAAC,CAEjD,EAAkB,EAC5B,KAAK,CAAC,SAAU,QAAS,SAAU,aAAc,QAAQ,CAAC,CAC1D,KAAK,CAAE,GAAI,YAAa,MAAO,YAAa,CAAC,CAEnC,EAAmB,EAC7B,KAAK,CAAC,eAAgB,aAAa,CAAC,CACpC,KAAK,CAAE,GAAI,aAAc,MAAO,aAAc,CAAC,CAErC,EAAsB,EAChC,OAAO,CACN,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,aAAc,EAAmB,UAAU,CAC3C,WAAY,EAAiB,UAAU,CACvC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,iBAAkB,EAAuB,UAAU,CACnD,UAAW,EAAE,QAAQ,CAAC,UAAU,CAChC,UAAW,EAAgB,UAAU,CACrC,WAAY,EAAiB,UAAU,CACvC,QAAS,EAAE,QAAQ,SAAS,CAC7B,CAAC,CACD,KAAK,CACJ,GAAI,gBACJ,MAAO,gBACP,YAAa,2CACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.d.mts","names":[],"sources":["../../../../src/sdk/plugins/context/node.ts"],"mappings":";;;cAEa,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;KAalB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.mjs","names":[],"sources":["../../../../src/sdk/plugins/context/node.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const nodeContextSchema = z\n .object({\n errorDigest: z.string().optional(),\n requestMethod: z.string().optional(),\n requestPath: z.string().optional(),\n runtime: z.literal(\"node\"),\n })\n .meta({\n id: \"NodeContext\",\n title: \"NodeContext\",\n description: \"Request context for the Node.js runtime.\",\n });\n\nexport type NodeContext = z.infer<typeof nodeContextSchema>;\n"],"mappings":"wBAEA,MAAa,EAAoB,EAC9B,OAAO,CACN,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACpC,YAAa,EAAE,QAAQ,CAAC,UAAU,CAClC,QAAS,EAAE,QAAQ,OAAO,CAC3B,CAAC,CACD,KAAK,CACJ,GAAI,cACJ,MAAO,cACP,YAAa,2CACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.d.mts","names":[],"sources":["../../../src/sdk/plugins/manifest.ts"],"mappings":";cAAa,kBAAA;AAAA,KAER,UAAA,oBACS,CAAA,KAAM,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,KAAM,OAAA,CAAQ,CAAA,UAC3C,CAAA;AAAA,cAEK,eAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+CD,cAAA,UAAwB,eAAA;AAAA,KAExB,eAAA,WAA0B,kBAAA;AAAA,KAC1B,SAAA,GAAY,cAAA;AAAA,KACZ,gBAAA,GAAmB,OAAA,CAAQ,eAAA;AAAA,KAC3B,YAAA,GAAe,UAAA,CAAW,MAAA,CAAO,gBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.mjs","names":[],"sources":["../../../src/sdk/plugins/manifest.ts"],"sourcesContent":["export const CONSENT_CATEGORIES = [\"necessary\", \"analytics\", \"replay\"] as const;\n\ntype AtLeastOne<T> = {\n [K in keyof T]-?: Required<Pick<T, K>> & Partial<T>;\n}[keyof T];\n\nexport const PLUGIN_MANIFEST = [\n {\n consentCategory: \"necessary\",\n defaultEnabled: true,\n events: [{ enrich: true, name: \"error\" }],\n name: \"errors\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [],\n name: \"device\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [\n { enrich: true, name: \"pageview\" },\n { enrich: true, name: \"pageleave\" },\n { enrich: true, name: \"ui_event\" },\n ],\n name: \"pageEvents\",\n },\n {\n consentCategory: \"analytics\",\n defaultEnabled: true,\n events: [{ enrich: true, name: \"rage_click\" }],\n name: \"rageClick\",\n },\n {\n consentCategory: \"replay\",\n defaultEnabled: true,\n events: [{ enrich: false, name: \"replay_chunk\" }],\n name: \"replay\",\n },\n {\n consentCategory: \"necessary\",\n defaultEnabled: true,\n // Logs ride OTel `LogRecord`s, not envelopes — no `events: [...]`\n // entry. The plugin patches `console.*` and emits via the kernel's\n // logger provider. Error-bearing console calls stay routed through\n // the `errors` plugin (class boundary).\n events: [],\n name: \"logs\",\n },\n] as const;\n\nexport type PluginManifest = typeof PLUGIN_MANIFEST;\n\nexport type ConsentCategory = (typeof CONSENT_CATEGORIES)[number];\nexport type PluginKey = PluginManifest[number][\"name\"];\nexport type GateableCategory = Exclude<ConsentCategory, \"necessary\">;\nexport type ConsentState = AtLeastOne<Record<GateableCategory, boolean>>;\n"],"mappings":"AAAA,MAAa,EAAqB,CAAC,YAAa,YAAa,SAAS,CAMzD,EAAkB,CAC7B,CACE,gBAAiB,YACjB,eAAgB,GAChB,OAAQ,CAAC,CAAE,OAAQ,GAAM,KAAM,QAAS,CAAC,CACzC,KAAM,SACP,CACD,CACE,gBAAiB,YACjB,eAAgB,GAChB,OAAQ,EAAE,CACV,KAAM,SACP,CACD,CACE,gBAAiB,YACjB,eAAgB,GAChB,OAAQ,CACN,CAAE,OAAQ,GAAM,KAAM,WAAY,CAClC,CAAE,OAAQ,GAAM,KAAM,YAAa,CACnC,CAAE,OAAQ,GAAM,KAAM,WAAY,CACnC,CACD,KAAM,aACP,CACD,CACE,gBAAiB,YACjB,eAAgB,GAChB,OAAQ,CAAC,CAAE,OAAQ,GAAM,KAAM,aAAc,CAAC,CAC9C,KAAM,YACP,CACD,CACE,gBAAiB,SACjB,eAAgB,GAChB,OAAQ,CAAC,CAAE,OAAQ,GAAO,KAAM,eAAgB,CAAC,CACjD,KAAM,SACP,CACD,CACE,gBAAiB,YACjB,eAAgB,GAKhB,OAAQ,EAAE,CACV,KAAM,OACP,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"mappings":";;;cAEa,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;KAIlB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,cAE5B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;KAYrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAkC/B,oBAAA,EAAoB,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;KASrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;KAkB3B,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,0BAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/errors.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const errorSourceSchema = z\n .enum([\"client\", \"server\", \"edge\"])\n .meta({ id: \"ErrorSource\", title: \"ErrorSource\" });\n\nexport type ErrorSource = z.infer<typeof errorSourceSchema>;\n\nexport const errorMechanismSchema = z\n .object({\n type: z.string(),\n handled: z.boolean(),\n synthetic: z.boolean().optional(),\n })\n .meta({\n id: \"ErrorMechanism\",\n title: \"ErrorMechanism\",\n description: \"How the exception was captured by the SDK.\",\n });\n\nexport type ErrorMechanism = z.infer<typeof errorMechanismSchema>;\n\n/**\n * Error-shaped exception: carries the raw `error.stack` string. The SDK\n * does not parse stacks client-side anymore — the collector parses\n * `stack` at ingest time (see\n * `src/services/collector/src/lib/stack-parser.ts`) so SDK bundle size\n * stays small and parsing-edge-case fixes don't require an SDK release.\n */\nconst errorExceptionSchema = z.object({\n kind: z.literal(\"error\"),\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n stack: z.string(),\n});\n\n/**\n * Non-Error rejection: `Promise.reject({ code: 401 })`,\n * `Promise.reject(42)`, etc. There's no stack to parse, so `stack` is\n * absent; the original payload rides as `serialized` (depth-bounded\n * and circular-safe — see `serializeBoundedDepth` in\n * `@interfere/types/sdk/errors`). Dashboards render the structured\n * payload from `serialized` rather than parsing JSON back out of\n * `value`.\n */\nconst nonErrorExceptionSchema = z.object({\n kind: z.literal(\"non-error\"),\n type: z.string(),\n value: z.string(),\n mechanism: errorMechanismSchema.optional(),\n serialized: z.unknown(),\n});\n\nexport const exceptionValueSchema = z\n .union([errorExceptionSchema, nonErrorExceptionSchema])\n .meta({\n id: \"Exception\",\n title: \"Exception\",\n description:\n \"A single exception. Error-shaped exceptions carry the raw `error.stack` string; non-Error rejections (e.g. `Promise.reject({ code: 401 })`) carry the structured payload as `serialized` instead.\",\n });\n\nexport type ExceptionValue = z.infer<typeof exceptionValueSchema>;\n\nexport const errorEnvelopePayloadSchema = z\n .object({\n exceptions: z.array(exceptionValueSchema).min(1),\n /**\n * `error.digest` from React when an RSC server-side throw is sanitised\n * and rebuilt as a synthetic Error on the client. The only identifier\n * that pairs the redacted client-side capture with the unredacted\n * server-side capture; downstream enrichment mixes it into the\n * fingerprint so both events group as one problem.\n */\n errorDigest: z.string().optional(),\n })\n .meta({\n id: \"ErrorPayload\",\n title: \"ErrorPayload\",\n description: \"Payload for an error envelope.\",\n });\n\nexport type ErrorEnvelopePayload = z.infer<typeof errorEnvelopePayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAAoB,EAC9B,KAAK,CAAC,SAAU,SAAU,OAAO,CAAC,CAClC,KAAK,CAAE,GAAI,cAAe,MAAO,cAAe,CAAC,CAIvC,EAAuB,EACjC,OAAO,CACN,KAAM,EAAE,QAAQ,CAChB,QAAS,EAAE,SAAS,CACpB,UAAW,EAAE,SAAS,CAAC,UAAU,CAClC,CAAC,CACD,KAAK,CACJ,GAAI,iBACJ,MAAO,iBACP,YAAa,6CACd,CAAC,CAWE,EAAuB,EAAE,OAAO,CACpC,KAAM,EAAE,QAAQ,QAAQ,CACxB,KAAM,EAAE,QAAQ,CAChB,MAAO,EAAE,QAAQ,CACjB,UAAW,EAAqB,UAAU,CAC1C,MAAO,EAAE,QAAQ,CAClB,CAAC,CAWI,EAA0B,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,YAAY,CAC5B,KAAM,EAAE,QAAQ,CAChB,MAAO,EAAE,QAAQ,CACjB,UAAW,EAAqB,UAAU,CAC1C,WAAY,EAAE,SAAS,CACxB,CAAC,CAEW,EAAuB,EACjC,MAAM,CAAC,EAAsB,EAAwB,CAAC,CACtD,KAAK,CACJ,GAAI,YACJ,MAAO,YACP,YACE,oMACH,CAAC,CAIS,EAA6B,EACvC,OAAO,CACN,WAAY,EAAE,MAAM,EAAqB,CAAC,IAAI,EAAE,CAQhD,YAAa,EAAE,QAAQ,CAAC,UAAU,CACnC,CAAC,CACD,KAAK,CACJ,GAAI,eACJ,MAAO,eACP,YAAa,iCACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-events.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"mappings":";;;cAEa,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;KAUrB,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAE/B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;KAWtB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEhC,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;KAWvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-events.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/page-events.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const uiEventPayloadSchema = z\n .object({\n event: z.record(z.string(), z.unknown()),\n })\n .meta({\n id: \"UiEventPayload\",\n title: \"UiEventPayload\",\n description: \"Payload for a UI event envelope.\",\n });\n\nexport type UiEventPayload = z.infer<typeof uiEventPayloadSchema>;\n\nexport const pageviewPayloadSchema = z\n .object({\n url: z.url(),\n title: z.string().optional(),\n })\n .meta({\n id: \"PageviewPayload\",\n title: \"PageviewPayload\",\n description: \"Payload for a pageview envelope.\",\n });\n\nexport type PageviewPayload = z.infer<typeof pageviewPayloadSchema>;\n\nexport const pageleavePayloadSchema = z\n .object({\n url: z.url(),\n durationMs: z.number().optional(),\n })\n .meta({\n id: \"PageleavePayload\",\n title: \"PageleavePayload\",\n description: \"Payload for a pageleave envelope.\",\n });\n\nexport type PageleavePayload = z.infer<typeof pageleavePayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAAuB,EACjC,OAAO,CACN,MAAO,EAAE,OAAO,EAAE,QAAQ,CAAE,EAAE,SAAS,CAAC,CACzC,CAAC,CACD,KAAK,CACJ,GAAI,iBACJ,MAAO,iBACP,YAAa,mCACd,CAAC,CAIS,EAAwB,EAClC,OAAO,CACN,IAAK,EAAE,KAAK,CACZ,MAAO,EAAE,QAAQ,CAAC,UAAU,CAC7B,CAAC,CACD,KAAK,CACJ,GAAI,kBACJ,MAAO,kBACP,YAAa,mCACd,CAAC,CAIS,EAAyB,EACnC,OAAO,CACN,IAAK,EAAE,KAAK,CACZ,WAAY,EAAE,QAAQ,CAAC,UAAU,CAClC,CAAC,CACD,KAAK,CACJ,GAAI,mBACJ,MAAO,mBACP,YAAa,oCACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rage-click.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"mappings":";;;cAEa,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;KAgBvB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rage-click.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/rage-click.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const rageClickPayloadSchema = z\n .object({\n count: z.number(),\n timeWindow: z.number(),\n selector: z.string(),\n text: z.string(),\n x: z.number(),\n y: z.number(),\n timestamp: z.number(),\n })\n .meta({\n id: \"RageClickPayload\",\n title: \"RageClickPayload\",\n description: \"Payload for a rage-click envelope.\",\n });\n\nexport type RageClickPayload = z.infer<typeof rageClickPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAAyB,EACnC,OAAO,CACN,MAAO,EAAE,QAAQ,CACjB,WAAY,EAAE,QAAQ,CACtB,SAAU,EAAE,QAAQ,CACpB,KAAM,EAAE,QAAQ,CAChB,EAAG,EAAE,QAAQ,CACb,EAAG,EAAE,QAAQ,CACb,UAAW,EAAE,QAAQ,CACtB,CAAC,CACD,KAAK,CACJ,GAAI,mBACJ,MAAO,mBACP,YAAa,qCACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.d.mts","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"mappings":";;;cAEa,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;KAgBzB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,wBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.mjs","names":[],"sources":["../../../../src/sdk/plugins/payload/replay.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const replayChunkPayloadSchema = z\n .object({\n ts: z.number(),\n count: z.number(),\n events: z.array(z.string()),\n /** First rrweb event timestamp (ms) in this chunk – actual recording start */\n first_event_ts: z.number().optional(),\n /** Last rrweb event timestamp (ms) in this chunk – actual recording end */\n last_event_ts: z.number().optional(),\n })\n .meta({\n id: \"ReplayChunkPayload\",\n title: \"ReplayChunkPayload\",\n description: \"Payload for a replay-chunk envelope.\",\n });\n\nexport type ReplayChunkPayload = z.infer<typeof replayChunkPayloadSchema>;\n"],"mappings":"wBAEA,MAAa,EAA2B,EACrC,OAAO,CACN,GAAI,EAAE,QAAQ,CACd,MAAO,EAAE,QAAQ,CACjB,OAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAE3B,eAAgB,EAAE,QAAQ,CAAC,UAAU,CAErC,cAAe,EAAE,QAAQ,CAAC,UAAU,CACrC,CAAC,CACD,KAAK,CACJ,GAAI,qBACJ,MAAO,qBACP,YAAa,uCACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"remote-config.d.mts","names":[],"sources":["../../src/sdk/remote-config.ts"],"mappings":";;;;;KAKY,kBAAA,GAAqB,OAAA,CAAQ,MAAA,CAAO,SAAA;;AAAhD;;;;;;;;;cAYa,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;cAQxB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;KAMnB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA;AAAA,cAE7B,oBAAA,EAAsB,MAAA,CAAO,SAAA,EAAW,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"remote-config.mjs","names":[],"sources":["../../src/sdk/remote-config.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { EventType } from \"./envelope.js\";\nimport { PLUGIN_MANIFEST, type PluginKey } from \"./plugins/manifest.js\";\n\nexport type RemotePluginConfig = Partial<Record<PluginKey, boolean>>;\n\n/**\n * Closed-shape schema for the SDK's per-plugin enabled state. Derived\n * from `PLUGIN_MANIFEST` so adding a plugin to the manifest extends\n * this schema automatically — no separate place to keep in sync.\n *\n * The closed shape (vs `Record<string, boolean>`) is what makes Speakeasy\n * generate a typed `{ errors?: boolean, replay?: boolean, ... }` instead\n * of a generic dictionary, and lets the SDK reject typo'd plugin names\n * before they silently drop on the wire.\n */\nexport const remotePluginConfigSchema = z\n .object(\n Object.fromEntries(\n PLUGIN_MANIFEST.map((p) => [p.name, z.boolean()])\n ) as Record<PluginKey, z.ZodBoolean>\n )\n .meta({ id: \"RemotePluginConfig\", title: \"RemotePluginConfig\" });\n\nexport const remoteConfigSchema = z\n .object({\n plugins: remotePluginConfigSchema,\n })\n .meta({ id: \"RemoteConfig\", title: \"RemoteConfig\" });\n\nexport type RemoteConfig = z.infer<typeof remoteConfigSchema>;\n\nexport const EVENT_TYPE_TO_PLUGIN: Record<EventType, PluginKey> =\n Object.fromEntries(\n PLUGIN_MANIFEST.flatMap((plugin) =>\n plugin.events.map((event) => [event.name, plugin.name])\n )\n ) as Record<EventType, PluginKey>;\n"],"mappings":"iFAiBA,MAAa,EAA2B,EACrC,OACC,OAAO,YACL,EAAgB,IAAK,GAAM,CAAC,EAAE,KAAM,EAAE,SAAS,CAAC,CAAC,CAClD,CACF,CACA,KAAK,CAAE,GAAI,qBAAsB,MAAO,qBAAsB,CAAC,CAErD,EAAqB,EAC/B,OAAO,CACN,QAAS,EACV,CAAC,CACD,KAAK,CAAE,GAAI,eAAgB,MAAO,eAAgB,CAAC,CAIzC,EACX,OAAO,YACL,EAAgB,QAAS,GACvB,EAAO,OAAO,IAAK,GAAU,CAAC,EAAM,KAAM,EAAO,KAAK,CAAC,CACxD,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../../src/sdk/runtime.ts"],"mappings":";;;cAEa,SAAA,EAAS,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;KASV,GAAA,GAAM,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAEpB,aAAA,EAAa,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,OAAA;;;;;KASd,OAAA,GAAU,CAAA,CAAE,KAAA,QAAa,aAAA;AAAA,iBAErB,YAAA,CAAa,OAAA;EAAA,SAClB,WAAA;AAAA,IACP,OAAA;AAAA,iBAiCY,YAAA,CAAa,KAAA,YAAiB,GAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../../src/sdk/runtime.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const envSchema = z\n .enum([\"development\", \"preview\", \"production\"])\n .nullable()\n .meta({\n id: \"Environment\",\n title: \"Environment\",\n description: \"Deployment environment the SDK is running in.\",\n });\n\nexport type Env = z.infer<typeof envSchema>;\n\nexport const runtimeSchema = z\n .enum([\"browser\", \"node\", \"edge\"])\n .nullable()\n .meta({\n id: \"Runtime\",\n title: \"Runtime\",\n description: \"JavaScript runtime the SDK is running in.\",\n });\n\nexport type Runtime = z.infer<typeof runtimeSchema>;\n\nexport function inferRuntime(options?: {\n readonly nextRuntime?: unknown;\n}): Runtime {\n // Browser\n if (\n typeof window !== \"undefined\" &&\n typeof document !== \"undefined\" &&\n typeof navigator !== \"undefined\"\n ) {\n return \"browser\";\n }\n\n // Edge (Vercel sets globalThis.EdgeRuntime = \"edge-runtime\")\n if (\n typeof (globalThis as { EdgeRuntime?: unknown }).EdgeRuntime === \"string\"\n ) {\n return \"edge\";\n }\n\n // Next.js Edge (explicit signal)\n if (options?.nextRuntime === \"edge\") {\n return \"edge\";\n }\n\n // Node\n if (\n typeof process !== \"undefined\" &&\n typeof process.versions?.node === \"string\"\n ) {\n return \"node\";\n }\n\n return null;\n}\n\nexport function normalizeEnv(value: unknown): Env {\n if (typeof value !== \"string\") {\n return null;\n }\n\n const env = value.toLowerCase();\n\n if (envSchema.safeParse(env).success) {\n return env as Env;\n }\n\n return null;\n}\n"],"mappings":"wBAEA,MAAa,EAAY,EACtB,KAAK,CAAC,cAAe,UAAW,aAAa,CAAC,CAC9C,UAAU,CACV,KAAK,CACJ,GAAI,cACJ,MAAO,cACP,YAAa,gDACd,CAAC,CAIS,EAAgB,EAC1B,KAAK,CAAC,UAAW,OAAQ,OAAO,CAAC,CACjC,UAAU,CACV,KAAK,CACJ,GAAI,UACJ,MAAO,UACP,YAAa,4CACd,CAAC,CAIJ,SAAgB,EAAa,EAEjB,CA8BV,OA3BE,OAAO,OAAW,KAClB,OAAO,SAAa,KACpB,OAAO,UAAc,IAEd,UAKP,OAAQ,WAAyC,aAAgB,UAM/D,GAAS,cAAgB,OACpB,OAKP,OAAO,QAAY,KACnB,OAAO,QAAQ,UAAU,MAAS,SAE3B,OAGF,KAGT,SAAgB,EAAa,EAAqB,CAChD,GAAI,OAAO,GAAU,SACnB,OAAO,KAGT,IAAM,EAAM,EAAM,aAAa,CAM/B,OAJI,EAAU,UAAU,EAAI,CAAC,QACpB,EAGF"}