deepline 0.3.88 → 0.3.90

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 (280) hide show
  1. package/contracts/install-commands.json +29 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +652 -39
  3. package/dist/bundling-sources/sdk/src/config.ts +77 -0
  4. package/dist/bundling-sources/sdk/src/http.ts +76 -30
  5. package/dist/bundling-sources/sdk/src/index.ts +10 -0
  6. package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
  7. package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
  8. package/dist/bundling-sources/sdk/src/play.ts +15 -1
  9. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
  10. package/dist/bundling-sources/sdk/src/release.ts +16 -9
  11. package/dist/bundling-sources/sdk/src/types.ts +106 -4
  12. package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
  13. package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
  14. package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
  15. package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
  16. package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
  17. package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
  18. package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
  19. package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
  20. package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
  21. package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
  22. package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
  23. package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
  24. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
  25. package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
  26. package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
  27. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
  28. package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
  29. package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
  30. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +270 -0
  31. package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
  32. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
  33. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
  34. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +471 -0
  35. package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
  36. package/dist/bundling-sources/shared_libs/monitors/package.json +36 -0
  37. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
  38. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +305 -0
  39. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
  40. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
  41. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
  42. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
  43. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
  44. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
  45. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
  46. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
  47. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
  48. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
  49. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
  50. package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
  51. package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
  52. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
  53. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
  54. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
  55. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
  56. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
  57. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +93 -0
  58. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
  59. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
  60. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
  61. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
  62. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
  63. package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
  64. package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
  65. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
  66. package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
  67. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
  68. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
  69. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
  70. package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
  71. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
  73. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +135 -12
  74. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
  75. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +77 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1159 -166
  79. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
  80. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +103 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
  85. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +29 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
  89. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
  92. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
  93. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
  95. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
  97. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
  99. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
  102. package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  105. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
  108. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
  117. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
  118. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
  119. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
  120. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
  121. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
  122. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
  123. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
  124. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
  125. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
  126. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
  127. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
  128. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
  129. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
  130. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
  131. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
  132. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
  133. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
  134. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +4 -0
  135. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
  136. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -2
  137. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
  138. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
  139. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +90 -13
  140. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
  141. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
  142. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +21 -0
  143. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
  144. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -43
  145. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -213
  146. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
  147. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
  148. package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
  149. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +12 -0
  150. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
  151. package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
  152. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
  153. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +38 -2
  154. package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
  155. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
  156. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
  157. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +37 -1
  158. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
  159. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
  160. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
  161. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
  162. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
  163. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
  164. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
  165. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
  166. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
  167. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
  168. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
  169. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
  170. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
  171. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
  172. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
  173. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
  174. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
  175. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
  176. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
  177. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
  178. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
  179. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
  180. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
  181. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
  182. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
  183. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
  184. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
  185. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
  186. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
  187. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
  188. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
  189. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
  190. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
  191. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
  192. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
  193. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
  194. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
  195. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
  196. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
  197. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
  198. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
  199. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
  200. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
  201. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
  202. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
  203. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
  204. package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
  205. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
  206. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
  207. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
  208. package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
  209. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +8 -3
  210. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
  211. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
  212. package/dist/bundling-sources/shared_libs/plays/contracts.ts +8 -14
  213. package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
  214. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
  215. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
  216. package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
  217. package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
  218. package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
  219. package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
  220. package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
  221. package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
  222. package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
  223. package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
  224. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
  225. package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
  226. package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
  227. package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
  228. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +50 -15
  229. package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
  230. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  231. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
  232. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
  233. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +566 -0
  234. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
  235. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +60 -0
  236. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
  237. package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
  238. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
  239. package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
  240. package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
  241. package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
  242. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
  243. package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
  244. package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
  245. package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
  246. package/dist/bundling-sources/shared_libs/runtime-env.ts +12 -0
  247. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
  248. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +35 -0
  249. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
  250. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
  251. package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
  252. package/dist/cli/getting-started.d.mts +52 -0
  253. package/dist/cli/getting-started.d.ts +52 -0
  254. package/dist/cli/getting-started.js +65 -0
  255. package/dist/cli/getting-started.mjs +36 -0
  256. package/dist/cli/index.d.mts +9 -0
  257. package/dist/cli/index.d.ts +9 -0
  258. package/dist/cli/index.js +1611 -453
  259. package/dist/cli/index.mjs +1596 -447
  260. package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-BaJfE-5H.d.mts} +136 -10
  261. package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-BaJfE-5H.d.ts} +136 -10
  262. package/dist/index.d.mts +910 -155
  263. package/dist/index.d.ts +910 -155
  264. package/dist/index.js +550 -64
  265. package/dist/index.mjs +550 -64
  266. package/dist/install-integrity.json +193 -4
  267. package/dist/monitor-fleet-contract.d.mts +138 -0
  268. package/dist/monitor-fleet-contract.d.ts +138 -0
  269. package/dist/monitor-fleet-contract.js +404 -0
  270. package/dist/monitor-fleet-contract.mjs +367 -0
  271. package/dist/plays/bundle-play-file.d.mts +8 -3
  272. package/dist/plays/bundle-play-file.d.ts +8 -3
  273. package/dist/plays/bundle-play-file.mjs +100 -20
  274. package/dist/release.d.mts +255 -0
  275. package/dist/release.d.ts +255 -0
  276. package/dist/release.js +215 -0
  277. package/dist/release.mjs +188 -0
  278. package/package.json +23 -4
  279. /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
  280. /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
