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
@@ -92,6 +92,20 @@ export class DaytonaSandboxAcquisitionUnavailableError extends Error {
92
92
  }
93
93
  }
94
94
 
95
+ /**
96
+ * A named Daytona create is still changing state after the client deadline.
97
+ * The scheduler must defer and resume this exact identity; falling back or
98
+ * creating another sandbox could execute the Play twice.
99
+ */
100
+ export class DaytonaSandboxTransitionPendingError extends Error {
101
+ constructor(readonly sandboxName: string) {
102
+ super(
103
+ `Daytona sandbox ${sandboxName} is still transitioning after create timed out.`,
104
+ );
105
+ this.name = 'DaytonaSandboxTransitionPendingError';
106
+ }
107
+ }
108
+
95
109
  export function resolveDaytonaSandboxAcquisitionUnavailableReason(
96
110
  errors: readonly string[],
97
111
  ): DaytonaSandboxAcquisitionUnavailableReason | null {
@@ -326,7 +340,8 @@ async function createOneShotDaytonaSandbox(input: {
326
340
  type TimedOutDaytonaSandboxReconciliation =
327
341
  | { kind: 'started'; sandbox: DaytonaSandbox }
328
342
  | { kind: 'deleted' }
329
- | { kind: 'not_found' };
343
+ | { kind: 'not_found' }
344
+ | { kind: 'transition_pending' };
330
345
 
331
346
  async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
332
347
  daytona: DaytonaClient;
@@ -376,23 +391,28 @@ async function reconcileAndDeleteTimedOutDaytonaSandbox(input: {
376
391
  return { kind: 'deleted' };
377
392
  }
378
393
  if (lastDeleteConflict) {
379
- throw new Error(
380
- `Daytona timed-out sandbox ${input.sandboxName} remained in a state transition across the bounded cleanup window. Modal fallback suppressed.`,
381
- { cause: lastDeleteConflict },
382
- );
394
+ return { kind: 'transition_pending' };
383
395
  }
384
396
  return { kind: 'not_found' };
385
397
  }
386
398
 
399
+ function daytonaSandboxName(providerOperationToken?: string | null): string {
400
+ return providerOperationToken
401
+ ? `dl-${providerOperationToken}`
402
+ : `dl-${crypto.randomUUID()}`;
403
+ }
404
+
387
405
  async function createRetriedOneShotDaytonaSandbox(input: {
388
406
  daytona: DaytonaClient;
389
407
  orgId: string;
390
408
  context: DaytonaExecutionContext;
391
409
  emitStage: DaytonaStageEmitter;
392
410
  observeCreateCall?: DaytonaCreateCallObserver;
393
- reserveSandboxCapacity?: (
394
- providerAttempt: number,
395
- ) => Promise<{ leaseId: string; providerOperationToken: string | null }>;
411
+ reserveSandboxCapacity?: (providerAttempt: number) => Promise<{
412
+ leaseId: string;
413
+ providerOperationToken: string | null;
414
+ resumeExistingProviderOperation?: boolean;
415
+ }>;
396
416
  releaseSandboxCapacity?: (leaseId: string) => Promise<void>;
397
417
  nextProviderAttempt: () => number;
398
418
  startedAt: number;
@@ -400,7 +420,6 @@ async function createRetriedOneShotDaytonaSandbox(input: {
400
420
  const errors: string[] = [];
401
421
  for (const [index, delayMs] of DAYTONA_CREATE_RETRY_DELAYS_MS.entries()) {
402
422
  const attempt = input.nextProviderAttempt();
403
- const sandboxName = `dl-${crypto.randomUUID()}`;
404
423
  if (delayMs > 0) {
405
424
  input.emitStage('create:retry', {
406
425
  attempt: index,
@@ -417,6 +436,40 @@ async function createRetriedOneShotDaytonaSandbox(input: {
417
436
  providerAttempt: attempt,
418
437
  });
419
438
  const reservation = await input.reserveSandboxCapacity?.(attempt);
439
+ const sandboxName = daytonaSandboxName(reservation?.providerOperationToken);
440
+ if (reservation?.resumeExistingProviderOperation) {
441
+ if (!input.daytona.get) {
442
+ throw new DaytonaSandboxTransitionPendingError(sandboxName);
443
+ }
444
+ try {
445
+ const sandbox = await input.daytona.get(sandboxName);
446
+ if (sandbox.state !== 'started') {
447
+ throw new DaytonaSandboxTransitionPendingError(sandboxName);
448
+ }
449
+ const acquiredAt = Date.now();
450
+ input.emitStage('create:resumed', {
451
+ attempt,
452
+ elapsedMs: acquiredAt - input.startedAt,
453
+ sandboxId: sandbox.id,
454
+ });
455
+ return {
456
+ sandbox,
457
+ attempt,
458
+ attemptElapsedMs: acquiredAt - attemptStartedAt,
459
+ sandboxCapacityLeaseId: reservation.leaseId,
460
+ };
461
+ } catch (error) {
462
+ if (error instanceof DaytonaSandboxTransitionPendingError) throw error;
463
+ if (!isDaytonaSandboxNotFound(error)) {
464
+ throw new DaytonaSandboxTransitionPendingError(sandboxName);
465
+ }
466
+ await input.releaseSandboxCapacity?.(reservation.leaseId);
467
+ throw new DaytonaSandboxAcquisitionUnavailableError(
468
+ 'daytona_sandbox_start_timeout',
469
+ `Timed-out Daytona sandbox ${sandboxName} was confirmed absent before resume.`,
470
+ );
471
+ }
472
+ }
420
473
  let sandbox: DaytonaSandbox;
421
474
  try {
422
475
  sandbox = await createOneShotDaytonaSandbox({
@@ -496,6 +549,15 @@ async function createRetriedOneShotDaytonaSandbox(input: {
496
549
  };
497
550
  }
498
551
  await recordCreateFailure();
552
+ if (reconciliation.kind === 'transition_pending') {
553
+ if (reservation?.providerOperationToken) {
554
+ throw new DaytonaSandboxTransitionPendingError(sandboxName);
555
+ }
556
+ throw new Error(
557
+ `Daytona timed-out sandbox ${sandboxName} remained in a state transition across the bounded cleanup window. Modal fallback suppressed.`,
558
+ { cause: error },
559
+ );
560
+ }
499
561
  if (reconciliation.kind === 'deleted') {
500
562
  // The provider-confirmed reconciliation means this reservation can
501
563
  // no longer represent a live sandbox. Release before returning the
@@ -693,6 +755,7 @@ export function createOneShotDaytonaSandboxLifecycle(input: {
693
755
  reserveSandboxCapacity?: (providerAttempt: number) => Promise<{
694
756
  leaseId: string;
695
757
  providerOperationToken: string | null;
758
+ resumeExistingProviderOperation?: boolean;
696
759
  }>;
697
760
  releaseSandboxCapacity?: (leaseId: string) => Promise<void>;
698
761
  startAdmission?: DaytonaSandboxStartAdmission;
@@ -26,6 +26,11 @@ import {
26
26
  RUNTIME_SANDBOX_KILLED_MESSAGE,
27
27
  RUNTIME_SANDBOX_OOM_MESSAGE,
28
28
  } from '../../run-failure';
29
+ import {
30
+ buildDaytonaPayloadMaterializerSource,
31
+ type DaytonaPayloadEnvelope,
32
+ } from '../../daytona-payload-contract';
33
+ export { buildDaytonaPayloadMaterializerSource } from '../../daytona-payload-contract';
29
34
  import { compactPlayArtifactForRuntimeTransport } from '../../../plays/artifact-transport';
30
35
  import type {
31
36
  DaytonaExecutionContext,
@@ -36,16 +41,6 @@ import { buildDaytonaRuntimeWatchdogSource } from './daytona-runtime-watchdog';
36
41
 
37
42
  type DaytonaRemoteRuntimeContext = PlayRunnerExecutionConfig['context'];
38
43
 
39
- type DaytonaPayloadEnvelope = {
40
- schemaVersion: 1;
41
- runnerCode: string;
42
- artifactBundledCode: string;
43
- artifactSourceMap: string;
44
- config: PlayRunnerExecutionConfig;
45
- /** Crash-containment epilogue script (see buildDaytonaCrashTerminalPusherSource). */
46
- crashPusherCode: string;
47
- };
48
-
49
44
  /**
50
45
  * The crash pusher must be able to recover one complete terminal event after
51
46
  * a runner exits before its primary gateway push. A stdout `result` event is
@@ -116,8 +111,7 @@ function nodeMaterializePayloadCommand(input: {
116
111
  artifactSourceMapPath: string;
117
112
  crashPusherPath: string;
118
113
  }): string {
119
- const script =
120
- "const fs=require('node:fs');const zlib=require('node:zlib');const p=JSON.parse(zlib.gunzipSync(fs.readFileSync(process.argv[1])));if(p.schemaVersion!==1)throw new Error('Unsupported Daytona payload envelope');fs.writeFileSync(process.argv[2],p.runnerCode);fs.writeFileSync(process.argv[3],JSON.stringify(p.config));fs.writeFileSync(process.argv[4],p.artifactBundledCode);fs.writeFileSync(process.argv[5],p.artifactSourceMap);fs.writeFileSync(process.argv[6],p.crashPusherCode);";
114
+ const script = buildDaytonaPayloadMaterializerSource();
121
115
  return [
122
116
  'node',
123
117
  '-e',
@@ -28,6 +28,7 @@ import {
28
28
  import {
29
29
  DAYTONA_CANCELLED_ERROR,
30
30
  DaytonaSandboxAcquisitionUnavailableError,
31
+ DaytonaSandboxTransitionPendingError,
31
32
  createDaytonaSandboxCleanupManager,
32
33
  createOneShotDaytonaSandboxLifecycle,
33
34
  type AcquiredDaytonaSandbox,
@@ -37,6 +38,7 @@ import {
37
38
  type OneShotDaytonaSandboxLifecycle,
38
39
  validateDaytonaExecutionContext,
39
40
  } from './daytona-lifecycle';
41
+ import { recoveryForDaytonaSandboxTransitionPending } from '../../play-run-recovery-policy';
40
42
  import { stageDaytonaRunnerPayload } from './daytona-payload-transport';
41
43
  import {
42
44
  DaytonaRunnerInitializationError,
@@ -69,6 +71,12 @@ const RUNTIME_API_TRANSPORT_RETRY_PATTERN =
69
71
  // with user code that has already had side effects.
70
72
  const DAYTONA_PUBLIC_STATUS_TRANSIENT_RETRY_PATTERN =
71
73
  /\bDaytonaValidationError:\s*bad request:\s*failed to get sandbox public status:\s*an unexpected error occurred\.?\b/i;
74
+ // A detached runner sends its first authenticated heartbeat before it can run
75
+ // customer code. Persisted terminal results retain the bounded startup
76
+ // diagnostic, so the worker can distinguish that proven pre-code transport
77
+ // failure from a generic readiness timeout on a later wake.
78
+ const DAYTONA_RUNNER_STARTUP_TRANSPORT_RETRY_PATTERN =
79
+ /\bDaytonaRunnerInitializationError:\s*RUNTIME_SANDBOX_START_FAILED:.*\bScheduler diagnosis:\s*runner_heartbeat_not_observed\..*"schedulerReadinessObserved":false.*"commandFound":true.*"exitCode":null.*"sessionFound":true.*"exitCodeFile":null.*"runnerStartup":\{"phase":"heartbeat_transport","outcome":"network_error","errorCode":"(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|UND_ERR_CONNECT_TIMEOUT)"/i;
72
80
  const DAYTONA_INFRASTRUCTURE_RETRY_PATTERN =
73
81
  /\b(?:Request failed with status code (?:408|429|500|502|503|504)|ECONNRESET|ECONNREFUSED|ETIMEDOUT|UND_ERR_CONNECT_TIMEOUT|fetch failed|socket hang up|Daytona sandbox create failed across|Daytona sandbox create did not complete|Daytona readiness baseline)\b/i;
74
82
 
@@ -902,6 +910,7 @@ export function retryableRuntimeInitializationFailureReason(
902
910
  | 'runtime_api_transport'
903
911
  | 'runtime_receipt_gateway_transport'
904
912
  | 'daytona_public_status'
913
+ | 'daytona_runner_startup_transport'
905
914
  | null {
906
915
  if (result.status !== 'failed') return null;
907
916
  if (RUNTIME_POSTGRES_CONNECT_RETRY_PATTERN.test(result.error)) {
@@ -911,6 +920,13 @@ export function retryableRuntimeInitializationFailureReason(
911
920
  return 'runtime_receipt_gateway_transport';
912
921
  }
913
922
  const rowsProcessed = Number(result.stats?.rowsProcessed ?? 0);
923
+ if (
924
+ rowsProcessed === 0 &&
925
+ result.steps.length === 0 &&
926
+ DAYTONA_RUNNER_STARTUP_TRANSPORT_RETRY_PATTERN.test(result.error)
927
+ ) {
928
+ return 'daytona_runner_startup_transport';
929
+ }
914
930
  if (
915
931
  rowsProcessed === 0 &&
916
932
  result.steps.length === 0 &&
@@ -1470,6 +1486,9 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
1470
1486
  if (error instanceof SandboxRunnerPreCodeDeferralError) {
1471
1487
  throw error;
1472
1488
  }
1489
+ if (error instanceof DaytonaSandboxTransitionPendingError) {
1490
+ throw recoveryForDaytonaSandboxTransitionPending(error);
1491
+ }
1473
1492
  if (error instanceof DaytonaSandboxAcquisitionUnavailableError) {
1474
1493
  throw error;
1475
1494
  }
@@ -206,7 +206,6 @@ export async function buildPlayRunnerBundle(): Promise<string> {
206
206
  resolve(process.cwd(), 'packages', 'play-runtime'),
207
207
  resolve(process.cwd(), 'packages', 'plays'),
208
208
  resolve(process.cwd(), 'packages', 'security'),
209
- resolve(process.cwd(), 'shared_libs'),
210
209
  ];
211
210
  const sourceHash = await hashRunnerSources(sourceRoots);
212
211
  setSpanAttributes(span, {
@@ -6,17 +6,17 @@ import {
6
6
  deleteModalSandboxById,
7
7
  readDetachedModalRuntimeCompletion,
8
8
  } from './backends/modal';
9
+ import {
10
+ readPersistedRuntimeSandboxRef,
11
+ type RuntimeSandboxProviderId,
12
+ type RuntimeSandboxRef,
13
+ } from '../runtime-sandbox-contract';
9
14
  import type { DetachedRunnerSuspension } from '../suspension';
10
15
 
11
- export type RuntimeSandboxProviderId = 'daytona' | 'modal';
12
-
13
- export type RuntimeSandboxRef = {
14
- /** Frozen at 1: persisted in suspension_json, so readers must keep taking 1. */
15
- schemaVersion: 1;
16
- provider: RuntimeSandboxProviderId;
17
- resourceId: string;
18
- routingDomain: string | null;
19
- };
16
+ export type {
17
+ RuntimeSandboxProviderId,
18
+ RuntimeSandboxRef,
19
+ } from '../runtime-sandbox-contract';
20
20
 
21
21
  export type RuntimeSandboxReconciliationAdapter = {
22
22
  provider: RuntimeSandboxProviderId;
@@ -139,41 +139,11 @@ export function runtimeSandboxRefFromSuspension(
139
139
  const storedRef = (suspension as { runtimeSandboxRef?: unknown })
140
140
  .runtimeSandboxRef;
141
141
  if (storedRef !== undefined) {
142
- if (
143
- !storedRef ||
144
- typeof storedRef !== 'object' ||
145
- Array.isArray(storedRef)
146
- ) {
147
- throw new Error('Persisted Runtime Sandbox Ref is not an object.');
148
- }
149
- const candidate = storedRef as Record<string, unknown>;
150
- const resourceId =
151
- typeof candidate.resourceId === 'string'
152
- ? candidate.resourceId.trim()
153
- : '';
154
- const provider = candidate.provider;
155
- const routingDomain = candidate.routingDomain;
156
- if (
157
- candidate.schemaVersion !== 1 ||
158
- (provider !== 'daytona' && provider !== 'modal') ||
159
- !resourceId ||
160
- resourceId !== suspension.sandboxId.trim() ||
161
- (routingDomain !== null && typeof routingDomain !== 'string') ||
162
- (typeof routingDomain === 'string' && !routingDomain.trim()) ||
163
- (suspension.sandboxProvider !== undefined &&
164
- suspension.sandboxProvider !== provider)
165
- ) {
166
- throw new Error(
167
- `Persisted Runtime Sandbox Ref is invalid or inconsistent for sandbox ${suspension.sandboxId}.`,
168
- );
169
- }
170
- return {
171
- schemaVersion: 1,
172
- provider,
173
- resourceId,
174
- routingDomain:
175
- typeof routingDomain === 'string' ? routingDomain.trim() : null,
176
- };
142
+ return readPersistedRuntimeSandboxRef({
143
+ raw: storedRef,
144
+ expectedSandboxId: suspension.sandboxId,
145
+ expectedProvider: suspension.sandboxProvider,
146
+ });
177
147
  }
178
148
  if (
179
149
  suspension.sandboxProvider !== undefined &&