deepline 0.3.552 → 0.3.554

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 (323) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +107 -12
  2. package/dist/bundling-sources/sdk/src/compat.ts +239 -87
  3. package/dist/bundling-sources/sdk/src/config.ts +113 -2
  4. package/dist/bundling-sources/sdk/src/errors.ts +2 -0
  5. package/dist/bundling-sources/sdk/src/http-core.ts +118 -8
  6. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  7. package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
  8. package/dist/bundling-sources/sdk/src/play.ts +3 -0
  9. package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
  10. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +8 -1
  12. package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
  13. package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
  14. package/dist/bundling-sources/sdk/src/types.ts +9 -1
  15. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
  16. package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
  17. package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
  18. package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
  19. package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
  20. package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
  21. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
  22. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
  23. package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
  24. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
  25. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
  26. package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
  27. package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
  28. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
  29. package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
  30. package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
  31. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
  32. package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
  33. package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
  34. package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
  35. package/dist/bundling-sources/shared_libs/monitors/package.json +9 -0
  36. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
  37. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
  38. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
  39. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
  40. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
  41. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
  42. package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
  43. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
  44. package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
  45. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
  46. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
  47. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
  48. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
  49. package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
  50. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
  51. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
  52. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  53. package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
  54. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +168 -41
  55. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
  56. package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
  57. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
  58. package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
  59. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
  60. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +444 -39
  61. package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
  64. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
  65. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
  66. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
  67. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +72 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
  71. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
  73. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
  74. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
  78. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
  79. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +254 -44
  82. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
  83. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
  84. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
  85. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
  86. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +259 -52
  89. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +30 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
  92. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
  95. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
  97. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
  99. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
  102. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
  104. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
  105. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
  106. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
  108. package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
  109. package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
  113. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
  114. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
  116. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
  117. package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
  118. package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
  119. package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
  120. package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
  121. package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
  122. package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
  123. package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
  124. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
  125. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
  126. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
  127. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
  128. package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
  129. package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
  130. package/dist/cli/{auth-KVSBJZOX.mjs → auth-HJUNW7T2.mjs} +8 -7
  131. package/dist/cli/auth-SP6SKZJZ.js +44 -0
  132. package/dist/cli/{billing-FQREA7UA.js → billing-4TSA5HEC.js} +297 -161
  133. package/dist/cli/{billing-54RHFEBI.mjs → billing-SJYRJAQ2.mjs} +197 -61
  134. package/dist/cli/{chunk-4MK42735.js → chunk-2HMN5H54.js} +215 -130
  135. package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
  136. package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-2ORPFQUA.mjs} +18 -18
  137. package/dist/cli/{chunk-RQZQVFCJ.js → chunk-2OVHNHCF.js} +2 -2
  138. package/dist/cli/{chunk-QX7LFGJR.mjs → chunk-33WRQSQ2.mjs} +1874 -91
  139. package/dist/cli/{chunk-UPMRIVZB.js → chunk-3IKGZ4CG.js} +74 -13
  140. package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-3Z4VFCXO.mjs} +8 -8
  141. package/dist/cli/{chunk-GKYAYLRI.js → chunk-4DOFGIEJ.js} +27 -31
  142. package/dist/cli/{chunk-4TALT2M3.mjs → chunk-52Q5KETX.mjs} +69 -3
  143. package/dist/cli/{chunk-RBEUVDZF.js → chunk-5CYZHOKI.js} +249 -107
  144. package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
  145. package/dist/cli/{chunk-IYSTRCLX.mjs → chunk-62AUAWQV.mjs} +4 -4
  146. package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-62HWJXST.mjs} +17 -21
  147. package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-6EXOAT6T.mjs} +2 -2
  148. package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
  149. package/dist/cli/{chunk-ADRC5I3R.js → chunk-7OWI736E.js} +30 -30
  150. package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
  151. package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-B6HO2XWH.mjs} +13 -13
  152. package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-BOZAP2EM.mjs} +141 -56
  153. package/dist/cli/chunk-BVXIGOBZ.js +32 -0
  154. package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
  155. package/dist/cli/{chunk-WE5HES3H.mjs → chunk-D6Z6POKE.mjs} +151 -43
  156. package/dist/cli/{chunk-AZQ264ID.mjs → chunk-DSKSFFK2.mjs} +1 -1
  157. package/dist/cli/{chunk-SHLFOPD6.js → chunk-DUBXUAAO.js} +5 -5
  158. package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
  159. package/dist/cli/{chunk-HO3XK3R7.js → chunk-E74KGKFZ.js} +8 -8
  160. package/dist/cli/{chunk-77AAAGVB.js → chunk-ECHKAC7M.js} +2 -2
  161. package/dist/cli/{chunk-KWSH5T7K.js → chunk-EN5NHCCQ.js} +21 -21
  162. package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-F7CMRKSK.mjs} +1 -1
  163. package/dist/cli/{chunk-JWUAX6OP.js → chunk-FBAFX43W.js} +11 -11
  164. package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-FXQ3JKE3.mjs} +1 -1
  165. package/dist/cli/{chunk-QPKH23EC.mjs → chunk-GA2M3G3Y.mjs} +5 -5
  166. package/dist/cli/{chunk-G4O75EXF.js → chunk-GHT2NDL7.js} +18 -18
  167. package/dist/cli/{chunk-MF2GHZDO.js → chunk-GRZENGNE.js} +2 -2
  168. package/dist/cli/{chunk-4UUR4TCH.js → chunk-IVZKMJUK.js} +1875 -92
  169. package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-KVBQY4ST.mjs} +3 -3
  170. package/dist/cli/{chunk-S5S355UY.mjs → chunk-KZHBDMGF.mjs} +12 -12
  171. package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
  172. package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
  173. package/dist/cli/{chunk-2WFPHBR4.js → chunk-LY5MMXFF.js} +47 -29
  174. package/dist/cli/{chunk-BAIST2BR.js → chunk-M7STM3MZ.js} +36 -36
  175. package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
  176. package/dist/cli/{chunk-45PVGZST.js → chunk-OPTV7D2V.js} +508 -361
  177. package/dist/cli/{chunk-PFO3ISXA.js → chunk-OVEYWO4H.js} +174 -129
  178. package/dist/cli/{chunk-BGBJV26E.mjs → chunk-PC2FTUCP.mjs} +4 -4
  179. package/dist/cli/{chunk-WLN3SUIA.js → chunk-PQQMPUCZ.js} +3 -3
  180. package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-Q7ACILL2.mjs} +5 -5
  181. package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
  182. package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RBBTCYQB.mjs} +3 -3
  183. package/dist/cli/{chunk-F2LH7TGF.js → chunk-RTHMGSZX.js} +21 -21
  184. package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-S6W6SJ6E.mjs} +158 -16
  185. package/dist/cli/chunk-STXDSVQZ.mjs +32 -0
  186. package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-TGUQET3O.mjs} +67 -6
  187. package/dist/cli/{chunk-IHRKLXZN.js → chunk-TJ6HLN56.js} +5 -5
  188. package/dist/cli/{chunk-3FD5EQ62.js → chunk-TOO3YM5N.js} +6 -7
  189. package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UBBYHB2B.mjs} +2 -2
  190. package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-UC4BDZKI.mjs} +299 -69
  191. package/dist/cli/{chunk-634ZDA3F.js → chunk-UNNOZKRT.js} +1 -1
  192. package/dist/cli/{chunk-IDVVIXPJ.js → chunk-UOT7HPBH.js} +41 -41
  193. package/dist/cli/{chunk-6YCA5NKJ.js → chunk-UYCZFQYQ.js} +12 -12
  194. package/dist/cli/{chunk-7IKQKKNX.js → chunk-VIUUTEHY.js} +90 -24
  195. package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-VLO5NFH2.mjs} +63 -18
  196. package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-VQ75KX7G.mjs} +5 -5
  197. package/dist/cli/{chunk-4NQF6KJ3.js → chunk-VV4XGZ24.js} +13 -13
  198. package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
  199. package/dist/cli/{chunk-S46HWQKO.js → chunk-W6CZDTIR.js} +69 -69
  200. package/dist/cli/{chunk-XVB7V4N7.js → chunk-WL7P32PI.js} +161 -53
  201. package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-XD3MFTHA.mjs} +1 -1
  202. package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-XFZX6FNM.mjs} +40 -22
  203. package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-XU6QNM4D.mjs} +1 -1
  204. package/dist/cli/{chunk-QAORXEY3.mjs → chunk-YCOGPOUX.mjs} +6 -7
  205. package/dist/cli/{chunk-VQALXEXO.js → chunk-YQKCH4R7.js} +348 -118
  206. package/dist/cli/{chunk-6O5HOODW.mjs → chunk-YY55NYAH.mjs} +207 -60
  207. package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
  208. package/dist/cli/command-docs.js +3 -3
  209. package/dist/cli/command-docs.mjs +2 -2
  210. package/dist/cli/{concurrent-runs-help-Q4KPAUJX.mjs → concurrent-runs-help-O3Q5IPLF.mjs} +9 -8
  211. package/dist/cli/concurrent-runs-help-ZFRZWX5V.js +22 -0
  212. package/dist/cli/{csv-F5VAGX4K.js → csv-4ZQ2RATI.js} +16 -15
  213. package/dist/cli/{csv-2PTVDNO6.mjs → csv-Y3BFPEM6.mjs} +7 -6
  214. package/dist/cli/{db-IEDXAUF7.mjs → db-3JYY4JNN.mjs} +17 -17
  215. package/dist/cli/{db-Z3OIUFMM.js → db-VEIFS4M7.js} +45 -45
  216. package/dist/cli/describe-EVJ4MFVU.mjs +50 -0
  217. package/dist/cli/describe-FG625QPF.js +50 -0
  218. package/dist/cli/describe-core.d.mts +3 -3
  219. package/dist/cli/describe-core.d.ts +3 -3
  220. package/dist/cli/describe-core.js +7 -7
  221. package/dist/cli/describe-core.mjs +6 -6
  222. package/dist/cli/{executions-H6H5655J.js → executions-HPZXOOVX.js} +12 -12
  223. package/dist/cli/{executions-R3LP74QN.mjs → executions-PCXZKEHM.mjs} +10 -10
  224. package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-Y6VKZNY6.mjs} +9 -8
  225. package/dist/cli/{feedback-VFOUR66B.js → feedback-ZKFHFVL6.js} +17 -16
  226. package/dist/cli/git-RUBMALLH.js +26 -0
  227. package/dist/cli/{git-YX2J4GCI.mjs → git-UMPR2QYC.mjs} +8 -7
  228. package/dist/cli/index.js +170 -158
  229. package/dist/cli/index.mjs +60 -48
  230. package/dist/cli/{integrations-E2JZYKHS.js → integrations-3GQCTRTF.js} +23 -27
  231. package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-V3TM6XAB.mjs} +15 -19
  232. package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-JZBUD7ZE.mjs} +9 -8
  233. package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-VYCO7NGW.js} +12 -11
  234. package/dist/cli/{mcp-UQV2K4EW.js → mcp-4OIWTCE6.js} +121 -48
  235. package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-PH4KZ76P.mjs} +100 -27
  236. package/dist/cli/{monitors-R3BBDCRC.js → monitors-E2A6VPBY.js} +221 -186
  237. package/dist/cli/{monitors-GGKS5W6M.mjs → monitors-SSMGIDGX.mjs} +58 -23
  238. package/dist/cli/org-SFDKSK5D.mjs +2289 -0
  239. package/dist/cli/org-WUDZGWBT.js +2289 -0
  240. package/dist/cli/outcomes-QT7LQBPK.mjs +2865 -0
  241. package/dist/cli/outcomes-Y7SZTLSL.js +2865 -0
  242. package/dist/cli/{play-MDWPR4XG.mjs → play-EK7KSFPL.mjs} +376 -106
  243. package/dist/cli/{play-2MVO27VO.js → play-GDNHCRRR.js} +1150 -880
  244. package/dist/cli/{providers-AKDYFZJZ.mjs → providers-FVZLRXAU.mjs} +10 -10
  245. package/dist/cli/{providers-2AACRUZH.js → providers-ZKOSECLV.js} +13 -13
  246. package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-KSDKIXYD.js} +9 -8
  247. package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-UJZ6PIQV.mjs} +7 -6
  248. package/dist/cli/{run-RTSQNGRD.mjs → run-E7MZ7P35.mjs} +35 -33
  249. package/dist/cli/{run-2634REDK.js → run-PD2BBG6S.js} +55 -53
  250. package/dist/cli/run-identity-LMLFMACS.js +31 -0
  251. package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
  252. package/dist/cli/search-TKSPTPHA.js +32 -0
  253. package/dist/cli/{search-6AOJ4XPP.mjs → search-VTFUFTOY.mjs} +11 -11
  254. package/dist/cli/{search-output-S5ODBL5E.js → search-output-G2AGDCOY.js} +13 -12
  255. package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PFVXQCWA.mjs} +10 -9
  256. package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-7CIMEMX7.mjs} +11 -11
  257. package/dist/cli/{secrets-LHCIIHMT.js → secrets-BCOQ4U7U.js} +20 -20
  258. package/dist/cli/sessions-4CO556VD.js +23 -0
  259. package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-IUCQZEF7.mjs} +9 -8
  260. package/dist/cli/{settings-EBONWL5C.mjs → settings-KZN62UQK.mjs} +16 -16
  261. package/dist/cli/{settings-CP4FVK2W.js → settings-REL4736M.js} +89 -89
  262. package/dist/cli/{setup-I5AZE3IU.mjs → setup-2P7OG3OU.mjs} +22 -24
  263. package/dist/cli/{setup-LFGHTNLQ.js → setup-2XIVBBCS.js} +62 -64
  264. package/dist/cli/skills-JYT5DEY6.js +37 -0
  265. package/dist/cli/{skills-W76AO5XE.mjs → skills-VIGNDJKI.mjs} +10 -9
  266. package/dist/cli/tools-NTVUQ2TG.js +57 -0
  267. package/dist/cli/{tools-7IJHGF6W.mjs → tools-W3QT5EJY.mjs} +24 -24
  268. package/dist/cli/{update-GFOPZTHY.mjs → update-GZVBVMY3.mjs} +14 -11
  269. package/dist/cli/update-TWJZPUZM.js +37 -0
  270. package/dist/cli/{views-D4NX4SBG.mjs → views-BOGEH424.mjs} +47 -49
  271. package/dist/cli/{views-BPL2TQJ4.js → views-TOLJNLSV.js} +62 -64
  272. package/dist/cli/{workflow-ZYNAUCKC.js → workflow-ENWFRK5M.js} +23 -23
  273. package/dist/cli/{workflow-YXP42FUI.mjs → workflow-VDG2FDQV.mjs} +13 -13
  274. package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
  275. package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
  276. package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
  277. package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
  278. package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
  279. package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
  280. package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
  281. package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
  282. package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
  283. package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
  284. package/dist/index.d.mts +7 -7
  285. package/dist/index.d.ts +7 -7
  286. package/dist/index.js +66 -55
  287. package/dist/index.mjs +25 -14
  288. package/dist/install-integrity.json +163 -144
  289. package/dist/plays/bundle-play-file.d.mts +3 -3
  290. package/dist/plays/bundle-play-file.d.ts +3 -3
  291. package/dist/plays/bundle-play-file.mjs +23 -4
  292. package/dist/plays/csv-data-input.js +3 -3
  293. package/dist/plays/csv-data-input.mjs +2 -2
  294. package/dist/plays/play-description.d.mts +2 -2
  295. package/dist/plays/play-description.d.ts +2 -2
  296. package/dist/plays/run-request.d.mts +2 -2
  297. package/dist/plays/run-request.d.ts +2 -2
  298. package/dist/plays/run-request.js +4 -4
  299. package/dist/plays/run-request.mjs +3 -3
  300. package/dist/release.d.mts +1 -1
  301. package/dist/release.d.ts +1 -1
  302. package/dist/release.js +2 -2
  303. package/dist/release.mjs +1 -1
  304. package/dist/server.d.mts +4 -4
  305. package/dist/server.d.ts +4 -4
  306. package/dist/server.js +15 -13
  307. package/dist/server.mjs +9 -7
  308. package/package.json +1 -1
  309. package/dist/cli/auth-MMNVWATX.js +0 -43
  310. package/dist/cli/chunk-AID3OYVJ.js +0 -8
  311. package/dist/cli/chunk-OVDNJAJN.mjs +0 -8
  312. package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
  313. package/dist/cli/describe-QDANCTS3.mjs +0 -50
  314. package/dist/cli/describe-VUTT5ZKU.js +0 -50
  315. package/dist/cli/git-ETB3GH3K.js +0 -25
  316. package/dist/cli/org-GRYVMNSW.js +0 -1282
  317. package/dist/cli/org-Z37NGJV4.mjs +0 -1282
  318. package/dist/cli/run-identity-G257GQED.js +0 -25
  319. package/dist/cli/search-VTW2YNBS.js +0 -32
  320. package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
  321. package/dist/cli/skills-R7EBXREW.js +0 -36
  322. package/dist/cli/tools-V7U2BDXM.js +0 -57
  323. package/dist/cli/update-4COPZETK.js +0 -34
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  handleDeploymentGet,
3
3
  handleDeploymentsList