@@ -0,0 +1,142 @@
1
+ import type {
2
+ SandboxCleanupInput,
3
+ SandboxCleanupJob,
4
+ SandboxCleanupOutcome,
5
+ } from '../../play-runs/sandbox-cleanup/contracts';
6
+ import type { SandboxCleanupPorts } from '../../play-runs/sandbox-cleanup/ports';
7
+
8
+ /**
9
+ * Creates the Sandbox Cleanup job.
10
+ *
11
+ * Capacity ends only after a provider-confirmed deletion or documented
12
+ * already-absent result. Every other provider result retains the durable
13
+ * cleanup obligation and schedules a fenced retry.
14
+ */
15
+ export function createSandboxCleanupJob(
16
+ ports: SandboxCleanupPorts,
17
+ ): SandboxCleanupJob {
18
+ return {
19
+ async reconcile(
20
+ input: SandboxCleanupInput,
21
+ ): Promise<SandboxCleanupOutcome> {
22
+ validate(input);
23
+ if (
24
+ input.resource.provider === 'modal' &&
25
+ !input.resource.routingDomain?.trim()
26
+ ) {
27
+ const reason =
28
+ 'missing_routing_domain: Modal cleanup requires its persisted app id.';
29
+ const blocked = await ports.store.block({
30
+ resource: input.resource,
31
+ reason,
32
+ });
33
+ return blocked === 'blocked'
34
+ ? { kind: 'blocked', reason }
35
+ : { kind: 'completion_rejected', completion: 'missing_obligation' };
36
+ }
37
+
38
+ try {
39
+ const deletion = await ports.deletion.delete(input);
40
+ if (deletion.kind === 'failed') {
41
+ if (deletion.code === 'missing_routing_domain') {
42
+ const reason = `missing_routing_domain: ${deletion.detail}`.slice(
43
+ 0,
44
+ 2_000,
45
+ );
46
+ const blocked = await ports.store.block({
47
+ resource: input.resource,
48
+ reason,
49
+ });
50
+ return blocked === 'blocked'
51
+ ? { kind: 'blocked', reason }
52
+ : {
53
+ kind: 'completion_rejected',
54
+ completion: 'missing_obligation',
55
+ };
56
+ }
57
+ return await scheduleRetry(ports, input, deletion.detail);
58
+ }
59
+
60
+ // A control-plane retry must never keep a provider-confirmed-deleted
61
+ // resource consuming capacity. This precedes cleanup row completion.
62
+ await ports.store.releaseCapacity({ resource: input.resource });
63
+ const completion = await ports.store.complete({
64
+ resource: input.resource,
65
+ providerOutcome: deletion.kind,
66
+ observedRoutingDomain: deletion.routingDomain,
67
+ });
68
+ if (
69
+ completion === 'completed' ||
70
+ completion === 'late_success_accepted' ||
71
+ completion === 'already_deleted'
72
+ ) {
73
+ return {
74
+ kind: 'completed',
75
+ providerOutcome: deletion.kind,
76
+ completion,
77
+ };
78
+ }
79
+ // A provider confirmation from the wrong routing domain is not a
80
+ // completion rejection: it is a real external-side-effect ambiguity.
81
+ // Preserve the obligation and retry through its existing claim fence.
82
+ if (completion === 'wrong_routing_domain') {
83
+ return await scheduleRetry(
84
+ ports,
85
+ input,
86
+ `${input.resource.provider} sandbox ${input.resource.sandboxId} cleanup confirmation used the wrong routing domain.`,
87
+ );
88
+ }
89
+ return { kind: 'completion_rejected', completion };
90
+ } catch (error) {
91
+ return await scheduleRetry(
92
+ ports,
93
+ input,
94
+ error instanceof Error ? error.message : String(error),
95
+ );
96
+ }
97
+ },
98
+ };
99
+ }
100
+
101
+ async function scheduleRetry(
102
+ ports: SandboxCleanupPorts,
103
+ input: SandboxCleanupInput,
104
+ error: string,
105
+ ): Promise<SandboxCleanupOutcome> {
106
+ const retryAfterMs = retryDelay(input.resource.failureCount + 1);
107
+ const scheduled = await ports.store.retry({
108
+ resource: input.resource,
109
+ error,
110
+ retryAfterMs,
111
+ });
112
+ return scheduled === 'retry_scheduled'
113
+ ? { kind: 'retry_scheduled', retryAfterMs }
114
+ : { kind: 'retry_rejected' };
115
+ }
116
+
117
+ function retryDelay(nextFailureCount: number): number {
118
+ return Math.min(
119
+ 5 * 60_000,
120
+ 1_000 * 2 ** Math.min(8, Math.max(0, nextFailureCount - 1)),
121
+ );
122
+ }
123
+
124
+ function validate(input: SandboxCleanupInput): void {
125
+ const { resource } = input;
126
+ if (!resource.sandboxId.trim() || !resource.runId.trim()) {
127
+ throw new Error('Sandbox Cleanup requires non-empty sandbox and run ids.');
128
+ }
129
+ if (!Number.isSafeInteger(resource.attempt) || resource.attempt < 1) {
130
+ throw new Error('Sandbox Cleanup requires a positive attempt number.');
131
+ }
132
+ if (
133
+ !Number.isSafeInteger(resource.cleanupAttempt) ||
134
+ resource.cleanupAttempt < 1 ||
135
+ !Number.isSafeInteger(resource.failureCount) ||
136
+ resource.failureCount < 0 ||
137
+ !Number.isFinite(input.timeoutMs) ||
138
+ input.timeoutMs <= 0
139
+ ) {
140
+ throw new Error('Sandbox Cleanup received invalid cleanup state.');
141
+ }
142
+ }
@@ -0,0 +1,42 @@
1
+ import type {
2
+ SandboxCleanupDeleteOutcome,
3
+ SandboxCleanupResource,
4
+ } from '../../play-runs/sandbox-cleanup/contracts';
5
+
6
+ /** Provider delete proof. A timeout must be reported as `failed`, never cast to deletion. */
7
+ export type SandboxDeletion = {
8
+ delete(input: {
9
+ resource: SandboxCleanupResource;
10
+ timeoutMs: number;
11
+ }): Promise<SandboxCleanupDeleteOutcome>;
12
+ };
13
+
14
+ /** Durable cleanup state transitions, all fenced by the claim represented in `resource`. */
15
+ export type SandboxCleanupStore = {
16
+ releaseCapacity(input: { resource: SandboxCleanupResource }): Promise<void>;
17
+ complete(input: {
18
+ resource: SandboxCleanupResource;
19
+ providerOutcome: 'deleted' | 'already_absent';
20
+ observedRoutingDomain: string | null;
21
+ }): Promise<
22
+ | 'completed'
23
+ | 'late_success_accepted'
24
+ | 'already_deleted'
25
+ | 'missing_obligation'
26
+ | 'wrong_routing_domain'
27
+ >;
28
+ retry(input: {
29
+ resource: SandboxCleanupResource;
30
+ error: string;
31
+ retryAfterMs: number;
32
+ }): Promise<'retry_scheduled' | 'rejected'>;
33
+ block(input: {
34
+ resource: SandboxCleanupResource;
35
+ reason: string;
36
+ }): Promise<'blocked' | 'rejected'>;
37
+ };
38
+
39
+ export type SandboxCleanupPorts = {
40
+ deletion: SandboxDeletion;
41
+ store: SandboxCleanupStore;
42
+ };
@@ -0,0 +1,102 @@
1
+ import {
2
+ blockPostgresSchedulerSandboxCleanupJob,
3
+ completePostgresSchedulerSandboxCleanupJob,
4
+ retryPostgresSchedulerSandboxCleanupJob,
5
+ type PostgresSchedulerOptions,
6
+ type PostgresSchedulerQueryClient,
7
+ } from '../../scheduler-backends/postgres';
8
+ import { releaseRuntimeSandboxCapacityLeaseForSandbox } from '../../scheduler-backends/runtime-sandbox-capacity';
9
+
10
+ import type { SandboxCleanupPorts } from '../../play-runs/sandbox-cleanup/ports';
11
+
12
+ export type SandboxCleanupPostgresAdapterInput = {
13
+ runWithClient: <T>(
14
+ fn: (client: PostgresSchedulerQueryClient) => Promise<T>,
15
+ ) => Promise<T>;
16
+ leaseOwner: string;
17
+ schedulerOptions?: Pick<PostgresSchedulerOptions, 'schema'>;
18
+ };
19
+
20
+ /**
21
+ * Runtime-Postgres Adapter for SandboxCleanup. The Job owns the state
22
+ * machine; this Adapter only translates its fenced transitions into the
23
+ * existing durable tables and capacity ledger.
24
+ */
25
+ export function createPostgresSandboxCleanupStore(
26
+ input: SandboxCleanupPostgresAdapterInput,
27
+ ): SandboxCleanupPorts['store'] {
28
+ const options = input.schedulerOptions ?? {};
29
+ return {
30
+ async releaseCapacity({ resource }) {
31
+ await input.runWithClient(async (client) => {
32
+ await releaseRuntimeSandboxCapacityLeaseForSandbox(
33
+ client,
34
+ {
35
+ runId: resource.runId,
36
+ provider: resource.provider,
37
+ sandboxId: resource.sandboxId,
38
+ routingDomain: resource.routingDomain,
39
+ },
40
+ options,
41
+ );
42
+ });
43
+ },
44
+ async complete({ resource, providerOutcome, observedRoutingDomain }) {
45
+ return await input.runWithClient(
46
+ async (client) =>
47
+ await completePostgresSchedulerSandboxCleanupJob(
48
+ client,
49
+ {
50
+ provider: resource.provider,
51
+ sandboxId: resource.sandboxId,
52
+ routingDomain: resource.routingDomain,
53
+ runId: resource.runId,
54
+ attempt: resource.attempt,
55
+ cleanupAttempt: resource.cleanupAttempt,
56
+ leaseOwner: input.leaseOwner,
57
+ providerOutcome,
58
+ observedRoutingDomain,
59
+ },
60
+ options,
61
+ ),
62
+ );
63
+ },
64
+ async retry({ resource, error, retryAfterMs }) {
65
+ const outcome = await input.runWithClient(
66
+ async (client) =>
67
+ await retryPostgresSchedulerSandboxCleanupJob(
68
+ client,
69
+ {
70
+ provider: resource.provider,
71
+ sandboxId: resource.sandboxId,
72
+ routingDomain: resource.routingDomain,
73
+ leaseOwner: input.leaseOwner,
74
+ claimGeneration: resource.cleanupAttempt,
75
+ error,
76
+ retryAfterMs,
77
+ },
78
+ options,
79
+ ),
80
+ );
81
+ return outcome === 'retry_scheduled' ? outcome : 'rejected';
82
+ },
83
+ async block({ resource, reason }) {
84
+ const outcome = await input.runWithClient(
85
+ async (client) =>
86
+ await blockPostgresSchedulerSandboxCleanupJob(
87
+ client,
88
+ {
89
+ provider: resource.provider,
90
+ sandboxId: resource.sandboxId,
91
+ routingDomain: resource.routingDomain,
92
+ leaseOwner: input.leaseOwner,
93
+ claimGeneration: resource.cleanupAttempt,
94
+ reason,
95
+ },
96
+ options,
97
+ ),
98
+ );
99
+ return outcome === 'blocked' ? outcome : 'rejected';
100
+ },
101
+ };
102
+ }
@@ -0,0 +1,60 @@
1
+ import {
2
+ directCompletedTerminalContract,
3
+ type DirectCompletedTerminalContract,
4
+ } from '../../scheduler-backends/terminal-contract';
5
+
6
+ /**
7
+ * The authenticated authority for one runner attempt to write the Play Run's
8
+ * terminal state. It is intentionally a terminal concept: it carries neither
9
+ * scheduler-row handles nor transport headers.
10
+ */
11
+ export type PlayRunTerminalAuthority = {
12
+ terminalContract: DirectCompletedTerminalContract;
13
+ leaseToken: string;
14
+ };
15
+
16
+ /** Parse ingress-only values into the authority the terminal job accepts. */
17
+ export function resolvePlayRunTerminalAuthority(input: {
18
+ terminalContract?: unknown;
19
+ leaseToken?: unknown;
20
+ }): PlayRunTerminalAuthority | null {
21
+ const terminalContract = directCompletedTerminalContract(
22
+ input.terminalContract,
23
+ );
24
+ if (
25
+ terminalContract === null ||
26
+ typeof input.leaseToken !== 'string' ||
27
+ !input.leaseToken.trim()
28
+ ) {
29
+ return null;
30
+ }
31
+ return {
32
+ terminalContract,
33
+ leaseToken: input.leaseToken.trim(),
34
+ };
35
+ }
36
+
37
+ /** The only terminal results visible to an ingress caller. */
38
+ export type PlayRunTerminalOutcome =
39
+ | { kind: 'direct_completed' }
40
+ | { kind: 'stale_attempt_cleaned' }
41
+ | { kind: 'already_terminal' }
42
+ | { kind: 'compatibility_wake_queued' }
43
+ | { kind: 'not_found_or_fence_rejected' };
44
+
45
+ /**
46
+ * One detached runner's attempt to settle a Play Run. The queue name belongs
47
+ * here because a compatibility wake is a terminal delivery obligation, not a
48
+ * caller-side scheduler detail.
49
+ */
50
+ export type PlayRunTerminalInput = {
51
+ queueName: string;
52
+ runId: string;
53
+ attempt: number;
54
+ authority?: PlayRunTerminalAuthority | null;
55
+ result: unknown;
56
+ };
57
+
58
+ export type PlayRunTerminalJob = {
59
+ accept(input: PlayRunTerminalInput): Promise<PlayRunTerminalOutcome>;
60
+ };
@@ -0,0 +1,16 @@
1
+ export { resolvePlayRunTerminalAuthority } from '../../play-runs/terminal/contracts';
2
+ export { createPlayRunTerminalJob } from '../../play-runs/terminal/job';
3
+ export { createPostgresPlayRunTerminalPorts } from '../../play-runs/terminal/postgres-adapter';
4
+ export type {
5
+ PlayRunTerminalAuthority,
6
+ PlayRunTerminalInput,
7
+ PlayRunTerminalJob,
8
+ PlayRunTerminalOutcome,
9
+ } from '../../play-runs/terminal/contracts';
10
+ export type {
11
+ CompatibilityTerminalRecorder,
12
+ DirectTerminalCommitOutcome,
13
+ DirectTerminalCommitter,
14
+ PlayRunTerminalPorts,
15
+ RunnerTerminalWakePublisher,
16
+ } from '../../play-runs/terminal/ports';
@@ -0,0 +1,78 @@
1
+ import {
2
+ resolvePlayRunTerminalAuthority,
3
+ type PlayRunTerminalInput,
4
+ type PlayRunTerminalJob,
5
+ type PlayRunTerminalOutcome,
6
+ } from '../../play-runs/terminal/contracts';
7
+ import type { PlayRunTerminalPorts } from '../../play-runs/terminal/ports';
8
+
9
+ /**
10
+ * Play Run Terminal Job.
11
+ *
12
+ * The job owns the terminal transition law:
13
+ *
14
+ * atomic direct transition → terminal outcome
15
+ * otherwise durable compatibility receipt → wake
16
+ *
17
+ * Infrastructure only supplies the three capabilities. In particular, no
18
+ * caller can accidentally publish a wake before the compatibility receipt is
19
+ * durable, or publish after a stale fence rejected its write.
20
+ */
21
+ export function createPlayRunTerminalJob(
22
+ ports: PlayRunTerminalPorts,
23
+ ): PlayRunTerminalJob {
24
+ return {
25
+ async accept(input: PlayRunTerminalInput): Promise<PlayRunTerminalOutcome> {
26
+ // The public compatibility facade historically accepted a manually
27
+ // constructed authority as well as the parsed ingress value. Normalize
28
+ // it again here so whitespace cannot turn an invalid lease into a direct
29
+ // terminal write when a caller bypasses the parser.
30
+ const authority = resolvePlayRunTerminalAuthority(input.authority ?? {});
31
+ const direct = authority
32
+ ? await ports.directCommitter.commit({
33
+ runId: input.runId,
34
+ attempt: input.attempt,
35
+ authority,
36
+ result: input.result,
37
+ queueName: input.queueName,
38
+ // An authority exists only for the one terminal contract this
39
+ // build recognizes, and that contract is what proves the durable
40
+ // compute-billing controller. An absent or unrecognized contract
41
+ // never reaches here: it resolves to null above and wakes instead.
42
+ allowCappedCompletion: true,
43
+ })
44
+ : 'wake_required';
45
+
46
+ if (direct === 'not_found') {
47
+ return { kind: 'not_found_or_fence_rejected' };
48
+ }
49
+ if (direct === 'completed') {
50
+ return { kind: 'direct_completed' };
51
+ }
52
+ if (direct === 'stale_cleaned') {
53
+ return { kind: 'stale_attempt_cleaned' };
54
+ }
55
+ if (direct === 'already_terminal') {
56
+ // Mixed-version recovery is first-write-wins. Re-emitting can retire a
57
+ // historical parked invocation whose prior transition predates atomic
58
+ // retirement-event recording.
59
+ await ports.wakePublisher.publish(input);
60
+ return { kind: 'already_terminal' };
61
+ }
62
+
63
+ const recorded = await ports.compatibilityRecorder.record({
64
+ runId: input.runId,
65
+ attempt: input.attempt,
66
+ result: input.result,
67
+ });
68
+ if (!recorded) {
69
+ return { kind: 'not_found_or_fence_rejected' };
70
+ }
71
+
72
+ // The event carries no terminal payload. A resumed attempt reads truth
73
+ // from its durable store rather than trusting a message body.
74
+ await ports.wakePublisher.publish(input);
75
+ return { kind: 'compatibility_wake_queued' };
76
+ },
77
+ };
78
+ }
@@ -0,0 +1,54 @@
1
+ import type {
2
+ PlayRunTerminalAuthority,
3
+ PlayRunTerminalInput,
4
+ } from '../../play-runs/terminal/contracts';
5
+
6
+ /** The result of the atomic terminal-transition capability. */
7
+ export type DirectTerminalCommitOutcome =
8
+ | 'completed'
9
+ | 'stale_cleaned'
10
+ | 'already_terminal'
11
+ | 'not_found'
12
+ | 'wake_required';
13
+
14
+ /**
15
+ * Capability for the modern atomic terminal transition. An implementation
16
+ * commits run truth, cleanup/billing obligations, terminal log outbox, and
17
+ * retirement event as one transaction when it returns `completed`.
18
+ */
19
+ export type DirectTerminalCommitter = {
20
+ commit(input: {
21
+ runId: string;
22
+ attempt: number;
23
+ authority: PlayRunTerminalAuthority;
24
+ result: unknown;
25
+ queueName: string;
26
+ allowCappedCompletion: boolean;
27
+ }): Promise<DirectTerminalCommitOutcome>;
28
+ };
29
+
30
+ /**
31
+ * Compatibility-only durable write. It persists a runner terminal before the
32
+ * wake is published; false means a stale/missing attempt won and no event may
33
+ * be emitted.
34
+ */
35
+ export type CompatibilityTerminalRecorder = {
36
+ record(input: {
37
+ runId: string;
38
+ attempt: number;
39
+ result: unknown;
40
+ }): Promise<boolean>;
41
+ };
42
+
43
+ /** Publishes the wake only after terminal truth has become durable. */
44
+ export type RunnerTerminalWakePublisher = {
45
+ publish(
46
+ input: Pick<PlayRunTerminalInput, 'queueName' | 'runId' | 'attempt'>,
47
+ ): Promise<void>;
48
+ };
49
+
50
+ export type PlayRunTerminalPorts = {
51
+ directCommitter: DirectTerminalCommitter;
52
+ compatibilityRecorder: CompatibilityTerminalRecorder;
53
+ wakePublisher: RunnerTerminalWakePublisher;
54
+ };
@@ -0,0 +1,71 @@
1
+ import { ABSURD_WAKE_CHANNEL } from '@deepline/absurd/sdk';
2
+
3
+ import { absurdRunnerTerminalEventName } from '../../scheduler-backends/absurd-shared';
4
+ import {
5
+ directCompletePostgresSchedulerRunnerTerminal,
6
+ recordPostgresSchedulerRunnerTerminal,
7
+ type PostgresSchedulerQueryClient,
8
+ } from '../../scheduler-backends/postgres';
9
+ import type { PlayRunTerminalPorts } from '../../play-runs/terminal/ports';
10
+
11
+ /**
12
+ * Postgres implementation of the Play Run Terminal capabilities.
13
+ *
14
+ * This adapter is intentionally the only place this module knows scheduler
15
+ * SQL, the Absurd event name, or PostgreSQL notification transport.
16
+ */
17
+ export function createPostgresPlayRunTerminalPorts(input: {
18
+ client: PostgresSchedulerQueryClient;
19
+ schema?: string;
20
+ }): PlayRunTerminalPorts {
21
+ const options = input.schema ? { schema: input.schema } : undefined;
22
+ return {
23
+ directCommitter: {
24
+ async commit(terminal) {
25
+ return await directCompletePostgresSchedulerRunnerTerminal(
26
+ input.client,
27
+ {
28
+ runId: terminal.runId,
29
+ attempt: terminal.attempt,
30
+ leaseToken: terminal.authority.leaseToken,
31
+ result: terminal.result,
32
+ terminalLogOutbox: 'ctx_log_tail',
33
+ allowCappedCompletion: terminal.allowCappedCompletion,
34
+ engineWake: {
35
+ queueName: terminal.queueName,
36
+ eventName: absurdRunnerTerminalEventName(
37
+ terminal.runId,
38
+ terminal.attempt,
39
+ ),
40
+ wakeChannel: ABSURD_WAKE_CHANNEL,
41
+ },
42
+ },
43
+ options,
44
+ );
45
+ },
46
+ },
47
+ compatibilityRecorder: {
48
+ async record(terminal) {
49
+ return await recordPostgresSchedulerRunnerTerminal(
50
+ input.client,
51
+ terminal,
52
+ options,
53
+ );
54
+ },
55
+ },
56
+ wakePublisher: {
57
+ async publish(terminal) {
58
+ await input.client.query(
59
+ `WITH emitted AS (
60
+ SELECT absurd.emit_event($1, $2, 'null'::jsonb)
61
+ )
62
+ SELECT pg_notify('${ABSURD_WAKE_CHANNEL}', $1) FROM emitted`,
63
+ [
64
+ terminal.queueName,
65
+ absurdRunnerTerminalEventName(terminal.runId, terminal.attempt),
66
+ ],
67
+ );
68
+ },
69
+ },
70
+ };
71
+ }
@@ -1,8 +1,10 @@
1
+ import { bouncebanBatchStrategies } from './/bounceban-batching';
1
2
  import type { AnyBatchOperationStrategy } from './batching-types';
