deepline 0.3.392 → 0.3.393

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 (145) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +156 -24
  2. package/dist/bundling-sources/sdk/src/compat.ts +9 -0
  3. package/dist/bundling-sources/sdk/src/http.ts +5 -1
  4. package/dist/bundling-sources/sdk/src/index.ts +5 -0
  5. package/dist/bundling-sources/sdk/src/plays/run-request.ts +182 -6
  6. package/dist/bundling-sources/sdk/src/release.ts +4 -1
  7. package/dist/bundling-sources/sdk/src/types.ts +13 -0
  8. package/dist/bundling-sources/shared_libs/integration-contracts/request-warnings.ts +64 -0
  9. package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +315 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +41 -8
  11. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +418 -44
  12. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +36 -3
  13. package/dist/bundling-sources/shared_libs/play-runtime/durable-invocation-fence.ts +36 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +11 -3
  15. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +19 -1
  17. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +26 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +158 -10
  19. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +235 -2
  20. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +92 -58
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +7 -1
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +30 -7
  23. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1161 -316
  24. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +28 -15
  25. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +24 -3
  26. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +31 -0
  27. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +37 -4
  28. package/dist/bundling-sources/shared_libs/plays/dataset.ts +172 -79
  29. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +173 -1
  30. package/dist/cli/{auth-6JSA2ZCW.mjs → auth-5PXHA232.mjs} +4 -4
  31. package/dist/cli/auth-P3MVDTXM.js +39 -0
  32. package/dist/cli/{billing-Q5BLQHIU.js → billing-JFB2XLSO.js} +101 -74
  33. package/dist/cli/{billing-MRRO643H.mjs → billing-Z2N7ZAGM.mjs} +32 -5
  34. package/dist/cli/{chunk-CVLM3WMJ.js → chunk-2HAD745V.js} +242 -183
  35. package/dist/cli/{chunk-HGYBEAQP.mjs → chunk-2LGC4EFT.mjs} +3 -3
  36. package/dist/cli/{chunk-A3APGZFP.mjs → chunk-4PT2VA3A.mjs} +2 -2
  37. package/dist/cli/{chunk-6DBOU7UH.js → chunk-4XX6443T.js} +176 -87
  38. package/dist/cli/{chunk-2QLML6G4.mjs → chunk-5KWKZIQR.mjs} +4 -4
  39. package/dist/cli/{chunk-2G7DXFHI.mjs → chunk-5PRVMXKB.mjs} +27 -2
  40. package/dist/cli/{chunk-DSWSEHRX.mjs → chunk-6I73X254.mjs} +1 -1
  41. package/dist/cli/{chunk-ZTACINO5.mjs → chunk-7HR7BGZL.mjs} +13 -3
  42. package/dist/cli/{chunk-BB3FNYFY.js → chunk-AARX5L4B.js} +2 -2
  43. package/dist/cli/{chunk-WMS5U6YB.js → chunk-CDFH2DYL.js} +20 -19
  44. package/dist/cli/{chunk-R3O2CZ4H.mjs → chunk-FQ6VHPW4.mjs} +2 -2
  45. package/dist/cli/{chunk-MU6M3URX.mjs → chunk-HLEESTCH.mjs} +1 -1
  46. package/dist/cli/{chunk-Q6EOHNRH.mjs → chunk-JI2B4RZP.mjs} +119 -6
  47. package/dist/cli/{chunk-2Q3GEFL4.mjs → chunk-KIYU2TGL.mjs} +2 -2
  48. package/dist/cli/{chunk-Y6VOGHF2.mjs → chunk-KZZC33PY.mjs} +0 -181
  49. package/dist/cli/{chunk-UCKJQG25.js → chunk-L2SYLGRP.js} +8 -8
  50. package/dist/cli/{chunk-2GAHHSLB.mjs → chunk-LMMEAMA7.mjs} +3 -2
  51. package/dist/cli/{chunk-YAZCDBXX.mjs → chunk-LZPCDB7U.mjs} +3 -2
  52. package/dist/cli/{chunk-RV6ALZIX.js → chunk-M7Y7JYZX.js} +32 -7
  53. package/dist/cli/{chunk-QGKPTBRR.js → chunk-MS6GUPBB.js} +3 -3
  54. package/dist/cli/{chunk-4SFPVW7A.js → chunk-OXNOAD6Y.js} +26 -26
  55. package/dist/cli/{chunk-JOFPQGXW.js → chunk-PTDECJGP.js} +50 -50
  56. package/dist/cli/{chunk-5O4B6AUN.js → chunk-PWSWAN7Q.js} +25 -2
  57. package/dist/cli/{chunk-YN6YA7ZZ.mjs → chunk-Q26LUSQ2.mjs} +79 -20
  58. package/dist/cli/{chunk-3VN4FTE3.js → chunk-RDXFGPJU.js} +1 -182
  59. package/dist/cli/{chunk-7E66A24V.mjs → chunk-RKMB3N7K.mjs} +25 -2
  60. package/dist/cli/{chunk-JSLPHFP7.js → chunk-RWHWF5ZJ.js} +3 -2
  61. package/dist/cli/{chunk-3FV4GBRK.mjs → chunk-STNYIMIV.mjs} +97 -8
  62. package/dist/cli/chunk-UBKA33KY.mjs +310 -0
  63. package/dist/cli/{chunk-PAIMOGCM.js → chunk-UHNDVD3P.js} +125 -12
  64. package/dist/cli/{chunk-24VEN5PQ.mjs → chunk-UOGZUA24.mjs} +179 -17
  65. package/dist/cli/{chunk-T7OKJ2T6.js → chunk-VIQJIX2P.js} +73 -63
  66. package/dist/cli/{chunk-RIV2GS5E.js → chunk-VIWE6WRK.js} +627 -465
  67. package/dist/cli/{chunk-EY7RFC6A.js → chunk-W4WOMXR3.js} +15 -15
  68. package/dist/cli/chunk-XDVT3GOM.js +310 -0
  69. package/dist/cli/{chunk-2FQG2HU4.js → chunk-Z3OOZM5L.js} +8 -8
  70. package/dist/cli/{csv-E4QGUIGI.mjs → csv-KJWZHKCH.mjs} +3 -3
  71. package/dist/cli/{csv-26U5T24Z.js → csv-P3Z3YE7H.js} +12 -12
  72. package/dist/cli/{db-JTRJIAQW.mjs → db-NCM4CQIS.mjs} +6 -5
  73. package/dist/cli/{db-QHBFLMVL.js → db-NUZGJNQC.js} +31 -30
  74. package/dist/cli/{describe-E3DE3ZK3.mjs → describe-WT6MM2GO.mjs} +17 -16
  75. package/dist/cli/{describe-FDV2V74F.js → describe-YGSEN5WC.js} +24 -23
  76. package/dist/cli/{executions-VZYOGVQY.js → executions-PCOLHN7Q.js} +8 -7
  77. package/dist/cli/{executions-B3GTNPRE.mjs → executions-XS2IPJ4W.mjs} +6 -5
  78. package/dist/cli/{feedback-CR55FJA2.js → feedback-4MSH7TFU.js} +7 -7
  79. package/dist/cli/{feedback-4CEBR3OV.mjs → feedback-CCLTS5SV.mjs} +3 -3
  80. package/dist/cli/{git-NM2PHHZ4.mjs → git-K2DHPMPC.mjs} +4 -4
  81. package/dist/cli/git-RNM45FX4.js +23 -0
  82. package/dist/cli/index.js +96 -92
  83. package/dist/cli/index.mjs +46 -42
  84. package/dist/cli/{legacy-noops-A7MSW5ND.mjs → legacy-noops-B5S4AR3P.mjs} +4 -4
  85. package/dist/cli/{legacy-noops-ZUA4YFIH.js → legacy-noops-GPNOPFXV.js} +7 -7
  86. package/dist/cli/{monitors-NVPRQYP3.mjs → monitors-JLMAIPRG.mjs} +6 -5
  87. package/dist/cli/{monitors-ZE3TLZ4H.js → monitors-ZAWD7NSN.js} +87 -86
  88. package/dist/cli/{org-U7A6DV5D.js → org-P2KN4CES.js} +66 -65
  89. package/dist/cli/{org-KUBILNQV.mjs → org-T3JTHP4G.mjs} +6 -5
  90. package/dist/cli/{play-HRDXQ4QE.mjs → play-NK6BLRGL.mjs} +11 -10
  91. package/dist/cli/play-PDXR6JFB.js +158 -0
  92. package/dist/cli/{providers-OHIWI453.mjs → providers-3NQRA7IT.mjs} +6 -5
  93. package/dist/cli/{providers-VD6YTVQZ.js → providers-5QRZN3DT.js} +9 -8
  94. package/dist/cli/{quickstart-UBV2FONF.mjs → quickstart-PIA2JGPV.mjs} +3 -3
  95. package/dist/cli/{quickstart-ETTCWPA4.js → quickstart-R7NUZGNW.js} +5 -5
  96. package/dist/cli/run-identity-G257GQED.js +25 -0
  97. package/dist/cli/run-identity-MRNCEGV2.mjs +25 -0
  98. package/dist/cli/{search-F44IZRT7.mjs → search-AIDIIGLY.mjs} +7 -6
  99. package/dist/cli/search-QRWL7MFM.js +27 -0
  100. package/dist/cli/{secrets-CAEMRORF.js → secrets-BT3PGMWN.js} +15 -14
  101. package/dist/cli/{secrets-R6XOJZKU.mjs → secrets-OQNHL45O.mjs} +6 -5
  102. package/dist/cli/{sessions-6GC7OFTT.js → sessions-EYXWOSWK.js} +5 -5
  103. package/dist/cli/{sessions-RLN6UQS3.mjs → sessions-SF7WJPJP.mjs} +4 -4
  104. package/dist/cli/{settings-DPNVUAV2.js → settings-BA3GHBOD.js} +76 -75
  105. package/dist/cli/{settings-KIPAMRPP.mjs → settings-Y57JTFDD.mjs} +9 -8
  106. package/dist/cli/{setup-TU2F7PU5.mjs → setup-7GR5GBHA.mjs} +6 -6
  107. package/dist/cli/{setup-DTL3L5SG.js → setup-RERXYC66.js} +41 -41
  108. package/dist/cli/{skills-UV5MYJ46.mjs → skills-SJWIQAV5.mjs} +4 -4
  109. package/dist/cli/skills-V7EY75HB.js +28 -0
  110. package/dist/cli/tools-H5HLBCHH.js +41 -0
  111. package/dist/cli/{tools-QRRNDCQ7.mjs → tools-ZF3JXPNL.mjs} +10 -9
  112. package/dist/cli/update-472HA3LT.js +28 -0
  113. package/dist/cli/{update-4426TF35.mjs → update-FFFYQAOJ.mjs} +6 -6
  114. package/dist/cli/{workflow-HNLOVISB.js → workflow-SZJVQH4T.js} +17 -16
  115. package/dist/cli/{workflow-N4U5VLZ3.mjs → workflow-XVFEEGAS.mjs} +7 -6
  116. package/dist/{client-e6Qh5ZIg.d.mts → client-DU5dtHDy.d.mts} +153 -4
  117. package/dist/{client-Uxuy-xQ2.d.ts → client-mCE88hC4.d.ts} +153 -4
  118. package/dist/{compiler-manifest-CY2v8ab0.d.ts → compiler-manifest-DE4RdAiY.d.mts} +61 -1
  119. package/dist/{compiler-manifest-CY2v8ab0.d.mts → compiler-manifest-DE4RdAiY.d.ts} +61 -1
  120. package/dist/{index-B9fBZH1g.d.mts → index-BI6nWgaV.d.mts} +1 -1
  121. package/dist/{index-BZ6uzZJl.d.ts → index-Bi-f7HFT.d.ts} +1 -1
  122. package/dist/index.d.mts +5 -5
  123. package/dist/index.d.ts +5 -5
  124. package/dist/index.js +120 -29
  125. package/dist/index.mjs +111 -20
  126. package/dist/install-integrity.json +91 -86
  127. package/dist/plays/bundle-play-file.d.mts +3 -3
  128. package/dist/plays/bundle-play-file.d.ts +3 -3
  129. package/dist/plays/bundle-play-file.mjs +2 -2
  130. package/dist/plays/run-request.d.mts +2 -2
  131. package/dist/plays/run-request.d.ts +2 -2
  132. package/dist/plays/run-request.js +5 -2
  133. package/dist/plays/run-request.mjs +4 -1
  134. package/dist/release.d.mts +4 -1
  135. package/dist/release.d.ts +4 -1
  136. package/dist/release.js +2 -2
  137. package/dist/release.mjs +1 -1
  138. package/package.json +1 -1
  139. package/dist/cli/auth-67TAELQL.js +0 -39
  140. package/dist/cli/git-I5JTK6YU.js +0 -23
  141. package/dist/cli/play-A2V7YDU7.js +0 -157
  142. package/dist/cli/search-WWXMBVPH.js +0 -26
  143. package/dist/cli/skills-SWOSEZLB.js +0 -28
  144. package/dist/cli/tools-IL2YCDQ6.js +0 -40
  145. package/dist/cli/update-BERDPEYR.js +0 -28
@@ -13,17 +13,17 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkQGKPTBRRjs = require('./chunk-QGKPTBRR.js');
16
+ var _chunkMS6GUPBBjs = require('./chunk-MS6GUPBB.js');
17
17
 
18
18
 
19
19
  var _chunkGSK6NHVMjs = require('./chunk-GSK6NHVM.js');
20
20
 
21
21
 
22
- var _chunkUCKJQG25js = require('./chunk-UCKJQG25.js');
22
+ var _chunkL2SYLGRPjs = require('./chunk-L2SYLGRP.js');
23
23
 
24
24
 
25
25
 
26
- var _chunk4SFPVW7Ajs = require('./chunk-4SFPVW7A.js');
26
+ var _chunkOXNOAD6Yjs = require('./chunk-OXNOAD6Y.js');
27
27
 
28
28
 
29
29
 
@@ -42,7 +42,7 @@ var _chunkGEJDBXXMjs = require('./chunk-GEJDBXXM.js');
42
42
 
43
43
 
44
44
 
45
- var _chunkCVLM3WMJjs = require('./chunk-CVLM3WMJ.js');
45
+ var _chunk2HAD745Vjs = require('./chunk-2HAD745V.js');
46
46
 
47
47
 
48
48
 
@@ -52,7 +52,7 @@ var _chunkCVLM3WMJjs = require('./chunk-CVLM3WMJ.js');
52
52
 
53
53
 
54
54
 
55
- var _chunkPAIMOGCMjs = require('./chunk-PAIMOGCM.js');
55
+ var _chunkUHNDVD3Pjs = require('./chunk-UHNDVD3P.js');
56
56
 
57
57
 
58
58
 
@@ -75,10 +75,10 @@ var _chunkWJYPBHTEjs = require('./chunk-WJYPBHTE.js');
75
75
 
76
76
 
77
77
 
78
- var _chunkRV6ALZIXjs = require('./chunk-RV6ALZIX.js');
78
+ var _chunkM7Y7JYZXjs = require('./chunk-M7Y7JYZX.js');
79
79
 
80
80
 
81
- var _chunkWMS5U6YBjs = require('./chunk-WMS5U6YB.js');
81
+ var _chunkCDFH2DYLjs = require('./chunk-CDFH2DYL.js');
82
82
 
83
83
 
