deepline 0.3.484 → 0.3.485

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 (209) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +91 -30
  2. package/dist/bundling-sources/sdk/src/compat.ts +13 -0
  3. package/dist/bundling-sources/sdk/src/plays/client-core.ts +4 -1
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +143 -9
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +31 -4
  7. package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
  8. package/dist/bundling-sources/sdk/src/types.ts +7 -1
  9. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +32 -3
  10. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +126 -41
  11. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +231 -25
  12. package/dist/bundling-sources/shared_libs/play-runtime/daytona-runtime-config.ts +9 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +130 -19
  14. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +105 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +4 -2
  16. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +194 -56
  17. package/dist/bundling-sources/shared_libs/play-runtime/log-provenance.ts +11 -6
  18. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +3 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +2 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +2 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +30 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +195 -2
  23. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +20 -1
  24. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +15 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +2 -2
  26. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +102 -23
  27. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/progress-sidecar.ts +9 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +25 -5
  29. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +133 -82
  30. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +58 -16
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-sandbox-absence.ts +171 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +69 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +100 -40
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +8 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -9
  36. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +5 -5
  37. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +6 -3
  38. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-errors.ts +14 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-writer.ts +87 -31
  40. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +18 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +19 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +14 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +204 -6
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +39 -0
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +12 -1
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +26 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +44 -15
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +60 -11
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +649 -38
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +6 -1
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +17 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +25 -33
  53. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +12 -0
  54. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +21 -0
  55. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
  56. package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +1 -1
  57. package/dist/cli/auth-ABZBH55L.js +43 -0
  58. package/dist/cli/{auth-EBFOTF7X.mjs → auth-OWMUENCU.mjs} +5 -5
  59. package/dist/cli/{billing-G2G3EF3I.js → billing-2FMNQGOX.js} +80 -80
  60. package/dist/cli/{billing-2ZOIMW5V.mjs → billing-JX4H3VFF.mjs} +7 -7
  61. package/dist/cli/{chunk-M4PG7FGC.js → chunk-2ILND7XX.js} +2 -2
  62. package/dist/cli/{chunk-WXRM3UC6.mjs → chunk-2ZEQ43B7.mjs} +3 -3
  63. package/dist/cli/{chunk-PU52JXKA.mjs → chunk-3DBW6C7M.mjs} +13 -4
  64. package/dist/cli/{chunk-4OVHIWE7.mjs → chunk-3DYU3JQN.mjs} +2 -2
  65. package/dist/cli/{chunk-QIDDTIVZ.js → chunk-3OF7NSGR.js} +322 -294
  66. package/dist/cli/{chunk-YWC5AN26.mjs → chunk-3Z24NKW7.mjs} +62 -34
  67. package/dist/cli/{chunk-RLLEH2SP.js → chunk-5DCQWQCP.js} +26 -26
  68. package/dist/cli/{chunk-DEXSQGXB.mjs → chunk-62PJ6PK7.mjs} +5 -5
  69. package/dist/cli/{chunk-6NPWXE32.mjs → chunk-676NZ7K4.mjs} +1 -1
  70. package/dist/cli/{chunk-FRD5WFT4.js → chunk-775AZTO7.js} +323 -247
  71. package/dist/cli/{chunk-4OEOM6GP.mjs → chunk-ACTUAZYP.mjs} +5 -5
  72. package/dist/cli/{chunk-ZOKM7DVA.js → chunk-AFADYKFE.js} +8 -8
  73. package/dist/cli/{chunk-GVAENVIG.js → chunk-AUQQVDAB.js} +110 -21
  74. package/dist/cli/{chunk-U7IJAGWB.js → chunk-BSKPQB2P.js} +7 -7
  75. package/dist/cli/chunk-C6QWRSMQ.js +42 -0
  76. package/dist/cli/{chunk-AK7UKQ5R.js → chunk-CSBMKHTV.js} +5 -5
  77. package/dist/cli/{chunk-YHA3EV3I.mjs → chunk-CW6TAQBF.mjs} +15 -4
  78. package/dist/cli/{chunk-UT4YMA2N.js → chunk-DMNVM34J.js} +5 -4
  79. package/dist/cli/{chunk-XZXIWPT3.mjs → chunk-E73JXJA3.mjs} +1 -1
  80. package/dist/cli/{chunk-5KNRQWHE.js → chunk-EC2CVPN5.js} +3 -3
  81. package/dist/cli/{chunk-IXWQOVNW.js → chunk-ECIXZNSW.js} +87 -76
  82. package/dist/cli/{chunk-LTZXLYKE.mjs → chunk-FJY6K3BG.mjs} +93 -17
  83. package/dist/cli/{chunk-TRLDJNVE.mjs → chunk-G5PI3RNT.mjs} +1 -1
  84. package/dist/cli/{chunk-WYUCDLVR.mjs → chunk-GHHJWCMD.mjs} +2 -1
  85. package/dist/cli/{chunk-FQK7BULS.js → chunk-HKGXGGIV.js} +1 -1
  86. package/dist/cli/{chunk-2AWYJXBX.js → chunk-IHMYIHF4.js} +5 -5
  87. package/dist/cli/{chunk-SD7QWZTV.mjs → chunk-INW22YP7.mjs} +1 -1
  88. package/dist/cli/{chunk-OWUZKXE7.mjs → chunk-J7EENGKJ.mjs} +1 -1
  89. package/dist/cli/{chunk-TIRSKEZH.mjs → chunk-JD6HKNKD.mjs} +1 -1
  90. package/dist/cli/{chunk-OHKKDPA5.js → chunk-JQXUWYWX.js} +13 -13
  91. package/dist/cli/{chunk-EACX7QXO.mjs → chunk-KZTNNLIL.mjs} +2 -2
  92. package/dist/cli/{chunk-7K5CWKKZ.mjs → chunk-L352NOE3.mjs} +2 -2
  93. package/dist/cli/{chunk-KGOC6HGI.js → chunk-L7IQ3DFH.js} +53 -53
  94. package/dist/cli/{chunk-4IOY2SCQ.js → chunk-LOX3BISD.js} +4 -4
  95. package/dist/cli/{chunk-6GRZEYSG.js → chunk-NKPTM7SK.js} +7 -7
  96. package/dist/cli/{chunk-VEVGM6B5.js → chunk-NLRTFJGH.js} +14 -14
  97. package/dist/cli/{chunk-UKM74PAA.js → chunk-NRNWPWBW.js} +37 -37
  98. package/dist/cli/{chunk-HNRELVCS.mjs → chunk-ONONSV2Q.mjs} +96 -7
  99. package/dist/cli/{chunk-CYWBAV5H.js → chunk-OW4OTEFF.js} +16 -16
  100. package/dist/cli/{chunk-5K5CAND4.mjs → chunk-RZE5I2XJ.mjs} +4 -4
  101. package/dist/cli/{chunk-3XQIVEAT.js → chunk-S3WQJ5VG.js} +3 -3
  102. package/dist/cli/{chunk-4SFC2XUF.mjs → chunk-SR6S4EYG.mjs} +5 -5
  103. package/dist/cli/{chunk-UWOY74RU.js → chunk-T4G2T5DS.js} +21 -21
  104. package/dist/cli/{chunk-TN2GW57M.mjs → chunk-TMCC7ORQ.mjs} +1 -1
  105. package/dist/cli/{chunk-HEI3BWIV.mjs → chunk-TSCUWWTM.mjs} +1 -1
  106. package/dist/cli/{chunk-DBJ62RAO.js → chunk-TVW6USSG.js} +3 -3
  107. package/dist/cli/{chunk-NW4QJE54.js → chunk-U6WEGDD3.js} +2 -2
  108. package/dist/cli/{chunk-V7JCMBLU.mjs → chunk-UPHXGZCE.mjs} +4 -4
  109. package/dist/cli/{chunk-C62NI2X6.js → chunk-UQ3LQ6IF.js} +5 -5
  110. package/dist/cli/{chunk-5GOG5ZGC.mjs → chunk-VZYTLWOM.mjs} +2 -2
  111. package/dist/cli/{chunk-AF7MOUZP.mjs → chunk-W33OL4F2.mjs} +2 -2
  112. package/dist/cli/{chunk-ZM2YPJQJ.js → chunk-XK5DMLZE.js} +5 -1
  113. package/dist/cli/{chunk-LJ5747UC.mjs → chunk-XRDXNAAY.mjs} +5 -1
  114. package/dist/cli/{chunk-YGN77QA5.mjs → chunk-YDA3PMKK.mjs} +3 -3
  115. package/dist/cli/{csv-S3CHUKI6.js → csv-HFEQPGNY.js} +13 -13
  116. package/dist/cli/{csv-NLWVWD3H.mjs → csv-OHF3Y5KB.mjs} +4 -4
  117. package/dist/cli/{db-OGRPAEEM.mjs → db-M456OUXD.mjs} +7 -7
  118. package/dist/cli/{db-WBSKMMOH.js → db-VLQKCYQS.js} +28 -28
  119. package/dist/cli/describe-CP35DZ5Z.js +49 -0
  120. package/dist/cli/{describe-FAD3Z7LN.mjs → describe-M6VXFYVL.mjs} +21 -21
  121. package/dist/cli/describe-core.d.mts +3 -3
  122. package/dist/cli/describe-core.d.ts +3 -3
  123. package/dist/cli/describe-core.js +4 -4
  124. package/dist/cli/describe-core.mjs +3 -3
  125. package/dist/cli/{executions-LYCL344R.mjs → executions-4FGRBPJF.mjs} +7 -7
  126. package/dist/cli/{executions-SOAZHCY4.js → executions-GKINJZI6.js} +9 -9
  127. package/dist/cli/{feedback-AVF6V7SV.mjs → feedback-D2WMGK3V.mjs} +4 -4
  128. package/dist/cli/{feedback-OROUPUNJ.js → feedback-ZH5K7WV7.js} +8 -8
  129. package/dist/cli/git-IDALMZDN.js +25 -0
  130. package/dist/cli/{git-J5N5M57H.mjs → git-OCIJ5ME4.mjs} +5 -5
  131. package/dist/cli/index.js +142 -139
  132. package/dist/cli/index.mjs +45 -42
  133. package/dist/cli/{legacy-noops-QAQMZMEG.js → legacy-noops-QNIVP7LO.js} +8 -8
  134. package/dist/cli/{legacy-noops-ENRRM7BL.mjs → legacy-noops-V6Q2X34P.mjs} +5 -5
  135. package/dist/cli/{monitors-CKQ65WRL.mjs → monitors-2USHTG5G.mjs} +8 -8
  136. package/dist/cli/{monitors-SFMQ5LFR.js → monitors-5DNK7W2K.js} +92 -92
  137. package/dist/cli/{org-3UNTDLT2.js → org-RPGM5AN4.js} +73 -73
  138. package/dist/cli/{org-K4UIEU5P.mjs → org-TL2YPYSE.mjs} +7 -7
  139. package/dist/cli/{pages-NKZTGB4C.js → pages-PNUKPFWV.js} +18 -18
  140. package/dist/cli/{pages-6GPGBIAH.mjs → pages-XDEW6EE3.mjs} +7 -7
  141. package/dist/cli/{play-BDEADESI.js → play-F5LHRKV5.js} +858 -632
  142. package/dist/cli/{play-62BEE7IX.mjs → play-WINNQ4HZ.mjs} +372 -146
  143. package/dist/cli/{providers-SXGP44GH.js → providers-BD4IS5U5.js} +10 -10
  144. package/dist/cli/{providers-X3CUWMFP.mjs → providers-PXGL3FRE.mjs} +7 -7
  145. package/dist/cli/{quickstart-XQ4426M4.js → quickstart-7LVF6HZF.js} +6 -6
  146. package/dist/cli/{quickstart-7LN22BKX.mjs → quickstart-XTH3UQWZ.mjs} +4 -4
  147. package/dist/cli/{run-XXSN3B5A.mjs → run-MBMUENR7.mjs} +26 -26
  148. package/dist/cli/{run-PBJ4ZJ4W.js → run-NH2BAWPA.js} +41 -41
  149. package/dist/cli/{search-M75VMADD.mjs → search-BMRWBV66.mjs} +8 -8
  150. package/dist/cli/search-R3MQJQMT.js +32 -0
  151. package/dist/cli/{search-output-F6HCFYEI.js → search-output-5NNT337U.js} +22 -16
  152. package/dist/cli/{search-output-NUQAKWDM.mjs → search-output-QKKRD4MF.mjs} +14 -8
  153. package/dist/cli/{secrets-J2H6V33R.mjs → secrets-AWEXBTJV.mjs} +7 -7
  154. package/dist/cli/{secrets-LRYY4QPE.js → secrets-KQSTOREN.js} +16 -16
  155. package/dist/cli/{sessions-YPF62CZE.js → sessions-DSPLZYCJ.js} +6 -6
  156. package/dist/cli/{sessions-IMT336UV.mjs → sessions-RO25Q67X.mjs} +5 -5
  157. package/dist/cli/{settings-35YYC5WA.js → settings-7JXIKNKI.js} +79 -79
  158. package/dist/cli/{settings-PDWVQIGH.mjs → settings-JMGXGK4Z.mjs} +12 -12
  159. package/dist/cli/{setup-UR7GOR7H.js → setup-5QFAQQRW.js} +47 -47
  160. package/dist/cli/{setup-DG5DISSE.mjs → setup-ZQZ47FHB.mjs} +9 -9
  161. package/dist/cli/skills-EDZXY7DV.js +33 -0
  162. package/dist/cli/{skills-U6NJD5J7.mjs → skills-W3H2DL56.mjs} +7 -7
  163. package/dist/cli/{tools-2HGEOELR.mjs → tools-2BZCVNBS.mjs} +19 -19
  164. package/dist/cli/tools-2EY2ETCZ.js +56 -0
  165. package/dist/cli/{update-FRAYBAHK.mjs → update-GAWYMGAW.mjs} +9 -9
  166. package/dist/cli/update-UKDQKNBY.js +33 -0
  167. package/dist/cli/{workflow-DDKVTF36.mjs → workflow-M6LLHQ2I.mjs} +8 -8
  168. package/dist/cli/{workflow-JKKLOMBX.js → workflow-ZPTDFPKW.js} +18 -18
  169. package/dist/{client-DJ3r8VQJ.d.mts → client-BkbDHRIg.d.mts} +1 -1
  170. package/dist/{client-JPSNljtj.d.ts → client-D3hVHXjK.d.ts} +1 -1
  171. package/dist/{client-core-3SJlNsKU.d.mts → client-core-BZoSMKcY.d.mts} +30 -15
  172. package/dist/{client-core-rCoQ5Xz3.d.ts → client-core-DUdVqO_m.d.ts} +30 -15
  173. package/dist/{compiler-manifest-gkO9ZkVg.d.mts → compiler-manifest-BFTwq1HI.d.mts} +1 -1
  174. package/dist/{compiler-manifest-gkO9ZkVg.d.ts → compiler-manifest-BFTwq1HI.d.ts} +1 -1
  175. package/dist/{errors-Cc92LKH-.d.ts → errors-c3pMsylw.d.ts} +1 -1
  176. package/dist/{errors-CeCCOKSA.d.mts → errors-w31ybrQM.d.mts} +1 -1
  177. package/dist/{index-DJQKdV76.d.ts → index-CQ-15-QL.d.ts} +1 -1
  178. package/dist/{index-DsqWJL3Q.d.mts → index-DvNtxucX.d.mts} +1 -1
  179. package/dist/index.d.mts +7 -7
  180. package/dist/index.d.ts +7 -7
  181. package/dist/index.js +10 -10
  182. package/dist/index.mjs +7 -7
  183. package/dist/install-integrity.json +117 -116
  184. package/dist/plays/bundle-play-file.d.mts +3 -3
  185. package/dist/plays/bundle-play-file.d.ts +3 -3
  186. package/dist/plays/bundle-play-file.mjs +2 -2
  187. package/dist/plays/play-description.d.mts +2 -2
  188. package/dist/plays/play-description.d.ts +2 -2
  189. package/dist/plays/run-request.d.mts +2 -2
  190. package/dist/plays/run-request.d.ts +2 -2
  191. package/dist/plays/run-request.js +12 -2
  192. package/dist/plays/run-request.mjs +11 -1
  193. package/dist/release.d.mts +1 -1
  194. package/dist/release.d.ts +1 -1
  195. package/dist/release.js +2 -2
  196. package/dist/release.mjs +1 -1
  197. package/dist/server.d.mts +4 -4
  198. package/dist/server.d.ts +4 -4
  199. package/dist/server.js +6 -6
  200. package/dist/server.mjs +4 -4
  201. package/package.json +1 -1
  202. package/dist/cli/auth-L5CSV3UO.js +0 -43
  203. package/dist/cli/chunk-KA2LNIUP.js +0 -33
  204. package/dist/cli/describe-UIAYCHWW.js +0 -49
  205. package/dist/cli/git-ATMWC27D.js +0 -25
  206. package/dist/cli/search-IGHLRLBD.js +0 -32
  207. package/dist/cli/skills-4U5WC4MJ.js +0 -33
  208. package/dist/cli/tools-PYJTQVVS.js +0 -56
  209. package/dist/cli/update-344OTRFM.js +0 -33
