deepline 0.3.89 → 0.3.91

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 (267) hide show
  1. package/contracts/install-commands.json +29 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +221 -43
  3. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  4. package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +2 -556
  5. package/dist/bundling-sources/sdk/src/monitor-fleets.ts +2 -2
  6. package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
  7. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  8. package/dist/bundling-sources/sdk/src/release.ts +11 -9
  9. package/dist/bundling-sources/sdk/src/types.ts +29 -1
  10. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +549 -0
  11. package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
  12. package/dist/bundling-sources/shared_libs/monitors/fleets/errors.ts +96 -0
  13. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
  14. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +320 -0
  15. package/dist/bundling-sources/shared_libs/monitors/fleets/verdict.ts +106 -0
  16. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +8 -1
  17. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +4 -4
  18. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
  19. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +7 -9
  20. package/dist/bundling-sources/shared_libs/monitors/monitor-fleet-limits.ts +2 -12
  21. package/dist/bundling-sources/shared_libs/monitors/package.json +113 -4
  22. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +56 -9
  23. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +2 -2
  24. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +2 -2
  25. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +1 -1
  26. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
  27. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
  28. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
  29. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
  30. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
  31. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +1 -1
  32. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +2 -2
  33. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +1 -1
  34. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +1 -1
  35. package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
  36. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
  37. package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
  38. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +690 -0
  39. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
  40. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
  41. package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
  42. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +46 -1
  44. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +0 -1
  46. package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +779 -140
  48. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +46 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/db-session-lease-store.ts +578 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-execution-relay.ts +521 -0
  54. package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-receipt-gateway.ts +1378 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/runtime-topology.ts +1024 -0
  56. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-gateway-route-probe.ts +193 -0
  57. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machine-lifecycle.ts +104 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +1844 -0
  59. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +21 -0
  60. package/dist/bundling-sources/shared_libs/play-runtime/deployment/process-tree.ts +40 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-gateway-drain.ts +262 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-surface.ts +98 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +303 -0
  64. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-tuple-publication-guardian.ts +70 -0
  65. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-tuple-recovery.ts +519 -0
  66. package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts +280 -0
  67. package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-production-gate.ts +159 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +23 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
  71. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +3 -3
  72. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
  73. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
  74. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
  75. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
  76. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/memory-store.ts +114 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
  83. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +1 -1
  84. package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
  85. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  89. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
  92. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
  95. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
  97. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
  102. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
  105. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
  108. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
  117. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
  118. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
  119. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +3 -5
  120. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
  121. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +44 -5
  122. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/child-play-resolver.ts +26 -0
  123. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +3662 -0
  124. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/progress-sidecar.ts +47 -0
  125. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-deadline.ts +84 -0
  126. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +91 -0
  127. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +424 -0
  128. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +321 -0
  129. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +110 -0
  130. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +625 -0
  131. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +72 -9
  132. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
  133. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
  134. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
  135. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -44
  136. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +103 -208
  137. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
  138. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
  139. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
  140. package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
  141. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
  142. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +14 -2
  143. package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
  144. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
  145. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
  146. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  147. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
  148. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
  149. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
  150. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
  151. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
  152. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
  153. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
  154. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
  155. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
  156. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
  157. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
  158. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
  159. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
  160. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
  161. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
  162. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
  163. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
  164. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
  165. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
  166. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
  167. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
  168. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
  169. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
  170. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
  171. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
  172. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
  173. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
  174. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
  175. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
  176. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
  177. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
  178. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
  179. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
  180. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
  181. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
  182. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
  183. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
  184. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
  185. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
  186. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
  187. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
  188. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
  189. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
  190. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
  191. package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
  192. package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-retry.ts +50 -0
  193. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
  194. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
  195. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
  196. package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
  197. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +2 -0
  198. package/dist/bundling-sources/shared_libs/plays/bundling/repository-adapter.ts +24 -0
  199. package/dist/bundling-sources/shared_libs/plays/child-run-projection.ts +174 -0
  200. package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -0
  201. package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +267 -0
  202. package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +73 -0
  203. package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +162 -0
  204. package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +87 -0
  205. package/dist/bundling-sources/shared_libs/plays/deploy/source-file-path.ts +26 -0
  206. package/dist/bundling-sources/shared_libs/plays/deploy/target-paths.ts +36 -0
  207. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
  208. package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
  209. package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +400 -0
  210. package/dist/bundling-sources/shared_libs/plays/launch/prepare.ts +96 -0
  211. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +385 -0
  212. package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +112 -0
  213. package/dist/bundling-sources/shared_libs/plays/play-reference.ts +117 -0
  214. package/dist/bundling-sources/shared_libs/plays/run-input-summary.ts +260 -0
  215. package/dist/bundling-sources/shared_libs/plays/run-summary-types.ts +49 -0
  216. package/dist/bundling-sources/shared_libs/plays/secrets/errors.ts +19 -0
  217. package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
  218. package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
  219. package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
  220. package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
  221. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
  222. package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
  223. package/dist/bundling-sources/shared_libs/plays/sheet-filter.ts +347 -0
  224. package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
  225. package/dist/bundling-sources/shared_libs/plays/standard-webhooks.ts +117 -0
  226. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -1
  227. package/dist/bundling-sources/shared_libs/plays/status-result.ts +388 -0
  228. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  229. package/dist/bundling-sources/shared_libs/plays/transform-factor-structure.ts +377 -0
  230. package/dist/bundling-sources/shared_libs/plays/webhook-payload.ts +113 -0
  231. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +7 -1
  232. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +3 -2
  233. package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
  234. package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
  235. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
  236. package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
  237. package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
  238. package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
  239. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
  240. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +10 -3
  241. package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
  242. package/dist/cli/getting-started.d.mts +52 -0
  243. package/dist/cli/getting-started.d.ts +52 -0
  244. package/dist/cli/getting-started.js +65 -0
  245. package/dist/cli/getting-started.mjs +36 -0
  246. package/dist/cli/index.d.mts +9 -0
  247. package/dist/cli/index.d.ts +9 -0
  248. package/dist/cli/index.js +895 -407
  249. package/dist/cli/index.mjs +893 -414
  250. package/dist/{compiler-manifest-DsLbQaew.d.mts → compiler-manifest-x14KL83E.d.mts} +4 -2
  251. package/dist/{compiler-manifest-DsLbQaew.d.ts → compiler-manifest-x14KL83E.d.ts} +4 -2
  252. package/dist/index.d.mts +124 -154
  253. package/dist/index.d.ts +124 -154
  254. package/dist/index.js +132 -28
  255. package/dist/index.mjs +132 -28
  256. package/dist/install-integrity.json +182 -2
  257. package/dist/monitor-fleet-contract.d.mts +131 -0
  258. package/dist/monitor-fleet-contract.d.ts +131 -0
  259. package/dist/monitor-fleet-contract.js +406 -0
  260. package/dist/monitor-fleet-contract.mjs +367 -0
  261. package/dist/plays/bundle-play-file.d.mts +2 -2
  262. package/dist/plays/bundle-play-file.d.ts +2 -2
  263. package/dist/release.d.mts +255 -0
  264. package/dist/release.d.ts +255 -0
  265. package/dist/release.js +210 -0
  266. package/dist/release.mjs +183 -0
  267. package/package.json +21 -4