84
84
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -2062,7 +2062,7 @@ function resolveField(key, command) {
2062
2062
  function printSettings(result, json, name) {
2063
2063
  result = { ...result, settings: parsePlaySettings(result.settings) };
2064
2064
  const selected = fields.filter(([key]) => !name || key === name);
2065
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2065
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2066
2066
  {
2067
2067
  ...result,
2068
2068
  settings: Object.fromEntries(
@@ -2106,7 +2106,7 @@ function registerPlaySettingsCommands(plays) {
2106
2106
  valueSyntax: field.cli.valueSyntax,
2107
2107
  examples: field.cli.examples
2108
2108
  }));
2109
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2109
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2110
2110
  {
2111
2111
  fields: descriptions,
2112
2112
  render: {
@@ -2131,7 +2131,7 @@ function registerPlaySettingsCommands(plays) {
2131
2131
  async (options, command) => {
2132
2132
  if (options.name !== void 0) resolveField(options.name, command);
2133
2133
  printSettings(
2134
- await new (0, _chunkCVLM3WMJjs.DeeplineClient)().getPlaySettings(options.play),
2134
+ await new (0, _chunk2HAD745Vjs.DeeplineClient)().getPlaySettings(options.play),
2135
2135
  options.json,
2136
2136
  options.name
2137
2137
  );
@@ -2162,7 +2162,7 @@ function registerPlaySettingsCommands(plays) {
2162
2162
  );
2163
2163
  }
2164
2164
  if (options.dryRun) {
2165
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2165
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2166
2166
  {
2167
2167
  dryRun: true,
2168
2168
  play,
@@ -2183,7 +2183,7 @@ function registerPlaySettingsCommands(plays) {
2183
2183
  return;
2184
2184
  }
2185
2185
  printSettings(
2186
- await new (0, _chunkCVLM3WMJjs.DeeplineClient)().updatePlaySettings(play, patch),
2186
+ await new (0, _chunk2HAD745Vjs.DeeplineClient)().updatePlaySettings(play, patch),
2187
2187
  options.json
2188
2188
  );
2189
2189
  };
@@ -2209,13 +2209,13 @@ function registerPlaySettingsCommands(plays) {
2209
2209
  "--root must be person or team; --limit must be 1\u2013100.",
2210
2210
  { exitCode: 2 }
2211
2211
  );
2212
- const page = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().listPlaySettingsPaths({
2212
+ const page = await new (0, _chunk2HAD745Vjs.DeeplineClient)().listPlaySettingsPaths({
2213
2213
  root: options.root,
2214
2214
  limit,
2215
2215
  cursor: options.cursor
2216
2216
  });
2217
2217
  const nextCommand = page.hasMore ? `deepline plays settings paths --cursor '${page.cursor}'${options.root ? ` --root ${options.root}` : ""}` : null;
2218
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2218
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2219
2219
  {
2220
2220
  ...page,
2221
2221
  nextCommand,
@@ -2266,7 +2266,7 @@ function registerPlaySettingsCommands(plays) {
2266
2266
  root: _nullishCoalesce(_optionalChain([toPath, 'optionalAccess', _13 => _13.root]), () => ( "person")),
2267
2267
  folders: _nullishCoalesce(_optionalChain([toPath, 'optionalAccess', _14 => _14.folders]), () => ( []))
2268
2268
  };
2269
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
2269
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
2270
2270
  const paths = [];
2271
2271
  let cursor;
2272
2272
  do {
@@ -2328,7 +2328,7 @@ function registerPlaySettingsCommands(plays) {
2328
2328
  moved.push(move.playName);
2329
2329
  }
2330
2330
  }
2331
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2331
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2332
2332
  {
2333
2333
  dryRun: Boolean(options.dryRun),
2334
2334
  from: options.from,
@@ -2456,7 +2456,7 @@ function triggerLines(view) {
2456
2456
  return lines;
2457
2457
  }
2458
2458
  function printView(view, json) {
2459
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2459
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2460
2460
  {
2461
2461
  ...view,
2462
2462
  render: {
@@ -2469,7 +2469,7 @@ function printView(view, json) {
2469
2469
  );
2470
2470
  }
2471
2471
  function printResult(result, json) {
2472
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2472
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2473
2473
  {
2474
2474
  ...result,
2475
2475
  render: {
@@ -2499,7 +2499,7 @@ async function mutate(command, options, build) {
2499
2499
  usage(command, `Invalid trigger: ${formatPlayTriggerConfigError(error)}`);
2500
2500
  }
2501
2501
  if (options.dryRun) {
2502
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
2502
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
2503
2503
  {
2504
2504
  dryRun: true,
2505
2505
  play: options.play,
@@ -2518,7 +2518,7 @@ async function mutate(command, options, build) {
2518
2518
  return;
2519
2519
  }
2520
2520
  printResult(
2521
- await new (0, _chunkCVLM3WMJjs.DeeplineClient)().updatePlayTriggerConfig(options.play, update),
2521
+ await new (0, _chunk2HAD745Vjs.DeeplineClient)().updatePlayTriggerConfig(options.play, update),
2522
2522
  options.json
2523
2523
  );
2524
2524
  }
@@ -2551,7 +2551,7 @@ function registerPlayTriggerConfigCommands(plays) {
2551
2551
  }).addHelpText("after", help2);
2552
2552
  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) => {
2553
2553
  printView(
2554
- await new (0, _chunkCVLM3WMJjs.DeeplineClient)().getPlayTriggerConfig(options.play),
2554
+ await new (0, _chunk2HAD745Vjs.DeeplineClient)().getPlayTriggerConfig(options.play),
2555
2555
  options.json
2556
2556
  );
2557
2557
  });
@@ -2595,7 +2595,7 @@ function registerPlayTriggerConfigCommands(plays) {
2595
2595
  if (options.auth === void 0) {
2596
2596
  if (secrets.length || options.header || options.signaturePrefix)
2597
2597
  usage(setWebhook, "--secret/--header need --auth.");
2598
- const current = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().getPlayTriggerConfig(
2598
+ const current = await new (0, _chunk2HAD745Vjs.DeeplineClient)().getPlayTriggerConfig(
2599
2599
  options.play
2600
2600
  );
2601
2601
  return {
@@ -2672,7 +2672,7 @@ var KIND_DESCRIPTIONS = {
2672
2672
  "receipt.skipped": "Saved work result: skipped.",
2673
2673
  "runtime.event": "Other event."
2674
2674
  };
2675
- var RUN_LOGS_KIND_HELP = _chunkCVLM3WMJjs.RUN_EVENT_SEARCH_KIND_VALUES.map((kind) => ({
2675
+ var RUN_LOGS_KIND_HELP = _chunk2HAD745Vjs.RUN_EVENT_SEARCH_KIND_VALUES.map((kind) => ({
2676
2676
  kind,
2677
2677
  description: KIND_DESCRIPTIONS[kind]
2678
2678
  }));
@@ -2809,9 +2809,9 @@ function configureRunQueryCommandErrors(command, resource) {
2809
2809
  const args = program.args;
2810
2810
  if (error.exitCode !== 0 && (resource === "events" || requestsStructuredLogs(args))) {
2811
2811
  error.exitCode = 2;
2812
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args) || command.optsWithGlobals().json === true) {
2813
- _chunkRV6ALZIXjs.printJsonError.call(void 0,
2814
- Object.assign(new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(error.message), {
2812
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) || command.optsWithGlobals().json === true) {
2813
+ _chunkM7Y7JYZXjs.printJsonError.call(void 0,
2814
+ Object.assign(new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(error.message), {
2815
2815
  exitCode: 2,
2816
2816
  retryable: false
2817
2817
  })
@@ -2855,14 +2855,14 @@ function parseQuery(args, resource) {
2855
2855
  if (VALUE_FLAGS.has(flag)) {
2856
2856
  const value = equals > 0 ? arg.slice(equals + 1) : args[++index];
2857
2857
  if (!value || equals < 0 && value.startsWith("--") && flag !== "--query" && flag !== "--where") {
2858
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2858
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2859
2859
  `${flag} requires a value. Use ${flag} <value>.`
2860
2860
  );
2861
2861
  }
2862
2862
  if (flag === "--sum") sums.push(value);
2863
2863
  else {
2864
2864
  if (values[flag] !== void 0) {
2865
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2865
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2866
2866
  `${flag} may only be supplied once.`
2867
2867
  );
2868
2868
  }
@@ -2876,12 +2876,12 @@ function parseQuery(args, resource) {
2876
2876
  }
2877
2877
  if (arg.startsWith("-")) {
2878
2878
  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.";
2879
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2879
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2880
2880
  `Unsupported query flag ${flag}. ${correction}`
2881
2881
  );
2882
2882
  }
2883
2883
  if (runId !== void 0) {
2884
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2884
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2885
2885
  `Unexpected argument ${JSON.stringify(arg)}. Supply one run ID.`
2886
2886
  );
2887
2887
  }
@@ -2889,7 +2889,7 @@ function parseQuery(args, resource) {
2889
2889
  }
2890
2890
  if (switches.has("--fields")) {
2891
2891
  if (runId !== void 0) {
2892
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2892
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2893
2893
  "--fields does not use a run ID. Omit the positional run ID."
2894
2894
  );
2895
2895
  }
@@ -2902,18 +2902,18 @@ function parseQuery(args, resource) {
2902
2902
  )
2903
2903
  ];
2904
2904
  if (incompatible.length) {
2905
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2905
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2906
2906
  `--fields cannot be combined with ${incompatible.join(", ")}. Use --fields alone to discover the query contract.`
2907
2907
  );
2908
2908
  }
2909
2909
  }
2910
2910
  if (switches.has("--count") && values["--group-by"] !== void 0) {
2911
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2911
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2912
2912
  "--count cannot be combined with --group-by. Use --group-by for counts per group."
2913
2913
  );
2914
2914
  }
2915
2915
  if (sums.length && switches.has("--count")) {
2916
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2916
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2917
2917
  "--sum cannot be combined with --count. Use --sum for the exact count and numeric total."
2918
2918
  );
2919
2919
  }
@@ -2921,7 +2921,7 @@ function parseQuery(args, resource) {
2921
2921
  if (operation === "count") {
2922
2922
  for (const flag of ["--limit", "--cursor", "--payloads"]) {
2923
2923
  if (values[flag] !== void 0 || switches.has(flag)) {
2924
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2924
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2925
2925
  `--count cannot be combined with ${flag}. Remove ${flag} to count all matching retained records.`
2926
2926
  );
2927
2927
  }
@@ -2956,16 +2956,16 @@ function parseQuery(args, resource) {
2956
2956
  ];
2957
2957
  }
2958
2958
  }
2959
- const request = _chunkCVLM3WMJjs.normalizeRunEventOperationRequest.call(void 0, body);
2959
+ const request = _chunk2HAD745Vjs.normalizeRunEventOperationRequest.call(void 0, body);
2960
2960
  const namespace = _nullishCoalesce(values["--runtime-namespace"], () => ( (process.env.DEEPLINE_RUNTIME_ENVIRONMENT === "preview" ? process.env.DEEPLINE_RUNTIME_NAMESPACE : void 0)));
2961
2961
  const backend = values["--runtime-backend"];
2962
2962
  if (backend && backend !== "daytona" && backend !== "modal") {
2963
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2963
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2964
2964
  "--runtime-backend must be daytona or modal."
2965
2965
  );
2966
2966
  }
2967
2967
  if (backend && !namespace) {
2968
- throw new (0, _chunkCVLM3WMJjs.RunEventQueryInputError)(
2968
+ throw new (0, _chunk2HAD745Vjs.RunEventQueryInputError)(
2969
2969
  "--runtime-backend requires --runtime-namespace."
2970
2970
  );
2971
2971
  }
@@ -3012,12 +3012,12 @@ async function handleRunEventQuery(args, resource = "logs") {
3012
3012
  const failure = error instanceof Error ? error : new Error(String(error));
3013
3013
  const record3 = failure;
3014
3014
  const status = record3.statusCode;
3015
- const exitCode = error instanceof _chunkCVLM3WMJjs.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;
3015
+ const exitCode = error instanceof _chunk2HAD745Vjs.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;
3016
3016
  const diagnostic = Object.assign(failure, {
3017
3017
  exitCode,
3018
3018
  retryable: exitCode === 5
3019
3019
  });
3020
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) _chunkRV6ALZIXjs.printJsonError.call(void 0, diagnostic);
3020
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) _chunkM7Y7JYZXjs.printJsonError.call(void 0, diagnostic);
3021
3021
  else console.error(`Error: ${diagnostic.message}`);
3022
3022
  return exitCode;
3023
3023
  }
@@ -3032,7 +3032,7 @@ async function executeRunEventQuery(args, resource) {
3032
3032
  ...criteria
3033
3033
  } = request;
3034
3034
  const options = { ...criteria, ...runtime ? { runtime } : {} };
3035
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
3035
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
3036
3036
  let result;
3037
3037
  if (request.operation === "fields") {
3038
3038
  result = await client.runs[resource].fields(runtime ? { runtime } : {});
@@ -3098,13 +3098,13 @@ async function executeRunEventQuery(args, resource) {
3098
3098
  lines.push(`Next page: ${nextPage}`);
3099
3099
  }
3100
3100
  }
3101
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
3101
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
3102
3102
  {
3103
3103
  ...result,
3104
3104
  ...nextPage ? { next: { page: nextPage } } : {},
3105
3105
  render: { sections: [{ title: `run ${resource}`, lines }] }
3106
3106
  },
3107
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args), text: `${lines.join("\n")}
3107
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args), text: `${lines.join("\n")}
3108
3108
  ` }
3109
3109
  );
3110
3110
  return 0;
@@ -3175,7 +3175,7 @@ function rowCountsFrom(input) {
3175
3175
  return { completed: c, failed: f, total: known };
3176
3176
  }
3177
3177
  function decodeRunStatus(status) {
3178
- return _chunkPAIMOGCMjs.decodePlayRunPublicStatus.call(void 0, status);
3178
+ return _chunkUHNDVD3Pjs.decodePlayRunPublicStatus.call(void 0, status);
3179
3179
  }
3180
3180
  function deriveRunExecutionState(input) {
3181
3181
  const status = decodeRunStatus(input.status);
@@ -3924,7 +3924,7 @@ function checkedRunExample(plays, target) {
3924
3924
  const quote = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
3925
3925
  const base = `deepline plays run --file ${quote(target)}`;
3926
3926
  return {
3927
- command: `${base}${_chunkCVLM3WMJjs.playInputExampleArgs.call(void 0, schema)}`,
3927
+ command: `${base}${_chunk2HAD745Vjs.playInputExampleArgs.call(void 0, schema)}`,
3928
3928
  note: "Runs the local file without publishing and may spend credits. Supply the indicated file; JSON input must match inputSchema."
3929
3929
  };
3930
3930
  }
@@ -4022,7 +4022,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4022
4022
  ...text.split(/\r?\n/).map((key) => key.trim()).filter(Boolean)
4023
4023
  );
4024
4024
  }
4025
- const response = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().runs.getReceipts(runId, {
4025
+ const response = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.getReceipts(runId, {
4026
4026
  keys
4027
4027
  });
4028
4028
  const failed = response.receipts.filter(
@@ -4034,7 +4034,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4034
4034
  JSON.stringify(response, null, 2) + "\n",
4035
4035
  { flag: "wx", mode: 384 }
4036
4036
  );
4037
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
4037
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
4038
4038
  {
4039
4039
  runId,
4040
4040
  out: options.out,
@@ -4044,7 +4044,7 @@ Existing credential redactions and referenced-list previews remain as stored.
4044
4044
  { json: true }
4045
4045
  );
4046
4046
  } else {
4047
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, { ...response }, { json: true });
4047
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, { ...response }, { json: true });
4048
4048
  }
4049
4049
  if (failed)
4050
4050
  process.exitCode = response.receipts.some(
@@ -4083,7 +4083,7 @@ includes nextCommand when another page is available.
4083
4083
  { exitCode: 2 }
4084
4084
  );
4085
4085
  }
4086
- const page = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().runs.children(parentRunId, {
4086
+ const page = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.children(parentRunId, {
4087
4087
  launchKey: options.launchKey,
4088
4088
  ...options.cursor !== void 0 ? { cursor: options.cursor } : {},
4089
4089
  limit
@@ -4098,7 +4098,7 @@ includes nextCommand when another page is available.
4098
4098
  "--limit",
4099
4099
  String(limit)
4100
4100
  ].join(" ") : null;
4101
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
4101
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
4102
4102
  {
4103
4103
  parentRunId,
4104
4104
  launchKey: options.launchKey,
@@ -4134,7 +4134,7 @@ async function handleRunsHistory(options) {
4134
4134
  throw new Error("--limit must be a positive integer.");
4135
4135
  }
4136
4136
  }
4137
- const page = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().runs.history({
4137
+ const page = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.history({
4138
4138
  cursor: options.cursor,
4139
4139
  orgId: options.org,
4140
4140
  search: options.search,
@@ -4150,7 +4150,7 @@ async function handleRunsHistory(options) {
4150
4150
  );
4151
4151
  }
4152
4152
  if (page.hasMore) lines.push(`Next cursor: ${page.nextCursor}`);
4153
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
4153
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
4154
4154
  { ...page, render: { sections: [{ title: "Run history", lines }] } },
4155
4155
  options.json ? { json: true } : {}
4156
4156
  );
@@ -4202,12 +4202,12 @@ async function runRunsRerunCommand(runId, options) {
4202
4202
  return 1;
4203
4203
  }
4204
4204
  }
4205
- const result = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().runs.rerun(runId, {
4205
+ const result = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.rerun(runId, {
4206
4206
  ...idempotencyKey === void 0 ? {} : { idempotencyKey },
4207
4207
  ...inputOverrides === void 0 ? {} : { inputOverrides }
4208
4208
  });
4209
- if (_chunkRV6ALZIXjs.shouldEmitJson.call(void 0, options.json)) {
4210
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, result, { json: true });
4209
+ if (_chunkM7Y7JYZXjs.shouldEmitJson.call(void 0, options.json)) {
4210
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, result, { json: true });
4211
4211
  } else {
4212
4212
  console.log(
4213
4213
  result.deduplicated === true ? `
@@ -4475,7 +4475,7 @@ function projectRunDatasetCell(value) {
4475
4475
  const logicalValue = parseSerializedDatasetValue(value);
4476
4476
  if (logicalValue === null || logicalValue === void 0) return logicalValue;
4477
4477
  if (typeof logicalValue === "object") {
4478
- return _chunkRV6ALZIXjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
4478
+ return _chunkM7Y7JYZXjs.csvSafeJsonString.call(void 0, canonicalDatasetJson(logicalValue));
4479
4479
  }
4480
4480
  return logicalValue;
4481
4481
  }
@@ -5562,6 +5562,13 @@ function resolveDaytonaSandboxComputeItem(input) {
5562
5562
  };
5563
5563
  }
5564
5564
 
5565
+ // ../play-runtime/runtime-constants.ts
5566
+ var STANDARD_PLAY_RUNTIME_LIMIT_SECONDS = 30 * 60;
5567
+ var PLAY_RUNNER_TERMINAL_GRACE_SECONDS = 90;
5568
+ var PLAY_RUNNER_STARTUP_GRACE_SECONDS = 4 * 60;
5569
+ var PLAY_RUNNER_TIMEOUT_SECONDS = 40 * 60;
5570
+ var WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS = MAX_PLAY_SANDBOX_RUNTIME_LIMITS.timeoutSeconds + (PLAY_RUNNER_TIMEOUT_SECONDS - STANDARD_PLAY_RUNTIME_LIMIT_SECONDS);
5571
+
5565
5572
  // ../billing/compute-pricing-contract.ts
5566
5573
  var COMPUTE_BILLING_MARKUP_MULTIPLIER = 5;
5567
5574
  var DEFAULT_USD_PER_CUSTOMER_CREDIT = 0.1;
@@ -5570,10 +5577,13 @@ function roundUpCredits(value) {
5570
5577
  if (!Number.isFinite(value) || value <= 0) return 0;
5571
5578
  return Math.ceil(value * 100) / 100;
5572
5579
  }
5580
+ function maximumPlaySandboxBillingSeconds(limits) {
5581
+ return limits.timeoutSeconds + PLAY_RUNNER_TERMINAL_GRACE_SECONDS;
5582
+ }
5573
5583
  function estimateDaytonaMaximumComputeCredits(limits) {
5574
5584
  const item = resolveDaytonaSandboxComputeItem({
5575
5585
  itemId: "estimate",
5576
- wallTimeSeconds: limits.timeoutSeconds,
5586
+ wallTimeSeconds: maximumPlaySandboxBillingSeconds(limits),
5577
5587
  cpu: limits.cpu,
5578
5588
  memoryGiB: limits.memoryGiB,
5579
5589
  diskGiB: limits.diskGiB
@@ -5999,10 +6009,10 @@ function resolveOwnedPlayReferenceName(reference, ownerSlug) {
5999
6009
  // ../plays/deploy/run-deployment.ts
6000
6010
  var RUN_PLAY_METHOD_NAMES = /* @__PURE__ */ new Set(["runPlay", "runPlayAsync"]);
6001
6011
  function isRunPlayReceiver(node) {
6002
- return _chunkQGKPTBRRjs.isAstNode.call(void 0, node) && node.type === "Identifier" && typeof node.name === "string" && (node.name === "ctx" || node.name.endsWith("Ctx"));
6012
+ return _chunkMS6GUPBBjs.isAstNode.call(void 0, node) && node.type === "Identifier" && typeof node.name === "string" && (node.name === "ctx" || node.name.endsWith("Ctx"));
6003
6013
  }
6004
6014
  function stringLiteralValue(node) {
6005
- if (!_chunkQGKPTBRRjs.isAstNode.call(void 0, node)) return null;
6015
+ if (!_chunkMS6GUPBBjs.isAstNode.call(void 0, node)) return null;
6006
6016
  if (node.type === "Literal" && typeof node.value === "string") {
6007
6017
  return node.value;
6008
6018
  }
@@ -6013,12 +6023,12 @@ function stringLiteralValue(node) {
6013
6023
  return null;
6014
6024
  }
6015
6025
  async function extractRunPlayStringTargets(sourceCode) {
6016
- const program = _chunkQGKPTBRRjs.parsePlaySourceForAnalysis.call(void 0, sourceCode);
6026
+ const program = _chunkMS6GUPBBjs.parsePlaySourceForAnalysis.call(void 0, sourceCode);
6017
6027
  if (!program) return await _asyncNullishCoalesce(await extractWithCompiler(sourceCode), async () => ( []));
6018
6028
  const targets = /* @__PURE__ */ new Set();
6019
6029
  const visit = (node) => {
6020
6030
  const callee = node.callee;
6021
- if (node.type === "CallExpression" && _chunkQGKPTBRRjs.isAstNode.call(void 0, callee) && callee.type === "MemberExpression" && callee.computed !== true && _chunkQGKPTBRRjs.isAstNode.call(void 0, callee.property) && RUN_PLAY_METHOD_NAMES.has(String(callee.property.name)) && isRunPlayReceiver(callee.object) && Array.isArray(node.arguments)) {
6031
+ if (node.type === "CallExpression" && _chunkMS6GUPBBjs.isAstNode.call(void 0, callee) && callee.type === "MemberExpression" && callee.computed !== true && _chunkMS6GUPBBjs.isAstNode.call(void 0, callee.property) && RUN_PLAY_METHOD_NAMES.has(String(callee.property.name)) && isRunPlayReceiver(callee.object) && Array.isArray(node.arguments)) {
6022
6032
  const playRef = stringLiteralValue(node.arguments[1]);
6023
6033
  const ownedName = playRef === null ? null : resolveOwnedPlayReferenceName(playRef);
6024
6034
  if (ownedName) targets.add(ownedName);
@@ -6026,7 +6036,7 @@ async function extractRunPlayStringTargets(sourceCode) {
6026
6036
  for (const [key, value] of Object.entries(node)) {
6027
6037
  if (key === "loc") continue;
6028
6038
  for (const child of Array.isArray(value) ? value : [value]) {
6029
- if (_chunkQGKPTBRRjs.isAstNode.call(void 0, child)) visit(child);
6039
+ if (_chunkMS6GUPBBjs.isAstNode.call(void 0, child)) visit(child);
6030
6040
  }
6031
6041
  }
6032
6042
  };
@@ -6892,7 +6902,7 @@ function renderOutcome(outcome) {
6892
6902
  function printResult2(input) {
6893
6903
  const failed = input.status === "failed" || input.status === "cancelled";
6894
6904
  if (failed) process.exitCode = 1;
6895
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
6905
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
6896
6906
  {
6897
6907
  deployment: { ...input.deployment, status: input.status },
6898
6908
  plays: input.outcomes,
@@ -6917,7 +6927,7 @@ async function handlePlaysDeploy(directory, options) {
6917
6927
  const root = await _promises.realpath.call(void 0, _path.resolve.call(void 0, _nullishCoalesce(directory, () => ( ".")))).catch(() => {
6918
6928
  throw new Error(`No such directory: ${_path.resolve.call(void 0, _nullishCoalesce(directory, () => ( ".")))}`);
6919
6929
  });
6920
- const { http, config } = _chunkRV6ALZIXjs.getAuthedHttpClient.call(void 0, );
6930
+ const { http, config } = _chunkM7Y7JYZXjs.getAuthedHttpClient.call(void 0, );
6921
6931
  const deliveryId = `local:${_crypto.randomUUID.call(void 0, )}`;
6922
6932
  const startDeployment = () => http.post("/api/v2/deployments", {
6923
6933
  deliveryId,
@@ -6944,7 +6954,7 @@ async function handlePlaysDeploy(directory, options) {
6944
6954
  },
6945
6955
  {
6946
6956
  bundle: bundleDeployPlayFile,
6947
- fetchImpl: _chunkWMS5U6YBjs.fetchWithDeploymentProtection,
6957
+ fetchImpl: _chunkCDFH2DYLjs.fetchWithDeploymentProtection,
6948
6958
  // The plays are already here: "opening" the source is naming it.
6949
6959
  openSource: async () => ({
6950
6960
  open: async () => ({ repoRoot: root })
@@ -7512,17 +7522,19 @@ function parseInputFlagValue(raw) {
7512
7522
  return raw;
7513
7523
  }
7514
7524
  function parsePlayRunOptions(args, initialInput = null) {
7515
- const selection = _chunkRV6ALZIXjs.parseJsonFields.call(void 0, args, "run");
7525
+ const selection = _chunkM7Y7JYZXjs.parseJsonFields.call(void 0, args, "run");
7516
7526
  args = selection.args;
7517
7527
  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.";
7518
7528
  let filePath = null;
7519
7529
  let playName = null;
7520
7530
  let input = initialInput === null ? null : structuredClone(initialInput);
7521
7531
  let revisionId = null;
7532
+ let workflowId = null;
7533
+ let maxTotalCredits = null;
7522
7534
  let revisionSelector = null;
7523
7535
  const watch = !args.includes("--no-wait");
7524
7536
  const dryRun = args.includes("--dry-run");
7525
- let jsonOutput = dryRun ? _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) : watch ? args.includes("--json") : _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
7537
+ let jsonOutput = dryRun ? _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) : watch ? args.includes("--json") : _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
7526
7538
  const fullJson = args.includes("--full");
7527
7539
  const force = args.includes("--force");
7528
7540
  const forceToolRefresh = args.includes("--force-tool-refresh");
@@ -7539,6 +7551,22 @@ function parsePlayRunOptions(args, initialInput = null) {
7539
7551
  let headers = null;
7540
7552
  for (let index = 0; index < args.length; index += 1) {
7541
7553
  const arg = args[index];
7554
+ if (arg === "--workflow-id") {
7555
+ const value = args[++index];
7556
+ if (!value || value.startsWith("--"))
7557
+ throw new Error("--workflow-id requires the original caller run ID.");
7558
+ workflowId = value;
7559
+ continue;
7560
+ }
7561
+ if (arg === "--max-total-credits") {
7562
+ const value = args[++index];
7563
+ if (value === void 0 || value.trim() === "" || !Number.isFinite(Number(value)) || Number(value) < 0)
7564
+ throw new Error(
7565
+ "--max-total-credits requires a non-negative number, including zero."
7566
+ );
7567
+ maxTotalCredits = Number(value);
7568
+ continue;
7569
+ }
7542
7570
  if (arg === "--header" || arg.startsWith("--header=")) {
7543
7571
  const raw = arg === "--header" ? args[index + 1] : arg.slice("--header=".length);
7544
7572
  if (raw === void 0 || arg === "--header" && raw.startsWith("--")) {
@@ -7569,7 +7597,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7569
7597
  "--log-level requires one of: debug, info, warn, error."
7570
7598
  );
7571
7599
  }
7572
- const parsed = _chunkCVLM3WMJjs.parseLogLevel.call(void 0, value);
7600
+ const parsed = _chunk2HAD745Vjs.parseLogLevel.call(void 0, value);
7573
7601
  if (!parsed) {
7574
7602
  throw new Error(
7575
7603
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -7606,7 +7634,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7606
7634
  throw new Error("--profile requires an execution profile id.");
7607
7635
  }
7608
7636
  profile = value.trim();
7609
- _chunkQGKPTBRRjs.resolveEnabledExecutionProfile.call(void 0, profile);
7637
+ _chunkMS6GUPBBjs.resolveEnabledExecutionProfile.call(void 0, profile);
7610
7638
  index += 1;
7611
7639
  continue;
7612
7640
  }
@@ -7693,12 +7721,12 @@ function parsePlayRunOptions(args, initialInput = null) {
7693
7721
  }
7694
7722
  if (arg === "--debug" && args[index + 1] && !args[index + 1].startsWith("--")) {
7695
7723
  input ??= {};
7696
- _chunkPAIMOGCMjs.setDottedInputValue.call(void 0, input, "debug", parseInputFlagValue(args[++index]));
7724
+ _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0, input, "debug", parseInputFlagValue(args[++index]));
7697
7725
  continue;
7698
7726
  }
7699
7727
  if (arg.startsWith("--debug=")) {
7700
7728
  input ??= {};
7701
- _chunkPAIMOGCMjs.setDottedInputValue.call(void 0,
7729
+ _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0,
7702
7730
  input,
7703
7731
  "debug",
7704
7732
  parseInputFlagValue(arg.slice("--debug=".length))
@@ -7726,7 +7754,7 @@ function parsePlayRunOptions(args, initialInput = null) {
7726
7754
  if (arg.startsWith("--")) {
7727
7755
  const { path, value } = parseInputFieldFlag(arg, args[index + 1]);
7728
7756
  input ??= {};
7729
- _chunkPAIMOGCMjs.setDottedInputValue.call(void 0, input, path, parseInputFlagValue(value));
7757
+ _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0, input, path, parseInputFlagValue(value));
7730
7758
  if (!arg.includes("=")) {
7731
7759
  index += 1;
7732
7760
  }
@@ -7777,6 +7805,8 @@ function parsePlayRunOptions(args, initialInput = null) {
7777
7805
  target: filePath ? { kind: "file", path: filePath } : { kind: "name", name: playName },
7778
7806
  input,
7779
7807
  revisionId,
7808
+ workflowId,
7809
+ maxTotalCredits,
7780
7810
  revisionSelector,
7781
7811
  watch,
7782
7812
  emitLogs,
@@ -7813,7 +7843,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7813
7843
  let initialInput = options.input === void 0 ? null : parseJsonInput(options.input);
7814
7844
  if (typeof options.debug === "string") {
7815
7845
  initialInput ??= {};
7816
- _chunkPAIMOGCMjs.setDottedInputValue.call(void 0,
7846
+ _chunkUHNDVD3Pjs.setDottedInputValue.call(void 0,
7817
7847
  initialInput,
7818
7848
  "debug",
7819
7849
  parseInputFlagValue(options.debug)
@@ -7842,10 +7872,15 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7842
7872
  "--live, --latest, and --revision-id only apply to named plays."
7843
7873
  );
7844
7874
  const dryRun = _nullishCoalesce(options.dryRun, () => ( base.dryRun));
7875
+ const maxTotalCredits = options.maxTotalCredits === void 0 ? base.maxTotalCredits : Number(options.maxTotalCredits);
7876
+ if (maxTotalCredits !== null && (!Number.isFinite(maxTotalCredits) || maxTotalCredits < 0 || _optionalChain([options, 'access', _234 => _234.maxTotalCredits, 'optionalAccess', _235 => _235.trim, 'call', _236 => _236()]) === ""))
7877
+ throw new Error(
7878
+ "--max-total-credits requires a non-negative number, including zero."
7879
+ );
7845
7880
  if (dryRun && resolvedTarget.kind !== "file")
7846
7881
  throw new Error("--dry-run currently requires a local Play file.");
7847
- const profile = _nullishCoalesce(_optionalChain([stringOption, 'call', _234 => _234(options.profile, "--profile"), 'optionalAccess', _235 => _235.trim, 'call', _236 => _236()]), () => ( base.profile));
7848
- if (profile !== null) _chunkQGKPTBRRjs.resolveEnabledExecutionProfile.call(void 0, profile);
7882
+ const profile = _nullishCoalesce(_optionalChain([stringOption, 'call', _237 => _237(options.profile, "--profile"), 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]), () => ( base.profile));
7883
+ if (profile !== null) _chunkMS6GUPBBjs.resolveEnabledExecutionProfile.call(void 0, profile);
7849
7884
  const countOption = (value, flag) => {
7850
7885
  if (value === void 0) return void 0;
7851
7886
  if (!/^[1-9]\d*$/.test(value))
@@ -7880,7 +7915,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7880
7915
  const hasExplicitLogLevel = options.logLevel !== void 0 || inputArgs.some(
7881
7916
  (arg) => arg === "--log-level" || arg.startsWith("--log-level=")
7882
7917
  );
7883
- let logLevel = options.logLevel === void 0 ? base.logLevel : _chunkCVLM3WMJjs.parseLogLevel.call(void 0, options.logLevel);
7918
+ let logLevel = options.logLevel === void 0 ? base.logLevel : _chunk2HAD745Vjs.parseLogLevel.call(void 0, options.logLevel);
7884
7919
  if (!logLevel)
7885
7920
  throw new Error("--log-level requires one of: debug, info, warn, error.");
7886
7921
  const debugAlias = options.logs || options.debug === true || inputArgs.some(
@@ -7894,13 +7929,13 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7894
7929
  if (debugAlias || debugMapLatency && logLevel === "info")
7895
7930
  logLevel = "debug";
7896
7931
  const fullJson = _nullishCoalesce(options.full, () => ( base.fullJson));
7897
- const jsonFields = options.json === void 0 ? base.jsonFields : _chunkRV6ALZIXjs.parseJsonFields.call(void 0,
7898
- [...fullJson ? ["--full"] : [], ..._chunkRV6ALZIXjs.jsonFieldArgs.call(void 0, options.json)],
7932
+ const jsonFields = options.json === void 0 ? base.jsonFields : _chunkM7Y7JYZXjs.parseJsonFields.call(void 0,
7933
+ [...fullJson ? ["--full"] : [], ..._chunkM7Y7JYZXjs.jsonFieldArgs.call(void 0, options.json)],
7899
7934
  "run"
7900
7935
  ).fields;
7901
7936
  const watch = options.wait === false ? false : base.watch;
7902
7937
  const explicitJson = options.json !== void 0 ? options.json !== false : base.jsonOutput;
7903
- const jsonOutput = dryRun || !watch ? explicitJson || _chunkRV6ALZIXjs.argsWantJson.call(void 0, []) : explicitJson;
7938
+ const jsonOutput = dryRun || !watch ? explicitJson || _chunkM7Y7JYZXjs.argsWantJson.call(void 0, []) : explicitJson;
7904
7939
  const verboseLogs = Boolean(
7905
7940
  debugAlias || logLevel === "debug" || debugMapLatency
7906
7941
  );
@@ -7910,6 +7945,8 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
7910
7945
  dryRun,
7911
7946
  input: base.input,
7912
7947
  revisionId,
7948
+ workflowId: _nullishCoalesce(stringOption(options.workflowId, "--workflow-id"), () => ( base.workflowId)),
7949
+ maxTotalCredits,
7913
7950
  revisionSelector: options.live ? "live" : options.latest ? "latest" : base.revisionSelector,
7914
7951
  profile,
7915
7952
  fixtureBehavior,
@@ -7945,7 +7982,7 @@ function playAuthoringGraphPath(parent, filePath) {
7945
7982
  // src/cli/renderers/local-play-execution.ts
7946
7983
  function renderLocalPlayExecutionPlan(plan, options = {}) {
7947
7984
  if (options.dryRun) {
7948
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, { dryRun: true, ...plan }, { json: options.json });
7985
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, { dryRun: true, ...plan }, { json: options.json });
7949
7986
  return;
7950
7987
  }
7951
7988
  process.stderr.write(`Local Play execution plan: ${JSON.stringify(plan)}
@@ -8037,7 +8074,7 @@ async function preflightRunIdFile(path) {
8037
8074
  `Cannot write --run-id-file destination ${destination}: ${error instanceof Error ? error.message : String(error)}`
8038
8075
  );
8039
8076
  } finally {
8040
- await _optionalChain([handle, 'optionalAccess', _237 => _237.close, 'call', _238 => _238()]);
8077
+ await _optionalChain([handle, 'optionalAccess', _240 => _240.close, 'call', _241 => _241()]);
8041
8078
  await removeRunIdTempFile(tempPath);
8042
8079
  }
8043
8080
  return destination;
@@ -8091,9 +8128,9 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
8091
8128
  } catch (error) {
8092
8129
  if (error.code !== "EEXIST") throw error;
8093
8130
  const raced = await readRunIdFile(destination);
8094
- if (_optionalChain([raced, 'optionalAccess', _239 => _239.runId]) !== runId) {
8131
+ if (_optionalChain([raced, 'optionalAccess', _242 => _242.runId]) !== runId) {
8095
8132
  throw new Error(
8096
- `--run-id-file destination already records run ${_nullishCoalesce(_optionalChain([raced, 'optionalAccess', _240 => _240.runId]), () => ( "<invalid>"))}; refusing to replace it with ${runId}: ${destination}`
8133
+ `--run-id-file destination already records run ${_nullishCoalesce(_optionalChain([raced, 'optionalAccess', _243 => _243.runId]), () => ( "<invalid>"))}; refusing to replace it with ${runId}: ${destination}`
8097
8134
  );
8098
8135
  }
8099
8136
  if (!options.launchConfirmed || raced.launchConfirmed) return;
@@ -8109,7 +8146,7 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
8109
8146
  }
8110
8147
  }
8111
8148
  } finally {
8112
- await _optionalChain([handle, 'optionalAccess', _241 => _241.close, 'call', _242 => _242()]);
8149
+ await _optionalChain([handle, 'optionalAccess', _244 => _244.close, 'call', _245 => _245()]);
8113
8150
  await removeRunIdTempFile(tempPath);
8114
8151
  }
8115
8152
  }
@@ -8178,10 +8215,10 @@ function playReferenceMatchTokens(value) {
8178
8215
  return normalizePlayReferenceForMatch(value).split("-").filter((token) => token.length > 1 && token !== "to" && token !== "and");
8179
8216
  }
8180
8217
  function playSuggestionReference(play) {
8181
- if (_optionalChain([play, 'access', _243 => _243.reference, 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()])) {
8218
+ if (_optionalChain([play, 'access', _246 => _246.reference, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()])) {
8182
8219
  return play.reference.trim();
8183
8220
  }
8184
- const ownerSlug = _optionalChain([play, 'access', _246 => _246.ownerSlug, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
8221
+ const ownerSlug = _optionalChain([play, 'access', _249 => _249.ownerSlug, 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
8185
8222
  return ownerSlug ? `${ownerSlug}/${play.name}` : play.name;
8186
8223
  }
8187
8224
  function scorePlayReferenceSuggestion(requested, play) {
@@ -8197,8 +8234,8 @@ function scorePlayReferenceSuggestion(requested, play) {
8197
8234
  const reference = playSuggestionReference(play);
8198
8235
  const referenceNorm = normalizePlayReferenceForMatch(reference);
8199
8236
  const nameNorm = normalizePlayReferenceForMatch(play.name);
8200
- const candidateNamespace = reference.includes("/") ? _optionalChain([reference, 'access', _249 => _249.split, 'call', _250 => _250("/"), 'access', _251 => _251[0], 'optionalAccess', _252 => _252.toLowerCase, 'call', _253 => _253()]) : null;
8201
- const requestedNamespace = _nullishCoalesce(_optionalChain([parsed, 'access', _254 => _254.ownerSlug, 'optionalAccess', _255 => _255.toLowerCase, 'call', _256 => _256()]), () => ( null));
8237
+ 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;
8238
+ const requestedNamespace = _nullishCoalesce(_optionalChain([parsed, 'access', _257 => _257.ownerSlug, 'optionalAccess', _258 => _258.toLowerCase, 'call', _259 => _259()]), () => ( null));
8202
8239
  const aliases = (_nullishCoalesce(play.aliases, () => ( []))).map(normalizePlayReferenceForMatch);
8203
8240
  const searchable = [referenceNorm, nameNorm, ...aliases].filter(Boolean);
8204
8241
  const requestedTokens = playReferenceMatchTokens(requestedName);
@@ -8317,16 +8354,16 @@ async function buildPlayReferenceNotFoundError(input) {
8317
8354
  suggestions = [];
8318
8355
  }
8319
8356
  const sourceError = input.sourceError instanceof _chunk7P5AA3SNjs.DeeplineError ? input.sourceError : null;
8320
- const code = _optionalChain([sourceError, 'optionalAccess', _257 => _257.code]) && sourceError.code !== "API_ERROR" ? sourceError.code : "PLAY_NOT_FOUND";
8357
+ const code = _optionalChain([sourceError, 'optionalAccess', _260 => _260.code]) && sourceError.code !== "API_ERROR" ? sourceError.code : "PLAY_NOT_FOUND";
8321
8358
  return new (0, _chunk7P5AA3SNjs.DeeplineError)(
8322
8359
  buildPlayReferenceNotFoundMessage({
8323
8360
  requested: input.target,
8324
8361
  command: input.command,
8325
8362
  suggestions
8326
8363
  }),
8327
- _nullishCoalesce(_optionalChain([sourceError, 'optionalAccess', _258 => _258.statusCode]), () => ( 404)),
8364
+ _nullishCoalesce(_optionalChain([sourceError, 'optionalAccess', _261 => _261.statusCode]), () => ( 404)),
8328
8365
  code,
8329
- _optionalChain([sourceError, 'optionalAccess', _259 => _259.details])
8366
+ _optionalChain([sourceError, 'optionalAccess', _262 => _262.details])
8330
8367
  );
8331
8368
  }
8332
8369
  async function isMissingRunPlayReferenceError(input) {
@@ -8378,7 +8415,7 @@ function formatPlayReference(play) {
8378
8415
  if (play.reference) {
8379
8416
  return play.reference;
8380
8417
  }
8381
- const ownerSlug = _optionalChain([play, 'access', _260 => _260.ownerSlug, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]) || "org";
8418
+ const ownerSlug = _optionalChain([play, 'access', _263 => _263.ownerSlug, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]) || "org";
8382
8419
  return `${ownerSlug}/${play.name}`;
8383
8420
  }
8384
8421
  function formatPlayListReference(play) {
@@ -8408,7 +8445,7 @@ function materializeRemotePlaySource(input) {
8408
8445
  return null;
8409
8446
  }
8410
8447
  const entrySource = input.source.files[input.source.entryFile];
8411
- if (!_optionalChain([entrySource, 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()])) {
8448
+ if (!_optionalChain([entrySource, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()])) {
8412
8449
  return null;
8413
8450
  }
8414
8451
  const files = Object.entries(input.source.files);
@@ -8492,7 +8529,7 @@ function buildMissingDefinePlayError(filePath) {
8492
8529
  );
8493
8530
  }
8494
8531
  function extractPlayName(code, filePath) {
8495
- const definedPlayName = _chunkQGKPTBRRjs.extractDefinedPlayName.call(void 0, code);
8532
+ const definedPlayName = _chunkMS6GUPBBjs.extractDefinedPlayName.call(void 0, code);
8496
8533
  if (definedPlayName) {
8497
8534
  return definedPlayName;
8498
8535
  }
@@ -8571,7 +8608,7 @@ function collectLocalFileInputRefs(value, inputPath, key, out) {
8571
8608
  if (!trimmed || isUrlValue(trimmed)) {
8572
8609
  return;
8573
8610
  }
8574
- const keyIsCsvData = key === _chunkPAIMOGCMjs.CSV_DATA_INPUT_KEY;
8611
+ const keyIsCsvData = key === _chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY;
8575
8612
  const endsWithCsv = /\.csv$/i.test(trimmed);
8576
8613
  const looksLikeFile = /\.[a-z0-9]{1,8}$/i.test(trimmed);
8577
8614
  if (keyIsCsvData) {
@@ -8602,14 +8639,14 @@ function collectLocalFileInputRefs(value, inputPath, key, out) {
8602
8639
  }
8603
8640
  }
8604
8641
  function preflightLocalFileInputs(runtimeInput) {
8605
- if (_chunkPAIMOGCMjs.CSV_DATA_INPUT_KEY in runtimeInput) {
8606
- const csvValue = runtimeInput[_chunkPAIMOGCMjs.CSV_DATA_INPUT_KEY];
8642
+ if (_chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY in runtimeInput) {
8643
+ const csvValue = runtimeInput[_chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY];
8607
8644
  if (typeof csvValue === "string" && csvValue.trim().length === 0) {
8608
8645
  throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
8609
- `Input ${_chunkPAIMOGCMjs.CSV_DATA_INPUT_KEY} is an empty string. Provide a path to a CSV file (or a CSV URL). No run was created.`,
8646
+ `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.`,
8610
8647
  void 0,
8611
8648
  "PLAY_INPUT_FILE_PREFLIGHT",
8612
- { inputPath: _chunkPAIMOGCMjs.CSV_DATA_INPUT_KEY, reason: "csv_empty_string" }
8649
+ { inputPath: _chunkUHNDVD3Pjs.CSV_DATA_INPUT_KEY, reason: "csv_empty_string" }
8613
8650
  );
8614
8651
  }
8615
8652
  }
@@ -8676,7 +8713,7 @@ var NODE_STAGED_FILE_CODEC = {
8676
8713
  )
8677
8714
  };
8678
8715
  async function stageFileInputArgs(input) {
8679
- return _chunkPAIMOGCMjs.stageFileInputs.call(void 0, {
8716
+ return _chunkUHNDVD3Pjs.stageFileInputs.call(void 0, {
8680
8717
  stage: (files) => input.client.stagePlayFiles(files),
8681
8718
  runtimeInput: input.runtimeInput,
8682
8719
  bindings: input.bindings,
@@ -8700,7 +8737,7 @@ function stageFile(logicalPath, absolutePath) {
8700
8737
  logicalPath,
8701
8738
  contentBase64: buffer.toString("base64"),
8702
8739
  contentHash: _crypto.createHash.call(void 0, "sha256").update(buffer).digest("hex"),
8703
- contentType: _chunkPAIMOGCMjs.stagedFileContentType.call(void 0, absolutePath),
8740
+ contentType: _chunkUHNDVD3Pjs.stagedFileContentType.call(void 0, absolutePath),
8704
8741
  bytes: buffer.byteLength
8705
8742
  };
8706
8743
  }
@@ -8721,12 +8758,12 @@ function unresolvedPackagedFilesMessage(node) {
8721
8758
  const details = node.unresolvedFileReferences.map((unresolved) => `${unresolved.sourceFragment}: ${unresolved.message}`).join("; ");
8722
8759
  return `Failed to package local ctx.csv(...) files in ${node.filePath}: ${details}`;
8723
8760
  }
8724
- async function collectBundledPlayGraph(entryFile, profile = null, entryExportName = _chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT, options = {}) {
8761
+ async function collectBundledPlayGraph(entryFile, profile = null, entryExportName = _chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT, options = {}) {
8725
8762
  const playBundler = await loadPlayBundler();
8726
8763
  const nodes = /* @__PURE__ */ new Map();
8727
8764
  const diagnostics = [];
8728
8765
  const visited = /* @__PURE__ */ new Set();
8729
- const artifactKind = _chunkQGKPTBRRjs.resolveEnabledExecutionProfile.call(void 0, profile).artifactKind;
8766
+ const artifactKind = _chunkMS6GUPBBjs.resolveEnabledExecutionProfile.call(void 0, profile).artifactKind;
8730
8767
  const rootPath = normalizePlayPath(entryFile);
8731
8768
  const visit = async (filePath) => {
8732
8769
  const absolutePath = normalizePlayPath(filePath);
@@ -8735,7 +8772,7 @@ async function collectBundledPlayGraph(entryFile, profile = null, entryExportNam
8735
8772
  const bundleResult = await playBundler.bundlePlayFile(absolutePath, {
8736
8773
  target: artifactKind,
8737
8774
  ...options.cache === false ? { cache: false } : {},
8738
- ...absolutePath === rootPath && entryExportName !== _chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT ? { exportName: entryExportName } : {}
8775
+ ...absolutePath === rootPath && entryExportName !== _chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT ? { exportName: entryExportName } : {}
8739
8776
  });
8740
8777
  if (bundleResult.success === false) {
8741
8778
  diagnostics.push(
@@ -8786,7 +8823,7 @@ async function compileBundledPlayGraphManifests(client, graph) {
8786
8823
  const child = graph.nodes.get(
8787
8824
  normalizePlayPath(dependency.filePath)
8788
8825
  );
8789
- if (!_optionalChain([child, 'optionalAccess', _265 => _265.compilerManifest])) {
8826
+ if (!_optionalChain([child, 'optionalAccess', _268 => _268.compilerManifest])) {
8790
8827
  throw new Error(
8791
8828
  `Missing compiler manifest for imported dependency ${dependency.filePath}.`
8792
8829
  );
@@ -8822,7 +8859,7 @@ function missingPlayDescriptionMessage(node) {
8822
8859
  function collectPlayGraphAuthoringErrors(graph) {
8823
8860
  return [...graph.nodes.values()].flatMap((node) => [
8824
8861
  ...node.unresolvedFileReferences.length > 0 ? [unresolvedPackagedFilesMessage(node)] : [],
8825
- ..._optionalChain([node, 'access', _266 => _266.playDescription, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]) ? [] : [missingPlayDescriptionMessage(node)]
8862
+ ..._optionalChain([node, 'access', _269 => _269.playDescription, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]) ? [] : [missingPlayDescriptionMessage(node)]
8826
8863
  ]);
8827
8864
  }
8828
8865
  function assertPlayGraphAuthoring(graph) {
@@ -8875,7 +8912,7 @@ function formatTimestamp(value) {
8875
8912
  return date.toISOString();
8876
8913
  }
8877
8914
  function isoTimestamp(value) {
8878
- return _nullishCoalesce(_optionalChain([timestampDate, 'call', _269 => _269(value), 'optionalAccess', _270 => _270.toISOString, 'call', _271 => _271()]), () => ( null));
8915
+ return _nullishCoalesce(_optionalChain([timestampDate, 'call', _272 => _272(value), 'optionalAccess', _273 => _273.toISOString, 'call', _274 => _274()]), () => ( null));
8879
8916
  }
8880
8917
  function formatRunLine(run) {
8881
8918
  const credits = typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount2(run.billingTotalCredits)} credits` : "\u2014";
@@ -8883,7 +8920,7 @@ function formatRunLine(run) {
8883
8920
  }
8884
8921
  function playStatusErrorText(status) {
8885
8922
  const chunks = [];
8886
- const progressError = _optionalChain([status, 'access', _272 => _272.progress, 'optionalAccess', _273 => _273.error]);
8923
+ const progressError = _optionalChain([status, 'access', _275 => _275.progress, 'optionalAccess', _276 => _276.error]);
8887
8924
  if (typeof progressError === "string" && progressError.trim()) {
8888
8925
  chunks.push(progressError.trim());
8889
8926
  }
@@ -8909,7 +8946,7 @@ function playStatusErrorText(status) {
8909
8946
  function isRetryablePendingStartFailure(status) {
8910
8947
  if (status.status !== "failed") return false;
8911
8948
  if (status.runId && status.runId !== "pending") return false;
8912
- return _chunkCVLM3WMJjs.isTransientPlayRunReadError.call(void 0, new Error(playStatusErrorText(status)));
8949
+ return _chunk2HAD745Vjs.isTransientPlayRunReadError.call(void 0, new Error(playStatusErrorText(status)));
8913
8950
  }
8914
8951
  function pendingStartFailureStatus(input) {
8915
8952
  const message = input.error instanceof Error ? input.error.message : String(input.error);
@@ -8936,13 +8973,13 @@ var PLAY_PROGRESS_HEARTBEAT_INTERVAL_MS = 15e3;
8936
8973
  var PLAY_STATUS_HEARTBEAT_INTERVAL_MS = 15e3;
8937
8974
  function watchSurfaceReaches(state, provenance, level) {
8938
8975
  const minimumLevel = _nullishCoalesce(state.logLevel, () => ( (state.verbose ? "debug" : "info")));
8939
- if (!_chunkCVLM3WMJjs.logLevelReaches.call(void 0, level, minimumLevel)) {
8976
+ if (!_chunk2HAD745Vjs.logLevelReaches.call(void 0, level, minimumLevel)) {
8940
8977
  return false;
8941
8978
  }
8942
- if (_chunkCVLM3WMJjs.logProvenanceReaches.call(void 0, provenance, "watch")) {
8979
+ if (_chunk2HAD745Vjs.logProvenanceReaches.call(void 0, provenance, "watch")) {
8943
8980
  return true;
8944
8981
  }
8945
- return state.verbose === true && _chunkCVLM3WMJjs.logProvenanceReaches.call(void 0, provenance, "debug");
8982
+ return state.verbose === true && _chunk2HAD745Vjs.logProvenanceReaches.call(void 0, provenance, "debug");
8946
8983
  }
8947
8984
  function getEventPayload(event) {
8948
8985
  return event.payload && typeof event.payload === "object" ? event.payload : {};
@@ -8965,7 +9002,7 @@ function getRunIdFromLiveEvent(event) {
8965
9002
  if (typeof directRunId === "string" && directRunId.trim()) {
8966
9003
  return directRunId;
8967
9004
  }
8968
- const packageRunId = _optionalChain([getRunRecordFromPackage, 'call', _274 => _274(payload), 'optionalAccess', _275 => _275.id]);
9005
+ const packageRunId = _optionalChain([getRunRecordFromPackage, 'call', _277 => _277(payload), 'optionalAccess', _278 => _278.id]);
8969
9006
  return typeof packageRunId === "string" && packageRunId.trim() ? packageRunId : null;
8970
9007
  }
8971
9008
  function eventConfirmsPlayRunLaunch(event) {
@@ -8986,19 +9023,19 @@ function getStatusFromLiveEvent(event) {
8986
9023
  return null;
8987
9024
  }
8988
9025
  const payload = getEventPayload(event);
8989
- return _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([getRunRecordFromPackage, 'call', _276 => _276(payload), 'optionalAccess', _277 => _277.status]))));
9026
+ return _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([getRunRecordFromPackage, 'call', _279 => _279(payload), 'optionalAccess', _280 => _280.status]))));
8990
9027
  }
8991
9028
  function readLiveRunField(event, field) {
8992
9029
  const payload = getEventPayload(event);
8993
9030
  if (field === "waitKind") {
8994
- const wait = _nullishCoalesce(payload.wait, () => ( _optionalChain([getRunRecordFromPackage, 'call', _278 => _278(payload), 'optionalAccess', _279 => _279.wait])));
9031
+ const wait = _nullishCoalesce(payload.wait, () => ( _optionalChain([getRunRecordFromPackage, 'call', _281 => _281(payload), 'optionalAccess', _282 => _282.wait])));
8995
9032
  if (wait && typeof wait === "object" && !Array.isArray(wait)) {
8996
9033
  const kind = wait.kind;
8997
9034
  if (typeof kind === "string" && kind.trim()) return kind.trim();
8998
9035
  }
8999
9036
  }
9000
9037
  const run = getRunRecordFromPackage(payload);
9001
- const records = [payload, payload.progress, run, _optionalChain([run, 'optionalAccess', _280 => _280.progress])].filter(
9038
+ const records = [payload, payload.progress, run, _optionalChain([run, 'optionalAccess', _283 => _283.progress])].filter(
9002
9039
  (value) => Boolean(value && typeof value === "object" && !Array.isArray(value))
9003
9040
  );
9004
9041
  for (const record3 of records) {
@@ -9013,7 +9050,7 @@ function getLiveRunStringField(event, field) {
9013
9050
  function getLiveRunActivity(event) {
9014
9051
  const payload = getEventPayload(event);
9015
9052
  const run = getRunRecordFromPackage(payload);
9016
- const candidates = [payload.activity, _optionalChain([run, 'optionalAccess', _281 => _281.activity])];
9053
+ const candidates = [payload.activity, _optionalChain([run, 'optionalAccess', _284 => _284.activity])];
9017
9054
  for (const candidate of candidates) {
9018
9055
  if (candidate && typeof candidate === "object" && !Array.isArray(candidate) && typeof candidate.summary === "string" && candidate.observation && typeof candidate.observation === "object") {
9019
9056
  return candidate;
@@ -9028,9 +9065,9 @@ function getRunLifecycleHint(input) {
9028
9065
  return null;
9029
9066
  }
9030
9067
  const activity = getLiveRunActivity(input.event);
9031
- const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _282 => _282.observation, 'access', _283 => _283.state, 'access', _284 => _284.kind]) === "active" && activity.observation.target.kind !== "runner";
9068
+ const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _285 => _285.observation, 'access', _286 => _286.state, 'access', _287 => _287.kind]) === "active" && activity.observation.target.kind !== "runner";
9032
9069
  const inspect = `'deepline runs get ${runId} --full'`;
9033
- const sleepState = _optionalChain([activity, 'optionalAccess', _285 => _285.observation, 'access', _286 => _286.state, 'access', _287 => _287.kind]) === "scheduled" && activity.observation.state.reason === "sleep" ? activity.observation.state : null;
9070
+ 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;
9034
9071
  if (status === "waiting" && (sleepState !== null || getLiveRunStringField(input.event, "waitKind") === "sleep")) {
9035
9072
  const recordedWake = readLiveRunField(input.event, "waitUntil");
9036
9073
  const projectedWake = sleepState && sleepState.resumeAt > activity.observation.observedAt ? sleepState.resumeAt : null;
@@ -9041,7 +9078,7 @@ function getRunLifecycleHint(input) {
9041
9078
  };
9042
9079
  }
9043
9080
  const typedEventWaitKind = getLiveRunStringField(input.event, "waitKind");
9044
- const activityEventWait = _optionalChain([activity, 'optionalAccess', _288 => _288.observation, 'access', _289 => _289.state, 'access', _290 => _290.kind]) === "waiting" && activity.observation.state.reason.kind === "external_event";
9081
+ const activityEventWait = _optionalChain([activity, 'optionalAccess', _291 => _291.observation, 'access', _292 => _292.state, 'access', _293 => _293.kind]) === "waiting" && activity.observation.state.reason.kind === "external_event";
9045
9082
  if (status === "waiting" && (typedEventWaitKind === "integration_event" || typedEventWaitKind === "integration_event_batch" || activityEventWait)) {
9046
9083
  return {
9047
9084
  signature: [
@@ -9114,12 +9151,12 @@ function getFinalStatusFromLiveEvent(event) {
9114
9151
  }
9115
9152
  const payload = getEventPayload(event);
9116
9153
  const packageRun = getRunRecordFromPackage(payload);
9117
- const status = _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([packageRun, 'optionalAccess', _291 => _291.status]))));
9154
+ const status = _nullishCoalesce(playStatusValue(payload.status), () => ( playStatusValue(_optionalChain([packageRun, 'optionalAccess', _294 => _294.status]))));
9118
9155
  if (status !== "completed" && status !== "failed" && status !== "cancelled") {
9119
9156
  return null;
9120
9157
  }
9121
- const runId = typeof payload.runId === "string" ? payload.runId : typeof _optionalChain([packageRun, 'optionalAccess', _292 => _292.id]) === "string" ? packageRun.id : "";
9122
- const error = typeof payload.error === "string" ? payload.error : typeof _optionalChain([packageRun, 'optionalAccess', _293 => _293.error]) === "string" ? packageRun.error : void 0;
9158
+ const runId = typeof payload.runId === "string" ? payload.runId : typeof _optionalChain([packageRun, 'optionalAccess', _295 => _295.id]) === "string" ? packageRun.id : "";
9159
+ const error = typeof payload.error === "string" ? payload.error : typeof _optionalChain([packageRun, 'optionalAccess', _296 => _296.error]) === "string" ? packageRun.error : void 0;
9123
9160
  return {
9124
9161
  ...payload,
9125
9162
  runId,
@@ -9354,7 +9391,7 @@ function getProgressLinesFromLiveEvent(event) {
9354
9391
  (count2) => typeof count2 === "number" && Number.isSafeInteger(count2) && count2 >= 0
9355
9392
  )) {
9356
9393
  lines.push(
9357
- `progress calls: ${formatInteger(callCounts[0])} logical, ${formatInteger(callCounts[1])} provider requests, ${formatInteger(callCounts[2])} provider 429s${_optionalChain([calls, 'optionalAccess', _294 => _294.confirmed]) === true ? "" : " (observed)"}`
9394
+ `progress calls: ${formatInteger(callCounts[0])} logical, ${formatInteger(callCounts[1])} provider requests, ${formatInteger(callCounts[2])} provider 429s${_optionalChain([calls, 'optionalAccess', _297 => _297.confirmed]) === true ? "" : " (observed)"}`
9358
9395
  );
9359
9396
  }
9360
9397
  const rowOutcomes = readRowOutcomeSummary({
@@ -9405,7 +9442,7 @@ function getRunningHeartbeatLine(input) {
9405
9442
  return null;
9406
9443
  }
9407
9444
  const activity = getLiveRunActivity(input.event);
9408
- const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _295 => _295.observation, 'access', _296 => _296.state, 'access', _297 => _297.kind]) === "active" && activity.observation.target.kind !== "runner";
9445
+ const activityConflictsWithDurableWait = status === "waiting" && _optionalChain([activity, 'optionalAccess', _298 => _298.observation, 'access', _299 => _299.state, 'access', _300 => _300.kind]) === "active" && activity.observation.target.kind !== "runner";
9409
9446
  if (activity && activity.classified !== false && !activityConflictsWithDurableWait) {
9410
9447
  return `activity ${input.playName}: ${activity.summary}`;
9411
9448
  }
@@ -9443,13 +9480,13 @@ function buildPlayDashboardUrl(baseUrl, playName) {
9443
9480
  return `${trimmedBase}/dashboard/plays/${encodedPlayName}`;
9444
9481
  }
9445
9482
  function resolveRunPlayName(status, runId) {
9446
- const packaged = _optionalChain([status, 'access', _298 => _298.package, 'optionalAccess', _299 => _299.run, 'optionalAccess', _300 => _300.playName]);
9483
+ const packaged = _optionalChain([status, 'access', _301 => _301.package, 'optionalAccess', _302 => _302.run, 'optionalAccess', _303 => _303.playName]);
9447
9484
  if (typeof packaged === "string" && packaged.trim()) return packaged.trim();
9448
- return _nullishCoalesce(_nullishCoalesce(extractRunPlayName(status), () => ( _optionalChain([/^play\/(.+)\/(?:run|webhook)\//, 'access', _301 => _301.exec, 'call', _302 => _302(runId), 'optionalAccess', _303 => _303[1]]))), () => ( null));
9485
+ return _nullishCoalesce(_nullishCoalesce(extractRunPlayName(status), () => ( _optionalChain([/^play\/(.+)\/(?:run|webhook)\//, 'access', _304 => _304.exec, 'call', _305 => _305(runId), 'optionalAccess', _306 => _306[1]]))), () => ( null));
9449
9486
  }
9450
9487
  function openPlayDashboard(dashboardUrl, open2) {
9451
9488
  if (open2 && dashboardUrl) {
9452
- _chunkRV6ALZIXjs.openInBrowser.call(void 0, dashboardUrl);
9489
+ _chunkM7Y7JYZXjs.openInBrowser.call(void 0, dashboardUrl);
9453
9490
  }
9454
9491
  }
9455
9492
  function printPlayLogLines(input) {
@@ -9501,7 +9538,7 @@ async function waitForPlayCompletionByWatch(input) {
9501
9538
  const confirmAdmission = async () => {
9502
9539
  if (admissionConfirmed) return;
9503
9540
  admissionConfirmed = true;
9504
- await _optionalChain([input, 'access', _304 => _304.onRunAdmitted, 'optionalCall', _305 => _305(input.workflowId)]);
9541
+ await _optionalChain([input, 'access', _307 => _307.onRunAdmitted, 'optionalCall', _308 => _308(input.workflowId)]);
9505
9542
  };
9506
9543
  const withDashboardUrl = (status) => input.dashboardUrl ? { ...status, dashboardUrl: input.dashboardUrl } : status;
9507
9544
  const fetchTerminalStatus = async () => {
@@ -9511,7 +9548,7 @@ async function waitForPlayCompletionByWatch(input) {
9511
9548
  billing: false
9512
9549
  });
9513
9550
  } catch (error) {
9514
- if (_chunkCVLM3WMJjs.isTransientPlayRunReadError.call(void 0, error) || isAdmittedRunVisibilityDelay(error)) {
9551
+ if (_chunk2HAD745Vjs.isTransientPlayRunReadError.call(void 0, error) || isAdmittedRunVisibilityDelay(error)) {
9515
9552
  return null;
9516
9553
  }
9517
9554
  throw error;
@@ -9628,9 +9665,18 @@ async function waitForPlayCompletionByWatch(input) {
9628
9665
  }
9629
9666
  }
9630
9667
  async function startAndWaitForPlayCompletionByStream(input) {
9631
- for (let attempt = 0; attempt <= PLAY_START_TRANSIENT_RETRY_DELAYS_MS.length; attempt += 1) {
9632
- const status = await startAndWaitForPlayCompletionByStreamOnce(input);
9633
- const retryDelayMs = PLAY_START_TRANSIENT_RETRY_DELAYS_MS[attempt];
9668
+ const prepared = await input.client.preparePlayRunAdmission(input.request, {
9669
+ onSubmission: input.onSubmission
9670
+ });
9671
+ const pinnedInput = {
9672
+ ...input,
9673
+ request: prepared.body,
9674
+ startStream: prepared.startStream
9675
+ };
9676
+ const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
9677
+ for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
9678
+ const status = await startAndWaitForPlayCompletionByStreamOnce(pinnedInput);
9679
+ const retryDelayMs = retryDelays[attempt];
9634
9680
  if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
9635
9681
  return status;
9636
9682
  }
@@ -9673,14 +9719,14 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9673
9719
  let timedOut = false;
9674
9720
  let emittedDashboardUrl = false;
9675
9721
  let lastKnownWorkflowId = "";
9676
- let launchedRevisionId = _optionalChain([input, 'access', _306 => _306.request, 'access', _307 => _307.revisionId, 'optionalAccess', _308 => _308.trim, 'call', _309 => _309()]) || null;
9722
+ let launchedRevisionId = _optionalChain([input, 'access', _309 => _309.request, 'access', _310 => _310.revisionId, 'optionalAccess', _311 => _311.trim, 'call', _312 => _312()]) || null;
9677
9723
  let eventCount = 0;
9678
9724
  let firstRunIdMs = null;
9679
9725
  let launchConfirmed = false;
9680
9726
  const confirmAdmission = async (runId) => {
9681
9727
  if (launchConfirmed || !runId || runId === "pending") return;
9682
9728
  launchConfirmed = true;
9683
- await _optionalChain([input, 'access', _310 => _310.onRunAdmitted, 'optionalCall', _311 => _311(runId)]);
9729
+ await _optionalChain([input, 'access', _313 => _313.onRunAdmitted, 'optionalCall', _314 => _314(runId)]);
9684
9730
  };
9685
9731
  let lastPhase = null;
9686
9732
  const timeout = input.waitTimeoutMs === null ? null : setTimeout(
@@ -9700,7 +9746,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9700
9746
  billing: false
9701
9747
  });
9702
9748
  } catch (error) {
9703
- if (_chunkCVLM3WMJjs.isTransientPlayRunReadError.call(void 0, error)) {
9749
+ if (_chunk2HAD745Vjs.isTransientPlayRunReadError.call(void 0, error)) {
9704
9750
  return null;
9705
9751
  }
9706
9752
  throw error;
@@ -9715,7 +9761,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9715
9761
  } : null;
9716
9762
  };
9717
9763
  try {
9718
- for await (const event of input.client.startPlayRunStream(input.request, {
9764
+ for await (const event of input.startStream({
9719
9765
  signal: controller.signal
9720
9766
  })) {
9721
9767
  eventCount += 1;
@@ -9732,7 +9778,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9732
9778
  lastKnownWorkflowId = eventRunId;
9733
9779
  firstRunIdMs ??= Date.now() - startedAt;
9734
9780
  if (runStartedNow) {
9735
- await _optionalChain([input, 'access', _312 => _312.onRunStarted, 'optionalCall', _313 => _313(eventRunId)]);
9781
+ await _optionalChain([input, 'access', _315 => _315.onRunStarted, 'optionalCall', _316 => _316(eventRunId)]);
9736
9782
  }
9737
9783
  }
9738
9784
  if (!launchConfirmed && eventConfirmsPlayRunLaunch(event) && eventRunId === lastKnownWorkflowId) {
@@ -9908,7 +9954,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9908
9954
  lastPhase
9909
9955
  });
9910
9956
  }
9911
- if (lastKnownWorkflowId && _chunkCVLM3WMJjs.isTransientPlayRunReadError.call(void 0, error)) {
9957
+ if (lastKnownWorkflowId && _chunk2HAD745Vjs.isTransientPlayRunReadError.call(void 0, error)) {
9912
9958
  if (timeout) {
9913
9959
  clearTimeout(timeout);
9914
9960
  }
@@ -9944,7 +9990,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9944
9990
  onRunAdmitted: confirmAdmission
9945
9991
  });
9946
9992
  }
9947
- if (!lastKnownWorkflowId && _chunkCVLM3WMJjs.isTransientPlayRunReadError.call(void 0, error)) {
9993
+ if (!lastKnownWorkflowId && _chunk2HAD745Vjs.isTransientPlayRunReadError.call(void 0, error)) {
9948
9994
  _chunkAYHLUHE5js.recordCliTrace.call(void 0, {
9949
9995
  phase: "cli.play_start_stream_transient_failure",
9950
9996
  ms: Date.now() - startedAt,
@@ -10043,29 +10089,29 @@ var BULKY_RETURN_KEYS = /* @__PURE__ */ new Set([
10043
10089
  "logs"
10044
10090
  ]);
10045
10091
  function formatPlayLogLine(rawLine, state) {
10046
- const classified = _chunkCVLM3WMJjs.classifyLogLine.call(void 0, rawLine);
10092
+ const classified = _chunk2HAD745Vjs.classifyLogLine.call(void 0, rawLine);
10047
10093
  const line = classified.line;
10048
10094
  const timestampMatch = line.match(/^\[([^\]]+)\]\s*(.*)$/);
10049
- const parsedTimestamp = _optionalChain([timestampMatch, 'optionalAccess', _314 => _314[1]]) ? new Date(timestampMatch[1]) : null;
10095
+ const parsedTimestamp = _optionalChain([timestampMatch, 'optionalAccess', _317 => _317[1]]) ? new Date(timestampMatch[1]) : null;
10050
10096
  const timestamp = parsedTimestamp && !Number.isNaN(parsedTimestamp.getTime()) ? parsedTimestamp.toLocaleTimeString("en-US", {
10051
10097
  hour12: false,
10052
10098
  hour: "2-digit",
10053
10099
  minute: "2-digit",
10054
10100
  second: "2-digit"
10055
10101
  }) : null;
10056
- const message = _nullishCoalesce(_optionalChain([timestampMatch, 'optionalAccess', _315 => _315[2]]), () => ( line));
10102
+ const message = _nullishCoalesce(_optionalChain([timestampMatch, 'optionalAccess', _318 => _318[2]]), () => ( line));
10057
10103
  const prefix = timestamp ? `${timestamp} ` : "";
10058
10104
  if (!state.verbose && isProviderRowWaitLogLine(line)) return null;
10059
10105
  const providerWait = formatProviderCapacityWaitLogLine(line);
10060
10106
  if (providerWait && !state.verbose) {
10061
- return _chunkCVLM3WMJjs.logLevelReaches.call(void 0, "warn", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${providerWait}` : null;
10107
+ return _chunk2HAD745Vjs.logLevelReaches.call(void 0, "warn", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${providerWait}` : null;
10062
10108
  }
10063
10109
  const mapProgress = formatMapProgressDiagnosticLogLine(line);
10064
10110
  if (mapProgress && !state.verbose) {
10065
- return _chunkCVLM3WMJjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${mapProgress}` : null;
10111
+ return _chunk2HAD745Vjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info"))) ? `${prefix}${mapProgress}` : null;
10066
10112
  }
10067
10113
  if (/\[worker\] picked up run\b/.test(message)) {
10068
- if (!_chunkCVLM3WMJjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10114
+ if (!_chunk2HAD745Vjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10069
10115
  return null;
10070
10116
  }
10071
10117
  if (state.emittedRunnerStarted) {
@@ -10078,7 +10124,7 @@ function formatPlayLogLine(rawLine, state) {
10078
10124
  /^Starting map over (\d+) items with (\d+) fields \(key: ([^;]+); (\d+) already satisfied; (\d+) pending\)$/
10079
10125
  );
10080
10126
  if (mapStart) {
10081
- if (!_chunkCVLM3WMJjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10127
+ if (!_chunk2HAD745Vjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10082
10128
  return null;
10083
10129
  }
10084
10130
  const [, rows, fields2, namespace, cached, pending] = mapStart;
@@ -10088,7 +10134,7 @@ function formatPlayLogLine(rawLine, state) {
10088
10134
  /^Map completed: (\d+) results \((\d+) executed, (\d+) already satisfied\)$/
10089
10135
  );
10090
10136
  if (mapDone) {
10091
- if (!_chunkCVLM3WMJjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10137
+ if (!_chunk2HAD745Vjs.logLevelReaches.call(void 0, "info", _nullishCoalesce(state.logLevel, () => ( "info")))) {
10092
10138
  return null;
10093
10139
  }
10094
10140
  const [, results, executed, cached] = mapDone;
@@ -10270,20 +10316,20 @@ function collectDatasetHandleLines(value, path = "result") {
10270
10316
  function buildRunWarnings(status, rowsInfo) {
10271
10317
  const rowOutcomes = readRowOutcomeSummary(status);
10272
10318
  const result = readRecord(status.result);
10273
- const metadata = readRecord(_optionalChain([result, 'optionalAccess', _316 => _316._metadata]));
10274
- const outputWarnings = Array.isArray(_optionalChain([metadata, 'optionalAccess', _317 => _317.outputWarnings])) ? metadata.outputWarnings.map((warning) => readRecord(warning)).filter((warning) => {
10319
+ const metadata = readRecord(_optionalChain([result, 'optionalAccess', _319 => _319._metadata]));
10320
+ const outputWarnings = Array.isArray(_optionalChain([metadata, 'optionalAccess', _320 => _320.outputWarnings])) ? metadata.outputWarnings.map((warning) => readRecord(warning)).filter((warning) => {
10275
10321
  if (!warning) return false;
10276
10322
  return !(rowsInfo && !rowsInfo.complete && warning.reason === "array_preview_limit" && warning.originalItems === rowsInfo.totalRows && warning.retainedItems === rowsInfo.rows.length);
10277
- }).map((warning) => _optionalChain([warning, 'optionalAccess', _318 => _318.message])).filter(
10323
+ }).map((warning) => _optionalChain([warning, 'optionalAccess', _321 => _321.message])).filter(
10278
10324
  (message) => typeof message === "string" && message.trim().length > 0
10279
10325
  ).slice(0, 16) : [];
10280
- const rowOutcomeWarnings = _optionalChain([rowOutcomes, 'optionalAccess', _319 => _319.hasRowFailures]) ? [
10326
+ const rowOutcomeWarnings = _optionalChain([rowOutcomes, 'optionalAccess', _322 => _322.hasRowFailures]) ? [
10281
10327
  `${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.`
10282
10328
  ] : [];
10283
- const supersededRowNotices = (_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _320 => _320.supersededRows]), () => ( 0))) > 0 ? [
10329
+ const supersededRowNotices = (_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _323 => _323.supersededRows]), () => ( 0))) > 0 ? [
10284
10330
  `Latest-write-wins: ${formatSupersededRowsNotice(_nullishCoalesce(rowOutcomes.supersededRows, () => ( 0)))}; the newer write still owns that Runtime Sheet row.`
10285
10331
  ] : [];
10286
- if (status.status === "completed" && _optionalChain([rowsInfo, 'optionalAccess', _321 => _321.totalRows]) === 0) {
10332
+ if (status.status === "completed" && _optionalChain([rowsInfo, 'optionalAccess', _324 => _324.totalRows]) === 0) {
10287
10333
  return [
10288
10334
  ...rowOutcomeWarnings,
10289
10335
  ...supersededRowNotices,
@@ -10302,7 +10348,7 @@ function buildRunWarnings(status, rowsInfo) {
10302
10348
  return [...rowOutcomeWarnings, ...supersededRowNotices, ...outputWarnings];
10303
10349
  }
10304
10350
  function buildRunNextCommands(status) {
10305
- const runId = _optionalChain([status, 'access', _322 => _322.runId, 'optionalAccess', _323 => _323.trim, 'call', _324 => _324()]);
10351
+ const runId = _optionalChain([status, 'access', _325 => _325.runId, 'optionalAccess', _326 => _326.trim, 'call', _327 => _327()]);
10306
10352
  if (!runId) {
10307
10353
  const playName = extractRunPlayName(status);
10308
10354
  return playName ? {
@@ -10453,14 +10499,14 @@ function extractToolIdFromErrorText(text) {
10453
10499
  return null;
10454
10500
  }
10455
10501
  const lowerToolMatch = /\btool\s+([A-Za-z0-9_.:-]+)\s+\d{3}\b/.exec(text);
10456
- if (_optionalChain([lowerToolMatch, 'optionalAccess', _325 => _325[1]])) {
10502
+ if (_optionalChain([lowerToolMatch, 'optionalAccess', _328 => _328[1]])) {
10457
10503
  return lowerToolMatch[1];
10458
10504
  }
10459
10505
  const upperToolMatch = /\bTool\s+([A-Za-z0-9_.:-]+)\s+failed\b/.exec(text);
10460
- return _nullishCoalesce(_optionalChain([upperToolMatch, 'optionalAccess', _326 => _326[1]]), () => ( null));
10506
+ return _nullishCoalesce(_optionalChain([upperToolMatch, 'optionalAccess', _329 => _329[1]]), () => ( null));
10461
10507
  }
10462
10508
  function isInsufficientCreditsBilling(billing) {
10463
- return _optionalChain([billing, 'optionalAccess', _327 => _327.kind]) === "insufficient_credits";
10509
+ return _optionalChain([billing, 'optionalAccess', _330 => _330.kind]) === "insufficient_credits";
10464
10510
  }
10465
10511
  function extractBillingForStatus(status, error) {
10466
10512
  const errorBilling = getObjectField(status, "errorBilling");
@@ -10500,8 +10546,8 @@ function formatInsufficientCreditsMessage(input) {
10500
10546
  function buildInsufficientCreditsSummaryLines(input) {
10501
10547
  const progress = input.status.progress;
10502
10548
  const rowsInfo = extractCanonicalRowsInfo(input.status);
10503
- const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "completed"), () => ( getNumericField(progress, "completedRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _328 => _328.rows, 'access', _329 => _329.length]))), () => ( null));
10504
- const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "total"), () => ( getNumericField(progress, "totalRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _330 => _330.totalRows]))), () => ( null));
10549
+ const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "completed"), () => ( getNumericField(progress, "completedRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _331 => _331.rows, 'access', _332 => _332.length]))), () => ( null));
10550
+ const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(getNumericField(progress, "total"), () => ( getNumericField(progress, "totalRows"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _333 => _333.totalRows]))), () => ( null));
10505
10551
  const lines = [
10506
10552
  " status: stopped_insufficient_credits",
10507
10553
  completed === null ? " completed rows: unknown" : ` completed rows: ${formatInteger(completed)}${total !== null ? ` of ${formatInteger(total)}` : ""}`,
@@ -10520,7 +10566,7 @@ function buildInsufficientCreditsSummaryLines(input) {
10520
10566
  lines.push(" ask user: ask whether they want to add Deepline credits");
10521
10567
  lines.push(` top up after approval: ${recovery.topUp}`);
10522
10568
  lines.push(` checkout fallback: ${recovery.checkout}`);
10523
- const runId = _optionalChain([input, 'access', _331 => _331.status, 'access', _332 => _332.runId, 'optionalAccess', _333 => _333.trim, 'call', _334 => _334()]);
10569
+ const runId = _optionalChain([input, 'access', _334 => _334.status, 'access', _335 => _335.runId, 'optionalAccess', _336 => _336.trim, 'call', _337 => _337()]);
10524
10570
  if (runId) {
10525
10571
  lines.push(` inspect: deepline runs get ${runId}`);
10526
10572
  lines.push(
@@ -10602,10 +10648,10 @@ function normalizeRunStatusForEnvelope(status) {
10602
10648
  function normalizeProgressForEnvelope(status, rowsInfo) {
10603
10649
  const progress = status.progress;
10604
10650
  const rowOutcomes = readRowOutcomeSummary(status);
10605
- const total = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _335 => _335.totalRows]), () => ( getNumericField(progress, "totalRows"))), () => ( getNumericField(progress, "total"))), () => ( _optionalChain([rowsInfo, 'optionalAccess', _336 => _336.totalRows]))), () => ( null));
10606
- const failed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _337 => _337.failedRows]), () => ( getNumericField(progress, "failed"))), () => ( getNumericField(progress, "failedRows"))), () => ( null));
10607
- const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _338 => _338.completedRows]), () => ( getNumericField(progress, "completed"))), () => ( getNumericField(progress, "completedRows"))), () => ( (status.status === "completed" ? total : null)));
10608
- const supersededRows = _nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _339 => _339.supersededRows]), () => ( getNumericField(progress, "supersededRows")));
10651
+ 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));
10652
+ const failed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _340 => _340.failedRows]), () => ( getNumericField(progress, "failed"))), () => ( getNumericField(progress, "failedRows"))), () => ( null));
10653
+ const completed = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _341 => _341.completedRows]), () => ( getNumericField(progress, "completed"))), () => ( getNumericField(progress, "completedRows"))), () => ( (status.status === "completed" ? total : null)));
10654
+ const supersededRows = _nullishCoalesce(_optionalChain([rowOutcomes, 'optionalAccess', _342 => _342.supersededRows]), () => ( getNumericField(progress, "supersededRows")));
10609
10655
  const supersededOffset = _nullishCoalesce(supersededRows, () => ( 0));
10610
10656
  const progressPending = getNumericField(progress, "pending");
10611
10657
  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)));
@@ -10675,7 +10721,7 @@ function normalizeErrorsForEnvelope(status, error) {
10675
10721
  ];
10676
10722
  }
10677
10723
  function normalizeLogsForEnvelope(status) {
10678
- const logs = Array.isArray(_optionalChain([status, 'access', _340 => _340.progress, 'optionalAccess', _341 => _341.logs])) ? status.progress.logs : [];
10724
+ const logs = Array.isArray(_optionalChain([status, 'access', _343 => _343.progress, 'optionalAccess', _344 => _344.logs])) ? status.progress.logs : [];
10679
10725
  const totalCount = logs.length;
10680
10726
  const entries = logs.slice(Math.max(0, logs.length - RUN_LOG_PREVIEW_LIMIT));
10681
10727
  const firstSequence = entries.length === 0 ? null : logs.length - entries.length + 1;
@@ -10732,7 +10778,7 @@ function compactPlayStatus(status) {
10732
10778
  const packaged = getPlayRunPackage(status);
10733
10779
  if (packaged) {
10734
10780
  const packagedRun = readRecord(packaged.run);
10735
- const packagedError = typeof _optionalChain([packagedRun, 'optionalAccess', _342 => _342.error]) === "string" ? packagedRun.error : null;
10781
+ const packagedError = typeof _optionalChain([packagedRun, 'optionalAccess', _345 => _345.error]) === "string" ? packagedRun.error : null;
10736
10782
  const error2 = _nullishCoalesce(selectRunErrorForDisplay(status), () => ( (typeof status.error === "string" ? String(status.error) : packagedError)));
10737
10783
  const compactError = error2 ? compactRunErrorForEnvelope(error2, status.runId) : null;
10738
10784
  const rowOutcomes2 = readRowOutcomeSummary(status);
@@ -10883,7 +10929,7 @@ function formatTopValuesPart(value) {
10883
10929
  }
10884
10930
  function formatPackageDatasetSummaryLines(summary, indent = " ") {
10885
10931
  const record3 = readRecord(summary);
10886
- const columnStats = readRecord(_optionalChain([record3, 'optionalAccess', _343 => _343.columnStats]));
10932
+ const columnStats = readRecord(_optionalChain([record3, 'optionalAccess', _346 => _346.columnStats]));
10887
10933
  if (!record3 || !columnStats) {
10888
10934
  return [];
10889
10935
  }
@@ -10971,7 +11017,7 @@ function packageDatasetRecords(packaged) {
10971
11017
  if (catalog.length > 0) return catalog;
10972
11018
  return readRecordArray(packaged.steps).flatMap((step) => {
10973
11019
  const output = readRecord(step.output);
10974
- return _optionalChain([output, 'optionalAccess', _344 => _344.kind]) === "dataset" ? [output] : [];
11020
+ return _optionalChain([output, 'optionalAccess', _347 => _347.kind]) === "dataset" ? [output] : [];
10975
11021
  });
10976
11022
  }
10977
11023
  function packageReturnedDatasetIdentity(packaged) {
@@ -10980,7 +11026,7 @@ function packageReturnedDatasetIdentity(packaged) {
10980
11026
  const outputs = _nullishCoalesce(readRecord(packaged.outputs), () => ( {}));
10981
11027
  for (const outputValue of Object.values(outputs)) {
10982
11028
  const output = readRecord(outputValue);
10983
- if (_optionalChain([output, 'optionalAccess', _345 => _345.kind]) !== "dataset") continue;
11029
+ if (_optionalChain([output, 'optionalAccess', _348 => _348.kind]) !== "dataset") continue;
10984
11030
  if (typeof output.datasetId === "string" && output.datasetId.trim()) {
10985
11031
  datasetIds.add(output.datasetId.trim());
10986
11032
  }
@@ -11016,7 +11062,7 @@ function formatRunStepProgress(progress, includeRowOutcomes = false) {
11016
11062
  }
11017
11063
  function formatPackageDatasetActionLines(packaged, options) {
11018
11064
  const returned = packageReturnedDatasetIdentity(packaged);
11019
- const includeSummary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _346 => _346.includeSummary]), () => ( true));
11065
+ const includeSummary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _349 => _349.includeSummary]), () => ( true));
11020
11066
  const lines = [];
11021
11067
  const steps = readRecordArray(packaged.steps);
11022
11068
  const stepsByDatasetId = /* @__PURE__ */ new Map();
@@ -11025,10 +11071,10 @@ function formatPackageDatasetActionLines(packaged, options) {
11025
11071
  for (const step of steps) {
11026
11072
  if (step.kind !== "dataset") continue;
11027
11073
  const output = readRecord(step.output);
11028
- if (typeof _optionalChain([output, 'optionalAccess', _347 => _347.datasetId]) === "string") {
11074
+ if (typeof _optionalChain([output, 'optionalAccess', _350 => _350.datasetId]) === "string") {
11029
11075
  stepsByDatasetId.set(output.datasetId, step);
11030
11076
  }
11031
- if (typeof _optionalChain([output, 'optionalAccess', _348 => _348.path]) === "string") {
11077
+ if (typeof _optionalChain([output, 'optionalAccess', _351 => _351.path]) === "string") {
11032
11078
  stepsByPath.set(output.path, step);
11033
11079
  }
11034
11080
  if (typeof step.id === "string") {
@@ -11042,8 +11088,8 @@ function formatPackageDatasetActionLines(packaged, options) {
11042
11088
  const category = isReturned ? "returned" : dataset.recovered === true ? "recovered" : "persisted";
11043
11089
  const rowCount = typeof dataset.rowCount === "number" && Number.isFinite(dataset.rowCount) ? Math.max(0, Math.trunc(dataset.rowCount)) : null;
11044
11090
  const lifecycle = readRecord(dataset.lifecycle);
11045
- const countUnconfirmed = _optionalChain([lifecycle, 'optionalAccess', _349 => _349.complete]) === false;
11046
- const persistedLowerBound = typeof _optionalChain([lifecycle, 'optionalAccess', _350 => _350.persistedRowsAtLeast]) === "number" && Number.isFinite(lifecycle.persistedRowsAtLeast) ? Math.max(0, Math.trunc(lifecycle.persistedRowsAtLeast)) : 0;
11091
+ const countUnconfirmed = _optionalChain([lifecycle, 'optionalAccess', _352 => _352.complete]) === false;
11092
+ const persistedLowerBound = typeof _optionalChain([lifecycle, 'optionalAccess', _353 => _353.persistedRowsAtLeast]) === "number" && Number.isFinite(lifecycle.persistedRowsAtLeast) ? Math.max(0, Math.trunc(lifecycle.persistedRowsAtLeast)) : 0;
11047
11093
  const actions2 = _nullishCoalesce(readRecord(dataset.actions), () => ( {}));
11048
11094
  if (countUnconfirmed) {
11049
11095
  lines.push(
@@ -11061,7 +11107,7 @@ function formatPackageDatasetActionLines(packaged, options) {
11061
11107
  }
11062
11108
  }
11063
11109
  const step = _nullishCoalesce(_nullishCoalesce((datasetId ? stepsByDatasetId.get(datasetId) : void 0), () => ( stepsByPath.get(path))), () => ( (typeof dataset.tableNamespace === "string" ? stepsByNamespace.get(dataset.tableNamespace) : void 0)));
11064
- const progress = readRecord(_optionalChain([step, 'optionalAccess', _351 => _351.progress]));
11110
+ const progress = readRecord(_optionalChain([step, 'optionalAccess', _354 => _354.progress]));
11065
11111
  if (progress) {
11066
11112
  lines.push(` progress: ${formatRunStepProgress(progress)}`);
11067
11113
  }
@@ -11075,10 +11121,10 @@ function formatPackageDatasetActionLines(packaged, options) {
11075
11121
  }
11076
11122
  const exportAction = readRecord(actions2.exportCsv);
11077
11123
  const exportCommand = actionToCommand(exportAction);
11078
- const exportScope = readRecord(_optionalChain([exportAction, 'optionalAccess', _352 => _352.scope]));
11124
+ const exportScope = readRecord(_optionalChain([exportAction, 'optionalAccess', _355 => _355.scope]));
11079
11125
  const queryAction = readRecord(actions2.query);
11080
- const queryScope = readRecord(_optionalChain([queryAction, 'optionalAccess', _353 => _353.scope]));
11081
- const runQueryCommand = _optionalChain([queryScope, 'optionalAccess', _354 => _354.kind]) === "run" ? actionToCommand(queryAction) : null;
11126
+ const queryScope = readRecord(_optionalChain([queryAction, 'optionalAccess', _356 => _356.scope]));
11127
+ const runQueryCommand = _optionalChain([queryScope, 'optionalAccess', _357 => _357.kind]) === "run" ? actionToCommand(queryAction) : null;
11082
11128
  const currentQueryCommand = actionToCommand(actions2.queryCurrentTable);
11083
11129
  const legacyQueryCommand = actionToCommand(actions2.query);
11084
11130
  if (runQueryCommand) {
@@ -11090,11 +11136,11 @@ function formatPackageDatasetActionLines(packaged, options) {
11090
11136
  }
11091
11137
  if (exportCommand) {
11092
11138
  lines.push(
11093
- _optionalChain([exportScope, 'optionalAccess', _355 => _355.kind]) === "database" ? ` export current table (may include other runs): ${exportCommand}` : ` export this run: ${exportCommand}`
11139
+ _optionalChain([exportScope, 'optionalAccess', _358 => _358.kind]) === "database" ? ` export current table (may include other runs): ${exportCommand}` : ` export this run: ${exportCommand}`
11094
11140
  );
11095
11141
  }
11096
11142
  const unavailable = readRecord(dataset.exportUnavailable);
11097
- if (typeof _optionalChain([unavailable, 'optionalAccess', _356 => _356.reason]) === "string" && typeof unavailable.message === "string") {
11143
+ if (typeof _optionalChain([unavailable, 'optionalAccess', _359 => _359.reason]) === "string" && typeof unavailable.message === "string") {
11098
11144
  lines.push(
11099
11145
  ` export unavailable (${unavailable.reason}): ${unavailable.message}`
11100
11146
  );
@@ -11111,7 +11157,7 @@ function packageSavedRowCount(packaged) {
11111
11157
  }
11112
11158
  function runtimeLimitWindowLabel(runtimeLimitFailure) {
11113
11159
  const message = _nullishCoalesce(getStringField(runtimeLimitFailure, "message"), () => ( ""));
11114
- const configuredSeconds = _optionalChain([/\bconfigured\s+(\d+)\s+second(?:s)?\s+runtime limit\b/i, 'access', _357 => _357.exec, 'call', _358 => _358(message), 'optionalAccess', _359 => _359[1]]);
11160
+ 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]]);
11115
11161
  if (configuredSeconds) {
11116
11162
  const seconds = Number(configuredSeconds);
11117
11163
  if (Number.isSafeInteger(seconds) && seconds > 0) {
@@ -11158,7 +11204,7 @@ function formatPackageValueOutputLines(packaged) {
11158
11204
  if (!outputs) return [];
11159
11205
  const returned = Object.entries(outputs).filter(([, output]) => {
11160
11206
  const record3 = readRecord(output);
11161
- return _optionalChain([record3, 'optionalAccess', _360 => _360.kind]) === "dataset" || _optionalChain([record3, 'optionalAccess', _361 => _361.kind]) === "value" && Object.prototype.hasOwnProperty.call(record3, "value");
11207
+ return _optionalChain([record3, 'optionalAccess', _363 => _363.kind]) === "dataset" || _optionalChain([record3, 'optionalAccess', _364 => _364.kind]) === "value" && Object.prototype.hasOwnProperty.call(record3, "value");
11162
11208
  });
11163
11209
  if (returned.length === 0) return [];
11164
11210
  const datasets = packageDatasetRecords(packaged);
@@ -11178,10 +11224,10 @@ function formatPackageValueOutputLines(packaged) {
11178
11224
  (candidate) => typeof output.datasetId === "string" && candidate.datasetId === output.datasetId || candidate.path === path
11179
11225
  );
11180
11226
  const stepOutput = datasetSteps.map((step) => readRecord(step.output)).find(
11181
- (candidate) => typeof output.datasetId === "string" && _optionalChain([candidate, 'optionalAccess', _362 => _362.datasetId]) === output.datasetId || _optionalChain([candidate, 'optionalAccess', _363 => _363.path]) === path
11227
+ (candidate) => typeof output.datasetId === "string" && _optionalChain([candidate, 'optionalAccess', _365 => _365.datasetId]) === output.datasetId || _optionalChain([candidate, 'optionalAccess', _366 => _366.path]) === path
11182
11228
  );
11183
- const preview = readRecord(_nullishCoalesce(_optionalChain([stepOutput, 'optionalAccess', _364 => _364.preview]), () => ( _optionalChain([dataset, 'optionalAccess', _365 => _365.preview]))));
11184
- const rows = Array.isArray(_optionalChain([preview, 'optionalAccess', _366 => _366.rows])) ? preview.rows.slice(0, 2) : [];
11229
+ const preview = readRecord(_nullishCoalesce(_optionalChain([stepOutput, 'optionalAccess', _367 => _367.preview]), () => ( _optionalChain([dataset, 'optionalAccess', _368 => _368.preview]))));
11230
+ const rows = Array.isArray(_optionalChain([preview, 'optionalAccess', _369 => _369.rows])) ? preview.rows.slice(0, 2) : [];
11185
11231
  if (rows.length > 0) {
11186
11232
  lines.push(` sample rows (${rows.length}):`);
11187
11233
  lines.push(
@@ -11207,7 +11253,7 @@ function formatPackageValueOutputLines(packaged) {
11207
11253
  return lines;
11208
11254
  }
11209
11255
  function authoredPackageStackFrames(packaged) {
11210
- const stack = readRecordArray(packaged.errors).map((entry) => typeof entry.stack === "string" ? entry.stack : null).find((candidate) => Boolean(_optionalChain([candidate, 'optionalAccess', _367 => _367.trim, 'call', _368 => _368()])));
11256
+ 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()])));
11211
11257
  if (!stack) return [];
11212
11258
  return stack.split("\n").map((line) => line.trim()).filter((line) => line.startsWith("at ")).filter(
11213
11259
  (line) => !line.includes("/virtual/deepline-plays/") && !line.includes("/apps/play-runner/") && !line.includes("/shared_libs/play-runtime/") && !line.includes("node:internal")
@@ -11239,9 +11285,9 @@ function activityIsoTimestamp(value) {
11239
11285
  }
11240
11286
  function buildRunActivityTextLines(run) {
11241
11287
  const activity = readRecord(run.activity);
11242
- const observation = readRecord(_optionalChain([activity, 'optionalAccess', _369 => _369.observation]));
11243
- const state = readRecord(_optionalChain([observation, 'optionalAccess', _370 => _370.state]));
11244
- const target = readRecord(_optionalChain([observation, 'optionalAccess', _371 => _371.target]));
11288
+ const observation = readRecord(_optionalChain([activity, 'optionalAccess', _372 => _372.observation]));
11289
+ const state = readRecord(_optionalChain([observation, 'optionalAccess', _373 => _373.state]));
11290
+ const target = readRecord(_optionalChain([observation, 'optionalAccess', _374 => _374.target]));
11245
11291
  if (!activity || !observation || !state) return [];
11246
11292
  const kind = typeof state.kind === "string" ? state.kind : "unknown";
11247
11293
  if (kind === "completed") return [];
@@ -11286,11 +11332,11 @@ function buildRunActivityTextLines(run) {
11286
11332
  }
11287
11333
  function formatObservedRunCounter(value) {
11288
11334
  const counter = readRecord(value);
11289
- const count2 = _optionalChain([counter, 'optionalAccess', _372 => _372.value]);
11335
+ const count2 = _optionalChain([counter, 'optionalAccess', _375 => _375.value]);
11290
11336
  if (typeof count2 !== "number" || !Number.isSafeInteger(count2) || count2 < 0) {
11291
11337
  return "unknown";
11292
11338
  }
11293
- return _optionalChain([counter, 'optionalAccess', _373 => _373.confirmed]) === true ? formatInteger(count2) : `${formatInteger(count2)} observed`;
11339
+ return _optionalChain([counter, 'optionalAccess', _376 => _376.confirmed]) === true ? formatInteger(count2) : `${formatInteger(count2)} observed`;
11294
11340
  }
11295
11341
  function buildRunStatusEvidenceTextLines(packaged) {
11296
11342
  const evidence = readRecord(packaged.runStatus);
@@ -11303,13 +11349,13 @@ function buildRunStatusEvidenceTextLines(packaged) {
11303
11349
  );
11304
11350
  }
11305
11351
  const source = readRecord(evidence.source);
11306
- if (_optionalChain([source, 'optionalAccess', _374 => _374.aligned]) === false) {
11352
+ if (_optionalChain([source, 'optionalAccess', _377 => _377.aligned]) === false) {
11307
11353
  lines.push(
11308
11354
  ` consistency: run snapshot event ${String(source.runSnapshotLedgerNextSeq)} and progress event ${String(source.ledgerNextSeq)} differ; retry this read to align them`
11309
11355
  );
11310
11356
  }
11311
11357
  const focus = readRecord(evidence.focusStep);
11312
- const rows = readRecord(_optionalChain([focus, 'optionalAccess', _375 => _375.rows]));
11358
+ const rows = readRecord(_optionalChain([focus, 'optionalAccess', _378 => _378.rows]));
11313
11359
  if (focus) {
11314
11360
  const id = typeof focus.id === "string" && focus.id.trim() ? focus.id.trim() : "unknown step";
11315
11361
  const label = typeof focus.label === "string" && focus.label.trim() ? ` (${focus.label.trim()})` : "";
@@ -11317,7 +11363,7 @@ function buildRunStatusEvidenceTextLines(packaged) {
11317
11363
  const known = readRecordArray(packaged.steps).find(
11318
11364
  (step) => typeof step.id === "string" && (id === step.id || id.endsWith(`:${step.id}`)) && typeof step.label === "string"
11319
11365
  );
11320
- const state = typeof _optionalChain([known, 'optionalAccess', _376 => _376.label]) === "string" ? known.label : typeof focus.status === "string" && focus.status.trim() ? formatNodeExecutionState(
11366
+ const state = typeof _optionalChain([known, 'optionalAccess', _379 => _379.label]) === "string" ? known.label : typeof focus.status === "string" && focus.status.trim() ? formatNodeExecutionState(
11321
11367
  deriveNodeExecutionState({
11322
11368
  reported: {
11323
11369
  status: focus.status.trim(),
@@ -11327,7 +11373,7 @@ function buildRunStatusEvidenceTextLines(packaged) {
11327
11373
  total: rows.total
11328
11374
  } : null
11329
11375
  },
11330
- runStatus: _optionalChain([run, 'optionalAccess', _377 => _377.status])
11376
+ runStatus: _optionalChain([run, 'optionalAccess', _380 => _380.status])
11331
11377
  })
11332
11378
  ) : null;
11333
11379
  lines.push(` current step: ${id}${label}${state ? `: ${state}` : ""}`);
@@ -11375,7 +11421,7 @@ function formatRecentRunLogLines(value) {
11375
11421
  (line) => typeof line === "string"
11376
11422
  );
11377
11423
  if (tail.length === 0) return [];
11378
- const shown = tail.map((line) => _chunkCVLM3WMJjs.classifyLogLine.call(void 0, line)).filter(
11424
+ const shown = tail.map((line) => _chunk2HAD745Vjs.classifyLogLine.call(void 0, line)).filter(
11379
11425
  (entry) => entry.level !== "debug" && !isProviderRowWaitLogLine(entry.line)
11380
11426
  ).slice(-8);
11381
11427
  const total = readNonNegativeInteger(logs.totalCount);
@@ -11419,7 +11465,7 @@ function buildRunPackageTextLines(packaged) {
11419
11465
  lines.push(` recovery: ${mode}${sourceRunId}`);
11420
11466
  }
11421
11467
  const runError = typeof run.error === "string" && run.error.trim() ? run.error.trim() : null;
11422
- const structuredRuntimeLimitMessage = typeof _optionalChain([runtimeLimitFailure, 'optionalAccess', _378 => _378.message]) === "string" && runtimeLimitFailure.message.trim() ? `${typeof runtimeLimitFailure.code === "string" ? runtimeLimitFailure.code : "RUNTIME_LIMIT_EXCEEDED"}: ${runtimeLimitFailure.message.trim()}` : null;
11468
+ 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;
11423
11469
  const displayRunError = _nullishCoalesce(structuredRuntimeLimitMessage, () => ( runError));
11424
11470
  if (!isRuntimeLimitCheckpoint && displayRunError && (status === "failed" || status === "cancelled")) {
11425
11471
  lines.push(` error: ${truncateErrorForDisplay(displayRunError, runId)}`);
@@ -11430,11 +11476,11 @@ function buildRunPackageTextLines(packaged) {
11430
11476
  }
11431
11477
  }
11432
11478
  const failedLogs = readRecord(packaged.failedLogs);
11433
- const failedLogEntries = Array.isArray(_optionalChain([failedLogs, 'optionalAccess', _379 => _379.entries])) ? failedLogs.entries.filter(
11479
+ const failedLogEntries = Array.isArray(_optionalChain([failedLogs, 'optionalAccess', _382 => _382.entries])) ? failedLogs.entries.filter(
11434
11480
  (entry) => typeof entry === "string"
11435
11481
  ) : [];
11436
- const failedLogAssociation = typeof _optionalChain([failedLogs, 'optionalAccess', _380 => _380.association]) === "string" ? failedLogs.association : null;
11437
- const failedLogWarning = typeof _optionalChain([failedLogs, 'optionalAccess', _381 => _381.warning]) === "string" && failedLogs.warning.trim() ? failedLogs.warning.trim() : null;
11482
+ const failedLogAssociation = typeof _optionalChain([failedLogs, 'optionalAccess', _383 => _383.association]) === "string" ? failedLogs.association : null;
11483
+ const failedLogWarning = typeof _optionalChain([failedLogs, 'optionalAccess', _384 => _384.warning]) === "string" && failedLogs.warning.trim() ? failedLogs.warning.trim() : null;
11438
11484
  if (failedLogEntries.length > 0) {
11439
11485
  lines.push(" failed logs:");
11440
11486
  lines.push(...failedLogEntries.map((entry) => ` ${entry}`));
@@ -11453,8 +11499,8 @@ function buildRunPackageTextLines(packaged) {
11453
11499
  )
11454
11500
  ).slice(0, 16) : [];
11455
11501
  lines.push(...packageWarnings.map((warning) => ` warning: ${warning}`));
11456
- const failedLogNext = readRecord(_optionalChain([failedLogs, 'optionalAccess', _382 => _382.next]));
11457
- if (failedLogWarning && typeof _optionalChain([failedLogNext, 'optionalAccess', _383 => _383.logs]) === "string") {
11502
+ const failedLogNext = readRecord(_optionalChain([failedLogs, 'optionalAccess', _385 => _385.next]));
11503
+ if (failedLogWarning && typeof _optionalChain([failedLogNext, 'optionalAccess', _386 => _386.logs]) === "string") {
11458
11504
  lines.push(
11459
11505
  failedLogAssociation === "retained_before_truncation" ? ` retained logs: ${failedLogNext.logs}` : ` retry failed logs: ${failedLogNext.logs}`
11460
11506
  );
@@ -11482,20 +11528,20 @@ function buildRunPackageTextLines(packaged) {
11482
11528
  const stepStatus = typeof step.status === "string" ? step.status : status;
11483
11529
  const output = step.output && typeof step.output === "object" && !Array.isArray(step.output) ? step.output : null;
11484
11530
  const rowCount = output && typeof output.rowCount === "number" ? ` rows=${formatInteger(output.rowCount)}` : "";
11485
- const preview = _optionalChain([output, 'optionalAccess', _384 => _384.preview]) && typeof output.preview === "object" && !Array.isArray(output.preview) ? output.preview : null;
11486
- const previewRows = Array.isArray(_optionalChain([preview, 'optionalAccess', _385 => _385.rows])) ? preview.rows.length : null;
11531
+ const preview = _optionalChain([output, 'optionalAccess', _387 => _387.preview]) && typeof output.preview === "object" && !Array.isArray(output.preview) ? output.preview : null;
11532
+ const previewRows = Array.isArray(_optionalChain([preview, 'optionalAccess', _388 => _388.rows])) ? preview.rows.length : null;
11487
11533
  lines.push(` ${kind} ${id}: ${stepStatus}${rowCount}`);
11488
- lines.push(...formatPackageDatasetSummaryLines(_optionalChain([output, 'optionalAccess', _386 => _386.summary])));
11534
+ lines.push(...formatPackageDatasetSummaryLines(_optionalChain([output, 'optionalAccess', _389 => _389.summary])));
11489
11535
  if (previewRows !== null) {
11490
11536
  lines.push(
11491
- ` preview=${previewRows}${_optionalChain([preview, 'optionalAccess', _387 => _387.truncated]) ? " truncated" : ""}`
11537
+ ` preview=${previewRows}${_optionalChain([preview, 'optionalAccess', _390 => _390.truncated]) ? " truncated" : ""}`
11492
11538
  );
11493
11539
  }
11494
11540
  }
11495
11541
  const inspectCommand = actionToCommand(next.inspect);
11496
11542
  const fullResultCommand = actionToCommand(next.full);
11497
11543
  const hasCatalogExportAction = packageDatasetRecords(packaged).some(
11498
- (dataset) => Boolean(actionToCommand(_optionalChain([readRecord, 'call', _388 => _388(dataset.actions), 'optionalAccess', _389 => _389.exportCsv])))
11544
+ (dataset) => Boolean(actionToCommand(_optionalChain([readRecord, 'call', _391 => _391(dataset.actions), 'optionalAccess', _392 => _392.exportCsv])))
11499
11545
  );
11500
11546
  const legacyExportCommand = hasCatalogExportAction ? null : actionToCommand(next.export);
11501
11547
  const runAgainCommand = typeof next.run === "string" && next.run.trim() ? next.run.trim() : null;
@@ -11560,7 +11606,7 @@ function withOrdinaryRunAgainCommand(status, options, resolvedRevisionId) {
11560
11606
  }
11561
11607
  function buildBillingRollupTextLines(status) {
11562
11608
  const billing = status.billing;
11563
- const rollup = _optionalChain([billing, 'optionalAccess', _390 => _390.rollup]);
11609
+ const rollup = _optionalChain([billing, 'optionalAccess', _393 => _393.rollup]);
11564
11610
  if (!rollup) return [];
11565
11611
  const total = formatCreditAmount2(rollup.totalCreditsRollup);
11566
11612
  if (rollup.childCredits > 0 && rollup.descendantRunCount > 0) {
@@ -11605,7 +11651,7 @@ function buildPlayCompletionTextLines(status) {
11605
11651
  const overview = buildRunOverview(status);
11606
11652
  const { run } = overview;
11607
11653
  const failed = run.status === "failed";
11608
- const label = run.status === "completed" ? _optionalChain([overview, 'access', _391 => _391.rowOutcomes, 'optionalAccess', _392 => _392.hasRowFailures]) ? "Completed with row failures" : "Completed" : failed ? "Failed" : run.status;
11654
+ const label = run.status === "completed" ? _optionalChain([overview, 'access', _394 => _394.rowOutcomes, 'optionalAccess', _395 => _395.hasRowFailures]) ? "Completed with row failures" : "Completed" : failed ? "Failed" : run.status;
11609
11655
  const lines = [
11610
11656
  `${label} ${_nullishCoalesce(_nullishCoalesce(run.playName, () => ( status.playName)), () => ( "Play"))}`,
11611
11657
  `Run: ${run.id}`
@@ -11625,7 +11671,7 @@ function buildPlayCompletionTextLines(status) {
11625
11671
  ...formatJsonPreview(compactReturnValue(overview.result))
11626
11672
  );
11627
11673
  }
11628
- if (_optionalChain([overview, 'access', _393 => _393.rowOutcomes, 'optionalAccess', _394 => _394.hasRowFailures])) {
11674
+ if (_optionalChain([overview, 'access', _396 => _396.rowOutcomes, 'optionalAccess', _397 => _397.hasRowFailures])) {
11629
11675
  lines.push(
11630
11676
  `Rows: ${overview.rowOutcomes.completedRows} completed, ${overview.rowOutcomes.failedRows} failed`
11631
11677
  );
@@ -11655,16 +11701,16 @@ function buildPlayCompletionTextLines(status) {
11655
11701
  function writePlayResult(status, jsonOutput, options) {
11656
11702
  const packaged = getPlayRunPackage(status);
11657
11703
  if (status.package) _chunkZMVJSS6Njs.recordPlayTermination.call(void 0, buildRunOverview(status).run);
11658
- const hits = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _395 => _395.hits]), () => ( null));
11704
+ const hits = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _398 => _398.hits]), () => ( null));
11659
11705
  if (jsonOutput) {
11660
- const payload2 = _optionalChain([options, 'optionalAccess', _396 => _396.fullJson]) ? status.package ? buildRunOverview(status, status) : { ...buildRunLaunch(status), diagnostics: status } : buildRunLaunch(status);
11661
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
11706
+ const payload2 = _optionalChain([options, 'optionalAccess', _399 => _399.fullJson]) ? status.package ? buildRunOverview(status, status) : { ...buildRunLaunch(status), diagnostics: status } : buildRunLaunch(status);
11707
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
11662
11708
  hits ? { ...payload2, hits } : payload2,
11663
- { json: true, fields: _optionalChain([options, 'optionalAccess', _397 => _397.jsonFields]) }
11709
+ { json: true, fields: _optionalChain([options, 'optionalAccess', _400 => _400.jsonFields]) }
11664
11710
  );
11665
11711
  return;
11666
11712
  }
11667
- if (packaged && !_optionalChain([options, 'optionalAccess', _398 => _398.fullJson])) {
11713
+ if (packaged && !_optionalChain([options, 'optionalAccess', _401 => _401.fullJson])) {
11668
11714
  const {
11669
11715
  logs: _logs,
11670
11716
  failedLogs: _failedLogs,
@@ -11674,7 +11720,7 @@ function writePlayResult(status, jsonOutput, options) {
11674
11720
  ...buildPlayCompletionTextLines(status),
11675
11721
  ...formatRunHitsLines(hits)
11676
11722
  ];
11677
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, displayPackage, {
11723
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, displayPackage, {
11678
11724
  json: false,
11679
11725
  text: `${lines2.join("\n")}
11680
11726
  `
@@ -11724,8 +11770,8 @@ function writePlayResult(status, jsonOutput, options) {
11724
11770
  lines.push(...renderedServerView.actions);
11725
11771
  lines.push(...buildBillingRollupTextLines(status));
11726
11772
  const compact = compactPlayStatus(status);
11727
- const payload = _optionalChain([options, 'optionalAccess', _399 => _399.fullJson]) ? status : compact;
11728
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
11773
+ const payload = _optionalChain([options, 'optionalAccess', _402 => _402.fullJson]) ? status : compact;
11774
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
11729
11775
  {
11730
11776
  ...payload,
11731
11777
  render: {
@@ -11878,14 +11924,14 @@ function mergeExportColumns(preferredColumns, rows) {
11878
11924
  return columns;
11879
11925
  }
11880
11926
  function sqlSafeExportColumnName(id) {
11881
- const prefix = _nullishCoalesce(_optionalChain([id, 'access', _400 => _400.trim, 'call', _401 => _401(), 'access', _402 => _402.match, 'call', _403 => _403(/^_+/), 'optionalAccess', _404 => _404[0]]), () => ( ""));
11927
+ const prefix = _nullishCoalesce(_optionalChain([id, 'access', _403 => _403.trim, 'call', _404 => _404(), 'access', _405 => _405.match, 'call', _406 => _406(/^_+/), 'optionalAccess', _407 => _407[0]]), () => ( ""));
11882
11928
  const normalized = id.trim().replace(/\.+/g, "__").replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
11883
11929
  const safe = `${prefix}${normalized || "column"}`;
11884
11930
  return /^[A-Za-z_]/.test(safe) ? safe : `c_${safe}`;
11885
11931
  }
11886
11932
  async function fetchBackingDatasetRows(input) {
11887
11933
  const playName = extractRunPlayName(input.status);
11888
- const tableNamespace = _optionalChain([input, 'access', _405 => _405.rowsInfo, 'access', _406 => _406.tableNamespace, 'optionalAccess', _407 => _407.trim, 'call', _408 => _408()]);
11934
+ const tableNamespace = _optionalChain([input, 'access', _408 => _408.rowsInfo, 'access', _409 => _409.tableNamespace, 'optionalAccess', _410 => _410.trim, 'call', _411 => _411()]);
11889
11935
  if (!playName || !tableNamespace) {
11890
11936
  return null;
11891
11937
  }
@@ -11924,7 +11970,7 @@ async function fetchBackingDatasetRows(input) {
11924
11970
  seenEnvelopeKeys.add(key);
11925
11971
  }
11926
11972
  sheetRows.push(...page.rows);
11927
- const summaryTotal = _optionalChain([page, 'access', _409 => _409.summary, 'optionalAccess', _410 => _410.stats, 'optionalAccess', _411 => _411.total]);
11973
+ const summaryTotal = _optionalChain([page, 'access', _412 => _412.summary, 'optionalAccess', _413 => _413.stats, 'optionalAccess', _414 => _414.total]);
11928
11974
  if (typeof summaryTotal === "number" && Number.isFinite(summaryTotal)) {
11929
11975
  settledTotal = Math.max(_nullishCoalesce(settledTotal, () => ( 0)), Math.trunc(summaryTotal));
11930
11976
  }
@@ -12018,7 +12064,7 @@ function assertDatasetHasExportableRows(input) {
12018
12064
  const rowOutcomes = _nullishCoalesce(readRowOutcomeSummary(input.status), () => ( readRowOutcomeSummary(
12019
12065
  getRecordField(getRecordField(input.status, "result"), "_metadata")
12020
12066
  )));
12021
- 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', _412 => _412.failedRows]) === 0 && !rowOutcomes.hasRowFailures) {
12067
+ 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) {
12022
12068
  return input.rowsInfo;
12023
12069
  }
12024
12070
  const datasetLabel = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(input.datasetPath, () => ( input.rowsInfo.tableNamespace)), () => ( input.rowsInfo.source)), () => ( "result.rows"));
@@ -12090,8 +12136,8 @@ async function exportPlayStatusRows(client, status, outPath, options = {}) {
12090
12136
  path: dataset.exportFile(outPath, options),
12091
12137
  rowsInfo: dataset.info(),
12092
12138
  currentTable: false,
12093
- datasetPath: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _413 => _413.source]), () => ( null)),
12094
- datasetInfo: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _414 => _414.info, 'call', _415 => _415()]), () => ( null))
12139
+ datasetPath: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _416 => _416.source]), () => ( null)),
12140
+ datasetInfo: _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _417 => _417.info, 'call', _418 => _418()]), () => ( null))
12095
12141
  };
12096
12142
  };
12097
12143
  const run = Run.open({
@@ -12103,7 +12149,7 @@ async function exportPlayStatusRows(client, status, outPath, options = {}) {
12103
12149
  const returnedRows = datasets.returned().map((dataset) => dataset.info());
12104
12150
  const recoveredRows = datasets.recovered().map((dataset) => dataset.info());
12105
12151
  const selectedDataset = run.dataset(options.datasetPath);
12106
- const rowsInfo = _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _416 => _416.info, 'call', _417 => _417()]), () => ( null));
12152
+ const rowsInfo = _nullishCoalesce(_optionalChain([selectedDataset, 'optionalAccess', _419 => _419.info, 'call', _420 => _420()]), () => ( null));
12107
12153
  if (!selectedDataset && options.datasetPath) {
12108
12154
  const available = availableRows.map((info) => info.source).filter((source) => typeof source === "string");
12109
12155
  const commands = datasetChoiceLines({
@@ -12215,7 +12261,7 @@ ${commands.join("\n")}`,
12215
12261
  throw error;
12216
12262
  }
12217
12263
  }
12218
- if (_optionalChain([fetchedRowsInfo, 'optionalAccess', _418 => _418.complete])) {
12264
+ if (_optionalChain([fetchedRowsInfo, 'optionalAccess', _421 => _421.complete])) {
12219
12265
  const guarded2 = assertDatasetHasExportableRows({
12220
12266
  rowsInfo: fetchedRowsInfo,
12221
12267
  status,
@@ -12277,7 +12323,7 @@ function extractActiveRunsFromError(error) {
12277
12323
  if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError)) {
12278
12324
  return [];
12279
12325
  }
12280
- const response = _optionalChain([error, 'access', _419 => _419.details, 'optionalAccess', _420 => _420.response]);
12326
+ const response = _optionalChain([error, 'access', _422 => _422.details, 'optionalAccess', _423 => _423.response]);
12281
12327
  if (!response || typeof response !== "object" || Array.isArray(response)) {
12282
12328
  return [];
12283
12329
  }
@@ -12396,8 +12442,8 @@ function renderServerResultView(value) {
12396
12442
  return { lines: [], actions: [] };
12397
12443
  }
12398
12444
  const view = value;
12399
- const renderedSections = Array.isArray(_optionalChain([view, 'access', _421 => _421.render, 'optionalAccess', _422 => _422.sections])) ? view.render.sections : [];
12400
- const renderedActions = Array.isArray(_optionalChain([view, 'access', _423 => _423.render, 'optionalAccess', _424 => _424.actions])) ? view.render.actions : [];
12445
+ const renderedSections = Array.isArray(_optionalChain([view, 'access', _424 => _424.render, 'optionalAccess', _425 => _425.sections])) ? view.render.sections : [];
12446
+ const renderedActions = Array.isArray(_optionalChain([view, 'access', _426 => _426.render, 'optionalAccess', _427 => _427.actions])) ? view.render.actions : [];
12401
12447
  if (renderedSections.length > 0 || renderedActions.length > 0) {
12402
12448
  const lines2 = [];
12403
12449
  for (const section of renderedSections) {
@@ -12435,7 +12481,7 @@ function renderServerResultView(value) {
12435
12481
  }
12436
12482
  const tables = Array.isArray(view.tables) ? view.tables : [];
12437
12483
  const topLevelOutputTable = view.topLevelOutputTable && typeof view.topLevelOutputTable === "object" && !Array.isArray(view.topLevelOutputTable) ? view.topLevelOutputTable : null;
12438
- if (typeof _optionalChain([topLevelOutputTable, 'optionalAccess', _425 => _425.queryCommand]) === "string") {
12484
+ if (typeof _optionalChain([topLevelOutputTable, 'optionalAccess', _428 => _428.queryCommand]) === "string") {
12439
12485
  lines.push(` top-level outputs: ${topLevelOutputTable.queryCommand}`);
12440
12486
  }
12441
12487
  if (tables.length > 0) {
@@ -12495,7 +12541,7 @@ function writeStartedPlayRun(input) {
12495
12541
  dashboardUrl: input.dashboardUrl,
12496
12542
  package: input.package
12497
12543
  };
12498
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, buildRunLaunch(status), {
12544
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, buildRunLaunch(status), {
12499
12545
  json: true,
12500
12546
  fields: input.jsonFields
12501
12547
  });
@@ -12517,7 +12563,7 @@ function writeStartedPlayRun(input) {
12517
12563
  input.progress.writeLine(output2, process.stdout);
12518
12564
  return;
12519
12565
  }
12520
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, input.package, {
12566
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, input.package, {
12521
12567
  json: false,
12522
12568
  text: `${output2}
12523
12569
  `
@@ -12546,7 +12592,7 @@ function writeStartedPlayRun(input) {
12546
12592
  ) ? [`Stop: deepline runs stop ${_chunkAID3OYVJjs.shellQuote.call(void 0, input.runId)}`] : []
12547
12593
  ];
12548
12594
  if (input.jsonOutput) {
12549
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, payload, { json: true, fields: input.jsonFields });
12595
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, payload, { json: true, fields: input.jsonFields });
12550
12596
  return;
12551
12597
  }
12552
12598
  if (input.dashboardUrl) {
@@ -12557,7 +12603,7 @@ function writeStartedPlayRun(input) {
12557
12603
  input.progress.writeLine(output, process.stdout);
12558
12604
  return;
12559
12605
  }
12560
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
12606
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
12561
12607
  {
12562
12608
  ...payload,
12563
12609
  render: { sections: [{ title: "play run", lines }] }
@@ -12567,7 +12613,7 @@ function writeStartedPlayRun(input) {
12567
12613
  );
12568
12614
  }
12569
12615
  function parsePlayCheckOptions(args) {
12570
- const selection = _chunkRV6ALZIXjs.parseJsonFields.call(void 0, args, "check");
12616
+ const selection = _chunkM7Y7JYZXjs.parseJsonFields.call(void 0, args, "check");
12571
12617
  args = selection.args;
12572
12618
  const target = args[0];
12573
12619
  if (!target || target.startsWith("-")) {
@@ -12579,7 +12625,7 @@ function parsePlayCheckOptions(args) {
12579
12625
  if (arg !== "--json" && arg !== "--full")
12580
12626
  throw new Error(`Unknown plays check option: ${arg}`);
12581
12627
  }
12582
- const jsonOutput = _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
12628
+ const jsonOutput = _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
12583
12629
  return {
12584
12630
  target,
12585
12631
  jsonOutput,
@@ -12655,7 +12701,7 @@ ${PLAY_PUBLISH_USAGE}`
12655
12701
  useLatest,
12656
12702
  expectedArtifactHash,
12657
12703
  dryRun,
12658
- jsonOutput: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args)
12704
+ jsonOutput: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)
12659
12705
  };
12660
12706
  }
12661
12707
  var PLAY_SAVE_USAGE = "Usage: deepline plays save <play-file.ts> [--expected-artifact <hash>] [--dry-run] [--json]";
@@ -12696,7 +12742,7 @@ ${PLAY_SAVE_USAGE}`);
12696
12742
  target,
12697
12743
  expectedArtifactHash,
12698
12744
  dryRun,
12699
- jsonOutput: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args)
12745
+ jsonOutput: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)
12700
12746
  };
12701
12747
  }
12702
12748
  function printScheduledPlayCapacity(capacity) {
@@ -12749,7 +12795,7 @@ function checkHintExpression(value) {
12749
12795
  return stringValue2(value).replace(/^toolExecutionResult\./, "result.");
12750
12796
  }
12751
12797
  function checkHintRawPath(value) {
12752
- return _optionalChain([value, 'optionalAccess', _426 => _426.startsWith, 'call', _427 => _427("toolResponse.rawV2")]) ? value.replace(/^toolResponse\./, "result.toolResponse.") : void 0;
12798
+ return _optionalChain([value, 'optionalAccess', _429 => _429.startsWith, 'call', _430 => _430("toolResponse.rawV2")]) ? value.replace(/^toolResponse\./, "result.toolResponse.") : void 0;
12753
12799
  }
12754
12800
  function collectStaticPipelineToolIds(staticPipeline) {
12755
12801
  const seen = /* @__PURE__ */ new Set();
@@ -12824,30 +12870,30 @@ function cronExecutionLabel(status) {
12824
12870
  }
12825
12871
  function readLiveCronMetadata(play) {
12826
12872
  const record3 = readRecord(play);
12827
- const metadata = readRecord(_optionalChain([record3, 'optionalAccess', _428 => _428.triggerMetadata]));
12873
+ const metadata = readRecord(_optionalChain([record3, 'optionalAccess', _431 => _431.triggerMetadata]));
12828
12874
  return {
12829
- schedule: typeof _optionalChain([metadata, 'optionalAccess', _429 => _429.cronSchedule]) === "string" ? metadata.cronSchedule : null,
12830
- timezone: typeof _optionalChain([metadata, 'optionalAccess', _430 => _430.cronTimezone]) === "string" ? metadata.cronTimezone : null,
12831
- nextScheduledAt: typeof _optionalChain([metadata, 'optionalAccess', _431 => _431.nextScheduledAt]) === "number" ? metadata.nextScheduledAt : null,
12832
- blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _432 => _432.blockedAt]) === "number" ? metadata.blockedAt : null,
12833
- blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _433 => _433.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null
12875
+ schedule: typeof _optionalChain([metadata, 'optionalAccess', _432 => _432.cronSchedule]) === "string" ? metadata.cronSchedule : null,
12876
+ timezone: typeof _optionalChain([metadata, 'optionalAccess', _433 => _433.cronTimezone]) === "string" ? metadata.cronTimezone : null,
12877
+ nextScheduledAt: typeof _optionalChain([metadata, 'optionalAccess', _434 => _434.nextScheduledAt]) === "number" ? metadata.nextScheduledAt : null,
12878
+ blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _435 => _435.blockedAt]) === "number" ? metadata.blockedAt : null,
12879
+ blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _436 => _436.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null
12834
12880
  };
12835
12881
  }
12836
12882
  function liveTriggerStatusLines(status, play) {
12837
12883
  const cron = readLiveCronMetadata(play);
12838
- if (!_optionalChain([status, 'optionalAccess', _434 => _434.cron]) && !cron.schedule && !_optionalChain([status, 'optionalAccess', _435 => _435.webhook])) return [];
12884
+ if (!_optionalChain([status, 'optionalAccess', _437 => _437.cron]) && !cron.schedule && !_optionalChain([status, 'optionalAccess', _438 => _438.webhook])) return [];
12839
12885
  const lines = [];
12840
- if (_optionalChain([status, 'optionalAccess', _436 => _436.cron]) || cron.schedule) {
12886
+ if (_optionalChain([status, 'optionalAccess', _439 => _439.cron]) || cron.schedule) {
12841
12887
  const timezone = cron.timezone ? ` (${cron.timezone})` : "";
12842
12888
  lines.push(
12843
- ` Scheduled execution: ${cronExecutionLabel(_nullishCoalesce(_optionalChain([status, 'optionalAccess', _437 => _437.cron]), () => ( null)))}${cron.schedule ? ` \u2014 ${cron.schedule}${timezone}` : ""}`
12889
+ ` Scheduled execution: ${cronExecutionLabel(_nullishCoalesce(_optionalChain([status, 'optionalAccess', _440 => _440.cron]), () => ( null)))}${cron.schedule ? ` \u2014 ${cron.schedule}${timezone}` : ""}`
12844
12890
  );
12845
- if (cron.nextScheduledAt !== null && _optionalChain([status, 'optionalAccess', _438 => _438.cron]) === "active") {
12891
+ if (cron.nextScheduledAt !== null && _optionalChain([status, 'optionalAccess', _441 => _441.cron]) === "active") {
12846
12892
  lines.push(
12847
12893
  ` Next scheduled run: ${formatTimestamp(cron.nextScheduledAt)}`
12848
12894
  );
12849
12895
  }
12850
- if (_optionalChain([status, 'optionalAccess', _439 => _439.blockedReason])) {
12896
+ if (_optionalChain([status, 'optionalAccess', _442 => _442.blockedReason])) {
12851
12897
  lines.push(` Schedule issue: ${status.blockedReason}`);
12852
12898
  if (status.blockedReasonCode || cron.blockedReasonCode) {
12853
12899
  lines.push(
@@ -12863,7 +12909,7 @@ function liveTriggerStatusLines(status, play) {
12863
12909
  );
12864
12910
  }
12865
12911
  }
12866
- if (_optionalChain([status, 'optionalAccess', _440 => _440.webhook])) {
12912
+ if (_optionalChain([status, 'optionalAccess', _443 => _443.webhook])) {
12867
12913
  lines.push(` Webhook: ${status.webhook}`);
12868
12914
  }
12869
12915
  return lines;
@@ -12871,11 +12917,11 @@ function liveTriggerStatusLines(status, play) {
12871
12917
  function triggerStatusFromMetadata(value) {
12872
12918
  const metadata = readRecord(value);
12873
12919
  return {
12874
- cron: typeof _optionalChain([metadata, 'optionalAccess', _441 => _441.cronStatus]) === "string" ? metadata.cronStatus : null,
12875
- webhook: typeof _optionalChain([metadata, 'optionalAccess', _442 => _442.webhookStatus]) === "string" ? metadata.webhookStatus : null,
12876
- blockedReason: typeof _optionalChain([metadata, 'optionalAccess', _443 => _443.blockedReason]) === "string" ? metadata.blockedReason : null,
12877
- blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _444 => _444.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null,
12878
- blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _445 => _445.blockedAt]) === "number" ? metadata.blockedAt : null
12920
+ cron: typeof _optionalChain([metadata, 'optionalAccess', _444 => _444.cronStatus]) === "string" ? metadata.cronStatus : null,
12921
+ webhook: typeof _optionalChain([metadata, 'optionalAccess', _445 => _445.webhookStatus]) === "string" ? metadata.webhookStatus : null,
12922
+ blockedReason: typeof _optionalChain([metadata, 'optionalAccess', _446 => _446.blockedReason]) === "string" ? metadata.blockedReason : null,
12923
+ blockedReasonCode: typeof _optionalChain([metadata, 'optionalAccess', _447 => _447.blockedReasonCode]) === "string" ? metadata.blockedReasonCode : null,
12924
+ blockedAt: typeof _optionalChain([metadata, 'optionalAccess', _448 => _448.blockedAt]) === "number" ? metadata.blockedAt : null
12879
12925
  };
12880
12926
  }
12881
12927
  function printPublishReceipt(input) {
@@ -12907,7 +12953,7 @@ function printBundledRuntimeWarning(bundle) {
12907
12953
  async function handlePlayCheck(args) {
12908
12954
  const options = parsePlayCheckOptions(args);
12909
12955
  if (!isFileTarget2(options.target)) {
12910
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
12956
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
12911
12957
  try {
12912
12958
  await assertCanonicalNamedPlayReference(client, options.target, {
12913
12959
  command: "check"
@@ -12936,7 +12982,7 @@ async function handlePlayCheck(args) {
12936
12982
  },
12937
12983
  ...options.full ? { diagnostics: { staticPipeline: _nullishCoalesce(play.staticPipeline, () => ( null)) } } : {}
12938
12984
  };
12939
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, result, {
12985
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, result, {
12940
12986
  json: options.jsonOutput,
12941
12987
  fields: options.jsonFields,
12942
12988
  text: renderPlayCheckOutput(result) + "\n"
@@ -12946,7 +12992,7 @@ async function handlePlayCheck(args) {
12946
12992
  const resolved = _path.resolve.call(void 0, options.target);
12947
12993
  const message = error instanceof Error && error.message ? error.message : `File not found: ${resolved}`;
12948
12994
  if (options.jsonOutput) {
12949
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
12995
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
12950
12996
  {
12951
12997
  kind: "play_check",
12952
12998
  checked: "named_contract",
@@ -12979,16 +13025,16 @@ async function handlePlayCheck(args) {
12979
13025
  );
12980
13026
  }
12981
13027
  const primary = outcomes.find(
12982
- (outcome) => outcome.exportName === _chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT
13028
+ (outcome) => outcome.exportName === _chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT
12983
13029
  );
12984
13030
  const output = buildPlayCheckOutput({
12985
13031
  outcomes,
12986
13032
  target: options.target,
12987
13033
  full: options.full,
12988
13034
  detailsCommand: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)} --full`,
12989
- publishCommand: _optionalChain([primary, 'optionalAccess', _446 => _446.result, 'access', _447 => _447.artifactHash]) ? `deepline plays publish ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)} --expected-artifact ${primary.result.artifactHash}` : void 0
13035
+ 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
12990
13036
  });
12991
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, output, {
13037
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, output, {
12992
13038
  json: options.jsonOutput,
12993
13039
  fields: options.jsonFields,
12994
13040
  text: renderPlayCheckOutput(output) + "\n"
@@ -12996,12 +13042,12 @@ async function handlePlayCheck(args) {
12996
13042
  return output.valid ? 0 : 1;
12997
13043
  }
12998
13044
  function resolvePlayCheckExportNames(sourceCode) {
12999
- const exports = _chunkQGKPTBRRjs.listPlayFileExports.call(void 0, sourceCode);
13000
- if (!exports || exports.length === 0) return [_chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT];
13045
+ const exports = _chunkMS6GUPBBjs.listPlayFileExports.call(void 0, sourceCode);
13046
+ if (!exports || exports.length === 0) return [_chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT];
13001
13047
  return exports.map((entry) => entry.name);
13002
13048
  }
13003
13049
  function artifactForProductionCompatibilityCheck(artifact) {
13004
- const rawEdition = _optionalChain([process, 'access', _448 => _448.env, 'access', _449 => _449.DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION, 'optionalAccess', _450 => _450.trim, 'call', _451 => _451()]);
13050
+ const rawEdition = _optionalChain([process, 'access', _451 => _451.env, 'access', _452 => _452.DEEPLINE_PROD_CHECK_AUTHORING_CONTRACT_EDITION, 'optionalAccess', _453 => _453.trim, 'call', _454 => _454()]);
13005
13051
  if (!rawEdition) return artifact;
13006
13052
  if (!/^\d+$/.test(rawEdition)) {
13007
13053
  throw new Error(
@@ -13042,7 +13088,7 @@ async function checkOneExportedPlay(input) {
13042
13088
  }
13043
13089
  const playName = _nullishCoalesce(graph.root.playName, () => ( fallbackName));
13044
13090
  const authoringErrors = collectPlayGraphAuthoringErrors(graph);
13045
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
13091
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
13046
13092
  const integrationMode = resolveEvalIntegrationMode();
13047
13093
  const importedPlays = [...graph.nodes.values()].filter((node) => node.filePath !== graph.root.filePath).map((node) => ({
13048
13094
  playName: node.playName,
@@ -13055,7 +13101,7 @@ async function checkOneExportedPlay(input) {
13055
13101
  sourceFiles: graph.root.sourceFiles,
13056
13102
  description: _nullishCoalesce(graph.root.playDescription, () => ( void 0)),
13057
13103
  artifact: artifactForProductionCompatibilityCheck(graph.root.artifact),
13058
- ...exportName === _chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT ? {} : { exportName },
13104
+ ...exportName === _chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT ? {} : { exportName },
13059
13105
  ...importedPlays.length > 0 ? { importedPlays } : {},
13060
13106
  ...integrationMode ? { integrationMode } : {}
13061
13107
  });
@@ -13106,7 +13152,7 @@ async function handleFileBackedRun(options, hooks) {
13106
13152
  () => collectBundledPlayGraph(
13107
13153
  absolutePlayPath,
13108
13154
  options.profile,
13109
- _chunkQGKPTBRRjs.PLAY_DEFAULT_EXPORT,
13155
+ _chunkMS6GUPBBjs.PLAY_DEFAULT_EXPORT,
13110
13156
  { cache: !options.dryRun }
13111
13157
  )
13112
13158
  );
@@ -13119,7 +13165,7 @@ async function handleFileBackedRun(options, hooks) {
13119
13165
  );
13120
13166
  return 0;
13121
13167
  }
13122
- client = new (0, _chunkCVLM3WMJjs.DeeplineClient)(playRunClientOptions(options));
13168
+ client = new (0, _chunk2HAD745Vjs.DeeplineClient)(playRunClientOptions(options));
13123
13169
  const canDeferCompilerManifest = graph.root.importedPlayDependencies.length === 0 && !sourceGraphMentionsRunPlay(graph.root) && !inputContainsLocalFilePath(runtimeInput);
13124
13170
  if (canDeferCompilerManifest) {
13125
13171
  _chunkAYHLUHE5js.recordCliTrace.call(void 0, {
@@ -13171,8 +13217,8 @@ async function handleFileBackedRun(options, hooks) {
13171
13217
  (file) => stageFile(file.logicalPath, file.absolutePath)
13172
13218
  );
13173
13219
  const compilerManifest = _nullishCoalesce(bundleResult.compilerManifest, () => ( null));
13174
- const fileInputBindings = _chunkPAIMOGCMjs.fileInputBindingsFromStaticPipeline.call(void 0,
13175
- _optionalChain([compilerManifest, 'optionalAccess', _452 => _452.staticPipeline])
13220
+ const fileInputBindings = _chunkUHNDVD3Pjs.fileInputBindingsFromStaticPipeline.call(void 0,
13221
+ _optionalChain([compilerManifest, 'optionalAccess', _455 => _455.staticPipeline])
13176
13222
  );
13177
13223
  const stagedFileInputs = await _chunkAYHLUHE5js.traceCliSpan.call(void 0,
13178
13224
  "cli.play_stage_inputs",
@@ -13197,6 +13243,8 @@ async function handleFileBackedRun(options, hooks) {
13197
13243
  ...options.debugMapLatency ? { mapLatencyProfile: true } : {}
13198
13244
  };
13199
13245
  const startRequest = {
13246
+ ...options.workflowId ? { workflowId: options.workflowId } : {},
13247
+ ...options.maxTotalCredits !== null ? { maxTotalCredits: options.maxTotalCredits } : {},
13200
13248
  name: playName,
13201
13249
  sourceCode: bundleResult.sourceCode,
13202
13250
  sourceFiles: bundleResult.sourceFiles,
@@ -13233,8 +13281,9 @@ async function handleFileBackedRun(options, hooks) {
13233
13281
  waitTimeoutMs: options.waitTimeoutMs,
13234
13282
  open: options.open,
13235
13283
  progress,
13236
- onRunStarted: _optionalChain([hooks, 'optionalAccess', _453 => _453.onRunStarted]),
13237
- onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _454 => _454.onRunAdmitted])
13284
+ onRunStarted: _optionalChain([hooks, 'optionalAccess', _456 => _456.onRunStarted]),
13285
+ onSubmission: _optionalChain([hooks, 'optionalAccess', _457 => _457.onSubmission]),
13286
+ onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _458 => _458.onRunAdmitted])
13238
13287
  }).catch(async (error) => {
13239
13288
  throw await normalizePlayStartError(client, error, playName);
13240
13289
  })
@@ -13256,7 +13305,7 @@ async function handleFileBackedRun(options, hooks) {
13256
13305
  ),
13257
13306
  options
13258
13307
  );
13259
- _optionalChain([hooks, 'optionalAccess', _455 => _455.onTerminalStatus, 'optionalCall', _456 => _456(outputStatus)]);
13308
+ _optionalChain([hooks, 'optionalAccess', _459 => _459.onTerminalStatus, 'optionalCall', _460 => _460(outputStatus)]);
13260
13309
  traceCliSync(
13261
13310
  "cli.play_write_result",
13262
13311
  { targetKind: "file", playName },
@@ -13271,12 +13320,12 @@ async function handleFileBackedRun(options, hooks) {
13271
13320
  const started = await _chunkAYHLUHE5js.traceCliSpan.call(void 0,
13272
13321
  "cli.play_start_unwatched",
13273
13322
  { targetKind: "file", playName },
13274
- () => client.startPlayRun(startRequest).catch(async (error) => {
13323
+ () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _461 => _461.onSubmission]) }).catch(async (error) => {
13275
13324
  throw await normalizePlayStartError(client, error, playName);
13276
13325
  })
13277
13326
  );
13278
- await _optionalChain([hooks, 'optionalAccess', _457 => _457.onRunStarted, 'optionalCall', _458 => _458(started.workflowId)]);
13279
- await _optionalChain([hooks, 'optionalAccess', _459 => _459.onRunAdmitted, 'optionalCall', _460 => _460(started.workflowId)]);
13327
+ await _optionalChain([hooks, 'optionalAccess', _462 => _462.onRunStarted, 'optionalCall', _463 => _463(started.workflowId)]);
13328
+ await _optionalChain([hooks, 'optionalAccess', _464 => _464.onRunAdmitted, 'optionalCall', _465 => _465(started.workflowId)]);
13280
13329
  const resolvedDashboardUrl = buildPlayDashboardUrl(client.baseUrl, playName);
13281
13330
  openPlayDashboard(resolvedDashboardUrl, options.open);
13282
13331
  progress.phase("started run");
@@ -13304,7 +13353,7 @@ async function resolveNamedRunRevisionId(input) {
13304
13353
  if (input.selector === "latest") {
13305
13354
  const versions = await input.client.listPlayVersions(input.playName);
13306
13355
  const latest = versions[0];
13307
- if (!_optionalChain([latest, 'optionalAccess', _461 => _461._id])) {
13356
+ if (!_optionalChain([latest, 'optionalAccess', _466 => _466._id])) {
13308
13357
  throw new Error(`No saved revisions found for ${input.playName}.`);
13309
13358
  }
13310
13359
  return latest._id;
@@ -13315,7 +13364,7 @@ async function handleNamedRun(options, hooks) {
13315
13364
  if (options.target.kind !== "name") {
13316
13365
  throw new Error("Expected a named play run target.");
13317
13366
  }
13318
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)(playRunClientOptions(options));
13367
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)(playRunClientOptions(options));
13319
13368
  const progress = _nullishCoalesce(_chunkWJYPBHTEjs.getActiveCliProgress.call(void 0, ), () => ( _chunkWJYPBHTEjs.createCliProgress.call(void 0, !options.jsonOutput)));
13320
13369
  const playName = options.target.name;
13321
13370
  const runtimeInput = options.input ? { ...options.input } : {};
@@ -13363,8 +13412,8 @@ async function handleNamedRun(options, hooks) {
13363
13412
  })
13364
13413
  );
13365
13414
  const fileInputBindings = playDetail ? [
13366
- ..._chunkPAIMOGCMjs.fileInputBindingsFromPlaySchema.call(void 0, playDetail.play.inputSchema),
13367
- ..._chunkPAIMOGCMjs.fileInputBindingsFromStaticPipeline.call(void 0, playDetail.play.staticPipeline)
13415
+ ..._chunkUHNDVD3Pjs.fileInputBindingsFromPlaySchema.call(void 0, playDetail.play.inputSchema),
13416
+ ..._chunkUHNDVD3Pjs.fileInputBindingsFromStaticPipeline.call(void 0, playDetail.play.staticPipeline)
13368
13417
  ] : [];
13369
13418
  const stagedFileInputs = await _chunkAYHLUHE5js.traceCliSpan.call(void 0,
13370
13419
  "cli.play_stage_inputs",
@@ -13389,12 +13438,14 @@ async function handleNamedRun(options, hooks) {
13389
13438
  const testPolicyOverrides = {
13390
13439
  ...options.debugMapLatency ? { mapLatencyProfile: true } : {}
13391
13440
  };
13392
- const startRequest = _chunkPAIMOGCMjs.buildNamedPlayRunRequest.call(void 0, {
13441
+ const startRequest = _chunkUHNDVD3Pjs.buildNamedPlayRunRequest.call(void 0, {
13393
13442
  name: playName,
13394
13443
  revisionId: selectedRevisionId,
13395
13444
  runtimeInput,
13396
13445
  stagedFileInputs,
13397
13446
  extra: {
13447
+ ...options.workflowId ? { workflowId: options.workflowId } : {},
13448
+ ...options.maxTotalCredits !== null ? { maxTotalCredits: options.maxTotalCredits } : {},
13398
13449
  ...options.force ? { force: true } : {},
13399
13450
  ...options.forceToolRefresh ? { forceToolRefresh: true } : {},
13400
13451
  ...options.maxConcurrentExternalCalls !== null ? { maxConcurrentExternalCalls: options.maxConcurrentExternalCalls } : {},
@@ -13422,8 +13473,9 @@ async function handleNamedRun(options, hooks) {
13422
13473
  waitTimeoutMs: options.waitTimeoutMs,
13423
13474
  open: options.open,
13424
13475
  progress,
13425
- onRunStarted: _optionalChain([hooks, 'optionalAccess', _462 => _462.onRunStarted]),
13426
- onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _463 => _463.onRunAdmitted])
13476
+ onRunStarted: _optionalChain([hooks, 'optionalAccess', _467 => _467.onRunStarted]),
13477
+ onSubmission: _optionalChain([hooks, 'optionalAccess', _468 => _468.onSubmission]),
13478
+ onRunAdmitted: _optionalChain([hooks, 'optionalAccess', _469 => _469.onRunAdmitted])
13427
13479
  }).catch(async (error) => {
13428
13480
  throw await normalizePlayStartError(client, error, playName, {
13429
13481
  suggestMissingPlay: true
@@ -13448,7 +13500,7 @@ async function handleNamedRun(options, hooks) {
13448
13500
  options,
13449
13501
  _nullishCoalesce(finalStatus.revisionId, () => ( selectedRevisionId))
13450
13502
  );
13451
- _optionalChain([hooks, 'optionalAccess', _464 => _464.onTerminalStatus, 'optionalCall', _465 => _465(outputStatus)]);
13503
+ _optionalChain([hooks, 'optionalAccess', _470 => _470.onTerminalStatus, 'optionalCall', _471 => _471(outputStatus)]);
13452
13504
  traceCliSync(
13453
13505
  "cli.play_write_result",
13454
13506
  { targetKind: "name", playName },
@@ -13463,14 +13515,14 @@ async function handleNamedRun(options, hooks) {
13463
13515
  const started = await _chunkAYHLUHE5js.traceCliSpan.call(void 0,
13464
13516
  "cli.play_start_unwatched",
13465
13517
  { targetKind: "name", playName },
13466
- () => client.startPlayRun(startRequest).catch(async (error) => {
13518
+ () => client.startPlayRun(startRequest, { onSubmission: _optionalChain([hooks, 'optionalAccess', _472 => _472.onSubmission]) }).catch(async (error) => {
13467
13519
  throw await normalizePlayStartError(client, error, playName, {
13468
13520
  suggestMissingPlay: true
13469
13521
  });
13470
13522
  })
13471
13523
  );
13472
- await _optionalChain([hooks, 'optionalAccess', _466 => _466.onRunStarted, 'optionalCall', _467 => _467(started.workflowId)]);
13473
- await _optionalChain([hooks, 'optionalAccess', _468 => _468.onRunAdmitted, 'optionalCall', _469 => _469(started.workflowId)]);
13524
+ await _optionalChain([hooks, 'optionalAccess', _473 => _473.onRunStarted, 'optionalCall', _474 => _474(started.workflowId)]);
13525
+ await _optionalChain([hooks, 'optionalAccess', _475 => _475.onRunAdmitted, 'optionalCall', _476 => _476(started.workflowId)]);
13474
13526
  const resolvedDashboardUrl = buildPlayDashboardUrl(client.baseUrl, playName);
13475
13527
  openPlayDashboard(resolvedDashboardUrl, options.open);
13476
13528
  progress.phase("started run");
@@ -13499,16 +13551,40 @@ async function handlePlayRun(args, hooks) {
13499
13551
  } : parsedOptions;
13500
13552
  const runHooks = options.runIdFile ? {
13501
13553
  ...hooks,
13554
+ onSubmission: async (intent) => {
13555
+ const destination = `${options.runIdFile}.submission.json`;
13556
+ const tempPath = runIdFileTempPath(destination);
13557
+ try {
13558
+ const handle = await _promises.open.call(void 0, tempPath, "wx", 384);
13559
+ try {
13560
+ await handle.writeFile(
13561
+ JSON.stringify({
13562
+ version: 1,
13563
+ admissionState: "submitted_unknown",
13564
+ baseUrl: new (0, _chunk2HAD745Vjs.DeeplineClient)().baseUrl,
13565
+ ...intent
13566
+ })
13567
+ );
13568
+ await handle.sync();
13569
+ } finally {
13570
+ await handle.close();
13571
+ }
13572
+ await _promises.link.call(void 0, tempPath, destination);
13573
+ } finally {
13574
+ await removeRunIdTempFile(tempPath);
13575
+ }
13576
+ await _optionalChain([hooks, 'optionalAccess', _477 => _477.onSubmission, 'optionalCall', _478 => _478(intent)]);
13577
+ },
13502
13578
  onRunStarted: async (runId) => {
13503
13579
  try {
13504
13580
  await writePlayRunIdFile(options.runIdFile, runId);
13505
13581
  } catch (error) {
13506
13582
  throw new Error(
13507
- `Run ${runId} was accepted, but its identity could not be persisted to ${options.runIdFile}: ${error instanceof Error ? error.message : String(error)}. Inspect it with 'deepline runs get ${runId} --full'; do not submit a replacement run.`,
13583
+ `Run ${runId} was accepted, but its identity could not be persisted to ${options.runIdFile}: ${error instanceof Error ? error.message : String(error)}. Inspect it with 'deepline runs get ${runId} --full --json'; do not submit a replacement run.`,
13508
13584
  { cause: error }
13509
13585
  );
13510
13586
  }
13511
- await _optionalChain([hooks, 'optionalAccess', _470 => _470.onRunStarted, 'optionalCall', _471 => _471(runId)]);
13587
+ await _optionalChain([hooks, 'optionalAccess', _479 => _479.onRunStarted, 'optionalCall', _480 => _480(runId)]);
13512
13588
  },
13513
13589
  onRunAdmitted: async (runId) => {
13514
13590
  try {
@@ -13521,7 +13597,7 @@ async function handlePlayRun(args, hooks) {
13521
13597
  { cause: error }
13522
13598
  );
13523
13599
  }
13524
- await _optionalChain([hooks, 'optionalAccess', _472 => _472.onRunAdmitted, 'optionalCall', _473 => _473(runId)]);
13600
+ await _optionalChain([hooks, 'optionalAccess', _481 => _481.onRunAdmitted, 'optionalCall', _482 => _482(runId)]);
13525
13601
  }
13526
13602
  } : hooks;
13527
13603
  if (options.target.kind === "file") {
@@ -13600,10 +13676,10 @@ function renderRunOverviewText(overview, extras = {}) {
13600
13676
  ...buildRunActivityTextLines(run),
13601
13677
  ...buildRunStatusEvidenceTextLines(overview)
13602
13678
  ];
13603
- if (_optionalChain([overview, 'access', _474 => _474.runStatus, 'optionalAccess', _475 => _475.available]) === false)
13679
+ if (_optionalChain([overview, 'access', _483 => _483.runStatus, 'optionalAccess', _484 => _484.available]) === false)
13604
13680
  lines.push(` call progress: unavailable (${overview.runStatus.reason})`);
13605
- const work = readRecord(_optionalChain([readRecord, 'call', _476 => _476(run), 'optionalAccess', _477 => _477.work]));
13606
- if (work && !_optionalChain([overview, 'access', _478 => _478.runStatus, 'optionalAccess', _479 => _479.available]))
13681
+ const work = readRecord(_optionalChain([readRecord, 'call', _485 => _485(run), 'optionalAccess', _486 => _486.work]));
13682
+ if (work && !_optionalChain([overview, 'access', _487 => _487.runStatus, 'optionalAccess', _488 => _488.available]))
13607
13683
  lines.push(
13608
13684
  ` calls (${_nullishCoalesce(work.scope, () => ( "attempt scope unknown"))}): ${formatObservedRunCounter({ value: work.logicalCalls, confirmed: true })} logical, ${formatObservedRunCounter({ value: work.providerRequests, confirmed: true })} provider requests`
13609
13685
  );
@@ -13654,7 +13730,7 @@ function renderRunOverviewText(overview, extras = {}) {
13654
13730
  ...overview.failedLogs.warning ? [`warning: ${overview.failedLogs.warning}`] : [],
13655
13731
  ...overview.failedLogs.logsTruncated ? ["Older log bodies were not retained."] : [],
13656
13732
  ...overview.failedLogs.entries,
13657
- ..._optionalChain([overview, 'access', _480 => _480.failedLogs, 'access', _481 => _481.next, 'optionalAccess', _482 => _482.logs]) ? [`More logs: ${overview.failedLogs.next.logs}`] : []
13733
+ ..._optionalChain([overview, 'access', _489 => _489.failedLogs, 'access', _490 => _490.next, 'optionalAccess', _491 => _491.logs]) ? [`More logs: ${overview.failedLogs.next.logs}`] : []
13658
13734
  ]
13659
13735
  });
13660
13736
  sections.push({
@@ -13714,10 +13790,10 @@ function renderRunOverviewText(overview, extras = {}) {
13714
13790
  );
13715
13791
  return `${lines.join("\n")}
13716
13792
 
13717
- ${_chunkRV6ALZIXjs.renderCommandEnvelopeText.call(void 0, { render: { sections, actions: actions2 } })}`;
13793
+ ${_chunkM7Y7JYZXjs.renderCommandEnvelopeText.call(void 0, { render: { sections, actions: actions2 } })}`;
13718
13794
  }
13719
13795
  async function handleRunGet(args) {
13720
- const selection = _chunkRV6ALZIXjs.parseJsonFields.call(void 0,
13796
+ const selection = _chunkM7Y7JYZXjs.parseJsonFields.call(void 0,
13721
13797
  args,
13722
13798
  args.includes("--config") ? "config" : "get"
13723
13799
  );
@@ -13730,7 +13806,7 @@ async function handleRunGet(args) {
13730
13806
  console.error(error instanceof Error ? error.message : usage2);
13731
13807
  return 1;
13732
13808
  }
13733
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
13809
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
13734
13810
  if (args.includes("--web-url")) {
13735
13811
  const status2 = await client.runs.get(runId, { full: false });
13736
13812
  const playName2 = resolveRunPlayName(status2, runId);
@@ -13739,7 +13815,7 @@ async function handleRunGet(args) {
13739
13815
  return 1;
13740
13816
  }
13741
13817
  const dashboardUrl2 = buildPlayDashboardUrl(client.baseUrl, playName2);
13742
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
13818
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
13743
13819
  { dashboardUrl: dashboardUrl2 },
13744
13820
  { json: args.includes("--json"), text: `${dashboardUrl2}
13745
13821
  ` }
@@ -13759,7 +13835,7 @@ async function handleRunGet(args) {
13759
13835
  "This server does not support recorded configuration reads."
13760
13836
  );
13761
13837
  }
13762
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
13838
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
13763
13839
  { runId, contract: _nullishCoalesce(status2.contract, () => ( null)) },
13764
13840
  { json: true, fields: selection.fields }
13765
13841
  );
@@ -13767,7 +13843,7 @@ async function handleRunGet(args) {
13767
13843
  }
13768
13844
  if (args.includes("--input")) {
13769
13845
  const input = await client.getRunInput(runId);
13770
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, input, { json: true });
13846
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, input, { json: true });
13771
13847
  return 0;
13772
13848
  }
13773
13849
  const full = args.includes("--full");
@@ -13783,8 +13859,8 @@ async function handleRunGet(args) {
13783
13859
  }) : status;
13784
13860
  const legacyPlayName = resolveRunPlayName(legacyStatus, runId);
13785
13861
  const legacyDashboardUrl = legacyPlayName ? buildPlayDashboardUrl(client.baseUrl, legacyPlayName) : null;
13786
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
13787
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
13862
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
13863
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
13788
13864
  {
13789
13865
  ...full ? legacyStatus : compactPlayStatus(legacyStatus),
13790
13866
  ...legacyDashboardUrl ? { dashboardUrl: legacyDashboardUrl } : {}
@@ -13794,7 +13870,7 @@ async function handleRunGet(args) {
13794
13870
  } else {
13795
13871
  writePlayResult(legacyStatus, false, { fullJson: full });
13796
13872
  if (legacyDashboardUrl)
13797
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
13873
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
13798
13874
  { dashboardUrl: legacyDashboardUrl },
13799
13875
  { json: false, text: `play page: ${legacyDashboardUrl}
13800
13876
  ` }
@@ -13809,10 +13885,10 @@ async function handleRunGet(args) {
13809
13885
  readRunCredits(client, runId, !TERMINAL_PLAY_STATUSES.has(status.status))
13810
13886
  ]);
13811
13887
  const hitLines = formatRunHitsLines(hits);
13812
- const json = _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
13888
+ const json = _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
13813
13889
  const playName = resolveRunPlayName(status, runId);
13814
13890
  const dashboardUrl = playName ? buildPlayDashboardUrl(client.baseUrl, playName) : void 0;
13815
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
13891
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
13816
13892
  {
13817
13893
  ...overview,
13818
13894
  ...dashboardUrl ? { dashboardUrl } : {},
@@ -13916,9 +13992,9 @@ async function handleRunLifecycleStatus(args) {
13916
13992
  console.error(error instanceof Error ? error.message : usage2);
13917
13993
  return 1;
13918
13994
  }
13919
- const status = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().runs.status(runId);
13920
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
13921
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, status, { json: true });
13995
+ const status = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.status(runId);
13996
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
13997
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, status, { json: true });
13922
13998
  return 0;
13923
13999
  }
13924
14000
  if (!status.available) {
@@ -13958,7 +14034,7 @@ async function handleRunsRerun(args) {
13958
14034
  console.error(error instanceof Error ? error.message : usage2);
13959
14035
  return 1;
13960
14036
  }
13961
- const options = { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) };
14037
+ const options = { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) };
13962
14038
  for (let index = 0; index < args.length; index += 1) {
13963
14039
  if (args[index] === "--idempotency-key") {
13964
14040
  options.idempotencyKey = _nullishCoalesce(args[++index], () => ( ""));
@@ -14023,8 +14099,8 @@ ${usage2}
14023
14099
  Discover Plays: ${next.discover}
14024
14100
  Active runs: ${next.running}`
14025
14101
  );
14026
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
14027
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14102
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
14103
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14028
14104
  { ok: false, exitCode: 1, code: "RUN_FILTER_REQUIRED", message, next },
14029
14105
  { json: true }
14030
14106
  );
@@ -14039,7 +14115,7 @@ Active runs: ${next.running}`
14039
14115
  console.error("--offset requires --play.");
14040
14116
  return 1;
14041
14117
  }
14042
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14118
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14043
14119
  const page = await client.runs.listPage({
14044
14120
  ...playName ? { play: playName } : {},
14045
14121
  ...statusFilter ? { status: statusFilter } : {},
@@ -14069,7 +14145,7 @@ Active runs: ${next.running}`
14069
14145
  executionTime: run.executionTime,
14070
14146
  billingTotalCredits: run.billingTotalCredits,
14071
14147
  billingMaxCreditsPerRun: run.billingMaxCreditsPerRun,
14072
- playName: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(run.playName, () => ( _optionalChain([run, 'access', _483 => _483.memo, 'optionalAccess', _484 => _484.playName]))), () => ( playName)), () => ( null)),
14148
+ playName: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(run.playName, () => ( _optionalChain([run, 'access', _492 => _492.memo, 'optionalAccess', _493 => _493.playName]))), () => ( playName)), () => ( null)),
14073
14149
  ...nodeId ? { nodeObservation: _nullishCoalesce(run.nodeObservation, () => ( null)) } : {}
14074
14150
  }));
14075
14151
  const lines = runs.length === 0 ? [
@@ -14108,7 +14184,7 @@ Active runs: ${next.running}`
14108
14184
  nextPage ? `Next page: ${nextPage}` : "Narrow with --play <play-name> to page through runs."
14109
14185
  );
14110
14186
  }
14111
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14187
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14112
14188
  {
14113
14189
  runs,
14114
14190
  count: runs.length,
@@ -14118,11 +14194,11 @@ Active runs: ${next.running}`
14118
14194
  ...page.hasMore !== void 0 ? { has_more: page.hasMore, is_truncated: page.hasMore } : {},
14119
14195
  next: {
14120
14196
  page: nextPage,
14121
- get: _optionalChain([runs, 'access', _485 => _485[0], 'optionalAccess', _486 => _486.id]) ? `deepline runs get ${runs[0].id}` : null
14197
+ get: _optionalChain([runs, 'access', _494 => _494[0], 'optionalAccess', _495 => _495.id]) ? `deepline runs get ${runs[0].id}` : null
14122
14198
  },
14123
14199
  render: { sections: [{ title: "runs", lines }] }
14124
14200
  },
14125
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14201
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14126
14202
  );
14127
14203
  return 0;
14128
14204
  }
@@ -14152,7 +14228,7 @@ async function handleRunTail(args) {
14152
14228
  console.error("--log-level requires one of: debug, info, warn, error.");
14153
14229
  return 1;
14154
14230
  }
14155
- const parsed = _chunkCVLM3WMJjs.parseLogLevel.call(void 0, value);
14231
+ const parsed = _chunk2HAD745Vjs.parseLogLevel.call(void 0, value);
14156
14232
  if (!parsed) {
14157
14233
  console.error(
14158
14234
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -14190,9 +14266,9 @@ async function handleRunTail(args) {
14190
14266
  );
14191
14267
  return 1;
14192
14268
  }
14193
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14269
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14194
14270
  const jsonLines = args.includes("--jsonl");
14195
- const jsonOutput = !jsonLines && _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
14271
+ const jsonOutput = !jsonLines && _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
14196
14272
  const compact = args.includes("--compact");
14197
14273
  const showLiveLogs = debug || hasExplicitLogLevel || !jsonOutput && !compact;
14198
14274
  const compactState = {
@@ -14273,7 +14349,7 @@ async function handleRunLogs(args) {
14273
14349
  ]);
14274
14350
  const cursorIndex = args.indexOf("--cursor");
14275
14351
  const cursorValue = cursorIndex >= 0 ? args[cursorIndex + 1] : void 0;
14276
- const continuesEventSearch = cursorIndex >= 0 && !(cursorValue && _chunkCVLM3WMJjs.isRunLogsCursor.call(void 0, cursorValue));
14352
+ const continuesEventSearch = cursorIndex >= 0 && !(cursorValue && _chunk2HAD745Vjs.isRunLogsCursor.call(void 0, cursorValue));
14277
14353
  if (!args[0] || args[0].startsWith("--") || continuesEventSearch || args.some((arg) => searchFlags.has(arg))) {
14278
14354
  return handleRunEventSearch(args);
14279
14355
  }
@@ -14307,7 +14383,7 @@ async function handleRunLogs(args) {
14307
14383
  console.error("--log-level requires one of: debug, info, warn, error.");
14308
14384
  return 1;
14309
14385
  }
14310
- const parsed = _chunkCVLM3WMJjs.parseLogLevel.call(void 0, value);
14386
+ const parsed = _chunk2HAD745Vjs.parseLogLevel.call(void 0, value);
14311
14387
  if (!parsed) {
14312
14388
  console.error(
14313
14389
  `Unsupported --log-level ${JSON.stringify(value)}. Use debug, info, warn, or error.`
@@ -14354,12 +14430,12 @@ async function handleRunLogs(args) {
14354
14430
  );
14355
14431
  return 1;
14356
14432
  }
14357
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14433
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14358
14434
  if (outPath) {
14359
14435
  const result2 = await client.runs.logs(runId, { all: true });
14360
- const logs = result2.entries.filter((line) => _chunkCVLM3WMJjs.logLevelReaches.call(void 0, _chunkCVLM3WMJjs.classifyLogLine.call(void 0, line).level, logLevel)).map((line) => _chunkCVLM3WMJjs.classifyLogLine.call(void 0, line).line);
14436
+ const logs = result2.entries.filter((line) => _chunk2HAD745Vjs.logLevelReaches.call(void 0, _chunk2HAD745Vjs.classifyLogLine.call(void 0, line).level, logLevel)).map((line) => _chunk2HAD745Vjs.classifyLogLine.call(void 0, line).line);
14361
14437
  _fs.writeFileSync.call(void 0, outPath, `${logs.join("\n")}${logs.length > 0 ? "\n" : ""}`);
14362
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14438
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14363
14439
  {
14364
14440
  runId: result2.runId,
14365
14441
  log_path: outPath,
@@ -14382,7 +14458,7 @@ async function handleRunLogs(args) {
14382
14458
  ]
14383
14459
  }
14384
14460
  },
14385
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14461
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14386
14462
  );
14387
14463
  return 0;
14388
14464
  }
@@ -14413,7 +14489,7 @@ async function handleRunLogs(args) {
14413
14489
  }
14414
14490
  };
14415
14491
  const text = buildRunLogsText(filteredResult);
14416
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14492
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14417
14493
  {
14418
14494
  runId: result.runId,
14419
14495
  totalCount: result.totalCount,
@@ -14437,7 +14513,7 @@ async function handleRunLogs(args) {
14437
14513
  render: { sections: [{ title: "run logs", lines: entries }] }
14438
14514
  },
14439
14515
  {
14440
- json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args),
14516
+ json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args),
14441
14517
  text
14442
14518
  }
14443
14519
  );
@@ -14461,17 +14537,17 @@ function selectRunLogTailPage(result, logLevel, limit) {
14461
14537
  );
14462
14538
  }
14463
14539
  const matching = result.entries.map((line, index) => ({ line, seq: first + index })).filter(
14464
- (entry) => _chunkCVLM3WMJjs.logLevelReaches.call(void 0, _chunkCVLM3WMJjs.classifyLogLine.call(void 0, entry.line).level, logLevel)
14540
+ (entry) => _chunk2HAD745Vjs.logLevelReaches.call(void 0, _chunk2HAD745Vjs.classifyLogLine.call(void 0, entry.line).level, logLevel)
14465
14541
  );
14466
14542
  const selected = matching.slice(-limit);
14467
14543
  const olderMatchesExist = matching.length > selected.length;
14468
14544
  return {
14469
14545
  entries: selected.map((entry) => entry.line),
14470
- firstSequence: _nullishCoalesce(_optionalChain([selected, 'access', _487 => _487[0], 'optionalAccess', _488 => _488.seq]), () => ( null)),
14471
- lastSequence: _nullishCoalesce(_optionalChain([selected, 'access', _489 => _489.at, 'call', _490 => _490(-1), 'optionalAccess', _491 => _491.seq]), () => ( null)),
14546
+ firstSequence: _nullishCoalesce(_optionalChain([selected, 'access', _496 => _496[0], 'optionalAccess', _497 => _497.seq]), () => ( null)),
14547
+ lastSequence: _nullishCoalesce(_optionalChain([selected, 'access', _498 => _498.at, 'call', _499 => _499(-1), 'optionalAccess', _500 => _500.seq]), () => ( null)),
14472
14548
  truncated: result.truncated || olderMatchesExist,
14473
14549
  hasMore: olderMatchesExist,
14474
- nextCursor: olderMatchesExist ? _chunkCVLM3WMJjs.encodeRunLogsCursor.call(void 0, selected[0].seq) : null
14550
+ nextCursor: olderMatchesExist ? _chunk2HAD745Vjs.encodeRunLogsCursor.call(void 0, selected[0].seq) : null
14475
14551
  };
14476
14552
  }
14477
14553
  async function handleRunEventSearch(args) {
@@ -14538,7 +14614,7 @@ ${usage2}`);
14538
14614
  namespace,
14539
14615
  ...backend ? { backend } : {}
14540
14616
  } : void 0;
14541
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14617
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14542
14618
  const result = await client.runs.searchEvents({
14543
14619
  ...runId ? { runId } : {},
14544
14620
  ...values["--since"] ? { since: values["--since"] } : {},
@@ -14610,7 +14686,7 @@ ${renderedDetails}` : ""}`;
14610
14686
  "--limit",
14611
14687
  String(limit)
14612
14688
  ].join(" ") : null;
14613
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14689
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14614
14690
  {
14615
14691
  events,
14616
14692
  nextCursor: result.nextCursor,
@@ -14621,19 +14697,19 @@ ${renderedDetails}` : ""}`;
14621
14697
  render: { sections: [{ title: "runtime events", lines }] }
14622
14698
  },
14623
14699
  {
14624
- json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args),
14700
+ json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args),
14625
14701
  text: `${lines.join("\n")}${lines.length ? "\n" : ""}`
14626
14702
  }
14627
14703
  );
14628
14704
  return 0;
14629
14705
  }
14630
14706
  function buildRunLogsText(result) {
14631
- const lines = result.entries.map((line) => _chunkCVLM3WMJjs.classifyLogLine.call(void 0, line).line);
14707
+ const lines = result.entries.map((line) => _chunk2HAD745Vjs.classifyLogLine.call(void 0, line).line);
14632
14708
  if (result.warning) {
14633
14709
  if (lines.length > 0) lines.push("");
14634
14710
  lines.push(`warning: ${result.warning}`);
14635
14711
  lines.push(
14636
- `retained logs: ${_nullishCoalesce(_optionalChain([result, 'access', _492 => _492.next, 'optionalAccess', _493 => _493.logs]), () => ( `deepline runs logs ${result.runId} --out run.log`))}`
14712
+ `retained logs: ${_nullishCoalesce(_optionalChain([result, 'access', _501 => _501.next, 'optionalAccess', _502 => _502.logs]), () => ( `deepline runs logs ${result.runId} --out run.log`))}`
14637
14713
  );
14638
14714
  }
14639
14715
  return `${lines.join("\n")}${lines.length > 0 ? "\n" : ""}`;
@@ -14662,7 +14738,7 @@ async function handleRunStop(args) {
14662
14738
  reason = args[++index];
14663
14739
  }
14664
14740
  }
14665
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14741
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14666
14742
  const result = await client.runs.stop(runId, { reason });
14667
14743
  const state = resolveRunStopState(result);
14668
14744
  const hitlCleanupIncomplete = state === "cancelling" && result.hitlCancellationPending === true;
@@ -14677,7 +14753,7 @@ async function handleRunStop(args) {
14677
14753
  ...result.hitlCancelledCount > 0 ? [`cancelled HITL waits: ${result.hitlCancelledCount}`] : [],
14678
14754
  `inspect: deepline runs get ${runId} --full`
14679
14755
  ];
14680
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14756
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14681
14757
  {
14682
14758
  ...cancelling,
14683
14759
  state,
@@ -14692,7 +14768,7 @@ async function handleRunStop(args) {
14692
14768
  ]
14693
14769
  }
14694
14770
  },
14695
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14771
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14696
14772
  );
14697
14773
  return 0;
14698
14774
  }
@@ -14709,7 +14785,7 @@ async function handleRunStop(args) {
14709
14785
  ];
14710
14786
  process.stderr.write(`${lines2.join("\n")}
14711
14787
  `);
14712
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14788
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14713
14789
  {
14714
14790
  ...result,
14715
14791
  render: {
@@ -14724,7 +14800,7 @@ async function handleRunStop(args) {
14724
14800
  ]
14725
14801
  }
14726
14802
  },
14727
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14803
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14728
14804
  );
14729
14805
  return 1;
14730
14806
  }
@@ -14735,12 +14811,12 @@ async function handleRunStop(args) {
14735
14811
  `warning: HITL cancellation or Slack card refresh is still pending; retry 'deepline runs stop ${runId}'`
14736
14812
  ] : []
14737
14813
  ];
14738
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14814
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14739
14815
  {
14740
14816
  ...result,
14741
14817
  render: { sections: [{ title: "run stop", lines }] }
14742
14818
  },
14743
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14819
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14744
14820
  );
14745
14821
  return 0;
14746
14822
  }
@@ -14790,18 +14866,18 @@ async function handleRunStopAll(args) {
14790
14866
  reason = args[++index];
14791
14867
  }
14792
14868
  }
14793
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14869
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14794
14870
  if (dryRun) {
14795
14871
  const result2 = await client.runs.stopAll({ dryRun: true, reason });
14796
14872
  const lines2 = buildStopAllDryRunTextLines(result2);
14797
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14873
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14798
14874
  {
14799
14875
  ...result2,
14800
14876
  render: {
14801
14877
  sections: [{ title: "workspace stop-all (dry run)", lines: lines2 }]
14802
14878
  }
14803
14879
  },
14804
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args), text: `${lines2.join("\n")}
14880
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args), text: `${lines2.join("\n")}
14805
14881
  ` }
14806
14882
  );
14807
14883
  return 0;
@@ -14814,17 +14890,17 @@ async function handleRunStopAll(args) {
14814
14890
  ...result.failed > 0 ? [`failed stops: ${result.failed}`] : [],
14815
14891
  ...result.skipped > 0 ? [`skipped: ${result.skipped}`] : []
14816
14892
  ];
14817
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
14893
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
14818
14894
  {
14819
14895
  ...result,
14820
14896
  render: { sections: [{ title: "workspace stop-all", lines }] }
14821
14897
  },
14822
- { json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args) }
14898
+ { json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args) }
14823
14899
  );
14824
14900
  return result.failed > 0 || result.partial ? 1 : 0;
14825
14901
  }
14826
14902
  async function handleRunExport(args) {
14827
- const selection = _chunkRV6ALZIXjs.parseJsonFields.call(void 0, args, "export");
14903
+ const selection = _chunkM7Y7JYZXjs.parseJsonFields.call(void 0, args, "export");
14828
14904
  args = selection.args;
14829
14905
  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]";
14830
14906
  let runId;
@@ -14883,16 +14959,16 @@ async function handleRunExport(args) {
14883
14959
  "INVALID_ARGUMENT"
14884
14960
  );
14885
14961
  }
14886
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
14962
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
14887
14963
  let status = await client.getPlayStatus(runId, { full: true });
14888
14964
  if (wait && !TERMINAL_PLAY_STATUSES.has(status.status)) {
14889
- const progress = _chunkWJYPBHTEjs.createCliProgress.call(void 0, !_chunkRV6ALZIXjs.argsWantJson.call(void 0, args));
14965
+ const progress = _chunkWJYPBHTEjs.createCliProgress.call(void 0, !_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args));
14890
14966
  try {
14891
14967
  await waitForPlayCompletionByWatch({
14892
14968
  client,
14893
14969
  playName: _nullishCoalesce(extractRunPlayName(status), () => ( runId)),
14894
14970
  workflowId: runId,
14895
- jsonOutput: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args),
14971
+ jsonOutput: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args),
14896
14972
  emitLogs: false,
14897
14973
  waitTimeoutMs,
14898
14974
  startedAt: Date.now(),
@@ -14916,26 +14992,26 @@ async function handleRunExport(args) {
14916
14992
  allowEmpty: args.includes("--allow-empty"),
14917
14993
  format
14918
14994
  });
14919
- const source = _nullishCoalesce(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _494 => _494.rowsInfo, 'access', _495 => _495.source]), () => ( datasetPath)), () => ( null));
14920
- const currentTableNotice = _optionalChain([exportResult, 'optionalAccess', _496 => _496.currentTable]) ? {
14995
+ const source = _nullishCoalesce(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _503 => _503.rowsInfo, 'access', _504 => _504.source]), () => ( datasetPath)), () => ( null));
14996
+ const currentTableNotice = _optionalChain([exportResult, 'optionalAccess', _505 => _505.currentTable]) ? {
14921
14997
  code: "CURRENT_SHARED_DATASET",
14922
14998
  message: "This export is the current shared dataset and may include writes from another run.",
14923
14999
  full_run_output_command: `deepline runs get ${status.runId} --full`
14924
15000
  } : null;
14925
15001
  const navigation = buildRunNavigation(status);
14926
- const resolved = _optionalChain([exportResult, 'optionalAccess', _497 => _497.datasetInfo]);
15002
+ const resolved = _optionalChain([exportResult, 'optionalAccess', _506 => _506.datasetInfo]);
14927
15003
  const identity = navigation.datasets.find(
14928
- (dataset) => _optionalChain([resolved, 'optionalAccess', _498 => _498.datasetId]) ? dataset.datasetId === resolved.datasetId : dataset.name === _optionalChain([resolved, 'optionalAccess', _499 => _499.tableNamespace])
15004
+ (dataset) => _optionalChain([resolved, 'optionalAccess', _507 => _507.datasetId]) ? dataset.datasetId === resolved.datasetId : dataset.name === _optionalChain([resolved, 'optionalAccess', _508 => _508.tableNamespace])
14929
15005
  );
14930
15006
  const unambiguousName = identity && !identity.exportUnavailable && navigation.datasets.filter((dataset) => dataset.name === identity.name).length === 1 ? identity.name : void 0;
14931
15007
  const exportCommand = runExportRetryCommand(
14932
15008
  status.runId,
14933
15009
  outPath,
14934
- _nullishCoalesce(_nullishCoalesce(unambiguousName, () => ( datasetPath)), () => ( _optionalChain([exportResult, 'optionalAccess', _500 => _500.datasetPath]))),
15010
+ _nullishCoalesce(_nullishCoalesce(unambiguousName, () => ( datasetPath)), () => ( _optionalChain([exportResult, 'optionalAccess', _509 => _509.datasetPath]))),
14935
15011
  { format }
14936
15012
  ) + (args.includes("--allow-empty") ? " --allow-empty" : "");
14937
- const fileLocation = format === "json" ? { json_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _501 => _501.path]), () => ( null)) } : { csv_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _502 => _502.path]), () => ( null)) };
14938
- const exportedRowOutcomes = _optionalChain([exportResult, 'optionalAccess', _503 => _503.rowsInfo, 'access', _504 => _504.exportedRowOutcomes]);
15013
+ const fileLocation = format === "json" ? { json_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _510 => _510.path]), () => ( null)) } : { csv_path: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _511 => _511.path]), () => ( null)) };
15014
+ const exportedRowOutcomes = _optionalChain([exportResult, 'optionalAccess', _512 => _512.rowsInfo, 'access', _513 => _513.exportedRowOutcomes]);
14939
15015
  const rowFailures = exportedRowOutcomes && exportedRowOutcomes.failed > 0 ? {
14940
15016
  count: exportedRowOutcomes.failed,
14941
15017
  message: "Failed rows can retain values from stages that completed earlier; those values do not prove the row succeeded.",
@@ -14955,17 +15031,17 @@ async function handleRunExport(args) {
14955
15031
  ...fileLocation,
14956
15032
  format,
14957
15033
  source,
14958
- rowCount: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _505 => _505.rowsInfo, 'access', _506 => _506.totalRows]), () => ( null)),
15034
+ rowCount: _nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _514 => _514.rowsInfo, 'access', _515 => _515.totalRows]), () => ( null)),
14959
15035
  ...exportedRowOutcomes ? { rowOutcomes: exportedRowOutcomes } : {},
14960
15036
  ...rowFailures ? { rowFailures } : {},
14961
- columns: underscoreKeysLast(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _507 => _507.rowsInfo, 'access', _508 => _508.columns]), () => ( []))),
15037
+ columns: underscoreKeysLast(_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _516 => _516.rowsInfo, 'access', _517 => _517.columns]), () => ( []))),
14962
15038
  ...currentTableNotice ? { notice: currentTableNotice } : {},
14963
15039
  ...metadataOutPath ? { metadata_path: metadataOutPath } : {},
14964
15040
  ...!TERMINAL_PLAY_STATUSES.has(status.status) ? { completionCommand: `${exportCommand} --wait` } : {}
14965
15041
  };
14966
15042
  const lines = withRunNavigationLines(
14967
15043
  [
14968
- `Exported ${status.runId} to ${_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _509 => _509.path]), () => ( outPath))}`,
15044
+ `Exported ${status.runId} to ${_nullishCoalesce(_optionalChain([exportResult, 'optionalAccess', _518 => _518.path]), () => ( outPath))}`,
14969
15045
  ...!TERMINAL_PLAY_STATUSES.has(status.status) ? [
14970
15046
  `Partial export: run is ${status.status}; more rows may be saved.`,
14971
15047
  `Export after completion: ${exportCommand} --wait`
@@ -14992,8 +15068,8 @@ async function handleRunExport(args) {
14992
15068
  "utf-8"
14993
15069
  );
14994
15070
  }
14995
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0, payload, {
14996
- json: _chunkRV6ALZIXjs.argsWantJson.call(void 0, args),
15071
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, payload, {
15072
+ json: _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args),
14997
15073
  fields: selection.fields,
14998
15074
  text: `${lines.join("\n")}
14999
15075
  `
@@ -15014,10 +15090,10 @@ async function handlePlayGet(args) {
15014
15090
  );
15015
15091
  return 2;
15016
15092
  }
15017
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15093
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15018
15094
  const explicitJson = args.includes("--json");
15019
15095
  const sourceOutput = args.includes("--source");
15020
- const jsonOutput = sourceOutput ? explicitJson : _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
15096
+ const jsonOutput = sourceOutput ? explicitJson : _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
15021
15097
  const requestedRevisionFlags = [
15022
15098
  args.includes("--working"),
15023
15099
  args.includes("--live"),
@@ -15067,7 +15143,7 @@ async function handlePlayGet(args) {
15067
15143
  ...includeSource ? { source: sourceSelector } : {}
15068
15144
  });
15069
15145
  const source = detail.source;
15070
- const resolvedSource = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _510 => _510.files, 'access', _511 => _511[source.entryFile]]), () => ( ""));
15146
+ const resolvedSource = _nullishCoalesce(_optionalChain([source, 'optionalAccess', _519 => _519.files, 'access', _520 => _520[source.entryFile]]), () => ( ""));
15071
15147
  let materializedFile = null;
15072
15148
  try {
15073
15149
  materializedFile = outPath && source ? materializeRemotePlaySource({ target, playName, source, outPath }) : null;
@@ -15077,7 +15153,7 @@ async function handlePlayGet(args) {
15077
15153
  }
15078
15154
  const loadedMessage = materializedFile ? formatLoadedPlayMessage(materializedFile) : null;
15079
15155
  if (jsonOutput) {
15080
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, {
15156
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
15081
15157
  ...detail,
15082
15158
  ...materializedFile ? {
15083
15159
  message: loadedMessage,
@@ -15118,16 +15194,16 @@ async function handlePlayGet(args) {
15118
15194
  }
15119
15195
  console.log(`Play: ${formatPlayReference(detail.play)}`);
15120
15196
  console.log(
15121
- `Working version: ${_nullishCoalesce(_optionalChain([detail, 'access', _512 => _512.play, 'access', _513 => _513.workingRevision, 'optionalAccess', _514 => _514.version]), () => ( "\u2014"))}`
15197
+ `Working version: ${_nullishCoalesce(_optionalChain([detail, 'access', _521 => _521.play, 'access', _522 => _522.workingRevision, 'optionalAccess', _523 => _523.version]), () => ( "\u2014"))}`
15122
15198
  );
15123
- console.log(`Live version: ${_nullishCoalesce(_optionalChain([detail, 'access', _515 => _515.play, 'access', _516 => _516.liveRevision, 'optionalAccess', _517 => _517.version]), () => ( "\u2014"))}`);
15199
+ console.log(`Live version: ${_nullishCoalesce(_optionalChain([detail, 'access', _524 => _524.play, 'access', _525 => _525.liveRevision, 'optionalAccess', _526 => _526.version]), () => ( "\u2014"))}`);
15124
15200
  if (detail.play.liveRevision) {
15125
15201
  console.log(
15126
15202
  `Live max credits per run: ${liveMaxCreditsPerRun(detail.play.liveRevision.sourceCode)}`
15127
15203
  );
15128
15204
  }
15129
15205
  console.log(`Draft dirty: ${detail.play.isDraftDirty ? "yes" : "no"}`);
15130
- if (detail.play.isDraftDirty && _optionalChain([detail, 'access', _518 => _518.play, 'access', _519 => _519.liveRevision, 'optionalAccess', _520 => _520.version])) {
15206
+ if (detail.play.isDraftDirty && _optionalChain([detail, 'access', _527 => _527.play, 'access', _528 => _528.liveRevision, 'optionalAccess', _529 => _529.version])) {
15131
15207
  console.log(
15132
15208
  ` Scheduled and named runs continue to use live v${detail.play.liveRevision.version}.`
15133
15209
  );
@@ -15139,7 +15215,7 @@ async function handlePlayGet(args) {
15139
15215
  console.log(line);
15140
15216
  }
15141
15217
  console.log(`Updated: ${formatTimestamp(detail.play.updatedAt)}`);
15142
- console.log(`Sheet rows: ${_nullishCoalesce(_optionalChain([detail, 'access', _521 => _521.sheetSummary, 'optionalAccess', _522 => _522.stats, 'optionalAccess', _523 => _523.total]), () => ( 0))}`);
15218
+ console.log(`Sheet rows: ${_nullishCoalesce(_optionalChain([detail, 'access', _530 => _530.sheetSummary, 'optionalAccess', _531 => _531.stats, 'optionalAccess', _532 => _532.total]), () => ( 0))}`);
15143
15219
  if (detail.customerDbUrl) {
15144
15220
  console.log(`Customer DB: ${detail.customerDbUrl}`);
15145
15221
  }
@@ -15155,7 +15231,7 @@ async function handlePlayGet(args) {
15155
15231
  return 0;
15156
15232
  }
15157
15233
  function formatVersionLine(version) {
15158
- const revisionLabel = _nullishCoalesce(_optionalChain([version, 'access', _524 => _524.artifactHash, 'optionalAccess', _525 => _525.slice, 'call', _526 => _526(0, 12)]), () => ( "unknown-revision"));
15234
+ const revisionLabel = _nullishCoalesce(_optionalChain([version, 'access', _533 => _533.artifactHash, 'optionalAccess', _534 => _534.slice, 'call', _535 => _535(0, 12)]), () => ( "unknown-revision"));
15159
15235
  const state = [
15160
15236
  version.isLive ? "live" : null,
15161
15237
  version.isWorking ? "working" : null
@@ -15169,8 +15245,8 @@ async function handlePlayVersions(args) {
15169
15245
  console.error("Usage: deepline plays versions --name <name> [--json]");
15170
15246
  return 1;
15171
15247
  }
15172
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15173
- const jsonOutput = _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
15248
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15249
+ const jsonOutput = _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
15174
15250
  await assertCanonicalNamedPlayReference(client, playName, {
15175
15251
  command: "versions"
15176
15252
  });
@@ -15178,7 +15254,7 @@ async function handlePlayVersions(args) {
15178
15254
  parseReferencedPlayTarget2(playName).playName
15179
15255
  );
15180
15256
  if (jsonOutput) {
15181
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, { versions });
15257
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, { versions });
15182
15258
  return 0;
15183
15259
  }
15184
15260
  if (versions.length === 0) {
@@ -15210,11 +15286,11 @@ var PREBUILT_PLAY_TAG_KEYS = [
15210
15286
  "signals"
15211
15287
  ];
15212
15288
  async function handlePlayList(args) {
15213
- const jsonOutput = _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
15289
+ const jsonOutput = _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
15214
15290
  const showCost = args.includes("--show-cost");
15215
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15291
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15216
15292
  const categoriesIndex = args.indexOf("--categories");
15217
- const categories = categoriesIndex >= 0 ? _optionalChain([args, 'access', _527 => _527[categoriesIndex + 1], 'optionalAccess', _528 => _528.trim, 'call', _529 => _529()]) : void 0;
15293
+ const categories = categoriesIndex >= 0 ? _optionalChain([args, 'access', _536 => _536[categoriesIndex + 1], 'optionalAccess', _537 => _537.trim, 'call', _538 => _538()]) : void 0;
15218
15294
  const tags = args.flatMap((arg, index) => arg === "--tag" ? [args[index + 1]] : []).flatMap((value) => (_nullishCoalesce(value, () => ( ""))).split(",")).map((value) => value.trim()).filter(Boolean);
15219
15295
  if (args.includes("--tag") && tags.length === 0) {
15220
15296
  console.error(
@@ -15235,7 +15311,7 @@ async function handlePlayList(args) {
15235
15311
  const cursorIndex = args.indexOf("--cursor");
15236
15312
  const limit = limitIndex >= 0 ? Number(args[limitIndex + 1]) : void 0;
15237
15313
  const cursor = cursorIndex >= 0 ? args[cursorIndex + 1] : void 0;
15238
- if (limitIndex >= 0 && (!Number.isSafeInteger(limit) || limit < 1) || cursorIndex >= 0 && !_optionalChain([cursor, 'optionalAccess', _530 => _530.trim, 'call', _531 => _531()])) {
15314
+ if (limitIndex >= 0 && (!Number.isSafeInteger(limit) || limit < 1) || cursorIndex >= 0 && !_optionalChain([cursor, 'optionalAccess', _539 => _539.trim, 'call', _540 => _540()])) {
15239
15315
  console.error("Pass a positive --limit and a non-empty --cursor.");
15240
15316
  return 2;
15241
15317
  }
@@ -15275,7 +15351,7 @@ async function handlePlayList(args) {
15275
15351
  if (play.inputSchema || play.hasInputSchema) {
15276
15352
  lines.push(" inputSchema: yes");
15277
15353
  }
15278
- if (_optionalChain([play, 'access', _532 => _532.triggerStatus, 'optionalAccess', _533 => _533.cron])) {
15354
+ if (_optionalChain([play, 'access', _541 => _541.triggerStatus, 'optionalAccess', _542 => _542.cron])) {
15279
15355
  lines.push(
15280
15356
  ` scheduled execution: ${cronExecutionLabel(play.triggerStatus.cron)}`
15281
15357
  );
@@ -15295,7 +15371,7 @@ async function handlePlayList(args) {
15295
15371
  } else {
15296
15372
  lines.push(" scheduled execution: not configured");
15297
15373
  }
15298
- if (_optionalChain([play, 'access', _534 => _534.triggerStatus, 'optionalAccess', _535 => _535.webhook])) {
15374
+ if (_optionalChain([play, 'access', _543 => _543.triggerStatus, 'optionalAccess', _544 => _544.webhook])) {
15299
15375
  lines.push(` webhook: ${play.triggerStatus.webhook}`);
15300
15376
  }
15301
15377
  if (showCost) {
@@ -15309,7 +15385,7 @@ async function handlePlayList(args) {
15309
15385
  lines.push("List truncated \u2014 more plays are available.");
15310
15386
  lines.push(`Next page: ${nextPage}`);
15311
15387
  }
15312
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
15388
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
15313
15389
  {
15314
15390
  plays,
15315
15391
  count: plays.length,
@@ -15326,8 +15402,8 @@ async function handlePlayList(args) {
15326
15402
  return 0;
15327
15403
  }
15328
15404
  async function handlePlayPin(args, pinned) {
15329
- const target = _optionalChain([args, 'access', _536 => _536.find, 'call', _537 => _537((arg) => !arg.startsWith("-")), 'optionalAccess', _538 => _538.trim, 'call', _539 => _539()]);
15330
- const jsonOutput = _chunkRV6ALZIXjs.argsWantJson.call(void 0, args);
15405
+ const target = _optionalChain([args, 'access', _545 => _545.find, 'call', _546 => _546((arg) => !arg.startsWith("-")), 'optionalAccess', _547 => _547.trim, 'call', _548 => _548()]);
15406
+ const jsonOutput = _chunkM7Y7JYZXjs.argsWantJson.call(void 0, args);
15331
15407
  const dryRun = args.includes("--dry-run");
15332
15408
  if (!target) {
15333
15409
  console.error(
@@ -15345,11 +15421,11 @@ async function handlePlayPin(args, pinned) {
15345
15421
  const name = parsedTarget.playName;
15346
15422
  const plan = { name, pinned, dryRun };
15347
15423
  if (dryRun) {
15348
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, plan);
15424
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, plan);
15349
15425
  return 0;
15350
15426
  }
15351
- const result = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().setPlayPinned(name, pinned);
15352
- if (jsonOutput) _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
15427
+ const result = await new (0, _chunk2HAD745Vjs.DeeplineClient)().setPlayPinned(name, pinned);
15428
+ if (jsonOutput) _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
15353
15429
  else console.log(`${result.pinned ? "Pinned" : "Unpinned"} ${result.name}.`);
15354
15430
  return 0;
15355
15431
  }
@@ -15365,7 +15441,7 @@ function csvColumnLines(csvInput) {
15365
15441
  const headers = [defaults[column]].flat().filter((header) => header && header !== column);
15366
15442
  return `${column}${required.has(column) ? " (required)" : ""}${headers.length > 0 ? `, default header: ${headers.join(" or ")}` : ""}`;
15367
15443
  }),
15368
- _chunkCVLM3WMJjs.CSV_HEADER_MATCHING_NOTE
15444
+ _chunk2HAD745Vjs.CSV_HEADER_MATCHING_NOTE
15369
15445
  ];
15370
15446
  }
15371
15447
  function describedPlay(play) {
@@ -15421,7 +15497,7 @@ function describedPlay(play) {
15421
15497
  ...starter ? { source: starter.command } : {},
15422
15498
  ...exclusive ? { exclusive } : {},
15423
15499
  // A prebuilt's cost is what its recent runs were charged; there is no rate.
15424
- ..._optionalChain([play, 'access', _540 => _540.observedCost, 'optionalAccess', _541 => _541.displayText]) ? { cost: play.observedCost.displayText } : {}
15500
+ ..._optionalChain([play, 'access', _549 => _549.observedCost, 'optionalAccess', _550 => _550.displayText]) ? { cost: play.observedCost.displayText } : {}
15425
15501
  };
15426
15502
  }
15427
15503
  function printPlayDescription(play) {
@@ -15453,7 +15529,7 @@ function printPlayDescription(play) {
15453
15529
  console.log(` ${line}`);
15454
15530
  }
15455
15531
  }
15456
- if (_optionalChain([play, 'access', _542 => _542.toolCategories, 'optionalAccess', _543 => _543.length])) {
15532
+ if (_optionalChain([play, 'access', _551 => _551.toolCategories, 'optionalAccess', _552 => _552.length])) {
15457
15533
  console.log(` Tool categories: ${play.toolCategories.join(", ")}`);
15458
15534
  }
15459
15535
  if (play.aliases.length > 0) {
@@ -15498,7 +15574,7 @@ function printPlayDescription(play) {
15498
15574
  const runtimeLimit = formatPlayRuntimeLimit(play.runtimeLimit);
15499
15575
  if (runtimeLimit) {
15500
15576
  console.log(
15501
- ` Runtime limit: ${runtimeLimit} (${_nullishCoalesce(_optionalChain([play, 'access', _544 => _544.runtimeLimit, 'optionalAccess', _545 => _545.source]), () => ( "live"))})`
15577
+ ` Runtime limit: ${runtimeLimit} (${_nullishCoalesce(_optionalChain([play, 'access', _553 => _553.runtimeLimit, 'optionalAccess', _554 => _554.source]), () => ( "live"))})`
15502
15578
  );
15503
15579
  }
15504
15580
  printScheduledPlayCapacity(play.activeScheduledPlays);
@@ -15526,17 +15602,17 @@ function formatPlayGrepMatches(matches) {
15526
15602
  return matches.map((match) => `${match.field}: ${match.terms.join(", ")}`).join("; ");
15527
15603
  }
15528
15604
  async function handlePlayGrep(args) {
15529
- const query = _optionalChain([args, 'access', _546 => _546[0], 'optionalAccess', _547 => _547.trim, 'call', _548 => _548()]);
15605
+ const query = _optionalChain([args, 'access', _555 => _555[0], 'optionalAccess', _556 => _556.trim, 'call', _557 => _557()]);
15530
15606
  if (!query) {
15531
15607
  console.error("Usage: deepline plays grep <query> [--json]");
15532
15608
  return 1;
15533
15609
  }
15534
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15610
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15535
15611
  const results = (await client.listPlays({ grep: query })).map(
15536
15612
  summarizePlayGrepResult
15537
15613
  );
15538
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
15539
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, {
15614
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
15615
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
15540
15616
  plays: results,
15541
15617
  count: results.length,
15542
15618
  query,
@@ -15550,7 +15626,7 @@ async function handlePlayGrep(args) {
15550
15626
  `
15551
15627
  );
15552
15628
  for (const result of results) {
15553
- console.log(_optionalChain([result, 'access', _549 => _549.displayName, 'optionalAccess', _550 => _550.trim, 'call', _551 => _551()]) || result.name);
15629
+ console.log(_optionalChain([result, 'access', _558 => _558.displayName, 'optionalAccess', _559 => _559.trim, 'call', _560 => _560()]) || result.name);
15554
15630
  const matches = formatPlayGrepMatches(result.matches);
15555
15631
  if (matches) console.log(` Matched: ${matches}`);
15556
15632
  console.log(` Describe: ${result.describe}`);
@@ -15559,7 +15635,7 @@ async function handlePlayGrep(args) {
15559
15635
  return 0;
15560
15636
  }
15561
15637
  async function handlePlayDescribe(args) {
15562
- const selection = _chunkRV6ALZIXjs.parseJsonFields.call(void 0, args, "describe");
15638
+ const selection = _chunkM7Y7JYZXjs.parseJsonFields.call(void 0, args, "describe");
15563
15639
  args = selection.args;
15564
15640
  const playName = args[0];
15565
15641
  if (!playName) {
@@ -15593,8 +15669,8 @@ async function handlePlayDescribe(args) {
15593
15669
  `deepline plays check ${playName}`,
15594
15670
  ...definedName ? [`deepline describe <workspace>/${definedName}`] : []
15595
15671
  ];
15596
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
15597
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, {
15672
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
15673
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
15598
15674
  ok: false,
15599
15675
  error: { message },
15600
15676
  next
@@ -15608,7 +15684,7 @@ async function handlePlayDescribe(args) {
15608
15684
  }
15609
15685
  return 2;
15610
15686
  }
15611
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15687
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15612
15688
  await assertCanonicalNamedPlayReference(client, playName, {
15613
15689
  command: "describe"
15614
15690
  });
@@ -15618,9 +15694,9 @@ async function handlePlayDescribe(args) {
15618
15694
  compact: args.includes("--compact")
15619
15695
  }
15620
15696
  );
15621
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
15622
- if (selection.fields) _chunkRV6ALZIXjs.printJson.call(void 0, play, selection.fields);
15623
- else _chunkRV6ALZIXjs.printCompactJson.call(void 0, play);
15697
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
15698
+ if (selection.fields) _chunkM7Y7JYZXjs.printJson.call(void 0, play, selection.fields);
15699
+ else _chunkM7Y7JYZXjs.printCompactJson.call(void 0, play);
15624
15700
  return 0;
15625
15701
  }
15626
15702
  printPlayDescription(play);
@@ -15664,7 +15740,7 @@ async function handlePlaySave(args) {
15664
15740
  next: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, options.target)}`
15665
15741
  };
15666
15742
  if (options.jsonOutput) {
15667
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
15743
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
15668
15744
  } else {
15669
15745
  console.error(result.message);
15670
15746
  console.error(` checked artifact: ${result.expectedArtifactHash}`);
@@ -15686,7 +15762,7 @@ async function handlePlaySave(args) {
15686
15762
  };
15687
15763
  if (options.dryRun) {
15688
15764
  if (options.jsonOutput) {
15689
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, dryRun);
15765
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, dryRun);
15690
15766
  } else {
15691
15767
  console.log(`Dry run: ${playName}`);
15692
15768
  console.log(` source: ${dryRun.sourceHash}`);
@@ -15695,7 +15771,7 @@ async function handlePlaySave(args) {
15695
15771
  }
15696
15772
  return 0;
15697
15773
  }
15698
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15774
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15699
15775
  try {
15700
15776
  await _chunkAYHLUHE5js.traceCliSpan.call(void 0,
15701
15777
  "cli.play_save_compile_manifests",
@@ -15731,7 +15807,7 @@ async function handlePlaySave(args) {
15731
15807
  }
15732
15808
  };
15733
15809
  if (options.jsonOutput) {
15734
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
15810
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
15735
15811
  } else {
15736
15812
  console.log(
15737
15813
  `\u2713 Saved ${playName} working draft as v${_nullishCoalesce(result.version, () => ( "?"))}`
@@ -15757,7 +15833,7 @@ async function handlePlayPublish(args) {
15757
15833
  }
15758
15834
  const { target: playName, useLatest } = options;
15759
15835
  let revisionId = options.revisionId;
15760
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
15836
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15761
15837
  if (isFileTarget2(playName)) {
15762
15838
  if (revisionId || useLatest) {
15763
15839
  console.error(
@@ -15789,7 +15865,7 @@ async function handlePlayPublish(args) {
15789
15865
  next: `deepline plays check ${_chunkAID3OYVJjs.shellQuote.call(void 0, playName)}`
15790
15866
  };
15791
15867
  if (options.jsonOutput) {
15792
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result3);
15868
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result3);
15793
15869
  } else {
15794
15870
  console.error(result3.message);
15795
15871
  console.error(` checked artifact: ${result3.expectedArtifactHash}`);
@@ -15812,7 +15888,7 @@ async function handlePlayPublish(args) {
15812
15888
  };
15813
15889
  if (options.dryRun) {
15814
15890
  if (options.jsonOutput) {
15815
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, dryRun);
15891
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, dryRun);
15816
15892
  } else {
15817
15893
  console.log(`Dry run: ${rootPlayName}`);
15818
15894
  console.log(` source: ${dryRun.sourceHash}`);
@@ -15870,17 +15946,17 @@ async function handlePlayPublish(args) {
15870
15946
  artifactHash,
15871
15947
  liveVersion: _nullishCoalesce(published.version, () => ( null)),
15872
15948
  revisionId: _nullishCoalesce(published.revisionId, () => ( null)),
15873
- previousLiveVersion: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _552 => _552.version]), () => ( null)),
15874
- previousArtifactHash: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _553 => _553.artifactHash]), () => ( null)),
15949
+ previousLiveVersion: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _561 => _561.version]), () => ( null)),
15950
+ previousArtifactHash: _nullishCoalesce(_optionalChain([previousLive, 'optionalAccess', _562 => _562.artifactHash]), () => ( null)),
15875
15951
  sourceBytes: {
15876
- before: _optionalChain([previousLive, 'optionalAccess', _554 => _554.sourceCode]) ? Buffer.byteLength(previousLive.sourceCode, "utf8") : null,
15952
+ before: _optionalChain([previousLive, 'optionalAccess', _563 => _563.sourceCode]) ? Buffer.byteLength(previousLive.sourceCode, "utf8") : null,
15877
15953
  after: Buffer.byteLength(graph.root.sourceCode, "utf8")
15878
15954
  },
15879
15955
  triggerMetadata: _nullishCoalesce(published.triggerMetadata, () => ( null)),
15880
15956
  triggerBindings: _nullishCoalesce(published.triggerBindings, () => ( []))
15881
15957
  };
15882
15958
  if (options.jsonOutput) {
15883
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result2);
15959
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result2);
15884
15960
  } else {
15885
15961
  printPublishReceipt({
15886
15962
  name: rootPlayName,
@@ -15911,14 +15987,14 @@ async function handlePlayPublish(args) {
15911
15987
  revisionId: _nullishCoalesce(revisionId, () => ( null)),
15912
15988
  latest: useLatest
15913
15989
  };
15914
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result2);
15990
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result2);
15915
15991
  return 0;
15916
15992
  }
15917
15993
  const resolvedName = parseReferencedPlayTarget2(playName).playName;
15918
15994
  if (useLatest) {
15919
15995
  const versions = await client.listPlayVersions(resolvedName);
15920
15996
  const latest = versions[0];
15921
- if (!_optionalChain([latest, 'optionalAccess', _555 => _555._id])) {
15997
+ if (!_optionalChain([latest, 'optionalAccess', _564 => _564._id])) {
15922
15998
  console.error(`No saved revisions found for ${resolvedName}.`);
15923
15999
  return 1;
15924
16000
  }
@@ -15935,7 +16011,7 @@ async function handlePlayPublish(args) {
15935
16011
  revisionId ? { revisionId } : {}
15936
16012
  );
15937
16013
  if (options.jsonOutput) {
15938
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
16014
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
15939
16015
  } else {
15940
16016
  printPublishReceipt({
15941
16017
  name: result.name,
@@ -15975,7 +16051,7 @@ async function handlePlayDelete(args) {
15975
16051
  );
15976
16052
  return 2;
15977
16053
  }
15978
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
16054
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
15979
16055
  let detail;
15980
16056
  try {
15981
16057
  detail = await client.getPlay(parseReferencedPlayTarget2(playName).playName);
@@ -15999,8 +16075,8 @@ async function handlePlayDelete(args) {
15999
16075
  name: resolvedName,
16000
16076
  plannedMutation: "move saved org-owned play to Trash and stop triggers"
16001
16077
  };
16002
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
16003
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result2);
16078
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
16079
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result2);
16004
16080
  } else {
16005
16081
  process.stdout.write(
16006
16082
  `Dry run: would move ${result2.name} to Trash and stop its active triggers.
@@ -16010,8 +16086,8 @@ async function handlePlayDelete(args) {
16010
16086
  return 0;
16011
16087
  }
16012
16088
  const result = await client.deletePlay(resolvedName);
16013
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
16014
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
16089
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
16090
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
16015
16091
  return result.archived || result.alreadyArchived ? 0 : 4;
16016
16092
  }
16017
16093
  if (result.alreadyArchived) {
@@ -16050,13 +16126,13 @@ async function handlePlayRestore(args) {
16050
16126
  );
16051
16127
  return 2;
16052
16128
  }
16053
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
16129
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
16054
16130
  try {
16055
16131
  const result = await client.restorePlay(
16056
16132
  parseReferencedPlayTarget2(playName).playName
16057
16133
  );
16058
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
16059
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, result);
16134
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
16135
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, result);
16060
16136
  return result.restored || result.alreadyActive ? 0 : 4;
16061
16137
  }
16062
16138
  if (result.alreadyActive) {
@@ -16136,6 +16212,58 @@ Common commands:
16136
16212
  deepline plays get prebuilt/person-linkedin-to-email
16137
16213
  `
16138
16214
  );
16215
+ play.command("resume-submission <path>").description(
16216
+ "Inspect or explicitly resubmit the same saved admission intent, preserving its run ID and original revision."
16217
+ ).option(
16218
+ "--inspect",
16219
+ "Read the local submission identity only; no API calls or execution"
16220
+ ).option("--json", "Emit the identity or admission response as JSON").action(
16221
+ async (path, options) => {
16222
+ const saved = JSON.parse(
16223
+ await _promises.readFile.call(void 0, _path.resolve.call(void 0, path), "utf8")
16224
+ );
16225
+ const { callerPlayWorkflowIdMatchesRequest } = await Promise.resolve().then(() => _interopRequireWildcard(require("./run-identity-G257GQED.js")));
16226
+ if (saved.version !== 1 || typeof saved.workflowId !== "string" || typeof saved.orgId !== "string" || typeof saved.baseUrl !== "string" || !saved.request || saved.request.admissionOrgId !== saved.orgId || saved.request.workflowId !== saved.workflowId || !callerPlayWorkflowIdMatchesRequest(
16227
+ saved.workflowId,
16228
+ saved.request
16229
+ )) {
16230
+ throw new Error(
16231
+ "The submission file does not contain a complete matching immutable admission intent."
16232
+ );
16233
+ }
16234
+ if (options.inspect) {
16235
+ const result2 = {
16236
+ workflowId: saved.workflowId,
16237
+ admissionState: "unknown",
16238
+ next: {
16239
+ inspect: `deepline runs get ${saved.workflowId} --json`,
16240
+ resume: `deepline plays resume-submission ${_chunkAID3OYVJjs.shellQuote.call(void 0, path)} --json`
16241
+ }
16242
+ };
16243
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0, result2, {
16244
+ json: options.json,
16245
+ text: `Submission ${saved.workflowId}: admission is unknown. ${result2.next.inspect}
16246
+ `
16247
+ });
16248
+ return;
16249
+ }
16250
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
16251
+ if (new URL(saved.baseUrl).origin !== new URL(client.baseUrl).origin) {
16252
+ throw new Error(
16253
+ "The submission belongs to a different API origin. Select its original host before recovery."
16254
+ );
16255
+ }
16256
+ const result = await client.startPlayRun(saved.request);
16257
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
16258
+ { ...result },
16259
+ {
16260
+ json: options.json,
16261
+ text: `Admission ${result.workflowId}: ${_nullishCoalesce(result.status, () => ( "observed"))}.
16262
+ `
16263
+ }
16264
+ );
16265
+ }
16266
+ );
16139
16267
  play.command("check <target>").description("Check a local play file or named/prebuilt play contract.").addHelpText(
16140
16268
  "after",
16141
16269
  `
@@ -16162,7 +16290,7 @@ Examples:
16162
16290
  ).action(async (target, options) => {
16163
16291
  process.exitCode = await handlePlayCheck([
16164
16292
  target,
16165
- ..._chunkRV6ALZIXjs.jsonFieldArgs.call(void 0, options.json),
16293
+ ..._chunkM7Y7JYZXjs.jsonFieldArgs.call(void 0, options.json),
16166
16294
  ...options.full ? ["--full"] : []
16167
16295
  ]);
16168
16296
  });
@@ -16278,6 +16406,12 @@ Examples:
16278
16406
  "Compatibility alias; run waits by default"
16279
16407
  ).hideHelp()
16280
16408
  ).option("--no-wait", "Start the run and return immediately").option(
16409
+ "--workflow-id <id>",
16410
+ "Reconcile or replay the same immutable request with its original caller run ID"
16411
+ ).option(
16412
+ "--max-total-credits <credits>",
16413
+ "Require a strict total spend ceiling including compute; unbounded work is refused before admission"
16414
+ ).option(
16281
16415
  "--run-id-file <path>",
16282
16416
  "Atomically write the accepted run id to a new JSON file"
16283
16417
  ).addOption(
@@ -16392,9 +16526,9 @@ Examples:
16392
16526
  const limit = Number(options.historyLimit);
16393
16527
  if (!Number.isInteger(limit) || limit < 1 || limit > 30)
16394
16528
  throw new Error("--history-limit must be an integer from 1 to 30.");
16395
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
16529
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
16396
16530
  if (options.binding) {
16397
- _chunkRV6ALZIXjs.printCompactJson.call(void 0,
16531
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0,
16398
16532
  await client.getPlayTriggerHistory(options.binding, { limit })
16399
16533
  );
16400
16534
  return;
@@ -16402,7 +16536,7 @@ Examples:
16402
16536
  const result = await client.listPlayTriggerInventory({
16403
16537
  cursor: options.cursor
16404
16538
  });
16405
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, {
16539
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
16406
16540
  ...result,
16407
16541
  next: result.isDone ? null : `deepline plays triggers --cursor ${JSON.stringify(result.continueCursor)}`
16408
16542
  });
@@ -16449,7 +16583,7 @@ Examples:
16449
16583
  if (options.groupBy !== "kind" && options.groupBy !== "trigger_source") {
16450
16584
  throw new Error("--group-by must be kind or trigger_source.");
16451
16585
  }
16452
- const result = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().getPlaysActivity({
16586
+ const result = await new (0, _chunk2HAD745Vjs.DeeplineClient)().getPlaysActivity({
16453
16587
  timeZone: options.timeZone,
16454
16588
  days,
16455
16589
  ...options.endDate ? { endDate: options.endDate } : {},
@@ -16463,7 +16597,7 @@ Examples:
16463
16597
  `${bucket.key} ${groups} failed_play_runs=${bucket.failedPlayRuns} ${coverage}`
16464
16598
  );
16465
16599
  }
16466
- _chunkRV6ALZIXjs.printCommandEnvelope.call(void 0,
16600
+ _chunkM7Y7JYZXjs.printCommandEnvelope.call(void 0,
16467
16601
  { ...result },
16468
16602
  {
16469
16603
  json: Boolean(options.json),
@@ -16492,7 +16626,7 @@ Examples:
16492
16626
  false
16493
16627
  );
16494
16628
  });
16495
- _chunkUCKJQG25js.registerDeprecatedSearchCommand.call(void 0,
16629
+ _chunkL2SYLGRPjs.registerDeprecatedSearchCommand.call(void 0,
16496
16630
  play,
16497
16631
  (options) => options.all ? ["plays"] : ["prebuilts"]
16498
16632
  );
@@ -16535,7 +16669,7 @@ Examples:
16535
16669
  );
16536
16670
  _chunkZMVJSS6Njs.addDescribeOptions.call(void 0, describeCommand, { json: false }).action(
16537
16671
  async (target, options) => {
16538
- const ownView = () => handlePlayDescribe(_chunkRV6ALZIXjs.describeArgs.call(void 0, target, options));
16672
+ const ownView = () => handlePlayDescribe(_chunkM7Y7JYZXjs.describeArgs.call(void 0, target, options));
16539
16673
  const [flagText] = [options.json].filter(
16540
16674
  (value) => typeof value === "string"
16541
16675
  );
@@ -16546,7 +16680,7 @@ Examples:
16546
16680
  process.exitCode = await ownView();
16547
16681
  return;
16548
16682
  }
16549
- const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-FDV2V74F.js")));
16683
+ const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-YGSEN5WC.js")));
16550
16684
  process.exitCode = await describeAnything(
16551
16685
  name,
16552
16686
  {
@@ -16664,7 +16798,7 @@ Examples:
16664
16798
  deepline plays deployments <deployment-id>
16665
16799
  `
16666
16800
  ).option("--limit <n>", "Max rows (default 50)").option("--json", "Emit JSON output").action(
16667
- async (id, options) => id ? _chunk4SFPVW7Ajs.handleDeploymentGet.call(void 0, id, options) : _chunk4SFPVW7Ajs.handleDeploymentsList.call(void 0, options)
16801
+ async (id, options) => id ? _chunkOXNOAD6Yjs.handleDeploymentGet.call(void 0, id, options) : _chunkOXNOAD6Yjs.handleDeploymentsList.call(void 0, options)
16668
16802
  );
16669
16803
  addPublishHelp(
16670
16804
  play.command("publish <target>").description(
@@ -16789,6 +16923,31 @@ Examples:
16789
16923
  registerRunChildrenCommand(runs);
16790
16924
  registerRunHistoryCommand(runs);
16791
16925
  registerRunEventsCommand(runs);
16926
+ runs.command("rows-history <runId>").description(
16927
+ "Read one immutable run-row history page; incomplete historical capture is reported explicitly."
16928
+ ).requiredOption("--play <name>", "Play reference owning this dataset").requiredOption(
16929
+ "--dataset <namespace>",
16930
+ "Recorded table namespace from the run dataset metadata"
16931
+ ).option("--limit <rows>", "History entries per page (1 to 1000)", "200").option("--cursor <cursor>", "Opaque nextCursor from the previous page").option("--json", "Emit rows and coverage metadata as JSON").action(
16932
+ async (runId, options) => {
16933
+ const limit = Number(options.limit);
16934
+ if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
16935
+ throw new Error("--limit must be an integer from 1 to 1000.");
16936
+ const result = await new (0, _chunk2HAD745Vjs.DeeplineClient)().runs.rowHistory({
16937
+ playName: options.play,
16938
+ runId,
16939
+ tableNamespace: options.dataset,
16940
+ limit,
16941
+ cursor: options.cursor
16942
+ });
16943
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
16944
+ ...result,
16945
+ ...result.nextCursor ? {
16946
+ 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`
16947
+ } : {}
16948
+ });
16949
+ }
16950
+ );
16792
16951
  runs.command("status <runId>").description(
16793
16952
  "Legacy scalar-only read. Use runs get for canonical status, progress, logs, and results."
16794
16953
  ).option("--json", "Emit JSON output").action(async (runId, options) => {
@@ -16846,7 +17005,7 @@ Examples:
16846
17005
  ).action(async (runId, options) => {
16847
17006
  process.exitCode = await handleRunGet([
16848
17007
  runId,
16849
- ..._chunkRV6ALZIXjs.jsonFieldArgs.call(void 0, options.json),
17008
+ ..._chunkM7Y7JYZXjs.jsonFieldArgs.call(void 0, options.json),
16850
17009
  ...options.webUrl ? ["--web-url"] : [],
16851
17010
  ...options.full ? ["--full"] : [],
16852
17011
  ...options.input ? ["--input"] : [],
@@ -16988,7 +17147,10 @@ Examples:
16988
17147
  ...options.logLevel ? ["--log-level", options.logLevel] : []
16989
17148
  ]);
16990
17149
  });
16991
- const runLogsCommand = runs.command("logs [runId]").description("Read a run\u2019s logs or search recent events.").addHelpText("after", renderRunLogsHelp()).option("--limit <count>", "Maximum results: logs 200; events 100, max 200").option("--out <path>", "Save the full available text log").option("--failed", "Last 20 lines of a failed run").option("--log-level <level>", "debug (default), info, warn or error").option("--step <id>", "Query structured logs from this authored step").option(
17150
+ const runLogsCommand = runs.command("logs [runId]").description("Read a run\u2019s logs or search recent events.").addHelpText("after", renderRunLogsHelp()).option("--limit <count>", "Maximum results: logs 200; events 100, max 200").option("--out <path>", "Save the full available text log").option(
17151
+ "--failed",
17152
+ "Terminal log tail of an overall failed run; completed runs with failed rows use runs events --kind receipt.failed --payloads"
17153
+ ).option("--log-level <level>", "debug (default), info, warn or error").option("--step <id>", "Query structured logs from this authored step").option(
16992
17154
  "--level <level>",
16993
17155
  "Query structured logs at this severity or above"
16994
17156
  ).option(
@@ -17122,7 +17284,7 @@ Examples:
17122
17284
  ...options.allowEmpty ? ["--allow-empty"] : [],
17123
17285
  ...options.wait ? ["--wait"] : [],
17124
17286
  ...options.timeoutMs ? ["--timeout-ms", options.timeoutMs] : [],
17125
- ..._chunkRV6ALZIXjs.jsonFieldArgs.call(void 0, options.json)
17287
+ ..._chunkM7Y7JYZXjs.jsonFieldArgs.call(void 0, options.json)
17126
17288
  ]);
17127
17289
  });
17128
17290
  const share = play.command("share").description(
@@ -17263,8 +17425,8 @@ function absolutePublicPlayUrl(path) {
17263
17425
  }
17264
17426
  function shareUrlFields(status) {
17265
17427
  return {
17266
- publicUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _556 => _556.share, 'optionalAccess', _557 => _557.publicPath])),
17267
- canonicalUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _558 => _558.share, 'optionalAccess', _559 => _559.canonicalPath]))
17428
+ publicUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _565 => _565.share, 'optionalAccess', _566 => _566.publicPath])),
17429
+ canonicalUrl: absolutePublicPlayUrl(_optionalChain([status, 'access', _567 => _567.share, 'optionalAccess', _568 => _568.canonicalPath]))
17268
17430
  };
17269
17431
  }
17270
17432
  function shareStatusForOutput(status) {
@@ -17288,10 +17450,10 @@ async function handlePlayShareStatus(args) {
17288
17450
  return 2;
17289
17451
  }
17290
17452
  const name = parseReferencedPlayTarget2(target).playName;
17291
- const status = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().getSharePage(name);
17453
+ const status = await new (0, _chunk2HAD745Vjs.DeeplineClient)().getSharePage(name);
17292
17454
  const outputStatus = shareStatusForOutput(status);
17293
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17294
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, outputStatus);
17455
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17456
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, outputStatus);
17295
17457
  return 0;
17296
17458
  }
17297
17459
  if (!outputStatus.share) {
@@ -17330,7 +17492,7 @@ async function handlePlaySharePublish(args) {
17330
17492
  return 2;
17331
17493
  }
17332
17494
  const name = parseReferencedPlayTarget2(target).playName;
17333
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
17495
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
17334
17496
  let revisionId = shareFlagValue(args, "--revision-id");
17335
17497
  let resolvedVersion;
17336
17498
  if (!revisionId) {
@@ -17361,8 +17523,8 @@ async function handlePlaySharePublish(args) {
17361
17523
  );
17362
17524
  if (!hasCompleted) {
17363
17525
  const message = `No completed run for ${name}. Publish a play only after it has run successfully. (Override with --no-run-check.)`;
17364
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17365
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, {
17526
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17527
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, {
17366
17528
  ok: false,
17367
17529
  code: "NO_SUCCESSFUL_RUN",
17368
17530
  message,
@@ -17386,8 +17548,8 @@ async function handlePlaySharePublish(args) {
17386
17548
  };
17387
17549
  if (args.includes("--dry-run")) {
17388
17550
  const plan = { dryRun: true, name, version: resolvedVersion, ...request };
17389
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17390
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, plan);
17551
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17552
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, plan);
17391
17553
  } else {
17392
17554
  console.log(
17393
17555
  `Would publish ${name}${resolvedVersion ? ` v${resolvedVersion}` : ""} (revision ${revisionId}).`
@@ -17397,13 +17559,13 @@ async function handlePlaySharePublish(args) {
17397
17559
  }
17398
17560
  const status = await client.publishSharePage(name, request);
17399
17561
  const outputStatus = shareStatusForOutput(status);
17400
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17401
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, outputStatus);
17562
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17563
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, outputStatus);
17402
17564
  return 0;
17403
17565
  }
17404
17566
  const urls = shareUrlFields(outputStatus);
17405
17567
  console.log(
17406
- `Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${_nullishCoalesce(_nullishCoalesce(urls.publicUrl, () => ( _optionalChain([outputStatus, 'access', _560 => _560.share, 'optionalAccess', _561 => _561.publicPath]))), () => ( ""))}`
17568
+ `Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${_nullishCoalesce(_nullishCoalesce(urls.publicUrl, () => ( _optionalChain([outputStatus, 'access', _569 => _569.share, 'optionalAccess', _570 => _570.publicPath]))), () => ( ""))}`
17407
17569
  );
17408
17570
  if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
17409
17571
  console.log(`Version URL: ${urls.canonicalUrl}`);
@@ -17429,9 +17591,9 @@ async function handlePlayShareUpdate(args) {
17429
17591
  ...args.includes("--show-latency") ? { showAverageLatency: true } : args.includes("--hide-latency") ? { showAverageLatency: false } : {},
17430
17592
  ...seoIndexing ? { seoIndexing } : {}
17431
17593
  };
17432
- const status = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().updateSharePage(name, request);
17433
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17434
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, status);
17594
+ const status = await new (0, _chunk2HAD745Vjs.DeeplineClient)().updateSharePage(name, request);
17595
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17596
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, status);
17435
17597
  return 0;
17436
17598
  }
17437
17599
  console.log(`Updated ${name} share settings.`);
@@ -17446,13 +17608,13 @@ async function handlePlayShareRegenerate(args) {
17446
17608
  return 2;
17447
17609
  }
17448
17610
  const name = parseReferencedPlayTarget2(target).playName;
17449
- const client = new (0, _chunkCVLM3WMJjs.DeeplineClient)();
17611
+ const client = new (0, _chunk2HAD745Vjs.DeeplineClient)();
17450
17612
  let revisionId = shareFlagValue(args, "--revision-id");
17451
17613
  const versionFlag = shareFlagValue(args, "--version");
17452
17614
  if (!revisionId && versionFlag) {
17453
17615
  const versions = await client.listPlayVersions(name);
17454
17616
  const chosen = versions.find((r) => r.version === Number(versionFlag));
17455
- if (!_optionalChain([chosen, 'optionalAccess', _562 => _562._id])) {
17617
+ if (!_optionalChain([chosen, 'optionalAccess', _571 => _571._id])) {
17456
17618
  console.error(`Version ${versionFlag} not found for ${name}.`);
17457
17619
  return 4;
17458
17620
  }
@@ -17463,12 +17625,12 @@ async function handlePlayShareRegenerate(args) {
17463
17625
  revisionId ? { revisionId } : {}
17464
17626
  );
17465
17627
  const outputStatus = shareStatusForOutput(status);
17466
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17467
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, outputStatus);
17628
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17629
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, outputStatus);
17468
17630
  return 0;
17469
17631
  }
17470
17632
  const urls = shareUrlFields(outputStatus);
17471
- const regeneratedPublishedRevision = !revisionId || _optionalChain([outputStatus, 'access', _563 => _563.share, 'optionalAccess', _564 => _564.publishedRevisionId]) === revisionId;
17633
+ const regeneratedPublishedRevision = !revisionId || _optionalChain([outputStatus, 'access', _572 => _572.share, 'optionalAccess', _573 => _573.publishedRevisionId]) === revisionId;
17472
17634
  console.log(
17473
17635
  `Regenerated public copy for ${name}${regeneratedPublishedRevision && urls.publicUrl ? `: ${urls.publicUrl}` : "."}`
17474
17636
  );
@@ -17489,9 +17651,9 @@ async function handlePlayShareUnpublish(args) {
17489
17651
  return 2;
17490
17652
  }
17491
17653
  const name = parseReferencedPlayTarget2(target).playName;
17492
- const status = await new (0, _chunkCVLM3WMJjs.DeeplineClient)().unpublishSharePage(name);
17493
- if (_chunkRV6ALZIXjs.argsWantJson.call(void 0, args)) {
17494
- _chunkRV6ALZIXjs.printCompactJson.call(void 0, status);
17654
+ const status = await new (0, _chunk2HAD745Vjs.DeeplineClient)().unpublishSharePage(name);
17655
+ if (_chunkM7Y7JYZXjs.argsWantJson.call(void 0, args)) {
17656
+ _chunkM7Y7JYZXjs.printCompactJson.call(void 0, status);
17495
17657
  return 0;
17496
17658
  }
17497
17659
  console.log(`Unpublished ${name}; the public page has been removed.`);