2
3
  import { bettercontactBatchStrategies } from './bettercontact-batching';
3
4
  import { DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES } from './default-batch-strategies';
4
5
  import { fullenrichBatchStrategies } from './fullenrich-batching';
5
6
  import { opensosdataBatchStrategies } from './opensosdata-batching';
7
+ import { zerobounceBatchStrategies } from './zerobounce-batching';
6
8
  import { testAsyncBatchStrategies } from './test-async-batching';
7
9
 
8
10
  export const PLAY_RUNTIME_BATCH_OPERATION_REGISTRY: Record<
@@ -11,9 +13,11 @@ export const PLAY_RUNTIME_BATCH_OPERATION_REGISTRY: Record<
11
13
  > = {
12
14
  ...DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES,
13
15
  ...bettercontactBatchStrategies,
16
+ ...bouncebanBatchStrategies,
14
17
  ...fullenrichBatchStrategies,
15
18
  ...opensosdataBatchStrategies,
16
19
  ...testAsyncBatchStrategies,
20
+ ...zerobounceBatchStrategies,
17
21
  };
18
22
 
19
23
  export function getPlayRuntimeBatchStrategy(
@@ -34,6 +34,9 @@ export type PlayRuntimeSemantics = Readonly<{
34
34
  */
35
35
  receiptIdentityEdition: PlayAuthoringContractEdition | null;
36
36
  }>;
37
+ slackHitl: Readonly<{
38
+ defaultTimeoutMs: number;
39
+ }>;
37
40
  }>;