4
- } from "./chunk-S5S355UY.mjs";
4
+ } from "./chunk-KZHBDMGF.mjs";
5
5
  import {
6
6
  DEFAULT_MAX_CONCURRENT_EXTERNAL_CALLS,
7
7
  MAX_CONFIGURABLE_CONCURRENT_EXTERNAL_CALLS,
@@ -9,7 +9,7 @@ import {
9
9
  parsePlayRunHeaderFlag,
10
10
  parsePlayRunOptions,
11
11
  resolvePlayRunCliOptions
12
- } from "./chunk-U7QRMBIY.mjs";
12
+ } from "./chunk-VQ75KX7G.mjs";
13
13
  import {
14
14
  ExecutionOutputError,
15
15
  TABLE_EXPORT_ERROR_COLUMN,
@@ -22,18 +22,18 @@ import {
22
22
  underscoreKeysLast,
23
23
  writeExecutionOutput,
24
24
  writeRunDatasetCsv
25
- } from "./chunk-FTJLJCE5.mjs";
25
+ } from "./chunk-KVBQY4ST.mjs";
26
26
  import {
27
27
  registerDeprecatedSearchCommand
28
- } from "./chunk-QPKH23EC.mjs";
28
+ } from "./chunk-GA2M3G3Y.mjs";
29
29
  import "./chunk-5AEDYVB6.mjs";
