deepline 0.3.409 → 0.3.410

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 (213) hide show
  1. package/dist/bundling-sources/sdk/src/agent-runtime.ts +18 -1
  2. package/dist/bundling-sources/sdk/src/client.ts +206 -333
  3. package/dist/bundling-sources/sdk/src/compat.ts +45 -2
  4. package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
  5. package/dist/bundling-sources/sdk/src/http.ts +38 -20
  6. package/dist/bundling-sources/sdk/src/index.ts +4 -5
  7. package/dist/bundling-sources/sdk/src/play.ts +10 -10
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
  9. package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
  10. package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
  11. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
  12. package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
  13. package/dist/bundling-sources/sdk/src/release.ts +13 -7
  14. package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
  15. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
  16. package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
  17. package/dist/bundling-sources/sdk/src/types.ts +18 -0
  18. package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
  19. package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
  20. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
  22. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
  25. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
  28. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
  29. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
  30. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
  39. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
  42. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
  54. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
  56. package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
  57. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
  58. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
  59. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
  60. package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
  61. package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
  62. package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
  63. package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
  64. package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
  65. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  66. package/dist/cli/{auth-5HIIACF7.mjs → auth-LLXLIILR.mjs} +6 -6
  67. package/dist/cli/auth-UG4WOYGL.js +40 -0
  68. package/dist/cli/{billing-EVZ3ZWKC.mjs → billing-5FVXZYAC.mjs} +8 -8
  69. package/dist/cli/{billing-4275N7FL.js → billing-NFPK7GYP.js} +84 -84
  70. package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
  71. package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
  72. package/dist/cli/{chunk-TQNHMWUR.mjs → chunk-2YR7BIIC.mjs} +5 -2
  73. package/dist/cli/{chunk-AU4OFDFX.js → chunk-36AHOWVS.js} +26 -26
  74. package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
  75. package/dist/cli/{chunk-PBZYY7VZ.mjs → chunk-4XQLVUC7.mjs} +734 -511
  76. package/dist/cli/chunk-5TUGWDEB.js +313 -0
  77. package/dist/cli/{chunk-DEC3JECC.js → chunk-5UUQAGJS.js} +5 -2
  78. package/dist/cli/{chunk-JRAVVJ3T.mjs → chunk-5V5Y37BC.mjs} +2 -2
  79. package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
  80. package/dist/cli/{chunk-V76R6HMV.js → chunk-63S7X326.js} +1029 -806
  81. package/dist/cli/{chunk-VWBTTJYQ.mjs → chunk-6PGATQ6L.mjs} +6 -3
  82. package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
  83. package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
  84. package/dist/cli/{chunk-GAICVLKL.js → chunk-D37FEBES.js} +2 -2
  85. package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
  86. package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
  87. package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
  88. package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
  89. package/dist/cli/{chunk-FJCIUF34.js → chunk-FVLNYDI4.js} +128 -376
  90. package/dist/cli/{chunk-O3VSXP2F.js → chunk-FZJAM576.js} +50 -50
  91. package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
  92. package/dist/cli/{chunk-N44JHMKY.mjs → chunk-IPG42SD2.mjs} +452 -138
  93. package/dist/cli/chunk-J33TSWO5.js +8 -0
  94. package/dist/cli/{chunk-BEVLCKXG.mjs → chunk-JNXJZ577.mjs} +1 -1
  95. package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
  96. package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
  97. package/dist/cli/{chunk-WLOCMJWV.js → chunk-LTFL4JRN.js} +426 -721
  98. package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
  99. package/dist/cli/{chunk-NZSF57UO.mjs → chunk-MN2OWLFA.mjs} +2 -2
  100. package/dist/cli/{chunk-YD7B53RW.js → chunk-NF4V5DTY.js} +12 -12
  101. package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
  102. package/dist/cli/chunk-NTVLGHFM.js +501 -0
  103. package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
  104. package/dist/cli/{chunk-JGHG4NBA.js → chunk-OBB4QXHA.js} +19 -4
  105. package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
  106. package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
  107. package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
  108. package/dist/cli/{chunk-FHPCKULR.mjs → chunk-PZSLPBDA.mjs} +2 -2
  109. package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
  110. package/dist/cli/{chunk-RTCDW2GU.js → chunk-QJI5FIOW.js} +170 -49
  111. package/dist/cli/{chunk-WYQO2CBS.mjs → chunk-QL22Y56M.mjs} +149 -28
  112. package/dist/cli/{chunk-2PRO2JTX.mjs → chunk-RFB25DSQ.mjs} +36 -284
  113. package/dist/cli/chunk-T44IIOT6.mjs +501 -0
  114. package/dist/cli/chunk-VK2LZ5IP.js +35 -0
  115. package/dist/cli/chunk-VKKVSFRD.js +62 -0
  116. package/dist/cli/{chunk-2GI3QD3L.js → chunk-VYKV5XHL.js} +644 -330
  117. package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
  118. package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
  119. package/dist/cli/{chunk-IT3XBJQR.mjs → chunk-XIHWSXSV.mjs} +330 -625
  120. package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
  121. package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
  122. package/dist/cli/{chunk-WHG43Z67.js → chunk-ZFZ427HN.js} +11 -8
  123. package/dist/cli/{chunk-J6DCKJNM.mjs → chunk-ZKYEW55U.mjs} +16 -1
  124. package/dist/cli/{csv-BBOTCGQY.js → csv-7U3FJYKZ.js} +14 -14
  125. package/dist/cli/{csv-A2MP6EFV.mjs → csv-ZWLDMM4A.mjs} +5 -5
  126. package/dist/cli/{db-G4CODDCA.js → db-DNCGV5PC.js} +42 -47
  127. package/dist/cli/{db-3W5DMTUX.mjs → db-IMYXVMGI.mjs} +15 -20
  128. package/dist/cli/{describe-XYJ2ZT4M.mjs → describe-Q23DWJUK.mjs} +20 -15
  129. package/dist/cli/{describe-PQTQ5B6F.js → describe-S34JUX5W.js} +27 -22
  130. package/dist/cli/describe-core.d.mts +2 -2
  131. package/dist/cli/describe-core.d.ts +2 -2
  132. package/dist/cli/describe-core.js +6 -6
  133. package/dist/cli/describe-core.mjs +5 -5
  134. package/dist/cli/{executions-UR67CA5H.mjs → executions-A73EUGSI.mjs} +8 -8
  135. package/dist/cli/{executions-TLANVR7Y.js → executions-XOMPX2YJ.js} +10 -10
  136. package/dist/cli/{feedback-WHCMGEIL.mjs → feedback-N4GJ2POI.mjs} +11 -7
  137. package/dist/cli/{feedback-6C2YTRJL.js → feedback-QTCHNJJH.js} +13 -9
  138. package/dist/cli/{git-GWLB6VSA.mjs → git-4Q3JIQYZ.mjs} +6 -6
  139. package/dist/cli/git-I6CPBEVG.js +24 -0
  140. package/dist/cli/index.js +236 -348
  141. package/dist/cli/index.mjs +162 -274
  142. package/dist/cli/{legacy-noops-KF4XIFEF.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
  143. package/dist/cli/{legacy-noops-ZUFA7RWI.js → legacy-noops-4OSHZM34.js} +9 -9
  144. package/dist/cli/{monitors-TB3K2IVE.js → monitors-LVE2KZNG.js} +94 -94
  145. package/dist/cli/{monitors-6UOIDIMB.mjs → monitors-QP2XID2B.mjs} +8 -8
  146. package/dist/cli/{org-WGHHMVDZ.mjs → org-IVRETVQA.mjs} +8 -8
  147. package/dist/cli/{org-CKWMBPIR.js → org-XFLK5IAP.js} +68 -68
  148. package/dist/cli/{play-LYPAXCLD.mjs → play-DE7VH6NU.mjs} +533 -98
  149. package/dist/cli/{play-N2B3KAVS.js → play-XXTPPP23.js} +1067 -632
  150. package/dist/cli/{providers-UR42MD6Z.js → providers-DLD3I4JF.js} +11 -11
  151. package/dist/cli/{providers-6DI5BVZJ.mjs → providers-GX2NIZQQ.mjs} +8 -8
  152. package/dist/cli/{quickstart-MNA2S6PO.mjs → quickstart-72B4L4PK.mjs} +5 -5
  153. package/dist/cli/{quickstart-FCJG4XGB.js → quickstart-XNS3HSWC.js} +7 -7
  154. package/dist/cli/search-6NCH4HB5.js +30 -0
  155. package/dist/cli/{search-VPPYUJ2M.mjs → search-SUTRANJI.mjs} +9 -9
  156. package/dist/cli/{secrets-QOSMVO36.js → secrets-6OBLOVEV.js} +17 -17
  157. package/dist/cli/{secrets-DRI4W7Z5.mjs → secrets-FPFXXNUH.mjs} +8 -8
  158. package/dist/cli/sessions-235532DR.js +16 -0
  159. package/dist/cli/{sessions-DQNUKP43.mjs → sessions-R25I4QKN.mjs} +6 -6
  160. package/dist/cli/{settings-DWDK3Y2R.mjs → settings-AOP6F5PZ.mjs} +12 -12
  161. package/dist/cli/{settings-JUGGCOPS.js → settings-VL5FOFPN.js} +79 -79
  162. package/dist/cli/{setup-AWBHNYXK.js → setup-BSC67YT3.js} +45 -44
  163. package/dist/cli/{setup-D5DWVNY4.mjs → setup-ZMPHBHVJ.mjs} +11 -10
  164. package/dist/cli/skills-3IWLYYRL.js +29 -0
  165. package/dist/cli/{skills-YV2XR35J.mjs → skills-KF65TVFO.mjs} +7 -7
  166. package/dist/cli/tools-LR66SPYU.js +44 -0
  167. package/dist/cli/{tools-VFJYHNV2.mjs → tools-SX4XIPM7.mjs} +19 -14
  168. package/dist/cli/{update-IM6VOTGL.mjs → update-QRMFRAQQ.mjs} +11 -9
  169. package/dist/cli/update-SP7UEO53.js +31 -0
  170. package/dist/cli/{workflow-26URBWPV.mjs → workflow-FOEEEB7G.mjs} +44 -20
  171. package/dist/cli/{workflow-3BS6U6SL.js → workflow-KOCK2FLW.js} +54 -30
  172. package/dist/{client-BfInrZPB.d.mts → client-74k4IPh6.d.mts} +135 -54
  173. package/dist/{client-BMjJFpan.d.ts → client-C1IK1f8c.d.ts} +135 -54
  174. package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
  175. package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
  176. package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
  177. package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
  178. package/dist/index.d.mts +47 -9
  179. package/dist/index.d.ts +47 -9
  180. package/dist/index.js +17 -14
  181. package/dist/index.mjs +13 -10
  182. package/dist/install-integrity.json +118 -102
  183. package/dist/plays/bundle-play-file.d.mts +3 -3
  184. package/dist/plays/bundle-play-file.d.ts +3 -3
  185. package/dist/plays/bundle-play-file.mjs +5 -4
  186. package/dist/plays/csv-data-input.js +3 -3
  187. package/dist/plays/csv-data-input.mjs +2 -2
  188. package/dist/plays/play-description.d.mts +2 -2
  189. package/dist/plays/play-description.d.ts +2 -2
  190. package/dist/plays/run-request.d.mts +2 -2
  191. package/dist/plays/run-request.d.ts +2 -2
  192. package/dist/plays/run-request.js +11 -3
  193. package/dist/plays/run-request.mjs +10 -2
  194. package/dist/release.d.mts +15 -6
  195. package/dist/release.d.ts +15 -6
  196. package/dist/release.js +2 -2
  197. package/dist/release.mjs +1 -1
  198. package/package.json +2 -2
  199. package/dist/cli/auth-F6BX32XZ.js +0 -40
  200. package/dist/cli/chunk-264PC2RN.mjs +0 -83
  201. package/dist/cli/chunk-44ZTYHMQ.mjs +0 -155
  202. package/dist/cli/chunk-53HN7WZN.js +0 -392
  203. package/dist/cli/chunk-7AALNGTA.mjs +0 -392
  204. package/dist/cli/chunk-ALD4COBH.js +0 -155
  205. package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
  206. package/dist/cli/chunk-WNUR6VP5.js +0 -83
  207. package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
  208. package/dist/cli/git-VQFF6D7C.js +0 -24
  209. package/dist/cli/search-NCEEONMQ.js +0 -30
  210. package/dist/cli/sessions-3WYKQABW.js +0 -16
  211. package/dist/cli/skills-AKPAJVSO.js +0 -29
  212. package/dist/cli/tools-RBKEK6PM.js +0 -39
  213. package/dist/cli/update-VFNUBLDA.js +0 -29
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
3
 
4
- var _chunkZAAKSJASjs = require('./chunk-ZAAKSJAS.js');
4
+ var _chunk27GJKC5Qjs = require('./chunk-27GJKC5Q.js');
5
5
 
6
6
 
7
- var _chunk53HN7WZNjs = require('./chunk-53HN7WZN.js');
7
+ var _chunkOZ6E3IRZjs = require('./chunk-OZ6E3IRZ.js');
8
8
 
9
9
 
10
10
 
11
- var _chunkAU4OFDFXjs = require('./chunk-AU4OFDFX.js');
11
+ var _chunk36AHOWVSjs = require('./chunk-36AHOWVS.js');
12
12
 
13
13
 
14
14
  var _chunkBQR6UN3Cjs = require('./chunk-BQR6UN3C.js');
@@ -23,16 +23,17 @@ require('./chunk-ZM2YPJQJ.js');
23
23
 
24
24
 
25
25
 
26
- var _chunkSEFMGO3Zjs = require('./chunk-SEFMGO3Z.js');
26
+ var _chunkOQQOXSYAjs = require('./chunk-OQQOXSYA.js');
27
27
  require('./chunk-3KC45UVF.js');
28
+ require('./chunk-J33TSWO5.js');
28
29
 
29
30
 
30
- var _chunkGSK6NHVMjs = require('./chunk-GSK6NHVM.js');
31
+ var _chunkWU4U6VSBjs = require('./chunk-WU4U6VSB.js');
31
32
 
32
33
 
33
34
 
34
35
  var _chunkGEJDBXXMjs = require('./chunk-GEJDBXXM.js');
35
- require('./chunk-Z4VNJOF7.js');
36
+ require('./chunk-VKKVSFRD.js');
36
37
 
37
38
 
38
39
 
@@ -45,9 +46,9 @@ require('./chunk-Z4VNJOF7.js');
45
46
 
46
47
 
47
48
 
48
- var _chunkV76R6HMVjs = require('./chunk-V76R6HMV.js');
49
- require('./chunk-S6R3OX7B.js');
50
49
 
50
+ var _chunk63S7X326js = require('./chunk-63S7X326.js');
51
+ require('./chunk-E4CABWXL.js');
51
52
 
52
53
 
53
54
 
@@ -56,7 +57,9 @@ require('./chunk-S6R3OX7B.js');
56
57
 
57
58
 
58
59
 
59
- var _chunkUHNDVD3Pjs = require('./chunk-UHNDVD3P.js');
60
+
61
+
62
+ var _chunk2H4EY7KHjs = require('./chunk-2H4EY7KH.js');
60
63
 
61
64
 
62
65
 
@@ -65,12 +68,17 @@ require('./chunk-XDVT3GOM.js');
65
68
 
66
69
 
67
70
 
68
- var _chunkJGHG4NBAjs = require('./chunk-JGHG4NBA.js');
71
+ var _chunkVK2LZ5IPjs = require('./chunk-VK2LZ5IP.js');
72
+
73
+
74
+
75
+
69
76
 
77
+ var _chunkOBB4QXHAjs = require('./chunk-OBB4QXHA.js');
70
78
 
71
79
 
72
- var _chunkALD4COBHjs = require('./chunk-ALD4COBH.js');
73
80
 
81
+ var _chunkLTFL4JRNjs = require('./chunk-LTFL4JRN.js');
74
82
 
75
83
 
76
84
 
@@ -84,16 +92,17 @@ var _chunkALD4COBHjs = require('./chunk-ALD4COBH.js');
84
92
 
85
93
 
86
94
 
87
- var _chunkYD7B53RWjs = require('./chunk-YD7B53RW.js');
88
95
 
96
+ var _chunkNF4V5DTYjs = require('./chunk-NF4V5DTY.js');
89
97
 
90
- var _chunkFJCIUF34js = require('./chunk-FJCIUF34.js');
91
- require('./chunk-Q2E4E4FJ.js');
98
+
99
+ var _chunkFVLNYDI4js = require('./chunk-FVLNYDI4.js');
100
+ require('./chunk-NPBJI7RE.js');
92
101
  require('./chunk-XNYIZMNQ.js');
93
102
 
94
103
 
95
- var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
96
- require('./chunk-DEC3JECC.js');
104
+ var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
105
+ require('./chunk-5UUQAGJS.js');
97
106
  require('./chunk-OG64RBAC.js');
98
107
 
99
108
 
@@ -2075,7 +2084,7 @@ function resolveField(key, command) {
2075
2084
  function printSettings(result, json, name) {
2076
2085
  result = { ...result, settings: parsePlaySettings(result.settings) };
2077
2086
  const selected = fields.filter(([key]) => !name || key === name);
2078
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2087
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2079
2088
  {
2080
2089
  ...result,
2081
2090
  settings: Object.fromEntries(
@@ -2119,7 +2128,7 @@ function registerPlaySettingsCommands(plays) {
2119
2128
  valueSyntax: field.cli.valueSyntax,
2120
2129
  examples: field.cli.examples
2121
2130
  }));
2122
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2131
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2123
2132
  {
2124
2133
  fields: descriptions,
2125
2134
  render: {
@@ -2144,7 +2153,7 @@ function registerPlaySettingsCommands(plays) {
2144
2153
  async (options, command) => {
2145
2154
  if (options.name !== void 0) resolveField(options.name, command);
2146
2155
  printSettings(
2147
- await new (0, _chunkV76R6HMVjs.DeeplineClient)().getPlaySettings(options.play),
2156
+ await new (0, _chunk63S7X326js.DeeplineClient)().getPlaySettings(options.play),
2148
2157
  options.json,
2149
2158
  options.name
2150
2159
  );
@@ -2175,7 +2184,7 @@ function registerPlaySettingsCommands(plays) {
2175
2184
  );
2176
2185
  }
2177
2186
  if (options.dryRun) {
2178
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2187
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2179
2188
  {
2180
2189
  dryRun: true,
2181
2190
  play,
@@ -2196,7 +2205,7 @@ function registerPlaySettingsCommands(plays) {
2196
2205
  return;
2197
2206
  }
2198
2207
  printSettings(
2199
- await new (0, _chunkV76R6HMVjs.DeeplineClient)().updatePlaySettings(play, patch),
2208
+ await new (0, _chunk63S7X326js.DeeplineClient)().updatePlaySettings(play, patch),
2200
2209
  options.json
2201
2210
  );
2202
2211
  };
@@ -2222,13 +2231,13 @@ function registerPlaySettingsCommands(plays) {
2222
2231
  "--root must be person or team; --limit must be 1\u2013100.",
2223
2232
  { exitCode: 2 }
2224
2233
  );
2225
- const page = await new (0, _chunkV76R6HMVjs.DeeplineClient)().listPlaySettingsPaths({
2234
+ const page = await new (0, _chunk63S7X326js.DeeplineClient)().listPlaySettingsPaths({
2226
2235
  root: options.root,
2227
2236
  limit,
2228
2237
  cursor: options.cursor
2229
2238
  });
2230
2239
  const nextCommand = page.hasMore ? `deepline plays settings paths --cursor '${page.cursor}'${options.root ? ` --root ${options.root}` : ""}` : null;
2231
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2240
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2232
2241
  {
2233
2242
  ...page,
2234
2243
  nextCommand,
@@ -2279,7 +2288,7 @@ function registerPlaySettingsCommands(plays) {
2279
2288
  root: _nullishCoalesce(_optionalChain([toPath, 'optionalAccess', _13 => _13.root]), () => ( "person")),
2280
2289
  folders: _nullishCoalesce(_optionalChain([toPath, 'optionalAccess', _14 => _14.folders]), () => ( []))
2281
2290
  };
2282
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
2291
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
2283
2292
  const paths = [];
2284
2293
  let cursor;
2285
2294
  do {
@@ -2341,7 +2350,7 @@ function registerPlaySettingsCommands(plays) {
2341
2350
  moved.push(move.playName);
2342
2351
  }
2343
2352
  }
2344
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2353
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2345
2354
  {
2346
2355
  dryRun: Boolean(options.dryRun),
2347
2356
  from: options.from,
@@ -2469,7 +2478,7 @@ function triggerLines(view) {
2469
2478
  return lines;
2470
2479
  }
2471
2480
  function printView(view, json) {
2472
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2481
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2473
2482
  {
2474
2483
  ...view,
2475
2484
  render: {
@@ -2482,7 +2491,7 @@ function printView(view, json) {
2482
2491
  );
2483
2492
  }
2484
2493
  function printResult(result, json) {
2485
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2494
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2486
2495
  {
2487
2496
  ...result,
2488
2497
  render: {
@@ -2512,7 +2521,7 @@ async function mutate(command, options, build) {
2512
2521
  usage(command, `Invalid trigger: ${formatPlayTriggerConfigError(error)}`);
2513
2522
  }
2514
2523
  if (options.dryRun) {
2515
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
2524
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
2516
2525
  {
2517
2526
  dryRun: true,
2518
2527
  play: options.play,
@@ -2531,7 +2540,7 @@ async function mutate(command, options, build) {
2531
2540
  return;
2532
2541
  }
2533
2542
  printResult(
2534
- await new (0, _chunkV76R6HMVjs.DeeplineClient)().updatePlayTriggerConfig(options.play, update),
2543
+ await new (0, _chunk63S7X326js.DeeplineClient)().updatePlayTriggerConfig(options.play, update),
2535
2544
  options.json
2536
2545
  );
2537
2546
  }
@@ -2564,7 +2573,7 @@ function registerPlayTriggerConfigCommands(plays) {
2564
2573
  }).addHelpText("after", help2);
2565
2574
  trigger.command("get").description("Show the cron and webhook triggers of a Play.").requiredOption("--play <play>", "Play to read").option("--json", "Emit JSON").addHelpText("after", help2).action(async (options) => {
2566
2575
  printView(
2567
- await new (0, _chunkV76R6HMVjs.DeeplineClient)().getPlayTriggerConfig(options.play),
2576
+ await new (0, _chunk63S7X326js.DeeplineClient)().getPlayTriggerConfig(options.play),
2568
2577
  options.json
2569
2578
  );
2570
2579
  });
@@ -2608,7 +2617,7 @@ function registerPlayTriggerConfigCommands(plays) {
2608
2617
  if (options.auth === void 0) {
2609
2618
  if (secrets.length || options.header || options.signaturePrefix)
2610
2619
  usage(setWebhook, "--secret/--header need --auth.");
2611
- const current = await new (0, _chunkV76R6HMVjs.DeeplineClient)().getPlayTriggerConfig(
2620
+ const current = await new (0, _chunk63S7X326js.DeeplineClient)().getPlayTriggerConfig(
2612
2621
  options.play
2613
2622
  );
2614
2623
  return {
@@ -2685,7 +2694,7 @@ var KIND_DESCRIPTIONS = {
2685
2694
  "receipt.skipped": "Saved work result: skipped.",
2686
2695
  "runtime.event": "Other event."
2687
2696
  };
2688
- var RUN_LOGS_KIND_HELP = _chunkV76R6HMVjs.RUN_EVENT_SEARCH_KIND_VALUES.map((kind) => ({
2697
+ var RUN_LOGS_KIND_HELP = _chunk63S7X326js.RUN_EVENT_SEARCH_KIND_VALUES.map((kind) => ({
2689
2698
  kind,
2690
2699
  description: KIND_DESCRIPTIONS[kind]
2691
2700
  }));
@@ -2822,9 +2831,9 @@ function configureRunQueryCommandErrors(command, resource) {
2822
2831
  const args = program.args;
2823
2832
  if (error.exitCode !== 0 && (resource === "events" || requestsStructuredLogs(args))) {
2824
2833
  error.exitCode = 2;
2825
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args) || command.optsWithGlobals().json === true) {
2826
- _chunkYD7B53RWjs.printJsonError.call(void 0,
2827
- Object.assign(new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(error.message), {
2834
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args) || command.optsWithGlobals().json === true) {
2835
+ _chunkNF4V5DTYjs.printJsonError.call(void 0,
2836
+ Object.assign(new (0, _chunk63S7X326js.RunEventQueryInputError)(error.message), {
2828
2837
  exitCode: 2,
2829
2838
  retryable: false
2830
2839
  })
@@ -2868,14 +2877,14 @@ function parseQuery(args, resource) {
2868
2877
  if (VALUE_FLAGS.has(flag)) {
2869
2878
  const value = equals > 0 ? arg.slice(equals + 1) : args[++index];
2870
2879
  if (!value || equals < 0 && value.startsWith("--") && flag !== "--query" && flag !== "--where") {
2871
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2880
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2872
2881
  `${flag} requires a value. Use ${flag} <value>.`
2873
2882
  );
2874
2883
  }
2875
2884
  if (flag === "--sum") sums.push(value);
2876
2885
  else {
2877
2886
  if (values[flag] !== void 0) {
2878
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2887
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2879
2888
  `${flag} may only be supplied once.`
2880
2889
  );
2881
2890
  }
@@ -2889,12 +2898,12 @@ function parseQuery(args, resource) {
2889
2898
  }
2890
2899
  if (arg.startsWith("-")) {
2891
2900
  const correction = flag === "--log-level" ? "Use --level for structured severity filtering." : flag === "--out" || flag === "--failed" || flag === "--all" ? "Use this flag with a plain runs logs <run-id> text read." : "Use --step, --level, --query, --where, --count, --group-by or --fields; see runs logs --help.";
2892
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2901
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2893
2902
  `Unsupported query flag ${flag}. ${correction}`
2894
2903
  );
2895
2904
  }
2896
2905
  if (runId !== void 0) {
2897
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2906
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2898
2907
  `Unexpected argument ${JSON.stringify(arg)}. Supply one run ID.`
2899
2908
  );
2900
2909
  }
@@ -2902,7 +2911,7 @@ function parseQuery(args, resource) {
2902
2911
  }
2903
2912
  if (switches.has("--fields")) {
2904
2913
  if (runId !== void 0) {
2905
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2914
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2906
2915
  "--fields does not use a run ID. Omit the positional run ID."
2907
2916
  );
2908
2917
  }
@@ -2915,18 +2924,18 @@ function parseQuery(args, resource) {
2915
2924
  )
2916
2925
  ];
2917
2926
  if (incompatible.length) {
2918
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2927
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2919
2928
  `--fields cannot be combined with ${incompatible.join(", ")}. Use --fields alone to discover the query contract.`
2920
2929
  );
2921
2930
  }
2922
2931
  }
2923
2932
  if (switches.has("--count") && values["--group-by"] !== void 0) {
2924
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2933
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2925
2934
  "--count cannot be combined with --group-by. Use --group-by for counts per group."
2926
2935
  );
2927
2936
  }
2928
2937
  if (sums.length && switches.has("--count")) {
2929
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2938
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2930
2939
  "--sum cannot be combined with --count. Use --sum for the exact count and numeric total."
2931
2940
  );
2932
2941
  }
@@ -2934,7 +2943,7 @@ function parseQuery(args, resource) {
2934
2943
  if (operation === "count") {
2935
2944
  for (const flag of ["--limit", "--cursor", "--payloads"]) {
2936
2945
  if (values[flag] !== void 0 || switches.has(flag)) {
2937
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2946
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2938
2947
  `--count cannot be combined with ${flag}. Remove ${flag} to count all matching retained records.`
2939
2948
  );
2940
2949
  }
@@ -2969,16 +2978,16 @@ function parseQuery(args, resource) {
2969
2978
  ];
2970
2979
  }
2971
2980
  }
2972
- const request = _chunkV76R6HMVjs.normalizeRunEventOperationRequest.call(void 0, body);
2981
+ const request = _chunk63S7X326js.normalizeRunEventOperationRequest.call(void 0, body);
2973
2982
  const namespace = _nullishCoalesce(values["--runtime-namespace"], () => ( (process.env.DEEPLINE_RUNTIME_ENVIRONMENT === "preview" ? process.env.DEEPLINE_RUNTIME_NAMESPACE : void 0)));
2974
2983
  const backend = values["--runtime-backend"];
2975
2984
  if (backend && backend !== "daytona" && backend !== "modal") {
2976
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2985
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2977
2986
  "--runtime-backend must be daytona or modal."
2978
2987
  );
2979
2988
  }
2980
2989
  if (backend && !namespace) {
2981
- throw new (0, _chunkV76R6HMVjs.RunEventQueryInputError)(
2990
+ throw new (0, _chunk63S7X326js.RunEventQueryInputError)(
2982
2991
  "--runtime-backend requires --runtime-namespace."
2983
2992
  );
2984
2993
  }
@@ -3025,12 +3034,12 @@ async function handleRunEventQuery(args, resource = "logs") {
3025
3034
  const failure = error instanceof Error ? error : new Error(String(error));
3026
3035
  const record3 = failure;
3027
3036
  const status = record3.statusCode;
3028
- const exitCode = error instanceof _chunkV76R6HMVjs.RunEventQueryInputError || status === 400 || status === 422 || record3.code === "INVALID_RUNTIME_SELECTION" ? 2 : status === 401 || status === 403 || record3.code === "CONFIG_ERROR" || record3.code === "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED" ? 3 : status === 404 ? 4 : 5;
3037
+ const exitCode = error instanceof _chunk63S7X326js.RunEventQueryInputError || status === 400 || status === 422 || record3.code === "INVALID_RUNTIME_SELECTION" ? 2 : status === 401 || status === 403 || record3.code === "CONFIG_ERROR" || record3.code === "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED" ? 3 : status === 404 ? 4 : 5;
3029
3038
  const diagnostic = Object.assign(failure, {
3030
3039
  exitCode,
3031
3040
  retryable: exitCode === 5
3032
3041
  });
3033
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) _chunkYD7B53RWjs.printJsonError.call(void 0, diagnostic);
3042
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) _chunkNF4V5DTYjs.printJsonError.call(void 0, diagnostic);
3034
3043
  else console.error(`Error: ${diagnostic.message}`);
3035
3044
  return exitCode;
3036
3045
  }
@@ -3045,7 +3054,7 @@ async function executeRunEventQuery(args, resource) {
3045
3054
  ...criteria
3046
3055
  } = request;
3047
3056
  const options = { ...criteria, ...runtime ? { runtime } : {} };
3048
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
3057
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
3049
3058
  let result;
3050
3059
  if (request.operation === "fields") {
3051
3060
  result = await client.runs[resource].fields(runtime ? { runtime } : {});
@@ -3111,13 +3120,13 @@ async function executeRunEventQuery(args, resource) {
3111
3120
  lines.push(`Next page: ${nextPage}`);
3112
3121
  }
3113
3122
  }
3114
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
3123
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
3115
3124
  {
3116
3125
  ...result,
3117
3126
  ...nextPage ? { next: { page: nextPage } } : {},
3118
3127
  render: { sections: [{ title: `run ${resource}`, lines }] }
3119
3128
  },
3120
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args), text: `${lines.join("\n")}
3129
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args), text: `${lines.join("\n")}
3121
3130
  ` }
3122
3131
  );
3123
3132
  return 0;
@@ -3188,7 +3197,7 @@ function rowCountsFrom(input) {
3188
3197
  return { completed: c, failed: f, total: known };
3189
3198
  }
3190
3199
  function decodeRunStatus(status) {
3191
- return _chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, status);
3200
+ return _chunk2H4EY7KHjs.decodePlayRunPublicStatus.call(void 0, status);
3192
3201
  }
3193
3202
  function deriveRunExecutionState(input) {
3194
3203
  const status = decodeRunStatus(input.status);
@@ -4035,7 +4044,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4035
4044
  ...text.split(/\r?\n/).map((key) => key.trim()).filter(Boolean)
4036
4045
  );
4037
4046
  }
4038
- const response = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.getReceipts(runId, {
4047
+ const response = await new (0, _chunk63S7X326js.DeeplineClient)().runs.getReceipts(runId, {
4039
4048
  keys
4040
4049
  });
4041
4050
  const failed = response.receipts.filter(
@@ -4047,7 +4056,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4047
4056
  JSON.stringify(response, null, 2) + "\n",
4048
4057
  { flag: "wx", mode: 384 }
4049
4058
  );
4050
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
4059
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
4051
4060
  {
4052
4061
  runId,
4053
4062
  out: options.out,
@@ -4057,7 +4066,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4057
4066
  { json: true }
4058
4067
  );
4059
4068
  } else {
4060
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, { ...response }, { json: true });
4069
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, { ...response }, { json: true });
4061
4070
  }
4062
4071
  if (failed)
4063
4072
  process.exitCode = response.receipts.some(
@@ -4096,7 +4105,7 @@ includes nextCommand when another page is available.
4096
4105
  { exitCode: 2 }
4097
4106
  );
4098
4107
  }
4099
- const page = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.children(parentRunId, {
4108
+ const page = await new (0, _chunk63S7X326js.DeeplineClient)().runs.children(parentRunId, {
4100
4109
  launchKey: options.launchKey,
4101
4110
  ...options.cursor !== void 0 ? { cursor: options.cursor } : {},
4102
4111
  limit
@@ -4111,7 +4120,7 @@ includes nextCommand when another page is available.
4111
4120
  "--limit",
4112
4121
  String(limit)
4113
4122
  ].join(" ") : null;
4114
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
4123
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
4115
4124
  {
4116
4125
  parentRunId,
4117
4126
  launchKey: options.launchKey,
@@ -4147,7 +4156,7 @@ async function handleRunsHistory(options) {
4147
4156
  throw new Error("--limit must be a positive integer.");
4148
4157
  }
4149
4158
  }
4150
- const page = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.history({
4159
+ const page = await new (0, _chunk63S7X326js.DeeplineClient)().runs.history({
4151
4160
  cursor: options.cursor,
4152
4161
  orgId: options.org,
4153
4162
  search: options.search,
@@ -4163,7 +4172,7 @@ async function handleRunsHistory(options) {
4163
4172
  );
4164
4173
  }
4165
4174
  if (page.hasMore) lines.push(`Next cursor: ${page.nextCursor}`);
4166
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
4175
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
4167
4176
  { ...page, render: { sections: [{ title: "Run history", lines }] } },
4168
4177
  options.json ? { json: true } : {}
4169
4178
  );
@@ -4215,12 +4224,12 @@ async function runRunsRerunCommand(runId, options) {
4215
4224
  return 1;
4216
4225
  }
4217
4226
  }
4218
- const result = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.rerun(runId, {
4227
+ const result = await new (0, _chunk63S7X326js.DeeplineClient)().runs.rerun(runId, {
4219
4228
  ...idempotencyKey === void 0 ? {} : { idempotencyKey },
4220
4229
  ...inputOverrides === void 0 ? {} : { inputOverrides }
4221
4230
  });
4222
- if (_chunkYD7B53RWjs.shouldEmitJson.call(void 0, options.json)) {
4223
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, result, { json: true });
4231
+ if (_chunkNF4V5DTYjs.shouldEmitJson.call(void 0, options.json)) {
4232
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, result, { json: true });
4224
4233
  } else {
4225
4234
  console.log(
4226
4235
  result.deduplicated === true ? `
@@ -4488,7 +4497,7 @@ function projectRunDatasetCell(value) {
4488
4497
  const logicalValue = parseSerializedDatasetValue(value);
4489
4498
  if (logicalValue === null || logicalValue === void 0) return logicalValue;
4490
4499
  if (typeof logicalValue === "object") {
4491
- return _chunkYD7B53RWjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
4500
+ return _chunkNF4V5DTYjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
4492
4501
  }
4493
4502
  return logicalValue;
4494
4503
  }
@@ -5254,7 +5263,7 @@ function resolveDatasetByName(available, datasetPath) {
5254
5263
  function uniqueDatasetMatch(infos, selector) {
5255
5264
  const matches = distinctCanonicalRowsInfos(infos);
5256
5265
  if (matches.length > 1) {
5257
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5266
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
5258
5267
  `Dataset selector '${selector}' is ambiguous; it matches multiple identities. Choose a unique Dataset ID or path.`,
5259
5268
  void 0,
5260
5269
  "RUN_EXPORT_DATASET_AMBIGUOUS",
@@ -5347,7 +5356,7 @@ function resolveReturnedDataset(output, available) {
5347
5356
  if (legacy && (!datasetId || !legacy.datasetId)) {
5348
5357
  return datasetId ? { ...legacy, datasetId } : legacy;
5349
5358
  }
5350
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
5359
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
5351
5360
  `Returned Dataset '${_nullishCoalesce(_nullishCoalesce(datasetId, () => ( path)), () => ( "unknown"))}' is missing from the run catalog; cannot choose another dataset in its place.`,
5352
5361
  void 0,
5353
5362
  "RUN_EXPORT_DATASET_NOT_FOUND",
@@ -6066,10 +6075,10 @@ function resolveOwnedPlayReferenceName(reference, ownerSlug) {
6066
6075
  // ../plays/deploy/run-deployment.ts
6067
6076
  var RUN_PLAY_METHOD_NAMES = /* @__PURE__ */ new Set(["runPlay", "runPlayAsync"]);
6068
6077
  function isRunPlayReceiver(node) {
6069
- return _chunkSEFMGO3Zjs.isAstNode.call(void 0, node) && node.type === "Identifier" && typeof node.name === "string" && (node.name === "ctx" || node.name.endsWith("Ctx"));
6078
+ return _chunkOQQOXSYAjs.isAstNode.call(void 0, node) && node.type === "Identifier" && typeof node.name === "string" && (node.name === "ctx" || node.name.endsWith("Ctx"));
6070
6079
  }
6071
6080
  function stringLiteralValue(node) {
6072
- if (!_chunkSEFMGO3Zjs.isAstNode.call(void 0, node)) return null;
6081
+ if (!_chunkOQQOXSYAjs.isAstNode.call(void 0, node)) return null;
6073
6082
  if (node.type === "Literal" && typeof node.value === "string") {
6074
6083
  return node.value;
6075
6084
  }
@@ -6080,12 +6089,12 @@ function stringLiteralValue(node) {
6080
6089
  return null;
6081
6090
  }
6082
6091
  async function extractRunPlayStringTargets(sourceCode) {
6083
- const program = _chunkSEFMGO3Zjs.parsePlaySourceForAnalysis.call(void 0, sourceCode);
6092
+ const program = _chunkOQQOXSYAjs.parsePlaySourceForAnalysis.call(void 0, sourceCode);
6084
6093
  if (!program) return await _asyncNullishCoalesce(await extractWithCompiler(sourceCode), async () => ( []));
6085
6094
  const targets = /* @__PURE__ */ new Set();
6086
6095
  const visit = (node) => {
6087
6096
  const callee = node.callee;
6088
- if (node.type === "CallExpression" && _chunkSEFMGO3Zjs.isAstNode.call(void 0, callee) && callee.type === "MemberExpression" && callee.computed !== true && _chunkSEFMGO3Zjs.isAstNode.call(void 0, callee.property) && RUN_PLAY_METHOD_NAMES.has(String(callee.property.name)) && isRunPlayReceiver(callee.object) && Array.isArray(node.arguments)) {
6097
+ if (node.type === "CallExpression" && _chunkOQQOXSYAjs.isAstNode.call(void 0, callee) && callee.type === "MemberExpression" && callee.computed !== true && _chunkOQQOXSYAjs.isAstNode.call(void 0, callee.property) && RUN_PLAY_METHOD_NAMES.has(String(callee.property.name)) && isRunPlayReceiver(callee.object) && Array.isArray(node.arguments)) {
6089
6098
  const playRef = stringLiteralValue(node.arguments[1]);
6090
6099
  const ownedName = playRef === null ? null : resolveOwnedPlayReferenceName(playRef);
6091
6100
  if (ownedName) targets.add(ownedName);
@@ -6093,7 +6102,7 @@ async function extractRunPlayStringTargets(sourceCode) {
6093
6102
  for (const [key, value] of Object.entries(node)) {
6094
6103
  if (key === "loc") continue;
6095
6104
  for (const child of Array.isArray(value) ? value : [value]) {
6096
- if (_chunkSEFMGO3Zjs.isAstNode.call(void 0, child)) visit(child);
6105
+ if (_chunkOQQOXSYAjs.isAstNode.call(void 0, child)) visit(child);
6097
6106
  }
6098
6107
  }
6099
6108
  };
@@ -6959,7 +6968,7 @@ function renderOutcome(outcome) {
6959
6968
  function printResult2(input) {
6960
6969
  const failed = input.status === "failed" || input.status === "cancelled";
6961
6970
  if (failed) process.exitCode = 1;
6962
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
6971
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
6963
6972
  {
6964
6973
  deployment: { ...input.deployment, status: input.status },
6965
6974
  plays: input.outcomes,
@@ -6984,7 +6993,7 @@ async function handlePlaysDeploy(directory, options) {
6984
6993
  const root = await _promises.realpath.call(void 0, _path.resolve.call(void 0, _nullishCoalesce(directory, () => ( ".")))).catch(() => {
6985
6994
  throw new Error(`No such directory: ${_path.resolve.call(void 0, _nullishCoalesce(directory, () => ( ".")))}`);
6986
6995
  });
6987
- const { http, config } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
6996
+ const { http, config } = _chunkNF4V5DTYjs.getAuthedHttpClient.call(void 0, );
6988
6997
  const deliveryId = `local:${_crypto.randomUUID.call(void 0, )}`;
6989
6998
  const startDeployment = () => http.post("/api/v2/deployments", {
6990
6999
  deliveryId,
@@ -7011,7 +7020,7 @@ async function handlePlaysDeploy(directory, options) {
7011
7020
  },
7012
7021
  {
7013
7022
  bundle: bundleDeployPlayFile,
7014
- fetchImpl: _chunkFJCIUF34js.fetchWithDeploymentProtection,
7023
+ fetchImpl: _chunkFVLNYDI4js.fetchWithDeploymentProtection,
7015
7024
  // The plays are already here: "opening" the source is naming it.
7016
7025
  openSource: async () => ({
7017
7026
  open: async () => ({ repoRoot: root })
@@ -7535,14 +7544,14 @@ function parseJsonInput(raw, flag = "--input") {
7535
7544
  try {
7536
7545
  parsed = JSON.parse(source);
7537
7546
  } catch (e9) {
7538
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
7547
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
7539
7548
  `${flag} expects a valid JSON object or @input.json. A bare file path is not JSON.${flag === "--input" ? " Use the field names and run example from plays check <file> or deepline describe <play>. --csv contacts.csv supplies input.csv only when the Play declares that field." : ""}`,
7540
7549
  void 0,
7541
7550
  "INVALID_JSON"
7542
7551
  );
7543
7552
  }
7544
7553
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
7545
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
7554
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
7546
7555
  `${flag} must be a JSON object.`,
7547
7556
  void 0,
7548
7557
  "INVALID_JSON"
@@ -7579,7 +7588,7 @@ function parseInputFlagValue(raw) {
7579
7588
  return raw;
7580
7589
  }
7581
7590
  function parsePlayRunOptions(args, initialInput = null) {
7582
- const selection = _chunkYD7B53RWjs.parseJsonFields.call(void 0, args, "run");
7591
+ const selection = _chunkNF4V5DTYjs.parseJsonFields.call(void 0, args, "run");
7583
7592
  args = selection.args;
7584
7593
  const usage2 = "Usage: deepline plays run <play-name> [--input '{...}'] [--run-id-file <path>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--open] [--full] [--<input> value]\n deepline plays run <play-file.ts> [--input '{...}'] [--run-id-file <path>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--open] [--full] [--<input> value]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--profile <id>] [--run-id-file <path>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--open] [--full] [--<input> value]\n deepline plays run --name <name> [--input '{...}'] [--profile <id>] [--live|--latest|--revision-id <id>] [--run-id-file <path>] [--no-wait] [--tail-timeout-ms 30000] [--force] [--open] [--json] [--full] [--<input> value]\n Runs use the Absurd CJS runtime.\n --header '<name>: <value>' may repeat; each is sent on every request for this run.\n Unknown --<input> value flags, such as --limit 5, are passed into play input.\nRun `deepline plays run --help` for idempotent call caching and ctx.dataset guidance.";
7585
7594
  let filePath = null;
@@ -7591,7 +7600,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7591
7600
  let revisionSelector = null;
7592
7601
  const watch = !args.includes("--no-wait");
7593
7602
  const dryRun = args.includes("--dry-run");
7594
- let jsonOutput = dryRun ? _chunkYD7B53RWjs.argsWantJson.call(void 0, args) : watch ? args.includes("--json") : _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
7603
+ let jsonOutput = dryRun ? _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) : watch ? args.includes("--json") : _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
7595
7604
  const fullJson = args.includes("--full");
7596
7605
  const force = args.includes("--force");
7597
7606
  const forceToolRefresh = args.includes("--force-tool-refresh");
@@ -7654,7 +7663,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7654
7663
  "--log-level requires one of: debug, info, warn, error."
7655
7664
  );
7656
7665
  }
7657
- const parsed = _chunkV76R6HMVjs.parseLogLevel.call(void 0, value);
7666
+ const parsed = _chunk63S7X326js.parseLogLevel.call(void 0, value);
7658
7667
  if (!parsed) {
7659
7668
  throw new Error(
7660
7669
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -7691,7 +7700,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7691
7700
  throw new Error("--profile requires an execution profile id.");
7692
7701
  }
7693
7702
  profile = value.trim();
7694
- _chunkSEFMGO3Zjs.resolveEnabledExecutionProfile.call(void 0, profile);
7703
+ _chunkOQQOXSYAjs.resolveEnabledExecutionProfile.call(void 0, profile);
7695
7704
  index += 1;
7696
7705
  continue;
7697
7706
  }
@@ -7778,12 +7787,12 @@ function parsePlayRunOptions(args, initialInput = null) {
7778
7787
  }
7779
7788
  if (arg === "--debug" && args[index + 1] && !args[index + 1].startsWith("--")) {
7780
7789
  input ??= {};
7781
- _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0, input, "debug", parseInputFlagValue(args[++index]));
7790
+ _chunk2H4EY7KHjs.setDottedInputValue.call(void 0, input, "debug", parseInputFlagValue(args[++index]));
7782
7791
  continue;
7783
7792
  }
7784
7793
  if (arg.startsWith("--debug=")) {
7785
7794
  input ??= {};
7786
- _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0,
7795
+ _chunk2H4EY7KHjs.setDottedInputValue.call(void 0,
7787
7796
  input,
7788
7797
  "debug",
7789
7798
  parseInputFlagValue(arg.slice("--debug=".length))
@@ -7811,7 +7820,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7811
7820
  if (arg.startsWith("--")) {
7812
7821
  const { path, value } = parseInputFieldFlag(arg, args[index + 1]);
7813
7822
  input ??= {};
7814
- _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0, input, path, parseInputFlagValue(value));
7823
+ _chunk2H4EY7KHjs.setDottedInputValue.call(void 0, input, path, parseInputFlagValue(value));
7815
7824
  if (!arg.includes("=")) {
7816
7825
  index += 1;
7817
7826
  }
@@ -7886,7 +7895,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7886
7895
  headers
7887
7896
  };
7888
7897
  }
7889
- function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7898
+ function resolvePlayRunCliOptions(target, options, inputArgs = [], maintenancePolicy) {
7890
7899
  const stringOption = (value, flag) => {
7891
7900
  if (value !== void 0 && !value.trim())
7892
7901
  throw new Error(`${flag} requires a non-empty value.`);
@@ -7900,7 +7909,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7900
7909
  let initialInput = options.input === void 0 ? null : parseJsonInput(options.input);
7901
7910
  if (typeof options.debug === "string") {
7902
7911
  initialInput ??= {};
7903
- _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0,
7912
+ _chunk2H4EY7KHjs.setDottedInputValue.call(void 0,
7904
7913
  initialInput,
7905
7914
  "debug",
7906
7915
  parseInputFlagValue(options.debug)
@@ -7937,7 +7946,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7937
7946
  if (dryRun && resolvedTarget.kind !== "file")
7938
7947
  throw new Error("--dry-run currently requires a local Play file.");
7939
7948
  const profile = _nullishCoalesce(_optionalChain([stringOption, 'call', _237 => _237(options.profile, "--profile"), 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]), () => ( base.profile));
7940
- if (profile !== null) _chunkSEFMGO3Zjs.resolveEnabledExecutionProfile.call(void 0, profile);
7949
+ if (profile !== null) _chunkOQQOXSYAjs.resolveEnabledExecutionProfile.call(void 0, profile);
7941
7950
  const countOption = (value, flag) => {
7942
7951
  if (value === void 0) return void 0;
7943
7952
  if (!/^[1-9]\d*$/.test(value))
@@ -7972,7 +7981,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7972
7981
  const hasExplicitLogLevel = options.logLevel !== void 0 || inputArgs.some(
7973
7982
  (arg) => arg === "--log-level" || arg.startsWith("--log-level=")
7974
7983
  );
7975
- let logLevel = options.logLevel === void 0 ? base.logLevel : _chunkV76R6HMVjs.parseLogLevel.call(void 0, options.logLevel);
7984
+ let logLevel = options.logLevel === void 0 ? base.logLevel : _chunk63S7X326js.parseLogLevel.call(void 0, options.logLevel);
7976
7985
  if (!logLevel)
7977
7986
  throw new Error("--log-level requires one of: debug, info, warn, error.");
7978
7987
  const debugAlias = options.logs || options.debug === true || inputArgs.some(
@@ -7986,18 +7995,19 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7986
7995
  if (debugAlias || debugMapLatency && logLevel === "info")
7987
7996
  logLevel = "debug";
7988
7997
  const fullJson = _nullishCoalesce(options.full, () => ( base.fullJson));
7989
- const jsonFields = options.json === void 0 ? base.jsonFields : _chunkYD7B53RWjs.parseJsonFields.call(void 0,
7990
- [...fullJson ? ["--full"] : [], ..._chunkYD7B53RWjs.jsonFieldArgs.call(void 0, options.json)],
7998
+ const jsonFields = options.json === void 0 ? base.jsonFields : _chunkNF4V5DTYjs.parseJsonFields.call(void 0,
7999
+ [...fullJson ? ["--full"] : [], ..._chunkNF4V5DTYjs.jsonFieldArgs.call(void 0, options.json)],
7991
8000
  "run"
7992
8001
  ).fields;
7993
8002
  const watch = options.wait === false ? false : base.watch;
7994
8003
  const explicitJson = options.json !== void 0 ? options.json !== false : base.jsonOutput;
7995
- const jsonOutput = dryRun || !watch ? explicitJson || _chunkYD7B53RWjs.argsWantJson.call(void 0, []) : explicitJson;
8004
+ const jsonOutput = dryRun || !watch ? explicitJson || _chunkNF4V5DTYjs.argsWantJson.call(void 0, []) : explicitJson;
7996
8005
  const verboseLogs = Boolean(
7997
8006
  debugAlias || logLevel === "debug" || debugMapLatency
7998
8007
  );
7999
8008
  return {
8000
8009
  ...base,
8010
+ ...maintenancePolicy ? { maintenancePolicy } : {},
8001
8011
  target: resolvedTarget,
8002
8012
  dryRun,
8003
8013
  input: base.input,
@@ -8036,10 +8046,83 @@ function playAuthoringGraphPath(parent, filePath) {
8036
8046
  ).replaceAll("\\", "/");
8037
8047
  }
8038
8048
 
8049
+ // src/plays/check-local-play-graph.ts
8050
+ async function checkLocalPlayGraph(input) {
8051
+ const { client, graph } = input;
8052
+ const nodesByPath = new Map(
8053
+ [...graph.nodes.values()].map((node) => [node.filePath, node])
8054
+ );
8055
+ const importedPlaysFor = (node) => {
8056
+ const imported = /* @__PURE__ */ new Set();
8057
+ const collect = (parent) => {
8058
+ for (const dependency of parent.importedPlayDependencies) {
8059
+ if (imported.has(dependency.filePath)) continue;
8060
+ const child = nodesByPath.get(dependency.filePath);
8061
+ if (!child)
8062
+ throw new Error(
8063
+ `Missing bundled Play dependency ${dependency.filePath}.`
8064
+ );
8065
+ imported.add(dependency.filePath);
8066
+ collect(child);
8067
+ }
8068
+ };
8069
+ collect(node);
8070
+ return [...imported].map((filePath) => {
8071
+ const child = nodesByPath.get(filePath);
8072
+ return {
8073
+ playName: child.playName,
8074
+ sourceCode: child.sourceCode,
8075
+ sourcePath: playAuthoringGraphPath(node, child.filePath)
8076
+ };
8077
+ });
8078
+ };
8079
+ const checkNode = (node) => {
8080
+ const name = _nullishCoalesce(node.playName, () => ( (node === graph.root ? input.rootPlayName : null)));
8081
+ if (!name)
8082
+ throw new Error(`Bundled Play ${node.filePath} has no declared name.`);
8083
+ const importedPlays = importedPlaysFor(node);
8084
+ const exportName = node === graph.root ? input.exportName : _nullishCoalesce(node.artifact.exportName, () => ( "default"));
8085
+ return client.checkPlayArtifact({
8086
+ name,
8087
+ sourceCode: node.sourceCode,
8088
+ sourceFiles: node.sourceFiles,
8089
+ description: _nullishCoalesce(node.playDescription, () => ( void 0)),
8090
+ artifact: _nullishCoalesce(_optionalChain([input, 'access', _240 => _240.prepareArtifact, 'optionalCall', _241 => _241(node.artifact)]), () => ( node.artifact)),
8091
+ ...exportName === "default" ? {} : { exportName },
8092
+ ...importedPlays.length ? { importedPlays } : {},
8093
+ ...input.integrationMode ? { integrationMode: input.integrationMode } : {}
8094
+ });
8095
+ };
8096
+ if ([...graph.nodes.values()].some(
8097
+ (node) => (_nullishCoalesce(node.artifact.compatibility.authoringContractEdition, () => ( 1))) >= 10
8098
+ )) {
8099
+ const checked = /* @__PURE__ */ new Set();
8100
+ const checkChildren = async (node) => {
8101
+ if (checked.has(node.filePath)) return null;
8102
+ checked.add(node.filePath);
8103
+ for (const dependency of node.importedPlayDependencies) {
8104
+ const child = nodesByPath.get(dependency.filePath);
8105
+ if (!child)
8106
+ throw new Error(
8107
+ `Missing bundled Play dependency ${dependency.filePath}.`
8108
+ );
8109
+ const failure2 = await checkChildren(child);
8110
+ if (failure2) return failure2;
8111
+ }
8112
+ if (node === graph.root) return null;
8113
+ const result = await checkNode(node);
8114
+ return result.valid ? null : { result, failedChild: node };
8115
+ };
8116
+ const failure = await checkChildren(graph.root);
8117
+ if (failure) return failure;
8118
+ }
8119
+ return { result: await checkNode(graph.root) };
8120
+ }
8121
+
8039
8122
  // src/cli/renderers/local-play-execution.ts
8040
8123
  function renderLocalPlayExecutionPlan(plan, options = {}) {
8041
8124
  if (options.dryRun) {
8042
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, { dryRun: true, ...plan }, { json: options.json });
8125
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, { dryRun: true, ...plan }, { json: options.json });
8043
8126
  return;
8044
8127
  }
8045
8128
  process.stderr.write(`Local Play execution plan: ${JSON.stringify(plan)}
@@ -8131,7 +8214,7 @@ async function preflightRunIdFile(path) {
8131
8214
  `Cannot write --run-id-file destination ${destination}: ${error instanceof Error ? error.message : String(error)}`
8132
8215
  );
8133
8216
  } finally {
8134
- await _optionalChain([handle, 'optionalAccess', _240 => _240.close, 'call', _241 => _241()]);
8217
+ await _optionalChain([handle, 'optionalAccess', _242 => _242.close, 'call', _243 => _243()]);
8135
8218
  await removeRunIdTempFile(tempPath);
8136
8219
  }
8137
8220
  return destination;
@@ -8185,9 +8268,9 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
8185
8268
  } catch (error) {
8186
8269
  if (error.code !== "EEXIST") throw error;
8187
8270
  const raced = await readRunIdFile(destination);
8188
- if (_optionalChain([raced, 'optionalAccess', _242 => _242.runId]) !== runId) {
8271
+ if (_optionalChain([raced, 'optionalAccess', _244 => _244.runId]) !== runId) {
8189
8272
  throw new Error(
8190
- `--run-id-file destination already records run ${_nullishCoalesce(_optionalChain([raced, 'optionalAccess', _243 => _243.runId]), () => ( "<invalid>"))}; refusing to replace it with ${runId}: ${destination}`
8273
+ `--run-id-file destination already records run ${_nullishCoalesce(_optionalChain([raced, 'optionalAccess', _245 => _245.runId]), () => ( "<invalid>"))}; refusing to replace it with ${runId}: ${destination}`
8191
8274
  );
8192
8275
  }
8193
8276
  if (!options.launchConfirmed || raced.launchConfirmed) return;
@@ -8203,7 +8286,7 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
8203
8286
  }
8204
8287
  }
8205
8288
  } finally {
8206
- await _optionalChain([handle, 'optionalAccess', _244 => _244.close, 'call', _245 => _245()]);
8289
+ await _optionalChain([handle, 'optionalAccess', _246 => _246.close, 'call', _247 => _247()]);
8207
8290
  await removeRunIdTempFile(tempPath);
8208
8291
  }
8209
8292
  }
@@ -8211,7 +8294,7 @@ function traceCliSync(phase, fields2, run) {
8211
8294
  const startedAt = Date.now();
8212
8295
  try {
8213
8296
  const result = run();
8214
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
8297
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
8215
8298
  phase,
8216
8299
  ms: Date.now() - startedAt,
8217
8300
  ok: true,
@@ -8219,7 +8302,7 @@ function traceCliSync(phase, fields2, run) {
8219
8302
  });
8220
8303
  return result;
8221
8304
  } catch (error) {
8222
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
8305
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
8223
8306
  phase,
8224
8307
  ms: Date.now() - startedAt,
8225
8308
  ok: false,
@@ -8254,10 +8337,10 @@ function buildBarePrebuiltReferenceError(input) {
8254
8337
  return new Error(buildBarePrebuiltReferenceMessage(input));
8255
8338
  }
8256
8339
  function isPlayNotFoundError(error) {
8257
- return error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND");
8340
+ return error instanceof _chunkPPDBRJRWjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND");
8258
8341
  }
8259
8342
  function isExplicitMissingPlayReferenceError(error) {
8260
- if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError)) {
8343
+ if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError)) {
8261
8344
  return false;
8262
8345
  }
8263
8346
  if (error.statusCode !== 404 && error.code !== "PLAY_NOT_FOUND") {
@@ -8272,10 +8355,10 @@ function playReferenceMatchTokens(value) {
8272
8355
  return normalizePlayReferenceForMatch(value).split("-").filter((token) => token.length > 1 && token !== "to" && token !== "and");
8273
8356
  }
8274
8357
  function playSuggestionReference(play) {
8275
- if (_optionalChain([play, 'access', _246 => _246.reference, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()])) {
8358
+ if (_optionalChain([play, 'access', _248 => _248.reference, 'optionalAccess', _249 => _249.trim, 'call', _250 => _250()])) {
8276
8359
  return play.reference.trim();
8277
8360
  }
8278
- const ownerSlug = _optionalChain([play, 'access', _249 => _249.ownerSlug, 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
8361
+ const ownerSlug = _optionalChain([play, 'access', _251 => _251.ownerSlug, 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
8279
8362
  return ownerSlug ? `${ownerSlug}/${play.name}` : play.name;
8280
8363
  }
8281
8364
  function scorePlayReferenceSuggestion(requested, play) {
@@ -8291,8 +8374,8 @@ function scorePlayReferenceSuggestion(requested, play) {
8291
8374
  const reference = playSuggestionReference(play);
8292
8375
  const referenceNorm = normalizePlayReferenceForMatch(reference);
8293
8376
  const nameNorm = normalizePlayReferenceForMatch(play.name);
8294
- const candidateNamespace = reference.includes("/") ? _optionalChain([reference, 'access', _252 => _252.split, 'call', _253 => _253("/"), 'access', _254 => _254[0], 'optionalAccess', _255 => _255.toLowerCase, 'call', _256 => _256()]) : null;
8295
- const requestedNamespace = _nullishCoalesce(_optionalChain([parsed, 'access', _257 => _257.ownerSlug, 'optionalAccess', _258 => _258.toLowerCase, 'call', _259 => _259()]), () => ( null));
8377
+ const candidateNamespace = reference.includes("/") ? _optionalChain([reference, 'access', _254 => _254.split, 'call', _255 => _255("/"), 'access', _256 => _256[0], 'optionalAccess', _257 => _257.toLowerCase, 'call', _258 => _258()]) : null;
8378
+ const requestedNamespace = _nullishCoalesce(_optionalChain([parsed, 'access', _259 => _259.ownerSlug, 'optionalAccess', _260 => _260.toLowerCase, 'call', _261 => _261()]), () => ( null));
8296
8379
  const aliases = (_nullishCoalesce(play.aliases, () => ( []))).map(normalizePlayReferenceForMatch);
8297
8380
  const searchable = [referenceNorm, nameNorm, ...aliases].filter(Boolean);
8298
8381
  const requestedTokens = playReferenceMatchTokens(requestedName);
@@ -8410,24 +8493,24 @@ async function buildPlayReferenceNotFoundError(input) {
8410
8493
  } catch (e11) {
8411
8494
  suggestions = [];
8412
8495
  }
8413
- const sourceError = input.sourceError instanceof _chunk7P5AA3SNjs.DeeplineError ? input.sourceError : null;
8414
- const code = _optionalChain([sourceError, 'optionalAccess', _260 => _260.code]) && sourceError.code !== "API_ERROR" ? sourceError.code : "PLAY_NOT_FOUND";
8415
- return new (0, _chunk7P5AA3SNjs.DeeplineError)(
8496
+ const sourceError = input.sourceError instanceof _chunkPPDBRJRWjs.DeeplineError ? input.sourceError : null;
8497
+ const code = _optionalChain([sourceError, 'optionalAccess', _262 => _262.code]) && sourceError.code !== "API_ERROR" ? sourceError.code : "PLAY_NOT_FOUND";
8498
+ return new (0, _chunkPPDBRJRWjs.DeeplineError)(
8416
8499
  buildPlayReferenceNotFoundMessage({
8417
8500
  requested: input.target,
8418
8501
  command: input.command,
8419
8502
  suggestions
8420
8503
  }),
8421
- _nullishCoalesce(_optionalChain([sourceError, 'optionalAccess', _261 => _261.statusCode]), () => ( 404)),
8504
+ _nullishCoalesce(_optionalChain([sourceError, 'optionalAccess', _263 => _263.statusCode]), () => ( 404)),
8422
8505
  code,
8423
- _optionalChain([sourceError, 'optionalAccess', _262 => _262.details])
8506
+ _optionalChain([sourceError, 'optionalAccess', _264 => _264.details])
8424
8507
  );
8425
8508
  }
8426
8509
  async function isMissingRunPlayReferenceError(input) {
8427
8510
  if (isExplicitMissingPlayReferenceError(input.error)) {
8428
8511
  return true;
8429
8512
  }
8430
- if (!(input.error instanceof _chunk7P5AA3SNjs.DeeplineError) || input.error.statusCode !== 404 || !/^no artifact-backed revision found for play:/i.test(
8513
+ if (!(input.error instanceof _chunkPPDBRJRWjs.DeeplineError) || input.error.statusCode !== 404 || !/^no artifact-backed revision found for play:/i.test(
8431
8514
  input.error.message.trim()
8432
8515
  )) {
8433
8516
  return false;
@@ -8472,7 +8555,7 @@ function formatPlayReference(play) {
8472
8555
  if (play.reference) {
8473
8556
  return play.reference;
8474
8557
  }
8475
- const ownerSlug = _optionalChain([play, 'access', _263 => _263.ownerSlug, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]) || "org";
8558
+ const ownerSlug = _optionalChain([play, 'access', _265 => _265.ownerSlug, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()]) || "org";
8476
8559
  return `${ownerSlug}/${play.name}`;
8477
8560
  }
8478
8561
  function formatPlayListReference(play) {
@@ -8502,7 +8585,7 @@ function materializeRemotePlaySource(input) {
8502
8585
  return null;
8503
8586
  }
8504
8587
  const entrySource = input.source.files[input.source.entryFile];
8505
- if (!_optionalChain([entrySource, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()])) {
8588
+ if (!_optionalChain([entrySource, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()])) {
8506
8589
  return null;
8507
8590
  }
8508
8591
  const files = Object.entries(input.source.files);
@@ -8586,7 +8669,7 @@ function buildMissingDefinePlayError(filePath) {
8586
8669
  );
8587
8670
  }
8588
8671
  function extractPlayName(code, filePath) {
8589
- const definedPlayName = _chunkSEFMGO3Zjs.extractDefinedPlayName.call(void 0, code);
8672
+ const definedPlayName = _chunkOQQOXSYAjs.extractDefinedPlayName.call(void 0, code);
8590
8673
  if (definedPlayName) {
8591
8674
  return definedPlayName;
8592
8675
  }
@@ -8665,7 +8748,7 @@ function collectLocalFileInputRefs(value, inputPath, key, out) {
8665
8748
  if (!trimmed || isUrlValue(trimmed)) {
8666
8749
  return;
8667
8750
  }
8668
- const keyIsCsvData = key === _chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY;
8751
+ const keyIsCsvData = key === _chunk2H4EY7KHjs.CSV_DATA_INPUT_KEY;
8669
8752
  const endsWithCsv = /\.csv$/i.test(trimmed);
8670
8753
  const looksLikeFile = /\.[a-z0-9]{1,8}$/i.test(trimmed);
8671
8754
  if (keyIsCsvData) {
@@ -8696,14 +8779,14 @@ function collectLocalFileInputRefs(value, inputPath, key, out) {
8696
8779
  }
8697
8780
  }
8698
8781
  function preflightLocalFileInputs(runtimeInput) {
8699
- if (_chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY in runtimeInput) {
8700
- const csvValue = runtimeInput[_chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY];
8782
+ if (_chunk2H4EY7KHjs.CSV_DATA_INPUT_KEY in runtimeInput) {
8783
+ const csvValue = runtimeInput[_chunk2H4EY7KHjs.CSV_DATA_INPUT_KEY];
8701
8784
  if (typeof csvValue === "string" && csvValue.trim().length === 0) {
8702
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8703
- `Input ${_chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY} is an empty string. Provide a path to a CSV file (or a CSV URL). No run was created.`,
8785
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
8786
+ `Input ${_chunk2H4EY7KHjs.CSV_DATA_INPUT_KEY} is an empty string. Provide a path to a CSV file (or a CSV URL). No run was created.`,
8704
8787
  void 0,
8705
8788
  "PLAY_INPUT_FILE_PREFLIGHT",
8706
- { inputPath: _chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY, reason: "csv_empty_string" }
8789
+ { inputPath: _chunk2H4EY7KHjs.CSV_DATA_INPUT_KEY, reason: "csv_empty_string" }
8707
8790
  );
8708
8791
  }
8709
8792
  }
@@ -8714,7 +8797,7 @@ function preflightLocalFileInputs(runtimeInput) {
8714
8797
  for (const ref of refs) {
8715
8798
  const absolutePath = _path.resolve.call(void 0, ref.value);
8716
8799
  if (!_fs.existsSync.call(void 0, absolutePath)) {
8717
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8800
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
8718
8801
  `Input ${ref.inputPath} references a local file that does not exist: ${ref.value} (resolved to ${absolutePath}). No run was created.`,
8719
8802
  void 0,
8720
8803
  "PLAY_INPUT_FILE_PREFLIGHT",
@@ -8725,7 +8808,7 @@ function preflightLocalFileInputs(runtimeInput) {
8725
8808
  try {
8726
8809
  stat2 = _fs.statSync.call(void 0, absolutePath);
8727
8810
  } catch (error) {
8728
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8811
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
8729
8812
  `Input ${ref.inputPath} references a local file that is not readable: ${ref.value} (${error instanceof Error ? error.message : String(error)}). No run was created.`,
8730
8813
  void 0,
8731
8814
  "PLAY_INPUT_FILE_PREFLIGHT",
@@ -8733,7 +8816,7 @@ function preflightLocalFileInputs(runtimeInput) {
8733
8816
  );
8734
8817
  }
8735
8818
  if (!stat2.isFile()) {
8736
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8819
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
8737
8820
  `Input ${ref.inputPath} references ${ref.value}, which is not a file. No run was created.`,
8738
8821
  void 0,
8739
8822
  "PLAY_INPUT_FILE_PREFLIGHT",
@@ -8751,14 +8834,14 @@ function preflightCsvDataInput(ref, absolutePath) {
8751
8834
  try {
8752
8835
  content = _fs.readFileSync.call(void 0, absolutePath, "utf-8");
8753
8836
  } catch (error) {
8754
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8837
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
8755
8838
  `Input ${ref.inputPath} CSV ${ref.value} is not readable: ${error instanceof Error ? error.message : String(error)}. No run was created.`,
8756
8839
  void 0,
8757
8840
  "PLAY_INPUT_FILE_PREFLIGHT",
8758
8841
  { inputPath: ref.inputPath, path: ref.value }
8759
8842
  );
8760
8843
  }
8761
- _chunkGSK6NHVMjs.parseCsvDataInput.call(void 0, { inputPath: ref.inputPath, value: ref.value }, content);
8844
+ _chunkWU4U6VSBjs.parseCsvDataInput.call(void 0, { inputPath: ref.inputPath, value: ref.value }, content);
8762
8845
  }
8763
8846
  function namedRunNeedsPlayDefinition(input) {
8764
8847
  return input.revisionSelector === "latest" || inputContainsLocalFilePath(input.runtimeInput);
@@ -8770,7 +8853,7 @@ var NODE_STAGED_FILE_CODEC = {
8770
8853
  )
8771
8854
  };
8772
8855
  async function stageFileInputArgs(input) {
8773
- return _chunkUHNDVD3Pjs.stageFileInputs.call(void 0, {
8856
+ return _chunk2H4EY7KHjs.stageFileInputs.call(void 0, {
8774
8857
  stage: (files) => input.client.stagePlayFiles(files),
8775
8858
  runtimeInput: input.runtimeInput,
8776
8859
  bindings: input.bindings,
@@ -8794,7 +8877,7 @@ function stageFile(logicalPath, absolutePath) {
8794
8877
  logicalPath,
8795
8878
  contentBase64: buffer.toString("base64"),
8796
8879
  contentHash: _crypto.createHash.call(void 0, "sha256").update(buffer).digest("hex"),
8797
- contentType: _chunkUHNDVD3Pjs.stagedFileContentType.call(void 0, absolutePath),
8880
+ contentType: _chunk2H4EY7KHjs.stagedFileContentType.call(void 0, absolutePath),
8798
8881
  bytes: buffer.byteLength
8799
8882
  };
8800
8883
  }
@@ -8815,12 +8898,12 @@ function unresolvedPackagedFilesMessage(node) {
8815
8898
  const details = node.unresolvedFileReferences.map((unresolved) => `${unresolved.sourceFragment}: ${unresolved.message}`).join("; ");
8816
8899
  return `Failed to package local ctx.csv(...) files in ${node.filePath}: ${details}`;
8817
8900
  }
8818
- async function collectBundledPlayGraph(entryFile, profile = null, entryExportName = _chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT, options = {}) {
8901
+ async function collectBundledPlayGraph(entryFile, profile = null, entryExportName = _chunkOQQOXSYAjs.PLAY_DEFAULT_EXPORT, options = {}) {
8819
8902
  const playBundler = await loadPlayBundler();
8820
8903
  const nodes = /* @__PURE__ */ new Map();
8821
8904
  const diagnostics = [];
8822
8905
  const visited = /* @__PURE__ */ new Set();
8823
- const artifactKind = _chunkSEFMGO3Zjs.resolveEnabledExecutionProfile.call(void 0, profile).artifactKind;
8906
+ const artifactKind = _chunkOQQOXSYAjs.resolveEnabledExecutionProfile.call(void 0, profile).artifactKind;
8824
8907
  const rootPath = normalizePlayPath(entryFile);
8825
8908
  const visit = async (filePath) => {
8826
8909
  const absolutePath = normalizePlayPath(filePath);
@@ -8829,7 +8912,7 @@ async function collectBundledPlayGraph(entryFile, profile = null, entryExportNam
8829
8912
  const bundleResult = await playBundler.bundlePlayFile(absolutePath, {
8830
8913
  target: artifactKind,
8831
8914
  ...options.cache === false ? { cache: false } : {},
8832
- ...absolutePath === rootPath && entryExportName !== _chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT ? { exportName: entryExportName } : {}
8915
+ ...absolutePath === rootPath && entryExportName !== _chunkOQQOXSYAjs.PLAY_DEFAULT_EXPORT ? { exportName: entryExportName } : {}
8833
8916
  });
8834
8917
  if (bundleResult.success === false) {
8835
8918
  diagnostics.push(
@@ -8880,7 +8963,7 @@ async function compileBundledPlayGraphManifests(client, graph) {
8880
8963
  const child = graph.nodes.get(
8881
8964
  normalizePlayPath(dependency.filePath)
8882
8965
  );
8883
- if (!_optionalChain([child, 'optionalAccess', _268 => _268.compilerManifest])) {
8966
+ if (!_optionalChain([child, 'optionalAccess', _270 => _270.compilerManifest])) {
8884
8967
  throw new Error(
8885
8968
  `Missing compiler manifest for imported dependency ${dependency.filePath}.`
8886
8969
  );
@@ -8916,7 +8999,7 @@ function missingPlayDescriptionMessage(node) {
8916
8999
  function collectPlayGraphAuthoringErrors(graph) {
8917
9000
  return [...graph.nodes.values()].flatMap((node) => [
8918
9001
  ...node.unresolvedFileReferences.length > 0 ? [unresolvedPackagedFilesMessage(node)] : [],
8919
- ..._optionalChain([node, 'access', _269 => _269.playDescription, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]) ? [] : [missingPlayDescriptionMessage(node)]
9002
+ ..._optionalChain([node, 'access', _271 => _271.playDescription, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()]) ? [] : [missingPlayDescriptionMessage(node)]
8920
9003
  ]);
8921
9004
  }
8922
9005
  function assertPlayGraphAuthoring(graph) {
@@ -8969,7 +9052,7 @@ function formatTimestamp(value) {
8969
9052
  return date.toISOString();
8970
9053
  }
8971
9054
  function isoTimestamp(value) {
8972
- return _nullishCoalesce(_optionalChain([timestampDate, 'call', _272 => _272(value), 'optionalAccess', _273 => _273.toISOString, 'call', _274 => _274()]), () => ( null));
9055
+ return _nullishCoalesce(_optionalChain([timestampDate, 'call', _274 => _274(value), 'optionalAccess', _275 => _275.toISOString, 'call', _276 => _276()]), () => ( null));
8973
9056
  }
8974
9057
  function formatRunLine(run) {
8975
9058
  const credits = typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount2(run.billingTotalCredits)} credits` : "\u2014";
@@ -8977,7 +9060,7 @@ function formatRunLine(run) {
8977
9060
  }
8978
9061
  function playStatusErrorText(status) {
8979
9062
  const chunks = [];
8980
- const progressError = _optionalChain([status, 'access', _275 => _275.progress, 'optionalAccess', _276 => _276.error]);
9063
+ const progressError = _optionalChain([status, 'access', _277 => _277.progress, 'optionalAccess', _278 => _278.error]);
8981
9064
  if (typeof progressError === "string" && progressError.trim()) {
8982
9065
  chunks.push(progressError.trim());
8983
9066
  }
@@ -9003,22 +9086,13 @@ function playStatusErrorText(status) {
9003
9086
  function isRetryablePendingStartFailure(status) {
9004
9087
  if (status.status !== "failed") return false;
9005
9088
  if (status.runId && status.runId !== "pending") return false;
9006
- return _chunkV76R6HMVjs.isTransientPlayRunReadError.call(void 0, new Error(playStatusErrorText(status)));
9089
+ return _chunk63S7X326js.isTransientPlayRunReadError.call(void 0, new Error(playStatusErrorText(status)));
9007
9090
  }
9008
- function pendingStartFailureStatus(input) {
9009
- const message = input.error instanceof Error ? input.error.message : String(input.error);
9010
- return {
9011
- runId: "pending",
9012
- name: input.playName,
9013
- playName: input.playName,
9014
- dashboardUrl: input.dashboardUrl,
9015
- status: "failed",
9016
- progress: {
9017
- status: "failed",
9018
- logs: [],
9019
- error: message
9020
- }
9021
- };
9091
+ function isAmbiguousPlayStartOutcomeError(error) {
9092
+ if (error instanceof _chunkPPDBRJRWjs.DeeplineError && typeof error.statusCode === "number") {
9093
+ return error.statusCode >= 500;
9094
+ }
9095
+ return true;
9022
9096
  }
9023
9097
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set([
9024
9098
  "completed",
@@ -9026,17 +9100,48 @@ var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set([
9026
9100
  "cancelled"
9027
9101
  ]);
9028
9102
  var PLAY_START_TRANSIENT_RETRY_DELAYS_MS = [500, 1500];
9103
+ var PLAY_START_STREAM_TERMINAL_WINDOW_MS = 2e3;
9029
9104
  var PLAY_PROGRESS_HEARTBEAT_INTERVAL_MS = 15e3;
9030
9105
  var PLAY_STATUS_HEARTBEAT_INTERVAL_MS = 15e3;
9106
+ var RetryablePlayStartAttemptError = class extends Error {
9107
+ constructor(originalError) {
9108
+ super(
9109
+ originalError instanceof Error ? originalError.message : String(originalError)
9110
+ );
9111
+ this.originalError = originalError;
9112
+ this.name = "RetryablePlayStartAttemptError";
9113
+ }
9114
+ };
9115
+ var PlayStartOutcomeUnknownError = (_class = class extends _chunkPPDBRJRWjs.DeeplineError {
9116
+ __init() {this.retryable = false}
9117
+ constructor(playName, cause) {
9118
+ const causeMessage = cause instanceof Error ? cause.message : String(cause);
9119
+ const recoveryCommand = `deepline runs list --play ${_chunkAID3OYVJjs.shellQuote.call(void 0, playName)} --json`;
9120
+ super(
9121
+ `Play ${playName} may have started, but the CLI did not receive confirmation. Do not run it again until you inspect the original workspace with: ${recoveryCommand}`,
9122
+ cause instanceof _chunkPPDBRJRWjs.DeeplineError ? cause.statusCode : void 0,
9123
+ "PLAY_START_OUTCOME_UNKNOWN",
9124
+ {
9125
+ outcome: "unknown",
9126
+ playName,
9127
+ recoveryCommand,
9128
+ recoveryScope: "same_authenticated_host_and_workspace",
9129
+ causeMessage
9130
+ }
9131
+ );_class.prototype.__init.call(this);;
9132
+ this.name = "PlayStartOutcomeUnknownError";
9133
+ Object.defineProperty(this, "cause", { value: cause, configurable: true });
9134
+ }
9135
+ }, _class);
9031
9136
  function watchSurfaceReaches(state, provenance, level) {
9032
9137
  const minimumLevel = _nullishCoalesce(state.logLevel, () => ( (state.verbose ? "debug" : "info")));
9033
- if (!_chunkV76R6HMVjs.logLevelReaches.call(void 0, level, minimumLevel)) {
9138
+ if (!_chunk63S7X326js.logLevelReaches.call(void 0, level, minimumLevel)) {
9034
9139
  return false;
9035
9140
  }
9036
- if (_chunkV76R6HMVjs.logProvenanceReaches.call(void 0, provenance, "watch")) {
9141
+ if (_chunk63S7X326js.logProvenanceReaches.call(void 0, provenance, "watch")) {
9037
9142
  return true;
9038
9143
  }
9039
- return state.verbose === true && _chunkV76R6HMVjs.logProvenanceReaches.call(void 0, provenance, "debug");
9144
+ return state.verbose === true && _chunk63S7X326js.logProvenanceReaches.call(void 0, provenance, "debug");
9040
9145
  }
9041
9146
  function getEventPayload(event) {
9042
9147
  return event.payload && typeof event.payload === "object" ? event.payload : {};
@@ -9059,7 +9164,7 @@ function getRunIdFromLiveEvent(event) {
9059
9164
  if (typeof directRunId === "string" && directRunId.trim()) {
9060
9165
  return directRunId;
9061
9166
  }
9062
- const packageRunId = _optionalChain([getRunRecordFromPackage, 'call', _277 => _277(payload), 'optionalAccess', _278 => _278.id]);
9167
+ const packageRunId = _optionalChain([getRunRecordFromPackage, 'call', _279 => _279(payload), 'optionalAccess', _280 => _280.id]);
9063
9168
  return typeof packageRunId === "string" && packageRunId.trim() ? packageRunId : null;
9064
9169
  }
9065
9170
  function eventConfirmsPlayRunLaunch(event) {
@@ -9080,19 +9185,19 @@ function getStatusFromLiveEvent(event) {
9080
9185
  return null;
9081
9186
  }
9082
9187
  const payload = getEventPayload(event);
9083
- return _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([getRunRecordFromPackage, 'call', _279 => _279(payload), 'optionalAccess', _280 => _280.status]))));
9188
+ return _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([getRunRecordFromPackage, 'call', _281 => _281(payload), 'optionalAccess', _282 => _282.status]))));
9084
9189
  }
9085
9190
  function readLiveRunField(event, field) {
9086
9191
  const payload = getEventPayload(event);
9087
9192
  if (field === "waitKind") {
9088
- const wait = _nullishCoalesce(payload.wait, () => ( _optionalChain([getRunRecordFromPackage, 'call', _281 => _281(payload), 'optionalAccess', _282 => _282.wait])));
9193
+ const wait = _nullishCoalesce(payload.wait, () => ( _optionalChain([getRunRecordFromPackage, 'call', _283 => _283(payload), 'optionalAccess', _284 => _284.wait])));
9089
9194
  if (wait && typeof wait === "object" && !Array.isArray(wait)) {
9090
9195
  const kind = wait.kind;
9091
9196
  if (typeof kind === "string" && kind.trim()) return kind.trim();
9092
9197
  }
9093
9198
  }
9094
9199
  const run = getRunRecordFromPackage(payload);
9095
- const records = [payload, payload.progress, run, _optionalChain([run, 'optionalAccess', _283 => _283.progress])].filter(
9200
+ const records = [payload, payload.progress, run, _optionalChain([run, 'optionalAccess', _285 => _285.progress])].filter(
9096
9201
  (value) => Boolean(value && typeof value === "object" && !Array.isArray(value))
9097
9202
  );
9098
9203
  for (const record3 of records) {
@@ -9107,7 +9212,7 @@ function getLiveRunStringField(event, field) {
9107
9212
  function getLiveRunActivity(event) {
9108
9213
  const payload = getEventPayload(event);
9109
9214
  const run = getRunRecordFromPackage(payload);
9110
- const candidates = [payload.activity, _optionalChain([run, 'optionalAccess', _284 => _284.activity])];
9215
+ const candidates = [payload.activity, _optionalChain([run, 'optionalAccess', _286 => _286.activity])];
9111
9216
  for (const candidate of candidates) {
9112
9217
  if (candidate && typeof candidate === "object" && !Array.isArray(candidate) && typeof candidate.summary === "string" && candidate.observation && typeof candidate.observation === "object") {
9113
9218
  return candidate;
@@ -9122,9 +9227,9 @@ function getRunLifecycleHint(input) {
9122
9227
  return null;
9123
9228
  }
9124
9229
  const activity = getLiveRunActivity(input.event);
9125
- const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _285 => _285.observation, 'access', _286 => _286.state, 'access', _287 => _287.kind]) === "active" && activity.observation.target.kind !== "runner";
9230
+ const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _287 => _287.observation, 'access', _288 => _288.state, 'access', _289 => _289.kind]) === "active" && activity.observation.target.kind !== "runner";
9126
9231
  const inspect = `'deepline runs get ${runId} --full'`;
9127
- const sleepState = _optionalChain([activity, 'optionalAccess', _288 => _288.observation, 'access', _289 => _289.state, 'access', _290 => _290.kind]) === "scheduled" && activity.observation.state.reason === "sleep" ? activity.observation.state : null;
9232
+ const sleepState = _optionalChain([activity, 'optionalAccess', _290 => _290.observation, 'access', _291 => _291.state, 'access', _292 => _292.kind]) === "scheduled" && activity.observation.state.reason === "sleep" ? activity.observation.state : null;
9128
9233
  if (status === "waiting" && (sleepState !== null || getLiveRunStringField(input.event, "waitKind") === "sleep")) {
9129
9234
  const recordedWake = readLiveRunField(input.event, "waitUntil");
9130
9235
  const projectedWake = sleepState && sleepState.resumeAt > activity.observation.observedAt ? sleepState.resumeAt : null;
@@ -9135,7 +9240,7 @@ function getRunLifecycleHint(input) {
9135
9240
  };
9136
9241
  }
9137
9242
  const typedEventWaitKind = getLiveRunStringField(input.event, "waitKind");
9138
- const activityEventWait = _optionalChain([activity, 'optionalAccess', _291 => _291.observation, 'access', _292 => _292.state, 'access', _293 => _293.kind]) === "waiting" && activity.observation.state.reason.kind === "external_event";
9243
+ const activityEventWait = _optionalChain([activity, 'optionalAccess', _293 => _293.observation, 'access', _294 => _294.state, 'access', _295 => _295.kind]) === "waiting" && activity.observation.state.reason.kind === "external_event";
9139
9244
  if (status === "waiting" && (typedEventWaitKind === "integration_event" || typedEventWaitKind === "integration_event_batch" || activityEventWait)) {
9140
9245
  return {
9141
9246
  signature: [
@@ -9208,12 +9313,12 @@ function getFinalStatusFromLiveEvent(event) {
9208
9313
  }
9209
9314
  const payload = getEventPayload(event);
9210
9315
  const packageRun = getRunRecordFromPackage(payload);
9211
- const status = _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([packageRun, 'optionalAccess', _294 => _294.status]))));
9316
+ const status = _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([packageRun, 'optionalAccess', _296 => _296.status]))));
9212
9317
  if (status !== "completed" && status !== "failed" && status !== "cancelled") {
9213
9318
  return null;
9214
9319
  }
9215
- const runId = typeof payload.runId === "string" ? payload.runId : typeof _optionalChain([packageRun, 'optionalAccess', _295 => _295.id]) === "string" ? packageRun.id : "";
9216
- const error = typeof payload.error === "string" ? payload.error : typeof _optionalChain([packageRun, 'optionalAccess', _296 => _296.error]) === "string" ? packageRun.error : void 0;
9320
+ const runId = typeof payload.runId === "string" ? payload.runId : typeof _optionalChain([packageRun, 'optionalAccess', _297 => _297.id]) === "string" ? packageRun.id : "";
9321
+ const error = typeof payload.error === "string" ? payload.error : typeof _optionalChain([packageRun, 'optionalAccess', _298 => _298.error]) === "string" ? packageRun.error : void 0;
9217
9322
  return {
9218
9323
  ...payload,
9219
9324
  runId,
@@ -9448,7 +9553,7 @@ function getProgressLinesFromLiveEvent(event) {
9448
9553
  (count2) => typeof count2 === "number" && Number.isSafeInteger(count2) && count2 >= 0
9449
9554
  )) {
9450
9555
  lines.push(
9451
- `progress calls: ${formatInteger(callCounts[0])} logical, ${formatInteger(callCounts[1])} provider requests, ${formatInteger(callCounts[2])} provider 429s${_optionalChain([calls, 'optionalAccess', _297 => _297.confirmed]) === true ? "" : " (observed)"}`
9556
+ `progress calls: ${formatInteger(callCounts[0])} logical, ${formatInteger(callCounts[1])} provider requests, ${formatInteger(callCounts[2])} provider 429s${_optionalChain([calls, 'optionalAccess', _299 => _299.confirmed]) === true ? "" : " (observed)"}`
9452
9557
  );
9453
9558
  }
9454
9559
  const rowOutcomes = readRowOutcomeSummary({
@@ -9499,7 +9604,7 @@ function getRunningHeartbeatLine(input) {
9499
9604
  return null;
9500
9605
  }
9501
9606
  const activity = getLiveRunActivity(input.event);
9502
- const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _298 => _298.observation, 'access', _299 => _299.state, 'access', _300 => _300.kind]) === "active" && activity.observation.target.kind !== "runner";
9607
+ const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _300 => _300.observation, 'access', _301 => _301.state, 'access', _302 => _302.kind]) === "active" && activity.observation.target.kind !== "runner";
9503
9608
  if (activity && activity.classified !== false && !activityConflictsWithDurableWait) {
9504
9609
  return `activity ${input.playName}: ${activity.summary}`;
9505
9610
  }
@@ -9532,13 +9637,13 @@ function printPlayStatusHeartbeat(input) {
9532
9637
  input.progress.writeLine(line);
9533
9638
  }
9534
9639
  function resolveRunPlayName(status, runId) {
9535
- const packaged = _optionalChain([status, 'access', _301 => _301.package, 'optionalAccess', _302 => _302.run, 'optionalAccess', _303 => _303.playName]);
9640
+ const packaged = _optionalChain([status, 'access', _303 => _303.package, 'optionalAccess', _304 => _304.run, 'optionalAccess', _305 => _305.playName]);
9536
9641
  if (typeof packaged === "string" && packaged.trim()) return packaged.trim();
9537
- return _nullishCoalesce(_nullishCoalesce(extractRunPlayName(status), () => ( _optionalChain([/^play\/(.+)\/(?:run|webhook)\//, 'access', _304 => _304.exec, 'call', _305 => _305(runId), 'optionalAccess', _306 => _306[1]]))), () => ( null));
9642
+ return _nullishCoalesce(_nullishCoalesce(extractRunPlayName(status), () => ( _optionalChain([/^play\/(.+)\/(?:run|webhook)\//, 'access', _306 => _306.exec, 'call', _307 => _307(runId), 'optionalAccess', _308 => _308[1]]))), () => ( null));
9538
9643
  }
9539
9644
  function openPlayDashboard(dashboardUrl, open2) {
9540
9645
  if (open2 && dashboardUrl) {
9541
- _chunkYD7B53RWjs.openInBrowser.call(void 0, dashboardUrl);
9646
+ _chunkNF4V5DTYjs.openInBrowser.call(void 0, dashboardUrl);
9542
9647
  }
9543
9648
  }
9544
9649
  function printPlayLogLines(input) {
@@ -9555,7 +9660,7 @@ function assertPlayWaitNotTimedOut(input) {
9555
9660
  const hasRealRunId = input.workflowId.length > 0 && input.workflowId !== "pending";
9556
9661
  const phaseSuffix = input.lastPhase && input.lastPhase.trim() ? ` (last observed phase: ${input.lastPhase.trim()})` : "";
9557
9662
  const tailHint = hasRealRunId ? ` The CLI stopped waiting; it did not cancel the run. Check its current state with 'deepline runs get ${input.workflowId}', or reattach with 'deepline runs watch ${input.workflowId}'. Do not start another run just to retrieve results.` : ` No run id was received, so acceptance is unknown. Check recent runs with 'deepline runs list --play <play-name>' before submitting again.`;
9558
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
9663
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
9559
9664
  `Timed out waiting for play ${hasRealRunId ? input.workflowId : "<no run id>"} after ${Math.ceil(input.waitTimeoutMs / 1e3)}s${phaseSuffix}.${tailHint}`,
9560
9665
  void 0,
9561
9666
  "PLAY_WAIT_TIMEOUT",
@@ -9569,7 +9674,7 @@ function assertPlayWaitNotTimedOut(input) {
9569
9674
  }
9570
9675
  var RUN_WATCH_RETRY_INTERVAL_MS = 2e3;
9571
9676
  function isAdmittedRunVisibilityDelay(error) {
9572
- return error instanceof _chunk7P5AA3SNjs.DeeplineError && error.statusCode === 404 && error.message.trim() === "Workflow run not found.";
9677
+ return error instanceof _chunkPPDBRJRWjs.DeeplineError && error.statusCode === 404 && error.message.trim() === "Workflow run not found.";
9573
9678
  }
9574
9679
  async function waitForPlayCompletionByWatch(input) {
9575
9680
  let lastPhase = null;
@@ -9590,25 +9695,37 @@ async function waitForPlayCompletionByWatch(input) {
9590
9695
  const confirmAdmission = async () => {
9591
9696
  if (admissionConfirmed) return;
9592
9697
  admissionConfirmed = true;
9593
- await _optionalChain([input, 'access', _307 => _307.onRunAdmitted, 'optionalCall', _308 => _308(input.workflowId)]);
9698
+ await _optionalChain([input, 'access', _309 => _309.onRunAdmitted, 'optionalCall', _310 => _310(input.workflowId)]);
9594
9699
  };
9595
9700
  const withDashboardUrl = (status) => input.dashboardUrl ? { ...status, dashboardUrl: input.dashboardUrl } : status;
9701
+ const finishTerminalStatus = async (status) => {
9702
+ if (status.runId === input.workflowId && statusProvesPlayRunExecution(status.status)) {
9703
+ await confirmAdmission();
9704
+ }
9705
+ if (!TERMINAL_PLAY_STATUSES.has(status.status)) return null;
9706
+ const resolved = input.fullJson === void 0 ? status : await resolvePlayRunOutputStatus({
9707
+ client: input.client,
9708
+ status,
9709
+ fullJson: input.fullJson,
9710
+ jsonOutput: input.jsonOutput,
9711
+ fromDurableStatus: true
9712
+ });
9713
+ return withDashboardUrl(resolved);
9714
+ };
9596
9715
  const fetchTerminalStatus = async () => {
9597
9716
  let refreshed;
9598
9717
  try {
9599
9718
  refreshed = await input.client.getPlayStatus(input.workflowId, {
9600
- billing: false
9719
+ billing: false,
9720
+ ...input.fullJson === void 0 ? {} : { full: input.fullJson }
9601
9721
  });
9602
9722
  } catch (error) {
9603
- if (_chunkV76R6HMVjs.isTransientPlayRunReadError.call(void 0, error) || isAdmittedRunVisibilityDelay(error)) {
9723
+ if (_chunk63S7X326js.isTransientPlayRunReadError.call(void 0, error) || isAdmittedRunVisibilityDelay(error)) {
9604
9724
  return null;
9605
9725
  }
9606
9726
  throw error;
9607
9727
  }
9608
- if (refreshed.runId === input.workflowId && statusProvesPlayRunExecution(refreshed.status)) {
9609
- await confirmAdmission();
9610
- }
9611
- return TERMINAL_PLAY_STATUSES.has(refreshed.status) ? withDashboardUrl(refreshed) : null;
9728
+ return finishTerminalStatus(refreshed);
9612
9729
  };
9613
9730
  const handleLiveEvent = async (event) => {
9614
9731
  assertPlayWaitNotTimedOut({ ...input, lastPhase });
@@ -9664,7 +9781,7 @@ async function waitForPlayCompletionByWatch(input) {
9664
9781
  }
9665
9782
  const finalStatus = getFinalStatusFromLiveEvent(event);
9666
9783
  if (event.type === "play.run.final_status" && finalStatus) {
9667
- return withDashboardUrl(finalStatus);
9784
+ return input.fullJson === void 0 ? withDashboardUrl(finalStatus) : fetchTerminalStatus();
9668
9785
  }
9669
9786
  const status = getStatusFromLiveEvent(event);
9670
9787
  if (status && TERMINAL_PLAY_STATUSES.has(status)) {
@@ -9679,7 +9796,37 @@ async function waitForPlayCompletionByWatch(input) {
9679
9796
  let terminalFromWatch = null;
9680
9797
  for await (const event of input.client.watchRunEvents(
9681
9798
  input.workflowId,
9682
- { signal: controller.signal }
9799
+ {
9800
+ signal: controller.signal,
9801
+ deferLogs: !input.emitLogs,
9802
+ omitTerminalLogs: !input.emitLogs,
9803
+ ..._chunkOBB4QXHAjs.isCliTraceEnabled.call(void 0, ) ? {
9804
+ onPoll: (observation) => {
9805
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9806
+ phase: "play_watch_poll",
9807
+ workflowId: input.workflowId,
9808
+ ms: observation.durationMs,
9809
+ poll: observation.poll,
9810
+ httpStatus: observation.status,
9811
+ serverTiming: observation.serverTiming
9812
+ });
9813
+ }
9814
+ } : {},
9815
+ terminalStatus: {
9816
+ full: input.fullJson,
9817
+ billing: false,
9818
+ onStatus: async (status) => {
9819
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9820
+ phase: "play_watch_terminal_status",
9821
+ workflowId: input.workflowId,
9822
+ full: input.fullJson === true
9823
+ });
9824
+ terminalStatusRead = Promise.resolve(
9825
+ await finishTerminalStatus(status)
9826
+ );
9827
+ }
9828
+ }
9829
+ }
9683
9830
  )) {
9684
9831
  const terminal3 = await handleLiveEvent(event);
9685
9832
  if (terminal3) terminalFromWatch = terminal3;
@@ -9706,7 +9853,7 @@ async function waitForPlayCompletionByWatch(input) {
9706
9853
  const terminal = await fetchTerminalStatus();
9707
9854
  if (terminal) return terminal;
9708
9855
  assertPlayWaitNotTimedOut({ ...input, lastPhase });
9709
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
9856
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
9710
9857
  `Run watch for ${input.workflowId} ended before a terminal status.`,
9711
9858
  void 0,
9712
9859
  "PLAY_WATCH_ENDED"
@@ -9716,18 +9863,183 @@ async function waitForPlayCompletionByWatch(input) {
9716
9863
  controller.abort();
9717
9864
  }
9718
9865
  }
9866
+ async function startAndWaitForPlayCompletion(input) {
9867
+ const startedAt = Date.now();
9868
+ const controller = new AbortController();
9869
+ let timedOut = false;
9870
+ const timeout = input.waitTimeoutMs === null ? null : setTimeout(
9871
+ () => {
9872
+ timedOut = true;
9873
+ controller.abort();
9874
+ },
9875
+ Math.max(1, input.waitTimeoutMs)
9876
+ );
9877
+ let started;
9878
+ let inlineCompatibility = input.cliAdmission === true;
9879
+ const request = input.request;
9880
+ try {
9881
+ try {
9882
+ started = await input.client.startPlayRun(request, {
9883
+ signal: controller.signal,
9884
+ onSubmission: input.onSubmission,
9885
+ ...input.cliAdmission ? { cliAdmission: true } : {}
9886
+ });
9887
+ } catch (error) {
9888
+ if (!(error instanceof _chunk2H4EY7KHjs.CliPlayAdmissionUnsupportedError)) throw error;
9889
+ await _chunkVK2LZ5IPjs.checkPlayRunCompatibility.call(void 0,
9890
+ input.client.baseUrl,
9891
+ input.maintenancePolicy
9892
+ );
9893
+ inlineCompatibility = false;
9894
+ controller.signal.throwIfAborted();
9895
+ started = await input.client.startPlayRun(request, {
9896
+ signal: controller.signal,
9897
+ onSubmission: input.onSubmission
9898
+ });
9899
+ }
9900
+ } catch (error) {
9901
+ if (timedOut) {
9902
+ assertPlayWaitNotTimedOut({
9903
+ workflowId: "",
9904
+ startedAt,
9905
+ waitTimeoutMs: input.waitTimeoutMs
9906
+ });
9907
+ }
9908
+ throw error;
9909
+ } finally {
9910
+ if (timeout) clearTimeout(timeout);
9911
+ }
9912
+ const workflowId = started.workflowId;
9913
+ if (!workflowId || workflowId === "pending") {
9914
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
9915
+ "Play admission returned no run id. Check recent runs before submitting again.",
9916
+ void 0,
9917
+ "PLAY_START_MISSING_RUN_ID"
9918
+ );
9919
+ }
9920
+ await _optionalChain([input, 'access', _311 => _311.onRunStarted, 'optionalCall', _312 => _312(workflowId)]);
9921
+ await _optionalChain([input, 'access', _313 => _313.onRunAdmitted, 'optionalCall', _314 => _314(workflowId)]);
9922
+ const dashboardUrl = _nullishCoalesce(started.dashboardUrl, () => ( _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, input.client.baseUrl, input.playName)));
9923
+ if (!input.jsonOutput) {
9924
+ writeStartedPlayRun({
9925
+ runId: workflowId,
9926
+ playName: input.playName,
9927
+ dashboardUrl,
9928
+ inputFieldCount: Object.keys(_nullishCoalesce(input.request.input, () => ( {}))).length,
9929
+ jsonOutput: false,
9930
+ progress: input.progress
9931
+ });
9932
+ }
9933
+ openPlayDashboard(dashboardUrl, _nullishCoalesce(input.open, () => ( false)));
9934
+ input.progress.phase("running");
9935
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9936
+ phase: "cli.play_start_admitted",
9937
+ ms: Date.now() - startedAt,
9938
+ ok: true,
9939
+ playName: input.playName,
9940
+ workflowId,
9941
+ inlineCompatibility
9942
+ });
9943
+ const initialTerminal = readRecord(started.finalStatus);
9944
+ const initialPackage = _nullishCoalesce(readRecord(_optionalChain([initialTerminal, 'optionalAccess', _315 => _315.package])), () => ( initialTerminal));
9945
+ const initialRun = readRecord(_optionalChain([initialPackage, 'optionalAccess', _316 => _316.run]));
9946
+ if (initialTerminal && _optionalChain([initialRun, 'optionalAccess', _317 => _317.id]) === workflowId && initialRun.status === "completed" && (initialTerminal.runId === void 0 || initialTerminal.runId === workflowId) && (initialTerminal.status === void 0 || initialTerminal.status === "completed") && input.fullJson === true && started.finalStatusView === "full") {
9947
+ assertPlayWaitNotTimedOut({
9948
+ workflowId,
9949
+ startedAt,
9950
+ waitTimeoutMs: input.waitTimeoutMs
9951
+ });
9952
+ const initialStatus = _chunk63S7X326js.normalizePlayStatus.call(void 0, initialTerminal);
9953
+ const status2 = await resolvePlayRunOutputStatus({
9954
+ client: input.client,
9955
+ status: initialStatus,
9956
+ fullJson: true,
9957
+ jsonOutput: input.jsonOutput,
9958
+ fromDurableStatus: true
9959
+ });
9960
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9961
+ phase: "play_watch_terminal_status",
9962
+ workflowId,
9963
+ full: true,
9964
+ source: status2 === initialStatus ? "start_response" : "durable_repair"
9965
+ });
9966
+ const completedStatus = { ...status2, dashboardUrl };
9967
+ return input.request.revisionId ? { ...completedStatus, revisionId: input.request.revisionId } : completedStatus;
9968
+ }
9969
+ const status = await waitForPlayCompletionByWatch({
9970
+ ...input,
9971
+ workflowId,
9972
+ dashboardUrl,
9973
+ startedAt,
9974
+ onRunAdmitted: void 0,
9975
+ state: {
9976
+ emittedRunnerStarted: false,
9977
+ verbose: input.verboseLogs === true,
9978
+ logLevel: _nullishCoalesce(input.logLevel, () => ( "info")),
9979
+ lastProgressSignature: null,
9980
+ lastProgressHeartbeatAt: 0,
9981
+ lastStatusHeartbeatAt: 0
9982
+ }
9983
+ });
9984
+ return input.request.revisionId ? { ...status, revisionId: input.request.revisionId } : status;
9985
+ }
9719
9986
  async function startAndWaitForPlayCompletionByStream(input) {
9720
9987
  const prepared = await input.client.preparePlayRunAdmission(input.request, {
9988
+ cliAdmission: input.cliAdmission,
9721
9989
  onSubmission: input.onSubmission
9722
9990
  });
9723
9991
  const pinnedInput = {
9724
9992
  ...input,
9725
9993
  request: prepared.body,
9726
- startStream: prepared.startStream
9994
+ startStream: prepared.startStream,
9995
+ supportsCallerIntent: prepared.supportsCallerIntent
9727
9996
  };
9728
9997
  const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
9729
9998
  for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
9730
- const status = await startAndWaitForPlayCompletionByStreamOnce(pinnedInput);
9999
+ let status;
10000
+ try {
10001
+ status = await startAndWaitForPlayCompletionByStreamOnce(pinnedInput);
10002
+ } catch (error) {
10003
+ if (error instanceof _chunk2H4EY7KHjs.CliPlayAdmissionUnsupportedError && input.cliAdmission) {
10004
+ await _chunkVK2LZ5IPjs.checkPlayRunCompatibility.call(void 0,
10005
+ input.client.baseUrl,
10006
+ input.maintenancePolicy
10007
+ );
10008
+ return startAndWaitForPlayCompletion({
10009
+ ...input,
10010
+ cliAdmission: false,
10011
+ streamTerminalWindowMs: void 0
10012
+ });
10013
+ }
10014
+ if (!(error instanceof RetryablePlayStartAttemptError)) throw error;
10015
+ const retryDelayMs2 = retryDelays[attempt];
10016
+ if (retryDelayMs2 === void 0) {
10017
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
10018
+ `Play ${input.playName} did not start after retrying transient start failures.`,
10019
+ void 0,
10020
+ "PLAY_START_RETRY_EXHAUSTED",
10021
+ {
10022
+ causeMessage: error.originalError instanceof Error ? error.originalError.message : String(error.originalError)
10023
+ }
10024
+ );
10025
+ }
10026
+ if (!input.jsonOutput) {
10027
+ input.progress.writeLine(
10028
+ `[play watch] start response was ambiguous; retrying the same caller intent (${error.message})`
10029
+ );
10030
+ }
10031
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10032
+ phase: "cli.play_start_stream_retry",
10033
+ ms: 0,
10034
+ ok: true,
10035
+ playName: input.playName,
10036
+ attempt: attempt + 1,
10037
+ reason: error.message,
10038
+ recovery: "same_caller_intent"
10039
+ });
10040
+ await sleep(retryDelayMs2);
10041
+ continue;
10042
+ }
9731
10043
  const retryDelayMs = retryDelays[attempt];
9732
10044
  if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
9733
10045
  return status;
@@ -9737,7 +10049,7 @@ async function startAndWaitForPlayCompletionByStream(input) {
9737
10049
  `[play watch] start failed before run id with a transient error; retrying (${playStatusErrorText(status)})`
9738
10050
  );
9739
10051
  }
9740
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10052
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9741
10053
  phase: "cli.play_start_stream_retry",
9742
10054
  ms: 0,
9743
10055
  ok: true,
@@ -9747,7 +10059,7 @@ async function startAndWaitForPlayCompletionByStream(input) {
9747
10059
  });
9748
10060
  await sleep(retryDelayMs);
9749
10061
  }
9750
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
10062
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
9751
10063
  `Play ${input.playName} did not start after retrying transient start failures.`,
9752
10064
  void 0,
9753
10065
  "PLAY_START_RETRY_EXHAUSTED"
@@ -9771,14 +10083,30 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9771
10083
  let timedOut = false;
9772
10084
  let emittedDashboardUrl = false;
9773
10085
  let lastKnownWorkflowId = "";
9774
- let launchedRevisionId = _optionalChain([input, 'access', _309 => _309.request, 'access', _310 => _310.revisionId, 'optionalAccess', _311 => _311.trim, 'call', _312 => _312()]) || null;
10086
+ let launchedRevisionId = _optionalChain([input, 'access', _318 => _318.request, 'access', _319 => _319.revisionId, 'optionalAccess', _320 => _320.trim, 'call', _321 => _321()]) || null;
9775
10087
  let eventCount = 0;
9776
10088
  let firstRunIdMs = null;
9777
10089
  let launchConfirmed = false;
10090
+ let terminalWindowExpired = false;
10091
+ let terminalWindowTimer = null;
9778
10092
  const confirmAdmission = async (runId) => {
9779
10093
  if (launchConfirmed || !runId || runId === "pending") return;
9780
10094
  launchConfirmed = true;
9781
- await _optionalChain([input, 'access', _313 => _313.onRunAdmitted, 'optionalCall', _314 => _314(runId)]);
10095
+ await _optionalChain([input, 'access', _322 => _322.onRunAdmitted, 'optionalCall', _323 => _323(runId)]);
10096
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10097
+ phase: "cli.play_start_admitted",
10098
+ ms: Date.now() - startedAt,
10099
+ ok: true,
10100
+ playName: input.playName,
10101
+ workflowId: runId,
10102
+ inlineCompatibility: input.cliAdmission === true
10103
+ });
10104
+ if ((_nullishCoalesce(input.streamTerminalWindowMs, () => ( 0))) > 0) {
10105
+ terminalWindowTimer = setTimeout(() => {
10106
+ terminalWindowExpired = true;
10107
+ controller.abort();
10108
+ }, input.streamTerminalWindowMs);
10109
+ }
9782
10110
  };
9783
10111
  let lastPhase = null;
9784
10112
  const timeout = input.waitTimeoutMs === null ? null : setTimeout(
@@ -9795,10 +10123,11 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9795
10123
  let refreshed;
9796
10124
  try {
9797
10125
  refreshed = await input.client.getPlayStatus(lastKnownWorkflowId, {
9798
- billing: false
10126
+ billing: false,
10127
+ full: input.fullJson
9799
10128
  });
9800
10129
  } catch (error) {
9801
- if (_chunkV76R6HMVjs.isTransientPlayRunReadError.call(void 0, error)) {
10130
+ if (_chunk63S7X326js.isTransientPlayRunReadError.call(void 0, error)) {
9802
10131
  return null;
9803
10132
  }
9804
10133
  throw error;
@@ -9830,7 +10159,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9830
10159
  lastKnownWorkflowId = eventRunId;
9831
10160
  firstRunIdMs ??= Date.now() - startedAt;
9832
10161
  if (runStartedNow) {
9833
- await _optionalChain([input, 'access', _315 => _315.onRunStarted, 'optionalCall', _316 => _316(eventRunId)]);
10162
+ await _optionalChain([input, 'access', _324 => _324.onRunStarted, 'optionalCall', _325 => _325(eventRunId)]);
9834
10163
  }
9835
10164
  }
9836
10165
  if (!launchConfirmed && eventConfirmsPlayRunLaunch(event) && eventRunId === lastKnownWorkflowId) {
@@ -9918,13 +10247,20 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9918
10247
  ...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
9919
10248
  };
9920
10249
  }
9921
- const canonicalTerminal = input.request.profile === "absurd" ? await fetchKnownTerminalStatus() : {
9922
- ...finalStatus,
9923
- dashboardUrl,
9924
- ...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
9925
- };
10250
+ let fromDurableStatus = false;
10251
+ let canonicalTerminal;
10252
+ if (input.request.profile === "absurd") {
10253
+ canonicalTerminal = await fetchKnownTerminalStatus();
10254
+ fromDurableStatus = canonicalTerminal !== null;
10255
+ } else {
10256
+ canonicalTerminal = {
10257
+ ...finalStatus,
10258
+ dashboardUrl,
10259
+ ...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
10260
+ };
10261
+ }
9926
10262
  if (!canonicalTerminal) {
9927
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10263
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9928
10264
  phase: "cli.play_start_stream_stale_terminal_ignored",
9929
10265
  ms: Date.now() - startedAt,
9930
10266
  ok: true,
@@ -9937,27 +10273,42 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9937
10273
  });
9938
10274
  continue;
9939
10275
  }
9940
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10276
+ const outputTerminal = input.fullJson === true ? await resolvePlayRunOutputStatus({
10277
+ client: input.client,
10278
+ status: canonicalTerminal,
10279
+ fullJson: true,
10280
+ jsonOutput: input.jsonOutput,
10281
+ fromDurableStatus
10282
+ }) : canonicalTerminal;
10283
+ if (input.fullJson === true) {
10284
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10285
+ phase: "play_watch_terminal_status",
10286
+ workflowId: outputTerminal.runId || lastKnownWorkflowId || void 0,
10287
+ full: true,
10288
+ source: outputTerminal === canonicalTerminal ? fromDurableStatus ? "start_stream_durable" : "start_stream" : "durable_repair"
10289
+ });
10290
+ }
10291
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9941
10292
  phase: "cli.play_start_stream_terminal",
9942
10293
  ms: Date.now() - startedAt,
9943
10294
  ok: true,
9944
10295
  playName: input.playName,
9945
- workflowId: canonicalTerminal.runId || lastKnownWorkflowId || null,
10296
+ workflowId: outputTerminal.runId || lastKnownWorkflowId || null,
9946
10297
  eventCount,
9947
10298
  firstRunIdMs,
9948
10299
  lastPhase
9949
10300
  });
9950
- if (statusProvesPlayRunExecution(canonicalTerminal.status)) {
10301
+ if (statusProvesPlayRunExecution(outputTerminal.status)) {
9951
10302
  await confirmAdmission(lastKnownWorkflowId);
9952
10303
  }
9953
- return canonicalTerminal;
10304
+ return outputTerminal;
9954
10305
  }
9955
- if (lastKnownWorkflowId && launchConfirmed) {
10306
+ if (lastKnownWorkflowId && launchConfirmed && (!input.streamTerminalWindowMs || terminalWindowExpired)) {
9956
10307
  if (timeout) {
9957
10308
  clearTimeout(timeout);
9958
10309
  }
9959
10310
  controller.abort();
9960
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10311
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9961
10312
  phase: "cli.play_start_stream_handoff_to_tail",
9962
10313
  ms: Date.now() - startedAt,
9963
10314
  ok: true,
@@ -9965,7 +10316,8 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9965
10316
  workflowId: lastKnownWorkflowId,
9966
10317
  eventCount,
9967
10318
  firstRunIdMs,
9968
- lastPhase
10319
+ lastPhase,
10320
+ handoffReason: terminalWindowExpired ? "terminal_window_elapsed" : "launch_confirmed"
9969
10321
  });
9970
10322
  return waitForPlayCompletionByWatch({
9971
10323
  client: input.client,
@@ -9978,6 +10330,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9978
10330
  startedAt,
9979
10331
  state,
9980
10332
  progress: input.progress,
10333
+ fullJson: input.fullJson,
9981
10334
  onRunAdmitted: confirmAdmission
9982
10335
  });
9983
10336
  }
@@ -9986,7 +10339,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9986
10339
  if (timedOut) {
9987
10340
  const terminal = await fetchKnownTerminalStatus();
9988
10341
  if (terminal) {
9989
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10342
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
9990
10343
  phase: "cli.play_start_stream_timeout_status_reconcile",
9991
10344
  ms: Date.now() - startedAt,
9992
10345
  ok: true,
@@ -10006,18 +10359,18 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10006
10359
  lastPhase
10007
10360
  });
10008
10361
  }
10009
- if (lastKnownWorkflowId && _chunkV76R6HMVjs.isTransientPlayRunReadError.call(void 0, error)) {
10362
+ if (lastKnownWorkflowId && (terminalWindowExpired || _chunk63S7X326js.isTransientPlayRunReadError.call(void 0, error))) {
10010
10363
  if (timeout) {
10011
10364
  clearTimeout(timeout);
10012
10365
  }
10013
- const reason = error instanceof Error ? error.message : String(error);
10366
+ const reason = terminalWindowExpired ? "terminal observation window elapsed" : error instanceof Error ? error.message : String(error);
10014
10367
  if (!input.jsonOutput) {
10015
10368
  process.stderr.write(
10016
10369
  `[play watch] start stream failed after run ${lastKnownWorkflowId}; reconnecting to canonical run stream (${reason})
10017
10370
  `
10018
10371
  );
10019
10372
  }
10020
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10373
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10021
10374
  phase: "cli.play_start_stream_reconnect",
10022
10375
  ms: Date.now() - startedAt,
10023
10376
  ok: true,
@@ -10039,11 +10392,12 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10039
10392
  startedAt,
10040
10393
  state,
10041
10394
  progress: input.progress,
10395
+ fullJson: input.fullJson,
10042
10396
  onRunAdmitted: confirmAdmission
10043
10397
  });
10044
10398
  }
10045
- if (!lastKnownWorkflowId && _chunkV76R6HMVjs.isTransientPlayRunReadError.call(void 0, error)) {
10046
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10399
+ if (!lastKnownWorkflowId && isAmbiguousPlayStartOutcomeError(error)) {
10400
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10047
10401
  phase: "cli.play_start_stream_transient_failure",
10048
10402
  ms: Date.now() - startedAt,
10049
10403
  ok: false,
@@ -10053,17 +10407,17 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10053
10407
  lastPhase,
10054
10408
  reason: error instanceof Error ? error.message : String(error)
10055
10409
  });
10056
- return pendingStartFailureStatus({
10057
- playName: input.playName,
10058
- dashboardUrl,
10059
- error
10060
- });
10410
+ if (input.supportsCallerIntent) {
10411
+ throw new RetryablePlayStartAttemptError(error);
10412
+ }
10413
+ throw new PlayStartOutcomeUnknownError(input.playName, error);
10061
10414
  }
10062
10415
  throw error;
10063
10416
  } finally {
10064
10417
  if (timeout) {
10065
10418
  clearTimeout(timeout);
10066
10419
  }
10420
+ if (terminalWindowTimer) clearTimeout(terminalWindowTimer);
10067
10421
  }
10068
10422
  if (lastKnownWorkflowId) {
10069
10423
  if (!input.jsonOutput) {
@@ -10071,7 +10425,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10071
10425
  `[play watch] start stream ended after run ${lastKnownWorkflowId}; reconnecting to canonical run stream`
10072
10426
  );
10073
10427
  }
10074
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
10428
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
10075
10429
  phase: "cli.play_start_stream_reconnect",
10076
10430
  ms: Date.now() - startedAt,
10077
10431
  ok: true,
@@ -10080,7 +10434,8 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10080
10434
  eventCount,
10081
10435
  firstRunIdMs,
10082
10436
  lastPhase,
10083
- reason: "stream ended before terminal event"
10437
+ reason: "stream ended before terminal event",
10438
+ ...terminalWindowExpired ? { handoffReason: "terminal_window_elapsed" } : {}
10084
10439
  });
10085
10440
  return waitForPlayCompletionByWatch({
10086
10441
  client: input.client,
@@ -10093,13 +10448,14 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10093
10448
  startedAt,
10094
10449
  state,
10095
10450
  progress: input.progress,
10451
+ fullJson: input.fullJson,
10096
10452
  onRunAdmitted: confirmAdmission
10097
10453
  });
10098
10454
  }
10099
10455
  const phaseSuffix = lastPhase && lastPhase.trim() ? ` (last observed phase: ${lastPhase.trim()})` : "";
10100
10456
  const idSuffix = lastKnownWorkflowId ? ` runId=${lastKnownWorkflowId}` : "";
10101
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
10102
- `Play start request ended before terminal status was observed${idSuffix}${phaseSuffix}. If a run id was printed, inspect it with 'deepline runs get <run-id> --full' or continue watching with 'deepline runs watch <run-id>'.`,
10457
+ const endedBeforeConfirmation = new (0, _chunkPPDBRJRWjs.DeeplineError)(
10458
+ `Play start request ended before terminal status was observed${idSuffix}${phaseSuffix}.`,
10103
10459
  void 0,
10104
10460
  "PLAY_START_STREAM_ENDED",
10105
10461
  {
@@ -10107,6 +10463,14 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
10107
10463
  ...lastPhase ? { phase: lastPhase } : {}
10108
10464
  }
10109
10465
  );
10466
+ if (lastKnownWorkflowId) throw endedBeforeConfirmation;
10467
+ if (input.supportsCallerIntent) {
10468
+ throw new RetryablePlayStartAttemptError(endedBeforeConfirmation);
10469
+ }
10470
+ throw new PlayStartOutcomeUnknownError(
10471
+ input.playName,
10472
+ endedBeforeConfirmation
10473
+ );
10110
10474
  }
10111
10475
  function formatInteger(value) {
10112
10476
  return typeof value === "number" && Number.isFinite(value) ? value.toLocaleString("en-US") : String(_nullishCoalesce(value, () => ( "-")));
@@ -10141,29 +10505,29 @@ var BULKY_RETURN_KEYS = /* @__PURE__ */ new Set([
10141
10505
  "logs"
10142
10506
  ]);
10143
10507
  function formatPlayLogLine(rawLine, state) {
10144
- const classified = _chunkV76R6HMVjs.classifyLogLine.call(void 0, rawLine);
10508
+ const classified = _chunk63S7X326js.classifyLogLine.call(void 0, rawLine);
10145
10509
  const line = classified.line;
10146
10510
  const timestampMatch = line.match(/^\[([^\]]+)\]\s*(.*)$/);
10147
- const parsedTimestamp = _optionalChain([timestampMatch, 'optionalAccess', _317 => _317[1]]) ? new Date(timestampMatch[1]) : null;
10511
+ const parsedTimestamp = _optionalChain([timestampMatch, 'optionalAccess', _326 => _326[1]]) ? new Date(timestampMatch[1]) : null;
10148
10512
  const timestamp = parsedTimestamp && !Number.isNaN(parsedTimestamp.getTime()) ? parsedTimestamp.toLocaleTimeString("en-US", {
10149
10513
  hour12: false,
10150
10514
  hour: "2-digit",
10151
10515
  minute: "2-digit",
10152
10516
  second: "2-digit"
10153
10517
  }) : null;
10154
- const message = _nullishCoalesce(_optionalChain([timestampMatch, 'optionalAccess', _318 => _318[2]]), () => ( line));
10518
+ const message = _nullishCoalesce(_optionalChain([timestampMatch, 'optionalAccess', _327 => _327[2]]), () => ( line));
10155
10519
  const prefix = timestamp ? `${timestamp} ` : "";
10156
10520
  if (!state.verbose && isProviderRowWaitLogLine(line)) return null;
10157
10521
  const providerWait = formatProviderCapacityWaitLogLine(line);
10158
10522
  if (providerWait && !state.verbose) {
10159
- return _chunkV76R6HMVjs.logLevelReaches.call(void 0, "warn", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${providerWait}` : null;
10523
+ return _chunk63S7X326js.logLevelReaches.call(void 0, "warn", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${providerWait}` : null;
10160
10524
  }
10161
10525
  const mapProgress = formatMapProgressDiagnosticLogLine(line);
10162
10526
  if (mapProgress && !state.verbose) {
10163
- return _chunkV76R6HMVjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${mapProgress}` : null;
10527
+ return _chunk63S7X326js.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${mapProgress}` : null;
10164
10528
  }
10165
10529
  if (/\[worker\] picked up run\b/.test(message)) {
10166
- if (!_chunkV76R6HMVjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10530
+ if (!_chunk63S7X326js.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10167
10531
  return null;
10168
10532
  }
10169
10533
  if (state.emittedRunnerStarted) {
@@ -10176,7 +10540,7 @@ function formatPlayLogLine(rawLine, state) {
10176
10540
  /^Starting map over (\d+) items with (\d+) fields \(key: ([^;]+); (\d+) already satisfied; (\d+) pending\)$/
10177
10541
  );
10178
10542
  if (mapStart) {
10179
- if (!_chunkV76R6HMVjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10543
+ if (!_chunk63S7X326js.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10180
10544
  return null;
10181
10545
  }
10182
10546
  const [, rows, fields2, namespace, cached, pending] = mapStart;
@@ -10186,7 +10550,7 @@ function formatPlayLogLine(rawLine, state) {
10186
10550
  /^Map completed: (\d+) results \((\d+) executed, (\d+) already satisfied\)$/
10187
10551
  );
10188
10552
  if (mapDone) {
10189
- if (!_chunkV76R6HMVjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10553
+ if (!_chunk63S7X326js.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10190
10554
  return null;
10191
10555
  }
10192
10556
  const [, results, executed, cached] = mapDone;
@@ -10368,20 +10732,20 @@ function collectDatasetHandleLines(value, path = "result") {
10368
10732
  function buildRunWarnings(status, rowsInfo) {
10369
10733
  const rowOutcomes = readRowOutcomeSummary(status);
10370
10734
  const result = readRecord(status.result);
10371
- const metadata = readRecord(_optionalChain([result, 'optionalAccess', _319 => _319._metadata]));
10372
- const outputWarnings = Array.isArray(_optionalChain([metadata, 'optionalAccess', _320 => _320.outputWarnings])) ? metadata.outputWarnings.map((warning) => readRecord(warning)).filter((warning) => {
10735
+ const metadata = readRecord(_optionalChain([result, 'optionalAccess', _328 => _328._metadata]));
10736
+ const outputWarnings = Array.isArray(_optionalChain([metadata, 'optionalAccess', _329 => _329.outputWarnings])) ? metadata.outputWarnings.map((warning) => readRecord(warning)).filter((warning) => {
10373
10737
  if (!warning) return false;
10374
10738
  return !(rowsInfo && !rowsInfo.complete && warning.reason === "array_preview_limit" && warning.originalItems === rowsInfo.totalRows && warning.retainedItems === rowsInfo.rows.length);
10375
- }).map((warning) => _optionalChain([warning, 'optionalAccess', _321 => _321.message])).filter(
10739
+ }).map((warning) => _optionalChain([warning, 'optionalAccess', _330 => _330.message])).filter(
10376
10740
  (message) => typeof message === "string" && message.trim().length > 0
10377
10741
  ).slice(0, 16) : [];
10378
- const rowOutcomeWarnings = _optionalChain([rowOutcomes, 'optionalAccess', _322 => _322.hasRowFailures]) ? [
10742
+ const rowOutcomeWarnings = _optionalChain([rowOutcomes, 'optionalAccess', _331 => _331.hasRowFailures]) ? [
10379
10743
  `${status.status === "completed" ? "Run completed" : "Run ended"} with ${formatInteger(rowOutcomes.failedRows)} failed row(s); inspect the persisted failed rows before treating the output as complete.`
10380
10744
  ] : [];
10381
- const supersededRowNotices = (_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _323 => _323.supersededRows]), () => ( 0))) > 0 ? [
10745
+ const supersededRowNotices = (_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _332 => _332.supersededRows]), () => ( 0))) > 0 ? [
10382
10746
  `Latest-write-wins: ${formatSupersededRowsNotice(_nullishCoalesce(rowOutcomes.supersededRows, () => ( 0)))}; the newer write still owns that Runtime Sheet row.`
10383
10747
  ] : [];
10384
- if (status.status === "completed" && _optionalChain([rowsInfo, 'optionalAccess', _324 => _324.totalRows]) === 0) {
10748
+ if (status.status === "completed" && _optionalChain([rowsInfo, 'optionalAccess', _333 => _333.totalRows]) === 0) {
10385
10749
  return [
10386
10750
  ...rowOutcomeWarnings,
10387
10751
  ...supersededRowNotices,
@@ -10400,7 +10764,7 @@ function buildRunWarnings(status, rowsInfo) {
10400
10764
  return [...rowOutcomeWarnings, ...supersededRowNotices, ...outputWarnings];
10401
10765
  }
10402
10766
  function buildRunNextCommands(status) {
10403
- const runId = _optionalChain([status, 'access', _325 => _325.runId, 'optionalAccess', _326 => _326.trim, 'call', _327 => _327()]);
10767
+ const runId = _optionalChain([status, 'access', _334 => _334.runId, 'optionalAccess', _335 => _335.trim, 'call', _336 => _336()]);
10404
10768
  if (!runId) {
10405
10769
  const playName = extractRunPlayName(status);
10406
10770
  return playName ? {
@@ -10551,14 +10915,14 @@ function extractToolIdFromErrorText(text) {
10551
10915
  return null;
10552
10916
  }
10553
10917
  const lowerToolMatch = /\btool\s+([A-Za-z0-9_.:-]+)\s+\d{3}\b/.exec(text);
10554
- if (_optionalChain([lowerToolMatch, 'optionalAccess', _328 => _328[1]])) {
10918
+ if (_optionalChain([lowerToolMatch, 'optionalAccess', _337 => _337[1]])) {
10555
10919
  return lowerToolMatch[1];
10556
10920
  }
10557
10921
  const upperToolMatch = /\bTool\s+([A-Za-z0-9_.:-]+)\s+failed\b/.exec(text);
10558
- return _nullishCoalesce(_optionalChain([upperToolMatch, 'optionalAccess', _329 => _329[1]]), () => ( null));
10922
+ return _nullishCoalesce(_optionalChain([upperToolMatch, 'optionalAccess', _338 => _338[1]]), () => ( null));
10559
10923
  }
10560
10924
  function isInsufficientCreditsBilling(billing) {
10561
- return _optionalChain([billing, 'optionalAccess', _330 => _330.kind]) === "insufficient_credits";
10925
+ return _optionalChain([billing, 'optionalAccess', _339 => _339.kind]) === "insufficient_credits";
10562
10926
  }
10563
10927
  function extractBillingForStatus(status, error) {
10564
10928
  const errorBilling = getObjectField(status, "errorBilling");
@@ -10600,8 +10964,8 @@ function formatInsufficientCreditsMessage(input) {
10600
10964
  function buildInsufficientCreditsSummaryLines(input) {
10601
10965
  const progress = input.status.progress;
10602
10966
  const rowsInfo = extractCanonicalRowsInfo(input.status);
10603
- const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "completed"), () => ( getNumericField(progress, "completedRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _331 => _331.rows, 'access', _332 => _332.length]))), () => ( null));
10604
- const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "total"), () => ( getNumericField(progress, "totalRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _333 => _333.totalRows]))), () => ( null));
10967
+ const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "completed"), () => ( getNumericField(progress, "completedRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _340 => _340.rows, 'access', _341 => _341.length]))), () => ( null));
10968
+ const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "total"), () => ( getNumericField(progress, "totalRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _342 => _342.totalRows]))), () => ( null));
10605
10969
  const lines = [
10606
10970
  " status: stopped_insufficient_credits",
10607
10971
  completed === null ? " completed rows: unknown" : ` completed rows: ${formatInteger(completed)}${total !== null ? ` of ${formatInteger(total)}` : ""}`,
@@ -10620,7 +10984,7 @@ function buildInsufficientCreditsSummaryLines(input) {
10620
10984
  lines.push(" ask user: ask whether they want to add Deepline credits");
10621
10985
  lines.push(` top up after approval: ${recovery.topUp}`);
10622
10986
  lines.push(` checkout fallback: ${recovery.checkout}`);
10623
- const runId = _optionalChain([input, 'access', _334 => _334.status, 'access', _335 => _335.runId, 'optionalAccess', _336 => _336.trim, 'call', _337 => _337()]);
10987
+ const runId = _optionalChain([input, 'access', _343 => _343.status, 'access', _344 => _344.runId, 'optionalAccess', _345 => _345.trim, 'call', _346 => _346()]);
10624
10988
  if (runId) {
10625
10989
  lines.push(` inspect: deepline runs get ${runId}`);
10626
10990
  lines.push(
@@ -10702,10 +11066,10 @@ function normalizeRunStatusForEnvelope(status) {
10702
11066
  function normalizeProgressForEnvelope(status, rowsInfo) {
10703
11067
  const progress = status.progress;
10704
11068
  const rowOutcomes = readRowOutcomeSummary(status);
10705
- const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _338 => _338.totalRows]), () => ( getNumericField(progress, "totalRows"))), () => ( getNumericField(progress, "total"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _339 => _339.totalRows]))), () => ( null));
10706
- const failed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _340 => _340.failedRows]), () => ( getNumericField(progress, "failed"))), () => ( getNumericField(progress, "failedRows"))), () => ( null));
10707
- const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _341 => _341.completedRows]), () => ( getNumericField(progress, "completed"))), () => ( getNumericField(progress, "completedRows"))), () => ( (status.status === "completed" ? total : null)));
10708
- const supersededRows = _nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _342 => _342.supersededRows]), () => ( getNumericField(progress, "supersededRows")));
11069
+ const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _347 => _347.totalRows]), () => ( getNumericField(progress, "totalRows"))), () => ( getNumericField(progress, "total"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _348 => _348.totalRows]))), () => ( null));
11070
+ const failed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _349 => _349.failedRows]), () => ( getNumericField(progress, "failed"))), () => ( getNumericField(progress, "failedRows"))), () => ( null));
11071
+ const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _350 => _350.completedRows]), () => ( getNumericField(progress, "completed"))), () => ( getNumericField(progress, "completedRows"))), () => ( (status.status === "completed" ? total : null)));
11072
+ const supersededRows = _nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _351 => _351.supersededRows]), () => ( getNumericField(progress, "supersededRows")));
10709
11073
  const supersededOffset = _nullishCoalesce(supersededRows, () => ( 0));
10710
11074
  const progressPending = getNumericField(progress, "pending");
10711
11075
  const pending = _nullishCoalesce((progressPending !== null ? Math.max(0, progressPending - supersededOffset) : null), () => ( (typeof total === "number" && typeof completed === "number" && typeof failed === "number" ? Math.max(0, total - completed - failed - supersededOffset) : null)));
@@ -10775,7 +11139,7 @@ function normalizeErrorsForEnvelope(status, error) {
10775
11139
  ];
10776
11140
  }
10777
11141
  function normalizeLogsForEnvelope(status) {
10778
- const logs = Array.isArray(_optionalChain([status, 'access', _343 => _343.progress, 'optionalAccess', _344 => _344.logs])) ? status.progress.logs : [];
11142
+ const logs = Array.isArray(_optionalChain([status, 'access', _352 => _352.progress, 'optionalAccess', _353 => _353.logs])) ? status.progress.logs : [];
10779
11143
  const totalCount = logs.length;
10780
11144
  const entries = logs.slice(Math.max(0, logs.length - RUN_LOG_PREVIEW_LIMIT));
10781
11145
  const firstSequence = entries.length === 0 ? null : logs.length - entries.length + 1;
@@ -10832,7 +11196,7 @@ function compactPlayStatus(status) {
10832
11196
  const packaged = getPlayRunPackage(status);
10833
11197
  if (packaged) {
10834
11198
  const packagedRun = readRecord(packaged.run);
10835
- const packagedError = typeof _optionalChain([packagedRun, 'optionalAccess', _345 => _345.error]) === "string" ? packagedRun.error : null;
11199
+ const packagedError = typeof _optionalChain([packagedRun, 'optionalAccess', _354 => _354.error]) === "string" ? packagedRun.error : null;
10836
11200
  const error2 = _nullishCoalesce(selectRunErrorForDisplay(status), () => ( (typeof status.error === "string" ? String(status.error) : packagedError)));
10837
11201
  const compactError = error2 ? compactRunErrorForEnvelope(error2, status.runId) : null;
10838
11202
  const rowOutcomes2 = readRowOutcomeSummary(status);
@@ -10983,7 +11347,7 @@ function formatTopValuesPart(value) {
10983
11347
  }
10984
11348
  function formatPackageDatasetSummaryLines(summary, indent = " ") {
10985
11349
  const record3 = readRecord(summary);
10986
- const columnStats = readRecord(_optionalChain([record3, 'optionalAccess', _346 => _346.columnStats]));
11350
+ const columnStats = readRecord(_optionalChain([record3, 'optionalAccess', _355 => _355.columnStats]));
10987
11351
  if (!record3 || !columnStats) {
10988
11352
  return [];
10989
11353
  }
@@ -11071,7 +11435,7 @@ function packageDatasetRecords(packaged) {
11071
11435
  if (catalog.length > 0) return catalog;
11072
11436
  return readRecordArray(packaged.steps).flatMap((step) => {
11073
11437
  const output = readRecord(step.output);
11074
- return _optionalChain([output, 'optionalAccess', _347 => _347.kind]) === "dataset" ? [output] : [];
11438
+ return _optionalChain([output, 'optionalAccess', _356 => _356.kind]) === "dataset" ? [output] : [];
11075
11439
  });
11076
11440
  }
11077
11441
  function packageReturnedDatasetIdentity(packaged) {
@@ -11080,7 +11444,7 @@ function packageReturnedDatasetIdentity(packaged) {
11080
11444
  const outputs = _nullishCoalesce(readRecord(packaged.outputs), () => ( {}));
11081
11445
  for (const outputValue of Object.values(outputs)) {
11082
11446
  const output = readRecord(outputValue);
11083
- if (_optionalChain([output, 'optionalAccess', _348 => _348.kind]) !== "dataset") continue;
11447
+ if (_optionalChain([output, 'optionalAccess', _357 => _357.kind]) !== "dataset") continue;
11084
11448
  if (typeof output.datasetId === "string" && output.datasetId.trim()) {
11085
11449
  datasetIds.add(output.datasetId.trim());
11086
11450
  }
@@ -11116,7 +11480,7 @@ function formatRunStepProgress(progress, includeRowOutcomes = false) {
11116
11480
  }
11117
11481
  function formatPackageDatasetActionLines(packaged, options) {
11118
11482
  const returned = packageReturnedDatasetIdentity(packaged);
11119
- const includeSummary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _349 => _349.includeSummary]), () => ( true));
11483
+ const includeSummary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _358 => _358.includeSummary]), () => ( true));
11120
11484
  const lines = [];
11121
11485
  const steps = readRecordArray(packaged.steps);
11122
11486
  const stepsByDatasetId = /* @__PURE__ */ new Map();
@@ -11125,10 +11489,10 @@ function formatPackageDatasetActionLines(packaged, options) {
11125
11489
  for (const step of steps) {
11126
11490
  if (step.kind !== "dataset") continue;
11127
11491
  const output = readRecord(step.output);
11128
- if (typeof _optionalChain([output, 'optionalAccess', _350 => _350.datasetId]) === "string") {
11492
+ if (typeof _optionalChain([output, 'optionalAccess', _359 => _359.datasetId]) === "string") {
11129
11493
  stepsByDatasetId.set(output.datasetId, step);
11130
11494
  }
11131
- if (typeof _optionalChain([output, 'optionalAccess', _351 => _351.path]) === "string") {
11495
+ if (typeof _optionalChain([output, 'optionalAccess', _360 => _360.path]) === "string") {
11132
11496
  stepsByPath.set(output.path, step);
11133
11497
  }
11134
11498
  if (typeof step.id === "string") {
@@ -11142,8 +11506,8 @@ function formatPackageDatasetActionLines(packaged, options) {
11142
11506
  const category = isReturned ? "returned" : dataset.recovered === true ? "recovered" : "persisted";
11143
11507
  const rowCount = typeof dataset.rowCount === "number" && Number.isFinite(dataset.rowCount) ? Math.max(0, Math.trunc(dataset.rowCount)) : null;
11144
11508
  const lifecycle = readRecord(dataset.lifecycle);
11145
- const countUnconfirmed = _optionalChain([lifecycle, 'optionalAccess', _352 => _352.complete]) === false;
11146
- const persistedLowerBound = typeof _optionalChain([lifecycle, 'optionalAccess', _353 => _353.persistedRowsAtLeast]) === "number" && Number.isFinite(lifecycle.persistedRowsAtLeast) ? Math.max(0, Math.trunc(lifecycle.persistedRowsAtLeast)) : 0;
11509
+ const countUnconfirmed = _optionalChain([lifecycle, 'optionalAccess', _361 => _361.complete]) === false;
11510
+ const persistedLowerBound = typeof _optionalChain([lifecycle, 'optionalAccess', _362 => _362.persistedRowsAtLeast]) === "number" && Number.isFinite(lifecycle.persistedRowsAtLeast) ? Math.max(0, Math.trunc(lifecycle.persistedRowsAtLeast)) : 0;
11147
11511
  const actions2 = _nullishCoalesce(readRecord(dataset.actions), () => ( {}));
11148
11512
  if (countUnconfirmed) {
11149
11513
  lines.push(
@@ -11161,7 +11525,7 @@ function formatPackageDatasetActionLines(packaged, options) {
11161
11525
  }
11162
11526
  }
11163
11527
  const step = _nullishCoalesce(_nullishCoalesce((datasetId ? stepsByDatasetId.get(datasetId) : void 0), () => ( stepsByPath.get(path))), () => ( (typeof dataset.tableNamespace === "string" ? stepsByNamespace.get(dataset.tableNamespace) : void 0)));
11164
- const progress = readRecord(_optionalChain([step, 'optionalAccess', _354 => _354.progress]));
11528
+ const progress = readRecord(_optionalChain([step, 'optionalAccess', _363 => _363.progress]));
11165
11529
  if (progress) {
11166
11530
  lines.push(` progress: ${formatRunStepProgress(progress)}`);
11167
11531
  }
@@ -11175,10 +11539,10 @@ function formatPackageDatasetActionLines(packaged, options) {
11175
11539
  }
11176
11540
  const exportAction = readRecord(actions2.exportCsv);
11177
11541
  const exportCommand = actionToCommand(exportAction);
11178
- const exportScope = readRecord(_optionalChain([exportAction, 'optionalAccess', _355 => _355.scope]));
11542
+ const exportScope = readRecord(_optionalChain([exportAction, 'optionalAccess', _364 => _364.scope]));
11179
11543
  const queryAction = readRecord(actions2.query);
11180
- const queryScope = readRecord(_optionalChain([queryAction, 'optionalAccess', _356 => _356.scope]));
11181
- const runQueryCommand = _optionalChain([queryScope, 'optionalAccess', _357 => _357.kind]) === "run" ? actionToCommand(queryAction) : null;
11544
+ const queryScope = readRecord(_optionalChain([queryAction, 'optionalAccess', _365 => _365.scope]));
11545
+ const runQueryCommand = _optionalChain([queryScope, 'optionalAccess', _366 => _366.kind]) === "run" ? actionToCommand(queryAction) : null;
11182
11546
  const currentQueryCommand = actionToCommand(actions2.queryCurrentTable);
11183
11547
  const legacyQueryCommand = actionToCommand(actions2.query);
11184
11548
  if (runQueryCommand) {
@@ -11190,11 +11554,11 @@ function formatPackageDatasetActionLines(packaged, options) {
11190
11554
  }
11191
11555
  if (exportCommand) {
11192
11556
  lines.push(
11193
- _optionalChain([exportScope, 'optionalAccess', _358 => _358.kind]) === "database" ? ` export current table (may include other runs): ${exportCommand}` : ` export this run: ${exportCommand}`
11557
+ _optionalChain([exportScope, 'optionalAccess', _367 => _367.kind]) === "database" ? ` export current table (may include other runs): ${exportCommand}` : ` export this run: ${exportCommand}`
11194
11558
  );
11195
11559
  }
11196
11560
  const unavailable = readRecord(dataset.exportUnavailable);
11197
- if (typeof _optionalChain([unavailable, 'optionalAccess', _359 => _359.reason]) === "string" && typeof unavailable.message === "string") {
11561
+ if (typeof _optionalChain([unavailable, 'optionalAccess', _368 => _368.reason]) === "string" && typeof unavailable.message === "string") {
11198
11562
  lines.push(
11199
11563
  ` export unavailable (${unavailable.reason}): ${unavailable.message}`
11200
11564
  );
@@ -11211,7 +11575,7 @@ function packageSavedRowCount(packaged) {
11211
11575
  }
11212
11576
  function runtimeLimitWindowLabel(runtimeLimitFailure) {
11213
11577
  const message = _nullishCoalesce(getStringField(runtimeLimitFailure, "message"), () => ( ""));
11214
- const configuredSeconds = _optionalChain([/\bconfigured\s+(\d+)\s+second(?:s)?\s+runtime limit\b/i, 'access', _360 => _360.exec, 'call', _361 => _361(message), 'optionalAccess', _362 => _362[1]]);
11578
+ const configuredSeconds = _optionalChain([/\bconfigured\s+(\d+)\s+second(?:s)?\s+runtime limit\b/i, 'access', _369 => _369.exec, 'call', _370 => _370(message), 'optionalAccess', _371 => _371[1]]);
11215
11579
  if (configuredSeconds) {
11216
11580
  const seconds = Number(configuredSeconds);
11217
11581
  if (Number.isSafeInteger(seconds) && seconds > 0) {
@@ -11258,7 +11622,7 @@ function formatPackageValueOutputLines(packaged) {
11258
11622
  if (!outputs) return [];
11259
11623
  const returned = Object.entries(outputs).filter(([, output]) => {
11260
11624
  const record3 = readRecord(output);
11261
- return _optionalChain([record3, 'optionalAccess', _363 => _363.kind]) === "dataset" || _optionalChain([record3, 'optionalAccess', _364 => _364.kind]) === "value" && Object.prototype.hasOwnProperty.call(record3, "value");
11625
+ return _optionalChain([record3, 'optionalAccess', _372 => _372.kind]) === "dataset" || _optionalChain([record3, 'optionalAccess', _373 => _373.kind]) === "value" && Object.prototype.hasOwnProperty.call(record3, "value");
11262
11626
  });
11263
11627
  if (returned.length === 0) return [];
11264
11628
  const datasets = packageDatasetRecords(packaged);
@@ -11278,10 +11642,10 @@ function formatPackageValueOutputLines(packaged) {
11278
11642
  (candidate) => typeof output.datasetId === "string" && candidate.datasetId === output.datasetId || candidate.path === path
11279
11643
  );
11280
11644
  const stepOutput = datasetSteps.map((step) => readRecord(step.output)).find(
11281
- (candidate) => typeof output.datasetId === "string" && _optionalChain([candidate, 'optionalAccess', _365 => _365.datasetId]) === output.datasetId || _optionalChain([candidate, 'optionalAccess', _366 => _366.path]) === path
11645
+ (candidate) => typeof output.datasetId === "string" && _optionalChain([candidate, 'optionalAccess', _374 => _374.datasetId]) === output.datasetId || _optionalChain([candidate, 'optionalAccess', _375 => _375.path]) === path
11282
11646
  );
11283
- const preview = readRecord(_nullishCoalesce(_optionalChain([stepOutput, 'optionalAccess', _367 => _367.preview]), () => ( _optionalChain([dataset, 'optionalAccess', _368 => _368.preview]))));
11284
- const rows = Array.isArray(_optionalChain([preview, 'optionalAccess', _369 => _369.rows])) ? preview.rows.slice(0, 2) : [];
11647
+ const preview = readRecord(_nullishCoalesce(_optionalChain([stepOutput, 'optionalAccess', _376 => _376.preview]), () => ( _optionalChain([dataset, 'optionalAccess', _377 => _377.preview]))));
11648
+ const rows = Array.isArray(_optionalChain([preview, 'optionalAccess', _378 => _378.rows])) ? preview.rows.slice(0, 2) : [];
11285
11649
  if (rows.length > 0) {
11286
11650
  lines.push(` sample rows (${rows.length}):`);
11287
11651
  lines.push(
@@ -11307,7 +11671,7 @@ function formatPackageValueOutputLines(packaged) {
11307
11671
  return lines;
11308
11672
  }
11309
11673
  function authoredPackageStackFrames(packaged) {
11310
- const stack = readRecordArray(packaged.errors).map((entry) => typeof entry.stack === "string" ? entry.stack : null).find((candidate) => Boolean(_optionalChain([candidate, 'optionalAccess', _370 => _370.trim, 'call', _371 => _371()])));
11674
+ const stack = readRecordArray(packaged.errors).map((entry) => typeof entry.stack === "string" ? entry.stack : null).find((candidate) => Boolean(_optionalChain([candidate, 'optionalAccess', _379 => _379.trim, 'call', _380 => _380()])));
11311
11675
  if (!stack) return [];
11312
11676
  return stack.split("\n").map((line) => line.trim()).filter((line) => line.startsWith("at ")).filter(
11313
11677
  (line) => !line.includes("/virtual/deepline-plays/") && !line.includes("/apps/play-runner/") && !line.includes("/shared_libs/play-runtime/") && !line.includes("node:internal")
@@ -11339,9 +11703,9 @@ function activityIsoTimestamp(value) {
11339
11703
  }
11340
11704
  function buildRunActivityTextLines(run) {
11341
11705
  const activity = readRecord(run.activity);
11342
- const observation = readRecord(_optionalChain([activity, 'optionalAccess', _372 => _372.observation]));
11343
- const state = readRecord(_optionalChain([observation, 'optionalAccess', _373 => _373.state]));
11344
- const target = readRecord(_optionalChain([observation, 'optionalAccess', _374 => _374.target]));
11706
+ const observation = readRecord(_optionalChain([activity, 'optionalAccess', _381 => _381.observation]));
11707
+ const state = readRecord(_optionalChain([observation, 'optionalAccess', _382 => _382.state]));
11708
+ const target = readRecord(_optionalChain([observation, 'optionalAccess', _383 => _383.target]));
11345
11709
  if (!activity || !observation || !state) return [];
11346
11710
  const kind = typeof state.kind === "string" ? state.kind : "unknown";
11347
11711
  if (kind === "completed") return [];
@@ -11386,11 +11750,11 @@ function buildRunActivityTextLines(run) {
11386
11750
  }
11387
11751
  function formatObservedRunCounter(value) {
11388
11752
  const counter = readRecord(value);
11389
- const count2 = _optionalChain([counter, 'optionalAccess', _375 => _375.value]);
11753
+ const count2 = _optionalChain([counter, 'optionalAccess', _384 => _384.value]);
11390
11754
  if (typeof count2 !== "number" || !Number.isSafeInteger(count2) || count2 < 0) {
11391
11755
  return "unknown";
11392
11756
  }
11393
- return _optionalChain([counter, 'optionalAccess', _376 => _376.confirmed]) === true ? formatInteger(count2) : `${formatInteger(count2)} observed`;
11757
+ return _optionalChain([counter, 'optionalAccess', _385 => _385.confirmed]) === true ? formatInteger(count2) : `${formatInteger(count2)} observed`;
11394
11758
  }
11395
11759
  function buildRunStatusEvidenceTextLines(packaged) {
11396
11760
  const evidence = readRecord(packaged.runStatus);
@@ -11403,13 +11767,13 @@ function buildRunStatusEvidenceTextLines(packaged) {
11403
11767
  );
11404
11768
  }
11405
11769
  const source = readRecord(evidence.source);
11406
- if (_optionalChain([source, 'optionalAccess', _377 => _377.aligned]) === false) {
11770
+ if (_optionalChain([source, 'optionalAccess', _386 => _386.aligned]) === false) {
11407
11771
  lines.push(
11408
11772
  ` consistency: run snapshot event ${String(source.runSnapshotLedgerNextSeq)} and progress event ${String(source.ledgerNextSeq)} differ; retry this read to align them`
11409
11773
  );
11410
11774
  }
11411
11775
  const focus = readRecord(evidence.focusStep);
11412
- const rows = readRecord(_optionalChain([focus, 'optionalAccess', _378 => _378.rows]));
11776
+ const rows = readRecord(_optionalChain([focus, 'optionalAccess', _387 => _387.rows]));
11413
11777
  if (focus) {
11414
11778
  const id = typeof focus.id === "string" && focus.id.trim() ? focus.id.trim() : "unknown step";
11415
11779
  const label = typeof focus.label === "string" && focus.label.trim() ? ` (${focus.label.trim()})` : "";
@@ -11417,7 +11781,7 @@ function buildRunStatusEvidenceTextLines(packaged) {
11417
11781
  const known = readRecordArray(packaged.steps).find(
11418
11782
  (step) => typeof step.id === "string" && (id === step.id || id.endsWith(`:${step.id}`)) && typeof step.label === "string"
11419
11783
  );
11420
- const state = typeof _optionalChain([known, 'optionalAccess', _379 => _379.label]) === "string" ? known.label : typeof focus.status === "string" && focus.status.trim() ? formatNodeExecutionState(
11784
+ const state = typeof _optionalChain([known, 'optionalAccess', _388 => _388.label]) === "string" ? known.label : typeof focus.status === "string" && focus.status.trim() ? formatNodeExecutionState(
11421
11785
  deriveNodeExecutionState({
11422
11786
  reported: {
11423
11787
  status: focus.status.trim(),
@@ -11427,7 +11791,7 @@ function buildRunStatusEvidenceTextLines(packaged) {
11427
11791
  total: rows.total
11428
11792
  } : null
11429
11793
  },
11430
- runStatus: _optionalChain([run, 'optionalAccess', _380 => _380.status])
11794
+ runStatus: _optionalChain([run, 'optionalAccess', _389 => _389.status])
11431
11795
  })
11432
11796
  ) : null;
11433
11797
  lines.push(` current step: ${id}${label}${state ? `: ${state}` : ""}`);
@@ -11475,7 +11839,7 @@ function formatRecentRunLogLines(value) {
11475
11839
  (line) => typeof line === "string"
11476
11840
  );
11477
11841
  if (tail.length === 0) return [];
11478
- const shown = tail.map((line) => _chunkV76R6HMVjs.classifyLogLine.call(void 0, line)).filter(
11842
+ const shown = tail.map((line) => _chunk63S7X326js.classifyLogLine.call(void 0, line)).filter(
11479
11843
  (entry) => entry.level !== "debug" && !isProviderRowWaitLogLine(entry.line)
11480
11844
  ).slice(-8);
11481
11845
  const total = readNonNegativeInteger(logs.totalCount);
@@ -11519,7 +11883,7 @@ function buildRunPackageTextLines(packaged) {
11519
11883
  lines.push(` recovery: ${mode}${sourceRunId}`);
11520
11884
  }
11521
11885
  const runError = typeof run.error === "string" && run.error.trim() ? run.error.trim() : null;
11522
- const structuredRuntimeLimitMessage = typeof _optionalChain([runtimeLimitFailure, 'optionalAccess', _381 => _381.message]) === "string" && runtimeLimitFailure.message.trim() ? `${typeof runtimeLimitFailure.code === "string" ? runtimeLimitFailure.code : "RUNTIME_LIMIT_EXCEEDED"}: ${runtimeLimitFailure.message.trim()}` : null;
11886
+ const structuredRuntimeLimitMessage = typeof _optionalChain([runtimeLimitFailure, 'optionalAccess', _390 => _390.message]) === "string" && runtimeLimitFailure.message.trim() ? `${typeof runtimeLimitFailure.code === "string" ? runtimeLimitFailure.code : "RUNTIME_LIMIT_EXCEEDED"}: ${runtimeLimitFailure.message.trim()}` : null;
11523
11887
  const displayRunError = _nullishCoalesce(structuredRuntimeLimitMessage, () => ( runError));
11524
11888
  if (!isRuntimeLimitCheckpoint && displayRunError && (status === "failed" || status === "cancelled")) {
11525
11889
  lines.push(` error: ${truncateErrorForDisplay(displayRunError, runId)}`);
@@ -11530,11 +11894,11 @@ function buildRunPackageTextLines(packaged) {
11530
11894
  }
11531
11895
  }
11532
11896
  const failedLogs = readRecord(packaged.failedLogs);
11533
- const failedLogEntries = Array.isArray(_optionalChain([failedLogs, 'optionalAccess', _382 => _382.entries])) ? failedLogs.entries.filter(
11897
+ const failedLogEntries = Array.isArray(_optionalChain([failedLogs, 'optionalAccess', _391 => _391.entries])) ? failedLogs.entries.filter(
11534
11898
  (entry) => typeof entry === "string"
11535
11899
  ) : [];
11536
- const failedLogAssociation = typeof _optionalChain([failedLogs, 'optionalAccess', _383 => _383.association]) === "string" ? failedLogs.association : null;
11537
- const failedLogWarning = typeof _optionalChain([failedLogs, 'optionalAccess', _384 => _384.warning]) === "string" && failedLogs.warning.trim() ? failedLogs.warning.trim() : null;
11900
+ const failedLogAssociation = typeof _optionalChain([failedLogs, 'optionalAccess', _392 => _392.association]) === "string" ? failedLogs.association : null;
11901
+ const failedLogWarning = typeof _optionalChain([failedLogs, 'optionalAccess', _393 => _393.warning]) === "string" && failedLogs.warning.trim() ? failedLogs.warning.trim() : null;
11538
11902
  if (failedLogEntries.length > 0) {
11539
11903
  lines.push(" failed logs:");
11540
11904
  lines.push(...failedLogEntries.map((entry) => ` ${entry}`));
@@ -11553,8 +11917,8 @@ function buildRunPackageTextLines(packaged) {
11553
11917
  )
11554
11918
  ).slice(0, 16) : [];
11555
11919
  lines.push(...packageWarnings.map((warning) => ` warning: ${warning}`));
11556
- const failedLogNext = readRecord(_optionalChain([failedLogs, 'optionalAccess', _385 => _385.next]));
11557
- if (failedLogWarning && typeof _optionalChain([failedLogNext, 'optionalAccess', _386 => _386.logs]) === "string") {
11920
+ const failedLogNext = readRecord(_optionalChain([failedLogs, 'optionalAccess', _394 => _394.next]));
11921
+ if (failedLogWarning && typeof _optionalChain([failedLogNext, 'optionalAccess', _395 => _395.logs]) === "string") {
11558
11922
  lines.push(
11559
11923
  failedLogAssociation === "retained_before_truncation" ? ` retained logs: ${failedLogNext.logs}` : ` retry failed logs: ${failedLogNext.logs}`
11560
11924
  );
@@ -11582,20 +11946,20 @@ function buildRunPackageTextLines(packaged) {
11582
11946
  const stepStatus = typeof step.status === "string" ? step.status : status;
11583
11947
  const output = step.output && typeof step.output === "object" && !Array.isArray(step.output) ? step.output : null;
11584
11948
  const rowCount = output && typeof output.rowCount === "number" ? ` rows=${formatInteger(output.rowCount)}` : "";
11585
- const preview = _optionalChain([output, 'optionalAccess', _387 => _387.preview]) && typeof output.preview === "object" && !Array.isArray(output.preview) ? output.preview : null;
11586
- const previewRows = Array.isArray(_optionalChain([preview, 'optionalAccess', _388 => _388.rows])) ? preview.rows.length : null;
11949
+ const preview = _optionalChain([output, 'optionalAccess', _396 => _396.preview]) && typeof output.preview === "object" && !Array.isArray(output.preview) ? output.preview : null;
11950
+ const previewRows = Array.isArray(_optionalChain([preview, 'optionalAccess', _397 => _397.rows])) ? preview.rows.length : null;
11587
11951
  lines.push(` ${kind} ${id}: ${stepStatus}${rowCount}`);
11588
- lines.push(...formatPackageDatasetSummaryLines(_optionalChain([output, 'optionalAccess', _389 => _389.summary])));
11952
+ lines.push(...formatPackageDatasetSummaryLines(_optionalChain([output, 'optionalAccess', _398 => _398.summary])));
11589
11953
  if (previewRows !== null) {
11590
11954
  lines.push(
11591
- ` preview=${previewRows}${_optionalChain([preview, 'optionalAccess', _390 => _390.truncated]) ? " truncated" : ""}`
11955
+ ` preview=${previewRows}${_optionalChain([preview, 'optionalAccess', _399 => _399.truncated]) ? " truncated" : ""}`
11592
11956
  );
11593
11957
  }
11594
11958
  }
11595
11959
  const inspectCommand = actionToCommand(next.inspect);
11596
11960
  const fullResultCommand = actionToCommand(next.full);
11597
11961
  const hasCatalogExportAction = packageDatasetRecords(packaged).some(
11598
- (dataset) => Boolean(actionToCommand(_optionalChain([readRecord, 'call', _391 => _391(dataset.actions), 'optionalAccess', _392 => _392.exportCsv])))
11962
+ (dataset) => Boolean(actionToCommand(_optionalChain([readRecord, 'call', _400 => _400(dataset.actions), 'optionalAccess', _401 => _401.exportCsv])))
11599
11963
  );
11600
11964
  const legacyExportCommand = hasCatalogExportAction ? null : actionToCommand(next.export);
11601
11965
  const runAgainCommand = typeof next.run === "string" && next.run.trim() ? next.run.trim() : null;
@@ -11660,7 +12024,7 @@ function withOrdinaryRunAgainCommand(status, options, resolvedRevisionId) {
11660
12024
  }
11661
12025
  function buildBillingRollupTextLines(status) {
11662
12026
  const billing = status.billing;
11663
- const rollup = _optionalChain([billing, 'optionalAccess', _393 => _393.rollup]);
12027
+ const rollup = _optionalChain([billing, 'optionalAccess', _402 => _402.rollup]);
11664
12028
  if (!rollup) return [];
11665
12029
  const total = formatCreditAmount2(rollup.totalCreditsRollup);
11666
12030
  if (rollup.childCredits > 0 && rollup.descendantRunCount > 0) {
@@ -11705,7 +12069,7 @@ function buildPlayCompletionTextLines(status) {
11705
12069
  const overview = buildRunOverview(status);
11706
12070
  const { run } = overview;
11707
12071
  const failed = run.status === "failed";
11708
- const label = run.status === "completed" ? _optionalChain([overview, 'access', _394 => _394.rowOutcomes, 'optionalAccess', _395 => _395.hasRowFailures]) ? "Completed with row failures" : "Completed" : failed ? "Failed" : run.status;
12072
+ const label = run.status === "completed" ? _optionalChain([overview, 'access', _403 => _403.rowOutcomes, 'optionalAccess', _404 => _404.hasRowFailures]) ? "Completed with row failures" : "Completed" : failed ? "Failed" : run.status;
11709
12073
  const lines = [
11710
12074
  `${label} ${_nullishCoalesce(_nullishCoalesce(run.playName, () => ( status.playName)), () => ( "Play"))}`,
11711
12075
  `Run: ${run.id}`
@@ -11725,7 +12089,7 @@ function buildPlayCompletionTextLines(status) {
11725
12089
  ...formatJsonPreview(compactReturnValue(overview.result))
11726
12090
  );
11727
12091
  }
11728
- if (_optionalChain([overview, 'access', _396 => _396.rowOutcomes, 'optionalAccess', _397 => _397.hasRowFailures])) {
12092
+ if (_optionalChain([overview, 'access', _405 => _405.rowOutcomes, 'optionalAccess', _406 => _406.hasRowFailures])) {
11729
12093
  lines.push(
11730
12094
  `Rows: ${overview.rowOutcomes.completedRows} completed, ${overview.rowOutcomes.failedRows} failed`
11731
12095
  );
@@ -11754,17 +12118,17 @@ function buildPlayCompletionTextLines(status) {
11754
12118
  }
11755
12119
  function writePlayResult(status, jsonOutput, options) {
11756
12120
  const packaged = getPlayRunPackage(status);
11757
- if (status.package) _chunkZAAKSJASjs.recordPlayTermination.call(void 0, buildRunOverview(status).run);
11758
- const hits = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _398 => _398.hits]), () => ( null));
12121
+ if (status.package) _chunk27GJKC5Qjs.recordPlayTermination.call(void 0, buildRunOverview(status).run);
12122
+ const hits = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _407 => _407.hits]), () => ( null));
11759
12123
  if (jsonOutput) {
11760
- const payload2 = _optionalChain([options, 'optionalAccess', _399 => _399.fullJson]) ? status.package ? buildRunOverview(status, status) : { ...buildRunLaunch(status), diagnostics: status } : buildRunLaunch(status);
11761
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
12124
+ const payload2 = _optionalChain([options, 'optionalAccess', _408 => _408.fullJson]) ? status.package ? buildRunOverview(status, status) : { ...buildRunLaunch(status), diagnostics: status } : buildRunLaunch(status);
12125
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
11762
12126
  hits ? { ...payload2, hits } : payload2,
11763
- { json: true, fields: _optionalChain([options, 'optionalAccess', _400 => _400.jsonFields]) }
12127
+ { json: true, fields: _optionalChain([options, 'optionalAccess', _409 => _409.jsonFields]) }
11764
12128
  );
11765
12129
  return;
11766
12130
  }
11767
- if (packaged && !_optionalChain([options, 'optionalAccess', _401 => _401.fullJson])) {
12131
+ if (packaged && !_optionalChain([options, 'optionalAccess', _410 => _410.fullJson])) {
11768
12132
  const {
11769
12133
  logs: _logs,
11770
12134
  failedLogs: _failedLogs,
@@ -11774,7 +12138,7 @@ function writePlayResult(status, jsonOutput, options) {
11774
12138
  ...buildPlayCompletionTextLines(status),
11775
12139
  ...formatRunHitsLines(hits)
11776
12140
  ];
11777
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, displayPackage, {
12141
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, displayPackage, {
11778
12142
  json: false,
11779
12143
  text: `${lines2.join("\n")}
11780
12144
  `
@@ -11824,8 +12188,8 @@ function writePlayResult(status, jsonOutput, options) {
11824
12188
  lines.push(...renderedServerView.actions);
11825
12189
  lines.push(...buildBillingRollupTextLines(status));
11826
12190
  const compact = compactPlayStatus(status);
11827
- const payload = _optionalChain([options, 'optionalAccess', _402 => _402.fullJson]) ? status : compact;
11828
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
12191
+ const payload = _optionalChain([options, 'optionalAccess', _411 => _411.fullJson]) ? status : compact;
12192
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
11829
12193
  {
11830
12194
  ...payload,
11831
12195
  render: {
@@ -11861,7 +12225,7 @@ function withRunNavigationLines(lines, status, actionCommands = buildRunNavigati
11861
12225
  function playRunPackageTextLedgerIncomplete(pkg) {
11862
12226
  if (!pkg) return true;
11863
12227
  const steps = readRecordArray(pkg.steps);
11864
- if (steps.length === 0) return true;
12228
+ if (steps.length === 0) return pkg.stepsExpected !== false;
11865
12229
  for (const step of steps) {
11866
12230
  if (step.kind !== "dataset" || step.status !== "completed") continue;
11867
12231
  const output = readRecord(step.output);
@@ -11876,9 +12240,9 @@ async function resolvePlayRunOutputStatus(input) {
11876
12240
  return input.status;
11877
12241
  }
11878
12242
  const streamedPackage = getPlayRunPackage(input.status);
11879
- const refreshForFullJson = input.fullJson && streamedPackage !== null;
12243
+ const refreshForFullJson = input.fullJson && !input.fromDurableStatus;
11880
12244
  const streamedTextPackageIncomplete = input.status.status === "completed" && playRunPackageTextLedgerIncomplete(streamedPackage);
11881
- const refreshFailedTerminal = input.status.status === "failed";
12245
+ const refreshFailedTerminal = input.status.status === "failed" && (!input.fromDurableStatus || _optionalChain([readRecord, 'call', _412 => _412(_optionalChain([streamedPackage, 'optionalAccess', _413 => _413.run])), 'optionalAccess', _414 => _414.status]) !== "failed");
11882
12246
  if (!refreshForFullJson && !streamedTextPackageIncomplete && !refreshFailedTerminal) {
11883
12247
  return input.status;
11884
12248
  }
@@ -11978,14 +12342,14 @@ function mergeExportColumns(preferredColumns, rows) {
11978
12342
  return columns;
11979
12343
  }
11980
12344
  function sqlSafeExportColumnName(id) {
11981
- const prefix = _nullishCoalesce(_optionalChain([id, 'access', _403 => _403.trim, 'call', _404 => _404(), 'access', _405 => _405.match, 'call', _406 => _406(/^_+/), 'optionalAccess', _407 => _407[0]]), () => ( ""));
12345
+ const prefix = _nullishCoalesce(_optionalChain([id, 'access', _415 => _415.trim, 'call', _416 => _416(), 'access', _417 => _417.match, 'call', _418 => _418(/^_+/), 'optionalAccess', _419 => _419[0]]), () => ( ""));
11982
12346
  const normalized = id.trim().replace(/\.+/g, "__").replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
11983
12347
  const safe = `${prefix}${normalized || "column"}`;
11984
12348
  return /^[A-Za-z_]/.test(safe) ? safe : `c_${safe}`;
11985
12349
  }
11986
12350
  async function fetchBackingDatasetRows(input) {
11987
12351
  const playName = extractRunPlayName(input.status);
11988
- const tableNamespace = _optionalChain([input, 'access', _408 => _408.rowsInfo, 'access', _409 => _409.tableNamespace, 'optionalAccess', _410 => _410.trim, 'call', _411 => _411()]);
12352
+ const tableNamespace = _optionalChain([input, 'access', _420 => _420.rowsInfo, 'access', _421 => _421.tableNamespace, 'optionalAccess', _422 => _422.trim, 'call', _423 => _423()]);
11989
12353
  if (!playName || !tableNamespace) {
11990
12354
  return null;
11991
12355
  }
@@ -12008,7 +12372,7 @@ async function fetchBackingDatasetRows(input) {
12008
12372
  if (seenEnvelopeKeys.has(key)) {
12009
12373
  const activeRun = !TERMINAL_PLAY_STATUSES.has(input.status.status);
12010
12374
  const waitCommand = `${input.retryCommand} --wait`;
12011
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12375
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12012
12376
  "The backing dataset returned a Runtime Sheet row more than once while paging; the export is not ready to write. " + (activeRun ? `Wait for this same run: ${waitCommand}. Do not rerun the Play to retrieve results.` : `Retry with: ${input.retryCommand}`),
12013
12377
  void 0,
12014
12378
  "RUN_EXPORT_NOT_READY",
@@ -12024,7 +12388,7 @@ async function fetchBackingDatasetRows(input) {
12024
12388
  seenEnvelopeKeys.add(key);
12025
12389
  }
12026
12390
  sheetRows.push(...page.rows);
12027
- const summaryTotal = _optionalChain([page, 'access', _412 => _412.summary, 'optionalAccess', _413 => _413.stats, 'optionalAccess', _414 => _414.total]);
12391
+ const summaryTotal = _optionalChain([page, 'access', _424 => _424.summary, 'optionalAccess', _425 => _425.stats, 'optionalAccess', _426 => _426.total]);
12028
12392
  if (typeof summaryTotal === "number" && Number.isFinite(summaryTotal)) {
12029
12393
  settledTotal = Math.max(_nullishCoalesce(settledTotal, () => ( 0)), Math.trunc(summaryTotal));
12030
12394
  }
@@ -12118,7 +12482,7 @@ function assertDatasetHasExportableRows(input) {
12118
12482
  const rowOutcomes = _nullishCoalesce(readRowOutcomeSummary(input.status), () => ( readRowOutcomeSummary(
12119
12483
  getRecordField(getRecordField(input.status, "result"), "_metadata")
12120
12484
  )));
12121
- 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 && _optionalChain([rowOutcomes, 'optionalAccess', _415 => _415.failedRows]) === 0 && !rowOutcomes.hasRowFailures) {
12485
+ 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 && _optionalChain([rowOutcomes, 'optionalAccess', _427 => _427.failedRows]) === 0 && !rowOutcomes.hasRowFailures) {
12122
12486
  return input.rowsInfo;
12123
12487
  }
12124
12488
  const datasetLabel = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(input.datasetPath, () => ( input.rowsInfo.tableNamespace)), () => ( input.rowsInfo.source)), () => ( "result.rows"));
@@ -12139,7 +12503,7 @@ function assertDatasetHasExportableRows(input) {
12139
12503
  const currentTableQueryCommand2 = input.rowsInfo.currentTableQueryCommand;
12140
12504
  if (!TERMINAL_PLAY_STATUSES.has(input.status.status)) {
12141
12505
  const waitCommand = `${retryCommand} --wait`;
12142
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12506
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12143
12507
  `Run ${input.status.runId} is ${runStatus}; this dataset has zero rows to export yet. Wait for this same run: ${waitCommand}. Do not start another run to retrieve results.`,
12144
12508
  void 0,
12145
12509
  "RUN_EXPORT_EMPTY",
@@ -12157,7 +12521,7 @@ function assertDatasetHasExportableRows(input) {
12157
12521
  );
12158
12522
  }
12159
12523
  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.`;
12160
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12524
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12161
12525
  `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."),
12162
12526
  void 0,
12163
12527
  "RUN_EXPORT_EMPTY",
@@ -12190,8 +12554,8 @@ async function exportPlayStatusRows(client, status, outPath, options = {}) {
12190
12554
  path: dataset.exportFile(outPath, options),
12191
12555
  rowsInfo: dataset.info(),
12192
12556
  currentTable: false,
12193
- datasetPath: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _416 => _416.source]), () => ( null)),
12194
- datasetInfo: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _417 => _417.info, 'call', _418 => _418()]), () => ( null))
12557
+ datasetPath: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _428 => _428.source]), () => ( null)),
12558
+ datasetInfo: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _429 => _429.info, 'call', _430 => _430()]), () => ( null))
12195
12559
  };
12196
12560
  };
12197
12561
  const run = Run.open({
@@ -12203,7 +12567,7 @@ async function exportPlayStatusRows(client, status, outPath, options = {}) {
12203
12567
  const returnedRows = datasets.returned().map((dataset) => dataset.info());
12204
12568
  const recoveredRows = datasets.recovered().map((dataset) => dataset.info());
12205
12569
  const selectedDataset = run.dataset(options.datasetPath);
12206
- const rowsInfo = _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _419 => _419.info, 'call', _420 => _420()]), () => ( null));
12570
+ const rowsInfo = _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _431 => _431.info, 'call', _432 => _432()]), () => ( null));
12207
12571
  if (!selectedDataset && options.datasetPath) {
12208
12572
  const available = availableRows.map((info) => info.source).filter((source) => typeof source === "string");
12209
12573
  const commands = datasetChoiceLines({
@@ -12212,7 +12576,7 @@ async function exportPlayStatusRows(client, status, outPath, options = {}) {
12212
12576
  outPath,
12213
12577
  options
12214
12578
  });
12215
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12579
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12216
12580
  `Run ${status.runId} did not return a dataset at ${options.datasetPath}.` + (available.length > 0 ? ` Available datasets: ${available.join(", ")}.
12217
12581
  ${commands.join("\n")}` : ""),
12218
12582
  void 0,
@@ -12228,7 +12592,7 @@ ${commands.join("\n")}` : ""),
12228
12592
  outPath,
12229
12593
  options
12230
12594
  });
12231
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12595
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12232
12596
  `Run ${status.runId} returned multiple datasets. Choose one:
12233
12597
  ${commands.join("\n")}`,
12234
12598
  void 0,
@@ -12251,7 +12615,7 @@ ${commands.join("\n")}`,
12251
12615
  outPath,
12252
12616
  options
12253
12617
  });
12254
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12618
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12255
12619
  `Run ${status.runId} has multiple recovered datasets. Choose one:
12256
12620
  ${commands.join("\n")}`,
12257
12621
  void 0,
@@ -12267,14 +12631,14 @@ ${commands.join("\n")}`,
12267
12631
  );
12268
12632
  }
12269
12633
  if (!rowsInfo) {
12270
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12634
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12271
12635
  `Run ${status.runId} did not expose a row-shaped final output to export.`
12272
12636
  );
12273
12637
  }
12274
12638
  const canExportPreview = rowsInfo.complete && !rowsInfo.currentTable;
12275
12639
  if (rowsInfo.exportUnavailableReason === "returned_dataset_not_persisted") {
12276
12640
  const datasetLabel = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(options.datasetPath, () => ( rowsInfo.source)), () => ( rowsInfo.datasetId)), () => ( "result.rows"));
12277
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12641
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12278
12642
  _nullishCoalesce(rowsInfo.exportUnavailableMessage, () => ( `Run ${status.runId} returned rows for '${datasetLabel}' without a run-scoped durable dataset. Persist the rows with ctx.dataset("rows", rows).run() before returning them.`)),
12279
12643
  void 0,
12280
12644
  "RUN_EXPORT_NOT_AVAILABLE",
@@ -12308,14 +12672,14 @@ ${commands.join("\n")}`,
12308
12672
  retryCommand
12309
12673
  });
12310
12674
  } catch (error) {
12311
- if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.code === "RUN_EXPORT_SCOPE_MISMATCH" || error.code === "RUN_EXPORT_NOT_READY")) {
12675
+ if (error instanceof _chunkPPDBRJRWjs.DeeplineError && (error.code === "RUN_EXPORT_SCOPE_MISMATCH" || error.code === "RUN_EXPORT_NOT_READY")) {
12312
12676
  throw error;
12313
12677
  }
12314
12678
  if (!canExportPreview) {
12315
12679
  throw error;
12316
12680
  }
12317
12681
  }
12318
- if (_optionalChain([fetchedRowsInfo, 'optionalAccess', _421 => _421.complete])) {
12682
+ if (_optionalChain([fetchedRowsInfo, 'optionalAccess', _433 => _433.complete])) {
12319
12683
  const guarded2 = assertDatasetHasExportableRows({
12320
12684
  rowsInfo: fetchedRowsInfo,
12321
12685
  status,
@@ -12347,7 +12711,7 @@ ${commands.join("\n")}`,
12347
12711
  const previewReason = rowsInfo.currentTable ? "Legacy shared-table metadata does not prove this preview belongs to the run" : `Run output only includes ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}`;
12348
12712
  const activeRun = !TERMINAL_PLAY_STATUSES.has(status.status);
12349
12713
  const waitCommand = `${retryCommand} --wait`;
12350
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
12714
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
12351
12715
  `${previewReason}; the backing dataset was not ready to export yet. ` + (activeRun ? `The run is ${status.status}. Wait for this same run: ${waitCommand}. Do not rerun the Play to retrieve results.` : `Retry with: ${retryCommand}`),
12352
12716
  void 0,
12353
12717
  "RUN_EXPORT_NOT_READY",
@@ -12374,10 +12738,10 @@ ${commands.join("\n")}`,
12374
12738
  return writeExport(guarded);
12375
12739
  }
12376
12740
  function extractActiveRunsFromError(error) {
12377
- if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError)) {
12741
+ if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError)) {
12378
12742
  return [];
12379
12743
  }
12380
- const response = _optionalChain([error, 'access', _422 => _422.details, 'optionalAccess', _423 => _423.response]);
12744
+ const response = _optionalChain([error, 'access', _434 => _434.details, 'optionalAccess', _435 => _435.response]);
12381
12745
  if (!response || typeof response !== "object" || Array.isArray(response)) {
12382
12746
  return [];
12383
12747
  }
@@ -12425,7 +12789,7 @@ function stringArrayField(record3, key) {
12425
12789
  return value.filter((entry) => typeof entry === "string");
12426
12790
  }
12427
12791
  function extractPlayValidationErrors(value) {
12428
- if (value instanceof _chunk7P5AA3SNjs.DeeplineError) {
12792
+ if (value instanceof _chunkPPDBRJRWjs.DeeplineError) {
12429
12793
  return extractPlayValidationErrors(value.details);
12430
12794
  }
12431
12795
  if (!isRecord2(value)) {
@@ -12464,21 +12828,21 @@ function normalizePlayValidationError(error) {
12464
12828
  if (!message.trim()) {
12465
12829
  return error;
12466
12830
  }
12467
- return new (0, _chunk7P5AA3SNjs.DeeplineError)(
12831
+ return new (0, _chunkPPDBRJRWjs.DeeplineError)(
12468
12832
  message,
12469
- error instanceof _chunk7P5AA3SNjs.DeeplineError ? error.statusCode : void 0,
12470
- error instanceof _chunk7P5AA3SNjs.DeeplineError ? error.code : "PLAY_VALIDATION_ERROR",
12471
- error instanceof _chunk7P5AA3SNjs.DeeplineError ? error.details : void 0
12833
+ error instanceof _chunkPPDBRJRWjs.DeeplineError ? error.statusCode : void 0,
12834
+ error instanceof _chunkPPDBRJRWjs.DeeplineError ? error.code : "PLAY_VALIDATION_ERROR",
12835
+ error instanceof _chunkPPDBRJRWjs.DeeplineError ? error.details : void 0
12472
12836
  );
12473
12837
  }
12474
12838
  async function normalizePlayStartError(client, error, playName, options = {}) {
12475
12839
  const activeRuns = extractActiveRunsFromError(error);
12476
12840
  if (activeRuns.length > 0) {
12477
- return new (0, _chunk7P5AA3SNjs.DeeplineError)(
12841
+ return new (0, _chunkPPDBRJRWjs.DeeplineError)(
12478
12842
  formatActiveRunConflictError({ playName, activeRuns }),
12479
- error instanceof _chunk7P5AA3SNjs.DeeplineError ? error.statusCode : 409,
12843
+ error instanceof _chunkPPDBRJRWjs.DeeplineError ? error.statusCode : 409,
12480
12844
  "ACTIVE_RUN_EXISTS",
12481
- error instanceof _chunk7P5AA3SNjs.DeeplineError ? error.details : void 0
12845
+ error instanceof _chunkPPDBRJRWjs.DeeplineError ? error.details : void 0
12482
12846
  );
12483
12847
  }
12484
12848
  if (options.suggestMissingPlay && await isMissingRunPlayReferenceError({ client, error, playName })) {
@@ -12496,8 +12860,8 @@ function renderServerResultView(value) {
12496
12860
  return { lines: [], actions: [] };
12497
12861
  }
12498
12862
  const view = value;
12499
- const renderedSections = Array.isArray(_optionalChain([view, 'access', _424 => _424.render, 'optionalAccess', _425 => _425.sections])) ? view.render.sections : [];
12500
- const renderedActions = Array.isArray(_optionalChain([view, 'access', _426 => _426.render, 'optionalAccess', _427 => _427.actions])) ? view.render.actions : [];
12863
+ const renderedSections = Array.isArray(_optionalChain([view, 'access', _436 => _436.render, 'optionalAccess', _437 => _437.sections])) ? view.render.sections : [];
12864
+ const renderedActions = Array.isArray(_optionalChain([view, 'access', _438 => _438.render, 'optionalAccess', _439 => _439.actions])) ? view.render.actions : [];
12501
12865
  if (renderedSections.length > 0 || renderedActions.length > 0) {
12502
12866
  const lines2 = [];
12503
12867
  for (const section of renderedSections) {
@@ -12535,7 +12899,7 @@ function renderServerResultView(value) {
12535
12899
  }
12536
12900
  const tables = Array.isArray(view.tables) ? view.tables : [];
12537
12901
  const topLevelOutputTable = view.topLevelOutputTable && typeof view.topLevelOutputTable === "object" && !Array.isArray(view.topLevelOutputTable) ? view.topLevelOutputTable : null;
12538
- if (typeof _optionalChain([topLevelOutputTable, 'optionalAccess', _428 => _428.queryCommand]) === "string") {
12902
+ if (typeof _optionalChain([topLevelOutputTable, 'optionalAccess', _440 => _440.queryCommand]) === "string") {
12539
12903
  lines.push(` top-level outputs: ${topLevelOutputTable.queryCommand}`);
12540
12904
  }
12541
12905
  if (tables.length > 0) {
@@ -12582,7 +12946,7 @@ function renderServerResultView(value) {
12582
12946
  function writeStartedPlayRun(input) {
12583
12947
  if (input.package && isPlayRunPackageValue(input.package)) {
12584
12948
  const run = input.package.run;
12585
- _chunkZAAKSJASjs.recordPlayTermination.call(void 0, {
12949
+ _chunk27GJKC5Qjs.recordPlayTermination.call(void 0, {
12586
12950
  id: run.id,
12587
12951
  status: run.status,
12588
12952
  finishedAt: run.finishedAt
@@ -12595,7 +12959,7 @@ function writeStartedPlayRun(input) {
12595
12959
  dashboardUrl: input.dashboardUrl,
12596
12960
  package: input.package
12597
12961
  };
12598
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, buildRunLaunch(status), {
12962
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, buildRunLaunch(status), {
12599
12963
  json: true,
12600
12964
  fields: input.jsonFields
12601
12965
  });
@@ -12617,7 +12981,7 @@ function writeStartedPlayRun(input) {
12617
12981
  input.progress.writeLine(output2, process.stdout);
12618
12982
  return;
12619
12983
  }
12620
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, input.package, {
12984
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, input.package, {
12621
12985
  json: false,
12622
12986
  text: `${output2}
12623
12987
  `
@@ -12646,7 +13010,7 @@ function writeStartedPlayRun(input) {
12646
13010
  ) ? [`Stop: deepline runs stop ${_chunkAID3OYVJjs.shellQuote.call(void 0, input.runId)}`] : []
12647
13011
  ];
12648
13012
  if (input.jsonOutput) {
12649
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, payload, { json: true, fields: input.jsonFields });
13013
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, payload, { json: true, fields: input.jsonFields });
12650
13014
  return;
12651
13015
  }
12652
13016
  if (input.dashboardUrl) {
@@ -12657,7 +13021,7 @@ function writeStartedPlayRun(input) {
12657
13021
  input.progress.writeLine(output, process.stdout);
12658
13022
  return;
12659
13023
  }
12660
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
13024
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
12661
13025
  {
12662
13026
  ...payload,
12663
13027
  render: { sections: [{ title: "play run", lines }] }
@@ -12667,7 +13031,7 @@ function writeStartedPlayRun(input) {
12667
13031
  );
12668
13032
  }
12669
13033
  function parsePlayCheckOptions(args) {
12670
- const selection = _chunkYD7B53RWjs.parseJsonFields.call(void 0, args, "check");
13034
+ const selection = _chunkNF4V5DTYjs.parseJsonFields.call(void 0, args, "check");
12671
13035
  args = selection.args;
12672
13036
  const target = args[0];
12673
13037
  if (!target || target.startsWith("-")) {
@@ -12679,7 +13043,7 @@ function parsePlayCheckOptions(args) {
12679
13043
  if (arg !== "--json" && arg !== "--full")
12680
13044
  throw new Error(`Unknown plays check option: ${arg}`);
12681
13045
  }
12682
- const jsonOutput = _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
13046
+ const jsonOutput = _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
12683
13047
  return {
12684
13048
  target,
12685
13049
  jsonOutput,
@@ -12755,7 +13119,7 @@ ${PLAY_PUBLISH_USAGE}`
12755
13119
  useLatest,
12756
13120
  expectedArtifactHash,
12757
13121
  dryRun,
12758
- jsonOutput: _chunkYD7B53RWjs.argsWantJson.call(void 0, args)
13122
+ jsonOutput: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args)
12759
13123
  };
12760
13124
  }
12761
13125
  var PLAY_SAVE_USAGE = "Usage: deepline plays save <play-file.ts> [--expected-artifact <hash>] [--dry-run] [--json]";
@@ -12796,7 +13160,7 @@ ${PLAY_SAVE_USAGE}`);
12796
13160
  target,
12797
13161
  expectedArtifactHash,
12798
13162
  dryRun,
12799
- jsonOutput: _chunkYD7B53RWjs.argsWantJson.call(void 0, args)
13163
+ jsonOutput: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args)
12800
13164
  };
12801
13165
  }
12802
13166
  function printScheduledPlayCapacity(capacity) {
@@ -12849,7 +13213,7 @@ function checkHintExpression(value) {
12849
13213
  return stringValue2(value).replace(/^toolExecutionResult\./, "result.");
12850
13214
  }
12851
13215
  function checkHintRawPath(value) {
12852
- return _optionalChain([value, 'optionalAccess', _429 => _429.startsWith, 'call', _430 => _430("toolResponse.rawV2")]) ? value.replace(/^toolResponse\./, "result.toolResponse.") : void 0;
13216
+ return _optionalChain([value, 'optionalAccess', _441 => _441.startsWith, 'call', _442 => _442("toolResponse.rawV2")]) ? value.replace(/^toolResponse\./, "result.toolResponse.") : void 0;
12853
13217
  }
12854
13218
  function collectStaticPipelineToolIds(staticPipeline) {
12855
13219
  const seen = /* @__PURE__ */ new Set();
@@ -12924,30 +13288,30 @@ function cronExecutionLabel(status) {
12924
13288
  }
12925
13289
  function readLiveCronMetadata(play) {
12926
13290
  const record3 = readRecord(play);
12927
- const metadata = readRecord(_optionalChain([record3, 'optionalAccess', _431 => _431.triggerMetadata]));
13291
+ const metadata = readRecord(_optionalChain([record3, 'optionalAccess', _443 => _443.triggerMetadata]));
12928
13292
  return {
12929
- schedule: typeof _optionalChain([metadata, 'optionalAccess', _432 => _432.cronSchedule]) === "string" ? metadata.cronSchedule : null,
12930
- timezone: typeof _optionalChain([metadata, 'optionalAccess', _433 => _433.cronTimezone]) === "string" ? metadata.cronTimezone : null,
12931
- nextScheduledAt: typeof _optionalChain([metadata, 'optionalAccess', _434 => _434.nextScheduledAt]) === "number" ? metadata.nextScheduledAt : null,
12932
- blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _435 => _435.blockedAt]) === "number" ? metadata.blockedAt : null,
12933
- blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _436 => _436.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null
13293
+ schedule: typeof _optionalChain([metadata, 'optionalAccess', _444 => _444.cronSchedule]) === "string" ? metadata.cronSchedule : null,
13294
+ timezone: typeof _optionalChain([metadata, 'optionalAccess', _445 => _445.cronTimezone]) === "string" ? metadata.cronTimezone : null,
13295
+ nextScheduledAt: typeof _optionalChain([metadata, 'optionalAccess', _446 => _446.nextScheduledAt]) === "number" ? metadata.nextScheduledAt : null,
13296
+ blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _447 => _447.blockedAt]) === "number" ? metadata.blockedAt : null,
13297
+ blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _448 => _448.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null
12934
13298
  };
12935
13299
  }
12936
13300
  function liveTriggerStatusLines(status, play) {
12937
13301
  const cron = readLiveCronMetadata(play);
12938
- if (!_optionalChain([status, 'optionalAccess', _437 => _437.cron]) && !cron.schedule && !_optionalChain([status, 'optionalAccess', _438 => _438.webhook])) return [];
13302
+ if (!_optionalChain([status, 'optionalAccess', _449 => _449.cron]) && !cron.schedule && !_optionalChain([status, 'optionalAccess', _450 => _450.webhook])) return [];
12939
13303
  const lines = [];
12940
- if (_optionalChain([status, 'optionalAccess', _439 => _439.cron]) || cron.schedule) {
13304
+ if (_optionalChain([status, 'optionalAccess', _451 => _451.cron]) || cron.schedule) {
12941
13305
  const timezone = cron.timezone ? ` (${cron.timezone})` : "";
12942
13306
  lines.push(
12943
- ` Scheduled execution: ${cronExecutionLabel(_nullishCoalesce(_optionalChain([status, 'optionalAccess', _440 => _440.cron]), () => ( null)))}${cron.schedule ? ` \u2014 ${cron.schedule}${timezone}` : ""}`
13307
+ ` Scheduled execution: ${cronExecutionLabel(_nullishCoalesce(_optionalChain([status, 'optionalAccess', _452 => _452.cron]), () => ( null)))}${cron.schedule ? ` \u2014 ${cron.schedule}${timezone}` : ""}`
12944
13308
  );
12945
- if (cron.nextScheduledAt !== null && _optionalChain([status, 'optionalAccess', _441 => _441.cron]) === "active") {
13309
+ if (cron.nextScheduledAt !== null && _optionalChain([status, 'optionalAccess', _453 => _453.cron]) === "active") {
12946
13310
  lines.push(
12947
13311
  ` Next scheduled run: ${formatTimestamp(cron.nextScheduledAt)}`
12948
13312
  );
12949
13313
  }
12950
- if (_optionalChain([status, 'optionalAccess', _442 => _442.blockedReason])) {
13314
+ if (_optionalChain([status, 'optionalAccess', _454 => _454.blockedReason])) {
12951
13315
  lines.push(` Schedule issue: ${status.blockedReason}`);
12952
13316
  if (status.blockedReasonCode || cron.blockedReasonCode) {
12953
13317
  lines.push(
@@ -12963,7 +13327,7 @@ function liveTriggerStatusLines(status, play) {
12963
13327
  );
12964
13328
  }
12965
13329
  }
12966
- if (_optionalChain([status, 'optionalAccess', _443 => _443.webhook])) {
13330
+ if (_optionalChain([status, 'optionalAccess', _455 => _455.webhook])) {
12967
13331
  lines.push(` Webhook: ${status.webhook}`);
12968
13332
  }
12969
13333
  return lines;
@@ -12971,11 +13335,11 @@ function liveTriggerStatusLines(status, play) {
12971
13335
  function triggerStatusFromMetadata(value) {
12972
13336
  const metadata = readRecord(value);
12973
13337
  return {
12974
- cron: typeof _optionalChain([metadata, 'optionalAccess', _444 => _444.cronStatus]) === "string" ? metadata.cronStatus : null,
12975
- webhook: typeof _optionalChain([metadata, 'optionalAccess', _445 => _445.webhookStatus]) === "string" ? metadata.webhookStatus : null,
12976
- blockedReason: typeof _optionalChain([metadata, 'optionalAccess', _446 => _446.blockedReason]) === "string" ? metadata.blockedReason : null,
12977
- blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _447 => _447.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null,
12978
- blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _448 => _448.blockedAt]) === "number" ? metadata.blockedAt : null
13338
+ cron: typeof _optionalChain([metadata, 'optionalAccess', _456 => _456.cronStatus]) === "string" ? metadata.cronStatus : null,
13339
+ webhook: typeof _optionalChain([metadata, 'optionalAccess', _457 => _457.webhookStatus]) === "string" ? metadata.webhookStatus : null,
13340
+ blockedReason: typeof _optionalChain([metadata, 'optionalAccess', _458 => _458.blockedReason]) === "string" ? metadata.blockedReason : null,
13341
+ blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _459 => _459.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null,
13342
+ blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _460 => _460.blockedAt]) === "number" ? metadata.blockedAt : null
12979
13343
  };
12980
13344
  }
12981
13345
  function printPublishReceipt(input) {
@@ -13007,7 +13371,7 @@ function printBundledRuntimeWarning(bundle) {
13007
13371
  async function handlePlayCheck(args) {
13008
13372
  const options = parsePlayCheckOptions(args);
13009
13373
  if (!isFileTarget2(options.target)) {
13010
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
13374
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
13011
13375
  try {
13012
13376
  await assertCanonicalNamedPlayReference(client, options.target, {
13013
13377
  command: "check"
@@ -13036,7 +13400,7 @@ async function handlePlayCheck(args) {
13036
13400
  },
13037
13401
  ...options.full ? { diagnostics: { staticPipeline: _nullishCoalesce(play.staticPipeline, () => ( null)) } } : {}
13038
13402
  };
13039
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, result, {
13403
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, result, {
13040
13404
  json: options.jsonOutput,
13041
13405
  fields: options.jsonFields,
13042
13406
  text: renderPlayCheckOutput(result) + "\n"
@@ -13046,7 +13410,7 @@ async function handlePlayCheck(args) {
13046
13410
  const resolved = _path.resolve.call(void 0, options.target);
13047
13411
  const message = error instanceof Error && error.message ? error.message : `File not found: ${resolved}`;
13048
13412
  if (options.jsonOutput) {
13049
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
13413
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
13050
13414
  {
13051
13415
  kind: "play_check",
13052
13416
  checked: "named_contract",
@@ -13079,16 +13443,16 @@ async function handlePlayCheck(args) {
13079
13443
  );
13080
13444
  }
13081
13445
  const primary = outcomes.find(
13082
- (outcome) => outcome.exportName === _chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT
13446
+ (outcome) => outcome.exportName === _chunkOQQOXSYAjs.PLAY_DEFAULT_EXPORT
13083
13447
  );
13084
13448
  const output = buildPlayCheckOutput({
13085
13449
  outcomes,
13086
13450
  target: options.target,
13087
13451
  full: options.full,
13088
13452
  detailsCommand: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)} --full`,
13089
- publishCommand: _optionalChain([primary, 'optionalAccess', _449 => _449.result, 'access', _450 => _450.artifactHash]) ? `deepline plays publish ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)} --expected-artifact ${primary.result.artifactHash}` : void 0
13453
+ publishCommand: _optionalChain([primary, 'optionalAccess', _461 => _461.result, 'access', _462 => _462.artifactHash]) ? `deepline plays publish ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)} --expected-artifact ${primary.result.artifactHash}` : void 0
13090
13454
  });
13091
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, output, {
13455
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, output, {
13092
13456
  json: options.jsonOutput,
13093
13457
  fields: options.jsonFields,
13094
13458
  text: renderPlayCheckOutput(output) + "\n"
@@ -13096,12 +13460,12 @@ async function handlePlayCheck(args) {
13096
13460
  return output.valid ? 0 : 1;
13097
13461
  }
13098
13462
  function resolvePlayCheckExportNames(sourceCode) {
13099
- const exports = _chunkSEFMGO3Zjs.listPlayFileExports.call(void 0, sourceCode);
13100
- if (!exports || exports.length === 0) return [_chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT];
13463
+ const exports = _chunkOQQOXSYAjs.listPlayFileExports.call(void 0, sourceCode);
13464
+ if (!exports || exports.length === 0) return [_chunkOQQOXSYAjs.PLAY_DEFAULT_EXPORT];
13101
13465
  return exports.map((entry) => entry.name);
13102
13466
  }
13103
13467
  function artifactForProductionCompatibilityCheck(artifact) {
13104
- const rawEdition = _optionalChain([process, 'access', _451 => _451.env, 'access', _452 => _452.DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION, 'optionalAccess', _453 => _453.trim, 'call', _454 => _454()]);
13468
+ const rawEdition = _optionalChain([process, 'access', _463 => _463.env, 'access', _464 => _464.DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION, 'optionalAccess', _465 => _465.trim, 'call', _466 => _466()]);
13105
13469
  if (!rawEdition) return artifact;
13106
13470
  if (!/^\d+$/.test(rawEdition)) {
13107
13471
  throw new Error(
@@ -13142,48 +13506,64 @@ async function checkOneExportedPlay(input) {
13142
13506
  }
13143
13507
  const playName = _nullishCoalesce(graph.root.playName, () => ( fallbackName));
13144
13508
  const authoringErrors = collectPlayGraphAuthoringErrors(graph);
13145
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
13509
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
13146
13510
  const integrationMode = resolveEvalIntegrationMode();
13147
- const importedPlays = [...graph.nodes.values()].filter((node) => node.filePath !== graph.root.filePath).map((node) => ({
13148
- playName: node.playName,
13149
- sourceCode: node.sourceCode,
13150
- sourcePath: playAuthoringGraphPath(graph.root, node.filePath)
13151
- }));
13152
- const result = await client.checkPlayArtifact({
13153
- name: playName,
13154
- sourceCode: graph.root.sourceCode,
13155
- sourceFiles: graph.root.sourceFiles,
13156
- description: _nullishCoalesce(graph.root.playDescription, () => ( void 0)),
13157
- artifact: artifactForProductionCompatibilityCheck(graph.root.artifact),
13158
- ...exportName === _chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT ? {} : { exportName },
13159
- ...importedPlays.length > 0 ? { importedPlays } : {},
13160
- ...integrationMode ? { integrationMode } : {}
13511
+ const checked = await checkLocalPlayGraph({
13512
+ client,
13513
+ graph,
13514
+ rootPlayName: playName,
13515
+ exportName,
13516
+ integrationMode,
13517
+ prepareArtifact: artifactForProductionCompatibilityCheck
13161
13518
  });
13162
- const valid = result.valid && authoringErrors.length === 0;
13519
+ const importedPlayName = _optionalChain([checked, 'access', _467 => _467.failedChild, 'optionalAccess', _468 => _468.playName]);
13520
+ const diagnosticPrefix = importedPlayName ? `Imported Play ${importedPlayName}: ` : "";
13521
+ const valid = checked.result.valid && !checked.failedChild && authoringErrors.length === 0;
13522
+ const errors = [
13523
+ ...authoringErrors,
13524
+ ...checked.result.errors.map((error) => `${diagnosticPrefix}${error}`)
13525
+ ];
13163
13526
  return {
13164
13527
  exportName,
13165
13528
  playName,
13166
- ...authoringErrors.length > 0 ? { stage: "authoring" } : {},
13529
+ ...authoringErrors.length > 0 || checked.failedChild ? { stage: "authoring" } : {},
13167
13530
  result: {
13168
- ...result,
13531
+ ...checked.result,
13169
13532
  valid,
13170
- errors: valid ? result.errors : addPlayCheckRepairHints({
13171
- errors: [...authoringErrors, ...result.errors],
13172
- sourceCode: graph.root.sourceCode
13533
+ errors: valid ? checked.result.errors : addPlayCheckRepairHints({
13534
+ errors,
13535
+ sourceCode: _nullishCoalesce(_optionalChain([checked, 'access', _469 => _469.failedChild, 'optionalAccess', _470 => _470.sourceCode]), () => ( graph.root.sourceCode))
13173
13536
  }),
13174
- toolGetterHints: await _asyncNullishCoalesce(result.toolGetterHints, async () => ( await buildToolGetterHints(client, result.staticPipeline)))
13537
+ ...checked.failedChild && checked.result.issues ? {
13538
+ issues: checked.result.issues.map((issue) => ({
13539
+ ...issue,
13540
+ message: `${diagnosticPrefix}${issue.message}`
13541
+ }))
13542
+ } : {},
13543
+ toolGetterHints: await _asyncNullishCoalesce(checked.result.toolGetterHints, async () => ( (checked.failedChild ? [] : await buildToolGetterHints(client, checked.result.staticPipeline))))
13175
13544
  }
13176
13545
  };
13177
13546
  }
13178
13547
  function playRunClientOptions(options) {
13179
13548
  return options.headers ? { headers: options.headers } : void 0;
13180
13549
  }
13550
+ async function preflightPlayRunTotalBudget(input) {
13551
+ if (input.maxTotalCredits === null) return;
13552
+ await input.client.preparePlayRunAdmission({
13553
+ name: input.playName,
13554
+ maxTotalCredits: input.maxTotalCredits
13555
+ });
13556
+ }
13181
13557
  async function handleFileBackedRun(options, hooks) {
13182
13558
  if (options.target.kind !== "file") {
13183
13559
  throw new Error("Expected a file-backed play run target.");
13184
13560
  }
13185
13561
  let client;
13186
- const progress = _nullishCoalesce(_chunkALD4COBHjs.getActiveCliProgress.call(void 0, ), () => ( _chunkALD4COBHjs.createCliProgress.call(void 0, !options.jsonOutput)));
13562
+ let cliAdmission = _chunkVK2LZ5IPjs.usesInlinePlayAdmission.call(void 0,
13563
+ "plays run",
13564
+ process.argv.slice(2)
13565
+ );
13566
+ const progress = _nullishCoalesce(_chunkLTFL4JRNjs.getActiveCliProgress.call(void 0, ), () => ( _chunkLTFL4JRNjs.createCliProgress.call(void 0, !options.jsonOutput)));
13187
13567
  const absolutePlayPath = _path.resolve.call(void 0, options.target.path);
13188
13568
  progress.phase("compiling play");
13189
13569
  const sourceCode = traceCliSync(
@@ -13200,13 +13580,13 @@ async function handleFileBackedRun(options, hooks) {
13200
13580
  }
13201
13581
  let graph;
13202
13582
  try {
13203
- graph = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13583
+ graph = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13204
13584
  "cli.play_file_bundle_graph",
13205
13585
  { targetKind: "file" },
13206
13586
  () => collectBundledPlayGraph(
13207
13587
  absolutePlayPath,
13208
13588
  options.profile,
13209
- _chunkSEFMGO3Zjs.PLAY_DEFAULT_EXPORT,
13589
+ _chunkOQQOXSYAjs.PLAY_DEFAULT_EXPORT,
13210
13590
  { cache: !options.dryRun }
13211
13591
  )
13212
13592
  );
@@ -13219,10 +13599,22 @@ async function handleFileBackedRun(options, hooks) {
13219
13599
  );
13220
13600
  return 0;
13221
13601
  }
13222
- client = new (0, _chunkV76R6HMVjs.DeeplineClient)(playRunClientOptions(options));
13602
+ client = new (0, _chunk63S7X326js.DeeplineClient)(playRunClientOptions(options));
13603
+ if (cliAdmission && (graph.root.importedPlayDependencies.length > 0 || inputContainsLocalFilePath(runtimeInput))) {
13604
+ await _chunkVK2LZ5IPjs.checkPlayRunCompatibility.call(void 0,
13605
+ client.baseUrl,
13606
+ options.maintenancePolicy
13607
+ );
13608
+ cliAdmission = false;
13609
+ }
13610
+ await preflightPlayRunTotalBudget({
13611
+ client,
13612
+ playName: _nullishCoalesce(graph.root.playName, () => ( extractPlayName(sourceCode, absolutePlayPath))),
13613
+ maxTotalCredits: options.maxTotalCredits
13614
+ });
13223
13615
  const canDeferCompilerManifest = graph.root.importedPlayDependencies.length === 0 && !sourceGraphMentionsRunPlay(graph.root) && !inputContainsLocalFilePath(runtimeInput);
13224
13616
  if (canDeferCompilerManifest) {
13225
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
13617
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
13226
13618
  phase: "cli.play_file_compile_manifests",
13227
13619
  ms: 0,
13228
13620
  ok: true,
@@ -13231,7 +13623,7 @@ async function handleFileBackedRun(options, hooks) {
13231
13623
  reason: "validated_by_run_route"
13232
13624
  });
13233
13625
  } else {
13234
- await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13626
+ await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13235
13627
  "cli.play_file_compile_manifests",
13236
13628
  { targetKind: "file", skipped: false },
13237
13629
  () => compileBundledPlayGraphManifests(client, graph)
@@ -13255,7 +13647,7 @@ async function handleFileBackedRun(options, hooks) {
13255
13647
  _chunkGEJDBXXMjs.planLocalPlayExecution.call(void 0, graph, { runIdFile: options.runIdFile })
13256
13648
  );
13257
13649
  progress.phase("pinning imported plays");
13258
- graph = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13650
+ graph = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13259
13651
  "cli.play_file_pin_imports",
13260
13652
  { targetKind: "file" },
13261
13653
  () => _chunkGEJDBXXMjs.pinLocalPlayImports.call(void 0, client, graph)
@@ -13271,10 +13663,10 @@ async function handleFileBackedRun(options, hooks) {
13271
13663
  (file) => stageFile(file.logicalPath, file.absolutePath)
13272
13664
  );
13273
13665
  const compilerManifest = _nullishCoalesce(bundleResult.compilerManifest, () => ( null));
13274
- const fileInputBindings = _chunkUHNDVD3Pjs.fileInputBindingsFromStaticPipeline.call(void 0,
13275
- _optionalChain([compilerManifest, 'optionalAccess', _455 => _455.staticPipeline])
13666
+ const fileInputBindings = _chunk2H4EY7KHjs.fileInputBindingsFromStaticPipeline.call(void 0,
13667
+ _optionalChain([compilerManifest, 'optionalAccess', _471 => _471.staticPipeline])
13276
13668
  );
13277
- const stagedFileInputs = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13669
+ const stagedFileInputs = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13278
13670
  "cli.play_stage_inputs",
13279
13671
  {
13280
13672
  targetKind: "file",
@@ -13321,10 +13713,10 @@ async function handleFileBackedRun(options, hooks) {
13321
13713
  };
13322
13714
  if (options.watch) {
13323
13715
  progress.phase("starting run");
13324
- const finalStatus = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13716
+ const finalStatus = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13325
13717
  "cli.play_start_watch",
13326
13718
  { targetKind: "file", playName },
13327
- () => startAndWaitForPlayCompletionByStream({
13719
+ () => (options.runIdFile || cliAdmission ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
13328
13720
  client,
13329
13721
  request: startRequest,
13330
13722
  playName,
@@ -13335,9 +13727,15 @@ async function handleFileBackedRun(options, hooks) {
13335
13727
  waitTimeoutMs: options.waitTimeoutMs,
13336
13728
  open: options.open,
13337
13729
  progress,
13338
- onRunStarted: _optionalChain([hooks, 'optionalAccess', _456 => _456.onRunStarted]),
13339
- onSubmission: _optionalChain([hooks, 'optionalAccess', _457 => _457.onSubmission]),
13340
- onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _458 => _458.onRunAdmitted])
13730
+ onRunStarted: _optionalChain([hooks, 'optionalAccess', _472 => _472.onRunStarted]),
13731
+ onSubmission: _optionalChain([hooks, 'optionalAccess', _473 => _473.onSubmission]),
13732
+ onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _474 => _474.onRunAdmitted]),
13733
+ maintenancePolicy: options.maintenancePolicy,
13734
+ ...options.runIdFile ? {} : { fullJson: options.fullJson },
13735
+ ...cliAdmission ? {
13736
+ cliAdmission: true,
13737
+ streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
13738
+ } : {}
13341
13739
  }).catch(async (error) => {
13342
13740
  throw await normalizePlayStartError(client, error, playName);
13343
13741
  })
@@ -13349,17 +13747,17 @@ async function handleFileBackedRun(options, hooks) {
13349
13747
  }
13350
13748
  const outputStatus = withOrdinaryRunAgainCommand(
13351
13749
  withTerminalPlayIdentity(
13352
- await resolvePlayRunOutputStatus({
13750
+ options.runIdFile ? await resolvePlayRunOutputStatus({
13353
13751
  client,
13354
13752
  status: finalStatus,
13355
13753
  fullJson: options.fullJson,
13356
13754
  jsonOutput: options.jsonOutput
13357
- }),
13755
+ }) : finalStatus,
13358
13756
  playName
13359
13757
  ),
13360
13758
  options
13361
13759
  );
13362
- _optionalChain([hooks, 'optionalAccess', _459 => _459.onTerminalStatus, 'optionalCall', _460 => _460(outputStatus)]);
13760
+ _optionalChain([hooks, 'optionalAccess', _475 => _475.onTerminalStatus, 'optionalCall', _476 => _476(outputStatus)]);
13363
13761
  traceCliSync(
13364
13762
  "cli.play_write_result",
13365
13763
  { targetKind: "file", playName },
@@ -13371,15 +13769,15 @@ async function handleFileBackedRun(options, hooks) {
13371
13769
  return outputStatus.status === "completed" ? 0 : 1;
13372
13770
  }
13373
13771
  progress.phase("starting run");
13374
- const started = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13772
+ const started = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13375
13773
  "cli.play_start_unwatched",
13376
13774
  { targetKind: "file", playName },
13377
- () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _461 => _461.onSubmission]) }).catch(async (error) => {
13775
+ () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _477 => _477.onSubmission]) }).catch(async (error) => {
13378
13776
  throw await normalizePlayStartError(client, error, playName);
13379
13777
  })
13380
13778
  );
13381
- await _optionalChain([hooks, 'optionalAccess', _462 => _462.onRunStarted, 'optionalCall', _463 => _463(started.workflowId)]);
13382
- await _optionalChain([hooks, 'optionalAccess', _464 => _464.onRunAdmitted, 'optionalCall', _465 => _465(started.workflowId)]);
13779
+ await _optionalChain([hooks, 'optionalAccess', _478 => _478.onRunStarted, 'optionalCall', _479 => _479(started.workflowId)]);
13780
+ await _optionalChain([hooks, 'optionalAccess', _480 => _480.onRunAdmitted, 'optionalCall', _481 => _481(started.workflowId)]);
13383
13781
  const resolvedDashboardUrl = _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, playName);
13384
13782
  openPlayDashboard(resolvedDashboardUrl, options.open);
13385
13783
  progress.phase("started run");
@@ -13407,7 +13805,7 @@ async function resolveNamedRunRevisionId(input) {
13407
13805
  if (input.selector === "latest") {
13408
13806
  const versions = await input.client.listPlayVersions(input.playName);
13409
13807
  const latest = versions[0];
13410
- if (!_optionalChain([latest, 'optionalAccess', _466 => _466._id])) {
13808
+ if (!_optionalChain([latest, 'optionalAccess', _482 => _482._id])) {
13411
13809
  throw new Error(`No saved revisions found for ${input.playName}.`);
13412
13810
  }
13413
13811
  return latest._id;
@@ -13418,8 +13816,12 @@ async function handleNamedRun(options, hooks) {
13418
13816
  if (options.target.kind !== "name") {
13419
13817
  throw new Error("Expected a named play run target.");
13420
13818
  }
13421
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)(playRunClientOptions(options));
13422
- const progress = _nullishCoalesce(_chunkALD4COBHjs.getActiveCliProgress.call(void 0, ), () => ( _chunkALD4COBHjs.createCliProgress.call(void 0, !options.jsonOutput)));
13819
+ const client = new (0, _chunk63S7X326js.DeeplineClient)(playRunClientOptions(options));
13820
+ let cliAdmission = _chunkVK2LZ5IPjs.usesInlinePlayAdmission.call(void 0,
13821
+ "plays run",
13822
+ process.argv.slice(2)
13823
+ );
13824
+ const progress = _nullishCoalesce(_chunkLTFL4JRNjs.getActiveCliProgress.call(void 0, ), () => ( _chunkLTFL4JRNjs.createCliProgress.call(void 0, !options.jsonOutput)));
13423
13825
  const playName = options.target.name;
13424
13826
  const runtimeInput = options.input ? { ...options.input } : {};
13425
13827
  try {
@@ -13434,14 +13836,14 @@ async function handleNamedRun(options, hooks) {
13434
13836
  });
13435
13837
  const playDetail = needsPlayDefinition ? await (async () => {
13436
13838
  progress.phase("loading play definition");
13437
- return _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13839
+ return _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13438
13840
  "cli.play_load_definition",
13439
13841
  { targetKind: "name", playName, skipped: false },
13440
13842
  () => assertCanonicalNamedPlayReference(client, playName, {
13441
13843
  command: "run"
13442
13844
  })
13443
13845
  );
13444
- })() : (_chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
13846
+ })() : (_chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
13445
13847
  phase: "cli.play_load_definition",
13446
13848
  ms: 0,
13447
13849
  ok: true,
@@ -13450,7 +13852,7 @@ async function handleNamedRun(options, hooks) {
13450
13852
  skipped: true
13451
13853
  }), null);
13452
13854
  progress.phase("selecting revision");
13453
- const selectedRevisionId = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13855
+ const selectedRevisionId = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13454
13856
  "cli.play_select_revision",
13455
13857
  {
13456
13858
  targetKind: "name",
@@ -13465,11 +13867,20 @@ async function handleNamedRun(options, hooks) {
13465
13867
  selector: options.revisionSelector
13466
13868
  })
13467
13869
  );
13870
+ await preflightPlayRunTotalBudget({
13871
+ client,
13872
+ playName,
13873
+ maxTotalCredits: options.maxTotalCredits
13874
+ });
13468
13875
  const fileInputBindings = playDetail ? [
13469
- ..._chunkUHNDVD3Pjs.fileInputBindingsFromPlaySchema.call(void 0, playDetail.play.inputSchema),
13470
- ..._chunkUHNDVD3Pjs.fileInputBindingsFromStaticPipeline.call(void 0, playDetail.play.staticPipeline)
13876
+ ..._chunk2H4EY7KHjs.fileInputBindingsFromPlaySchema.call(void 0, playDetail.play.inputSchema),
13877
+ ..._chunk2H4EY7KHjs.fileInputBindingsFromStaticPipeline.call(void 0, playDetail.play.staticPipeline)
13471
13878
  ] : [];
13472
- const stagedFileInputs = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13879
+ if (cliAdmission && fileInputBindings.length > 0) {
13880
+ await _chunkVK2LZ5IPjs.checkPlayRunCompatibility.call(void 0, client.baseUrl, options.maintenancePolicy);
13881
+ cliAdmission = false;
13882
+ }
13883
+ const stagedFileInputs = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13473
13884
  "cli.play_stage_inputs",
13474
13885
  {
13475
13886
  targetKind: "name",
@@ -13492,7 +13903,7 @@ async function handleNamedRun(options, hooks) {
13492
13903
  const testPolicyOverrides = {
13493
13904
  ...options.debugMapLatency ? { mapLatencyProfile: true } : {}
13494
13905
  };
13495
- const startRequest = _chunkUHNDVD3Pjs.buildNamedPlayRunRequest.call(void 0, {
13906
+ const startRequest = _chunk2H4EY7KHjs.buildNamedPlayRunRequest.call(void 0, {
13496
13907
  name: playName,
13497
13908
  revisionId: selectedRevisionId,
13498
13909
  runtimeInput,
@@ -13513,10 +13924,10 @@ async function handleNamedRun(options, hooks) {
13513
13924
  });
13514
13925
  if (options.watch) {
13515
13926
  progress.phase("starting run");
13516
- const finalStatus = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13927
+ const finalStatus = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13517
13928
  "cli.play_start_watch",
13518
13929
  { targetKind: "name", playName },
13519
- () => startAndWaitForPlayCompletionByStream({
13930
+ () => (options.runIdFile || cliAdmission ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
13520
13931
  client,
13521
13932
  request: startRequest,
13522
13933
  playName,
@@ -13527,9 +13938,15 @@ async function handleNamedRun(options, hooks) {
13527
13938
  waitTimeoutMs: options.waitTimeoutMs,
13528
13939
  open: options.open,
13529
13940
  progress,
13530
- onRunStarted: _optionalChain([hooks, 'optionalAccess', _467 => _467.onRunStarted]),
13531
- onSubmission: _optionalChain([hooks, 'optionalAccess', _468 => _468.onSubmission]),
13532
- onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _469 => _469.onRunAdmitted])
13941
+ onRunStarted: _optionalChain([hooks, 'optionalAccess', _483 => _483.onRunStarted]),
13942
+ onSubmission: _optionalChain([hooks, 'optionalAccess', _484 => _484.onSubmission]),
13943
+ onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _485 => _485.onRunAdmitted]),
13944
+ maintenancePolicy: options.maintenancePolicy,
13945
+ ...options.runIdFile ? {} : { fullJson: options.fullJson },
13946
+ ...cliAdmission ? {
13947
+ cliAdmission: true,
13948
+ streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
13949
+ } : {}
13533
13950
  }).catch(async (error) => {
13534
13951
  throw await normalizePlayStartError(client, error, playName, {
13535
13952
  suggestMissingPlay: true
@@ -13543,18 +13960,18 @@ async function handleNamedRun(options, hooks) {
13543
13960
  }
13544
13961
  const outputStatus = withOrdinaryRunAgainCommand(
13545
13962
  withTerminalPlayIdentity(
13546
- await resolvePlayRunOutputStatus({
13963
+ options.runIdFile ? await resolvePlayRunOutputStatus({
13547
13964
  client,
13548
13965
  status: finalStatus,
13549
13966
  fullJson: options.fullJson,
13550
13967
  jsonOutput: options.jsonOutput
13551
- }),
13968
+ }) : finalStatus,
13552
13969
  playName
13553
13970
  ),
13554
13971
  options,
13555
13972
  _nullishCoalesce(finalStatus.revisionId, () => ( selectedRevisionId))
13556
13973
  );
13557
- _optionalChain([hooks, 'optionalAccess', _470 => _470.onTerminalStatus, 'optionalCall', _471 => _471(outputStatus)]);
13974
+ _optionalChain([hooks, 'optionalAccess', _486 => _486.onTerminalStatus, 'optionalCall', _487 => _487(outputStatus)]);
13558
13975
  traceCliSync(
13559
13976
  "cli.play_write_result",
13560
13977
  { targetKind: "name", playName },
@@ -13566,17 +13983,17 @@ async function handleNamedRun(options, hooks) {
13566
13983
  return outputStatus.status === "completed" ? 0 : 1;
13567
13984
  }
13568
13985
  progress.phase("starting run");
13569
- const started = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
13986
+ const started = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
13570
13987
  "cli.play_start_unwatched",
13571
13988
  { targetKind: "name", playName },
13572
- () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _472 => _472.onSubmission]) }).catch(async (error) => {
13989
+ () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _488 => _488.onSubmission]) }).catch(async (error) => {
13573
13990
  throw await normalizePlayStartError(client, error, playName, {
13574
13991
  suggestMissingPlay: true
13575
13992
  });
13576
13993
  })
13577
13994
  );
13578
- await _optionalChain([hooks, 'optionalAccess', _473 => _473.onRunStarted, 'optionalCall', _474 => _474(started.workflowId)]);
13579
- await _optionalChain([hooks, 'optionalAccess', _475 => _475.onRunAdmitted, 'optionalCall', _476 => _476(started.workflowId)]);
13995
+ await _optionalChain([hooks, 'optionalAccess', _489 => _489.onRunStarted, 'optionalCall', _490 => _490(started.workflowId)]);
13996
+ await _optionalChain([hooks, 'optionalAccess', _491 => _491.onRunAdmitted, 'optionalCall', _492 => _492(started.workflowId)]);
13580
13997
  const resolvedDashboardUrl = _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, playName);
13581
13998
  openPlayDashboard(resolvedDashboardUrl, options.open);
13582
13999
  progress.phase("started run");
@@ -13615,7 +14032,7 @@ async function handlePlayRun(args, hooks) {
13615
14032
  JSON.stringify({
13616
14033
  version: 1,
13617
14034
  admissionState: "submitted_unknown",
13618
- baseUrl: new (0, _chunkV76R6HMVjs.DeeplineClient)().baseUrl,
14035
+ baseUrl: new (0, _chunk63S7X326js.DeeplineClient)().baseUrl,
13619
14036
  ...intent
13620
14037
  })
13621
14038
  );
@@ -13627,7 +14044,7 @@ async function handlePlayRun(args, hooks) {
13627
14044
  } finally {
13628
14045
  await removeRunIdTempFile(tempPath);
13629
14046
  }
13630
- await _optionalChain([hooks, 'optionalAccess', _477 => _477.onSubmission, 'optionalCall', _478 => _478(intent)]);
14047
+ await _optionalChain([hooks, 'optionalAccess', _493 => _493.onSubmission, 'optionalCall', _494 => _494(intent)]);
13631
14048
  },
13632
14049
  onRunStarted: async (runId) => {
13633
14050
  try {
@@ -13638,7 +14055,7 @@ async function handlePlayRun(args, hooks) {
13638
14055
  { cause: error }
13639
14056
  );
13640
14057
  }
13641
- await _optionalChain([hooks, 'optionalAccess', _479 => _479.onRunStarted, 'optionalCall', _480 => _480(runId)]);
14058
+ await _optionalChain([hooks, 'optionalAccess', _495 => _495.onRunStarted, 'optionalCall', _496 => _496(runId)]);
13642
14059
  },
13643
14060
  onRunAdmitted: async (runId) => {
13644
14061
  try {
@@ -13651,7 +14068,7 @@ async function handlePlayRun(args, hooks) {
13651
14068
  { cause: error }
13652
14069
  );
13653
14070
  }
13654
- await _optionalChain([hooks, 'optionalAccess', _481 => _481.onRunAdmitted, 'optionalCall', _482 => _482(runId)]);
14071
+ await _optionalChain([hooks, 'optionalAccess', _497 => _497.onRunAdmitted, 'optionalCall', _498 => _498(runId)]);
13655
14072
  }
13656
14073
  } : hooks;
13657
14074
  if (options.target.kind === "file") {
@@ -13698,7 +14115,7 @@ function parseRunIdPositional(args, usage2) {
13698
14115
  return arg;
13699
14116
  }
13700
14117
  }
13701
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(usage2);
14118
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(usage2);
13702
14119
  }
13703
14120
  function formatRunFactLines(value) {
13704
14121
  if (Array.isArray(value)) return value.flatMap(formatRunFactLines);
@@ -13730,10 +14147,10 @@ function renderRunOverviewText(overview, extras = {}) {
13730
14147
  ...buildRunActivityTextLines(run),
13731
14148
  ...buildRunStatusEvidenceTextLines(overview)
13732
14149
  ];
13733
- if (_optionalChain([overview, 'access', _483 => _483.runStatus, 'optionalAccess', _484 => _484.available]) === false)
14150
+ if (_optionalChain([overview, 'access', _499 => _499.runStatus, 'optionalAccess', _500 => _500.available]) === false)
13734
14151
  lines.push(` call progress: unavailable (${overview.runStatus.reason})`);
13735
- const work = readRecord(_optionalChain([readRecord, 'call', _485 => _485(run), 'optionalAccess', _486 => _486.work]));
13736
- if (work && !_optionalChain([overview, 'access', _487 => _487.runStatus, 'optionalAccess', _488 => _488.available]))
14152
+ const work = readRecord(_optionalChain([readRecord, 'call', _501 => _501(run), 'optionalAccess', _502 => _502.work]));
14153
+ if (work && !_optionalChain([overview, 'access', _503 => _503.runStatus, 'optionalAccess', _504 => _504.available]))
13737
14154
  lines.push(
13738
14155
  ` calls (${_nullishCoalesce(work.scope, () => ( "attempt scope unknown"))}): ${formatObservedRunCounter({ value: work.logicalCalls, confirmed: true })} logical, ${formatObservedRunCounter({ value: work.providerRequests, confirmed: true })} provider requests`
13739
14156
  );
@@ -13784,7 +14201,7 @@ function renderRunOverviewText(overview, extras = {}) {
13784
14201
  ...overview.failedLogs.warning ? [`warning: ${overview.failedLogs.warning}`] : [],
13785
14202
  ...overview.failedLogs.logsTruncated ? ["Older log bodies were not retained."] : [],
13786
14203
  ...overview.failedLogs.entries,
13787
- ..._optionalChain([overview, 'access', _489 => _489.failedLogs, 'access', _490 => _490.next, 'optionalAccess', _491 => _491.logs]) ? [`More logs: ${overview.failedLogs.next.logs}`] : []
14204
+ ..._optionalChain([overview, 'access', _505 => _505.failedLogs, 'access', _506 => _506.next, 'optionalAccess', _507 => _507.logs]) ? [`More logs: ${overview.failedLogs.next.logs}`] : []
13788
14205
  ]
13789
14206
  });
13790
14207
  sections.push({
@@ -13844,7 +14261,7 @@ function renderRunOverviewText(overview, extras = {}) {
13844
14261
  );
13845
14262
  return `${lines.join("\n")}
13846
14263
 
13847
- ${_chunkYD7B53RWjs.renderCommandEnvelopeText.call(void 0, { render: { sections, actions: actions2 } })}`;
14264
+ ${_chunkNF4V5DTYjs.renderCommandEnvelopeText.call(void 0, { render: { sections, actions: actions2 } })}`;
13848
14265
  }
13849
14266
  var RUN_READ_TIMING_PROGRESS_INTERVAL_MS = 15e3;
13850
14267
  async function withRunReadTiming(command, stage, enabled, action) {
@@ -13855,7 +14272,7 @@ async function withRunReadTiming(command, stage, enabled, action) {
13855
14272
  const progressTimer = setInterval(() => {
13856
14273
  console.error(`[${command}] ${stage} still running after ${elapsedMs()}ms`);
13857
14274
  }, RUN_READ_TIMING_PROGRESS_INTERVAL_MS);
13858
- _optionalChain([progressTimer, 'access', _492 => _492.unref, 'optionalCall', _493 => _493()]);
14275
+ _optionalChain([progressTimer, 'access', _508 => _508.unref, 'optionalCall', _509 => _509()]);
13859
14276
  try {
13860
14277
  const result = await action();
13861
14278
  console.error(`[${command}] ${stage} completed in ${elapsedMs()}ms`);
@@ -13868,7 +14285,7 @@ async function withRunReadTiming(command, stage, enabled, action) {
13868
14285
  }
13869
14286
  }
13870
14287
  async function handleRunGet(args) {
13871
- const selection = _chunkYD7B53RWjs.parseJsonFields.call(void 0,
14288
+ const selection = _chunkNF4V5DTYjs.parseJsonFields.call(void 0,
13872
14289
  args,
13873
14290
  args.includes("--config") ? "config" : "get"
13874
14291
  );
@@ -13881,7 +14298,7 @@ async function handleRunGet(args) {
13881
14298
  console.error(error instanceof Error ? error.message : usage2);
13882
14299
  return 1;
13883
14300
  }
13884
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
14301
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
13885
14302
  const timing = args.includes("--timing");
13886
14303
  if (args.includes("--web-url")) {
13887
14304
  const status2 = await withRunReadTiming(
@@ -13896,7 +14313,7 @@ async function handleRunGet(args) {
13896
14313
  return 1;
13897
14314
  }
13898
14315
  const dashboardUrl2 = _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, playName2);
13899
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14316
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
13900
14317
  { dashboardUrl: dashboardUrl2 },
13901
14318
  { json: args.includes("--json"), text: `${dashboardUrl2}
13902
14319
  ` }
@@ -13921,7 +14338,7 @@ async function handleRunGet(args) {
13921
14338
  "This server does not support recorded configuration reads."
13922
14339
  );
13923
14340
  }
13924
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14341
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
13925
14342
  { runId, contract: _nullishCoalesce(status2.contract, () => ( null)) },
13926
14343
  { json: true, fields: selection.fields }
13927
14344
  );
@@ -13934,7 +14351,7 @@ async function handleRunGet(args) {
13934
14351
  timing,
13935
14352
  () => client.getRunInput(runId)
13936
14353
  );
13937
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, input, { json: true });
14354
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, input, { json: true });
13938
14355
  return 0;
13939
14356
  }
13940
14357
  const full = args.includes("--full");
@@ -13947,7 +14364,7 @@ async function handleRunGet(args) {
13947
14364
  failedLogs: args.includes("--log-failed")
13948
14365
  })
13949
14366
  );
13950
- if (status.package) _chunkZAAKSJASjs.recordPlayTermination.call(void 0, buildRunOverview(status).run);
14367
+ if (status.package) _chunk27GJKC5Qjs.recordPlayTermination.call(void 0, buildRunOverview(status).run);
13951
14368
  if (!status.package) {
13952
14369
  const legacyStatus = full ? await withRunReadTiming(
13953
14370
  "runs get",
@@ -13960,8 +14377,8 @@ async function handleRunGet(args) {
13960
14377
  ) : status;
13961
14378
  const legacyPlayName = resolveRunPlayName(legacyStatus, runId);
13962
14379
  const legacyDashboardUrl = legacyPlayName ? _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, legacyPlayName) : null;
13963
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
13964
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14380
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
14381
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
13965
14382
  {
13966
14383
  ...full ? legacyStatus : compactPlayStatus(legacyStatus),
13967
14384
  ...legacyDashboardUrl ? { dashboardUrl: legacyDashboardUrl } : {}
@@ -13971,7 +14388,7 @@ async function handleRunGet(args) {
13971
14388
  } else {
13972
14389
  writePlayResult(legacyStatus, false, { fullJson: full });
13973
14390
  if (legacyDashboardUrl)
13974
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14391
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
13975
14392
  { dashboardUrl: legacyDashboardUrl },
13976
14393
  { json: false, text: `play page: ${legacyDashboardUrl}
13977
14394
  ` }
@@ -14001,10 +14418,10 @@ async function handleRunGet(args) {
14001
14418
  )
14002
14419
  ]);
14003
14420
  const hitLines = formatRunHitsLines(hits);
14004
- const json = _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
14421
+ const json = _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
14005
14422
  const playName = resolveRunPlayName(status, runId);
14006
14423
  const dashboardUrl = playName ? _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, client.baseUrl, playName) : void 0;
14007
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14424
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14008
14425
  {
14009
14426
  ...overview,
14010
14427
  ...dashboardUrl ? { dashboardUrl } : {},
@@ -14108,9 +14525,9 @@ async function handleRunLifecycleStatus(args) {
14108
14525
  console.error(error instanceof Error ? error.message : usage2);
14109
14526
  return 1;
14110
14527
  }
14111
- const status = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.status(runId);
14112
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
14113
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, status, { json: true });
14528
+ const status = await new (0, _chunk63S7X326js.DeeplineClient)().runs.status(runId);
14529
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
14530
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, status, { json: true });
14114
14531
  return 0;
14115
14532
  }
14116
14533
  if (!status.available) {
@@ -14150,7 +14567,7 @@ async function handleRunsRerun(args) {
14150
14567
  console.error(error instanceof Error ? error.message : usage2);
14151
14568
  return 1;
14152
14569
  }
14153
- const options = { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) };
14570
+ const options = { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) };
14154
14571
  for (let index = 0; index < args.length; index += 1) {
14155
14572
  if (args[index] === "--idempotency-key") {
14156
14573
  options.idempotencyKey = _nullishCoalesce(args[++index], () => ( ""));
@@ -14216,8 +14633,8 @@ ${usage2}
14216
14633
  Discover Plays: ${next.discover}
14217
14634
  Active runs: ${next.running}`
14218
14635
  );
14219
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
14220
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14636
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
14637
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14221
14638
  { ok: false, exitCode: 1, code: "RUN_FILTER_REQUIRED", message, next },
14222
14639
  { json: true }
14223
14640
  );
@@ -14232,7 +14649,7 @@ Active runs: ${next.running}`
14232
14649
  console.error("--offset requires --play.");
14233
14650
  return 1;
14234
14651
  }
14235
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
14652
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14236
14653
  const page = await withRunReadTiming(
14237
14654
  "runs list",
14238
14655
  "run inventory",
@@ -14267,7 +14684,7 @@ Active runs: ${next.running}`
14267
14684
  executionTime: run.executionTime,
14268
14685
  billingTotalCredits: run.billingTotalCredits,
14269
14686
  billingMaxCreditsPerRun: run.billingMaxCreditsPerRun,
14270
- playName: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(run.playName, () => ( _optionalChain([run, 'access', _494 => _494.memo, 'optionalAccess', _495 => _495.playName]))), () => ( playName)), () => ( null)),
14687
+ playName: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(run.playName, () => ( _optionalChain([run, 'access', _510 => _510.memo, 'optionalAccess', _511 => _511.playName]))), () => ( playName)), () => ( null)),
14271
14688
  ...nodeId ? { nodeObservation: _nullishCoalesce(run.nodeObservation, () => ( null)) } : {}
14272
14689
  }));
14273
14690
  const lines = runs.length === 0 ? [
@@ -14299,14 +14716,14 @@ Active runs: ${next.running}`
14299
14716
  return lines2.join("\n");
14300
14717
  });
14301
14718
  const nextOffset = (_nullishCoalesce(_nullishCoalesce(page.offset, () => ( offset)), () => ( 0))) + runs.length;
14302
- const nextPage = page.hasMore && playName ? `deepline runs list --play ${_chunkAID3OYVJjs.shellQuote.call(void 0, playName)}${statusFilter ? ` --status ${_chunkAID3OYVJjs.shellQuote.call(void 0, statusFilter)}` : ""} --limit ${_nullishCoalesce(_nullishCoalesce(page.limit, () => ( limit)), () => ( 20))} --offset ${nextOffset}` : null;
14719
+ const nextPage = page.hasMore && playName ? `deepline runs list --play ${_chunkAID3OYVJjs.shellQuote.call(void 0, playName)}${nodeId ? ` --node ${_chunkAID3OYVJjs.shellQuote.call(void 0, nodeId)}` : ""}${statusFilter ? ` --status ${_chunkAID3OYVJjs.shellQuote.call(void 0, statusFilter)}` : ""} --limit ${_nullishCoalesce(_nullishCoalesce(page.limit, () => ( limit)), () => ( 20))} --offset ${nextOffset}${_chunkNF4V5DTYjs.argsWantJson.call(void 0, args) ? " --json" : ""}` : null;
14303
14720
  if (page.hasMore) {
14304
14721
  lines.push("List truncated \u2014 more runs match this filter.");
14305
14722
  lines.push(
14306
14723
  nextPage ? `Next page: ${nextPage}` : "Narrow with --play <play-name> to page through runs."
14307
14724
  );
14308
14725
  }
14309
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14726
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14310
14727
  {
14311
14728
  runs,
14312
14729
  count: runs.length,
@@ -14316,11 +14733,11 @@ Active runs: ${next.running}`
14316
14733
  ...page.hasMore !== void 0 ? { has_more: page.hasMore, is_truncated: page.hasMore } : {},
14317
14734
  next: {
14318
14735
  page: nextPage,
14319
- get: _optionalChain([runs, 'access', _496 => _496[0], 'optionalAccess', _497 => _497.id]) ? `deepline runs get ${runs[0].id}` : null
14736
+ get: _optionalChain([runs, 'access', _512 => _512[0], 'optionalAccess', _513 => _513.id]) ? `deepline runs get ${runs[0].id}` : null
14320
14737
  },
14321
14738
  render: { sections: [{ title: "runs", lines }] }
14322
14739
  },
14323
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
14740
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
14324
14741
  );
14325
14742
  return 0;
14326
14743
  }
@@ -14350,7 +14767,7 @@ async function handleRunTail(args) {
14350
14767
  console.error("--log-level requires one of: debug, info, warn, error.");
14351
14768
  return 1;
14352
14769
  }
14353
- const parsed = _chunkV76R6HMVjs.parseLogLevel.call(void 0, value);
14770
+ const parsed = _chunk63S7X326js.parseLogLevel.call(void 0, value);
14354
14771
  if (!parsed) {
14355
14772
  console.error(
14356
14773
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -14388,9 +14805,9 @@ async function handleRunTail(args) {
14388
14805
  );
14389
14806
  return 1;
14390
14807
  }
14391
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
14808
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14392
14809
  const jsonLines = args.includes("--jsonl");
14393
- const jsonOutput = !jsonLines && _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
14810
+ const jsonOutput = !jsonLines && _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
14394
14811
  const compact = args.includes("--compact");
14395
14812
  const showLiveLogs = debug || hasExplicitLogLevel || !jsonOutput && !compact;
14396
14813
  const compactState = {
@@ -14471,7 +14888,7 @@ async function handleRunLogs(args) {
14471
14888
  ]);
14472
14889
  const cursorIndex = args.indexOf("--cursor");
14473
14890
  const cursorValue = cursorIndex >= 0 ? args[cursorIndex + 1] : void 0;
14474
- const continuesEventSearch = cursorIndex >= 0 && !(cursorValue && _chunkV76R6HMVjs.isRunLogsCursor.call(void 0, cursorValue));
14891
+ const continuesEventSearch = cursorIndex >= 0 && !(cursorValue && _chunk63S7X326js.isRunLogsCursor.call(void 0, cursorValue));
14475
14892
  if (!args[0] || args[0].startsWith("--") || continuesEventSearch || args.some((arg) => searchFlags.has(arg))) {
14476
14893
  return handleRunEventSearch(args);
14477
14894
  }
@@ -14505,7 +14922,7 @@ async function handleRunLogs(args) {
14505
14922
  console.error("--log-level requires one of: debug, info, warn, error.");
14506
14923
  return 1;
14507
14924
  }
14508
- const parsed = _chunkV76R6HMVjs.parseLogLevel.call(void 0, value);
14925
+ const parsed = _chunk63S7X326js.parseLogLevel.call(void 0, value);
14509
14926
  if (!parsed) {
14510
14927
  console.error(
14511
14928
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -14552,12 +14969,12 @@ async function handleRunLogs(args) {
14552
14969
  );
14553
14970
  return 1;
14554
14971
  }
14555
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
14972
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14556
14973
  if (outPath) {
14557
14974
  const result2 = await client.runs.logs(runId, { all: true });
14558
- const logs = result2.entries.filter((line) => _chunkV76R6HMVjs.logLevelReaches.call(void 0, _chunkV76R6HMVjs.classifyLogLine.call(void 0, line).level, logLevel)).map((line) => _chunkV76R6HMVjs.classifyLogLine.call(void 0, line).line);
14975
+ const logs = result2.entries.filter((line) => _chunk63S7X326js.logLevelReaches.call(void 0, _chunk63S7X326js.classifyLogLine.call(void 0, line).level, logLevel)).map((line) => _chunk63S7X326js.classifyLogLine.call(void 0, line).line);
14559
14976
  _fs.writeFileSync.call(void 0, outPath, `${logs.join("\n")}${logs.length > 0 ? "\n" : ""}`);
14560
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
14977
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14561
14978
  {
14562
14979
  runId: result2.runId,
14563
14980
  log_path: outPath,
@@ -14580,7 +14997,7 @@ async function handleRunLogs(args) {
14580
14997
  ]
14581
14998
  }
14582
14999
  },
14583
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
15000
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
14584
15001
  );
14585
15002
  return 0;
14586
15003
  }
@@ -14611,7 +15028,7 @@ async function handleRunLogs(args) {
14611
15028
  }
14612
15029
  };
14613
15030
  const text = buildRunLogsText(filteredResult);
14614
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15031
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14615
15032
  {
14616
15033
  runId: result.runId,
14617
15034
  totalCount: result.totalCount,
@@ -14635,7 +15052,7 @@ async function handleRunLogs(args) {
14635
15052
  render: { sections: [{ title: "run logs", lines: entries }] }
14636
15053
  },
14637
15054
  {
14638
- json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args),
15055
+ json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args),
14639
15056
  text
14640
15057
  }
14641
15058
  );
@@ -14659,17 +15076,17 @@ function selectRunLogTailPage(result, logLevel, limit) {
14659
15076
  );
14660
15077
  }
14661
15078
  const matching = result.entries.map((line, index) => ({ line, seq: first + index })).filter(
14662
- (entry) => _chunkV76R6HMVjs.logLevelReaches.call(void 0, _chunkV76R6HMVjs.classifyLogLine.call(void 0, entry.line).level, logLevel)
15079
+ (entry) => _chunk63S7X326js.logLevelReaches.call(void 0, _chunk63S7X326js.classifyLogLine.call(void 0, entry.line).level, logLevel)
14663
15080
  );
14664
15081
  const selected = matching.slice(-limit);
14665
15082
  const olderMatchesExist = matching.length > selected.length;
14666
15083
  return {
14667
15084
  entries: selected.map((entry) => entry.line),
14668
- firstSequence: _nullishCoalesce(_optionalChain([selected, 'access', _498 => _498[0], 'optionalAccess', _499 => _499.seq]), () => ( null)),
14669
- lastSequence: _nullishCoalesce(_optionalChain([selected, 'access', _500 => _500.at, 'call', _501 => _501(-1), 'optionalAccess', _502 => _502.seq]), () => ( null)),
15085
+ firstSequence: _nullishCoalesce(_optionalChain([selected, 'access', _514 => _514[0], 'optionalAccess', _515 => _515.seq]), () => ( null)),
15086
+ lastSequence: _nullishCoalesce(_optionalChain([selected, 'access', _516 => _516.at, 'call', _517 => _517(-1), 'optionalAccess', _518 => _518.seq]), () => ( null)),
14670
15087
  truncated: result.truncated || olderMatchesExist,
14671
15088
  hasMore: olderMatchesExist,
14672
- nextCursor: olderMatchesExist ? _chunkV76R6HMVjs.encodeRunLogsCursor.call(void 0, selected[0].seq) : null
15089
+ nextCursor: olderMatchesExist ? _chunk63S7X326js.encodeRunLogsCursor.call(void 0, selected[0].seq) : null
14673
15090
  };
14674
15091
  }
14675
15092
  async function handleRunEventSearch(args) {
@@ -14736,7 +15153,7 @@ ${usage2}`);
14736
15153
  namespace,
14737
15154
  ...backend ? { backend } : {}
14738
15155
  } : void 0;
14739
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15156
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14740
15157
  const result = await client.runs.searchEvents({
14741
15158
  ...runId ? { runId } : {},
14742
15159
  ...values["--since"] ? { since: values["--since"] } : {},
@@ -14808,7 +15225,7 @@ ${renderedDetails}` : ""}`;
14808
15225
  "--limit",
14809
15226
  String(limit)
14810
15227
  ].join(" ") : null;
14811
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15228
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14812
15229
  {
14813
15230
  events,
14814
15231
  nextCursor: result.nextCursor,
@@ -14819,19 +15236,19 @@ ${renderedDetails}` : ""}`;
14819
15236
  render: { sections: [{ title: "runtime events", lines }] }
14820
15237
  },
14821
15238
  {
14822
- json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args),
15239
+ json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args),
14823
15240
  text: `${lines.join("\n")}${lines.length ? "\n" : ""}`
14824
15241
  }
14825
15242
  );
14826
15243
  return 0;
14827
15244
  }
14828
15245
  function buildRunLogsText(result) {
14829
- const lines = result.entries.map((line) => _chunkV76R6HMVjs.classifyLogLine.call(void 0, line).line);
15246
+ const lines = result.entries.map((line) => _chunk63S7X326js.classifyLogLine.call(void 0, line).line);
14830
15247
  if (result.warning) {
14831
15248
  if (lines.length > 0) lines.push("");
14832
15249
  lines.push(`warning: ${result.warning}`);
14833
15250
  lines.push(
14834
- `retained logs: ${_nullishCoalesce(_optionalChain([result, 'access', _503 => _503.next, 'optionalAccess', _504 => _504.logs]), () => ( `deepline runs logs ${result.runId} --out run.log`))}`
15251
+ `retained logs: ${_nullishCoalesce(_optionalChain([result, 'access', _519 => _519.next, 'optionalAccess', _520 => _520.logs]), () => ( `deepline runs logs ${result.runId} --out run.log`))}`
14835
15252
  );
14836
15253
  }
14837
15254
  return `${lines.join("\n")}${lines.length > 0 ? "\n" : ""}`;
@@ -14860,7 +15277,7 @@ async function handleRunStop(args) {
14860
15277
  reason = args[++index];
14861
15278
  }
14862
15279
  }
14863
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15280
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14864
15281
  const result = await client.runs.stop(runId, { reason });
14865
15282
  const state = resolveRunStopState(result);
14866
15283
  const hitlCleanupIncomplete = state === "cancelling" && result.hitlCancellationPending === true;
@@ -14875,7 +15292,7 @@ async function handleRunStop(args) {
14875
15292
  ...result.hitlCancelledCount > 0 ? [`cancelled HITL waits: ${result.hitlCancelledCount}`] : [],
14876
15293
  `inspect: deepline runs get ${runId} --full`
14877
15294
  ];
14878
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15295
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14879
15296
  {
14880
15297
  ...cancelling,
14881
15298
  state,
@@ -14890,7 +15307,7 @@ async function handleRunStop(args) {
14890
15307
  ]
14891
15308
  }
14892
15309
  },
14893
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
15310
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
14894
15311
  );
14895
15312
  return 0;
14896
15313
  }
@@ -14907,7 +15324,7 @@ async function handleRunStop(args) {
14907
15324
  ];
14908
15325
  process.stderr.write(`${lines2.join("\n")}
14909
15326
  `);
14910
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15327
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14911
15328
  {
14912
15329
  ...result,
14913
15330
  render: {
@@ -14922,7 +15339,7 @@ async function handleRunStop(args) {
14922
15339
  ]
14923
15340
  }
14924
15341
  },
14925
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
15342
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
14926
15343
  );
14927
15344
  return 1;
14928
15345
  }
@@ -14933,12 +15350,12 @@ async function handleRunStop(args) {
14933
15350
  `warning: HITL cancellation or Slack card refresh is still pending; retry 'deepline runs stop ${runId}'`
14934
15351
  ] : []
14935
15352
  ];
14936
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15353
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14937
15354
  {
14938
15355
  ...result,
14939
15356
  render: { sections: [{ title: "run stop", lines }] }
14940
15357
  },
14941
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
15358
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
14942
15359
  );
14943
15360
  return 0;
14944
15361
  }
@@ -14988,18 +15405,18 @@ async function handleRunStopAll(args) {
14988
15405
  reason = args[++index];
14989
15406
  }
14990
15407
  }
14991
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15408
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
14992
15409
  if (dryRun) {
14993
15410
  const result2 = await client.runs.stopAll({ dryRun: true, reason });
14994
15411
  const lines2 = buildStopAllDryRunTextLines(result2);
14995
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15412
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
14996
15413
  {
14997
15414
  ...result2,
14998
15415
  render: {
14999
15416
  sections: [{ title: "workspace stop-all (dry run)", lines: lines2 }]
15000
15417
  }
15001
15418
  },
15002
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args), text: `${lines2.join("\n")}
15419
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args), text: `${lines2.join("\n")}
15003
15420
  ` }
15004
15421
  );
15005
15422
  return 0;
@@ -15012,17 +15429,17 @@ async function handleRunStopAll(args) {
15012
15429
  ...result.failed > 0 ? [`failed stops: ${result.failed}`] : [],
15013
15430
  ...result.skipped > 0 ? [`skipped: ${result.skipped}`] : []
15014
15431
  ];
15015
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15432
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
15016
15433
  {
15017
15434
  ...result,
15018
15435
  render: { sections: [{ title: "workspace stop-all", lines }] }
15019
15436
  },
15020
- { json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args) }
15437
+ { json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args) }
15021
15438
  );
15022
15439
  return result.failed > 0 || result.partial ? 1 : 0;
15023
15440
  }
15024
15441
  async function handleRunExport(args) {
15025
- const selection = _chunkYD7B53RWjs.parseJsonFields.call(void 0, args, "export");
15442
+ const selection = _chunkNF4V5DTYjs.parseJsonFields.call(void 0, args, "export");
15026
15443
  args = selection.args;
15027
15444
  const usage2 = "Usage: deepline runs export <run-id> [--dataset result.rows] --out <path> [--format csv|json] [--wait] [--timeout-ms 300000] [--metadata-out export.json] [--allow-empty] [--json]";
15028
15445
  let runId;
@@ -15055,7 +15472,7 @@ async function handleRunExport(args) {
15055
15472
  if (arg === "--timeout-ms") {
15056
15473
  waitTimeoutMs = parsePositiveInteger2(_nullishCoalesce(args[++index], () => ( "")), arg);
15057
15474
  if (!wait) {
15058
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
15475
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
15059
15476
  "--timeout-ms requires --wait.",
15060
15477
  void 0,
15061
15478
  "INVALID_ARGUMENT"
@@ -15068,29 +15485,30 @@ async function handleRunExport(args) {
15068
15485
  return 1;
15069
15486
  }
15070
15487
  if (format !== "csv" && format !== "json") {
15071
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
15488
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
15072
15489
  "Invalid --format. Choose csv or json.",
15073
15490
  void 0,
15074
15491
  "INVALID_ARGUMENT"
15075
15492
  );
15076
15493
  }
15077
15494
  if (metadataOutPath === outPath) {
15078
- throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
15495
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
15079
15496
  "--metadata-out must differ from --out.",
15080
15497
  void 0,
15081
15498
  "INVALID_ARGUMENT"
15082
15499
  );
15083
15500
  }
15084
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15501
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15085
15502
  let status = await client.getPlayStatus(runId, { full: true });
15503
+ assertRunExportStatusIdentity(status, runId);
15086
15504
  if (wait && !TERMINAL_PLAY_STATUSES.has(status.status)) {
15087
- const progress = _chunkALD4COBHjs.createCliProgress.call(void 0, !_chunkYD7B53RWjs.argsWantJson.call(void 0, args));
15505
+ const progress = _chunkLTFL4JRNjs.createCliProgress.call(void 0, !_chunkNF4V5DTYjs.argsWantJson.call(void 0, args));
15088
15506
  try {
15089
15507
  await waitForPlayCompletionByWatch({
15090
15508
  client,
15091
15509
  playName: _nullishCoalesce(extractRunPlayName(status), () => ( runId)),
15092
15510
  workflowId: runId,
15093
- jsonOutput: _chunkYD7B53RWjs.argsWantJson.call(void 0, args),
15511
+ jsonOutput: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args),
15094
15512
  emitLogs: false,
15095
15513
  waitTimeoutMs,
15096
15514
  startedAt: Date.now(),
@@ -15103,6 +15521,7 @@ async function handleRunExport(args) {
15103
15521
  progress
15104
15522
  });
15105
15523
  status = await client.getPlayStatus(runId, { full: true });
15524
+ assertRunExportStatusIdentity(status, runId);
15106
15525
  progress.complete();
15107
15526
  } catch (error) {
15108
15527
  progress.fail();
@@ -15114,26 +15533,26 @@ async function handleRunExport(args) {
15114
15533
  allowEmpty: args.includes("--allow-empty"),
15115
15534
  format
15116
15535
  });
15117
- const source = _nullishCoalesce(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _505 => _505.rowsInfo, 'access', _506 => _506.source]), () => ( datasetPath)), () => ( null));
15118
- const currentTableNotice = _optionalChain([exportResult, 'optionalAccess', _507 => _507.currentTable]) ? {
15536
+ const source = _nullishCoalesce(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _521 => _521.rowsInfo, 'access', _522 => _522.source]), () => ( datasetPath)), () => ( null));
15537
+ const currentTableNotice = _optionalChain([exportResult, 'optionalAccess', _523 => _523.currentTable]) ? {
15119
15538
  code: "CURRENT_SHARED_DATASET",
15120
15539
  message: "This export is the current shared dataset and may include writes from another run.",
15121
15540
  full_run_output_command: `deepline runs get ${status.runId} --full`
15122
15541
  } : null;
15123
15542
  const navigation = buildRunNavigation(status);
15124
- const resolved = _optionalChain([exportResult, 'optionalAccess', _508 => _508.datasetInfo]);
15543
+ const resolved = _optionalChain([exportResult, 'optionalAccess', _524 => _524.datasetInfo]);
15125
15544
  const identity = navigation.datasets.find(
15126
- (dataset) => _optionalChain([resolved, 'optionalAccess', _509 => _509.datasetId]) ? dataset.datasetId === resolved.datasetId : dataset.name === _optionalChain([resolved, 'optionalAccess', _510 => _510.tableNamespace])
15545
+ (dataset) => _optionalChain([resolved, 'optionalAccess', _525 => _525.datasetId]) ? dataset.datasetId === resolved.datasetId : dataset.name === _optionalChain([resolved, 'optionalAccess', _526 => _526.tableNamespace])
15127
15546
  );
15128
15547
  const unambiguousName = identity && !identity.exportUnavailable && navigation.datasets.filter((dataset) => dataset.name === identity.name).length === 1 ? identity.name : void 0;
15129
15548
  const exportCommand = runExportRetryCommand(
15130
15549
  status.runId,
15131
15550
  outPath,
15132
- _nullishCoalesce(_nullishCoalesce(unambiguousName, () => ( datasetPath)), () => ( _optionalChain([exportResult, 'optionalAccess', _511 => _511.datasetPath]))),
15551
+ _nullishCoalesce(_nullishCoalesce(unambiguousName, () => ( datasetPath)), () => ( _optionalChain([exportResult, 'optionalAccess', _527 => _527.datasetPath]))),
15133
15552
  { format }
15134
15553
  ) + (args.includes("--allow-empty") ? " --allow-empty" : "");
15135
- const fileLocation = format === "json" ? { json_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _512 => _512.path]), () => ( null)) } : { csv_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _513 => _513.path]), () => ( null)) };
15136
- const exportedRowOutcomes = _optionalChain([exportResult, 'optionalAccess', _514 => _514.rowsInfo, 'access', _515 => _515.exportedRowOutcomes]);
15554
+ const fileLocation = format === "json" ? { json_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _528 => _528.path]), () => ( null)) } : { csv_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _529 => _529.path]), () => ( null)) };
15555
+ const exportedRowOutcomes = _optionalChain([exportResult, 'optionalAccess', _530 => _530.rowsInfo, 'access', _531 => _531.exportedRowOutcomes]);
15137
15556
  const rowFailures = exportedRowOutcomes && exportedRowOutcomes.failed > 0 ? {
15138
15557
  count: exportedRowOutcomes.failed,
15139
15558
  message: "Failed rows can retain values from stages that completed earlier; those values do not prove the row succeeded.",
@@ -15153,17 +15572,17 @@ async function handleRunExport(args) {
15153
15572
  ...fileLocation,
15154
15573
  format,
15155
15574
  source,
15156
- rowCount: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _516 => _516.rowsInfo, 'access', _517 => _517.totalRows]), () => ( null)),
15575
+ rowCount: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _532 => _532.rowsInfo, 'access', _533 => _533.totalRows]), () => ( null)),
15157
15576
  ...exportedRowOutcomes ? { rowOutcomes: exportedRowOutcomes } : {},
15158
15577
  ...rowFailures ? { rowFailures } : {},
15159
- columns: underscoreKeysLast(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _518 => _518.rowsInfo, 'access', _519 => _519.columns]), () => ( []))),
15578
+ columns: underscoreKeysLast(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _534 => _534.rowsInfo, 'access', _535 => _535.columns]), () => ( []))),
15160
15579
  ...currentTableNotice ? { notice: currentTableNotice } : {},
15161
15580
  ...metadataOutPath ? { metadata_path: metadataOutPath } : {},
15162
15581
  ...!TERMINAL_PLAY_STATUSES.has(status.status) ? { completionCommand: `${exportCommand} --wait` } : {}
15163
15582
  };
15164
15583
  const lines = withRunNavigationLines(
15165
15584
  [
15166
- `Exported ${status.runId} to ${_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _520 => _520.path]), () => ( outPath))}`,
15585
+ `Exported ${status.runId} to ${_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _536 => _536.path]), () => ( outPath))}`,
15167
15586
  ...!TERMINAL_PLAY_STATUSES.has(status.status) ? [
15168
15587
  `Partial export: run is ${status.status}; more rows may be saved.`,
15169
15588
  `Export after completion: ${exportCommand} --wait`
@@ -15190,14 +15609,27 @@ async function handleRunExport(args) {
15190
15609
  "utf-8"
15191
15610
  );
15192
15611
  }
15193
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, payload, {
15194
- json: _chunkYD7B53RWjs.argsWantJson.call(void 0, args),
15612
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, payload, {
15613
+ json: _chunkNF4V5DTYjs.argsWantJson.call(void 0, args),
15195
15614
  fields: selection.fields,
15196
15615
  text: `${lines.join("\n")}
15197
15616
  `
15198
15617
  });
15199
15618
  return 0;
15200
15619
  }
15620
+ function assertRunExportStatusIdentity(status, requestedRunId) {
15621
+ if (status.runId === requestedRunId) return;
15622
+ throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
15623
+ `Run status identity did not match requested run ${requestedRunId}; refusing to export rows for ${status.runId || "an unidentified run"}.`,
15624
+ void 0,
15625
+ "RUN_EXPORT_SCOPE_MISMATCH",
15626
+ {
15627
+ requestedRunId,
15628
+ statusRunId: status.runId || null,
15629
+ reason: "status_identity_mismatch"
15630
+ }
15631
+ );
15632
+ }
15201
15633
  async function handlePlayGet(args) {
15202
15634
  const target = args[0];
15203
15635
  if (!target) {
@@ -15212,10 +15644,10 @@ async function handlePlayGet(args) {
15212
15644
  );
15213
15645
  return 2;
15214
15646
  }
15215
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15647
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15216
15648
  const explicitJson = args.includes("--json");
15217
15649
  const sourceOutput = args.includes("--source");
15218
- const jsonOutput = sourceOutput ? explicitJson : _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
15650
+ const jsonOutput = sourceOutput ? explicitJson : _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
15219
15651
  const requestedRevisionFlags = [
15220
15652
  args.includes("--working"),
15221
15653
  args.includes("--live"),
@@ -15265,7 +15697,7 @@ async function handlePlayGet(args) {
15265
15697
  ...includeSource ? { source: sourceSelector } : {}
15266
15698
  });
15267
15699
  const source = detail.source;
15268
- const resolvedSource = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _521 => _521.files, 'access', _522 => _522[source.entryFile]]), () => ( ""));
15700
+ const resolvedSource = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _537 => _537.files, 'access', _538 => _538[source.entryFile]]), () => ( ""));
15269
15701
  let materializedFile = null;
15270
15702
  try {
15271
15703
  materializedFile = outPath && source ? materializeRemotePlaySource({ target, playName, source, outPath }) : null;
@@ -15275,7 +15707,7 @@ async function handlePlayGet(args) {
15275
15707
  }
15276
15708
  const loadedMessage = materializedFile ? formatLoadedPlayMessage(materializedFile) : null;
15277
15709
  if (jsonOutput) {
15278
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
15710
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
15279
15711
  ...detail,
15280
15712
  ...materializedFile ? {
15281
15713
  message: loadedMessage,
@@ -15316,16 +15748,16 @@ async function handlePlayGet(args) {
15316
15748
  }
15317
15749
  console.log(`Play: ${formatPlayReference(detail.play)}`);
15318
15750
  console.log(
15319
- `Working version: ${_nullishCoalesce(_optionalChain([detail, 'access', _523 => _523.play, 'access', _524 => _524.workingRevision, 'optionalAccess', _525 => _525.version]), () => ( "\u2014"))}`
15751
+ `Working version: ${_nullishCoalesce(_optionalChain([detail, 'access', _539 => _539.play, 'access', _540 => _540.workingRevision, 'optionalAccess', _541 => _541.version]), () => ( "\u2014"))}`
15320
15752
  );
15321
- console.log(`Live version: ${_nullishCoalesce(_optionalChain([detail, 'access', _526 => _526.play, 'access', _527 => _527.liveRevision, 'optionalAccess', _528 => _528.version]), () => ( "\u2014"))}`);
15753
+ console.log(`Live version: ${_nullishCoalesce(_optionalChain([detail, 'access', _542 => _542.play, 'access', _543 => _543.liveRevision, 'optionalAccess', _544 => _544.version]), () => ( "\u2014"))}`);
15322
15754
  if (detail.play.liveRevision) {
15323
15755
  console.log(
15324
15756
  `Live max credits per run: ${liveMaxCreditsPerRun(detail.play.liveRevision.sourceCode)}`
15325
15757
  );
15326
15758
  }
15327
15759
  console.log(`Draft dirty: ${detail.play.isDraftDirty ? "yes" : "no"}`);
15328
- if (detail.play.isDraftDirty && _optionalChain([detail, 'access', _529 => _529.play, 'access', _530 => _530.liveRevision, 'optionalAccess', _531 => _531.version])) {
15760
+ if (detail.play.isDraftDirty && _optionalChain([detail, 'access', _545 => _545.play, 'access', _546 => _546.liveRevision, 'optionalAccess', _547 => _547.version])) {
15329
15761
  console.log(
15330
15762
  ` Scheduled and named runs continue to use live v${detail.play.liveRevision.version}.`
15331
15763
  );
@@ -15337,7 +15769,7 @@ async function handlePlayGet(args) {
15337
15769
  console.log(line);
15338
15770
  }
15339
15771
  console.log(`Updated: ${formatTimestamp(detail.play.updatedAt)}`);
15340
- console.log(`Sheet rows: ${_nullishCoalesce(_optionalChain([detail, 'access', _532 => _532.sheetSummary, 'optionalAccess', _533 => _533.stats, 'optionalAccess', _534 => _534.total]), () => ( 0))}`);
15772
+ console.log(`Sheet rows: ${_nullishCoalesce(_optionalChain([detail, 'access', _548 => _548.sheetSummary, 'optionalAccess', _549 => _549.stats, 'optionalAccess', _550 => _550.total]), () => ( 0))}`);
15341
15773
  if (detail.customerDbUrl) {
15342
15774
  console.log(`Customer DB: ${detail.customerDbUrl}`);
15343
15775
  }
@@ -15353,7 +15785,7 @@ async function handlePlayGet(args) {
15353
15785
  return 0;
15354
15786
  }
15355
15787
  function formatVersionLine(version) {
15356
- const revisionLabel = _nullishCoalesce(_optionalChain([version, 'access', _535 => _535.artifactHash, 'optionalAccess', _536 => _536.slice, 'call', _537 => _537(0, 12)]), () => ( "unknown-revision"));
15788
+ const revisionLabel = _nullishCoalesce(_optionalChain([version, 'access', _551 => _551.artifactHash, 'optionalAccess', _552 => _552.slice, 'call', _553 => _553(0, 12)]), () => ( "unknown-revision"));
15357
15789
  const state = [
15358
15790
  version.isLive ? "live" : null,
15359
15791
  version.isWorking ? "working" : null
@@ -15367,8 +15799,8 @@ async function handlePlayVersions(args) {
15367
15799
  console.error("Usage: deepline plays versions --name <name> [--json]");
15368
15800
  return 1;
15369
15801
  }
15370
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15371
- const jsonOutput = _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
15802
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15803
+ const jsonOutput = _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
15372
15804
  await assertCanonicalNamedPlayReference(client, playName, {
15373
15805
  command: "versions"
15374
15806
  });
@@ -15376,7 +15808,7 @@ async function handlePlayVersions(args) {
15376
15808
  parseReferencedPlayTarget2(playName).playName
15377
15809
  );
15378
15810
  if (jsonOutput) {
15379
- _chunkYD7B53RWjs.printCompactJson.call(void 0, { versions });
15811
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, { versions });
15380
15812
  return 0;
15381
15813
  }
15382
15814
  if (versions.length === 0) {
@@ -15389,7 +15821,7 @@ async function handlePlayVersions(args) {
15389
15821
  return 0;
15390
15822
  }
15391
15823
  function formatPlayCostEstimate(estimate) {
15392
- const computeSummary = _optionalChain([estimate, 'optionalAccess', _538 => _538.compute]) ? `; ${estimate.status === "available" && estimate.source === "observed" ? "observed Deepline total includes usage-based compute; per-session ceiling" : "separate Deepline compute is usage-based; per-session ceiling"} across ${estimate.compute.pricedBackends.map(formatSandboxBackend).join(" and ")}: ${formatCredits(estimate.compute.maximumCredits)} credits (${formatSandboxBackend(estimate.compute.maximumBackend)} is highest; ${formatCredits(estimate.compute.maximumBillingSeconds)}s; total session count unbounded)` : "";
15824
+ const computeSummary = _optionalChain([estimate, 'optionalAccess', _554 => _554.compute]) ? `; ${estimate.status === "available" && estimate.source === "observed" ? "observed Deepline total includes usage-based compute; per-session ceiling" : "separate Deepline compute is usage-based; per-session ceiling"} across ${estimate.compute.pricedBackends.map(formatSandboxBackend).join(" and ")}: ${formatCredits(estimate.compute.maximumCredits)} credits (${formatSandboxBackend(estimate.compute.maximumBackend)} is highest; ${formatCredits(estimate.compute.maximumBillingSeconds)}s; total session count unbounded)` : "";
15393
15825
  if (!estimate || estimate.status === "unavailable") {
15394
15826
  return `unavailable${estimate ? `: ${estimate.message}${computeSummary}` : ""}`;
15395
15827
  }
@@ -15414,11 +15846,11 @@ var PREBUILT_PLAY_TAG_KEYS = [
15414
15846
  "signals"
15415
15847
  ];
15416
15848
  async function handlePlayList(args) {
15417
- const jsonOutput = _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
15849
+ const jsonOutput = _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
15418
15850
  const showCost = args.includes("--show-cost");
15419
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
15851
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15420
15852
  const categoriesIndex = args.indexOf("--categories");
15421
- const categories = categoriesIndex >= 0 ? _optionalChain([args, 'access', _539 => _539[categoriesIndex + 1], 'optionalAccess', _540 => _540.trim, 'call', _541 => _541()]) : void 0;
15853
+ const categories = categoriesIndex >= 0 ? _optionalChain([args, 'access', _555 => _555[categoriesIndex + 1], 'optionalAccess', _556 => _556.trim, 'call', _557 => _557()]) : void 0;
15422
15854
  const tags = args.flatMap((arg, index) => arg === "--tag" ? [args[index + 1]] : []).flatMap((value) => (_nullishCoalesce(value, () => ( ""))).split(",")).map((value) => value.trim()).filter(Boolean);
15423
15855
  if (args.includes("--tag") && tags.length === 0) {
15424
15856
  console.error(
@@ -15439,7 +15871,7 @@ async function handlePlayList(args) {
15439
15871
  const cursorIndex = args.indexOf("--cursor");
15440
15872
  const limit = limitIndex >= 0 ? Number(args[limitIndex + 1]) : void 0;
15441
15873
  const cursor = cursorIndex >= 0 ? args[cursorIndex + 1] : void 0;
15442
- if (limitIndex >= 0 && (!Number.isSafeInteger(limit) || limit < 1) || cursorIndex >= 0 && !_optionalChain([cursor, 'optionalAccess', _542 => _542.trim, 'call', _543 => _543()])) {
15874
+ if (limitIndex >= 0 && (!Number.isSafeInteger(limit) || limit < 1) || cursorIndex >= 0 && !_optionalChain([cursor, 'optionalAccess', _558 => _558.trim, 'call', _559 => _559()])) {
15443
15875
  console.error("Pass a positive --limit and a non-empty --cursor.");
15444
15876
  return 2;
15445
15877
  }
@@ -15479,7 +15911,7 @@ async function handlePlayList(args) {
15479
15911
  if (play.inputSchema || play.hasInputSchema) {
15480
15912
  lines.push(" inputSchema: yes");
15481
15913
  }
15482
- if (_optionalChain([play, 'access', _544 => _544.triggerStatus, 'optionalAccess', _545 => _545.cron])) {
15914
+ if (_optionalChain([play, 'access', _560 => _560.triggerStatus, 'optionalAccess', _561 => _561.cron])) {
15483
15915
  lines.push(
15484
15916
  ` scheduled execution: ${cronExecutionLabel(play.triggerStatus.cron)}`
15485
15917
  );
@@ -15499,7 +15931,7 @@ async function handlePlayList(args) {
15499
15931
  } else {
15500
15932
  lines.push(" scheduled execution: not configured");
15501
15933
  }
15502
- if (_optionalChain([play, 'access', _546 => _546.triggerStatus, 'optionalAccess', _547 => _547.webhook])) {
15934
+ if (_optionalChain([play, 'access', _562 => _562.triggerStatus, 'optionalAccess', _563 => _563.webhook])) {
15503
15935
  lines.push(` webhook: ${play.triggerStatus.webhook}`);
15504
15936
  }
15505
15937
  if (showCost) {
@@ -15513,7 +15945,7 @@ async function handlePlayList(args) {
15513
15945
  lines.push("List truncated \u2014 more plays are available.");
15514
15946
  lines.push(`Next page: ${nextPage}`);
15515
15947
  }
15516
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
15948
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
15517
15949
  {
15518
15950
  plays,
15519
15951
  count: plays.length,
@@ -15530,8 +15962,8 @@ async function handlePlayList(args) {
15530
15962
  return 0;
15531
15963
  }
15532
15964
  async function handlePlayPin(args, pinned) {
15533
- const target = _optionalChain([args, 'access', _548 => _548.find, 'call', _549 => _549((arg) => !arg.startsWith("-")), 'optionalAccess', _550 => _550.trim, 'call', _551 => _551()]);
15534
- const jsonOutput = _chunkYD7B53RWjs.argsWantJson.call(void 0, args);
15965
+ const target = _optionalChain([args, 'access', _564 => _564.find, 'call', _565 => _565((arg) => !arg.startsWith("-")), 'optionalAccess', _566 => _566.trim, 'call', _567 => _567()]);
15966
+ const jsonOutput = _chunkNF4V5DTYjs.argsWantJson.call(void 0, args);
15535
15967
  const dryRun = args.includes("--dry-run");
15536
15968
  if (!target) {
15537
15969
  console.error(
@@ -15549,11 +15981,11 @@ async function handlePlayPin(args, pinned) {
15549
15981
  const name = parsedTarget.playName;
15550
15982
  const plan = { name, pinned, dryRun };
15551
15983
  if (dryRun) {
15552
- _chunkYD7B53RWjs.printCompactJson.call(void 0, plan);
15984
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, plan);
15553
15985
  return 0;
15554
15986
  }
15555
- const result = await new (0, _chunkV76R6HMVjs.DeeplineClient)().setPlayPinned(name, pinned);
15556
- if (jsonOutput) _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
15987
+ const result = await new (0, _chunk63S7X326js.DeeplineClient)().setPlayPinned(name, pinned);
15988
+ if (jsonOutput) _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
15557
15989
  else console.log(`${result.pinned ? "Pinned" : "Unpinned"} ${result.name}.`);
15558
15990
  return 0;
15559
15991
  }
@@ -15601,7 +16033,7 @@ function printPlayDescription(play) {
15601
16033
  console.log(` ${line}`);
15602
16034
  }
15603
16035
  }
15604
- if (_optionalChain([play, 'access', _552 => _552.toolCategories, 'optionalAccess', _553 => _553.length])) {
16036
+ if (_optionalChain([play, 'access', _568 => _568.toolCategories, 'optionalAccess', _569 => _569.length])) {
15605
16037
  console.log(` Tool categories: ${play.toolCategories.join(", ")}`);
15606
16038
  }
15607
16039
  if (play.aliases.length > 0) {
@@ -15646,7 +16078,7 @@ function printPlayDescription(play) {
15646
16078
  const runtimeLimit = formatPlayRuntimeLimit(play.runtimeLimit);
15647
16079
  if (runtimeLimit) {
15648
16080
  console.log(
15649
- ` Runtime limit: ${runtimeLimit} (${_nullishCoalesce(_optionalChain([play, 'access', _554 => _554.runtimeLimit, 'optionalAccess', _555 => _555.source]), () => ( "live"))})`
16081
+ ` Runtime limit: ${runtimeLimit} (${_nullishCoalesce(_optionalChain([play, 'access', _570 => _570.runtimeLimit, 'optionalAccess', _571 => _571.source]), () => ( "live"))})`
15650
16082
  );
15651
16083
  }
15652
16084
  printScheduledPlayCapacity(play.activeScheduledPlays);
@@ -15674,17 +16106,17 @@ function formatPlayGrepMatches(matches) {
15674
16106
  return matches.map((match) => `${match.field}: ${match.terms.join(", ")}`).join("; ");
15675
16107
  }
15676
16108
  async function handlePlayGrep(args) {
15677
- const query = _optionalChain([args, 'access', _556 => _556[0], 'optionalAccess', _557 => _557.trim, 'call', _558 => _558()]);
16109
+ const query = _optionalChain([args, 'access', _572 => _572[0], 'optionalAccess', _573 => _573.trim, 'call', _574 => _574()]);
15678
16110
  if (!query) {
15679
16111
  console.error("Usage: deepline plays grep <query> [--json]");
15680
16112
  return 1;
15681
16113
  }
15682
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16114
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15683
16115
  const results = (await client.listPlays({ grep: query })).map(
15684
16116
  summarizePlayGrepResult
15685
16117
  );
15686
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
15687
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
16118
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16119
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
15688
16120
  plays: results,
15689
16121
  count: results.length,
15690
16122
  query,
@@ -15698,7 +16130,7 @@ async function handlePlayGrep(args) {
15698
16130
  `
15699
16131
  );
15700
16132
  for (const result of results) {
15701
- console.log(_optionalChain([result, 'access', _559 => _559.displayName, 'optionalAccess', _560 => _560.trim, 'call', _561 => _561()]) || result.name);
16133
+ console.log(_optionalChain([result, 'access', _575 => _575.displayName, 'optionalAccess', _576 => _576.trim, 'call', _577 => _577()]) || result.name);
15702
16134
  const matches = formatPlayGrepMatches(result.matches);
15703
16135
  if (matches) console.log(` Matched: ${matches}`);
15704
16136
  console.log(` Describe: ${result.describe}`);
@@ -15707,7 +16139,7 @@ async function handlePlayGrep(args) {
15707
16139
  return 0;
15708
16140
  }
15709
16141
  async function handlePlayDescribe(args) {
15710
- const selection = _chunkYD7B53RWjs.parseJsonFields.call(void 0, args, "describe");
16142
+ const selection = _chunkNF4V5DTYjs.parseJsonFields.call(void 0, args, "describe");
15711
16143
  args = selection.args;
15712
16144
  const playName = args[0];
15713
16145
  if (!playName) {
@@ -15741,8 +16173,8 @@ async function handlePlayDescribe(args) {
15741
16173
  `deepline plays check ${playName}`,
15742
16174
  ...definedName ? [`deepline describe <workspace>/${definedName}`] : []
15743
16175
  ];
15744
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
15745
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
16176
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16177
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
15746
16178
  ok: false,
15747
16179
  error: { message },
15748
16180
  next
@@ -15756,7 +16188,7 @@ async function handlePlayDescribe(args) {
15756
16188
  }
15757
16189
  return 2;
15758
16190
  }
15759
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16191
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15760
16192
  await assertCanonicalNamedPlayReference(client, playName, {
15761
16193
  command: "describe"
15762
16194
  });
@@ -15766,9 +16198,9 @@ async function handlePlayDescribe(args) {
15766
16198
  compact: args.includes("--compact")
15767
16199
  }
15768
16200
  );
15769
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
15770
- if (selection.fields) _chunkYD7B53RWjs.printJson.call(void 0, play, selection.fields);
15771
- else _chunkYD7B53RWjs.printCompactJson.call(void 0, play);
16201
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16202
+ if (selection.fields) _chunkNF4V5DTYjs.printJson.call(void 0, play, selection.fields);
16203
+ else _chunkNF4V5DTYjs.printCompactJson.call(void 0, play);
15772
16204
  return 0;
15773
16205
  }
15774
16206
  printPlayDescription(play);
@@ -15790,7 +16222,7 @@ async function handlePlaySave(args) {
15790
16222
  }
15791
16223
  let graph;
15792
16224
  try {
15793
- graph = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16225
+ graph = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15794
16226
  "cli.play_save_bundle_graph",
15795
16227
  { targetKind: "file" },
15796
16228
  () => collectBundledPlayGraph(_path.resolve.call(void 0, options.target))
@@ -15812,7 +16244,7 @@ async function handlePlaySave(args) {
15812
16244
  next: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)}`
15813
16245
  };
15814
16246
  if (options.jsonOutput) {
15815
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
16247
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
15816
16248
  } else {
15817
16249
  console.error(result.message);
15818
16250
  console.error(` checked artifact: ${result.expectedArtifactHash}`);
@@ -15834,7 +16266,7 @@ async function handlePlaySave(args) {
15834
16266
  };
15835
16267
  if (options.dryRun) {
15836
16268
  if (options.jsonOutput) {
15837
- _chunkYD7B53RWjs.printCompactJson.call(void 0, dryRun);
16269
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, dryRun);
15838
16270
  } else {
15839
16271
  console.log(`Dry run: ${playName}`);
15840
16272
  console.log(` source: ${dryRun.sourceHash}`);
@@ -15843,14 +16275,14 @@ async function handlePlaySave(args) {
15843
16275
  }
15844
16276
  return 0;
15845
16277
  }
15846
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16278
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15847
16279
  try {
15848
- await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16280
+ await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15849
16281
  "cli.play_save_compile_manifests",
15850
16282
  { targetKind: "file", nodeCount: graph.nodes.size },
15851
16283
  () => compileBundledPlayGraphManifests(client, graph)
15852
16284
  );
15853
- const saved = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16285
+ const saved = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15854
16286
  "cli.play_save_register_draft",
15855
16287
  { targetKind: "file", playName, artifactHash },
15856
16288
  () => client.registerPlayArtifact({
@@ -15879,7 +16311,7 @@ async function handlePlaySave(args) {
15879
16311
  }
15880
16312
  };
15881
16313
  if (options.jsonOutput) {
15882
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
16314
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
15883
16315
  } else {
15884
16316
  console.log(
15885
16317
  `\u2713 Saved ${playName} working draft as v${_nullishCoalesce(result.version, () => ( "?"))}`
@@ -15905,7 +16337,7 @@ async function handlePlayPublish(args) {
15905
16337
  }
15906
16338
  const { target: playName, useLatest } = options;
15907
16339
  let revisionId = options.revisionId;
15908
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16340
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
15909
16341
  if (isFileTarget2(playName)) {
15910
16342
  if (revisionId || useLatest) {
15911
16343
  console.error(
@@ -15915,7 +16347,7 @@ async function handlePlayPublish(args) {
15915
16347
  }
15916
16348
  let graph;
15917
16349
  try {
15918
- graph = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16350
+ graph = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15919
16351
  "cli.play_publish_bundle_graph",
15920
16352
  { targetKind: "file" },
15921
16353
  () => collectBundledPlayGraph(_path.resolve.call(void 0, playName))
@@ -15937,7 +16369,7 @@ async function handlePlayPublish(args) {
15937
16369
  next: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, playName)}`
15938
16370
  };
15939
16371
  if (options.jsonOutput) {
15940
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result3);
16372
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result3);
15941
16373
  } else {
15942
16374
  console.error(result3.message);
15943
16375
  console.error(` checked artifact: ${result3.expectedArtifactHash}`);
@@ -15960,7 +16392,7 @@ async function handlePlayPublish(args) {
15960
16392
  };
15961
16393
  if (options.dryRun) {
15962
16394
  if (options.jsonOutput) {
15963
- _chunkYD7B53RWjs.printCompactJson.call(void 0, dryRun);
16395
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, dryRun);
15964
16396
  } else {
15965
16397
  console.log(`Dry run: ${rootPlayName}`);
15966
16398
  console.log(` source: ${dryRun.sourceHash}`);
@@ -15973,18 +16405,18 @@ async function handlePlayPublish(args) {
15973
16405
  try {
15974
16406
  previousLive = await _asyncNullishCoalesce((await client.getPlay(rootPlayName)).play.liveRevision, async () => ( null));
15975
16407
  } catch (error) {
15976
- if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError) || error.statusCode !== 404) {
16408
+ if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError) || error.statusCode !== 404) {
15977
16409
  console.error(error instanceof Error ? error.message : String(error));
15978
16410
  return 5;
15979
16411
  }
15980
16412
  }
15981
16413
  try {
15982
- await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16414
+ await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15983
16415
  "cli.play_publish_compile_manifests",
15984
16416
  { targetKind: "file", nodeCount: graph.nodes.size },
15985
16417
  () => compileBundledPlayGraphManifests(client, graph)
15986
16418
  );
15987
- await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16419
+ await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15988
16420
  "cli.play_publish_imports",
15989
16421
  { targetKind: "file", nodeCount: graph.nodes.size },
15990
16422
  () => publishImportedPlayDependencies(client, graph)
@@ -15993,7 +16425,7 @@ async function handlePlayPublish(args) {
15993
16425
  console.error(error instanceof Error ? error.message : String(error));
15994
16426
  return 1;
15995
16427
  }
15996
- const published = await _chunkJGHG4NBAjs.traceCliSpan.call(void 0,
16428
+ const published = await _chunkOBB4QXHAjs.traceCliSpan.call(void 0,
15997
16429
  "cli.play_publish_register_root",
15998
16430
  {
15999
16431
  targetKind: "file",
@@ -16018,17 +16450,17 @@ async function handlePlayPublish(args) {
16018
16450
  artifactHash,
16019
16451
  liveVersion: _nullishCoalesce(published.version, () => ( null)),
16020
16452
  revisionId: _nullishCoalesce(published.revisionId, () => ( null)),
16021
- previousLiveVersion: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _562 => _562.version]), () => ( null)),
16022
- previousArtifactHash: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _563 => _563.artifactHash]), () => ( null)),
16453
+ previousLiveVersion: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _578 => _578.version]), () => ( null)),
16454
+ previousArtifactHash: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _579 => _579.artifactHash]), () => ( null)),
16023
16455
  sourceBytes: {
16024
- before: _optionalChain([previousLive, 'optionalAccess', _564 => _564.sourceCode]) ? Buffer.byteLength(previousLive.sourceCode, "utf8") : null,
16456
+ before: _optionalChain([previousLive, 'optionalAccess', _580 => _580.sourceCode]) ? Buffer.byteLength(previousLive.sourceCode, "utf8") : null,
16025
16457
  after: Buffer.byteLength(graph.root.sourceCode, "utf8")
16026
16458
  },
16027
16459
  triggerMetadata: _nullishCoalesce(published.triggerMetadata, () => ( null)),
16028
16460
  triggerBindings: _nullishCoalesce(published.triggerBindings, () => ( []))
16029
16461
  };
16030
16462
  if (options.jsonOutput) {
16031
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result2);
16463
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result2);
16032
16464
  } else {
16033
16465
  printPublishReceipt({
16034
16466
  name: rootPlayName,
@@ -16059,14 +16491,14 @@ async function handlePlayPublish(args) {
16059
16491
  revisionId: _nullishCoalesce(revisionId, () => ( null)),
16060
16492
  latest: useLatest
16061
16493
  };
16062
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result2);
16494
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result2);
16063
16495
  return 0;
16064
16496
  }
16065
16497
  const resolvedName = parseReferencedPlayTarget2(playName).playName;
16066
16498
  if (useLatest) {
16067
16499
  const versions = await client.listPlayVersions(resolvedName);
16068
16500
  const latest = versions[0];
16069
- if (!_optionalChain([latest, 'optionalAccess', _565 => _565._id])) {
16501
+ if (!_optionalChain([latest, 'optionalAccess', _581 => _581._id])) {
16070
16502
  console.error(`No saved revisions found for ${resolvedName}.`);
16071
16503
  return 1;
16072
16504
  }
@@ -16083,7 +16515,7 @@ async function handlePlayPublish(args) {
16083
16515
  revisionId ? { revisionId } : {}
16084
16516
  );
16085
16517
  if (options.jsonOutput) {
16086
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
16518
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
16087
16519
  } else {
16088
16520
  printPublishReceipt({
16089
16521
  name: result.name,
@@ -16123,7 +16555,7 @@ async function handlePlayDelete(args) {
16123
16555
  );
16124
16556
  return 2;
16125
16557
  }
16126
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16558
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
16127
16559
  let detail;
16128
16560
  try {
16129
16561
  detail = await client.getPlay(parseReferencedPlayTarget2(playName).playName);
@@ -16147,8 +16579,8 @@ async function handlePlayDelete(args) {
16147
16579
  name: resolvedName,
16148
16580
  plannedMutation: "move saved org-owned play to Trash and stop triggers"
16149
16581
  };
16150
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
16151
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result2);
16582
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16583
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result2);
16152
16584
  } else {
16153
16585
  process.stdout.write(
16154
16586
  `Dry run: would move ${result2.name} to Trash and stop its active triggers.
@@ -16158,8 +16590,8 @@ async function handlePlayDelete(args) {
16158
16590
  return 0;
16159
16591
  }
16160
16592
  const result = await client.deletePlay(resolvedName);
16161
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
16162
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
16593
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16594
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
16163
16595
  return result.archived || result.alreadyArchived ? 0 : 4;
16164
16596
  }
16165
16597
  if (result.alreadyArchived) {
@@ -16198,13 +16630,13 @@ async function handlePlayRestore(args) {
16198
16630
  );
16199
16631
  return 2;
16200
16632
  }
16201
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16633
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
16202
16634
  try {
16203
16635
  const result = await client.restorePlay(
16204
16636
  parseReferencedPlayTarget2(playName).playName
16205
16637
  );
16206
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
16207
- _chunkYD7B53RWjs.printCompactJson.call(void 0, result);
16638
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
16639
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, result);
16208
16640
  return result.restored || result.alreadyActive ? 0 : 4;
16209
16641
  }
16210
16642
  if (result.alreadyActive) {
@@ -16317,21 +16749,21 @@ Common commands:
16317
16749
  resume: `deepline plays resume-submission ${_chunkAID3OYVJjs.shellQuote.call(void 0, path)} --json`
16318
16750
  }
16319
16751
  };
16320
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0, result2, {
16752
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, result2, {
16321
16753
  json: options.json,
16322
16754
  text: `Submission ${saved.workflowId}: admission is unknown. ${result2.next.inspect}
16323
16755
  `
16324
16756
  });
16325
16757
  return;
16326
16758
  }
16327
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
16759
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
16328
16760
  if (new URL(saved.baseUrl).origin !== new URL(client.baseUrl).origin) {
16329
16761
  throw new Error(
16330
16762
  "The submission belongs to a different API origin. Select its original host before recovery."
16331
16763
  );
16332
16764
  }
16333
16765
  const result = await client.startPlayRun(saved.request);
16334
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
16766
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
16335
16767
  { ...result },
16336
16768
  {
16337
16769
  json: options.json,
@@ -16367,7 +16799,7 @@ Examples:
16367
16799
  ).action(async (target, options) => {
16368
16800
  process.exitCode = await handlePlayCheck([
16369
16801
  target,
16370
- ..._chunkYD7B53RWjs.jsonFieldArgs.call(void 0, options.json),
16802
+ ..._chunkNF4V5DTYjs.jsonFieldArgs.call(void 0, options.json),
16371
16803
  ...options.full ? ["--full"] : []
16372
16804
  ]);
16373
16805
  });
@@ -16555,10 +16987,11 @@ JSON field selection:
16555
16987
  resolvePlayRunCliOptions(
16556
16988
  _nullishCoalesce(effectiveTarget, () => ( void 0)),
16557
16989
  options,
16558
- passthroughArgs
16990
+ passthroughArgs,
16991
+ _chunkOBB4QXHAjs.resolveCliMaintenancePolicy.call(void 0, command.optsWithGlobals())
16559
16992
  )
16560
16993
  );
16561
- _chunkJGHG4NBAjs.recordCliTrace.call(void 0, {
16994
+ _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
16562
16995
  phase: "cli.play_command_exit",
16563
16996
  exitCode
16564
16997
  });
@@ -16608,9 +17041,9 @@ Examples:
16608
17041
  const limit = Number(options.historyLimit);
16609
17042
  if (!Number.isInteger(limit) || limit < 1 || limit > 30)
16610
17043
  throw new Error("--history-limit must be an integer from 1 to 30.");
16611
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
17044
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
16612
17045
  if (options.binding) {
16613
- _chunkYD7B53RWjs.printCompactJson.call(void 0,
17046
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0,
16614
17047
  await client.getPlayTriggerHistory(options.binding, { limit })
16615
17048
  );
16616
17049
  return;
@@ -16618,7 +17051,7 @@ Examples:
16618
17051
  const result = await client.listPlayTriggerInventory({
16619
17052
  cursor: options.cursor
16620
17053
  });
16621
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
17054
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
16622
17055
  ...result,
16623
17056
  next: result.isDone ? null : `deepline plays triggers --cursor ${JSON.stringify(result.continueCursor)}`
16624
17057
  });
@@ -16665,7 +17098,7 @@ Examples:
16665
17098
  if (options.groupBy !== "kind" && options.groupBy !== "trigger_source") {
16666
17099
  throw new Error("--group-by must be kind or trigger_source.");
16667
17100
  }
16668
- const result = await new (0, _chunkV76R6HMVjs.DeeplineClient)().getPlaysActivity({
17101
+ const result = await new (0, _chunk63S7X326js.DeeplineClient)().getPlaysActivity({
16669
17102
  timeZone: options.timeZone,
16670
17103
  days,
16671
17104
  ...options.endDate ? { endDate: options.endDate } : {},
@@ -16679,7 +17112,7 @@ Examples:
16679
17112
  `${bucket.key} ${groups} failed_play_runs=${bucket.failedPlayRuns} ${coverage}`
16680
17113
  );
16681
17114
  }
16682
- _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
17115
+ _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
16683
17116
  { ...result },
16684
17117
  {
16685
17118
  json: Boolean(options.json),
@@ -16708,7 +17141,7 @@ Examples:
16708
17141
  false
16709
17142
  );
16710
17143
  });
16711
- _chunk53HN7WZNjs.registerDeprecatedSearchCommand.call(void 0,
17144
+ _chunkOZ6E3IRZjs.registerDeprecatedSearchCommand.call(void 0,
16712
17145
  play,
16713
17146
  (options) => options.all ? ["plays"] : ["prebuilts"]
16714
17147
  );
@@ -16749,9 +17182,9 @@ Examples:
16749
17182
  "--json [fields]",
16750
17183
  "JSON output; optionally select comma-separated dotted paths"
16751
17184
  );
16752
- _chunkZAAKSJASjs.addDescribeOptions.call(void 0, describeCommand, { json: false }).action(
17185
+ _chunk27GJKC5Qjs.addDescribeOptions.call(void 0, describeCommand, { json: false }).action(
16753
17186
  async (target, options) => {
16754
- const ownView = () => handlePlayDescribe(_chunkYD7B53RWjs.describeArgs.call(void 0, target, options));
17187
+ const ownView = () => handlePlayDescribe(_chunkNF4V5DTYjs.describeArgs.call(void 0, target, options));
16755
17188
  const [flagText] = [options.json].filter(
16756
17189
  (value) => typeof value === "string"
16757
17190
  );
@@ -16762,7 +17195,7 @@ Examples:
16762
17195
  process.exitCode = await ownView();
16763
17196
  return;
16764
17197
  }
16765
- const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-PQTQ5B6F.js")));
17198
+ const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-S34JUX5W.js")));
16766
17199
  process.exitCode = await describeAnything(
16767
17200
  name,
16768
17201
  {
@@ -16880,7 +17313,7 @@ Examples:
16880
17313
  deepline plays deployments <deployment-id>
16881
17314
  `
16882
17315
  ).option("--limit <n>", "Max rows (default 50)").option("--json", "Emit JSON output").action(
16883
- async (id, options) => id ? _chunkAU4OFDFXjs.handleDeploymentGet.call(void 0, id, options) : _chunkAU4OFDFXjs.handleDeploymentsList.call(void 0, options)
17316
+ async (id, options) => id ? _chunk36AHOWVSjs.handleDeploymentGet.call(void 0, id, options) : _chunk36AHOWVSjs.handleDeploymentsList.call(void 0, options)
16884
17317
  );
16885
17318
  addPublishHelp(
16886
17319
  play.command("publish <target>").description(
@@ -17015,14 +17448,14 @@ Examples:
17015
17448
  const limit = Number(options.limit);
17016
17449
  if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
17017
17450
  throw new Error("--limit must be an integer from 1 to 1000.");
17018
- const result = await new (0, _chunkV76R6HMVjs.DeeplineClient)().runs.rowHistory({
17451
+ const result = await new (0, _chunk63S7X326js.DeeplineClient)().runs.rowHistory({
17019
17452
  playName: options.play,
17020
17453
  runId,
17021
17454
  tableNamespace: options.dataset,
17022
17455
  limit,
17023
17456
  cursor: options.cursor
17024
17457
  });
17025
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
17458
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
17026
17459
  ...result,
17027
17460
  ...result.nextCursor ? {
17028
17461
  next: `deepline runs rows-history ${_chunkAID3OYVJjs.shellQuote.call(void 0, runId)} --play ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.play)} --dataset ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.dataset)} --limit ${limit} --cursor ${_chunkAID3OYVJjs.shellQuote.call(void 0, result.nextCursor)} --json`
@@ -17092,7 +17525,7 @@ Examples:
17092
17525
  ).action(async (runId, options) => {
17093
17526
  process.exitCode = await handleRunGet([
17094
17527
  runId,
17095
- ..._chunkYD7B53RWjs.jsonFieldArgs.call(void 0, options.json),
17528
+ ..._chunkNF4V5DTYjs.jsonFieldArgs.call(void 0, options.json),
17096
17529
  ...options.webUrl ? ["--web-url"] : [],
17097
17530
  ...options.full ? ["--full"] : [],
17098
17531
  ...options.input ? ["--input"] : [],
@@ -17151,12 +17584,13 @@ Examples:
17151
17584
  deepline runs list --play my-play --status failed --compact
17152
17585
  deepline runs list --status running --compact
17153
17586
  `
17154
- ).option("--play <name>", "Play name to filter runs").option("--status <status>", "Filter by run status").option("--limit <count>", "Maximum runs to return").option("--offset <count>", "Zero-based page offset (requires --play)").option("--compact", "Drop verbose fields from JSON output").option("--json", "Emit JSON output").option(
17587
+ ).option("--play <name>", "Play name to filter runs").option("--node <id>", "Mermaid node id to filter runs").option("--status <status>", "Filter by run status").option("--limit <count>", "Maximum runs to return").option("--offset <count>", "Zero-based page offset (requires --play)").option("--compact", "Drop verbose fields from JSON output").option("--json", "Emit JSON output").option(
17155
17588
  "--timing",
17156
17589
  "Report the inventory request duration and periodic long-read updates to stderr"
17157
17590
  ).action(async (options) => {
17158
17591
  process.exitCode = await handleRunsList([
17159
17592
  ...options.play ? ["--play", options.play] : [],
17593
+ ...options.node ? ["--node", options.node] : [],
17160
17594
  ...options.status ? ["--status", options.status] : [],
17161
17595
  ...options.limit ? ["--limit", options.limit] : [],
17162
17596
  ...options.offset ? ["--offset", options.offset] : [],
@@ -17377,7 +17811,7 @@ Examples:
17377
17811
  ...options.allowEmpty ? ["--allow-empty"] : [],
17378
17812
  ...options.wait ? ["--wait"] : [],
17379
17813
  ...options.timeoutMs ? ["--timeout-ms", options.timeoutMs] : [],
17380
- ..._chunkYD7B53RWjs.jsonFieldArgs.call(void 0, options.json)
17814
+ ..._chunkNF4V5DTYjs.jsonFieldArgs.call(void 0, options.json)
17381
17815
  ]);
17382
17816
  });
17383
17817
  const share = play.command("share").description(
@@ -17518,8 +17952,8 @@ function absolutePublicPlayUrl(path) {
17518
17952
  }
17519
17953
  function shareUrlFields(status) {
17520
17954
  return {
17521
- publicUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _566 => _566.share, 'optionalAccess', _567 => _567.publicPath])),
17522
- canonicalUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _568 => _568.share, 'optionalAccess', _569 => _569.canonicalPath]))
17955
+ publicUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _582 => _582.share, 'optionalAccess', _583 => _583.publicPath])),
17956
+ canonicalUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _584 => _584.share, 'optionalAccess', _585 => _585.canonicalPath]))
17523
17957
  };
17524
17958
  }
17525
17959
  function shareStatusForOutput(status) {
@@ -17543,10 +17977,10 @@ async function handlePlayShareStatus(args) {
17543
17977
  return 2;
17544
17978
  }
17545
17979
  const name = parseReferencedPlayTarget2(target).playName;
17546
- const status = await new (0, _chunkV76R6HMVjs.DeeplineClient)().getSharePage(name);
17980
+ const status = await new (0, _chunk63S7X326js.DeeplineClient)().getSharePage(name);
17547
17981
  const outputStatus = shareStatusForOutput(status);
17548
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17549
- _chunkYD7B53RWjs.printCompactJson.call(void 0, outputStatus);
17982
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
17983
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, outputStatus);
17550
17984
  return 0;
17551
17985
  }
17552
17986
  if (!outputStatus.share) {
@@ -17585,7 +18019,7 @@ async function handlePlaySharePublish(args) {
17585
18019
  return 2;
17586
18020
  }
17587
18021
  const name = parseReferencedPlayTarget2(target).playName;
17588
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
18022
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
17589
18023
  let revisionId = shareFlagValue(args, "--revision-id");
17590
18024
  let resolvedVersion;
17591
18025
  if (!revisionId) {
@@ -17616,8 +18050,8 @@ async function handlePlaySharePublish(args) {
17616
18050
  );
17617
18051
  if (!hasCompleted) {
17618
18052
  const message = `No completed run for ${name}. Publish a play only after it has run successfully. (Override with --no-run-check.)`;
17619
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17620
- _chunkYD7B53RWjs.printCompactJson.call(void 0, {
18053
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18054
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, {
17621
18055
  ok: false,
17622
18056
  code: "NO_SUCCESSFUL_RUN",
17623
18057
  message,
@@ -17641,8 +18075,8 @@ async function handlePlaySharePublish(args) {
17641
18075
  };
17642
18076
  if (args.includes("--dry-run")) {
17643
18077
  const plan = { dryRun: true, name, version: resolvedVersion, ...request };
17644
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17645
- _chunkYD7B53RWjs.printCompactJson.call(void 0, plan);
18078
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18079
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, plan);
17646
18080
  } else {
17647
18081
  console.log(
17648
18082
  `Would publish ${name}${resolvedVersion ? ` v${resolvedVersion}` : ""} (revision ${revisionId}).`
@@ -17652,13 +18086,13 @@ async function handlePlaySharePublish(args) {
17652
18086
  }
17653
18087
  const status = await client.publishSharePage(name, request);
17654
18088
  const outputStatus = shareStatusForOutput(status);
17655
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17656
- _chunkYD7B53RWjs.printCompactJson.call(void 0, outputStatus);
18089
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18090
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, outputStatus);
17657
18091
  return 0;
17658
18092
  }
17659
18093
  const urls = shareUrlFields(outputStatus);
17660
18094
  console.log(
17661
- `Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${_nullishCoalesce(_nullishCoalesce(urls.publicUrl, () => ( _optionalChain([outputStatus, 'access', _570 => _570.share, 'optionalAccess', _571 => _571.publicPath]))), () => ( ""))}`
18095
+ `Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${_nullishCoalesce(_nullishCoalesce(urls.publicUrl, () => ( _optionalChain([outputStatus, 'access', _586 => _586.share, 'optionalAccess', _587 => _587.publicPath]))), () => ( ""))}`
17662
18096
  );
17663
18097
  if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
17664
18098
  console.log(`Version URL: ${urls.canonicalUrl}`);
@@ -17684,9 +18118,9 @@ async function handlePlayShareUpdate(args) {
17684
18118
  ...args.includes("--show-latency") ? { showAverageLatency: true } : args.includes("--hide-latency") ? { showAverageLatency: false } : {},
17685
18119
  ...seoIndexing ? { seoIndexing } : {}
17686
18120
  };
17687
- const status = await new (0, _chunkV76R6HMVjs.DeeplineClient)().updateSharePage(name, request);
17688
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17689
- _chunkYD7B53RWjs.printCompactJson.call(void 0, status);
18121
+ const status = await new (0, _chunk63S7X326js.DeeplineClient)().updateSharePage(name, request);
18122
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18123
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, status);
17690
18124
  return 0;
17691
18125
  }
17692
18126
  console.log(`Updated ${name} share settings.`);
@@ -17701,13 +18135,13 @@ async function handlePlayShareRegenerate(args) {
17701
18135
  return 2;
17702
18136
  }
17703
18137
  const name = parseReferencedPlayTarget2(target).playName;
17704
- const client = new (0, _chunkV76R6HMVjs.DeeplineClient)();
18138
+ const client = new (0, _chunk63S7X326js.DeeplineClient)();
17705
18139
  let revisionId = shareFlagValue(args, "--revision-id");
17706
18140
  const versionFlag = shareFlagValue(args, "--version");
17707
18141
  if (!revisionId && versionFlag) {
17708
18142
  const versions = await client.listPlayVersions(name);
17709
18143
  const chosen = versions.find((r) => r.version === Number(versionFlag));
17710
- if (!_optionalChain([chosen, 'optionalAccess', _572 => _572._id])) {
18144
+ if (!_optionalChain([chosen, 'optionalAccess', _588 => _588._id])) {
17711
18145
  console.error(`Version ${versionFlag} not found for ${name}.`);
17712
18146
  return 4;
17713
18147
  }
@@ -17718,12 +18152,12 @@ async function handlePlayShareRegenerate(args) {
17718
18152
  revisionId ? { revisionId } : {}
17719
18153
  );
17720
18154
  const outputStatus = shareStatusForOutput(status);
17721
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17722
- _chunkYD7B53RWjs.printCompactJson.call(void 0, outputStatus);
18155
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18156
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, outputStatus);
17723
18157
  return 0;
17724
18158
  }
17725
18159
  const urls = shareUrlFields(outputStatus);
17726
- const regeneratedPublishedRevision = !revisionId || _optionalChain([outputStatus, 'access', _573 => _573.share, 'optionalAccess', _574 => _574.publishedRevisionId]) === revisionId;
18160
+ const regeneratedPublishedRevision = !revisionId || _optionalChain([outputStatus, 'access', _589 => _589.share, 'optionalAccess', _590 => _590.publishedRevisionId]) === revisionId;
17727
18161
  console.log(
17728
18162
  `Regenerated public copy for ${name}${regeneratedPublishedRevision && urls.publicUrl ? `: ${urls.publicUrl}` : "."}`
17729
18163
  );
@@ -17744,9 +18178,9 @@ async function handlePlayShareUnpublish(args) {
17744
18178
  return 2;
17745
18179
  }
17746
18180
  const name = parseReferencedPlayTarget2(target).playName;
17747
- const status = await new (0, _chunkV76R6HMVjs.DeeplineClient)().unpublishSharePage(name);
17748
- if (_chunkYD7B53RWjs.argsWantJson.call(void 0, args)) {
17749
- _chunkYD7B53RWjs.printCompactJson.call(void 0, status);
18181
+ const status = await new (0, _chunk63S7X326js.DeeplineClient)().unpublishSharePage(name);
18182
+ if (_chunkNF4V5DTYjs.argsWantJson.call(void 0, args)) {
18183
+ _chunkNF4V5DTYjs.printCompactJson.call(void 0, status);
17750
18184
  return 0;
17751
18185
  }
17752
18186
  console.log(`Unpublished ${name}; the public page has been removed.`);
@@ -17817,4 +18251,5 @@ async function handlePlayShareUnpublish(args) {
17817
18251
 
17818
18252
 
17819
18253
 
17820
- exports.PREBUILT_PLAY_TAG_KEYS = PREBUILT_PLAY_TAG_KEYS; exports.assertDatasetHasExportableRows = assertDatasetHasExportableRows; exports.buildPlayCompletionTextLines = buildPlayCompletionTextLines; exports.buildRunActivityTextLines = buildRunActivityTextLines; exports.buildRunLaunch = buildRunLaunch; exports.buildRunLogsText = buildRunLogsText; exports.buildRunPackageTextLines = buildRunPackageTextLines; exports.buildStopAllDryRunTextLines = buildStopAllDryRunTextLines; exports.clampJsonPreviewText = clampJsonPreviewText; exports.compactPlayStatus = compactPlayStatus; exports.csvColumnLines = csvColumnLines; exports.describeSleepUntil = describeSleepUntil; exports.exportPlayStatusRows = exportPlayStatusRows; exports.formatPlaySandboxRuntimeWarning = formatPlaySandboxRuntimeWarning; exports.formatStepLabelFromNodeId = formatStepLabelFromNodeId; exports.getFinalStatusFromLiveEvent = getFinalStatusFromLiveEvent; exports.getProgressLinesFromLiveEvent = getProgressLinesFromLiveEvent; exports.getRunningHeartbeatLine = getRunningHeartbeatLine; exports.getStepTransitionLineFromLiveEvent = getStepTransitionLineFromLiveEvent; exports.handlePlayCheck = handlePlayCheck; exports.handlePlayDelete = handlePlayDelete; exports.handlePlayDescribe = handlePlayDescribe; exports.handlePlayGet = handlePlayGet; exports.handlePlayGrep = handlePlayGrep; exports.handlePlayList = handlePlayList; exports.handlePlayPin = handlePlayPin; exports.handlePlayPublish = handlePlayPublish; exports.handlePlayRestore = handlePlayRestore; exports.handlePlayRun = handlePlayRun; exports.handlePlaySave = handlePlaySave; exports.handlePlaySharePublish = handlePlaySharePublish; exports.handlePlayShareRegenerate = handlePlayShareRegenerate; exports.handlePlayShareStatus = handlePlayShareStatus; exports.handlePlayShareUnpublish = handlePlayShareUnpublish; exports.handlePlayShareUpdate = handlePlayShareUpdate; exports.handlePlayVersions = handlePlayVersions; exports.handleRunEventSearch = handleRunEventSearch; exports.handleRunExport = handleRunExport; exports.handleRunGet = handleRunGet; exports.handleRunLifecycleStatus = handleRunLifecycleStatus; exports.handleRunLogs = handleRunLogs; exports.handleRunStop = handleRunStop; exports.handleRunStopAll = handleRunStopAll; exports.handleRunTail = handleRunTail; exports.handleRunsList = handleRunsList; exports.handleRunsRerun = handleRunsRerun; exports.liveMaxCreditsPerRun = liveMaxCreditsPerRun; exports.loadPlayBundler = loadPlayBundler; exports.parsePlayPublishOptions = parsePlayPublishOptions; exports.parsePlayRunHeaderFlag = parsePlayRunHeaderFlag; exports.parsePlayRunOptions = parsePlayRunOptions; exports.preflightLocalFileInputs = preflightLocalFileInputs; exports.registerPlayCommands = registerPlayCommands; exports.renderRunOverviewText = renderRunOverviewText; exports.resolveDatasetByName = resolveDatasetByName; exports.resolvePlayRunOutputStatus = resolvePlayRunOutputStatus; exports.resolveRunStopState = resolveRunStopState; exports.selectRunLogTailPage = selectRunLogTailPage; exports.shouldPrintPlayProgressLine = shouldPrintPlayProgressLine; exports.startAndWaitForPlayCompletionByStream = startAndWaitForPlayCompletionByStream; exports.truncateErrorForDisplay = truncateErrorForDisplay; exports.waitForPlayCompletionByWatch = waitForPlayCompletionByWatch; exports.withTerminalPlayIdentity = withTerminalPlayIdentity; exports.writePlayRunIdFile = writePlayRunIdFile;
18254
+
18255
+ exports.PREBUILT_PLAY_TAG_KEYS = PREBUILT_PLAY_TAG_KEYS; exports.assertDatasetHasExportableRows = assertDatasetHasExportableRows; exports.buildPlayCompletionTextLines = buildPlayCompletionTextLines; exports.buildRunActivityTextLines = buildRunActivityTextLines; exports.buildRunLaunch = buildRunLaunch; exports.buildRunLogsText = buildRunLogsText; exports.buildRunPackageTextLines = buildRunPackageTextLines; exports.buildStopAllDryRunTextLines = buildStopAllDryRunTextLines; exports.clampJsonPreviewText = clampJsonPreviewText; exports.compactPlayStatus = compactPlayStatus; exports.csvColumnLines = csvColumnLines; exports.describeSleepUntil = describeSleepUntil; exports.exportPlayStatusRows = exportPlayStatusRows; exports.formatPlaySandboxRuntimeWarning = formatPlaySandboxRuntimeWarning; exports.formatStepLabelFromNodeId = formatStepLabelFromNodeId; exports.getFinalStatusFromLiveEvent = getFinalStatusFromLiveEvent; exports.getProgressLinesFromLiveEvent = getProgressLinesFromLiveEvent; exports.getRunningHeartbeatLine = getRunningHeartbeatLine; exports.getStepTransitionLineFromLiveEvent = getStepTransitionLineFromLiveEvent; exports.handlePlayCheck = handlePlayCheck; exports.handlePlayDelete = handlePlayDelete; exports.handlePlayDescribe = handlePlayDescribe; exports.handlePlayGet = handlePlayGet; exports.handlePlayGrep = handlePlayGrep; exports.handlePlayList = handlePlayList; exports.handlePlayPin = handlePlayPin; exports.handlePlayPublish = handlePlayPublish; exports.handlePlayRestore = handlePlayRestore; exports.handlePlayRun = handlePlayRun; exports.handlePlaySave = handlePlaySave; exports.handlePlaySharePublish = handlePlaySharePublish; exports.handlePlayShareRegenerate = handlePlayShareRegenerate; exports.handlePlayShareStatus = handlePlayShareStatus; exports.handlePlayShareUnpublish = handlePlayShareUnpublish; exports.handlePlayShareUpdate = handlePlayShareUpdate; exports.handlePlayVersions = handlePlayVersions; exports.handleRunEventSearch = handleRunEventSearch; exports.handleRunExport = handleRunExport; exports.handleRunGet = handleRunGet; exports.handleRunLifecycleStatus = handleRunLifecycleStatus; exports.handleRunLogs = handleRunLogs; exports.handleRunStop = handleRunStop; exports.handleRunStopAll = handleRunStopAll; exports.handleRunTail = handleRunTail; exports.handleRunsList = handleRunsList; exports.handleRunsRerun = handleRunsRerun; exports.liveMaxCreditsPerRun = liveMaxCreditsPerRun; exports.loadPlayBundler = loadPlayBundler; exports.parsePlayPublishOptions = parsePlayPublishOptions; exports.parsePlayRunHeaderFlag = parsePlayRunHeaderFlag; exports.parsePlayRunOptions = parsePlayRunOptions; exports.preflightLocalFileInputs = preflightLocalFileInputs; exports.registerPlayCommands = registerPlayCommands; exports.renderRunOverviewText = renderRunOverviewText; exports.resolveDatasetByName = resolveDatasetByName; exports.resolvePlayRunOutputStatus = resolvePlayRunOutputStatus; exports.resolveRunStopState = resolveRunStopState; exports.selectRunLogTailPage = selectRunLogTailPage; exports.shouldPrintPlayProgressLine = shouldPrintPlayProgressLine; exports.startAndWaitForPlayCompletion = startAndWaitForPlayCompletion; exports.startAndWaitForPlayCompletionByStream = startAndWaitForPlayCompletionByStream; exports.truncateErrorForDisplay = truncateErrorForDisplay; exports.waitForPlayCompletionByWatch = waitForPlayCompletionByWatch; exports.withTerminalPlayIdentity = withTerminalPlayIdentity; exports.writePlayRunIdFile = writePlayRunIdFile;