@@ -17,7 +17,10 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
17
17
 
18
18
 
19
19
 
20
- var _chunkGVAENVIGjs = require('./chunk-GVAENVIG.js');
20
+
21
+
22
+
23
+ var _chunkAUQQVDABjs = require('./chunk-AUQQVDAB.js');
21
24
 
22
25
 
23
26
 
@@ -28,7 +31,7 @@ var _chunkNMU3VR5Ujs = require('./chunk-NMU3VR5U.js');
28
31
 
29
32
 
30
33
 
31
- var _chunkUT4YMA2Njs = require('./chunk-UT4YMA2N.js');
34
+ var _chunkDMNVM34Jjs = require('./chunk-DMNVM34J.js');
32
35
 
33
36
 
34
37
  var _chunkALJJRZNJjs = require('./chunk-ALJJRZNJ.js');
@@ -649,7 +652,7 @@ var ToolCalls = class {
649
652
  idempotencyKey,
650
653
  onResponse: (response2) => {
651
654
  lastResponse = null;
652
- atomicToolsSupported = response2.headers.get(_chunkUT4YMA2Njs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
655
+ atomicToolsSupported = response2.headers.get(_chunkDMNVM34Jjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
653
656
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
654
657
  if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
655
658
  try {
@@ -1028,8 +1031,8 @@ function runtimeSelectionHeaders(runtime, env) {
1028
1031
  }
1029
1032
  const receivers = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
1030
1033
  return {
1031
- [_chunkUT4YMA2Njs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1032
- ...receivers ? { [_chunkUT4YMA2Njs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1034
+ [_chunkDMNVM34Jjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1035
+ ...receivers ? { [_chunkDMNVM34Jjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1033
1036
  };
1034
1037
  }
1035
1038
  function normalizeTestPolicyOverrides(value, source) {
@@ -1063,10 +1066,10 @@ function isRecord2(value) {
1063
1066
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
1064
1067
  }
1065
1068
  function normalizePlayStatus(raw) {
1066
- const runPackage = _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1069
+ const runPackage = _chunkAUQQVDABjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkAUQQVDABjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1067
1070
  const packageRun = _optionalChain([runPackage, 'optionalAccess', _57 => _57.run]);
1068
1071
  const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _58 => _58.status]) === "string" ? packageRun.status : null;
1069
- const status = _chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1072
+ const status = _chunkAUQQVDABjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1070
1073
  if (!status) {
1071
1074
  throw new Error(
1072
1075
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
@@ -1097,10 +1100,10 @@ var PlayClient = class {
1097
1100
  async startPlayRun(request, options) {
1098
1101
  const resolved = resolveStartPlayRunRequest(request, this.environment);
1099
1102
  const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
1100
- return _chunkGVAENVIGjs.startPlayRun.call(void 0,
1103
+ return _chunkAUQQVDABjs.startPlayRun.call(void 0,
1101
1104
  this.http,
1102
1105
  resolved.request,
1103
- _optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkUT4YMA2Njs.SDK_API_MAJOR) } : headers,
1106
+ _optionalChain([options, 'optionalAccess', _62 => _62.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkDMNVM34Jjs.SDK_API_MAJOR) } : headers,
1104
1107
  options
1105
1108
  );
1106
1109
  }
@@ -1114,7 +1117,8 @@ var PlayClient = class {
1114
1117
  }
1115
1118
  const query = params.size > 0 ? `?${params.toString()}` : "";
1116
1119
  const response = await this.http.get(
1117
- `/api/v2/runs/${encodeURIComponent(workflowId)}${query}`
1120
+ `/api/v2/runs/${encodeURIComponent(workflowId)}${query}`,
1121
+ _optionalChain([options, 'optionalAccess', _65 => _65.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
1118
1122
  );
1119
1123
  return normalizePlayStatus(response);
1120
1124
  }
@@ -1127,7 +1131,7 @@ var PlayClient = class {
1127
1131
  async stopPlay(workflowId, options) {
1128
1132
  return this.http.post(
1129
1133
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
1130
- _optionalChain([options, 'optionalAccess', _65 => _65.reason]) ? { reason: options.reason } : {}
1134
+ _optionalChain([options, 'optionalAccess', _66 => _66.reason]) ? { reason: options.reason } : {}
1131
1135
  );
1132
1136
  }
1133
1137
  async listPlayRuns(playName) {
@@ -1139,7 +1143,7 @@ var PlayClient = class {
1139
1143
  }
1140
1144
  async getPlay(name, options) {
1141
1145
  const encodedName = encodeURIComponent(name);
1142
- const query = _optionalChain([options, 'optionalAccess', _66 => _66.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _67 => _67.guidance]) ? "?include=guidance" : "";
1146
+ const query = _optionalChain([options, 'optionalAccess', _67 => _67.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _68 => _68.guidance]) ? "?include=guidance" : "";
1143
1147
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
1144
1148
  }
1145
1149
  async clearPlayHistory(name, request = {}) {
@@ -1151,7 +1155,7 @@ var PlayClient = class {
1151
1155
  }
1152
1156
  async listPlayVersions(name, options) {
1153
1157
  const encodedName = encodeURIComponent(name);
1154
- const suffix = _optionalChain([options, 'optionalAccess', _68 => _68.full]) ? "?full=true" : "";
1158
+ const suffix = _optionalChain([options, 'optionalAccess', _69 => _69.full]) ? "?full=true" : "";
1155
1159
  const response = await this.http.get(
1156
1160
  `/api/v2/plays/${encodedName}/versions${suffix}`
1157
1161
  );
@@ -1308,7 +1312,7 @@ function classifyLegacyLogLine(line) {
1308
1312
  if (/^\[perf\] runtime receipt\b/i.test(message)) {
1309
1313
  return "receipt";
1310
1314
  }
1311
- if (/^\[perf\]/i.test(message) || /^\[runtime\.(?:phase_summary|logs|log_transport)\]/i.test(message) || /\[worker\] picked up run\b/.test(message) || /\[worker\] heartbeat\b/.test(message) || /\[worker\] progress completedRows=\d+ totalRows=\d+ rowUpdates=\d+/.test(
1315
+ if (/^\[perf-trace\]/i.test(message) || /^\[perf\]/i.test(message) || /^\[runtime\.(?:phase_summary|logs|log_transport)\]/i.test(message) || /\[worker\] picked up run\b/.test(message) || /\[worker\] heartbeat\b/.test(message) || /\[worker\] progress completedRows=\d+ totalRows=\d+ rowUpdates=\d+/.test(
1312
1316
  message
1313
1317
  ) || /\[worker\] step started\b/.test(message) || /\[worker\] Preparing run files\b/.test(message) || /\[worker\] Run files ready\b/.test(message) || /\[worker\] Runtime ready\b/.test(message) || /\[worker\] Sandbox (?:starting|create start|create done|workspace ready|upload start|runner uploaded)\b/.test(
1314
1318
  message
@@ -2108,7 +2112,7 @@ function parseDsl(input) {
2108
2112
  input.slice(position)
2109
2113
  );
2110
2114
  if (!operation) {
2111
- const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _69 => _69.exec, 'call', _70 => _70(input.slice(position)), 'optionalAccess', _71 => _71[0]]), () => ( input[position])), () => ( "<end>"));
2115
+ const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _70 => _70.exec, 'call', _71 => _71(input.slice(position)), 'optionalAccess', _72 => _72[0]]), () => ( input[position])), () => ( "<end>"));
2112
2116
  if (token === "=") {
2113
2117
  const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
2114
2118
  fail(
@@ -2187,7 +2191,7 @@ function normalizeRunEventQueryTimestamp(value) {
2187
2191
  return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2188
2192
  }
2189
2193
  function timestampMicros(value) {
2190
- const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _72 => _72.exec, 'call', _73 => _73(value), 'optionalAccess', _74 => _74[1]]), () => ( ""));
2194
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _73 => _73.exec, 'call', _74 => _74(value), 'optionalAccess', _75 => _75[1]]), () => ( ""));
2191
2195
  return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2192
2196
  }
2193
2197
  function time(value, nowMs, fallback) {
@@ -2665,7 +2669,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
2665
2669
 
2666
2670
  // ../play-runtime/run-snapshot-stream.ts
2667
2671
  function isTerminalPlayRunLiveStatus(status) {
2668
- return _chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2672
+ return _chunkAUQQVDABjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2669
2673
  }
2670
2674
  function makeRunStreamEvent(input) {
2671
2675
  return {
@@ -2695,10 +2699,10 @@ function getStepStatusSignature(snapshot) {
2695
2699
  _nullishCoalesce(state.artifactTableNamespace, () => ( "")),
2696
2700
  _nullishCoalesce(state.startedAt, () => ( "")),
2697
2701
  _nullishCoalesce(state.completedAt, () => ( "")),
2698
- _nullishCoalesce(_optionalChain([state, 'access', _75 => _75.progress, 'optionalAccess', _76 => _76.startedAt]), () => ( "")),
2699
- _nullishCoalesce(_optionalChain([state, 'access', _77 => _77.progress, 'optionalAccess', _78 => _78.completedAt]), () => ( "")),
2702
+ _nullishCoalesce(_optionalChain([state, 'access', _76 => _76.progress, 'optionalAccess', _77 => _77.startedAt]), () => ( "")),
2703
+ _nullishCoalesce(_optionalChain([state, 'access', _78 => _78.progress, 'optionalAccess', _79 => _79.completedAt]), () => ( "")),
2700
2704
  _nullishCoalesce(state.updatedAt, () => ( "")),
2701
- _nullishCoalesce(_optionalChain([state, 'access', _79 => _79.progress, 'optionalAccess', _80 => _80.updatedAt]), () => ( ""))
2705
+ _nullishCoalesce(_optionalChain([state, 'access', _80 => _80.progress, 'optionalAccess', _81 => _81.updatedAt]), () => ( ""))
2702
2706
  ].join(":")
2703
2707
  ).join("|");
2704
2708
  }
@@ -2707,11 +2711,11 @@ function getStepProgressSignature(snapshot) {
2707
2711
  snapshot.nodeStates.map((state) => [
2708
2712
  state.nodeId,
2709
2713
  projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
2710
- _nullishCoalesce(_optionalChain([state, 'access', _81 => _81.progress, 'optionalAccess', _82 => _82.artifactTableNamespace]), () => ( "")),
2711
- _nullishCoalesce(_optionalChain([state, 'access', _83 => _83.progress, 'optionalAccess', _84 => _84.startedAt]), () => ( "")),
2712
- _nullishCoalesce(_optionalChain([state, 'access', _85 => _85.progress, 'optionalAccess', _86 => _86.completedAt]), () => ( "")),
2713
- _nullishCoalesce(_optionalChain([state, 'access', _87 => _87.progress, 'optionalAccess', _88 => _88.updatedAt]), () => ( "")),
2714
- _nullishCoalesce(_optionalChain([state, 'access', _89 => _89.progress, 'optionalAccess', _90 => _90.message]), () => ( ""))
2714
+ _nullishCoalesce(_optionalChain([state, 'access', _82 => _82.progress, 'optionalAccess', _83 => _83.artifactTableNamespace]), () => ( "")),
2715
+ _nullishCoalesce(_optionalChain([state, 'access', _84 => _84.progress, 'optionalAccess', _85 => _85.startedAt]), () => ( "")),
2716
+ _nullishCoalesce(_optionalChain([state, 'access', _86 => _86.progress, 'optionalAccess', _87 => _87.completedAt]), () => ( "")),
2717
+ _nullishCoalesce(_optionalChain([state, 'access', _88 => _88.progress, 'optionalAccess', _89 => _89.updatedAt]), () => ( "")),
2718
+ _nullishCoalesce(_optionalChain([state, 'access', _90 => _90.progress, 'optionalAccess', _91 => _91.message]), () => ( ""))
2715
2719
  ])
2716
2720
  );
2717
2721
  }
@@ -2781,8 +2785,8 @@ function diffPlayRunStreamEvents(input) {
2781
2785
  if (state.status === "idle") {
2782
2786
  continue;
2783
2787
  }
2784
- const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _91 => _91.progress, 'optionalAccess', _92 => _92.startedAt]))), () => ( null));
2785
- const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _93 => _93.progress, 'optionalAccess', _94 => _94.completedAt]))), () => ( null));
2788
+ const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.startedAt]))), () => ( null));
2789
+ const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.completedAt]))), () => ( null));
2786
2790
  events.push(
2787
2791
  makeRunStreamEvent({
2788
2792
  cursor,
@@ -2796,7 +2800,7 @@ function diffPlayRunStreamEvents(input) {
2796
2800
  ...resolveTimingWindow({
2797
2801
  startedAt: persistedStartedAt,
2798
2802
  completedAt: persistedCompletedAt,
2799
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _95 => _95.progress, 'optionalAccess', _96 => _96.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2803
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2800
2804
  })
2801
2805
  }
2802
2806
  })
@@ -2850,9 +2854,9 @@ function diffPlayRunStreamEvents(input) {
2850
2854
  if (next.snapshotSignature !== previous.snapshotSignature) {
2851
2855
  const enrichedNodeStates = snapshot.nodeStates.map((state) => {
2852
2856
  const timing = resolveTimingWindow({
2853
- startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _97 => _97.progress, 'optionalAccess', _98 => _98.startedAt]))), () => ( null)),
2854
- completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _99 => _99.progress, 'optionalAccess', _100 => _100.completedAt]))), () => ( null)),
2855
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _101 => _101.progress, 'optionalAccess', _102 => _102.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2857
+ startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.startedAt]))), () => ( null)),
2858
+ completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.completedAt]))), () => ( null)),
2859
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _102 => _102.progress, 'optionalAccess', _103 => _103.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2856
2860
  });