30
30
  import {
31
31
  buildPlayDashboardUrl,
32
32
  buildPlayRunUrl
33
- } from "./chunk-GGGAEVCX.mjs";
33
+ } from "./chunk-XFZX6FNM.mjs";
34
34
  import {
35
35
  shellQuote
36
- } from "./chunk-OVDNJAJN.mjs";
36
+ } from "./chunk-STXDSVQZ.mjs";
37
37
  import {
38
38
  INLINE_PLAY_FILE,
39
39
  PLAY_DEFAULT_EXPORT,
@@ -47,14 +47,14 @@ import {
47
47
  } from "./chunk-MF7PCM6C.mjs";
48
48
  import {
49
49
  parseCsvDataInput
50
- } from "./chunk-FSIVF2SI.mjs";
50
+ } from "./chunk-VZGLIK5U.mjs";
51
51
  import {
52
52
  pinLocalPlayImports,
53
53
  planLocalPlayExecution
54
- } from "./chunk-QILKGXYF.mjs";
54
+ } from "./chunk-UBBYHB2B.mjs";
55
55
  import {
56
56
  DeeplineClient
57
- } from "./chunk-QY3ZNU6Z.mjs";
57
+ } from "./chunk-6EXOAT6T.mjs";
58
58
  import {
59
59
  RUN_EVENT_SEARCH_KIND_VALUES,
60
60
  RunEventQueryInputError,
@@ -67,7 +67,7 @@ import {
67
67
  normalizePlayStatus,
68
68
  normalizeRunEventOperationRequest,
69
69
  parseLogLevel
70
- } from "./chunk-Z5TSLLOW.mjs";
70
+ } from "./chunk-VLO5NFH2.mjs";
71
71
  import "./chunk-FZHMNK6F.mjs";
72
72
  import {
73
73
  CSV_DATA_INPUT_KEY,
@@ -82,30 +82,29 @@ import {
82
82
  sqlSafePlayColumnName,
83
83
  stageFileInputs,
84
84
  stagedFileContentType
85
- } from "./chunk-LX35AXTN.mjs";
85
+ } from "./chunk-5TYLSS4Q.mjs";
86
86
  import {
87
87
  CSV_HEADER_MATCHING_NOTE,
88
88
  playInputExampleArgs
89
89
  } from "./chunk-PSX3WHIH.mjs";
90
- import "./chunk-UBKA33KY.mjs";
91
90
  import {
92
91
  checkPlayRunCompatibility,
93
92
  usesCliPlayAdmission
94
- } from "./chunk-QAORXEY3.mjs";
93
+ } from "./chunk-YCOGPOUX.mjs";
95
94
  import {
96
95
  isCliTraceEnabled,
97
96
  recordCliTrace,
98
97
  resolveCliMaintenancePolicy,
99
98
  traceCliSpan
100
- } from "./chunk-6RZOWL2V.mjs";
101
- import "./chunk-YJHE3O5M.mjs";
99
+ } from "./chunk-F7CMRKSK.mjs";
100
+ import "./chunk-BOZAP2EM.mjs";
102
101
  import {
103
102
  createCliProgress,
104
103
  getActiveCliProgress
105
- } from "./chunk-AZQ264ID.mjs";
104
+ } from "./chunk-DSKSFFK2.mjs";
106
105
  import {
107
106
  formatNonStandardSandboxRuntimeWarning
108
- } from "./chunk-6ZORHRKB.mjs";
107
+ } from "./chunk-LRZGS6RZ.mjs";
109
108
  import {
110
109
  STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
111
110
  resolvePlaySandboxRuntimeLimits
@@ -123,17 +122,23 @@ import {
123
122
  printJsonError,
124
123
  renderCommandEnvelopeText,
125
124
  shouldEmitJson
126
- } from "./chunk-6PRW5UBA.mjs";
127
- import "./chunk-4TALT2M3.mjs";
125
+ } from "./chunk-UC4BDZKI.mjs";
126
+ import {
127
+ cliFeatureEnabled
128
+ } from "./chunk-52Q5KETX.mjs";
128
129
  import {
129
130
  fetchWithDeploymentProtection
130
- } from "./chunk-YLTMXJFC.mjs";
131
- import "./chunk-NURW5XH4.mjs";
131
+ } from "./chunk-S6W6SJ6E.mjs";
132
+ import "./chunk-ASB47RXJ.mjs";
132
133
  import "./chunk-DLIRSHV6.mjs";
133
134
  import {
134
135
  DeeplineError
135
- } from "./chunk-JL2OTMSG.mjs";
136
- import "./chunk-AQWQ2BFX.mjs";
136
+ } from "./chunk-Z3A2S3QM.mjs";
137
+ import {
138
+ playRunIdLookupPrefix,
139
+ shortPlayRunId
140
+ } from "./chunk-2MGZAI54.mjs";
141
+ import "./chunk-FXQ3JKE3.mjs";
137
142
  import "./chunk-WZYKRD7T.mjs";
138
143
  import {
139
144
  __commonJS,
@@ -2079,7 +2084,7 @@ var fields = Object.entries(PLAY_SETTING_FIELDS);
2079
2084
  var help = `
2080
2085
  Settings live on the Play definition. Edits preserve code revisions.
2081
2086
  New Plays start at person (the creator\u2019s personal root, e.g. Chirag\u2019s team).
2082
- Publishing moves a Play into team and keeps its folders. Workspace sharing
2087
+ Publishing moves a Play into team and keeps its folders. Org sharing
2083
2088
  permissions apply in both roots. Folder paths are independent of your cwd.
2084
2089
 
2085
2090
  Setting names and values:
@@ -2416,7 +2421,10 @@ var PLAY_TRIGGER_TOLERANCE_SECONDS_MAX = 3600;
2416
2421
  var playCronTriggerConfigSchema = z2.object({
2417
2422
  schedule: z2.string().trim().min(1, "Schedule is required.").max(256).describe('Standard 5-field cron expression, e.g. "0 9 * * 1-5".'),
2418
2423
  timezone: z2.string().trim().min(1).max(64).optional().describe("IANA timezone. Omitted means UTC."),
2419
- input: z2.record(z2.string(), z2.unknown()).optional().describe("Static JSON object passed as the input of every cron run.")
2424
+ input: z2.record(z2.string(), z2.unknown()).optional().describe("Static JSON object passed as the input of every cron run."),
2425
+ overlap: z2.enum(["allow", "skip"]).optional().describe(
2426
+ 'While an earlier cron run is still queued or running: "allow" starts another run, "skip" records the occurrence as skipped. Omitted keeps the current policy ("allow" for a new schedule).'
2427
+ )
2420
2428
  }).strict();
2421
2429
  var playWebhookAuthConfigSchema = z2.discriminatedUnion("type", [
2422
2430
  z2.object({
@@ -2464,7 +2472,8 @@ function buildPlayTriggerConfigUpdate(intent) {
2464
2472
  cron: schedule.enabled ? {
2465
2473
  schedule: schedule.schedule,
2466
2474
  ...schedule.timezone ? { timezone: schedule.timezone } : {},
2467
- ...schedule.input && Object.keys(schedule.input).length > 0 ? { input: schedule.input } : {}
2475
+ ...schedule.input && Object.keys(schedule.input).length > 0 ? { input: schedule.input } : {},
2476
+ ...schedule.overlap ? { overlap: schedule.overlap } : {}
2468
2477
  } : null
2469
2478
  },
2470
2479
  ...webhook === void 0 ? {} : { webhook: webhook.enabled ? { auth: webhook.auth } : null }
@@ -2484,6 +2493,7 @@ Examples:
2484
2493
  deepline plays trigger get --play daily-sync
2485
2494
  deepline plays trigger set-cron --play daily-sync --schedule "0 9 * * 1-5" --timezone America/New_York
2486
2495
  deepline plays trigger set-cron --play daily-sync --schedule "0 * * * *" --input '{"domain":"example.com"}'
2496
+ deepline plays trigger set-cron --play daily-sync --schedule "*/5 * * * *" --overlap skip
2487
2497
  deepline plays trigger clear-cron --play daily-sync
2488
2498
  deepline plays trigger set-webhook --play inbound-lead
2489
2499
  deepline plays trigger set-webhook --play inbound-lead --auth svix --secret VECTOR_SECRET
@@ -2491,6 +2501,11 @@ Examples:
2491
2501
  deepline plays trigger clear-webhook --play inbound-lead
2492
2502
 
2493
2503
  Removing a webhook retires its URL; turning it back on issues a new URL.
2504
+
2505
+ --overlap decides what a cron occurrence does while an earlier cron run of the
2506
+ Play is still queued or running: allow (the default) starts another run; skip
2507
+ starts nothing and records the occurrence as skipped (PLAY_CRON_OVERLAP_SKIPPED).
2508
+ Without --overlap, set-cron keeps the current policy.
2494
2509
  `;
2495
2510
  function describeAuth(auth) {
2496
2511
  if (!auth) return "unsigned";
@@ -2503,6 +2518,7 @@ function triggerLines(view) {
2503
2518
  `Live version: ${view.liveVersion ?? "none"}`,
2504
2519
  view.cron ? `Schedule: ${view.cron.schedule} (${view.cron.timezone ?? "UTC"}) \u2014 ${view.cron.status ?? "pending"}${view.cron.nextScheduledAt ? `, next ${new Date(view.cron.nextScheduledAt).toISOString()}` : ""}` : "Schedule: off",
2505
2520
  ...view.cron?.input ? [` input: ${JSON.stringify(view.cron.input)}`] : [],
2521
+ ...view.cron?.overlap === "skip" ? [" overlap: skip while a cron run is queued or running"] : [],
2506
2522
  ...view.cron?.blockedReason ? [` held: ${view.cron.blockedReason}`] : [],
2507
2523
  view.webhook ? `Webhook: ${view.webhook.url ?? "(URL issued on publish)"} \u2014 ${describeAuth(view.webhook.auth)}` : "Webhook: off"
2508
2524
  ];
@@ -2615,17 +2631,26 @@ function registerPlayTriggerConfigCommands(plays) {
2615
2631
  );
2616
2632
  });