38
41
 
39
42
  function definePlayRuntimeSemantics(
@@ -43,6 +46,7 @@ function definePlayRuntimeSemantics(
43
46
  ...semantics,
44
47
  secrets: Object.freeze({ ...semantics.secrets }),
45
48
  fetch: Object.freeze({ ...semantics.fetch }),
49
+ slackHitl: Object.freeze({ ...semantics.slackHitl }),
46
50
  });
47
51
  }
48
52
 
@@ -66,6 +70,14 @@ const PLAINTEXT_SECRET_SEMANTICS = {
66
70
  secrets: { value: 'plaintext_promise' },
67
71
  } as const;
68
72
 
73
+ const LEGACY_SLACK_HITL_SEMANTICS = {
74
+ defaultTimeoutMs: 24 * 60 * 60 * 1000,
75
+ } as const;
76
+
77
+ const WEEK_LONG_SLACK_HITL_SEMANTICS = {
78
+ defaultTimeoutMs: 7 * 24 * 60 * 60 * 1000,
79
+ } as const;
80
+
69
81
  /**
70
82
  * Exhaustive compatibility registry for worker-visible Play behavior.
71
83
  *
@@ -77,22 +89,27 @@ const PLAY_RUNTIME_SEMANTICS_BY_EDITION = {
77
89
  1: definePlayRuntimeSemantics({
78
90
  authoringContractEdition: 1,
79
91
  ...LEGACY_SEMANTICS,
92
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
80
93
  }),
81
94
  2: definePlayRuntimeSemantics({
82
95
  authoringContractEdition: 2,
83
96
  ...STRICT_SEMANTICS,
97
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
84
98
  }),
85
99
  3: definePlayRuntimeSemantics({
86
100
  authoringContractEdition: 3,
87
101
  ...STRICT_SEMANTICS,
102
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
88
103
  }),
89
104
  4: definePlayRuntimeSemantics({
90
105
  authoringContractEdition: 4,
91
106
  ...PLAINTEXT_SECRET_SEMANTICS,
107
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
92
108
  }),
93
109
  5: definePlayRuntimeSemantics({
94
110
  authoringContractEdition: 5,
95
111
  ...PLAINTEXT_SECRET_SEMANTICS,
112
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
96
113
  fetch: {
97
114
  httpFailure: 'throw_typed_error',
98
115
  persistHttpFailure: false,
@@ -102,6 +119,7 @@ const PLAY_RUNTIME_SEMANTICS_BY_EDITION = {
102
119
  6: definePlayRuntimeSemantics({
103
120
  authoringContractEdition: 6,
104
121
  ...PLAINTEXT_SECRET_SEMANTICS,
122
+ slackHitl: LEGACY_SLACK_HITL_SEMANTICS,
105
123
  fetch: {
106
124
  httpFailure: 'throw_typed_error',
107
125
  persistHttpFailure: false,
@@ -110,6 +128,16 @@ const PLAY_RUNTIME_SEMANTICS_BY_EDITION = {
110
128
  receiptIdentityEdition: 6,
111
129
  },
112
130
  }),
131
+ 7: definePlayRuntimeSemantics({
132
+ authoringContractEdition: 7,
133
+ ...PLAINTEXT_SECRET_SEMANTICS,
134
+ slackHitl: WEEK_LONG_SLACK_HITL_SEMANTICS,
135
+ fetch: {
136
+ httpFailure: 'throw_typed_error',
137
+ persistHttpFailure: false,
138
+ receiptIdentityEdition: 6,
139
+ },
140
+ }),
113
141
  } satisfies Record<PlayAuthoringContractEdition, PlayRuntimeSemantics>;
114
142
 
115
143
  export function resolvePlayRuntimeSemantics(
@@ -152,6 +152,10 @@ export interface PlayRunnerContextConfig {
152
152
  workflowId?: string;
153
153
  playId?: string;
154
154
  runId?: string;
155
+ /** Original run for an explicit user-requested replay. */
156
+ replayedFromRunId?: string | null;
157
+ /** Shared governance/billing root. Differs from runId for async children. */
158
+ rootRunId?: string;
155
159
  runAttempt?: number | null;
156
160
  playName?: string;
157
161
  userEmail?: string;