@@ -0,0 +1,94 @@
1
+ import { getVercelOidcToken } from '@vercel/oidc';
2
+
3
+ import { SIGNAL_RADAR_INBOUND_TOPIC } from '@deepline/monitors/signal-radars/inbound-queue';
4
+
5
+ // Must match the function key in apps/deepline-api/vercel.json. Vercel Queue's push-trigger
6
+ // adapter derives the consumer group from this path. Deriving rather than
7
+ // copying the encoded value makes the transformation reviewable and testable.
8
+ export const SIGNAL_RADAR_INBOUND_TRIGGER_PATH =
9
+ 'src/app/api/queues/signal-radar-inbound/route.ts';
10
+
11
+ const DEEPLINE_API_PROJECT_ROOT = 'apps/deepline-api/';
12
+
13
+ export function vercelQueueConsumerGroupForFunctionPath(functionPath: string) {
14
+ return functionPath
15
+ .replaceAll('_', '__')
16
+ .replaceAll('/', '_S')
17
+ .replaceAll('.', '_D');
18
+ }
19
+
20
+ export const SIGNAL_RADAR_INBOUND_CONSUMER_GROUP =
21
+ vercelQueueConsumerGroupForFunctionPath(
22
+ SIGNAL_RADAR_INBOUND_TRIGGER_PATH.replace(DEEPLINE_API_PROJECT_ROOT, ''),
23
+ );
24
+
25
+ export type SignalRadarInboundQueueMessageState =
26
+ | 'acknowledged'
27
+ | 'available'
28
+ | 'in_flight'
29
+ | 'not_found';
30
+
31
+ type ProbeDependencies = {
32
+ fetch?: typeof fetch;
33
+ getOidcToken?: () => Promise<string>;
34
+ };
35
+
36
+ type ProbeInput = {
37
+ messageId: string;
38
+ region: string | undefined;
39
+ deploymentId: string | undefined;
40
+ };
41
+
42
+ function requiredRuntimeValue(name: string, value: string | undefined) {
43
+ if (value?.trim()) return value.trim();
44
+ throw new Error(
45
+ `${name} is required for the Vercel Queue acknowledgement probe.`,
46
+ );
47
+ }
48
+
49
+ /**
50
+ * Peeks at the exact message in Vercel's push-consumer group without leasing,
51
+ * acknowledging, or otherwise changing it. A 410 is the direct proof that
52
+ * the consumer successfully acknowledged this message.
53
+ */
54
+ export async function signalRadarInboundQueueMessageState(
55
+ input: ProbeInput,
56
+ dependencies: ProbeDependencies = {},
57
+ ): Promise<SignalRadarInboundQueueMessageState> {
58
+ const region = requiredRuntimeValue('VERCEL_REGION', input.region);
59
+ const deploymentId = requiredRuntimeValue(
60
+ 'VERCEL_DEPLOYMENT_ID',
61
+ input.deploymentId,
62
+ );
63
+ const requestFetch = dependencies.fetch ?? fetch;
64
+ const getToken = dependencies.getOidcToken ?? getVercelOidcToken;
65
+ const response = await requestFetch(
66
+ `https://${region}.vercel-queue.com/api/v3/topic/${encodeURIComponent(
67
+ SIGNAL_RADAR_INBOUND_TOPIC,
68
+ )}/consumer/${encodeURIComponent(
69
+ SIGNAL_RADAR_INBOUND_CONSUMER_GROUP,
70
+ )}/id/${encodeURIComponent(input.messageId)}`,
71
+ {
72
+ method: 'POST',
73
+ headers: {
74
+ authorization: `Bearer ${await getToken()}`,
75
+ accept: 'multipart/mixed',
76
+ // Vercel documents zero as a non-leasing peek. This probe must never
77
+ // become a competing consumer or acknowledge an unprocessed message.
78
+ 'vqs-visibility-timeout-seconds': '0',
79
+ 'vqs-deployment-id': deploymentId,
80
+ },
81
+ },
82
+ );
83
+
84
+ if (response.status === 410) return 'acknowledged';
85
+ if (response.status === 409) return 'in_flight';
86
+ if (response.status === 404) return 'not_found';
87
+ if (response.status === 200) return 'available';
88
+
89
+ throw new Error(
90
+ `Vercel Queue acknowledgement probe failed with HTTP ${response.status}: ${(
91
+ await response.text()
92
+ ).slice(0, 500)}`,
93
+ );
94
+ }
@@ -0,0 +1,60 @@
1
+ import {
2
+ classifyInboundFailure,
3
+ inboundBackoffSeconds,
4
+ } from '@deepline/monitors/signal-radars/inbound-dead-letter';
5
+ import type { SignalRadarInboundMessage } from '@deepline/monitors/signal-radars/inbound-message';
6
+
7
+ export class SignalRadarInboundDeliveryError extends Error {
8
+ readonly cause_error: unknown;
9
+
10
+ constructor(cause: unknown) {
11
+ super(cause instanceof Error ? cause.message : String(cause));
12
+ this.name = 'SignalRadarInboundDeliveryError';
13
+ this.cause_error = cause;
14
+ }
15
+ }
16
+
17
+ export async function handleSignalRadarInboundDelivery(input: {
18
+ message: SignalRadarInboundMessage;
19
+ metadata: { deliveryCount: number; messageId?: string };
20
+ maxDeliveries: number;
21
+ runWorker: (
22
+ message: SignalRadarInboundMessage,
23
+ metadata: { deliveryCount: number; messageId?: string },
24
+ ) => Promise<unknown>;
25
+ recordDeadLetter: (input: {
26
+ message: SignalRadarInboundMessage;
27
+ error: unknown;
28
+ deliveryCount: number;
29
+ }) => Promise<void>;
30
+ }) {
31
+ try {
32
+ await input.runWorker(input.message, input.metadata);
33
+ } catch (error) {
34
+ if (
35
+ classifyInboundFailure(error) === 'permanent' &&
36
+ input.metadata.deliveryCount > input.maxDeliveries
37
+ ) {
38
+ try {
39
+ await input.recordDeadLetter({
40
+ message: input.message,
41
+ error,
42
+ deliveryCount: input.metadata.deliveryCount,
43
+ });
44
+ return;
45
+ } catch (recordError) {
46
+ throw new SignalRadarInboundDeliveryError(recordError);
47
+ }
48
+ }
49
+ throw new SignalRadarInboundDeliveryError(error);
50
+ }
51
+ }
52
+
53
+ export function signalRadarInboundRetry(input: {
54
+ error: unknown;
55
+ deliveryCount: number;
56
+ }) {
57
+ // This function intentionally does no I/O. Vercel's retry callback is
58
+ // synchronous; terminal persistence belongs in the awaited handler above.
59
+ return { afterSeconds: inboundBackoffSeconds(input.deliveryCount) };
60
+ }
@@ -0,0 +1,60 @@
1
+ import { send as vercelQueueSend } from '@vercel/queue';
2
+ import type { SignalRadarInboundMessage } from '@deepline/monitors/signal-radars/inbound-message';
3
+ import { isTestOnlyRuntime } from '../../play-runtime/runtime-env';
4
+
5
+ // Durable Vercel Queues front-queue for Monitor inbound webhook events.
6
+ // The receiver produces onto this topic (auth -> enqueue -> 200); the air-gapped
7
+ // worker at apps/deepline-api/src/app/api/queues/signal-radar-inbound/route.ts consumes it and runs
8
+ // the full ingestion machinery. See docs/provider-monitor-playbook.md.
9
+ export const SIGNAL_RADAR_INBOUND_TOPIC = 'signal-radar-inbound';
10
+
11
+ // Retention set to the Vercel Queues maximum (7 days). This is the ceiling on
12
+ // the worst Neon/Convex outage the buffer can survive: while downstream is down,
13
+ // the receiver still returns 200 and the message sits here, redelivering until it
14
+ // drains or expires. Sized to exceed any tolerable Neon outage window.
15
+ export const SIGNAL_RADAR_INBOUND_RETENTION_SECONDS = 604_800;
16
+
17
+ export type SignalRadarInboundSendOptions = {
18
+ idempotencyKey?: string;
19
+ /**
20
+ * Test-runtime delivery driver. The public receiver may set this only after
21
+ * proving the request is synthetic and test-authorized. It exercises the
22
+ * same queue worker locally, where Vercel Queues cannot mint its OIDC token.
23
+ */
24
+ inlineTestWorker?: boolean;
25
+ runInlineTestWorker?: (message: SignalRadarInboundMessage) => Promise<unknown>;
26
+ };
27
+
28
+ // Publish onto the inbound topic. `idempotencyKey` is the Neon-free provider
29
+ // event key (belt-and-suspenders publish-side dedupe within the message TTL;
30
+ // the real guarantee is the worker's consumer-side dedupe on the same grain).
31
+ export async function send(
32
+ message: SignalRadarInboundMessage,
33
+ options?: SignalRadarInboundSendOptions,
34
+ ) {
35
+ if (options?.inlineTestWorker) {
36
+ if (!isTestOnlyRuntime()) {
37
+ throw new Error(
38
+ 'The synthetic inbound queue driver is unavailable outside a test runtime.',
39
+ );
40
+ }
41
+ // The owning app supplies its real worker; packages cannot import app routes.
42
+ if (!options.runInlineTestWorker) {
43
+ throw new Error('The synthetic inbound queue driver requires an app worker.');
44
+ }
45
+ const result = await options.runInlineTestWorker(message);
46
+ return {
47
+ messageId: `test-inline:${options.idempotencyKey ?? crypto.randomUUID()}`,
48
+ // The test-only driver executes Tier 2 synchronously. Preserve its
49
+ // outcome for the synthetic receiver so a Gauntlet can assert a billing
50
+ // suspension without changing the real provider-facing queue contract.
51
+ result,
52
+ };
53
+ }
54
+ return vercelQueueSend(SIGNAL_RADAR_INBOUND_TOPIC, message, {
55
+ retentionSeconds: SIGNAL_RADAR_INBOUND_RETENTION_SECONDS,
56
+ ...(options?.idempotencyKey
57
+ ? { idempotencyKey: options.idempotencyKey }
58
+ : {}),
59
+ });
60
+ }
@@ -1,6 +1,6 @@
1
1
  import { lookup } from 'node:dns/promises';