2617
2633
  const setCron = withMutationOptions(
2618
- trigger.command("set-cron").alias("set-schedule").description("Schedule the Play (replaces any existing schedule).").requiredOption("--schedule <cron>", '5-field cron, e.g. "0 9 * * 1-5"').option("--timezone <iana>", "IANA timezone; default UTC").option("--input <json>", "Static JSON object passed to every cron run")
2634
+ trigger.command("set-cron").alias("set-schedule").description("Schedule the Play (replaces any existing schedule).").requiredOption("--schedule <cron>", '5-field cron, e.g. "0 9 * * 1-5"').option("--timezone <iana>", "IANA timezone; default UTC").option("--input <json>", "Static JSON object passed to every cron run").option(
2635
+ "--overlap <policy>",
2636
+ "allow or skip: what an occurrence does while a cron run is active; default keeps the current policy"
2637
+ )
2619
2638
  );
2620
2639
  setCron.action(
2621
- (options) => mutate(setCron, options, async () => ({
2622
- schedule: {
2623
- enabled: true,
2624
- schedule: options.schedule,
2625
- timezone: options.timezone,
2626
- input: options.input === void 0 ? void 0 : parseInput(setCron, options.input)
2627
- }
2628
- }))
2640
+ (options) => mutate(setCron, options, async () => {
2641
+ if (options.overlap !== void 0 && options.overlap !== "allow" && options.overlap !== "skip")
2642
+ usage(setCron, "--overlap must be allow or skip.");
2643
+ return {
2644
+ schedule: {
2645
+ enabled: true,
2646
+ schedule: options.schedule,
2647
+ timezone: options.timezone,
2648
+ input: options.input === void 0 ? void 0 : parseInput(setCron, options.input),
2649
+ // Omitted: the server keeps the current policy.
2650
+ overlap: options.overlap
2651
+ }
2652
+ };
2653
+ })
2629
2654
  );