2857
2861
  return {
2858
2862
  ...state,
@@ -2896,21 +2900,22 @@ function diffPlayRunStreamEvents(input) {
2896
2900
 
2897
2901
  // src/runs/watch-polling.ts
2898
2902
  var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
2899
- var RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 500;
2903
+ var RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 300;
2900
2904
  var RUN_WATCH_STARTUP_WINDOW_MS = 6e3;
2905
+ var TERMINAL_LOG_PROJECTION_RETRY_LIMIT = 3;
2901
2906
  function waitForNextPoll(ms, signal) {
2902
- if (_optionalChain([signal, 'optionalAccess', _103 => _103.aborted])) {
2907
+ if (_optionalChain([signal, 'optionalAccess', _104 => _104.aborted])) {
2903
2908
  return Promise.resolve(false);
2904
2909
  }
2905
2910
  return new Promise((resolve) => {
2906
2911
  const finish = (elapsed) => {
2907
2912
  clearTimeout(timeout);
2908
- _optionalChain([signal, 'optionalAccess', _104 => _104.removeEventListener, 'call', _105 => _105("abort", onAbort)]);
2913
+ _optionalChain([signal, 'optionalAccess', _105 => _105.removeEventListener, 'call', _106 => _106("abort", onAbort)]);
2909
2914
  resolve(elapsed);
2910
2915
  };
2911
2916
  const onAbort = () => finish(false);
2912
2917
  const timeout = setTimeout(() => finish(true), ms);
2913
- _optionalChain([signal, 'optionalAccess', _106 => _106.addEventListener, 'call', _107 => _107("abort", onAbort, { once: true })]);
2918
+ _optionalChain([signal, 'optionalAccess', _107 => _107.addEventListener, 'call', _108 => _108("abort", onAbort, { once: true })]);
2914
2919
  });
2915
2920
  }
2916
2921
  function readSnapshotResponse(response, runId) {
@@ -2990,7 +2995,8 @@ async function* watchRunEvents(options) {
2990
2995
  let consecutiveFailures = 0;
2991
2996
  let outageNoticeSent = false;
2992
2997
  let pollCount = 0;
2993
- while (!_optionalChain([signal, 'optionalAccess', _108 => _108.aborted])) {
2998
+ let terminalLogProjectionRetries = 0;
2999
+ while (!_optionalChain([signal, 'optionalAccess', _109 => _109.aborted])) {
2994
3000
  const pollStartedAt = Date.now();
2995
3001
  const poll = ++pollCount;
2996
3002
  const pollIntervalMs = _nullishCoalesce(options.pollIntervalMs, () => ( (pollStartedAt - watchStartedAt < RUN_WATCH_STARTUP_WINDOW_MS ? RUN_WATCH_STARTUP_POLL_INTERVAL_MS : RUN_WATCH_POLL_INTERVAL_MS)));
@@ -3034,7 +3040,7 @@ async function* watchRunEvents(options) {
3034
3040
  reportPoll();
3035
3041
  } catch (error) {
3036
3042
  reportPoll();
3037
- if (_optionalChain([signal, 'optionalAccess', _109 => _109.aborted])) {
3043
+ if (_optionalChain([signal, 'optionalAccess', _110 => _110.aborted])) {
3038
3044
  return;
3039
3045
  }
3040
3046
  if (!isTransientPlayRunReadError(error)) {
@@ -3043,12 +3049,12 @@ async function* watchRunEvents(options) {
3043
3049
  consecutiveFailures += 1;
3044
3050
  const reason = error instanceof Error ? error.message : String(error);
3045
3051
  if (!outageNoticeSent) {
3046
- _optionalChain([options, 'access', _110 => _110.onRetry, 'optionalCall', _111 => _111({
3052
+ _optionalChain([options, 'access', _111 => _111.onRetry, 'optionalCall', _112 => _112({
3047
3053
  attempt: consecutiveFailures,
3048
3054
  delayMs: pollIntervalMs,
3049
3055
  reason
3050
3056
  })]);
3051
- _optionalChain([options, 'access', _112 => _112.onNotice, 'optionalCall', _113 => _113(
3057
+ _optionalChain([options, 'access', _113 => _113.onNotice, 'optionalCall', _114 => _114(
3052
3058
  `[watch] run snapshot request failed; retrying snapshot polling (${reason})`
3053
3059
  )]);
3054
3060
  outageNoticeSent = true;
@@ -3063,12 +3069,29 @@ async function* watchRunEvents(options) {
3063
3069
  continue;
3064
3070
  }
3065
3071
  if (outageNoticeSent) {
3066
- _optionalChain([options, 'access', _114 => _114.onNotice, 'optionalCall', _115 => _115("[watch] run snapshot polling recovered")]);
3072
+ _optionalChain([options, 'access', _115 => _115.onNotice, 'optionalCall', _116 => _116("[watch] run snapshot polling recovered")]);
3067
3073
  outageNoticeSent = false;
3068
3074
  }
3069
3075
  consecutiveFailures = 0;
3076
+ const terminalLogsPending = isTerminalPlayRunLiveStatus(snapshot.status) && snapshot.logsUnavailable && !options.omitTerminalLogs;
3077
+ if (terminalLogsPending) {
3078
+ if (terminalLogProjectionRetries < TERMINAL_LOG_PROJECTION_RETRY_LIMIT) {
3079
+ terminalLogProjectionRetries += 1;
3080
+ const remaining2 = Math.max(
3081
+ 0,
3082
+ pollIntervalMs - (Date.now() - pollStartedAt)
3083
+ );
3084
+ if (!await waitForNextPoll(remaining2, signal)) return;
3085
+ continue;
3086
+ }
3087
+ _optionalChain([options, 'access', _117 => _117.onNotice, 'optionalCall', _118 => _118(
3088
+ `[watch] terminal status is complete, but final logs are unavailable in this watch; fetch retained logs with deepline runs logs ${runId}`
3089
+ )]);
3090
+ } else {
3091
+ terminalLogProjectionRetries = 0;
3092
+ }
3070
3093
  if (terminalStatus) {
3071
- await _optionalChain([options, 'access', _116 => _116.terminalStatus, 'optionalAccess', _117 => _117.onStatus, 'call', _118 => _118(terminalStatus, snapshot.status)]);
3094
+ await _optionalChain([options, 'access', _119 => _119.terminalStatus, 'optionalAccess', _120 => _120.onStatus, 'call', _121 => _121(terminalStatus, snapshot.status)]);
3072
3095
  }
3073
3096
  const diff = diffPlayRunStreamEvents({
3074
3097
  streamId,
@@ -3132,7 +3155,7 @@ function parseNotificationGroupTarget(value) {
3132
3155
  }
3133
3156
  return { kind: "email", email };
3134
3157
  }
3135
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _119 => _119.exec, 'call', _120 => _120(normalized), 'optionalAccess', _121 => _121[1], 'optionalAccess', _122 => _122.trim, 'call', _123 => _123()]);
3158
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _122 => _122.exec, 'call', _123 => _123(normalized), 'optionalAccess', _124 => _124[1], 'optionalAccess', _125 => _125.trim, 'call', _126 => _126()]);
3136
3159
  if (!slack) {
3137
3160
  const provider = normalized.split(":", 1)[0] || normalized;
3138
3161
  throw new Error(
@@ -3140,7 +3163,7 @@ function parseNotificationGroupTarget(value) {
3140
3163
  );
3141
3164
  }
3142
3165
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
3143
- if (_optionalChain([member, 'optionalAccess', _124 => _124[1]])) {
3166
+ if (_optionalChain([member, 'optionalAccess', _127 => _127[1]])) {
3144
3167
  return { kind: "slack", memberId: member[1].toUpperCase() };
3145
3168
  }
3146
3169
  if (slack.toLowerCase().startsWith("member:")) {
@@ -3165,11 +3188,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3165
3188
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
3166
3189
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
3167
3190
  function isolatedCiRuntimeEventReadHeaders(env) {
3168
- const schema = _optionalChain([env, 'access', _125 => _125.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]);
3169
- if (_optionalChain([env, 'access', _128 => _128.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3191
+ const schema = _optionalChain([env, 'access', _128 => _128.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()]);
3192
+ if (_optionalChain([env, 'access', _131 => _131.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3170
3193
  return void 0;
3171
3194
  }
3172
- const token = _optionalChain([env, 'access', _131 => _131.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]);
3195
+ const token = _optionalChain([env, 'access', _134 => _134.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()]);
3173
3196
  if (!token) {
3174
3197
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
3175
3198
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -3177,7 +3200,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3177
3200
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3178
3201
  );
3179
3202
  }
3180
- return { [_chunkUT4YMA2Njs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3203
+ return { [_chunkDMNVM34Jjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3181
3204
  }
3182
3205
  function sleep(ms) {
3183
3206
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -3192,7 +3215,7 @@ function isTransientCompileManifestError(error) {
3192
3215
  );
3193
3216
  }
3194
3217
  function requireCompileManifestResponse(response, playName) {
3195
- const compilerManifest = _optionalChain([response, 'optionalAccess', _134 => _134.compilerManifest]);
3218
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _137 => _137.compilerManifest]);
3196
3219
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
3197
3220
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
3198
3221
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -3244,7 +3267,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
3244
3267
  }
3245
3268
  function searchParams(options) {
3246
3269
  const params = new URLSearchParams();
3247
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _135 => _135.query, 'optionalAccess', _136 => _136.trim, 'call', _137 => _137()]), () => ( "")));
3270
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _138 => _138.query, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()]), () => ( "")));
3248
3271
  params.set(
3249
3272
  "include_search_debug",
3250
3273
  options.includeSearchDebug ? "true" : "false"
@@ -3254,13 +3277,13 @@ function searchParams(options) {
3254
3277
  if (options.offset !== void 0) {
3255
3278
  params.set("offset", String(options.offset));
3256
3279
  }
3257
- if (_optionalChain([options, 'access', _138 => _138.categories, 'optionalAccess', _139 => _139.trim, 'call', _140 => _140()])) {
3280
+ if (_optionalChain([options, 'access', _141 => _141.categories, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()])) {
3258
3281
  params.set("categories", options.categories.trim());
3259
3282
  }
3260
- if (_optionalChain([options, 'access', _141 => _141.searchTerms, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()])) {
3283
+ if (_optionalChain([options, 'access', _144 => _144.searchTerms, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) {
3261
3284
  params.set("search_terms", options.searchTerms.trim());
3262
3285
  }
3263
- if (_optionalChain([options, 'access', _144 => _144.task, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) params.set("task", options.task.trim());
3286
+ if (_optionalChain([options, 'access', _147 => _147.task, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()])) params.set("task", options.task.trim());
3264
3287
  return params;
3265
3288
  }
3266
3289
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3308,7 +3331,7 @@ function playLiveRunStatus(event) {
3308
3331
  return null;
3309
3332
  }
3310
3333
  const payload = getPlayLiveEventPayload(event);
3311
- return _nullishCoalesce(_chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? _chunkGVAENVIGjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3334
+ return _nullishCoalesce(_chunkAUQQVDABjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkAUQQVDABjs.isPlayRunPackage.call(void 0, payload) ? _chunkAUQQVDABjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3312
3335
  }
3313
3336
  function appendPlayLiveLogLines(state, payload) {
3314
3337
  const lines = readStringArray(payload.lines);
@@ -3340,7 +3363,7 @@ function updatePlayLiveStatusState(state, event) {
3340
3363
  if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
3341
3364
  return null;
3342
3365
  }
3343
- const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3366
+ const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkAUQQVDABjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3344
3367
  const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
3345
3368
  const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
3346
3369
  if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
@@ -3353,7 +3376,7 @@ function updatePlayLiveStatusState(state, event) {
3353
3376
  }
3354
3377
  if ("result" in payload) {
3355
3378
  state.result = payload.result;
3356
- } else if (_chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload)) {
3379
+ } else if (_chunkAUQQVDABjs.isPlayRunPackage.call(void 0, payload)) {
3357
3380
  state.result = payload;
3358
3381
  }
3359
3382
  if (typeof payload.error === "string" && payload.error.trim()) {
@@ -3366,7 +3389,7 @@ function updatePlayLiveStatusState(state, event) {
3366
3389
  ...payload,
3367
3390
  runId,
3368
3391
  status,
3369
- ..._chunkGVAENVIGjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3392
+ ..._chunkAUQQVDABjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3370
3393
  progress: {
3371
3394
  ...progressRecord,
3372
3395
  status: typeof progressRecord.status === "string" ? progressRecord.status : status,
@@ -3384,9 +3407,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3384
3407
  runId: status.runId || fallbackRunId,
3385
3408
  result: _nullishCoalesce(status.package, () => ( status.result)),
3386
3409
  ...status.package ? { package: status.package } : {},
3387
- logs: _nullishCoalesce(_optionalChain([status, 'access', _147 => _147.progress, 'optionalAccess', _148 => _148.logs]), () => ( [])),
3410
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _150 => _150.progress, 'optionalAccess', _151 => _151.logs]), () => ( [])),
3388
3411
  durationMs: Date.now() - startedAt,
3389
- error: _nullishCoalesce(_optionalChain([status, 'access', _149 => _149.progress, 'optionalAccess', _150 => _150.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3412
+ error: _nullishCoalesce(_optionalChain([status, 'access', _152 => _152.progress, 'optionalAccess', _153 => _153.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3390
3413
  };
3391
3414
  }
3392
3415
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -3488,7 +3511,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3488
3511
  {},
3489
3512
  {
3490
3513
  "Idempotency-Key": requireBillingIdempotencyKey(
3491
- _nullishCoalesce(_optionalChain([options, 'optionalAccess', _151 => _151.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3514
+ _nullishCoalesce(_optionalChain([options, 'optionalAccess', _154 => _154.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3492
3515
  )
3493
3516
  }
3494
3517
  ),
@@ -3501,7 +3524,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3501
3524
  };
3502
3525
  this.workspaces = {
3503
3526
  members: (options) => {
3504
- const query = _optionalChain([options, 'optionalAccess', _152 => _152.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3527
+ const query = _optionalChain([options, 'optionalAccess', _155 => _155.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3505
3528
  return this.http.get(`/api/v2/auth/workspace/members${query}`);
3506
3529
  },
3507
3530
  setMemberGrants: (memberId, grants) => this.http.patch(
@@ -3516,7 +3539,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3516
3539
  check: (definition) => this.checkMonitor(definition),
3517
3540
  preview: (definition, options) => this.previewMonitor(definition, options),
3518
3541
  deploy: (definition, options) => this.deployMonitor(definition, options),
3519
- sync: (definition, options) => _optionalChain([options, 'optionalAccess', _153 => _153.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3542
+ sync: (definition, options) => _optionalChain([options, 'optionalAccess', _156 => _156.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3520
3543
  list: (options) => this.listMonitors(options),
3521
3544
  get: (key) => this.getMonitor(key),
3522
3545
  test: (key, payload, options) => this.testMonitorWebhook(key, payload, options),
@@ -3525,13 +3548,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3525
3548
  update: (key, patch) => this.updateMonitor(key, patch),
3526
3549
  delete: (key, options) => this.deleteMonitor(key, options),
3527
3550
  reactivate: (key, options) => this.reactivateMonitor(key, options),
3528
- start: (key, options) => _optionalChain([options, 'optionalAccess', _154 => _154.dryRun]) ? this.submitMonitorBatch({
3551
+ start: (key, options) => _optionalChain([options, 'optionalAccess', _157 => _157.dryRun]) ? this.submitMonitorBatch({
3529
3552
  kind: "reactivate",
3530
3553
  scope: { kind: "keys", monitorKeys: [key] },
3531
3554
  dryRun: true,
3532
3555
  idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3533
3556
  }) : this.submitScalarMonitorLifecycle(key, "start", options),
3534
- stop: (key, options) => _optionalChain([options, 'optionalAccess', _155 => _155.dryRun]) ? this.submitMonitorBatch({
3557
+ stop: (key, options) => _optionalChain([options, 'optionalAccess', _158 => _158.dryRun]) ? this.submitMonitorBatch({
3535
3558
  kind: "deactivate",
3536
3559
  scope: { kind: "keys", monitorKeys: [key] },
3537
3560
  dryRun: true,
@@ -3580,8 +3603,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3580
3603
  /** List this workspace's hosted pages, newest update first. */
3581
3604
  async listPages(input) {
3582
3605
  const params = new URLSearchParams();
3583
- if (_optionalChain([input, 'optionalAccess', _156 => _156.cursor])) params.set("cursor", input.cursor);
3584
- if (_optionalChain([input, 'optionalAccess', _157 => _157.limit])) params.set("limit", String(input.limit));
3606
+ if (_optionalChain([input, 'optionalAccess', _159 => _159.cursor])) params.set("cursor", input.cursor);
3607
+ if (_optionalChain([input, 'optionalAccess', _160 => _160.limit])) params.set("limit", String(input.limit));
3585
3608
  const query = params.size > 0 ? `?${params}` : "";
3586
3609
  return await this.http.get(`/api/v2/pages${query}`);
3587
3610
  }
@@ -3697,17 +3720,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3697
3720
  */
3698
3721
  async listTools(options) {
3699
3722
  const params = new URLSearchParams();
3700
- if (_optionalChain([options, 'optionalAccess', _158 => _158.categories, 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()])) {
3723
+ if (_optionalChain([options, 'optionalAccess', _161 => _161.categories, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()])) {
3701
3724
  params.set("categories", options.categories.trim());
3702
3725
  }
3703
- if (_optionalChain([options, 'optionalAccess', _161 => _161.tags, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()])) {
3726
+ if (_optionalChain([options, 'optionalAccess', _164 => _164.tags, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()])) {
3704
3727
  params.set("tags", options.tags.trim());
3705
3728
  }
3706
- if (_optionalChain([options, 'optionalAccess', _164 => _164.grep, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()])) {
3729
+ if (_optionalChain([options, 'optionalAccess', _167 => _167.grep, 'optionalAccess', _168 => _168.trim, 'call', _169 => _169()])) {
3707
3730
  params.set("grep", options.grep.trim());
3708
3731
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3709
3732
  }
3710
- params.set("compact", _optionalChain([options, 'optionalAccess', _167 => _167.compact]) === true ? "true" : "false");
3733
+ params.set("compact", _optionalChain([options, 'optionalAccess', _170 => _170.compact]) === true ? "true" : "false");
3711
3734
  const suffix = params.toString() ? `?${params.toString()}` : "";
3712
3735
  const res = await this.http.get(
3713
3736
  `/api/v2/tools${suffix}`
@@ -3740,7 +3763,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3740
3763
  const params = new URLSearchParams({
3741
3764
  view: "category",
3742
3765
  categories: normalizedCategory,
3743
- compact: _optionalChain([options, 'optionalAccess', _168 => _168.compact]) === true ? "true" : "false"
3766
+ compact: _optionalChain([options, 'optionalAccess', _171 => _171.compact]) === true ? "true" : "false"
3744
3767
  });
3745
3768
  const response = await this.http.get(
3746
3769
  `/api/v2/tools?${params}`
@@ -3755,7 +3778,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3755
3778
  }
3756
3779
  /** List discoverable providers without requiring a local plugin catalog. */
3757
3780
  async listProviders(options) {
3758
- const suffix = _optionalChain([options, 'optionalAccess', _169 => _169.changed]) ? "?changed=true" : "";
3781
+ const suffix = _optionalChain([options, 'optionalAccess', _172 => _172.changed]) ? "?changed=true" : "";
3759
3782
  const res = await this.http.get(
3760
3783
  `/api/v2/tools/providers${suffix}`
3761
3784
  );
@@ -3786,8 +3809,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3786
3809
  */
3787
3810
  async search(options = {}) {
3788
3811
  const params = searchParams(options);
3789
- if (_optionalChain([options, 'access', _170 => _170.types, 'optionalAccess', _171 => _171.length])) params.set("types", options.types.join(","));
3790
- if (_optionalChain([options, 'access', _172 => _172.exclude, 'optionalAccess', _173 => _173.length])) {
3812
+ if (_optionalChain([options, 'access', _173 => _173.types, 'optionalAccess', _174 => _174.length])) params.set("types", options.types.join(","));
3813
+ if (_optionalChain([options, 'access', _175 => _175.exclude, 'optionalAccess', _176 => _176.length])) {
3791
3814
  params.set("exclude", options.exclude.join(","));
3792
3815
  }
3793
3816
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3809,7 +3832,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3809
3832
  * ```
3810
3833
  */
3811
3834
  async getTool(toolId, options) {
3812
- if (_optionalChain([options, 'optionalAccess', _174 => _174.cliInvocationId]) !== void 0) {
3835
+ if (_optionalChain([options, 'optionalAccess', _177 => _177.cliInvocationId]) !== void 0) {
3813
3836
  validateCliInvocationId(options.cliInvocationId);
3814
3837
  }
3815
3838
  return this.http.request(
@@ -3822,7 +3845,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3822
3845
  retryApiErrors: true,
3823
3846
  headers: {
3824
3847
  "x-deepline-tool-meta-only": "1",
3825
- ..._optionalChain([options, 'optionalAccess', _175 => _175.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3848
+ ..._optionalChain([options, 'optionalAccess', _178 => _178.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3826
3849
  }
3827
3850
  }
3828
3851
  );
@@ -3913,7 +3936,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3913
3936
  return this.http.post(
3914
3937
  "/api/v2/ingestion/repair",
3915
3938
  {
3916
- ..._optionalChain([input, 'optionalAccess', _176 => _176.provider]) ? { provider: input.provider } : {}
3939
+ ..._optionalChain([input, 'optionalAccess', _179 => _179.provider]) ? { provider: input.provider } : {}
3917
3940
  }
3918
3941
  );
3919
3942
  }
@@ -3965,21 +3988,26 @@ var DeeplineClient = (_class = class _DeeplineClient {
3965
3988
  */
3966
3989
  async preparePlayRunAdmission(request, options) {
3967
3990
  const resolved = resolveStartPlayRunRequest(request, this.environment);
3968
- const prepared = await _chunkGVAENVIGjs.preparePlayRunAdmission.call(void 0,
3991
+ const prepared = await _chunkAUQQVDABjs.preparePlayRunAdmission.call(void 0,
3969
3992
  this.http,
3970
3993
  resolved.request,
3971
- _optionalChain([options, 'optionalAccess', _177 => _177.onSubmission]),
3972
- {
3973
- ...options && Object.hasOwn(options, "admissionCapability") ? { admissionCapability: options.admissionCapability } : {}
3974
- }
3994
+ _optionalChain([options, 'optionalAccess', _180 => _180.onSubmission]),
3995
+ options
3975
3996
  );
3976
3997
  const bodyJson = JSON.stringify(prepared.body);
3977
- const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
3998
+ const runtimeHeaders = runtimeSelectionHeaders(
3999
+ resolved.runtime,
4000
+ this.environment
4001
+ );
4002
+ const headers = _optionalChain([options, 'optionalAccess', _181 => _181.cliAdmission]) ? {
4003
+ ...runtimeHeaders,
4004
+ "X-Deepline-API-Major": String(_chunkDMNVM34Jjs.SDK_API_MAJOR)
4005
+ } : runtimeHeaders;
3978
4006
  const http = this.http;
3979
4007
  let submitted = false;
3980
4008
  return {
3981
4009
  ...prepared,
3982
- async *startStream(streamOptions) {
4010
+ async start(startOptions) {
3983
4011
  if (submitted && !prepared.supportsCallerIntent) {
3984
4012
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
3985
4013
  "This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
@@ -3988,34 +4016,82 @@ var DeeplineClient = (_class = class _DeeplineClient {
3988
4016
  );
3989
4017
  }
3990
4018
  if (submitted) {
3991
- await _chunkGVAENVIGjs.preparePlayRunAdmission.call(void 0,
4019
+ if (!_optionalChain([options, 'optionalAccess', _182 => _182.callerIntentV2])) {
4020
+ await _chunkAUQQVDABjs.preparePlayRunAdmission.call(void 0,
4021
+ http,
4022
+ JSON.parse(bodyJson),
4023
+ void 0,
4024
+ { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _183 => _183.signal]), () => ( _optionalChain([options, 'optionalAccess', _184 => _184.signal]))) }
4025
+ );
4026
+ }
4027
+ }
4028
+ submitted = true;
4029
+ try {
4030
+ return await _chunkAUQQVDABjs.submitPreparedPlayRunAdmission.call(void 0,
3992
4031
  http,
3993
4032
  JSON.parse(bodyJson),
3994
- void 0,
3995
- { signal: _optionalChain([streamOptions, 'optionalAccess', _178 => _178.signal]) }
4033
+ prepared.workflowId,
4034
+ prepared.supportsCallerIntent,
4035
+ headers,
4036
+ {
4037
+ cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _185 => _185.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _186 => _186.cliAdmission]))),
4038
+ callerIntentV2: _optionalChain([options, 'optionalAccess', _187 => _187.callerIntentV2]),
4039
+ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _188 => _188.signal]), () => ( _optionalChain([options, 'optionalAccess', _189 => _189.signal])))
4040
+ }
3996
4041
  );
4042
+ } catch (error) {
4043
+ if (error instanceof _chunkAUQQVDABjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkAUQQVDABjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
4044
+ submitted = false;
4045
+ }
4046
+ throw error;
4047
+ }
4048
+ },
4049
+ async *startStream(streamOptions) {
4050
+ if (submitted && !prepared.supportsCallerIntent) {
4051
+ throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4052
+ "This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
4053
+ 409,
4054
+ "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
4055
+ );
4056
+ }
4057
+ if (submitted) {
4058
+ if (!_optionalChain([options, 'optionalAccess', _190 => _190.callerIntentV2])) {
4059
+ await _chunkAUQQVDABjs.preparePlayRunAdmission.call(void 0,
4060
+ http,
4061
+ JSON.parse(bodyJson),
4062
+ void 0,
4063
+ { signal: _optionalChain([streamOptions, 'optionalAccess', _191 => _191.signal]) }
4064
+ );
4065
+ }
3997
4066
  }
3998
4067
  submitted = true;
3999
- const streamPath = _optionalChain([options, 'optionalAccess', _179 => _179.cliAdmission]) ? _chunkGVAENVIGjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkGVAENVIGjs.PLAY_RUN_START_STREAM_PATH;
4068
+ const streamPath = _optionalChain([options, 'optionalAccess', _192 => _192.callerIntentV2]) ? _chunkAUQQVDABjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _193 => _193.cliAdmission]) ? _chunkAUQQVDABjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkAUQQVDABjs.PLAY_RUN_START_STREAM_PATH;
4000
4069
  let cliAdmissionSupported = false;
4001
4070
  try {
4002
4071
  for await (const event of http.streamSse(streamPath, {
4003
4072
  method: "POST",
4004
4073
  body: JSON.parse(bodyJson),
4005
4074
  headers,
4006
- signal: _optionalChain([streamOptions, 'optionalAccess', _180 => _180.signal]),
4075
+ signal: _optionalChain([streamOptions, 'optionalAccess', _194 => _194.signal]),
4007
4076
  exactUrlOnly: true,
4008
- ..._optionalChain([options, 'optionalAccess', _181 => _181.cliAdmission]) ? {
4077
+ ..._optionalChain([options, 'optionalAccess', _195 => _195.cliAdmission]) ? {
4009
4078
  onResponse: (response) => {
4010
- cliAdmissionSupported = response.headers.get(_chunkGVAENVIGjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4079
+ cliAdmissionSupported = response.headers.get(_chunkAUQQVDABjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4011
4080
  }
4012
4081
  } : {}
4013
4082
  })) {
4014
4083
  if (event.scope === "play") yield event;
4015
4084
  }
4016
4085
  } catch (error) {
4017
- if (_optionalChain([options, 'optionalAccess', _182 => _182.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4018
- throw new (0, _chunkGVAENVIGjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4086
+ if (_optionalChain([options, 'optionalAccess', _196 => _196.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkDIAWYWT5js.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4087
+ if (options.callerIntentV2) {
4088
+ submitted = false;
4089
+ throw new (0, _chunkAUQQVDABjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
4090
+ error.statusCode
4091
+ );
4092
+ }
4093
+ submitted = false;
4094
+ throw new (0, _chunkAUQQVDABjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4019
4095
  }
4020
4096
  throw error;
4021
4097
  }
@@ -4027,8 +4103,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4027
4103
  * preparation so the network round trip can overlap with compilation.
4028
4104
  * @internal
4029
4105
  */
4030
- async prefetchPlayRunAdmissionCapability() {
4031
- return _chunkGVAENVIGjs.readPlayRunAdmissionCapability.call(void 0, this.http);
4106
+ async prefetchPlayRunAdmissionCapability(options) {
4107
+ return _chunkAUQQVDABjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
4032
4108
  }
4033
4109
  /**
4034
4110
  * Submit a play run through the legacy event response.
@@ -4045,7 +4121,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4045
4121
  */
4046
4122
  async *startPlayRunStream(request, options) {
4047
4123
  const prepared = await this.preparePlayRunAdmission(request, options);
4048
- yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _183 => _183.signal]) });
4124
+ yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _197 => _197.signal]) });
4049
4125
  }
4050
4126
  /**
4051
4127
  * Register a bundled play artifact.
@@ -4198,7 +4274,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4198
4274
  compilerManifest,
4199
4275
  ...input.input ? { input: input.input } : {},
4200
4276
  ...input.inputFile ? { inputFile: input.inputFile } : {},
4201
- ..._optionalChain([input, 'access', _184 => _184.packagedFiles, 'optionalAccess', _185 => _185.length]) ? { packagedFiles: input.packagedFiles } : {},
4277
+ ..._optionalChain([input, 'access', _198 => _198.packagedFiles, 'optionalAccess', _199 => _199.length]) ? { packagedFiles: input.packagedFiles } : {},
4202
4278
  ...input.force ? { force: true } : {},
4203
4279
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
4204
4280
  });
@@ -4228,29 +4304,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
4228
4304
  * ```
4229
4305
  */
4230
4306
  async submitPlay(code, csvPath, name, options) {
4231
- const runtimeInput = _optionalChain([options, 'optionalAccess', _186 => _186.input]) ? { ...options.input } : {};
4307
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _200 => _200.input]) ? { ...options.input } : {};
4232
4308
  if (csvPath) {
4233
4309
  runtimeInput.file = csvPath;
4234
4310
  }
4235
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _187 => _187.sourceCode]), () => ( code));
4236
- const artifact = _optionalChain([options, 'optionalAccess', _188 => _188.artifact]);
4237
- if (!_optionalChain([name, 'optionalAccess', _189 => _189.trim, 'call', _190 => _190()])) {
4311
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _201 => _201.sourceCode]), () => ( code));
4312
+ const artifact = _optionalChain([options, 'optionalAccess', _202 => _202.artifact]);
4313
+ if (!_optionalChain([name, 'optionalAccess', _203 => _203.trim, 'call', _204 => _204()])) {
4238
4314
  throw new Error("submitPlay requires a play name.");
4239
4315
  }
4240
4316
  if (!artifact) {
4241
4317
  throw new Error("submitPlay requires a bundled play artifact.");
4242
4318
  }
4243
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _191 => _191.compilerManifest]), async () => ( await this.compilePlayManifest({
4319
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _205 => _205.compilerManifest]), async () => ( await this.compilePlayManifest({
4244
4320
  name,
4245
4321
  sourceCode,
4246
- sourceFiles: _optionalChain([options, 'optionalAccess', _192 => _192.sourceFiles]),
4322
+ sourceFiles: _optionalChain([options, 'optionalAccess', _206 => _206.sourceFiles]),
4247
4323
  artifact
4248
4324
  })));
4249
4325
  const registeredArtifact = await this.registerPlayArtifact({
4250
4326
  name,
4251
4327
  sourceCode,
4252
- sourceFiles: _optionalChain([options, 'optionalAccess', _193 => _193.sourceFiles]),
4253
- description: _optionalChain([options, 'optionalAccess', _194 => _194.description]),
4328
+ sourceFiles: _optionalChain([options, 'optionalAccess', _207 => _207.sourceFiles]),
4329
+ description: _optionalChain([options, 'optionalAccess', _208 => _208.description]),
4254
4330
  artifact,
4255
4331
  compilerManifest,
4256
4332
  publish: false
@@ -4264,17 +4340,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4264
4340
  name,
4265
4341
  artifactStorageKey: registeredArtifact.artifactStorageKey,
4266
4342
  sourceCode,
4267
- description: _optionalChain([options, 'optionalAccess', _195 => _195.description]),
4343
+ description: _optionalChain([options, 'optionalAccess', _209 => _209.description]),
4268
4344
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
4269
4345
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
4270
4346
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
4271
4347
  runtimeArtifact: artifact,
4272
4348
  compilerManifest,
4273
4349
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4274
- ..._optionalChain([options, 'optionalAccess', _196 => _196.inputFile]) ? { inputFile: options.inputFile } : {},
4275
- ..._optionalChain([options, 'optionalAccess', _197 => _197.packagedFiles, 'optionalAccess', _198 => _198.length]) ? { packagedFiles: options.packagedFiles } : {},
4276
- ..._optionalChain([options, 'optionalAccess', _199 => _199.force]) ? { force: true } : {},
4277
- ..._optionalChain([options, 'optionalAccess', _200 => _200.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4350
+ ..._optionalChain([options, 'optionalAccess', _210 => _210.inputFile]) ? { inputFile: options.inputFile } : {},
4351
+ ..._optionalChain([options, 'optionalAccess', _211 => _211.packagedFiles, 'optionalAccess', _212 => _212.length]) ? { packagedFiles: options.packagedFiles } : {},
4352
+ ..._optionalChain([options, 'optionalAccess', _213 => _213.force]) ? { force: true } : {},
4353
+ ..._optionalChain([options, 'optionalAccess', _214 => _214.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4278
4354
  });
4279
4355
  }
4280
4356
  /**
@@ -4302,7 +4378,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4302
4378
  * ```
4303
4379
  */
4304
4380
  async stagePlayFiles(files) {
4305
- return _chunkGVAENVIGjs.stagePlayFiles.call(void 0, this.http, files);
4381
+ return _chunkAUQQVDABjs.stagePlayFiles.call(void 0, this.http, files);
4306
4382
  }
4307
4383
  /**
4308
4384
  * Mint short-lived presigned upload targets for staged play files.
@@ -4311,7 +4387,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4311
4387
  * For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
4312
4388
  */
4313
4389
  async mintStagedPlayFileUploads(files) {
4314
- return _chunkGVAENVIGjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4390
+ return _chunkAUQQVDABjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4315
4391
  }
4316
4392
  /**
4317
4393
  * Resolve staged play files by content hash without uploading bytes.
@@ -4350,13 +4426,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4350
4426
  for await (const event of watchRunEvents({
4351
4427
  http: this.http,
4352
4428
  runId: workflowId,
4353
- signal: _optionalChain([options, 'optionalAccess', _201 => _201.signal]),
4354
- onNotice: _optionalChain([options, 'optionalAccess', _202 => _202.onNotice]),
4355
- onRetry: _optionalChain([options, 'optionalAccess', _203 => _203.onRetry]),
4356
- deferLogs: _optionalChain([options, 'optionalAccess', _204 => _204.deferLogs]),
4357
- omitTerminalLogs: _optionalChain([options, 'optionalAccess', _205 => _205.omitTerminalLogs]),
4358
- onPoll: _optionalChain([options, 'optionalAccess', _206 => _206.onPoll]),
4359
- ..._optionalChain([options, 'optionalAccess', _207 => _207.terminalStatus]) ? {
4429
+ signal: _optionalChain([options, 'optionalAccess', _215 => _215.signal]),
4430
+ onNotice: _optionalChain([options, 'optionalAccess', _216 => _216.onNotice]),
4431
+ onRetry: _optionalChain([options, 'optionalAccess', _217 => _217.onRetry]),
4432
+ deferLogs: _optionalChain([options, 'optionalAccess', _218 => _218.deferLogs]),
4433
+ omitTerminalLogs: _optionalChain([options, 'optionalAccess', _219 => _219.omitTerminalLogs]),
4434
+ onPoll: _optionalChain([options, 'optionalAccess', _220 => _220.onPoll]),
4435
+ ..._optionalChain([options, 'optionalAccess', _221 => _221.terminalStatus]) ? {
4360
4436
  terminalStatus: {
4361
4437
  ...options.terminalStatus,
4362
4438
  onStatus: async (raw, expectedStatus) => {
@@ -4366,7 +4442,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4366
4442
  `Run watch returned a mismatched terminal status for ${workflowId}.`
4367
4443
  );
4368
4444
  }
4369
- await _optionalChain([options, 'access', _208 => _208.terminalStatus, 'optionalAccess', _209 => _209.onStatus, 'call', _210 => _210(status)]);
4445
+ await _optionalChain([options, 'access', _222 => _222.terminalStatus, 'optionalAccess', _223 => _223.onStatus, 'call', _224 => _224(status)]);
4370
4446
  }
4371
4447
  }
4372
4448
  } : {}
@@ -4381,12 +4457,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4381
4457
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4382
4458
  */
4383
4459
  async *streamPlayRunEvents(workflowId, options) {
4384
- const headers = _optionalChain([options, 'optionalAccess', _211 => _211.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4460
+ const headers = _optionalChain([options, 'optionalAccess', _225 => _225.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4385
4461
  const params = new URLSearchParams();
4386
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.mode]), () => ( "cli")));
4462
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _226 => _226.mode]), () => ( "cli")));
4387
4463
  for await (const event of this.http.streamSse(
4388
4464
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4389
- { signal: _optionalChain([options, 'optionalAccess', _213 => _213.signal]), headers }
4465
+ { signal: _optionalChain([options, 'optionalAccess', _227 => _227.signal]), headers }
4390
4466
  )) {
4391
4467
  if (event.scope === "play") {
4392
4468
  yield event;
@@ -4402,8 +4478,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4402
4478
  */
4403
4479
  async *observeRunEvents(runId, options) {
4404
4480
  yield* this.watchRunEvents(runId, {
4405
- signal: _optionalChain([options, 'optionalAccess', _214 => _214.signal]),
4406
- onNotice: _optionalChain([options, 'optionalAccess', _215 => _215.onNotice])
4481
+ signal: _optionalChain([options, 'optionalAccess', _228 => _228.signal]),
4482
+ onNotice: _optionalChain([options, 'optionalAccess', _229 => _229.onNotice])
4407
4483
  });
4408
4484
  }
4409
4485
  /** Poll snapshots to terminal status and return the durable package. */
@@ -4411,9 +4487,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4411
4487
  let terminalObserved = false;
4412
4488
  let terminalStatus = null;
4413
4489
  for await (const event of this.watchRunEvents(runId, {
4414
- signal: _optionalChain([options, 'optionalAccess', _216 => _216.signal]),
4415
- onNotice: _optionalChain([options, 'optionalAccess', _217 => _217.onNotice]),
4416
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _218 => _218.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _219 => _219.onReconnect]))),
4490
+ signal: _optionalChain([options, 'optionalAccess', _230 => _230.signal]),
4491
+ onNotice: _optionalChain([options, 'optionalAccess', _231 => _231.onNotice]),
4492
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _232 => _232.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _233 => _233.onReconnect]))),
4417
4493
  terminalStatus: {
4418
4494
  runStatus: true,
4419
4495
  onStatus: (status) => {
@@ -4421,16 +4497,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4421
4497
  }
4422
4498
  }
4423
4499
  })) {
4424
- _optionalChain([options, 'optionalAccess', _220 => _220.onEvent, 'optionalCall', _221 => _221(event)]);
4425
- if (_chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4500
+ _optionalChain([options, 'optionalAccess', _234 => _234.onEvent, 'optionalCall', _235 => _235(event)]);
4501
+ if (_chunkAUQQVDABjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4426
4502
  terminalObserved = true;
4427
4503
  }
4428
4504
  }
4429
- if (_optionalChain([options, 'optionalAccess', _222 => _222.signal, 'optionalAccess', _223 => _223.aborted])) {
4505
+ if (_optionalChain([options, 'optionalAccess', _236 => _236.signal, 'optionalAccess', _237 => _237.aborted])) {
4430
4506
  throw new (0, _chunkDIAWYWT5js.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4431
4507
  }
4432
4508
  const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
4433
- if (terminalObserved || _chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4509
+ if (terminalObserved || _chunkAUQQVDABjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4434
4510
  return refreshed;
4435
4511
  }
4436
4512
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
@@ -4506,7 +4582,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4506
4582
  /** List the org's workflows. `GET /api/v2/workflows`. */
4507
4583
  async listWorkflows(options) {
4508
4584
  const params = new URLSearchParams();
4509
- if (typeof _optionalChain([options, 'optionalAccess', _224 => _224.limit]) === "number") {
4585
+ if (typeof _optionalChain([options, 'optionalAccess', _238 => _238.limit]) === "number") {
4510
4586
  params.set("limit", String(options.limit));
4511
4587
  }
4512
4588
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4559,7 +4635,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4559
4635
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4560
4636
  async listWorkflowRuns(id, options) {
4561
4637
  const params = new URLSearchParams();
4562
- if (typeof _optionalChain([options, 'optionalAccess', _225 => _225.limit]) === "number") {
4638
+ if (typeof _optionalChain([options, 'optionalAccess', _239 => _239.limit]) === "number") {
4563
4639
  params.set("limit", String(options.limit));
4564
4640
  }
4565
4641
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4595,10 +4671,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4595
4671
  */
4596
4672
  async getRunStatus(runId, options) {
4597
4673
  const params = new URLSearchParams();
4598
- if (_optionalChain([options, 'optionalAccess', _226 => _226.full]) === true) {
4674
+ if (_optionalChain([options, 'optionalAccess', _240 => _240.full]) === true) {
4599
4675
  params.set("full", "true");
4600
4676
  }
4601
- if (_optionalChain([options, 'optionalAccess', _227 => _227.configuration]) === true) {
4677
+ if (_optionalChain([options, 'optionalAccess', _241 => _241.configuration]) === true) {
4602
4678
  params.set("include", "configuration");
4603
4679
  }
4604
4680
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4606,7 +4682,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4606
4682
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4607
4683
  { headers: { "x-deepline-run-status": "1" } }
4608
4684
  );
4609
- if (_optionalChain([options, 'optionalAccess', _228 => _228.configuration]) === true && !Object.hasOwn(response, "contract")) {
4685
+ if (_optionalChain([options, 'optionalAccess', _242 => _242.configuration]) === true && !Object.hasOwn(response, "contract")) {
4610
4686
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4611
4687
  "This server does not support recorded configuration reads.",
4612
4688
  void 0,
@@ -4614,7 +4690,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4614
4690
  );
4615
4691
  }
4616
4692
  const status = normalizePlayStatus(response);
4617
- if (_optionalChain([options, 'optionalAccess', _229 => _229.failedLogs]) !== true || status.status !== "failed") {
4693
+ if (_optionalChain([options, 'optionalAccess', _243 => _243.failedLogs]) !== true || status.status !== "failed") {
4618
4694
  return status;
4619
4695
  }
4620
4696
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4703,7 +4779,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4703
4779
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4704
4780
  async getRunsHistory(options = {}) {
4705
4781
  const params = new URLSearchParams();
4706
- const search = _optionalChain([options, 'access', _230 => _230.search, 'optionalAccess', _231 => _231.trim, 'call', _232 => _232()]);
4782
+ const search = _optionalChain([options, 'access', _244 => _244.search, 'optionalAccess', _245 => _245.trim, 'call', _246 => _246()]);
4707
4783
  if (search && search.length > 200) {
4708
4784
  throw new Error("Run search must be at most 200 characters.");
4709
4785
  }
@@ -4729,16 +4805,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4729
4805
  }
4730
4806
  /** Read one run page without discarding server pagination metadata. */
4731
4807
  async listRunsPage(options) {
4732
- const playName = _optionalChain([options, 'access', _233 => _233.play, 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
4808
+ const playName = _optionalChain([options, 'access', _247 => _247.play, 'optionalAccess', _248 => _248.trim, 'call', _249 => _249()]);
4733
4809
  const params = new URLSearchParams();
4734
4810
  if (playName) {
4735
4811
  params.set("play", playName);
4736
4812
  }
4737
- const status = _optionalChain([options, 'access', _236 => _236.status, 'optionalAccess', _237 => _237.trim, 'call', _238 => _238()]);
4813
+ const status = _optionalChain([options, 'access', _250 => _250.status, 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]);
4738
4814
  if (status) {
4739
4815
  params.set("status", status);
4740
4816
  }
4741
- const node = _optionalChain([options, 'access', _239 => _239.node, 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
4817
+ const node = _optionalChain([options, 'access', _253 => _253.node, 'optionalAccess', _254 => _254.trim, 'call', _255 => _255()]);
4742
4818
  if (node) {
4743
4819
  if (!playName)
4744
4820
  throw new Error("runs.list options.node requires options.play.");
@@ -4812,8 +4888,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4812
4888
  * A different key starts another rerun.
4813
4889
  */
4814
4890
  async rerun(runId, options) {
4815
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _242 => _242.idempotencyKey, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]);
4816
- if (_optionalChain([options, 'optionalAccess', _245 => _245.idempotencyKey]) !== void 0 && !idempotencyKey) {
4891
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _256 => _256.idempotencyKey, 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()]);
4892
+ if (_optionalChain([options, 'optionalAccess', _259 => _259.idempotencyKey]) !== void 0 && !idempotencyKey) {
4817
4893
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4818
4894
  "runs.rerun idempotencyKey must not be empty.",
4819
4895
  void 0,
@@ -4822,7 +4898,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4822
4898
  }
4823
4899
  return this.http.post(
4824
4900
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
4825
- _optionalChain([options, 'optionalAccess', _246 => _246.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4901
+ _optionalChain([options, 'optionalAccess', _260 => _260.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
4826
4902
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
4827
4903
  );
4828
4904
  }
@@ -4836,21 +4912,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
4836
4912
  * ```
4837
4913
  */
4838
4914
  async getRunLogs(runId, options) {
4839
- if (_optionalChain([options, 'optionalAccess', _247 => _247.all]) === true && options.failed === true) {
4915
+ if (_optionalChain([options, 'optionalAccess', _261 => _261.all]) === true && options.failed === true) {
4840
4916
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4841
4917
  "runs.logs cannot combine all and failed views.",
4842
4918
  void 0,
4843
4919
  "INVALID_RUN_LOG_VIEW"
4844
4920
  );
4845
4921
  }
4846
- if (_optionalChain([options, 'optionalAccess', _248 => _248.cursor]) !== void 0 && options.failed === true) {
4922
+ if (_optionalChain([options, 'optionalAccess', _262 => _262.cursor]) !== void 0 && options.failed === true) {
4847
4923
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
4848
4924
  "runs.logs cannot combine failed with cursor.",
4849
4925
  void 0,
4850
4926
  "INVALID_RUN_LOG_VIEW"
4851
4927
  );
4852
4928
  }
4853
- if (_optionalChain([options, 'optionalAccess', _249 => _249.failed]) === true) {
4929
+ if (_optionalChain([options, 'optionalAccess', _263 => _263.failed]) === true) {
4854
4930
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
4855
4931
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
4856
4932
  const page = await this.http.get(
@@ -4875,18 +4951,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
4875
4951
  ...page.logsTruncated ? { logsTruncated: true } : {}
4876
4952
  };
4877
4953
  }
4878
- const beforeSequence = _optionalChain([options, 'optionalAccess', _250 => _250.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4879
- const limit = _optionalChain([options, 'optionalAccess', _251 => _251.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _252 => _252.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4954
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _264 => _264.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
4955
+ const limit = _optionalChain([options, 'optionalAccess', _265 => _265.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _266 => _266.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
4880
4956
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
4881
4957
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
4882
4958
  { retryApiErrors: true }
4883
4959
  );
4884
4960
  const probe = await fetchPage(0, 1);
4885
4961
  const lastStoredSeq = probe.lastStoredSeq;
4886
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _253 => _253.entries, 'access', _254 => _254[0], 'optionalAccess', _255 => _255.seq]), () => ( null));
4962
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _267 => _267.entries, 'access', _268 => _268[0], 'optionalAccess', _269 => _269.seq]), () => ( null));
4887
4963
  const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
4888
4964
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
4889
- let afterSeq = _optionalChain([options, 'optionalAccess', _256 => _256.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4965
+ let afterSeq = _optionalChain([options, 'optionalAccess', _270 => _270.all]) ? 0 : Math.max(0, windowEndSeq - limit);
4890
4966
  const entries = [];
4891
4967
  while (entries.length < limit && afterSeq < upperSeq) {
4892
4968
  const page = await fetchPage(
@@ -4920,7 +4996,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4920
4996
  hasMore: olderLinesExist,
4921
4997
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
4922
4998
  entries: entries.map((entry) => entry.line),
4923
- view: _optionalChain([options, 'optionalAccess', _257 => _257.all]) ? "all" : "tail",
4999
+ view: _optionalChain([options, 'optionalAccess', _271 => _271.all]) ? "all" : "tail",
4924
5000
  ...probe.logsTruncated ? { logsTruncated: true } : {}
4925
5001
  };
4926
5002
  }
@@ -5096,7 +5172,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5096
5172
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
5097
5173
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
5098
5174
  });
5099
- if (_optionalChain([input, 'access', _258 => _258.runId, 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()])) {
5175
+ if (_optionalChain([input, 'access', _272 => _272.runId, 'optionalAccess', _273 => _273.trim, 'call', _274 => _274()])) {
5100
5176
  params.set("runId", input.runId.trim());
5101
5177
  }
5102
5178
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -5109,9 +5185,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5109
5185
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
5110
5186
  { signal: input.signal }
5111
5187
  );
5112
- const requestedRunId = _optionalChain([input, 'access', _261 => _261.runId, 'optionalAccess', _262 => _262.trim, 'call', _263 => _263()]) || "";
5188
+ const requestedRunId = _optionalChain([input, 'access', _275 => _275.runId, 'optionalAccess', _276 => _276.trim, 'call', _277 => _277()]) || "";
5113
5189
  if (requestedRunId) {
5114
- const confirmedRunId = _optionalChain([result, 'access', _264 => _264.scope, 'optionalAccess', _265 => _265.kind]) === "run" ? result.scope.runId.trim() : "";
5190
+ const confirmedRunId = _optionalChain([result, 'access', _278 => _278.scope, 'optionalAccess', _279 => _279.kind]) === "run" ? result.scope.runId.trim() : "";
5115
5191
  const foreignRowRunIds = [
5116
5192
  ...new Set(
5117
5193
  result.rows.map(
@@ -5119,7 +5195,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5119
5195
  ).filter((runId) => runId && runId !== requestedRunId)
5120
5196
  )
5121
5197
  ];
5122
- if (_optionalChain([result, 'access', _266 => _266.scope, 'optionalAccess', _267 => _267.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5198
+ if (_optionalChain([result, 'access', _280 => _280.scope, 'optionalAccess', _281 => _281.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5123
5199
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
5124
5200
  `Run-scoped dataset export was not confirmed for ${requestedRunId}; no rows were returned to the caller. Update Deepline, then retry the same export command. Do not rerun the play.`,
5125
5201
  void 0,
@@ -5148,7 +5224,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5148
5224
  async stopRun(runId, options) {
5149
5225
  return this.http.post(
5150
5226
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
5151
- _optionalChain([options, 'optionalAccess', _268 => _268.reason]) ? { reason: options.reason } : {}
5227
+ _optionalChain([options, 'optionalAccess', _282 => _282.reason]) ? { reason: options.reason } : {}
5152
5228
  );
5153
5229
  }
5154
5230
  /**
@@ -5166,11 +5242,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5166
5242
  * The method clears workspace run-slot state without requiring each run ID.
5167
5243
  */
5168
5244
  async stopAllRuns(options) {
5169
- const dryRun = _optionalChain([options, 'optionalAccess', _269 => _269.dryRun]) === true;
5245
+ const dryRun = _optionalChain([options, 'optionalAccess', _283 => _283.dryRun]) === true;
5170
5246
  const result = await this.http.post(
5171
5247
  "/api/v2/runs/stop-all",
5172
5248
  {
5173
- ..._optionalChain([options, 'optionalAccess', _270 => _270.reason]) ? { reason: options.reason } : {},
5249
+ ..._optionalChain([options, 'optionalAccess', _284 => _284.reason]) ? { reason: options.reason } : {},
5174
5250
  ...dryRun ? { dryRun: true } : {}
5175
5251
  }
5176
5252
  );
@@ -5191,7 +5267,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5191
5267
  * `origin: "owned"` for org-owned plays.
5192
5268
  */
5193
5269
  async listPlays(options) {
5194
- if (!_optionalChain([options, 'optionalAccess', _271 => _271.grep, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()])) {
5270
+ if (!_optionalChain([options, 'optionalAccess', _285 => _285.grep, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
5195
5271
  return (await this.requestPlaysPage(options, false)).plays;
5196
5272
  }
5197
5273
  const plays = [];
@@ -5213,46 +5289,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
5213
5289
  }
5214
5290
  async requestPlaysPage(options, paginateInventory = true) {
5215
5291
  const params = new URLSearchParams();
5216
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _274 => _274.grep, 'optionalAccess', _275 => _275.trim, 'call', _276 => _276()]))
5292
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _288 => _288.grep, 'optionalAccess', _289 => _289.trim, 'call', _290 => _290()]))
5217
5293
  params.set("inventory_paginated", "1");
5218
- if (_optionalChain([options, 'optionalAccess', _277 => _277.origin])) params.set("origin", options.origin);
5219
- if (_optionalChain([options, 'optionalAccess', _278 => _278.summaryOnly])) params.set("summary_only", "1");
5220
- if (_optionalChain([options, 'optionalAccess', _279 => _279.categories])) {
5294
+ if (_optionalChain([options, 'optionalAccess', _291 => _291.origin])) params.set("origin", options.origin);
5295
+ if (_optionalChain([options, 'optionalAccess', _292 => _292.summaryOnly])) params.set("summary_only", "1");
5296
+ if (_optionalChain([options, 'optionalAccess', _293 => _293.categories])) {
5221
5297
  params.set(
5222
5298
  "categories",
5223
5299
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5224
5300
  );
5225
5301
  }
5226
- if (_optionalChain([options, 'optionalAccess', _280 => _280.categories]) || _optionalChain([options, 'optionalAccess', _281 => _281.includeToolCategories])) {
5302
+ if (_optionalChain([options, 'optionalAccess', _294 => _294.categories]) || _optionalChain([options, 'optionalAccess', _295 => _295.includeToolCategories])) {
5227
5303
  params.set("include_tool_categories", "1");
5228
5304
  }
5229
- if (_optionalChain([options, 'optionalAccess', _282 => _282.tags])) {
5305
+ if (_optionalChain([options, 'optionalAccess', _296 => _296.tags])) {
5230
5306
  params.set(
5231
5307
  "tags",
5232
5308
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
5233
5309
  );
5234
5310
  }
5235
- if (_optionalChain([options, 'optionalAccess', _283 => _283.includeArchived])) params.set("include_archived", "1");
5236
- if (_optionalChain([options, 'optionalAccess', _284 => _284.includeCostEstimates])) {
5311
+ if (_optionalChain([options, 'optionalAccess', _297 => _297.includeArchived])) params.set("include_archived", "1");
5312
+ if (_optionalChain([options, 'optionalAccess', _298 => _298.includeCostEstimates])) {
5237
5313
  params.set("include_cost_estimates", "1");
5238
5314
  }
5239
- if (_optionalChain([options, 'optionalAccess', _285 => _285.grep, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
5315
+ if (_optionalChain([options, 'optionalAccess', _299 => _299.grep, 'optionalAccess', _300 => _300.trim, 'call', _301 => _301()])) {
5240
5316
  params.set("grep", options.grep.trim());
5241
5317
  params.set("limit", "60");
5242
5318
  }
5243
- if (_optionalChain([options, 'optionalAccess', _288 => _288.limit]) !== void 0) {
5319
+ if (_optionalChain([options, 'optionalAccess', _302 => _302.limit]) !== void 0) {
5244
5320
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
5245
5321
  throw new Error("Play page limit must be a positive integer");
5246
5322
  }
5247
5323
  params.set("limit", String(options.limit));
5248
5324
  }
5249
- if (_optionalChain([options, 'optionalAccess', _289 => _289.cursor])) params.set("cursor", options.cursor);
5325
+ if (_optionalChain([options, 'optionalAccess', _303 => _303.cursor])) params.set("cursor", options.cursor);
5250
5326
  const suffix = params.size ? `?${params.toString()}` : "";
5251
5327
  const response = await this.http.get(`/api/v2/plays${suffix}`);
5252
5328
  return {
5253
5329
  plays: _nullishCoalesce(response.plays, () => ( [])),
5254
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _290 => _290.pagination, 'optionalAccess', _291 => _291.cursor]), () => ( response.cursor)), () => ( null)),
5255
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _292 => _292.pagination, 'optionalAccess', _293 => _293.hasMore]), () => ( response.hasMore)))
5330
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _304 => _304.pagination, 'optionalAccess', _305 => _305.cursor]), () => ( response.cursor)), () => ( null)),
5331
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _306 => _306.pagination, 'optionalAccess', _307 => _307.hasMore]), () => ( response.hasMore)))
5256
5332
  };
5257
5333
  }
5258
5334
  /** Read definition-level settings, independently of code revisions. */
@@ -5306,7 +5382,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5306
5382
  }
5307
5383
  /** Start provider OAuth and return the URL to open in a browser. */
5308
5384
  async startIntegrationOAuth(provider, options = {}) {
5309
- const scopes = _optionalChain([options, 'access', _294 => _294.scopes, 'optionalAccess', _295 => _295.map, 'call', _296 => _296((scope) => scope.trim()), 'access', _297 => _297.filter, 'call', _298 => _298(Boolean)]);
5385
+ const scopes = _optionalChain([options, 'access', _308 => _308.scopes, 'optionalAccess', _309 => _309.map, 'call', _310 => _310((scope) => scope.trim()), 'access', _311 => _311.filter, 'call', _312 => _312(Boolean)]);
5310
5386
  if (scopes !== void 0 && scopes.length === 0) {
5311
5387
  throw new Error("scopes must contain at least one OAuth scope.");
5312
5388
  }
@@ -5322,8 +5398,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5322
5398
  return this.http.post("/api/v2/integrations/connect", {
5323
5399
  provider: "slack",
5324
5400
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5325
- ..._optionalChain([options, 'optionalAccess', _299 => _299.successUrl]) ? { success_url: options.successUrl } : {},
5326
- ..._optionalChain([options, 'optionalAccess', _300 => _300.failureUrl]) ? { failure_url: options.failureUrl } : {}
5401
+ ..._optionalChain([options, 'optionalAccess', _313 => _313.successUrl]) ? { success_url: options.successUrl } : {},
5402
+ ..._optionalChain([options, 'optionalAccess', _314 => _314.failureUrl]) ? { failure_url: options.failureUrl } : {}
5327
5403
  });
5328
5404
  }
5329
5405
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5398,7 +5474,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5398
5474
  }
5399
5475
  const targets = input.targets.map(parseNotificationGroupTarget);
5400
5476
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5401
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _301 => _301[0], 'optionalAccess', _302 => _302.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5477
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _315 => _315[0], 'optionalAccess', _316 => _316.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5402
5478
  if (legacyEvents.length > 0 && !legacyTarget) {
5403
5479
  throw new Error(
5404
5480
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5434,7 +5510,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5434
5510
  const existingGroup = current.configuration.groups.find(
5435
5511
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5436
5512
  );
5437
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _303 => _303.groupKey]), () => ( notificationObjectKey("group")));
5513
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _317 => _317.groupKey]), () => ( notificationObjectKey("group")));
5438
5514
  const group = _nullishCoalesce(existingGroup, () => ( {
5439
5515
  groupKey,
5440
5516
  name,
@@ -5662,7 +5738,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5662
5738
  /** Read one trigger inventory page without loading run histories. */
5663
5739
  async listPlayTriggerInventory(options) {
5664
5740
  const params = new URLSearchParams({ view: "inventory" });
5665
- if (_optionalChain([options, 'optionalAccess', _304 => _304.cursor])) params.set("cursor", options.cursor);
5741
+ if (_optionalChain([options, 'optionalAccess', _318 => _318.cursor])) params.set("cursor", options.cursor);
5666
5742
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5667
5743
  }
5668
5744
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5671,7 +5747,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5671
5747
  view: "history",
5672
5748
  binding_id: bindingId
5673
5749
  });
5674
- if (_optionalChain([options, 'optionalAccess', _305 => _305.limit]) !== void 0)
5750
+ if (_optionalChain([options, 'optionalAccess', _319 => _319.limit]) !== void 0)
5675
5751
  params.set("history_limit", String(options.limit));
5676
5752
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5677
5753
  }
@@ -5859,14 +5935,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
5859
5935
  */
5860
5936
  async runPlay(code, csvPath, name, options) {
5861
5937
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
5862
- input: _optionalChain([options, 'optionalAccess', _306 => _306.input]),
5863
- sourceCode: _optionalChain([options, 'optionalAccess', _307 => _307.sourceCode]),
5864
- artifact: _optionalChain([options, 'optionalAccess', _308 => _308.artifact]),
5865
- compilerManifest: _optionalChain([options, 'optionalAccess', _309 => _309.compilerManifest]),
5866
- inputFile: _optionalChain([options, 'optionalAccess', _310 => _310.inputFile]),
5867
- packagedFiles: _optionalChain([options, 'optionalAccess', _311 => _311.packagedFiles]),
5868
- force: _optionalChain([options, 'optionalAccess', _312 => _312.force]),
5869
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _313 => _313.forceToolRefresh])
5938
+ input: _optionalChain([options, 'optionalAccess', _320 => _320.input]),
5939
+ sourceCode: _optionalChain([options, 'optionalAccess', _321 => _321.sourceCode]),
5940
+ artifact: _optionalChain([options, 'optionalAccess', _322 => _322.artifact]),
5941
+ compilerManifest: _optionalChain([options, 'optionalAccess', _323 => _323.compilerManifest]),
5942
+ inputFile: _optionalChain([options, 'optionalAccess', _324 => _324.inputFile]),
5943
+ packagedFiles: _optionalChain([options, 'optionalAccess', _325 => _325.packagedFiles]),
5944
+ force: _optionalChain([options, 'optionalAccess', _326 => _326.force]),
5945
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _327 => _327.forceToolRefresh])
5870
5946
  });
5871
5947
  const start = Date.now();
5872
5948
  const state = {
@@ -5877,7 +5953,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5877
5953
  latest: null
5878
5954
  };
5879
5955
  let terminalObserved = null;
5880
- if (_optionalChain([options, 'optionalAccess', _314 => _314.signal, 'optionalAccess', _315 => _315.aborted])) {
5956
+ if (_optionalChain([options, 'optionalAccess', _328 => _328.signal, 'optionalAccess', _329 => _329.aborted])) {
5881
5957
  await this.cancelPlay(workflowId);
5882
5958
  return {
5883
5959
  success: false,
@@ -5888,9 +5964,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5888
5964
  };
5889
5965
  }
5890
5966
  for await (const event of this.watchRunEvents(workflowId, {
5891
- signal: _optionalChain([options, 'optionalAccess', _316 => _316.signal])
5967
+ signal: _optionalChain([options, 'optionalAccess', _330 => _330.signal])
5892
5968
  })) {
5893
- if (_optionalChain([options, 'optionalAccess', _317 => _317.signal, 'optionalAccess', _318 => _318.aborted])) {
5969
+ if (_optionalChain([options, 'optionalAccess', _331 => _331.signal, 'optionalAccess', _332 => _332.aborted])) {
5894
5970
  await this.cancelPlay(workflowId);
5895
5971
  return {
5896
5972
  success: false,
@@ -5900,19 +5976,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
5900
5976
  error: "Cancelled by user"
5901
5977
  };
5902
5978
  }
5903
- const previousStatus = _optionalChain([state, 'access', _319 => _319.latest, 'optionalAccess', _320 => _320.status]);
5979
+ const previousStatus = _optionalChain([state, 'access', _333 => _333.latest, 'optionalAccess', _334 => _334.status]);
5904
5980
  const status = updatePlayLiveStatusState(state, event);
5905
5981
  if (!status) {
5906
5982
  continue;
5907
5983
  }
5908
5984
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
5909
- _optionalChain([options, 'optionalAccess', _321 => _321.onProgress, 'optionalCall', _322 => _322(status)]);
5985
+ _optionalChain([options, 'optionalAccess', _335 => _335.onProgress, 'optionalCall', _336 => _336(status)]);
5910
5986
  }
5911
- if (_chunkGVAENVIGjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
5987
+ if (_chunkAUQQVDABjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
5912
5988
  terminalObserved = status;
5913
5989
  }
5914
5990
  }
5915
- if (_optionalChain([options, 'optionalAccess', _323 => _323.signal, 'optionalAccess', _324 => _324.aborted])) {
5991
+ if (_optionalChain([options, 'optionalAccess', _337 => _337.signal, 'optionalAccess', _338 => _338.aborted])) {
5916
5992
  await this.cancelPlay(workflowId);
5917
5993
  return {
5918
5994
  success: false,
@@ -5965,7 +6041,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5965
6041
  const response = await this.http.get(
5966
6042
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
5967
6043
  );
5968
- const event = _optionalChain([response, 'access', _325 => _325.entries, 'optionalAccess', _326 => _326[0]]);
6044
+ const event = _optionalChain([response, 'access', _339 => _339.entries, 'optionalAccess', _340 => _340[0]]);
5969
6045
  if (!event) {
5970
6046
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
5971
6047
  "No usage event was found for this request_id.",
@@ -6140,7 +6216,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6140
6216
  async cancelBillingSubscription(options) {
6141
6217
  return this.http.post(
6142
6218
  "/api/v2/billing/subscription/cancel",
6143
- { action: _optionalChain([options, 'optionalAccess', _327 => _327.undo]) ? "undo_cancel" : "cancel" }
6219
+ { action: _optionalChain([options, 'optionalAccess', _341 => _341.undo]) ? "undo_cancel" : "cancel" }
6144
6220
  );
6145
6221
  }
6146
6222
  /**
@@ -6152,7 +6228,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6152
6228
  */
6153
6229
  async listBillingInvoices(options) {
6154
6230
  const params = new URLSearchParams();
6155
- if (_optionalChain([options, 'optionalAccess', _328 => _328.limit]) !== void 0) {
6231
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.limit]) !== void 0) {
6156
6232
  params.set("limit", String(options.limit));
6157
6233
  }
6158
6234
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -6262,7 +6338,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6262
6338
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6263
6339
  async createTargetBillingPortalSession(options) {
6264
6340
  const response = await this.http.post(
6265
- _optionalChain([options, 'optionalAccess', _329 => _329.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6341
+ _optionalChain([options, 'optionalAccess', _343 => _343.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6266
6342
  {}
6267
6343
  );
6268
6344
  return response.data;
@@ -6312,8 +6388,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6312
6388
  return this.http.request("/api/v2/monitors/audit", {
6313
6389
  method: "POST",
6314
6390
  body: {
6315
- ..._optionalChain([options, 'optionalAccess', _330 => _330.fleetId]) ? { fleet_id: options.fleetId } : {},
6316
- ..._optionalChain([options, 'optionalAccess', _331 => _331.cursor]) ? { cursor: options.cursor } : {}
6391
+ ..._optionalChain([options, 'optionalAccess', _344 => _344.fleetId]) ? { fleet_id: options.fleetId } : {},
6392
+ ..._optionalChain([options, 'optionalAccess', _345 => _345.cursor]) ? { cursor: options.cursor } : {}
6317
6393
  },
6318
6394
  maxRetries: 0
6319
6395
  });
@@ -6323,8 +6399,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6323
6399
  return this.http.request("/api/v2/monitors/repair", {
6324
6400
  method: "POST",
6325
6401
  body: {
6326
- ..._optionalChain([options, 'optionalAccess', _332 => _332.fleetId]) ? { fleet_id: options.fleetId } : {},
6327
- ..._optionalChain([options, 'optionalAccess', _333 => _333.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6402
+ ..._optionalChain([options, 'optionalAccess', _346 => _346.fleetId]) ? { fleet_id: options.fleetId } : {},
6403
+ ..._optionalChain([options, 'optionalAccess', _347 => _347.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6328
6404
  },
6329
6405
  maxRetries: 0
6330
6406
  });
@@ -6332,7 +6408,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6332
6408
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6333
6409
  async readMonitorsHealth(options) {
6334
6410
  const params = new URLSearchParams();
6335
- if (_optionalChain([options, 'optionalAccess', _334 => _334.fleetId])) params.set("fleet_id", options.fleetId);
6411
+ if (_optionalChain([options, 'optionalAccess', _348 => _348.fleetId])) params.set("fleet_id", options.fleetId);
6336
6412
  const query = params.toString();
6337
6413
  const suffix = query ? `?${query}` : "";
6338
6414
  return this.http.request(
@@ -6405,7 +6481,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6405
6481
  );
6406
6482
  }
6407
6483
  const params = new URLSearchParams();
6408
- if (_optionalChain([options, 'optionalAccess', _335 => _335.cursor])) params.set("cursor", options.cursor);
6484
+ if (_optionalChain([options, 'optionalAccess', _349 => _349.cursor])) params.set("cursor", options.cursor);
6409
6485
  const suffix = params.size > 0 ? `?${params}` : "";
6410
6486
  return this.http.request(
6411
6487
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6452,7 +6528,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6452
6528
  * a second charge. The submission is never replayed automatically.
6453
6529
  */
6454
6530
  async previewMonitor(definition, options) {
6455
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _336 => _336.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _337 => _337.crypto, 'optionalAccess', _338 => _338.randomUUID, 'optionalCall', _339 => _339()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6531
+ const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _350 => _350.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _351 => _351.crypto, 'optionalAccess', _352 => _352.randomUUID, 'optionalCall', _353 => _353()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6456
6532
  try {
6457
6533
  const result = await this.http.request(
6458
6534
  "/api/v2/monitors/preview",
@@ -6460,7 +6536,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6460
6536
  method: "POST",
6461
6537
  body: {
6462
6538
  ...definition,
6463
- ..._optionalChain([options, 'optionalAccess', _340 => _340.limit]) === void 0 ? {} : { limit: options.limit }
6539
+ ..._optionalChain([options, 'optionalAccess', _354 => _354.limit]) === void 0 ? {} : { limit: options.limit }
6464
6540
  },
6465
6541
  headers: { "Idempotency-Key": idempotencyKey },
6466
6542
  maxRetries: 0,
@@ -6482,7 +6558,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6482
6558
  * `client.monitors.deploy(...)`.
6483
6559
  */
6484
6560
  async deployMonitor(definition, options) {
6485
- if (_optionalChain([options, 'optionalAccess', _341 => _341.dryRun])) {
6561
+ if (_optionalChain([options, 'optionalAccess', _355 => _355.dryRun])) {
6486
6562
  return this.http.request("/api/v2/monitors/check", {
6487
6563
  method: "POST",
6488
6564
  body: definition
@@ -6518,12 +6594,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6518
6594
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6519
6595
  async listMonitors(options) {
6520
6596
  const params = new URLSearchParams();
6521
- if (_optionalChain([options, 'optionalAccess', _342 => _342.state])) params.set("state", options.state);
6522
- else if (_optionalChain([options, 'optionalAccess', _343 => _343.status])) params.set("status", options.status);
6523
- if (_optionalChain([options, 'optionalAccess', _344 => _344.limit]) !== void 0)
6597
+ if (_optionalChain([options, 'optionalAccess', _356 => _356.state])) params.set("state", options.state);
6598
+ else if (_optionalChain([options, 'optionalAccess', _357 => _357.status])) params.set("status", options.status);
6599
+ if (_optionalChain([options, 'optionalAccess', _358 => _358.limit]) !== void 0)
6524
6600
  params.set("limit", String(options.limit));
6525
- if (_optionalChain([options, 'optionalAccess', _345 => _345.cursor])) params.set("cursor", options.cursor);
6526
- if (_optionalChain([options, 'optionalAccess', _346 => _346.includeConsumers])) params.set("include_consumers", "true");
6601
+ if (_optionalChain([options, 'optionalAccess', _359 => _359.cursor])) params.set("cursor", options.cursor);
6602
+ if (_optionalChain([options, 'optionalAccess', _360 => _360.includeConsumers])) params.set("include_consumers", "true");
6527
6603
  const query = params.toString();
6528
6604
  const suffix = query ? `?${query}` : "";
6529
6605
  return this.http.request(
@@ -6539,7 +6615,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6539
6615
  );
6540
6616
  }
6541
6617
  async testMonitorWebhook(key, payload, options) {
6542
- if (_optionalChain([options, 'optionalAccess', _347 => _347.dispatch]) === true || _optionalChain([options, 'optionalAccess', _348 => _348.validationOnly]) === false) {
6618
+ if (_optionalChain([options, 'optionalAccess', _361 => _361.dispatch]) === true || _optionalChain([options, 'optionalAccess', _362 => _362.validationOnly]) === false) {
6543
6619
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
6544
6620
  "Monitor tests are validation-only and cannot dispatch events.",
6545
6621
  void 0,
@@ -6594,7 +6670,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6594
6670
  }
6595
6671
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6596
6672
  async deleteMonitor(key, options) {
6597
- if (_optionalChain([options, 'optionalAccess', _349 => _349.localOnly]) === true) {
6673
+ if (_optionalChain([options, 'optionalAccess', _363 => _363.localOnly]) === true) {
6598
6674
  throw new (0, _chunkDIAWYWT5js.DeeplineError)(
6599
6675
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6600
6676
  void 0,
@@ -6602,11 +6678,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6602
6678
  );
6603
6679
  }
6604
6680
  const params = new URLSearchParams();
6605
- if (_optionalChain([options, 'optionalAccess', _350 => _350.dryRun])) params.set("dry_run", "true");
6681
+ if (_optionalChain([options, 'optionalAccess', _364 => _364.dryRun])) params.set("dry_run", "true");
6606
6682
  const query = params.toString();
6607
6683
  return this.http.request(
6608
6684
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6609
- _optionalChain([options, 'optionalAccess', _351 => _351.dryRun]) ? { method: "DELETE" } : {
6685
+ _optionalChain([options, 'optionalAccess', _365 => _365.dryRun]) ? { method: "DELETE" } : {
6610
6686
  method: "DELETE",
6611
6687
  // Deletion is a provider lifecycle operation. A timeout is an
6612
6688
  // unknown outcome, not authority to begin another delete attempt.
@@ -6619,10 +6695,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6619
6695
  * Prefer `client.monitors.reactivate(...)`.
6620
6696
  */
6621
6697
  async reactivateMonitor(key, options) {
6622
- const query = _optionalChain([options, 'optionalAccess', _352 => _352.dryRun]) ? "?dry_run=true" : "";
6698
+ const query = _optionalChain([options, 'optionalAccess', _366 => _366.dryRun]) ? "?dry_run=true" : "";
6623
6699
  return this.http.request(
6624
6700
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6625
- _optionalChain([options, 'optionalAccess', _353 => _353.dryRun]) ? { method: "POST", body: {} } : {
6701
+ _optionalChain([options, 'optionalAccess', _367 => _367.dryRun]) ? { method: "POST", body: {} } : {
6626
6702
  method: "POST",
6627
6703
  body: {},
6628
6704
  // Reactivation can create an upstream resource, so it must not use
@@ -6636,7 +6712,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6636
6712
  // ——————————————————————————————————————————————————————————
6637
6713
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6638
6714
  monitorJobIdempotencyKey(operation) {
6639
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _354 => _354.crypto, 'optionalAccess', _355 => _355.randomUUID, 'optionalCall', _356 => _356()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6715
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _368 => _368.crypto, 'optionalAccess', _369 => _369.randomUUID, 'optionalCall', _370 => _370()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6640
6716
  const prefix = "monitor-job-";
6641
6717
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6642
6718
  const maxOperationLength = Math.max(
@@ -6647,7 +6723,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6647
6723
  }
6648
6724
  monitorJobHeaders(operation, idempotencyKey) {
6649
6725
  return {
6650
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _357 => _357.trim, 'call', _358 => _358()]) || this.monitorJobIdempotencyKey(operation)
6726
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _371 => _371.trim, 'call', _372 => _372()]) || this.monitorJobIdempotencyKey(operation)
6651
6727
  };
6652
6728
  }
6653
6729
  async deployMonitorBatch(definitions, options) {
@@ -6658,7 +6734,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6658
6734
  body: { version: 1, kind: "batch", monitors: definitions },
6659
6735
  headers: this.monitorJobHeaders(
6660
6736
  "batch-deploy",
6661
- _optionalChain([options, 'optionalAccess', _359 => _359.idempotencyKey])
6737
+ _optionalChain([options, 'optionalAccess', _373 => _373.idempotencyKey])
6662
6738
  ),
6663
6739
  maxRetries: 0,
6664
6740
  exactUrlOnly: true
@@ -6677,11 +6753,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6677
6753
  version: 1,
6678
6754
  kind: "batch",
6679
6755
  monitors: definitions,
6680
- ..._optionalChain([options, 'optionalAccess', _360 => _360.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6756
+ ..._optionalChain([options, 'optionalAccess', _374 => _374.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6681
6757
  },
6682
6758
  headers: this.monitorJobHeaders(
6683
6759
  `batch-sync-${batchId}`,
6684
- _optionalChain([options, 'optionalAccess', _361 => _361.idempotencyKey])
6760
+ _optionalChain([options, 'optionalAccess', _375 => _375.idempotencyKey])
6685
6761
  ),
6686
6762
  maxRetries: 0,
6687
6763
  exactUrlOnly: true
@@ -6696,7 +6772,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6696
6772
  body: {},
6697
6773
  headers: this.monitorJobHeaders(
6698
6774
  `batch-start-${batchId}`,
6699
- _optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey])
6775
+ _optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey])
6700
6776
  ),
6701
6777
  maxRetries: 0,
6702
6778
  exactUrlOnly: true
@@ -6711,7 +6787,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6711
6787
  body: {},
6712
6788
  headers: this.monitorJobHeaders(
6713
6789
  `batch-stop-${batchId}`,
6714
- _optionalChain([options, 'optionalAccess', _363 => _363.idempotencyKey])
6790
+ _optionalChain([options, 'optionalAccess', _377 => _377.idempotencyKey])
6715
6791
  ),
6716
6792
  maxRetries: 0,
6717
6793
  exactUrlOnly: true
@@ -6732,7 +6808,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6732
6808
  body: {},
6733
6809
  headers: this.monitorJobHeaders(
6734
6810
  `${action}-${monitorKey}`,
6735
- _optionalChain([options, 'optionalAccess', _364 => _364.idempotencyKey])
6811
+ _optionalChain([options, 'optionalAccess', _378 => _378.idempotencyKey])
6736
6812
  ),
6737
6813
  maxRetries: 0,
6738
6814
  exactUrlOnly: true
@@ -6745,7 +6821,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6745
6821
  body: definition,
6746
6822
  headers: this.monitorJobHeaders(
6747
6823
  `sync-${definition.key}`,
6748
- _optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey])
6824
+ _optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])
6749
6825
  ),
6750
6826
  maxRetries: 0,
6751
6827
  exactUrlOnly: true
@@ -6758,7 +6834,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6758
6834
  );
6759
6835
  }
6760
6836
  async getMonitorJobLogs(jobId, options) {
6761
- const query = _optionalChain([options, 'optionalAccess', _366 => _366.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6837
+ const query = _optionalChain([options, 'optionalAccess', _380 => _380.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
6762
6838
  return this.http.request(
6763
6839
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
6764
6840
  { method: "GET" }
@@ -6771,15 +6847,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6771
6847
  );
6772
6848
  }
6773
6849
  async waitForMonitorJob(jobId, options) {
6774
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _367 => _367.timeoutMs]), () => ( 10 * 6e4)));
6775
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _368 => _368.pollIntervalMs]), () => ( 2e3)));
6850
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _381 => _381.timeoutMs]), () => ( 10 * 6e4)));
6851
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _382 => _382.pollIntervalMs]), () => ( 2e3)));
6776
6852
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
6777
6853
  const startedAt = Date.now();
6778
6854
  let latest = await this.getMonitorJob(jobId);
6779
6855
  while (true) {
6780
- _optionalChain([options, 'optionalAccess', _369 => _369.onProgress, 'optionalCall', _370 => _370(latest)]);
6856
+ _optionalChain([options, 'optionalAccess', _383 => _383.onProgress, 'optionalCall', _384 => _384(latest)]);
6781
6857
  const job = latest.job;
6782
- const state = typeof _optionalChain([job, 'optionalAccess', _371 => _371.state]) === "string" ? job.state : void 0;
6858
+ const state = typeof _optionalChain([job, 'optionalAccess', _385 => _385.state]) === "string" ? job.state : void 0;
6783
6859
  if (state && terminal.has(state)) return latest;
6784
6860
  if (Date.now() - startedAt >= timeoutMs) return latest;
6785
6861
  await sleep(pollIntervalMs);
@@ -6790,12 +6866,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6790
6866
  // Monitor Fleets
6791
6867
  // ——————————————————————————————————————————————————————————
6792
6868
  monitorFleetIdempotencyKey(operation) {
6793
- const uuid = _optionalChain([globalThis, 'access', _372 => _372.crypto, 'optionalAccess', _373 => _373.randomUUID, 'optionalCall', _374 => _374()]);
6869
+ const uuid = _optionalChain([globalThis, 'access', _386 => _386.crypto, 'optionalAccess', _387 => _387.randomUUID, 'optionalCall', _388 => _388()]);
6794
6870
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
6795
6871
  }
6796
6872
  monitorFleetHeaders(operation, idempotencyKey) {
6797
6873
  return {
6798
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _375 => _375.trim, 'call', _376 => _376()]) || this.monitorFleetIdempotencyKey(operation)
6874
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _389 => _389.trim, 'call', _390 => _390()]) || this.monitorFleetIdempotencyKey(operation)
6799
6875
  };
6800
6876
  }
6801
6877
  monitorFleetPath(fleetId) {
@@ -6815,15 +6891,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
6815
6891
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
6816
6892
  const body = {
6817
6893
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
6818
- ..._optionalChain([options, 'optionalAccess', _377 => _377.dryRun]) ? { dry_run: true } : {},
6819
- ..._optionalChain([options, 'optionalAccess', _378 => _378.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6894
+ ..._optionalChain([options, 'optionalAccess', _391 => _391.dryRun]) ? { dry_run: true } : {},
6895
+ ..._optionalChain([options, 'optionalAccess', _392 => _392.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
6820
6896
  };
6821
6897
  return this.http.request(
6822
6898
  this.monitorFleetPath(fleetId),
6823
6899
  {
6824
6900
  method: "PUT",
6825
6901
  body,
6826
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _379 => _379.idempotencyKey])),
6902
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _393 => _393.idempotencyKey])),
6827
6903
  maxRetries: 0,
6828
6904
  exactUrlOnly: true
6829
6905
  }
@@ -6836,8 +6912,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6836
6912
  }
6837
6913
  async getMonitorFleet(fleetId, options) {
6838
6914
  const params = new URLSearchParams();
6839
- if (_optionalChain([options, 'optionalAccess', _380 => _380.drift])) params.set("drift", "1");
6840
- if (_optionalChain([options, 'optionalAccess', _381 => _381.limit]) !== void 0)
6915
+ if (_optionalChain([options, 'optionalAccess', _394 => _394.drift])) params.set("drift", "1");
6916
+ if (_optionalChain([options, 'optionalAccess', _395 => _395.limit]) !== void 0)
6841
6917
  params.set("limit", String(options.limit));
6842
6918
  const query = params.toString();
6843
6919
  return this.http.request(
@@ -6850,10 +6926,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6850
6926
  this.monitorFleetPath(fleetId),
6851
6927
  {
6852
6928
  method: "DELETE",
6853
- body: _optionalChain([options, 'optionalAccess', _382 => _382.dryRun]) ? { dry_run: true } : {},
6929
+ body: _optionalChain([options, 'optionalAccess', _396 => _396.dryRun]) ? { dry_run: true } : {},
6854
6930
  headers: this.monitorFleetHeaders(
6855
6931
  "deactivate",
6856
- _optionalChain([options, 'optionalAccess', _383 => _383.idempotencyKey])
6932
+ _optionalChain([options, 'optionalAccess', _397 => _397.idempotencyKey])
6857
6933
  ),
6858
6934
  maxRetries: 0,
6859
6935
  exactUrlOnly: true
@@ -6868,7 +6944,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6868
6944
  body: {},
6869
6945
  headers: this.monitorFleetHeaders(
6870
6946
  "reactivate",
6871
- _optionalChain([options, 'optionalAccess', _384 => _384.idempotencyKey])
6947
+ _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
6872
6948
  ),
6873
6949
  maxRetries: 0,
6874
6950
  exactUrlOnly: true
@@ -6885,13 +6961,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
6885
6961
  * identical to "the request failed".
6886
6962
  */
6887
6963
  async waitForMonitorFleetConvergence(fleetId, options) {
6888
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _385 => _385.timeoutMs]), () => ( 10 * 6e4)));
6889
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _386 => _386.pollIntervalMs]), () => ( 2e3)));
6890
- const terminal = _optionalChain([options, 'optionalAccess', _387 => _387.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6964
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _399 => _399.timeoutMs]), () => ( 10 * 6e4)));
6965
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _400 => _400.pollIntervalMs]), () => ( 2e3)));
6966
+ const terminal = _optionalChain([options, 'optionalAccess', _401 => _401.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded"]) : /* @__PURE__ */ new Set(["converged", "degraded", "deactivated"]);
6891
6967
  const startedAt = Date.now();
6892
6968
  let latest = await this.getMonitorFleet(fleetId);
6893
6969
  while (true) {
6894
- _optionalChain([options, 'optionalAccess', _388 => _388.onProgress, 'optionalCall', _389 => _389(latest)]);
6970
+ _optionalChain([options, 'optionalAccess', _402 => _402.onProgress, 'optionalCall', _403 => _403(latest)]);
6895
6971
  const status = typeof latest.status === "string" ? latest.status : void 0;
6896
6972
  if (status && terminal.has(status)) return latest;
6897
6973
  if (Date.now() - startedAt >= timeoutMs) return latest;