2
2
  import { isIP } from 'node:net';
3
- import { DEEPLINE_ANALYTICS_BROWSER_OBJECT } from '@/lib/analytics/public';
3
+ import { DEEPLINE_ANALYTICS_BROWSER_OBJECT } from '@deepline/monitors/analytics-public';
4
4
 
5
5
  export type SnitcherInstallationCheck = {
6
6
  domain: string;
@@ -1,8 +1,8 @@
1
1
  import { createHmac, randomUUID } from 'node:crypto';
2
2
  import { isIP } from 'node:net';
3
- import { internal } from '@convex/_generated/api';
3
+ import { internal } from '@deepline/convex-client/function-references';
4
4
  import { hasSnitcherSessionIdentity } from '@deepline/ingestion-v2/snitcher-session-identity';
5
- import { getRequiredInternalConvexClient } from '@/lib/convex/internal-client';
5
+ import { getRequiredInternalConvexClient } from '@deepline/convex-client/internal-client';
6
6
 
7
7
  export { hasSnitcherSessionIdentity };
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { buildProviderWebhookCallbackUrl } from '@deepline/monitors/provider-webhook-monitor-runtime';
2
- import { DEEPLINE_ANALYTICS_BROWSER_OBJECT } from '@/lib/analytics/public';
2
+ import { DEEPLINE_ANALYTICS_BROWSER_OBJECT } from '@deepline/monitors/analytics-public';
3
3
 
4
4
  const SNITCHER_RADAR_API_URL = 'https://api.snitcher.com/radar/operator/v1';
5
5
  const SNITCHER_INTERNAL_IDENTIFIER_PREFIX = 'dlr1_';
@@ -2,7 +2,7 @@ import { TRACKING_PROVIDER_POST_DEPLOY_GUIDANCE } from '@deepline/monitors/track
2
2
  import {
3
3
  ANALYTICS_INTEGRATION_SLUG,
4
4
  ANALYTICS_PUBLIC_TOOL,
5
- } from '@/lib/analytics/public';
5
+ } from '@deepline/monitors/analytics-public';
6
6
 