2630
2655
  const clearCron = withMutationOptions(
2631
2656
  trigger.command("clear-cron").alias("clear-schedule").description("Remove the schedule.")
@@ -3944,6 +3969,46 @@ function formatRunRetrySummary(summary) {
3944
3969
  return parts.join(" \xB7 ");
3945
3970
  }
3946
3971
 
3972
+ // src/cli/run-id-argument.ts
3973
+ var MISSING_RUN_ID_SPELLINGS = /* @__PURE__ */ new Set(["null", "none", "undefined", "nil"]);
3974
+ var RUN_LOOKUP_COMMANDS = {
3975
+ byPlay: "deepline runs list --play <play-name> --json",
3976
+ running: "deepline runs list --status running --json"
3977
+ };
3978
+ var LIST_RUNS_GUIDANCE = `\`${RUN_LOOKUP_COMMANDS.byPlay}\` lists that Play's runs`;
3979
+ function assertRunIdArgument(value) {
3980
+ if (MISSING_RUN_ID_SPELLINGS.has(value.trim().toLowerCase())) {
3981
+ throw new DeeplineError(
3982
+ `'${value}' is not a run id: the command that should have printed one returned none. Read that command\u2019s error before starting it again, and find runs that exist: ${LIST_RUNS_GUIDANCE}.`,
3983
+ void 0,
3984
+ "INVALID_ARGUMENT",
3985
+ { runId: value }
3986
+ );
3987
+ }
3988
+ return value;
3989
+ }
3990
+ var CALLER_TAIL = /-caller-([a-f0-9]*)$/i;
3991
+ function explainRunNotFound(error, runId) {
3992
+ if (!(error instanceof DeeplineError) || error.statusCode !== 404 || error.message.trim() !== "Workflow run not found.") {
3993
+ return error;
3994
+ }
3995
+ const tail = CALLER_TAIL.exec(runId)?.[1];
3996
+ const damagedTail = tail !== void 0 && playRunIdLookupPrefix(runId) !== null;
3997
+ const guidance = damagedTail ? `Its caller hash has ${tail.length} characters; a caller run id ends in -caller- and exactly 64 hex characters, so this id was cut or mistyped, and no run readable in this workspace matches ${playRunIdLookupPrefix(runId)}. Retrying this read will not find it: ${LIST_RUNS_GUIDANCE}; use the id it prints.` : tail !== void 0 ? `A caller run id is chosen by the CLI before the start request is sent. If it came from a start whose outcome was unknown, the run may still be being admitted: read this id again before starting another run; \`${RUN_LOOKUP_COMMANDS.running}\` lists runs still in progress. A start that failed or was interrupted can also print an id under which no run was admitted; ${LIST_RUNS_GUIDANCE}.` : `It may belong to another workspace or have been mistyped; ${LIST_RUNS_GUIDANCE}.`;
3998
+ return new DeeplineError(
3999
+ `No run ${runId} is readable in this workspace. ${guidance}`,
4000
+ 404,
4001
+ "RUN_NOT_FOUND",
4002
+ {
4003
+ runId,
4004
+ next: {
4005
+ list: RUN_LOOKUP_COMMANDS.byPlay,
4006
+ running: RUN_LOOKUP_COMMANDS.running
4007
+ }
4008
+ }
4009
+ );
4010
+ }
4011
+
3947
4012
  // ../plays/docflow-flow-order.ts
3948
4013
  function docflowFlowOrder(docflow) {
3949
4014
  const subgraphs = docflow.subgraphs ?? [];
@@ -5004,7 +5069,7 @@ async function handleRunsHistory(options) {
5004
5069
  );
5005
5070
  }
5006
5071
  function registerRunHistoryCommand(runs) {
5007
- runs.command("history").description("Page workspace run history.").option(
5072
+ runs.command("history").description("Page org run history.").option(
5008
5073
  "--cursor <cursor>",
5009
5074
  "Opaque nextCursor returned by the previous page"
5010
5075
  ).option("--limit <count>", "Maximum runs on this page").option(
@@ -5013,10 +5078,7 @@ function registerRunHistoryCommand(runs) {
5013
5078
  ).option(
5014
5079
  "--type <type>",
5015
5080
  "Search all, plays or monitors (requires --search)"
5016
- ).option(
5017
- "--org <id>",
5018
- "Workspace ID (must match the authenticated workspace)"
5019
- ).option("--json", "Emit JSON output").addHelpText(
5081
+ ).option("--org <id>", "Org ID (must match the authenticated org)").option("--json", "Emit JSON output").addHelpText(
5020
5082
  "after",
5021
5083
  "\nUse the opaque --cursor returned by the previous page to continue.\n\nExample:\n deepline runs history --limit 100\n"
5022
5084
  ).action(handleRunsHistory);
@@ -6281,7 +6343,10 @@ var DeployApiClient = class {
6281
6343
  method: "POST",
6282
6344
  path: "/api/v2/plays/artifacts",
6283
6345
  body: {
6284
- artifacts: batch.map((entry) => ({ ...entry, publish: false }))
6346
+ artifacts: batch.map((entry) => ({ ...entry, publish: false })),
6347
+ // Every revision a deployment registers is its own; the server
6348
+ // never hands it another writer's revision or rewrites it in place.
6349
+ deploymentId: this.config.deploymentId
6285
6350
  }
6286
6351
  });
6287
6352
  results.push(...payload.artifacts);
@@ -7124,14 +7189,7 @@ async function runDeployment(params, hooks) {
7124
7189
  const artifact = play.result.artifact;
7125
7190
  const importsOtherPlays = (play.result.importedPlayDependencies ?? []).length > 0;
7126
7191
  const matches = (revision) => !importsOtherPlays && carriesArtifact(revision, artifact);
7127
- if (matches(playState?.liveRevision ?? null)) {
7128
- if (deployment.isProduction && project && (playState?.playProjectId !== project.id || playState?.driftFromGit)) {
7129
- toPromote.push({
7130
- name: play.name,
7131
- revisionId: playState.liveRevision.revisionId
7132
- });
7133
- continue;
7134
- }
7192
+ if (matches(playState?.liveRevision ?? null) && !(deployment.isProduction && project && (playState?.playProjectId !== project.id || playState?.driftFromGit))) {
7135
7193
  outcomes.push({
7136
7194
  name: play.name,
7137
7195
  file: play.file,
@@ -7141,24 +7199,6 @@ async function runDeployment(params, hooks) {
7141
7199
  });
7142
7200
  continue;
7143
7201
  }
7144
- if (matches(playState?.workingRevision ?? null)) {
7145
- if (deployment.isProduction) {
7146
- toPromote.push({
7147
- name: play.name,
7148
- revisionId: playState.workingRevision.revisionId
7149
- });
7150
- } else {
7151
- outcomes.push({
7152
- name: play.name,
7153
- file: play.file,
7154
- status: "registered",
7155
- version: playState?.workingRevision?.version ?? void 0,
7156
- ...sdkUpdated(play.name),
7157
- ...warning ? { warning } : {}
7158
- });
7159
- }
7160
- continue;
7161
- }
7162
7202
  toRegister.push({
7163
7203
  play,
7164
7204
  entry: {
@@ -8158,7 +8198,7 @@ To make your own version:
8158
8198
  2. Change its export const config = { name } to a new play name you own.
8159
8199
  3. Run: deepline plays check ./${localName}.play.ts
8160
8200
  4. Run: deepline plays publish ./${localName}.play.ts
8161
- 5. Your play will then live under your workspace namespace.`
8201
+ 5. Your play will then live under your org namespace.`
8162
8202
  );
8163
8203
  }
8164
8204
  async function ensureEditableRemotePlay(client, target) {
@@ -8618,8 +8658,77 @@ var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set([
8618
8658
  "failed",
8619
8659
  "cancelled"
8620
8660
  ]);
8621
- var PLAY_START_TRANSIENT_RETRY_DELAYS_MS = [500, 1500];
8661
+ var PLAY_START_TRANSIENT_RETRY_DELAYS_MS = [
8662
+ 500,
8663
+ 1500,
8664
+ 3e3,
8665
+ 5e3,
8666
+ 1e4,
8667
+ 15e3,
8668
+ 2e4,
8669
+ 3e4,
8670
+ 3e4
8671
+ ];
8622
8672
  var PLAY_START_STREAM_TERMINAL_WINDOW_MS = 2e3;
8673
+ var PLAY_START_UNWATCHED_ATTEMPT_ALLOWANCE_MS = 6e4;
8674
+ async function startPlayRunWithTransientRetry(input) {
8675
+ const scheduledDelays = input.retryDelaysMs ?? PLAY_START_TRANSIENT_RETRY_DELAYS_MS;
8676
+ const deadline = new AbortController();
8677
+ const deadlineTimer = setTimeout(
8678
+ () => deadline.abort(),
8679
+ input.deadlineMs ?? scheduledDelays.reduce((sum, delay) => sum + delay, 0) + PLAY_START_UNWATCHED_ATTEMPT_ALLOWANCE_MS
8680
+ );
8681
+ deadlineTimer.unref?.();
8682
+ try {
8683
+ const prepared = await input.client.preparePlayRunAdmission(input.request, {
8684
+ signal: deadline.signal,
8685
+ ...input.onSubmission ? { onSubmission: input.onSubmission } : {}
8686
+ });
8687
+ const retryDelays = prepared.supportsCallerIntent ? scheduledDelays : [];
8688
+ for (let attempt = 0; ; attempt += 1) {
8689
+ try {
8690
+ return await prepared.start({ signal: deadline.signal });
8691
+ } catch (error) {
8692
+ const retryDelayMs = retryDelays[attempt];
8693
+ if (retryDelayMs === void 0 || deadline.signal.aborted || !isAmbiguousPlayStartOutcomeError(error)) {
8694
+ if (attempt > 0) {
8695
+ throw new PlayStartOutcomeUnknownError(
8696
+ input.playName,
8697
+ error,
8698
+ prepared.workflowId
8699
+ );
8700
+ }
8701
+ throw error;
8702
+ }
8703
+ const reason = error instanceof Error ? error.message : String(error);
8704
+ if (!input.jsonOutput) {
8705
+ input.progress.writeLine(
8706
+ `[play start] response was ambiguous; retrying the same caller intent (${reason})`
8707
+ );
8708
+ }
8709
+ recordCliTrace({
8710
+ phase: "cli.play_start_json_retry",
8711
+ ms: 0,
8712
+ ok: true,
8713
+ playName: input.playName,
8714
+ attempt: attempt + 1,
8715
+ reason,
8716
+ recovery: "same_caller_intent"
8717
+ });
8718
+ await sleepOrAbort(retryDelayMs, deadline.signal);
8719
+ if (deadline.signal.aborted) {
8720
+ throw new PlayStartOutcomeUnknownError(
8721
+ input.playName,
8722
+ error,
8723
+ prepared.workflowId
8724
+ );
8725
+ }
8726
+ }
8727
+ }
8728
+ } finally {
8729
+ clearTimeout(deadlineTimer);
8730
+ }
8731
+ }
8623
8732
  var PLAY_PROGRESS_HEARTBEAT_INTERVAL_MS = 15e3;
8624
8733
  var PLAY_STATUS_HEARTBEAT_INTERVAL_MS = 15e3;
8625
8734
  var RetryablePlayStartAttemptError = class extends Error {
@@ -8637,7 +8746,7 @@ var PlayStartOutcomeUnknownError = class extends DeeplineError {
8637
8746
  const causeMessage = cause instanceof Error ? cause.message : String(cause);
8638
8747
  const recoveryCommand = workflowId ? `deepline runs get ${shellQuote(workflowId)} --json` : `deepline runs list --play ${shellQuote(playName)} --json`;
8639
8748
  super(
8640
- `Play ${playName}${workflowId ? ` (${workflowId})` : ""} may have started, but the CLI did not receive confirmation. Do not run it again until you inspect the original workspace with: ${recoveryCommand}`,
8749
+ `Play ${playName}${workflowId ? ` (${workflowId})` : ""} may have started, but the CLI did not receive confirmation. Do not run it again until you inspect the original org with: ${recoveryCommand}`,
8641
8750
  cause instanceof DeeplineError ? cause.statusCode : void 0,
8642
8751
  "PLAY_START_OUTCOME_UNKNOWN",
8643
8752
  {
@@ -9503,7 +9612,8 @@ async function startAndWaitForPlayCompletion(input) {
9503
9612
  }
9504
9613
  await checkPlayRunCompatibility(
9505
9614
  input.client.baseUrl,
9506
- input.maintenancePolicy
9615
+ input.maintenancePolicy,
9616
+ controller.signal
9507
9617
  );
9508
9618
  controller.signal.throwIfAborted();
9509
9619
  useCliAdmission = false;
@@ -10752,8 +10862,8 @@ function formatInsufficientCreditsMessage(input) {
10752
10862
  const minimum = input.billing.minimum_balance_credits;
10753
10863
  const estimate = input.billing.estimated_credits;
10754
10864
  const estimatedPrice = typeof estimate === "number" ? ` Estimated price: ${formatCreditAmount2(estimate)}.` : "";
10755
- const spendableNote = " Spendable credits exclude pending spending and can be lower than the posted balance shown by billing balance.";
10756
- const shortfall = typeof minimum === "number" && input.billing.required_credits === minimum ? `Spendable workspace balance ${balance} credits is below the ${formatCreditAmount2(minimum)}-credit workspace minimum for starting a billable call (${operation}${workspaceSuffix}); this is a workspace-wide minimum, separate from the tool's own price.${estimatedPrice}${spendableNote}` : typeof estimate === "number" && typeof input.billing.required_credits === "number" && input.billing.required_credits > estimate ? `Spendable workspace balance ${balance} credits is below the ${required}-credit balance required to start ${operation}${workspaceSuffix}; this is a required balance, not the price.${estimatedPrice}${spendableNote}` : `Spendable workspace balance ${balance} credits < required ${required} for ${operation}${workspaceSuffix}.${spendableNote}`;
10865
+ const spendableNote = " Spendable credits exclude finalizing usage (usage incurred, final price pending) and can be lower than the posted balance shown by billing balance.";
10866
+ const shortfall = typeof minimum === "number" && input.billing.required_credits === minimum ? `Spendable org balance ${balance} credits is below the ${formatCreditAmount2(minimum)}-credit org minimum for starting a billable call (${operation}${workspaceSuffix}); this is an org-wide minimum, separate from the tool's own price.${estimatedPrice}${spendableNote}` : typeof estimate === "number" && typeof input.billing.required_credits === "number" && input.billing.required_credits > estimate ? `Spendable org balance ${balance} credits is below the ${required}-credit balance required to start ${operation}${workspaceSuffix}; this is a required balance, not the price.${estimatedPrice}${spendableNote}` : `Spendable org balance ${balance} credits < required ${required} for ${operation}${workspaceSuffix}.${spendableNote}`;
10757
10867
  return `${shortfall}${addSuffix} Ask the user if they want to add Deepline credits. If they approve, run: ${recovery.topUp}. If checkout is required, run: ${recovery.checkout}.`;
10758
10868
  }
10759
10869
  function buildInsufficientCreditsSummaryLines(input) {
@@ -11528,7 +11638,7 @@ function buildRunActivityTextLines(run) {
11528
11638
  if (observation.activityId === "run:sandbox-capacity" && kind === "queued" && target?.kind === "capacity") {
11529
11639
  if (typeof target.limit === "number") {
11530
11640
  lines.push(
11531
- ` concurrency limit: ${target.limit} simultaneous Play runs per workspace`
11641
+ ` concurrency limit: ${target.limit} simultaneous Play runs per org`
11532
11642
  );
11533
11643
  }
11534
11644
  if (target.limitSource === "admission") {
@@ -12350,11 +12460,19 @@ function assertDatasetHasExportableRows(input) {
12350
12460
  const rowOutcomes = readRowOutcomeSummary(input.status) ?? readRowOutcomeSummary(
12351
12461
  getRecordField(getRecordField(input.status, "result"), "_metadata")
12352
12462
  );
12353
- if (input.allowEmpty === true && input.status.status === "completed" && !getRecordField(input.status, "error") && !getRecordField(input.status.progress, "error") && structuredErrorsForStatus(input.status).length === 0 && input.rowsInfo.complete && input.rowsInfo.totalRows === 0 && rowOutcomes?.failedRows === 0 && !rowOutcomes.hasRowFailures) {
12463
+ const completedWithoutErrors = input.status.status === "completed" && !getRecordField(input.status, "error") && !getRecordField(input.status.progress, "error") && structuredErrorsForStatus(input.status).length === 0;
12464
+ const completedEmptyDataset = completedWithoutErrors && input.rowsInfo.complete && input.rowsInfo.totalRows === 0;
12465
+ const allowEmptyEligible = completedEmptyDataset && rowOutcomes?.failedRows === 0 && !rowOutcomes.hasRowFailures;
12466
+ if (input.allowEmpty === true && allowEmptyEligible) {
12354
12467
  return input.rowsInfo;
12355
12468
  }
12356
12469
  const datasetLabel = input.datasetPath ?? input.rowsInfo.tableNamespace ?? input.rowsInfo.source ?? "result.rows";
12357
12470
  const available = input.availableRows.map((info) => info.tableNamespace ?? info.source).filter((name) => typeof name === "string");
12471
+ const availableWithCounts = input.availableRows.flatMap((info) => {
12472
+ const name = info.tableNamespace ?? info.source;
12473
+ if (typeof name !== "string") return [];
12474
+ return info.complete ? [`${name} (${info.totalRows} row${info.totalRows === 1 ? "" : "s"})`] : [name];
12475
+ });
12358
12476
  const runStatus = String(input.status.status ?? "").toLowerCase();
12359
12477
  const advertisedRows = Math.max(
12360
12478
  input.rowsInfo.totalRows,
@@ -12388,9 +12506,10 @@ function assertDatasetHasExportableRows(input) {
12388
12506
  }
12389
12507
  );
12390
12508
  }
12391
- const explanation = terminalRunWithMissingAdvertisedRows ? ` The terminal result advertised ${advertisedRows} row(s), but none are currently attributed to this run's durable sheet. Those rows may have been reused from an earlier run or the projection may still be lagging; export refuses to guess another run's rows. Retry the same export after projection catches up (do not rerun the Play): ${retryCommand}. If it remains empty, inspect the full package with ${inspectCommand}` + (currentTableQueryCommand2 ? `, then inspect the current table's _run_id/_writer_run_id with ${currentTableQueryCommand2} and export the run that owns those rows` : " and export the run that owns the durable dataset") + "; this command will not use a database-wide table query that could mix runs." : ` The run status is '${runStatus || "unknown"}', so it likely failed before persisting rows to this dataset. That means provider calls may have been billed without a durable row; inspect ${inspectCommand}, fix the failure cause, then rerun the Play so completed receipts can be reused.`;
12509
+ const emptyDatasetAllowEmptyHint = allowEmptyEligible ? ` To write an empty file anyway, add --allow-empty: ${retryCommand} --allow-empty.` : ` --allow-empty cannot write an empty file for this run because ${rowOutcomes ? `${rowOutcomes.failedRows > 0 ? `${rowOutcomes.failedRows} row(s)` : "rows"} failed in it` : "it did not report its row outcomes"}; inspect ${inspectCommand}.`;
12510
+ const explanation = completedEmptyDataset ? " The run completed and wrote no rows to this dataset, so there is nothing to export. This is the Play\u2019s result, not a lost write: rerunning the same Play on the same input gives the same empty dataset." + emptyDatasetAllowEmptyHint : terminalRunWithMissingAdvertisedRows ? ` The terminal result advertised ${advertisedRows} row(s), but none are currently attributed to this run's durable sheet. Those rows may have been reused from an earlier run or the projection may still be lagging; export refuses to guess another run's rows. Retry the same export after projection catches up (do not rerun the Play): ${retryCommand}. If it remains empty, inspect the full package with ${inspectCommand}` + (currentTableQueryCommand2 ? `, then inspect the current table's _run_id/_writer_run_id with ${currentTableQueryCommand2} and export the run that owns those rows` : " and export the run that owns the durable dataset") + "; this command will not use a database-wide table query that could mix runs." : ` The run status is '${runStatus || "unknown"}', so it likely failed before persisting rows to this dataset. That means provider calls may have been billed without a durable row; inspect ${inspectCommand}, fix the failure cause, then rerun the Play so completed receipts can be reused.`;
12392
12511
  throw new DeeplineError(
12393
- `Run ${input.status.runId} has zero rows to export from dataset '${datasetLabel}'.` + explanation + (available.length > 0 ? ` Available datasets: ${available.join(", ")}.` : " No datasets were materialized for this run."),
12512
+ `Run ${input.status.runId} has zero rows to export from dataset '${datasetLabel}'.` + explanation + (available.length > 0 ? ` Available datasets: ${availableWithCounts.join(", ")}.` : " No datasets were materialized for this run."),
12394
12513
  void 0,
12395
12514
  "RUN_EXPORT_EMPTY",
12396
12515
  {
@@ -12398,7 +12517,12 @@ function assertDatasetHasExportableRows(input) {
12398
12517
  dataset: datasetLabel,
12399
12518
  available,
12400
12519
  runStatus: runStatus || null,
12401
- guidance: terminalRunWithMissingAdvertisedRows ? {
12520
+ guidance: completedEmptyDataset ? {
12521
+ inspect_command: inspectCommand,
12522
+ ...allowEmptyEligible ? { allow_empty_command: `${retryCommand} --allow-empty` } : {},
12523
+ do_not_rerun: true,
12524
+ reason: "The run completed and this dataset has zero rows; there is nothing to export."
12525
+ } : terminalRunWithMissingAdvertisedRows ? {
12402
12526
  inspect_command: inspectCommand,
12403
12527
  retry_command: retryCommand,
12404
12528
  ...currentTableQueryCommand2 ? { lookup_writer_command: currentTableQueryCommand2 } : {},
@@ -13676,7 +13800,14 @@ async function handleFileBackedRun(options, hooks) {
13676
13800
  const started = await traceCliSpan(
13677
13801
  "cli.play_start_unwatched",
13678
13802
  { targetKind: "file", playName },
13679
- () => client.startPlayRun(startRequest, { onSubmission: hooks?.onSubmission }).catch(async (error) => {
13803
+ () => startPlayRunWithTransientRetry({
13804
+ client,
13805
+ request: startRequest,
13806
+ onSubmission: hooks?.onSubmission,
13807
+ playName,
13808
+ progress,
13809
+ jsonOutput: options.jsonOutput
13810
+ }).catch(async (error) => {
13680
13811
  throw await normalizePlayStartError(client, error, playName);
13681
13812
  })
13682
13813
  );
@@ -13927,7 +14058,14 @@ async function handleNamedRun(options, hooks) {
13927
14058
  const started = await traceCliSpan(
13928
14059
  "cli.play_start_unwatched",
13929
14060
  { targetKind: "name", playName },
13930
- () => client.startPlayRun(startRequest, { onSubmission: hooks?.onSubmission }).catch(async (error) => {
14061
+ () => startPlayRunWithTransientRetry({
14062
+ client,
14063
+ request: startRequest,
14064
+ onSubmission: hooks?.onSubmission,
14065
+ playName,
14066
+ progress,
14067
+ jsonOutput: options.jsonOutput
14068
+ }).catch(async (error) => {
13931
14069
  throw await normalizePlayStartError(client, error, playName, {
13932
14070
  suggestMissingPlay: true
13933
14071
  });
@@ -14190,11 +14328,24 @@ function parseRunIdPositional(args, usage2) {
14190
14328
  continue;
14191
14329
  }
14192
14330
  if (!arg.startsWith("--")) {
14193
- return arg;
14331
+ return assertRunIdArgument(arg);
14194
14332
  }
14195
14333
  }
14196
14334
  throw new DeeplineError(usage2);
14197
14335
  }
14336
+ async function explainingRunNotFound(readRunId, action) {
14337
+ try {
14338
+ return await action();
14339
+ } catch (error) {
14340
+ let runId;
14341
+ try {
14342
+ runId = readRunId();
14343
+ } catch {
14344
+ throw error;
14345
+ }
14346
+ throw explainRunNotFound(error, runId);
14347
+ }
14348
+ }
14198
14349
  function formatRunFactLines(value) {
14199
14350
  if (Array.isArray(value)) return value.flatMap(formatRunFactLines);
14200
14351
  const fields2 = readRecord(value);
@@ -14382,6 +14533,15 @@ async function withRunReadTiming(command, stage, enabled, action) {
14382
14533
  }
14383
14534
  }
14384
14535
  async function handleRunGet(args) {
14536
+ return explainingRunNotFound(
14537
+ () => parseRunIdPositional(
14538
+ parseJsonFields(args, args.includes("--config") ? "config" : "get").args,
14539
+ ""
14540
+ ),
14541
+ () => handleRunGetAndPrint(args)
14542
+ );
14543
+ }
14544
+ async function handleRunGetAndPrint(args) {
14385
14545
  const selection = parseJsonFields(
14386
14546
  args,
14387
14547
  args.includes("--config") ? "config" : "get"
@@ -15602,7 +15762,7 @@ async function handleRunStopAll(args) {
15602
15762
  {
15603
15763
  ...result2,
15604
15764
  render: {
15605
- sections: [{ title: "workspace stop-all (dry run)", lines: lines2 }]
15765
+ sections: [{ title: "org stop-all (dry run)", lines: lines2 }]
15606
15766
  }
15607
15767
  },
15608
15768
  { json: argsWantJson(args), text: `${lines2.join("\n")}
@@ -15621,13 +15781,19 @@ async function handleRunStopAll(args) {
15621
15781
  printCommandEnvelope(
15622
15782
  {
15623
15783
  ...result,
15624
- render: { sections: [{ title: "workspace stop-all", lines }] }
15784
+ render: { sections: [{ title: "org stop-all", lines }] }
15625
15785
  },
15626
15786
  { json: argsWantJson(args) }
15627
15787
  );
15628
15788
  return result.failed > 0 || result.partial ? 1 : 0;
15629
15789
  }
15630
15790
  async function handleRunExport(args) {
15791
+ return explainingRunNotFound(
15792
+ () => parseRunIdPositional(parseJsonFields(args, "export").args, ""),
15793
+ () => handleRunExportAndWrite(args)
15794
+ );
15795
+ }
15796
+ async function handleRunExportAndWrite(args) {
15631
15797
  const selection = parseJsonFields(args, "export");
15632
15798
  args = selection.args;
15633
15799
  const usage2 = "Usage: deepline runs export <run-id> [--dataset result.rows] --out <path> [--format csv|json] [--summary full|counts] [--wait] [--timeout-ms 300000] [--metadata-out export.json] [--allow-empty] [--json]";
@@ -15701,7 +15867,7 @@ async function handleRunExport(args) {
15701
15867
  }
15702
15868
  const client = new DeeplineClient();
15703
15869
  let status = await client.getPlayStatus(runId, { full: true });
15704
- assertRunExportStatusIdentity(status, runId);
15870
+ runId = assertRunExportStatusIdentity(status, runId);
15705
15871
  if (wait && !TERMINAL_PLAY_STATUSES.has(status.status)) {
15706
15872
  const progress = createCliProgress(!argsWantJson(args));
15707
15873
  try {
@@ -15722,7 +15888,7 @@ async function handleRunExport(args) {
15722
15888
  progress
15723
15889
  });
15724
15890
  status = await client.getPlayStatus(runId, { full: true });
15725
- assertRunExportStatusIdentity(status, runId);
15891
+ runId = assertRunExportStatusIdentity(status, runId);
15726
15892
  progress.complete();
15727
15893
  } catch (error) {
15728
15894
  progress.fail();
@@ -15820,7 +15986,11 @@ async function handleRunExport(args) {
15820
15986
  return 0;
15821
15987
  }
15822
15988
  function assertRunExportStatusIdentity(status, requestedRunId) {
15823
- if (status.runId === requestedRunId) return;
15989
+ if (status.runId === requestedRunId) return requestedRunId;
15990
+ const lookup = playRunIdLookupPrefix(requestedRunId);
15991
+ if (lookup && status.runId && shortPlayRunId(status.runId) === lookup) {
15992
+ return status.runId;
15993
+ }
15824
15994
  throw new DeeplineError(
15825
15995
  `Run status identity did not match requested run ${requestedRunId}; refusing to export rows for ${status.runId || "an unidentified run"}.`,
15826
15996
  void 0,
@@ -16577,6 +16747,57 @@ async function handlePlaySave(args) {
16577
16747
  return 5;
16578
16748
  }
16579
16749
  }
16750
+ async function enforceOutcomeGuardrail(input) {
16751
+ const { requireOutcomeGuardrail } = await import("./outcomes-QT7LQBPK.mjs");
16752
+ try {
16753
+ const gate = await requireOutcomeGuardrail({ ...input, phase: "reserve" });
16754
+ return {
16755
+ refused: null,
16756
+ approval: gate.gated && gate.approvedBySeq !== null ? { seq: gate.approvedBySeq, name: gate.approvedByName } : null
16757
+ };
16758
+ } catch (error) {
16759
+ const response = error.details?.response;
16760
+ const code = response?.code ?? "OUTCOME_GUARDRAIL_CHECK_FAILED";
16761
+ const message = response?.error ?? (error instanceof Error ? error.message : String(error));
16762
+ const status = error.statusCode;
16763
+ const exitCode = status === 403 ? 3 : status === 404 ? 4 : 5;
16764
+ if (input.json) {
16765
+ process.stdout.write(
16766
+ `${JSON.stringify({ ok: false, code, message, exitCode, ...response?.next ? { next: response.next } : {} }, null, 2)}
16767
+ `
16768
+ );
16769
+ } else {
16770
+ console.error(`Refused: ${code} (exit ${exitCode})`);
16771
+ console.error(` ${message}`);
16772
+ if (response?.next?.askCmd)
16773
+ console.error(` Next: ${response.next.askCmd}`);
16774
+ }
16775
+ return { refused: exitCode };
16776
+ }
16777
+ }
16778
+ async function settleOutcomeApproval(input) {
16779
+ const { requireOutcomeGuardrail } = await import("./outcomes-QT7LQBPK.mjs");
16780
+ const id = `${input.outcome}/${input.approval.seq}`;
16781
+ try {
16782
+ await requireOutcomeGuardrail({
16783
+ outcome: input.outcome,
16784
+ action: input.action,
16785
+ detail: input.detail,
16786
+ as: input.as,
16787
+ phase: input.succeeded ? "commit" : "release",
16788
+ approvalSeq: input.approval.seq
16789
+ });
16790
+ } catch (error) {
16791
+ console.error(
16792
+ `The approval in ${id} could not be ${input.succeeded ? "recorded as used" : "given back"}: ${error instanceof Error ? error.message : String(error)}. It stays held and allows no other run.`
16793
+ );
16794
+ return;
16795
+ }
16796
+ if (input.json) return;
16797
+ console.error(
16798
+ input.succeeded ? `Approved by ${input.approval.name ?? "a stakeholder"} in ${id}. That approval is now used.` : `Nothing ran, so the approval in ${id} was not used. It still allows one run.`
16799
+ );
16800
+ }
16580
16801
  async function handlePlayPublish(args) {
16581
16802
  let options;
16582
16803
  try {
@@ -16995,7 +17216,7 @@ Common commands:
16995
17216
  const saved = JSON.parse(
16996
17217
  await readFileAsync(resolve3(path), "utf8")
16997
17218
  );
16998
- const { callerPlayWorkflowIdMatchesRequest } = await import("./run-identity-MRNCEGV2.mjs");
17219
+ const { callerPlayWorkflowIdMatchesRequest } = await import("./run-identity-MAZ7ANH5.mjs");
16999
17220
  if (saved.version !== 1 || typeof saved.workflowId !== "string" || typeof saved.orgId !== "string" || typeof saved.baseUrl !== "string" || !saved.request || saved.request.admissionOrgId !== saved.orgId || saved.request.workflowId !== saved.workflowId || !callerPlayWorkflowIdMatchesRequest(
17000
17221
  saved.workflowId,
17001
17222
  saved.request
@@ -17413,9 +17634,7 @@ Examples:
17413
17634
  next: result.isDone ? null : `deepline plays triggers --cursor ${JSON.stringify(result.continueCursor)}`
17414
17635
  });
17415
17636
  });
17416
- play.command("cost <play>").description(
17417
- "Estimate one saved or prebuilt Play in the current workspace."
17418
- ).option("--json", "Emit the cost estimate as JSON").action(async (name, options) => {
17637
+ play.command("cost <play>").description("Estimate one saved or prebuilt Play in the current org.").option("--json", "Emit the cost estimate as JSON").action(async (name, options) => {
17419
17638
  process.exitCode = await handlePlayCost([
17420
17639
  name,
17421
17640
  ...options.json ? ["--json"] : []
@@ -17564,7 +17783,7 @@ Examples:
17564
17783
  process.exitCode = await ownView();
17565
17784
  return;
17566
17785
  }
17567
- const { describeAnything } = await import("./describe-QDANCTS3.mjs");
17786
+ const { describeAnything } = await import("./describe-EVJ4MFVU.mjs");
17568
17787
  process.exitCode = await describeAnything(
17569
17788
  name,
17570
17789
  {
@@ -17674,7 +17893,7 @@ Examples:
17674
17893
  async (directory, options) => handlePlaysDeploy(directory, options)
17675
17894
  );
17676
17895
  play.command("deployments [id]").description(
17677
- "Deployment history for this workspace; pass an id for one deployment and its plays."
17896
+ "Deployment history for this org; pass an id for one deployment and its plays."
17678
17897
  ).addHelpText(
17679
17898
  "after",
17680
17899
  `
@@ -17711,15 +17930,63 @@ Examples:
17711
17930
  ).option("--latest", "Promote the newest saved revision").option("--revision-id <id>", "Revision to promote").option(
17712
17931
  "--expected-artifact <hash>",
17713
17932
  "Require the local file to produce this checked artifact hash"
17714
- ).option("--dry-run", "Bundle and show the planned publish without mutation").option("--json", "Emit JSON output").action(async (target, options) => {
17715
- process.exitCode = await handlePlayPublish([
17716
- target,
17717
- ...options.latest ? ["--latest"] : [],
17718
- ...options.revisionId ? ["--revision-id", options.revisionId] : [],
17719
- ...options.expectedArtifact ? ["--expected-artifact", options.expectedArtifact] : [],
17720
- ...options.dryRun ? ["--dry-run"] : [],
17721
- ...options.json ? ["--json"] : []
17722
- ]);
17933
+ ).option("--dry-run", "Bundle and show the planned publish without mutation").addOption(
17934
+ new Option2(
17935
+ "--outcome <outcome>",
17936
+ "Run under this outcome. Refused (exit 3) when it asks before plays.set-live and no approval exists"
17937
+ ).hideHelp(!cliFeatureEnabled("outcomes"))
17938
+ ).addOption(
17939
+ new Option2("--as <agent>", "With --outcome: the agent acting").hideHelp(
17940
+ !cliFeatureEnabled("outcomes")
17941
+ )
17942
+ ).option("--json", "Emit JSON output").action(async (target, options) => {
17943
+ const guarded = options.outcome && !options.dryRun ? {
17944
+ outcome: String(options.outcome),
17945
+ action: "plays.set-live",
17946
+ detail: `plays set-live ${basename(target)}`,
17947
+ as: options.as,
17948
+ json: Boolean(options.json)
17949
+ } : null;
17950
+ let approval = null;
17951
+ if (guarded) {
17952
+ const gate = await enforceOutcomeGuardrail(guarded);
17953
+ if (gate.refused !== null) {
17954
+ process.exitCode = gate.refused;
17955
+ return;
17956
+ }
17957
+ approval = gate.approval;
17958
+ }
17959
+ let exitCode;
17960
+ let unknown = false;
17961
+ try {
17962
+ exitCode = await handlePlayPublish([
17963
+ target,
17964
+ ...options.latest ? ["--latest"] : [],
17965
+ ...options.revisionId ? ["--revision-id", options.revisionId] : [],
17966
+ ...options.expectedArtifact ? ["--expected-artifact", options.expectedArtifact] : [],
17967
+ ...options.dryRun ? ["--dry-run"] : [],
17968
+ ...options.json ? ["--json"] : []
17969
+ ]);
17970
+ process.exitCode = exitCode;
17971
+ } catch (error) {
17972
+ const status = error.statusCode;
17973
+ unknown = !(typeof status === "number" && status >= 400 && status < 500);
17974
+ throw error;
17975
+ } finally {
17976
+ if (guarded && approval) {
17977
+ if (unknown) {
17978
+ console.error(
17979
+ `The publish did not report whether it went through, so the approval in ${guarded.outcome}/${approval.seq} stays held and allows no other run. Check the play, then ask again if it is not live.`
17980
+ );
17981
+ } else {
17982
+ await settleOutcomeApproval({
17983
+ ...guarded,
17984
+ approval,
17985
+ succeeded: exitCode === 0
17986
+ });
17987
+ }
17988
+ }
17989
+ }
17723
17990
  });
17724
17991
  play.command("delete <target>").description("Move an org-owned play to Trash and stop its triggers.").addHelpText(
17725
17992
  "after",
@@ -17804,7 +18071,7 @@ Examples:
17804
18071
  deepline runs list --play my-play --status failed
17805
18072
  deepline runs list --status running
17806
18073
  deepline runs stop play/my-play/run/20260501t000000-000 --reason "stale lock"
17807
- deepline runs stop-all --reason "unjam workspace"
18074
+ deepline runs stop-all --reason "unjam org"
17808
18075
  deepline runs export play/my-play/run/20260501t000000-000 --out output.csv
17809
18076
  `
17810
18077
  );
@@ -17907,7 +18174,7 @@ Examples:
17907
18174
  new Option2("--log-failed", "Attach terminal-failure logs").hideHelp()
17908
18175
  ).action(async (runId, options) => {
17909
18176
  if (TOOL_EXECUTION_ID.test(runId)) {
17910
- const { getToolExecutionReceipt } = await import("./tools-7IJHGF6W.mjs");
18177
+ const { getToolExecutionReceipt } = await import("./tools-W3QT5EJY.mjs");
17911
18178
  process.exitCode = await getToolExecutionReceipt(runId, {
17912
18179
  receiptJson: options.json !== void 0
17913
18180
  });
@@ -18029,11 +18296,11 @@ Examples:
18029
18296
  ...options.timing ? ["--timing"] : []
18030
18297
  ]);
18031
18298
  });
18032
- runs.command("stop-all").description("Stop active play runs in the current workspace.").addHelpText(
18299
+ runs.command("stop-all").description("Stop active play runs in the current org.").addHelpText(
18033
18300
  "after",
18034
18301
  `
18035
18302
  Notes:
18036
- Stops all active runs visible to this workspace, including child runs created by deepline.runPlay.
18303
+ Stops all active runs visible to this org, including child runs created by deepline.runPlay.
18037
18304
  --dry-run lists the exact candidates (same scope, statuses, and order) and
18038
18305
  never cancels or mutates anything. A real stop-all exits nonzero when any
18039
18306
  cancellation failed or the candidate list was truncated; failed runs stay
@@ -18041,7 +18308,7 @@ Notes:
18041
18308
 
18042
18309
  Examples:
18043
18310
  deepline runs stop-all --dry-run
18044
- deepline runs stop-all --reason "unjam workspace"
18311
+ deepline runs stop-all --reason "unjam org"
18045
18312
  deepline runs stop-all
18046
18313
  `
18047
18314
  ).option("--reason <text>", "Reason to include with each stop request").option(
@@ -18621,8 +18888,10 @@ async function handlePlayShareUnpublish(args) {
18621
18888
  return 0;
18622
18889
  }
18623
18890
  export {
18891
+ PLAY_START_TRANSIENT_RETRY_DELAYS_MS,
18624
18892
  PREBUILT_PLAY_TAG_KEYS,
18625
18893
  assertDatasetHasExportableRows,
18894
+ assertRunExportStatusIdentity,
18626
18895
  buildPlayCompletionTextLines,
18627
18896
  buildRunActivityTextLines,
18628
18897
  buildRunLaunch,
@@ -18685,6 +18954,7 @@ export {
18685
18954
  shouldPrintPlayProgressLine,
18686
18955
  startAndWaitForPlayCompletion,
18687
18956
  startAndWaitForPlayCompletionByStream,
18957
+ startPlayRunWithTransientRetry,
18688
18958
  takeFromRunRerunArgs,
18689
18959
  truncateErrorForDisplay,
18690
18960
  waitForPlayCompletionByWatch,