7
7
  export const TRACKING_PROVIDER_INTEGRATIONS = {
8
8
  vector: {
@@ -0,0 +1,13 @@
1
+ /**
2
+ * True while running inside a production build — Vercel/CI `next build` (where
3
+ * `CI=1`) and the prebuilt-artifact scripts, plus the prerender phase (where
4
+ * `NEXT_PHASE` is set). Use it to silence high-volume per-operation diagnostics
5
+ * that flood the build log with no build-time signal; they still emit at runtime
6
+ * and in local dev for Axiom/perf debugging.
7
+ */
8
+ export function isBuildContext(): boolean {
9
+ return (
10
+ process.env.CI === '1' ||
11
+ process.env.NEXT_PHASE === 'phase-production-build'
12
+ );
13
+ }
@@ -0,0 +1,160 @@
1
+ import 'server-only';
2
+
3
+ import { workUnitAsyncStorage } from 'next/dist/server/app-render/work-unit-async-storage.external';
4
+ import { AsyncLocalStorage } from 'node:async_hooks';
5
+
6
+ export type LogMetadata = Record<string, unknown>;
7
+
8
+ type RequestStoreLike = {
9
+ headers?: unknown;
10
+ url?: { pathname?: string; search?: string };
11
+ };
12
+
13
+ const storage = new AsyncLocalStorage<LogMetadata>();
14
+ const CONSOLE_METHODS = ['log', 'info', 'warn', 'error', 'debug'] as const;
15
+ const LOG_REQUEST_ID_HEADER = 'x-deepline-request-id';
16
+ const LOG_REQUEST_PATH_HEADER = 'x-deepline-request-path';
17
+ const LOG_REQUEST_METHOD_HEADER = 'x-deepline-request-method';
18
+
19
+ let isPatched = false;
20
+
21
+ function isPlainRecord(value: unknown): value is Record<string, unknown> {
22
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return false;
23
+ const prototype = Object.getPrototypeOf(value);
24
+ return prototype === Object.prototype || prototype === null;
25
+ }
26
+
27
+ function normalizeText(value: string | null | undefined): string | null {
28
+ if (!value) return null;
29
+ const trimmed = String(value).trim();
30
+ return trimmed.length > 0 ? trimmed : null;
31
+ }
32
+
33
+ function safeHeaderValue(container: unknown, key: string): string | null {
34
+ if (!container || typeof container !== 'object') return null;
35
+ if (
36
+ 'then' in (container as Record<string, unknown>) &&
37
+ typeof (container as { then: unknown }).then === 'function'
38
+ ) {
39
+ return null;
40
+ }
41
+ const getter = (container as { get?: (name: string) => unknown }).get;
42
+ if (typeof getter !== 'function') return null;
43
+ try {
44
+ const value = getter.call(container, key);
45
+ return normalizeText(typeof value === 'string' ? value : null);
46
+ } catch {
47
+ return null;
48
+ }
49
+ }
50
+
51
+ function getRequestStoreFromNext(): unknown {
52
+ try {
53
+ return workUnitAsyncStorage.getStore?.() as unknown;
54
+ } catch {
55
+ return null;
56
+ }
57
+ }
58
+
59
+ function getRequestMetadataFromHeaders(): Record<string, string> | null {
60
+ const requestStore = getRequestStoreFromNext() as RequestStoreLike | null;
61
+ if (!requestStore?.headers) return null;
62
+
63
+ const requestHeaders = requestStore.headers;
64
+ const requestId = normalizeText(
65
+ safeHeaderValue(requestHeaders, LOG_REQUEST_ID_HEADER) ??
66
+ safeHeaderValue(requestHeaders, 'x-vercel-id') ??
67
+ safeHeaderValue(requestHeaders, 'x-request-id'),
68
+ );
69
+ const requestPath =
70
+ normalizeText(safeHeaderValue(requestHeaders, LOG_REQUEST_PATH_HEADER)) ??
71
+ ((): string | null => {
72
+ const pathFromStore =
73
+ requestStore.url &&
74
+ typeof requestStore.url === 'object' &&
75
+ 'pathname' in requestStore.url
76
+ ? String(requestStore.url.pathname ?? '').trim()
77
+ : '';
78
+ return normalizeText(pathFromStore);
79
+ })();
80
+ const requestMethod =
81
+ normalizeText(safeHeaderValue(requestHeaders, LOG_REQUEST_METHOD_HEADER)) ??
82
+ null;
83
+ const vercelRequestId = normalizeText(
84
+ safeHeaderValue(requestHeaders, 'x-vercel-id'),
85
+ );
86
+
87
+ if (!requestId && !requestPath && !requestMethod && !vercelRequestId) {
88
+ return null;
89
+ }
90
+
91
+ const metadata: Record<string, string> = {};
92
+ if (requestId) {
93
+ metadata.request_id = requestId;
94
+ metadata.requestId = requestId;
95
+ }
96
+ if (requestPath) metadata.request_path = requestPath;
97
+ if (requestMethod) metadata.request_method = requestMethod;
98
+ if (vercelRequestId) {
99
+ metadata.vercel_request_id = vercelRequestId;
100
+ metadata.vercelRequestId = vercelRequestId;
101
+ }
102
+ return metadata;
103
+ }
104
+
105
+ function getActiveLogMetadata(): LogMetadata {
106
+ const contextMetadata = storage.getStore();
107
+ const requestMetadata = getRequestMetadataFromHeaders();
108
+
109
+ if (!contextMetadata && requestMetadata) return requestMetadata;
110
+ if (!requestMetadata) return contextMetadata ?? {};
111
+ return { ...requestMetadata, ...contextMetadata };
112
+ }
113
+
114
+ function mergeLogArgs(args: unknown[], metadata: LogMetadata): unknown[] {
115
+ if (args.length === 0) return [metadata];
116
+ const last = args[args.length - 1];
117
+ if (isPlainRecord(last)) {
118
+ return [...args.slice(0, -1), { ...metadata, ...last }];
119
+ }
120
+ return [...args, metadata];
121
+ }
122
+
123
+ function patchConsoleWithMetadata(): void {
124
+ if (isPatched) return;
125
+ isPatched = true;
126
+ const consoleRef = console as unknown as Record<
127
+ (typeof CONSOLE_METHODS)[number],
128
+ (...args: unknown[]) => void
129
+ >;
130
+
131
+ for (const method of CONSOLE_METHODS) {
132
+ const original = consoleRef[method].bind(console);
133
+ consoleRef[method] = ((...args: unknown[]) => {
134
+ const metadata = getActiveLogMetadata();
135
+ if (!metadata || Object.keys(metadata).length === 0) {
136
+ original(...args);
137
+ return;
138
+ }
139
+ original(...mergeLogArgs(args, metadata));
140
+ }) as (...args: unknown[]) => void;
141
+ }
142
+ }
143
+
144
+ export function setLogMetadata(metadata: LogMetadata): void {
145
+ patchConsoleWithMetadata();
146
+ const current = storage.getStore() ?? {};
147
+ storage.enterWith({ ...current, ...metadata });
148
+ }
149
+
150
+ export function withLogMetadata<T>(metadata: LogMetadata, fn: () => T): T {
151
+ patchConsoleWithMetadata();
152
+ const current = storage.getStore() ?? {};
153
+ return storage.run({ ...current, ...metadata }, fn);
154
+ }
155
+
156
+ export function getCurrentRequestMetadata(): LogMetadata {
157
+ return getActiveLogMetadata();
158
+ }
159
+
160
+ patchConsoleWithMetadata();
@@ -0,0 +1,68 @@
1
+ import { randomUUID } from 'node:crypto';
2
+
3
+ const REQUEST_ID_PREFIX = 'req_';
4
+
5
+ export type RequestLogMetadata = Record<string, unknown>;
6
+
7
+ export type RequestLike = {
8
+ method: string;
9
+ headers: { get(name: string): string | null };
10
+ nextUrl?: { pathname: string };
11
+ url?: string;
12
+ };
13
+
14
+ function normalizeText(value: string | null | undefined): string | null {
15
+ if (!value) return null;
16
+ const trimmed = String(value).trim();
17
+ return trimmed.length > 0 ? trimmed : null;
18
+ }
19
+
20
+ function resolveRequestPath(req: RequestLike): string {
21
+ if (req.nextUrl?.pathname) return req.nextUrl.pathname;
22
+ if (req.url) {
23
+ try {
24
+ return new URL(req.url).pathname;
25
+ } catch {
26
+ return String(req.url);
27
+ }
28
+ }
29
+ return '(unknown)';
30
+ }
31
+
32
+ function resolveRequestId(
33
+ req: RequestLike,
34
+ requestId: string | null | undefined,
35
+ ): string {
36
+ const explicit = normalizeText(requestId);
37
+ if (explicit) return explicit;
38
+ const vercelRequestId = normalizeText(req.headers.get('x-vercel-id'));
39
+ if (vercelRequestId) return vercelRequestId;
40
+ return `${REQUEST_ID_PREFIX}${randomUUID().replace(/-/g, '').slice(0, 12)}`;
41
+ }
42
+
43
+ export function buildRequestLogMetadata(
44
+ req: RequestLike,
45
+ input: {
46
+ requestId?: string | null;
47
+ requestPath?: string | null;
48
+ requestMethod?: string | null;
49
+ extraMetadata?: RequestLogMetadata;
50
+ } = {},
51
+ ): RequestLogMetadata {
52
+ const resolvedRequestId = resolveRequestId(req, input.requestId);
53
+ const vercelRequestId = normalizeText(req.headers.get('x-vercel-id'));
54
+ const resolvedRequestPath =
55
+ normalizeText(input.requestPath) ?? resolveRequestPath(req);
56
+ const resolvedRequestMethod =
57
+ normalizeText(input.requestMethod) ?? req.method.toUpperCase();
58
+
59
+ return {
60
+ request_id: resolvedRequestId,
61
+ requestId: resolvedRequestId,
62
+ request_path: resolvedRequestPath,
63
+ request_method: resolvedRequestMethod,
64
+ ...(vercelRequestId ? { vercel_request_id: vercelRequestId } : {}),
65
+ ...(vercelRequestId ? { vercelRequestId } : {}),
66
+ ...(input.extraMetadata ?? {}),
67
+ };
68
+ }