deepline 0.3.536 → 0.3.538

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 (204) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +22 -5
  2. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  3. package/dist/bundling-sources/sdk/src/plays/client-core.ts +18 -1
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +33 -4
  6. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +1 -1
  7. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +36 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +1 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +330 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +717 -133
  11. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +7 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +22 -1
  13. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +123 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +480 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/fixture-egress-fetch.ts +24 -16
  16. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +293 -53
  17. package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +57 -2
  18. package/dist/bundling-sources/shared_libs/play-runtime/governor/budget-state-backend.ts +43 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +141 -9
  20. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +6 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/modal-supervisor-sidecar.ts +556 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +27 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +19 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +54 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +5 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +155 -3
  28. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/relay-connection-counter.ts +103 -0
  29. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +75 -6
  30. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +59 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +544 -73
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +8 -1
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/detached-runner-readiness-pacing.ts +19 -1
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +2390 -110
  35. package/dist/bundling-sources/shared_libs/play-runtime/runtime-flow.ts +42 -8
  36. package/dist/bundling-sources/shared_libs/play-runtime/runtime-read-through.ts +287 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-finish.ts +606 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +274 -119
  39. package/dist/bundling-sources/shared_libs/play-runtime/runtime-traffic-policy.ts +54 -0
  40. package/dist/bundling-sources/shared_libs/play-runtime/runtime-work-counters.ts +10 -1
  41. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +15 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +18 -1
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +18 -4
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +219 -7
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +3 -0
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-claim-affinity.ts +340 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +1 -0
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +10 -1
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +623 -7
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +340 -5
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +61 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -1
  53. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +269 -2
  54. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +238 -5
  55. package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +47 -0
  56. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +5 -4
  57. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +6 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +11 -0
  59. package/dist/cli/auth-4WEVLYK4.js +43 -0
  60. package/dist/cli/{auth-KCTCUO7P.mjs → auth-KYH7N7RQ.mjs} +5 -5
  61. package/dist/cli/{billing-4VBGZ3CT.js → billing-4KTUVZ4S.js} +114 -90
  62. package/dist/cli/{billing-OOJHKLNS.mjs → billing-WK346KAI.mjs} +31 -7
  63. package/dist/cli/{chunk-4E5JXZ3W.js → chunk-25RGHJQL.js} +15 -15
  64. package/dist/cli/{chunk-MSP4DTSD.js → chunk-34PLG5OE.js} +13 -13
  65. package/dist/cli/{chunk-DQHUJMCL.mjs → chunk-35OCRH5C.mjs} +5 -5
  66. package/dist/cli/{chunk-2B4IOGFD.js → chunk-3I5TU5XE.js} +292 -279
  67. package/dist/cli/{chunk-Z7UIOGW4.mjs → chunk-4KZF6OYY.mjs} +3 -3
  68. package/dist/cli/{chunk-2YWJS76L.mjs → chunk-4NEOGPKD.mjs} +1 -1
  69. package/dist/cli/{chunk-LZXZQPA2.mjs → chunk-4WQR4DG4.mjs} +1 -1
  70. package/dist/cli/{chunk-KWYGWO4Y.js → chunk-5VSPRRTI.js} +7 -7
  71. package/dist/cli/{chunk-ANUKBZ6W.mjs → chunk-6JG3MRTM.mjs} +2 -2
  72. package/dist/cli/{chunk-VBDZIMWD.js → chunk-6SLQLWWL.js} +26 -26
  73. package/dist/cli/{chunk-E24UGPGG.mjs → chunk-7XDJKIM2.mjs} +4 -4
  74. package/dist/cli/{chunk-OUDTOMZC.mjs → chunk-A6E7TCK2.mjs} +5 -5
  75. package/dist/cli/{chunk-ZZ4MF2GI.js → chunk-ADLDU2QG.js} +6 -6
  76. package/dist/cli/{chunk-XVZRJJDS.mjs → chunk-ALARRSMZ.mjs} +3 -3
  77. package/dist/cli/{chunk-HWDKRN7L.js → chunk-B2BTBHX2.js} +3 -3
  78. package/dist/cli/{chunk-ZISEH7OL.js → chunk-BBS2BLPV.js} +16 -16
  79. package/dist/cli/{chunk-YRLAUGQY.mjs → chunk-CLO562KG.mjs} +3 -1
  80. package/dist/cli/{chunk-CXTW7SRW.mjs → chunk-E7D37PLM.mjs} +8 -0
  81. package/dist/cli/{chunk-SLPJ3LXI.js → chunk-ESX3H7Q7.js} +22 -22
  82. package/dist/cli/{chunk-AB2GBOD4.mjs → chunk-FJ5KPGCS.mjs} +10 -10
  83. package/dist/cli/{chunk-DUYAMLOC.mjs → chunk-FWE37N2P.mjs} +1 -1
  84. package/dist/cli/{chunk-3PCYV6ZJ.mjs → chunk-ICTA5ICE.mjs} +1 -1
  85. package/dist/cli/{chunk-ZILSRDIN.js → chunk-IMLFB66A.js} +3 -3
  86. package/dist/cli/{chunk-PNY3BWHP.mjs → chunk-IP3XJTWA.mjs} +2 -2
  87. package/dist/cli/{chunk-6VUGBQZQ.js → chunk-JCLRSMUP.js} +5 -5
  88. package/dist/cli/{chunk-YBMHOH6H.mjs → chunk-JPEBKN3K.mjs} +2 -2
  89. package/dist/cli/{chunk-GF32SBST.mjs → chunk-JTOV5RUA.mjs} +1 -1
  90. package/dist/cli/{chunk-Q5CXV3E3.js → chunk-KCUQNH4K.js} +2 -2
  91. package/dist/cli/{chunk-DA2I2M7D.mjs → chunk-KNIYEZVV.mjs} +2 -2
  92. package/dist/cli/{chunk-CWSLUNA6.js → chunk-LPTBHNGB.js} +7 -5
  93. package/dist/cli/{chunk-WC5M3JXE.mjs → chunk-M3NCXGNN.mjs} +2 -2
  94. package/dist/cli/{chunk-TX5TUHJN.js → chunk-MNBIGX6O.js} +10 -10
  95. package/dist/cli/{chunk-ZEV2Y56V.js → chunk-MYSPQUAO.js} +44 -44
  96. package/dist/cli/{chunk-KPQHUVYW.mjs → chunk-N2BCPZVR.mjs} +5 -5
  97. package/dist/cli/{chunk-XBAH3TKU.js → chunk-N5HSG4OV.js} +5 -5
  98. package/dist/cli/{chunk-GTVZKY3F.js → chunk-O765M4LT.js} +2 -2
  99. package/dist/cli/{chunk-2FCSUOYN.js → chunk-OOLBE6FR.js} +53 -53
  100. package/dist/cli/{chunk-W7AEIGZR.js → chunk-P3DP56HB.js} +41 -41
  101. package/dist/cli/{chunk-LN6RXDTB.js → chunk-PQKD5DMT.js} +19 -19
  102. package/dist/cli/{chunk-GHLDCLSC.mjs → chunk-T6GPTJ5F.mjs} +1 -1
  103. package/dist/cli/{chunk-XJD2GYUP.mjs → chunk-TWWYCJJW.mjs} +5 -5
  104. package/dist/cli/{chunk-BASLYGXK.mjs → chunk-UE7JHAZ2.mjs} +29 -16
  105. package/dist/cli/{chunk-Q4MNUOS4.js → chunk-UEZNIPFO.js} +107 -107
  106. package/dist/cli/{chunk-RVSSQPQO.mjs → chunk-VCHV4LS3.mjs} +1 -1
  107. package/dist/cli/{chunk-LDGZFDUB.js → chunk-VIFLWQXS.js} +2 -2
  108. package/dist/cli/{chunk-6BBGUQJJ.js → chunk-XTYHZEJ2.js} +8 -0
  109. package/dist/cli/{chunk-CIDN5K23.js → chunk-YQURGSRB.js} +1 -1
  110. package/dist/cli/{chunk-Y2NTPYGS.js → chunk-YZ2ZPHWR.js} +9 -9
  111. package/dist/cli/{chunk-HAJQGP5V.mjs → chunk-ZDLDCXY3.mjs} +2 -2
  112. package/dist/cli/{chunk-JUHDJNSI.mjs → chunk-ZU6JBRV5.mjs} +4 -4
  113. package/dist/cli/command-docs.js +2 -2
  114. package/dist/cli/command-docs.mjs +1 -1
  115. package/dist/cli/{csv-P3HLK4GO.mjs → csv-2YKLUKDR.mjs} +4 -4
  116. package/dist/cli/{csv-2V2DIFNG.js → csv-LM7FBECI.js} +13 -13
  117. package/dist/cli/{db-ZYOY3QRQ.mjs → db-234UBWJH.mjs} +6 -6
  118. package/dist/cli/{db-MREAQVW6.js → db-5PMA4IVW.js} +27 -27
  119. package/dist/cli/describe-C7GOSGYB.js +49 -0
  120. package/dist/cli/{describe-IKZFOADR.mjs → describe-W26LW5O7.mjs} +17 -17
  121. package/dist/cli/describe-core.d.mts +3 -3
  122. package/dist/cli/describe-core.d.ts +3 -3
  123. package/dist/cli/{executions-H5IJ7QSQ.js → executions-3S736GXX.js} +8 -8
  124. package/dist/cli/{executions-KTSY5M34.mjs → executions-GD7GXTJM.mjs} +6 -6
  125. package/dist/cli/{feedback-724QK3Z5.js → feedback-BUWTDY4R.js} +14 -14
  126. package/dist/cli/{feedback-WWJRIXEU.mjs → feedback-GBV5HJJZ.mjs} +6 -6
  127. package/dist/cli/git-YG36MROC.js +25 -0
  128. package/dist/cli/{git-R5VRG7X6.mjs → git-YXJGTDQL.mjs} +5 -5
  129. package/dist/cli/index.js +143 -143
  130. package/dist/cli/index.mjs +42 -42
  131. package/dist/cli/{legacy-noops-PWZ5XLAO.mjs → legacy-noops-UJM6GBNP.mjs} +6 -6
  132. package/dist/cli/{legacy-noops-C6GDEGPU.js → legacy-noops-ZSF64V2U.js} +9 -9
  133. package/dist/cli/{monitors-WQSKMHAP.mjs → monitors-UERUQ6CT.mjs} +7 -7
  134. package/dist/cli/{monitors-VAVQ4WCE.js → monitors-XQ2GNH6D.js} +100 -100
  135. package/dist/cli/{org-MAL4QPVF.mjs → org-CP4VLH6M.mjs} +6 -6
  136. package/dist/cli/{org-CWWRWXZQ.js → org-IF6MPVNR.js} +86 -86
  137. package/dist/cli/{play-WJOWK5PQ.js → play-2NHQO5MO.js} +317 -317
  138. package/dist/cli/{play-ILW6MSNG.mjs → play-ZWDYYVPI.mjs} +17 -17
  139. package/dist/cli/{providers-4V2NMLZZ.mjs → providers-2CVIATU4.mjs} +6 -6
  140. package/dist/cli/{providers-W662ANCH.js → providers-LOPXQN56.js} +9 -9
  141. package/dist/cli/{quickstart-C22BR743.mjs → quickstart-KVCFXLID.mjs} +4 -4
  142. package/dist/cli/{quickstart-BW6EBUYX.js → quickstart-N4WDEQZY.js} +6 -6
  143. package/dist/cli/{run-KW7KW4FX.js → run-BDT5LK3I.js} +42 -42
  144. package/dist/cli/{run-SPAU5IMW.mjs → run-RUXHYWLF.mjs} +22 -22
  145. package/dist/cli/search-ATDDVADT.js +32 -0
  146. package/dist/cli/{search-XPC75HLM.mjs → search-BFUTNPA5.mjs} +7 -7
  147. package/dist/cli/{search-output-VJYE7USJ.js → search-output-CTXI2QZU.js} +6 -6
  148. package/dist/cli/{search-output-JKYJSEPM.mjs → search-output-WUGH4PZA.mjs} +4 -4
  149. package/dist/cli/{secrets-YB57KGSB.js → secrets-BZJZYFOU.js} +15 -15
  150. package/dist/cli/{secrets-OJG73GXQ.mjs → secrets-Z4XQVTC6.mjs} +6 -6
  151. package/dist/cli/sessions-HNU35AFM.js +22 -0
  152. package/dist/cli/{sessions-7ZL37BW4.mjs → sessions-VZXR3MQZ.mjs} +6 -6
  153. package/dist/cli/{settings-RKSQB7FA.mjs → settings-VYEZFR4L.mjs} +12 -12
  154. package/dist/cli/{settings-A7DD2ZYE.js → settings-WBYA4JMM.js} +85 -85
  155. package/dist/cli/{setup-S3K5YU62.js → setup-FS2RMSS2.js} +49 -49
  156. package/dist/cli/{setup-NXDUTITY.mjs → setup-H7KCI4SO.mjs} +9 -9
  157. package/dist/cli/skills-VPIURCAZ.js +36 -0
  158. package/dist/cli/{skills-VMFAIDO6.mjs → skills-YQNSJUUG.mjs} +7 -7
  159. package/dist/cli/tools-273GS5HU.js +56 -0
  160. package/dist/cli/{tools-52NTHBSJ.mjs → tools-ZF6SVEGW.mjs} +16 -16
  161. package/dist/cli/{update-SAKBEKMV.mjs → update-RKQNNJM4.mjs} +9 -9
  162. package/dist/cli/update-TOD3XY55.js +34 -0
  163. package/dist/cli/{views-ACRV7MD6.mjs → views-JHHOTWDU.mjs} +6 -6
  164. package/dist/cli/{views-C3GJOBDG.js → views-KN7FEDGT.js} +21 -21
  165. package/dist/cli/{workflow-ZNWCZEGN.js → workflow-2WHSKTTV.js} +17 -17
  166. package/dist/cli/{workflow-CS22E7TC.mjs → workflow-AAYLCLWA.mjs} +7 -7
  167. package/dist/{client-BlLYQDNo.d.mts → client-D0uDBybG.d.mts} +1 -1
  168. package/dist/{client-DSQlkIDO.d.ts → client-DZTnAv4B.d.ts} +1 -1
  169. package/dist/{client-core-rX7n2H8U.d.mts → client-core-BhWf8Y1b.d.mts} +15 -2
  170. package/dist/{client-core-CDwapXy5.d.ts → client-core-og3AP1LL.d.ts} +15 -2
  171. package/dist/{compiler-manifest-BHNC4RL-.d.mts → compiler-manifest-Bes3OVA3.d.mts} +1 -1
  172. package/dist/{compiler-manifest-BHNC4RL-.d.ts → compiler-manifest-Bes3OVA3.d.ts} +1 -1
  173. package/dist/{errors-lhtIWG5Z.d.ts → errors-BJm4lLWc.d.ts} +1 -1
  174. package/dist/{errors-D7sPXrvB.d.mts → errors-Dc5r42ks.d.mts} +1 -1
  175. package/dist/{index-CQTBHXHr.d.ts → index-BfV7mRPF.d.ts} +1 -1
  176. package/dist/{index-NaDZq2xf.d.mts → index-DTkiz_Ur.d.mts} +1 -1
  177. package/dist/index.d.mts +7 -7
  178. package/dist/index.d.ts +7 -7
  179. package/dist/index.js +9 -9
  180. package/dist/index.mjs +6 -6
  181. package/dist/install-integrity.json +120 -112
  182. package/dist/plays/bundle-play-file.d.mts +3 -3
  183. package/dist/plays/bundle-play-file.d.ts +3 -3
  184. package/dist/plays/play-description.d.mts +2 -2
  185. package/dist/plays/play-description.d.ts +2 -2
  186. package/dist/plays/run-request.d.mts +2 -2
  187. package/dist/plays/run-request.d.ts +2 -2
  188. package/dist/release.d.mts +1 -1
  189. package/dist/release.d.ts +1 -1
  190. package/dist/release.js +2 -2
  191. package/dist/release.mjs +1 -1
  192. package/dist/server.d.mts +4 -4
  193. package/dist/server.d.ts +4 -4
  194. package/dist/server.js +5 -5
  195. package/dist/server.mjs +3 -3
  196. package/package.json +1 -1
  197. package/dist/cli/auth-6XQKFOLG.js +0 -43
  198. package/dist/cli/describe-WW3OQRLP.js +0 -49
  199. package/dist/cli/git-PHYRD56H.js +0 -25
  200. package/dist/cli/search-HLE54W5G.js +0 -32
  201. package/dist/cli/sessions-VEBYZIEU.js +0 -22
  202. package/dist/cli/skills-NVQ744CN.js +0 -36
  203. package/dist/cli/tools-SBDUL3WB.js +0 -56
  204. package/dist/cli/update-HHVFZPCV.js +0 -34
@@ -31,7 +31,8 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
31
31
 
32
32
 
33
33
 
34
- var _chunkCWSLUNA6js = require('./chunk-CWSLUNA6.js');
34
+
35
+ var _chunkLPTBHNGBjs = require('./chunk-LPTBHNGB.js');
35
36
 
36
37
 
37
38
  var _chunk2GJZLIKWjs = require('./chunk-2GJZLIKW.js');
@@ -674,7 +675,7 @@ var ToolCalls = class {
674
675
  idempotencyKey,
675
676
  onResponse: (response2) => {
676
677
  lastResponse = null;
677
- atomicToolsSupported = response2.headers.get(_chunkCWSLUNA6js.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
678
+ atomicToolsSupported = response2.headers.get(_chunkLPTBHNGBjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
678
679
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
679
680
  if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
680
681
  try {
@@ -1060,10 +1061,16 @@ function runtimeSelectionHeaders(runtime, env) {
1060
1061
  }
1061
1062
  const receivers = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
1062
1063
  return {
1063
- [_chunkCWSLUNA6js.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1064
- ...receivers ? { [_chunkCWSLUNA6js.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1064
+ [_chunkLPTBHNGBjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1065
+ ...receivers ? { [_chunkLPTBHNGBjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1065
1066
  };
1066
1067
  }
1068
+ function playRunStartHeaders(runtime, env) {
1069
+ const headers = runtimeSelectionHeaders(runtime, env);
1070
+ const experimentSwitches = _optionalChain([env, 'access', _58 => _58.DEEPLINE_EXPERIMENT_SWITCHES, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
1071
+ if (!experimentSwitches) return headers;
1072
+ return { ...headers, [_chunkLPTBHNGBjs.EXPERIMENT_SWITCHES_HEADER]: experimentSwitches };
1073
+ }
1067
1074
  function normalizeTestPolicyOverrides(value, source) {
1068
1075
  if (value && typeof value === "object" && !Array.isArray(value)) {
1069
1076
  return value;
@@ -1076,7 +1083,7 @@ function normalizeTestPolicyOverrides(value, source) {
1076
1083
  }
1077
1084
  function parseEnvTestPolicyOverrides(env) {
1078
1085
  const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
1079
- const trimmed = _optionalChain([raw, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
1086
+ const trimmed = _optionalChain([raw, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()]);
1080
1087
  if (!trimmed) return void 0;
1081
1088
  let parsed;
1082
1089
  try {
@@ -1096,17 +1103,17 @@ function isRecord2(value) {
1096
1103
  }
1097
1104
  function normalizePlayStatus(raw) {
1098
1105
  const runPackage = _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1099
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _60 => _60.run]);
1100
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _61 => _61.status]) === "string" ? packageRun.status : null;
1106
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _63 => _63.run]);
1107
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _64 => _64.status]) === "string" ? packageRun.status : null;
1101
1108
  const status = _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1102
1109
  if (!status) {
1103
1110
  throw new Error(
1104
1111
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
1105
1112
  );
1106
1113
  }
1107
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _62 => _62.id]), () => ( ""));
1108
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _63 => _63.overview]), () => ( raw.overview));
1109
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _64 => _64.runStatus]), () => ( raw.runStatus));
1114
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _65 => _65.id]), () => ( ""));
1115
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _66 => _66.overview]), () => ( raw.overview));
1116
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _67 => _67.runStatus]), () => ( raw.runStatus));
1110
1117
  return {
1111
1118
  ...raw,
1112
1119
  runId,
@@ -1128,26 +1135,26 @@ var PlayClient = class {
1128
1135
  }
1129
1136
  async startPlayRun(request, options) {
1130
1137
  const resolved = resolveStartPlayRunRequest(request, this.environment);
1131
- const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
1138
+ const headers = playRunStartHeaders(resolved.runtime, this.environment);
1132
1139
  return _chunkCQDQNZGHjs.startPlayRun.call(void 0,
1133
1140
  this.http,
1134
1141
  resolved.request,
1135
- _optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkCWSLUNA6js.SDK_API_MAJOR) } : headers,
1142
+ _optionalChain([options, 'optionalAccess', _68 => _68.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkLPTBHNGBjs.SDK_API_MAJOR) } : headers,
1136
1143
  options
1137
1144
  );
1138
1145
  }
1139
1146
  async getPlayStatus(workflowId, options) {
1140
1147
  const params = new URLSearchParams();
1141
- if (_optionalChain([options, 'optionalAccess', _66 => _66.billing]) === false) {
1148
+ if (_optionalChain([options, 'optionalAccess', _69 => _69.billing]) === false) {
1142
1149
  params.set("billing", "false");
1143
1150
  }
1144
- if (_optionalChain([options, 'optionalAccess', _67 => _67.full]) === true) {
1151
+ if (_optionalChain([options, 'optionalAccess', _70 => _70.full]) === true) {
1145
1152
  params.set("full", "true");
1146
1153
  }
1147
1154
  const query = params.size > 0 ? `?${params.toString()}` : "";
1148
1155
  const response = await this.http.get(
1149
1156
  `/api/v2/runs/${encodeURIComponent(workflowId)}${query}`,
1150
- _optionalChain([options, 'optionalAccess', _68 => _68.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
1157
+ _optionalChain([options, 'optionalAccess', _71 => _71.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
1151
1158
  );
1152
1159
  return normalizePlayStatus(response);
1153
1160
  }
@@ -1160,7 +1167,7 @@ var PlayClient = class {
1160
1167
  async stopPlay(workflowId, options) {
1161
1168
  return this.http.post(
1162
1169
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
1163
- _optionalChain([options, 'optionalAccess', _69 => _69.reason]) ? { reason: options.reason } : {}
1170
+ _optionalChain([options, 'optionalAccess', _72 => _72.reason]) ? { reason: options.reason } : {}
1164
1171
  );
1165
1172
  }
1166
1173
  async listPlayRuns(playName) {
@@ -1172,7 +1179,7 @@ var PlayClient = class {
1172
1179
  }
1173
1180
  async getPlay(name, options) {
1174
1181
  const encodedName = encodeURIComponent(name);
1175
- const query = _optionalChain([options, 'optionalAccess', _70 => _70.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _71 => _71.guidance]) ? "?include=guidance" : "";
1182
+ const query = _optionalChain([options, 'optionalAccess', _73 => _73.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _74 => _74.guidance]) ? "?include=guidance" : "";
1176
1183
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
1177
1184
  }
1178
1185
  async clearPlayHistory(name, request = {}) {
@@ -1184,7 +1191,7 @@ var PlayClient = class {
1184
1191
  }
1185
1192
  async listPlayVersions(name, options) {
1186
1193
  const encodedName = encodeURIComponent(name);
1187
- const suffix = _optionalChain([options, 'optionalAccess', _72 => _72.full]) ? "?full=true" : "";
1194
+ const suffix = _optionalChain([options, 'optionalAccess', _75 => _75.full]) ? "?full=true" : "";
1188
1195
  const response = await this.http.get(
1189
1196
  `/api/v2/plays/${encodedName}/versions${suffix}`
1190
1197
  );
@@ -2141,7 +2148,7 @@ function parseDsl(input) {
2141
2148
  input.slice(position)
2142
2149
  );
2143
2150
  if (!operation) {
2144
- const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _73 => _73.exec, 'call', _74 => _74(input.slice(position)), 'optionalAccess', _75 => _75[0]]), () => ( input[position])), () => ( "<end>"));
2151
+ const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _76 => _76.exec, 'call', _77 => _77(input.slice(position)), 'optionalAccess', _78 => _78[0]]), () => ( input[position])), () => ( "<end>"));
2145
2152
  if (token === "=") {
2146
2153
  const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
2147
2154
  fail(
@@ -2220,7 +2227,7 @@ function normalizeRunEventQueryTimestamp(value) {
2220
2227
  return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2221
2228
  }
2222
2229
  function timestampMicros(value) {
2223
- const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _76 => _76.exec, 'call', _77 => _77(value), 'optionalAccess', _78 => _78[1]]), () => ( ""));
2230
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _79 => _79.exec, 'call', _80 => _80(value), 'optionalAccess', _81 => _81[1]]), () => ( ""));
2224
2231
  return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2225
2232
  }
2226
2233
  function time(value, nowMs, fallback) {
@@ -2728,10 +2735,10 @@ function getStepStatusSignature(snapshot) {
2728
2735
  _nullishCoalesce(state.artifactTableNamespace, () => ( "")),
2729
2736
  _nullishCoalesce(state.startedAt, () => ( "")),
2730
2737
  _nullishCoalesce(state.completedAt, () => ( "")),
2731
- _nullishCoalesce(_optionalChain([state, 'access', _79 => _79.progress, 'optionalAccess', _80 => _80.startedAt]), () => ( "")),
2732
- _nullishCoalesce(_optionalChain([state, 'access', _81 => _81.progress, 'optionalAccess', _82 => _82.completedAt]), () => ( "")),
2738
+ _nullishCoalesce(_optionalChain([state, 'access', _82 => _82.progress, 'optionalAccess', _83 => _83.startedAt]), () => ( "")),
2739
+ _nullishCoalesce(_optionalChain([state, 'access', _84 => _84.progress, 'optionalAccess', _85 => _85.completedAt]), () => ( "")),
2733
2740
  _nullishCoalesce(state.updatedAt, () => ( "")),
2734
- _nullishCoalesce(_optionalChain([state, 'access', _83 => _83.progress, 'optionalAccess', _84 => _84.updatedAt]), () => ( ""))
2741
+ _nullishCoalesce(_optionalChain([state, 'access', _86 => _86.progress, 'optionalAccess', _87 => _87.updatedAt]), () => ( ""))
2735
2742
  ].join(":")
2736
2743
  ).join("|");
2737
2744
  }
@@ -2740,11 +2747,11 @@ function getStepProgressSignature(snapshot) {
2740
2747
  snapshot.nodeStates.map((state) => [
2741
2748
  state.nodeId,
2742
2749
  projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
2743
- _nullishCoalesce(_optionalChain([state, 'access', _85 => _85.progress, 'optionalAccess', _86 => _86.artifactTableNamespace]), () => ( "")),
2744
- _nullishCoalesce(_optionalChain([state, 'access', _87 => _87.progress, 'optionalAccess', _88 => _88.startedAt]), () => ( "")),
2745
- _nullishCoalesce(_optionalChain([state, 'access', _89 => _89.progress, 'optionalAccess', _90 => _90.completedAt]), () => ( "")),
2746
- _nullishCoalesce(_optionalChain([state, 'access', _91 => _91.progress, 'optionalAccess', _92 => _92.updatedAt]), () => ( "")),
2747
- _nullishCoalesce(_optionalChain([state, 'access', _93 => _93.progress, 'optionalAccess', _94 => _94.message]), () => ( ""))
2750
+ _nullishCoalesce(_optionalChain([state, 'access', _88 => _88.progress, 'optionalAccess', _89 => _89.artifactTableNamespace]), () => ( "")),
2751
+ _nullishCoalesce(_optionalChain([state, 'access', _90 => _90.progress, 'optionalAccess', _91 => _91.startedAt]), () => ( "")),
2752
+ _nullishCoalesce(_optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.completedAt]), () => ( "")),
2753
+ _nullishCoalesce(_optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.updatedAt]), () => ( "")),
2754
+ _nullishCoalesce(_optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.message]), () => ( ""))
2748
2755
  ])
2749
2756
  );
2750
2757
  }
@@ -2814,8 +2821,8 @@ function diffPlayRunStreamEvents(input) {
2814
2821
  if (state.status === "idle") {
2815
2822
  continue;
2816
2823
  }
2817
- const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _95 => _95.progress, 'optionalAccess', _96 => _96.startedAt]))), () => ( null));
2818
- const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _97 => _97.progress, 'optionalAccess', _98 => _98.completedAt]))), () => ( null));
2824
+ const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.startedAt]))), () => ( null));
2825
+ const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.completedAt]))), () => ( null));
2819
2826
  events.push(
2820
2827
  makeRunStreamEvent({
2821
2828
  cursor,
@@ -2829,7 +2836,7 @@ function diffPlayRunStreamEvents(input) {
2829
2836
  ...resolveTimingWindow({
2830
2837
  startedAt: persistedStartedAt,
2831
2838
  completedAt: persistedCompletedAt,
2832
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _99 => _99.progress, 'optionalAccess', _100 => _100.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2839
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _102 => _102.progress, 'optionalAccess', _103 => _103.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2833
2840
  })
2834
2841
  }
2835
2842
  })
@@ -2883,9 +2890,9 @@ function diffPlayRunStreamEvents(input) {
2883
2890
  if (next.snapshotSignature !== previous.snapshotSignature) {
2884
2891
  const enrichedNodeStates = snapshot.nodeStates.map((state) => {
2885
2892
  const timing = resolveTimingWindow({
2886
- startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _101 => _101.progress, 'optionalAccess', _102 => _102.startedAt]))), () => ( null)),
2887
- completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _103 => _103.progress, 'optionalAccess', _104 => _104.completedAt]))), () => ( null)),
2888
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _105 => _105.progress, 'optionalAccess', _106 => _106.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2893
+ startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _104 => _104.progress, 'optionalAccess', _105 => _105.startedAt]))), () => ( null)),
2894
+ completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _106 => _106.progress, 'optionalAccess', _107 => _107.completedAt]))), () => ( null)),
2895
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _108 => _108.progress, 'optionalAccess', _109 => _109.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2889
2896
  });
2890
2897
  return {
2891
2898
  ...state,
@@ -2931,20 +2938,22 @@ function diffPlayRunStreamEvents(input) {
2931
2938
  var RUN_WATCH_POLL_INTERVAL_MS = 2e3;
2932
2939
  var RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 300;
2933
2940
  var RUN_WATCH_STARTUP_WINDOW_MS = 6e3;
2941
+ var RUN_WATCH_SERVER_WAIT_MS = 0;
2942
+ var RUN_WATCH_SERVER_WAIT_FROM_START = false;
2934
2943
  var TERMINAL_LOG_PROJECTION_RETRY_LIMIT = 3;
2935
2944
  function waitForNextPoll(ms, signal) {
2936
- if (_optionalChain([signal, 'optionalAccess', _107 => _107.aborted])) {
2945
+ if (_optionalChain([signal, 'optionalAccess', _110 => _110.aborted])) {
2937
2946
  return Promise.resolve(false);
2938
2947
  }
2939
2948
  return new Promise((resolve) => {
2940
2949
  const finish = (elapsed) => {
2941
2950
  clearTimeout(timeout);
2942
- _optionalChain([signal, 'optionalAccess', _108 => _108.removeEventListener, 'call', _109 => _109("abort", onAbort)]);
2951
+ _optionalChain([signal, 'optionalAccess', _111 => _111.removeEventListener, 'call', _112 => _112("abort", onAbort)]);
2943
2952
  resolve(elapsed);
2944
2953
  };
2945
2954
  const onAbort = () => finish(false);
2946
2955
  const timeout = setTimeout(() => finish(true), ms);
2947
- _optionalChain([signal, 'optionalAccess', _110 => _110.addEventListener, 'call', _111 => _111("abort", onAbort, { once: true })]);
2956
+ _optionalChain([signal, 'optionalAccess', _113 => _113.addEventListener, 'call', _114 => _114("abort", onAbort, { once: true })]);
2948
2957
  });
2949
2958
  }
2950
2959
  function readSnapshotResponse(response, runId) {
@@ -3025,10 +3034,12 @@ async function* watchRunEvents(options) {
3025
3034
  let outageNoticeSent = false;
3026
3035
  let pollCount = 0;
3027
3036
  let terminalLogProjectionRetries = 0;
3028
- while (!_optionalChain([signal, 'optionalAccess', _112 => _112.aborted])) {
3037
+ while (!_optionalChain([signal, 'optionalAccess', _115 => _115.aborted])) {
3029
3038
  const pollStartedAt = Date.now();
3030
3039
  const poll = ++pollCount;
3031
- const pollIntervalMs = _nullishCoalesce(options.pollIntervalMs, () => ( (pollStartedAt - watchStartedAt < RUN_WATCH_STARTUP_WINDOW_MS ? RUN_WATCH_STARTUP_POLL_INTERVAL_MS : RUN_WATCH_POLL_INTERVAL_MS)));
3040
+ const pastStartup = pollStartedAt - watchStartedAt >= RUN_WATCH_STARTUP_WINDOW_MS;
3041
+ const serverWaitMs = options.pollIntervalMs === void 0 && options.deferLogs && (pastStartup || RUN_WATCH_SERVER_WAIT_FROM_START) && RUN_WATCH_SERVER_WAIT_MS > 0 ? RUN_WATCH_SERVER_WAIT_MS : 0;
3042
+ const pollIntervalMs = _nullishCoalesce(options.pollIntervalMs, () => ( (serverWaitMs > 0 ? 0 : pastStartup ? RUN_WATCH_POLL_INTERVAL_MS : RUN_WATCH_STARTUP_POLL_INTERVAL_MS)));
3032
3043
  let snapshot;
3033
3044
  let terminalStatus;
3034
3045
  let responseStatus;
@@ -3048,15 +3059,18 @@ async function* watchRunEvents(options) {
3048
3059
  }
3049
3060
  };
3050
3061
  try {
3051
- const response = await http.get(path, {
3052
- signal,
3053
- ...options.onPoll ? {
3054
- onResponse: (response2) => {
3055
- responseStatus = response2.status;
3056
- serverTiming = _nullishCoalesce(response2.headers.get("server-timing"), () => ( void 0));
3057
- }
3058
- } : {}
3059
- });
3062
+ const response = await http.get(
3063
+ serverWaitMs > 0 ? `${path}&waitForTerminalMs=${serverWaitMs}` : path,
3064
+ {
3065
+ signal,
3066
+ ...options.onPoll ? {
3067
+ onResponse: (response2) => {
3068
+ responseStatus = response2.status;
3069
+ serverTiming = _nullishCoalesce(response2.headers.get("server-timing"), () => ( void 0));
3070
+ }
3071
+ } : {}
3072
+ }
3073
+ );
3060
3074
  const parsed = readSnapshotResponse(response, runId);
3061
3075
  terminalStatus = parsed.terminalStatus;
3062
3076
  snapshot = options.deferLogs ? parsed.snapshot : await backfillRotatedLogTail({
@@ -3069,7 +3083,7 @@ async function* watchRunEvents(options) {
3069
3083
  reportPoll();
3070
3084
  } catch (error) {
3071
3085
  reportPoll();
3072
- if (_optionalChain([signal, 'optionalAccess', _113 => _113.aborted])) {
3086
+ if (_optionalChain([signal, 'optionalAccess', _116 => _116.aborted])) {
3073
3087
  return;
3074
3088
  }
3075
3089
  if (!isTransientPlayRunReadError(error)) {
@@ -3078,12 +3092,12 @@ async function* watchRunEvents(options) {
3078
3092
  consecutiveFailures += 1;
3079
3093
  const reason = error instanceof Error ? error.message : String(error);
3080
3094
  if (!outageNoticeSent) {
3081
- _optionalChain([options, 'access', _114 => _114.onRetry, 'optionalCall', _115 => _115({
3095
+ _optionalChain([options, 'access', _117 => _117.onRetry, 'optionalCall', _118 => _118({
3082
3096
  attempt: consecutiveFailures,
3083
3097
  delayMs: pollIntervalMs,
3084
3098
  reason
3085
3099
  })]);
3086
- _optionalChain([options, 'access', _116 => _116.onNotice, 'optionalCall', _117 => _117(
3100
+ _optionalChain([options, 'access', _119 => _119.onNotice, 'optionalCall', _120 => _120(
3087
3101
  `[watch] run snapshot request failed; retrying snapshot polling (${reason})`
3088
3102
  )]);
3089
3103
  outageNoticeSent = true;
@@ -3098,7 +3112,7 @@ async function* watchRunEvents(options) {
3098
3112
  continue;
3099
3113
  }
3100
3114
  if (outageNoticeSent) {
3101
- _optionalChain([options, 'access', _118 => _118.onNotice, 'optionalCall', _119 => _119("[watch] run snapshot polling recovered")]);
3115
+ _optionalChain([options, 'access', _121 => _121.onNotice, 'optionalCall', _122 => _122("[watch] run snapshot polling recovered")]);
3102
3116
  outageNoticeSent = false;
3103
3117
  }
3104
3118
  consecutiveFailures = 0;
@@ -3113,14 +3127,14 @@ async function* watchRunEvents(options) {
3113
3127
  if (!await waitForNextPoll(remaining2, signal)) return;
3114
3128
  continue;
3115
3129
  }
3116
- _optionalChain([options, 'access', _120 => _120.onNotice, 'optionalCall', _121 => _121(
3130
+ _optionalChain([options, 'access', _123 => _123.onNotice, 'optionalCall', _124 => _124(
3117
3131
  `[watch] terminal status is complete, but final logs are unavailable in this watch; fetch retained logs with deepline runs logs ${runId}`
3118
3132
  )]);
3119
3133
  } else {
3120
3134
  terminalLogProjectionRetries = 0;
3121
3135
  }
3122
3136
  if (terminalStatus) {
3123
- await _optionalChain([options, 'access', _122 => _122.terminalStatus, 'optionalAccess', _123 => _123.onStatus, 'call', _124 => _124(terminalStatus, snapshot.status)]);
3137
+ await _optionalChain([options, 'access', _125 => _125.terminalStatus, 'optionalAccess', _126 => _126.onStatus, 'call', _127 => _127(terminalStatus, snapshot.status)]);
3124
3138
  }
3125
3139
  const diff = diffPlayRunStreamEvents({
3126
3140
  streamId,
@@ -3184,7 +3198,7 @@ function parseNotificationGroupTarget(value) {
3184
3198
  }
3185
3199
  return { kind: "email", email };
3186
3200
  }
3187
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _125 => _125.exec, 'call', _126 => _126(normalized), 'optionalAccess', _127 => _127[1], 'optionalAccess', _128 => _128.trim, 'call', _129 => _129()]);
3201
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _128 => _128.exec, 'call', _129 => _129(normalized), 'optionalAccess', _130 => _130[1], 'optionalAccess', _131 => _131.trim, 'call', _132 => _132()]);
3188
3202
  if (!slack) {
3189
3203
  const provider = normalized.split(":", 1)[0] || normalized;
3190
3204
  throw new Error(
@@ -3192,7 +3206,7 @@ function parseNotificationGroupTarget(value) {
3192
3206
  );
3193
3207
  }
3194
3208
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
3195
- if (_optionalChain([member, 'optionalAccess', _130 => _130[1]])) {
3209
+ if (_optionalChain([member, 'optionalAccess', _133 => _133[1]])) {
3196
3210
  return { kind: "slack", memberId: member[1].toUpperCase() };
3197
3211
  }
3198
3212
  if (slack.toLowerCase().startsWith("member:")) {
@@ -3217,11 +3231,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3217
3231
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
3218
3232
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
3219
3233
  function isolatedCiRuntimeEventReadHeaders(env) {
3220
- const schema = _optionalChain([env, 'access', _131 => _131.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _132 => _132.trim, 'call', _133 => _133()]);
3221
- if (_optionalChain([env, 'access', _134 => _134.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3234
+ const schema = _optionalChain([env, 'access', _134 => _134.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()]);
3235
+ if (_optionalChain([env, 'access', _137 => _137.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3222
3236
  return void 0;
3223
3237
  }
3224
- const token = _optionalChain([env, 'access', _137 => _137.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()]);
3238
+ const token = _optionalChain([env, 'access', _140 => _140.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]);
3225
3239
  if (!token) {
3226
3240
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3227
3241
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -3229,7 +3243,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3229
3243
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3230
3244
  );
3231
3245
  }
3232
- return { [_chunkCWSLUNA6js.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3246
+ return { [_chunkLPTBHNGBjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3233
3247
  }
3234
3248
  function sleep(ms) {
3235
3249
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -3244,7 +3258,7 @@ function isTransientCompileManifestError(error) {
3244
3258
  );
3245
3259
  }
3246
3260
  function requireCompileManifestResponse(response, playName) {
3247
- const compilerManifest = _optionalChain([response, 'optionalAccess', _140 => _140.compilerManifest]);
3261
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _143 => _143.compilerManifest]);
3248
3262
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
3249
3263
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3250
3264
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -3296,7 +3310,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
3296
3310
  }
3297
3311
  function searchParams(options) {
3298
3312
  const params = new URLSearchParams();
3299
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _141 => _141.query, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()]), () => ( "")));
3313
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _144 => _144.query, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()]), () => ( "")));
3300
3314
  params.set(
3301
3315
  "include_search_debug",
3302
3316
  options.includeSearchDebug ? "true" : "false"
@@ -3306,13 +3320,13 @@ function searchParams(options) {
3306
3320
  if (options.offset !== void 0) {
3307
3321
  params.set("offset", String(options.offset));
3308
3322
  }
3309
- if (_optionalChain([options, 'access', _144 => _144.categories, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) {
3323
+ if (_optionalChain([options, 'access', _147 => _147.categories, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()])) {
3310
3324
  params.set("categories", options.categories.trim());
3311
3325
  }
3312
- if (_optionalChain([options, 'access', _147 => _147.searchTerms, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()])) {
3326
+ if (_optionalChain([options, 'access', _150 => _150.searchTerms, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
3313
3327
  params.set("search_terms", options.searchTerms.trim());
3314
3328
  }
3315
- if (_optionalChain([options, 'access', _150 => _150.task, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) params.set("task", options.task.trim());
3329
+ if (_optionalChain([options, 'access', _153 => _153.task, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()])) params.set("task", options.task.trim());
3316
3330
  return params;
3317
3331
  }
3318
3332
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3436,9 +3450,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3436
3450
  runId: status.runId || fallbackRunId,
3437
3451
  result: _nullishCoalesce(status.package, () => ( status.result)),
3438
3452
  ...status.package ? { package: status.package } : {},
3439
- logs: _nullishCoalesce(_optionalChain([status, 'access', _153 => _153.progress, 'optionalAccess', _154 => _154.logs]), () => ( [])),
3453
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _156 => _156.progress, 'optionalAccess', _157 => _157.logs]), () => ( [])),
3440
3454
  durationMs: Date.now() - startedAt,
3441
- error: _nullishCoalesce(_optionalChain([status, 'access', _155 => _155.progress, 'optionalAccess', _156 => _156.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3455
+ error: _nullishCoalesce(_optionalChain([status, 'access', _158 => _158.progress, 'optionalAccess', _159 => _159.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3442
3456
  };
3443
3457
  }
3444
3458
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -3537,6 +3551,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3537
3551
  usageEvent: (requestId) => this.getBillingUsageEvent(requestId),
3538
3552
  usageEvents: (options) => this.getBillingUsageEvents(options),
3539
3553
  usage: (options) => this.getBillingUsage(options),
3554
+ reuse: () => this.http.get("/api/v2/usage/reuse"),
3540
3555
  targetPlans: (options) => this.getTargetBillingPlans(options),
3541
3556
  targetStatus: () => this.getTargetBillingStatus(),
3542
3557
  autoRecharge: {
@@ -3546,7 +3561,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3546
3561
  {},
3547
3562
  {
3548
3563
  "Idempotency-Key": requireBillingIdempotencyKey(
3549
- _nullishCoalesce(_optionalChain([options, 'optionalAccess', _157 => _157.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3564
+ _nullishCoalesce(_optionalChain([options, 'optionalAccess', _160 => _160.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3550
3565
  )
3551
3566
  }
3552
3567
  ),
@@ -3555,10 +3570,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
3555
3570
  cards: {
3556
3571
  list: (options) => {
3557
3572
  const query = new URLSearchParams();
3558
- if (_optionalChain([options, 'optionalAccess', _158 => _158.limit]) !== void 0) {
3573
+ if (_optionalChain([options, 'optionalAccess', _161 => _161.limit]) !== void 0) {
3559
3574
  query.set("limit", String(options.limit));
3560
3575
  }
3561
- if (_optionalChain([options, 'optionalAccess', _159 => _159.cursor])) query.set("cursor", options.cursor);
3576
+ if (_optionalChain([options, 'optionalAccess', _162 => _162.cursor])) query.set("cursor", options.cursor);
3562
3577
  const suffix = query.size > 0 ? `?${query.toString()}` : "";
3563
3578
  return this.http.get(
3564
3579
  `/api/v2/billing/payment-methods${suffix}`
@@ -3566,7 +3581,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3566
3581
  },
3567
3582
  add: (options) => this.http.post(
3568
3583
  "/api/v2/billing/payment-method/setup",
3569
- { make_default: _optionalChain([options, 'optionalAccess', _160 => _160.makeDefault]) === true }
3584
+ { make_default: _optionalChain([options, 'optionalAccess', _163 => _163.makeDefault]) === true }
3570
3585
  ),
3571
3586
  setDefault: (options) => this.http.post(
3572
3587
  "/api/v2/billing/payment-methods/default",
@@ -3590,7 +3605,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3590
3605
  };
3591
3606
  this.workspaces = {
3592
3607
  members: (options) => {
3593
- const query = _optionalChain([options, 'optionalAccess', _161 => _161.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3608
+ const query = _optionalChain([options, 'optionalAccess', _164 => _164.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3594
3609
  return this.http.get(`/api/v2/auth/workspace/members${query}`);
3595
3610
  },
3596
3611
  setMemberGrants: (memberId, grants) => this.http.patch(
@@ -3642,7 +3657,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3642
3657
  check: (definition) => this.checkMonitor(definition),
3643
3658
  preview: (definition, options) => this.previewMonitor(definition, options),
3644
3659
  deploy: (definition, options) => this.deployMonitor(definition, options),
3645
- sync: (definition, options) => _optionalChain([options, 'optionalAccess', _162 => _162.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3660
+ sync: (definition, options) => _optionalChain([options, 'optionalAccess', _165 => _165.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3646
3661
  list: (options) => this.listMonitors(options),
3647
3662
  ledger: (options) => this.listMonitorLedger(options),
3648
3663
  ledgerGet: (key) => this.getMonitorLedgerEntry(key),
@@ -3654,13 +3669,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3654
3669
  update: (key, patch) => this.updateMonitor(key, patch),
3655
3670
  delete: (key, options) => this.deleteMonitor(key, options),
3656
3671
  reactivate: (key, options) => this.reactivateMonitor(key, options),
3657
- start: (key, options) => _optionalChain([options, 'optionalAccess', _163 => _163.dryRun]) ? this.submitMonitorBatch({
3672
+ start: (key, options) => _optionalChain([options, 'optionalAccess', _166 => _166.dryRun]) ? this.submitMonitorBatch({
3658
3673
  kind: "reactivate",
3659
3674
  scope: { kind: "keys", monitorKeys: [key] },
3660
3675
  dryRun: true,
3661
3676
  idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3662
3677
  }) : this.submitScalarMonitorLifecycle(key, "start", options),
3663
- stop: (key, options) => _optionalChain([options, 'optionalAccess', _164 => _164.dryRun]) ? this.submitMonitorBatch({
3678
+ stop: (key, options) => _optionalChain([options, 'optionalAccess', _167 => _167.dryRun]) ? this.submitMonitorBatch({
3664
3679
  kind: "deactivate",
3665
3680
  scope: { kind: "keys", monitorKeys: [key] },
3666
3681
  dryRun: true,
@@ -3714,8 +3729,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3714
3729
  /** List this workspace's views, most recently changed first. */
3715
3730
  async listViews(input) {
3716
3731
  const params = new URLSearchParams();
3717
- if (_optionalChain([input, 'optionalAccess', _165 => _165.cursor])) params.set("cursor", input.cursor);
3718
- if (_optionalChain([input, 'optionalAccess', _166 => _166.limit])) params.set("limit", String(input.limit));
3732
+ if (_optionalChain([input, 'optionalAccess', _168 => _168.cursor])) params.set("cursor", input.cursor);
3733
+ if (_optionalChain([input, 'optionalAccess', _169 => _169.limit])) params.set("limit", String(input.limit));
3719
3734
  const query = params.size > 0 ? `?${params}` : "";
3720
3735
  return await this.http.get(`/api/v2/views${query}`);
3721
3736
  }
@@ -3745,9 +3760,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3745
3760
  }
3746
3761
  /** The view's share links, newest first. Their tokens are never returned. */
3747
3762
  async listViewShareLinks(id) {
3748
- return await this.http.get(
3749
- `/api/v2/views/${encodeURIComponent(id)}/links`
3750
- );
3763
+ return await this.http.get(`/api/v2/views/${encodeURIComponent(id)}/links`);
3751
3764
  }
3752
3765
  /**
3753
3766
  * Create a share link. `url` in the result is the only copy of the link;
@@ -3772,8 +3785,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3772
3785
  /** Every run of the view's Play, newest first. */
3773
3786
  async listViewRuns(id, input) {
3774
3787
  const params = new URLSearchParams();
3775
- if (_optionalChain([input, 'optionalAccess', _167 => _167.limit])) params.set("limit", String(input.limit));
3776
- if (_optionalChain([input, 'optionalAccess', _168 => _168.offset])) params.set("offset", String(input.offset));
3788
+ if (_optionalChain([input, 'optionalAccess', _170 => _170.limit])) params.set("limit", String(input.limit));
3789
+ if (_optionalChain([input, 'optionalAccess', _171 => _171.offset])) params.set("offset", String(input.offset));
3777
3790
  const query = params.size > 0 ? `?${params}` : "";
3778
3791
  return await this.http.get(
3779
3792
  `/api/v2/views/${encodeURIComponent(id)}/runs${query}`
@@ -3861,17 +3874,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3861
3874
  */
3862
3875
  async listTools(options) {
3863
3876
  const params = new URLSearchParams();
3864
- if (_optionalChain([options, 'optionalAccess', _169 => _169.categories, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()])) {
3877
+ if (_optionalChain([options, 'optionalAccess', _172 => _172.categories, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
3865
3878
  params.set("categories", options.categories.trim());
3866
3879
  }
3867
- if (_optionalChain([options, 'optionalAccess', _172 => _172.tags, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
3880
+ if (_optionalChain([options, 'optionalAccess', _175 => _175.tags, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()])) {
3868
3881
  params.set("tags", options.tags.trim());
3869
3882
  }
3870
- if (_optionalChain([options, 'optionalAccess', _175 => _175.grep, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()])) {
3883
+ if (_optionalChain([options, 'optionalAccess', _178 => _178.grep, 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()])) {
3871
3884
  params.set("grep", options.grep.trim());
3872
3885
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3873
3886
  }
3874
- params.set("compact", _optionalChain([options, 'optionalAccess', _178 => _178.compact]) === true ? "true" : "false");
3887
+ params.set("compact", _optionalChain([options, 'optionalAccess', _181 => _181.compact]) === true ? "true" : "false");
3875
3888
  const suffix = params.toString() ? `?${params.toString()}` : "";
3876
3889
  const res = await this.http.get(
3877
3890
  `/api/v2/tools${suffix}`
@@ -3904,7 +3917,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3904
3917
  const params = new URLSearchParams({
3905
3918
  view: "category",
3906
3919
  categories: normalizedCategory,
3907
- compact: _optionalChain([options, 'optionalAccess', _179 => _179.compact]) === true ? "true" : "false"
3920
+ compact: _optionalChain([options, 'optionalAccess', _182 => _182.compact]) === true ? "true" : "false"
3908
3921
  });
3909
3922
  const response = await this.http.get(
3910
3923
  `/api/v2/tools?${params}`
@@ -3919,7 +3932,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3919
3932
  }
3920
3933
  /** List discoverable providers without requiring a local plugin catalog. */
3921
3934
  async listProviders(options) {
3922
- const suffix = _optionalChain([options, 'optionalAccess', _180 => _180.changed]) ? "?changed=true" : "";
3935
+ const suffix = _optionalChain([options, 'optionalAccess', _183 => _183.changed]) ? "?changed=true" : "";
3923
3936
  const res = await this.http.get(
3924
3937
  `/api/v2/tools/providers${suffix}`
3925
3938
  );
@@ -3950,8 +3963,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3950
3963
  */
3951
3964
  async search(options = {}) {
3952
3965
  const params = searchParams(options);
3953
- if (_optionalChain([options, 'access', _181 => _181.types, 'optionalAccess', _182 => _182.length])) params.set("types", options.types.join(","));
3954
- if (_optionalChain([options, 'access', _183 => _183.exclude, 'optionalAccess', _184 => _184.length])) {
3966
+ if (_optionalChain([options, 'access', _184 => _184.types, 'optionalAccess', _185 => _185.length])) params.set("types", options.types.join(","));
3967
+ if (_optionalChain([options, 'access', _186 => _186.exclude, 'optionalAccess', _187 => _187.length])) {
3955
3968
  params.set("exclude", options.exclude.join(","));
3956
3969
  }
3957
3970
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3973,7 +3986,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3973
3986
  * ```
3974
3987
  */
3975
3988
  async getTool(toolId, options) {
3976
- if (_optionalChain([options, 'optionalAccess', _185 => _185.cliInvocationId]) !== void 0) {
3989
+ if (_optionalChain([options, 'optionalAccess', _188 => _188.cliInvocationId]) !== void 0) {
3977
3990
  validateCliInvocationId(options.cliInvocationId);
3978
3991
  }
3979
3992
  return this.http.request(
@@ -3986,7 +3999,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3986
3999
  retryApiErrors: true,
3987
4000
  headers: {
3988
4001
  "x-deepline-tool-meta-only": "1",
3989
- ..._optionalChain([options, 'optionalAccess', _186 => _186.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
4002
+ ..._optionalChain([options, 'optionalAccess', _189 => _189.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3990
4003
  }
3991
4004
  }
3992
4005
  );
@@ -4077,7 +4090,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4077
4090
  return this.http.post(
4078
4091
  "/api/v2/ingestion/repair",
4079
4092
  {
4080
- ..._optionalChain([input, 'optionalAccess', _187 => _187.provider]) ? { provider: input.provider } : {}
4093
+ ..._optionalChain([input, 'optionalAccess', _190 => _190.provider]) ? { provider: input.provider } : {}
4081
4094
  }
4082
4095
  );
4083
4096
  }
@@ -4132,17 +4145,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4132
4145
  const prepared = await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4133
4146
  this.http,
4134
4147
  resolved.request,
4135
- _optionalChain([options, 'optionalAccess', _188 => _188.onSubmission]),
4148
+ _optionalChain([options, 'optionalAccess', _191 => _191.onSubmission]),
4136
4149
  options
4137
4150
  );
4138
4151
  const bodyJson = JSON.stringify(prepared.body);
4139
- const runtimeHeaders = runtimeSelectionHeaders(
4152
+ const runtimeHeaders = playRunStartHeaders(
4140
4153
  resolved.runtime,
4141
4154
  this.environment
4142
4155
  );
4143
- const headers = _optionalChain([options, 'optionalAccess', _189 => _189.cliAdmission]) ? {
4156
+ const headers = _optionalChain([options, 'optionalAccess', _192 => _192.cliAdmission]) ? {
4144
4157
  ...runtimeHeaders,
4145
- "X-Deepline-API-Major": String(_chunkCWSLUNA6js.SDK_API_MAJOR)
4158
+ "X-Deepline-API-Major": String(_chunkLPTBHNGBjs.SDK_API_MAJOR)
4146
4159
  } : runtimeHeaders;
4147
4160
  const http = this.http;
4148
4161
  let submitted = false;
@@ -4157,12 +4170,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4157
4170
  );
4158
4171
  }
4159
4172
  if (submitted) {
4160
- if (!_optionalChain([options, 'optionalAccess', _190 => _190.callerIntentV2])) {
4173
+ if (!_optionalChain([options, 'optionalAccess', _193 => _193.callerIntentV2])) {
4161
4174
  await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4162
4175
  http,
4163
4176
  JSON.parse(bodyJson),
4164
4177
  void 0,
4165
- { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _191 => _191.signal]), () => ( _optionalChain([options, 'optionalAccess', _192 => _192.signal]))) }
4178
+ { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _194 => _194.signal]), () => ( _optionalChain([options, 'optionalAccess', _195 => _195.signal]))) }
4166
4179
  );
4167
4180
  }
4168
4181
  }
@@ -4175,9 +4188,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4175
4188
  prepared.supportsCallerIntent,
4176
4189
  headers,
4177
4190
  {
4178
- cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _193 => _193.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _194 => _194.cliAdmission]))),
4179
- callerIntentV2: _optionalChain([options, 'optionalAccess', _195 => _195.callerIntentV2]),
4180
- signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _196 => _196.signal]), () => ( _optionalChain([options, 'optionalAccess', _197 => _197.signal])))
4191
+ cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _196 => _196.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _197 => _197.cliAdmission]))),
4192
+ callerIntentV2: _optionalChain([options, 'optionalAccess', _198 => _198.callerIntentV2]),
4193
+ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _199 => _199.signal]), () => ( _optionalChain([options, 'optionalAccess', _200 => _200.signal])))
4181
4194
  }
4182
4195
  );
4183
4196
  } catch (error) {
@@ -4196,26 +4209,26 @@ var DeeplineClient = (_class = class _DeeplineClient {
4196
4209
  );
4197
4210
  }
4198
4211
  if (submitted) {
4199
- if (!_optionalChain([options, 'optionalAccess', _198 => _198.callerIntentV2])) {
4212
+ if (!_optionalChain([options, 'optionalAccess', _201 => _201.callerIntentV2])) {
4200
4213
  await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4201
4214
  http,
4202
4215
  JSON.parse(bodyJson),
4203
4216
  void 0,
4204
- { signal: _optionalChain([streamOptions, 'optionalAccess', _199 => _199.signal]) }
4217
+ { signal: _optionalChain([streamOptions, 'optionalAccess', _202 => _202.signal]) }
4205
4218
  );
4206
4219
  }
4207
4220
  }
4208
4221
  submitted = true;
4209
- const streamPath = _optionalChain([options, 'optionalAccess', _200 => _200.callerIntentV2]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _201 => _201.cliAdmission]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkCQDQNZGHjs.PLAY_RUN_START_STREAM_PATH;
4222
+ const streamPath = _optionalChain([options, 'optionalAccess', _203 => _203.callerIntentV2]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _204 => _204.cliAdmission]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkCQDQNZGHjs.PLAY_RUN_START_STREAM_PATH;
4210
4223
  let cliAdmissionSupported = false;
4211
4224
  try {
4212
4225
  for await (const event of http.streamSse(streamPath, {
4213
4226
  method: "POST",
4214
4227
  body: JSON.parse(bodyJson),
4215
4228
  headers,
4216
- signal: _optionalChain([streamOptions, 'optionalAccess', _202 => _202.signal]),
4229
+ signal: _optionalChain([streamOptions, 'optionalAccess', _205 => _205.signal]),
4217
4230
  exactUrlOnly: true,
4218
- ..._optionalChain([options, 'optionalAccess', _203 => _203.cliAdmission]) ? {
4231
+ ..._optionalChain([options, 'optionalAccess', _206 => _206.cliAdmission]) ? {
4219
4232
  onResponse: (response) => {
4220
4233
  cliAdmissionSupported = response.headers.get(_chunkCQDQNZGHjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4221
4234
  }
@@ -4224,7 +4237,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4224
4237
  if (event.scope === "play") yield event;
4225
4238
  }
4226
4239
  } catch (error) {
4227
- if (_optionalChain([options, 'optionalAccess', _204 => _204.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4240
+ if (_optionalChain([options, 'optionalAccess', _207 => _207.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4228
4241
  if (options.callerIntentV2) {
4229
4242
  submitted = false;
4230
4243
  throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
@@ -4262,7 +4275,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4262
4275
  */
4263
4276
  async *startPlayRunStream(request, options) {
4264
4277
  const prepared = await this.preparePlayRunAdmission(request, options);
4265
- yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _205 => _205.signal]) });
4278
+ yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _208 => _208.signal]) });
4266
4279
  }
4267
4280
  /**
4268
4281
  * Register a bundled play artifact.
@@ -4415,7 +4428,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4415
4428
  compilerManifest,
4416
4429
  ...input.input ? { input: input.input } : {},
4417
4430
  ...input.inputFile ? { inputFile: input.inputFile } : {},
4418
- ..._optionalChain([input, 'access', _206 => _206.packagedFiles, 'optionalAccess', _207 => _207.length]) ? { packagedFiles: input.packagedFiles } : {},
4431
+ ..._optionalChain([input, 'access', _209 => _209.packagedFiles, 'optionalAccess', _210 => _210.length]) ? { packagedFiles: input.packagedFiles } : {},
4419
4432
  ...input.force ? { force: true } : {},
4420
4433
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
4421
4434
  });
@@ -4445,29 +4458,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
4445
4458
  * ```
4446
4459
  */
4447
4460
  async submitPlay(code, csvPath, name, options) {
4448
- const runtimeInput = _optionalChain([options, 'optionalAccess', _208 => _208.input]) ? { ...options.input } : {};
4461
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _211 => _211.input]) ? { ...options.input } : {};
4449
4462
  if (csvPath) {
4450
4463
  runtimeInput.file = csvPath;
4451
4464
  }
4452
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _209 => _209.sourceCode]), () => ( code));
4453
- const artifact = _optionalChain([options, 'optionalAccess', _210 => _210.artifact]);
4454
- if (!_optionalChain([name, 'optionalAccess', _211 => _211.trim, 'call', _212 => _212()])) {
4465
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.sourceCode]), () => ( code));
4466
+ const artifact = _optionalChain([options, 'optionalAccess', _213 => _213.artifact]);
4467
+ if (!_optionalChain([name, 'optionalAccess', _214 => _214.trim, 'call', _215 => _215()])) {
4455
4468
  throw new Error("submitPlay requires a play name.");
4456
4469
  }
4457
4470
  if (!artifact) {
4458
4471
  throw new Error("submitPlay requires a bundled play artifact.");
4459
4472
  }
4460
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _213 => _213.compilerManifest]), async () => ( await this.compilePlayManifest({
4473
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _216 => _216.compilerManifest]), async () => ( await this.compilePlayManifest({
4461
4474
  name,
4462
4475
  sourceCode,
4463
- sourceFiles: _optionalChain([options, 'optionalAccess', _214 => _214.sourceFiles]),
4476
+ sourceFiles: _optionalChain([options, 'optionalAccess', _217 => _217.sourceFiles]),
4464
4477
  artifact
4465
4478
  })));
4466
4479
  const registeredArtifact = await this.registerPlayArtifact({
4467
4480
  name,
4468
4481
  sourceCode,
4469
- sourceFiles: _optionalChain([options, 'optionalAccess', _215 => _215.sourceFiles]),
4470
- description: _optionalChain([options, 'optionalAccess', _216 => _216.description]),
4482
+ sourceFiles: _optionalChain([options, 'optionalAccess', _218 => _218.sourceFiles]),
4483
+ description: _optionalChain([options, 'optionalAccess', _219 => _219.description]),
4471
4484
  artifact,
4472
4485
  compilerManifest,
4473
4486
  publish: false
@@ -4481,17 +4494,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4481
4494
  name,
4482
4495
  artifactStorageKey: registeredArtifact.artifactStorageKey,
4483
4496
  sourceCode,
4484
- description: _optionalChain([options, 'optionalAccess', _217 => _217.description]),
4497
+ description: _optionalChain([options, 'optionalAccess', _220 => _220.description]),
4485
4498
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
4486
4499
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
4487
4500
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
4488
4501
  runtimeArtifact: artifact,
4489
4502
  compilerManifest,
4490
4503
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4491
- ..._optionalChain([options, 'optionalAccess', _218 => _218.inputFile]) ? { inputFile: options.inputFile } : {},
4492
- ..._optionalChain([options, 'optionalAccess', _219 => _219.packagedFiles, 'optionalAccess', _220 => _220.length]) ? { packagedFiles: options.packagedFiles } : {},
4493
- ..._optionalChain([options, 'optionalAccess', _221 => _221.force]) ? { force: true } : {},
4494
- ..._optionalChain([options, 'optionalAccess', _222 => _222.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4504
+ ..._optionalChain([options, 'optionalAccess', _221 => _221.inputFile]) ? { inputFile: options.inputFile } : {},
4505
+ ..._optionalChain([options, 'optionalAccess', _222 => _222.packagedFiles, 'optionalAccess', _223 => _223.length]) ? { packagedFiles: options.packagedFiles } : {},
4506
+ ..._optionalChain([options, 'optionalAccess', _224 => _224.force]) ? { force: true } : {},
4507
+ ..._optionalChain([options, 'optionalAccess', _225 => _225.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4495
4508
  });
4496
4509
  }
4497
4510
  /**
@@ -4567,13 +4580,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4567
4580
  for await (const event of watchRunEvents({
4568
4581
  http: this.http,
4569
4582
  runId: workflowId,
4570
- signal: _optionalChain([options, 'optionalAccess', _223 => _223.signal]),
4571
- onNotice: _optionalChain([options, 'optionalAccess', _224 => _224.onNotice]),
4572
- onRetry: _optionalChain([options, 'optionalAccess', _225 => _225.onRetry]),
4573
- deferLogs: _optionalChain([options, 'optionalAccess', _226 => _226.deferLogs]),
4574
- omitTerminalLogs: _optionalChain([options, 'optionalAccess', _227 => _227.omitTerminalLogs]),
4575
- onPoll: _optionalChain([options, 'optionalAccess', _228 => _228.onPoll]),
4576
- ..._optionalChain([options, 'optionalAccess', _229 => _229.terminalStatus]) ? {
4583
+ signal: _optionalChain([options, 'optionalAccess', _226 => _226.signal]),
4584
+ onNotice: _optionalChain([options, 'optionalAccess', _227 => _227.onNotice]),
4585
+ onRetry: _optionalChain([options, 'optionalAccess', _228 => _228.onRetry]),
4586
+ deferLogs: _optionalChain([options, 'optionalAccess', _229 => _229.deferLogs]),
4587
+ omitTerminalLogs: _optionalChain([options, 'optionalAccess', _230 => _230.omitTerminalLogs]),
4588
+ onPoll: _optionalChain([options, 'optionalAccess', _231 => _231.onPoll]),
4589
+ ..._optionalChain([options, 'optionalAccess', _232 => _232.terminalStatus]) ? {
4577
4590
  terminalStatus: {
4578
4591
  ...options.terminalStatus,
4579
4592
  onStatus: async (raw, expectedStatus) => {
@@ -4583,7 +4596,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4583
4596
  `Run watch returned a mismatched terminal status for ${workflowId}.`
4584
4597
  );
4585
4598
  }
4586
- await _optionalChain([options, 'access', _230 => _230.terminalStatus, 'optionalAccess', _231 => _231.onStatus, 'call', _232 => _232(status)]);
4599
+ await _optionalChain([options, 'access', _233 => _233.terminalStatus, 'optionalAccess', _234 => _234.onStatus, 'call', _235 => _235(status)]);
4587
4600
  }
4588
4601
  }
4589
4602
  } : {}
@@ -4598,12 +4611,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4598
4611
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4599
4612
  */
4600
4613
  async *streamPlayRunEvents(workflowId, options) {
4601
- const headers = _optionalChain([options, 'optionalAccess', _233 => _233.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4614
+ const headers = _optionalChain([options, 'optionalAccess', _236 => _236.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4602
4615
  const params = new URLSearchParams();
4603
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _234 => _234.mode]), () => ( "cli")));
4616
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _237 => _237.mode]), () => ( "cli")));
4604
4617
  for await (const event of this.http.streamSse(
4605
4618
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4606
- { signal: _optionalChain([options, 'optionalAccess', _235 => _235.signal]), headers }
4619
+ { signal: _optionalChain([options, 'optionalAccess', _238 => _238.signal]), headers }
4607
4620
  )) {
4608
4621
  if (event.scope === "play") {
4609
4622
  yield event;
@@ -4619,8 +4632,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4619
4632
  */
4620
4633
  async *observeRunEvents(runId, options) {
4621
4634
  yield* this.watchRunEvents(runId, {
4622
- signal: _optionalChain([options, 'optionalAccess', _236 => _236.signal]),
4623
- onNotice: _optionalChain([options, 'optionalAccess', _237 => _237.onNotice])
4635
+ signal: _optionalChain([options, 'optionalAccess', _239 => _239.signal]),
4636
+ onNotice: _optionalChain([options, 'optionalAccess', _240 => _240.onNotice])
4624
4637
  });
4625
4638
  }
4626
4639
  /** Poll snapshots to terminal status and return the durable package. */
@@ -4628,9 +4641,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4628
4641
  let terminalObserved = false;
4629
4642
  let terminalStatus = null;
4630
4643
  for await (const event of this.watchRunEvents(runId, {
4631
- signal: _optionalChain([options, 'optionalAccess', _238 => _238.signal]),
4632
- onNotice: _optionalChain([options, 'optionalAccess', _239 => _239.onNotice]),
4633
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _240 => _240.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _241 => _241.onReconnect]))),
4644
+ signal: _optionalChain([options, 'optionalAccess', _241 => _241.signal]),
4645
+ onNotice: _optionalChain([options, 'optionalAccess', _242 => _242.onNotice]),
4646
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _243 => _243.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _244 => _244.onReconnect]))),
4634
4647
  terminalStatus: {
4635
4648
  runStatus: true,
4636
4649
  onStatus: (status) => {
@@ -4638,12 +4651,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4638
4651
  }
4639
4652
  }
4640
4653
  })) {
4641
- _optionalChain([options, 'optionalAccess', _242 => _242.onEvent, 'optionalCall', _243 => _243(event)]);
4654
+ _optionalChain([options, 'optionalAccess', _245 => _245.onEvent, 'optionalCall', _246 => _246(event)]);
4642
4655
  if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4643
4656
  terminalObserved = true;
4644
4657
  }
4645
4658
  }
4646
- if (_optionalChain([options, 'optionalAccess', _244 => _244.signal, 'optionalAccess', _245 => _245.aborted])) {
4659
+ if (_optionalChain([options, 'optionalAccess', _247 => _247.signal, 'optionalAccess', _248 => _248.aborted])) {
4647
4660
  throw new (0, _chunkBBTKAASQjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4648
4661
  }
4649
4662
  const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
@@ -4723,7 +4736,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4723
4736
  /** List the org's workflows. `GET /api/v2/workflows`. */
4724
4737
  async listWorkflows(options) {
4725
4738
  const params = new URLSearchParams();
4726
- if (typeof _optionalChain([options, 'optionalAccess', _246 => _246.limit]) === "number") {
4739
+ if (typeof _optionalChain([options, 'optionalAccess', _249 => _249.limit]) === "number") {
4727
4740
  params.set("limit", String(options.limit));
4728
4741
  }
4729
4742
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4776,7 +4789,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4776
4789
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4777
4790
  async listWorkflowRuns(id, options) {
4778
4791
  const params = new URLSearchParams();
4779
- if (typeof _optionalChain([options, 'optionalAccess', _247 => _247.limit]) === "number") {
4792
+ if (typeof _optionalChain([options, 'optionalAccess', _250 => _250.limit]) === "number") {
4780
4793
  params.set("limit", String(options.limit));
4781
4794
  }
4782
4795
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4812,16 +4825,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4812
4825
  */
4813
4826
  async getRunStatus(runId, options) {
4814
4827
  const params = new URLSearchParams();
4815
- if (_optionalChain([options, 'optionalAccess', _248 => _248.full]) === true) {
4828
+ if (_optionalChain([options, 'optionalAccess', _251 => _251.full]) === true) {
4816
4829
  params.set("full", "true");
4817
4830
  }
4818
- if (_optionalChain([options, 'optionalAccess', _249 => _249.configuration]) === true) {
4831
+ if (_optionalChain([options, 'optionalAccess', _252 => _252.configuration]) === true) {
4819
4832
  params.append("include", "configuration");
4820
4833
  }
4821
- if (_optionalChain([options, 'optionalAccess', _250 => _250.performance]) === true) {
4834
+ if (_optionalChain([options, 'optionalAccess', _253 => _253.performance]) === true) {
4822
4835
  params.append("include", "performance");
4823
4836
  }
4824
- if (_optionalChain([options, 'optionalAccess', _251 => _251.retries]) === true) {
4837
+ if (_optionalChain([options, 'optionalAccess', _254 => _254.retries]) === true) {
4825
4838
  params.append("include", "retries");
4826
4839
  }
4827
4840
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4829,7 +4842,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4829
4842
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4830
4843
  { headers: { "x-deepline-run-status": "1" } }
4831
4844
  );
4832
- if (_optionalChain([options, 'optionalAccess', _252 => _252.configuration]) === true && !Object.hasOwn(response, "contract")) {
4845
+ if (_optionalChain([options, 'optionalAccess', _255 => _255.configuration]) === true && !Object.hasOwn(response, "contract")) {
4833
4846
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4834
4847
  "This server does not support recorded configuration reads.",
4835
4848
  void 0,
@@ -4837,7 +4850,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4837
4850
  );
4838
4851
  }
4839
4852
  const status = normalizePlayStatus(response);
4840
- if (_optionalChain([options, 'optionalAccess', _253 => _253.failedLogs]) !== true || status.status !== "failed") {
4853
+ if (_optionalChain([options, 'optionalAccess', _256 => _256.failedLogs]) !== true || status.status !== "failed") {
4841
4854
  return status;
4842
4855
  }
4843
4856
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4926,7 +4939,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4926
4939
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4927
4940
  async getRunsHistory(options = {}) {
4928
4941
  const params = new URLSearchParams();
4929
- const search = _optionalChain([options, 'access', _254 => _254.search, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
4942
+ const search = _optionalChain([options, 'access', _257 => _257.search, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
4930
4943
  if (search && search.length > 200) {
4931
4944
  throw new Error("Run search must be at most 200 characters.");
4932
4945
  }
@@ -4952,16 +4965,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4952
4965
  }
4953
4966
  /** Read one run page without discarding server pagination metadata. */
4954
4967
  async listRunsPage(options) {
4955
- const playName = _optionalChain([options, 'access', _257 => _257.play, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
4968
+ const playName = _optionalChain([options, 'access', _260 => _260.play, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
4956
4969
  const params = new URLSearchParams();
4957
4970
  if (playName) {
4958
4971
  params.set("play", playName);
4959
4972
  }
4960
- const status = _optionalChain([options, 'access', _260 => _260.status, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
4973
+ const status = _optionalChain([options, 'access', _263 => _263.status, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]);
4961
4974
  if (status) {
4962
4975
  params.set("status", status);
4963
4976
  }
4964
- const node = _optionalChain([options, 'access', _263 => _263.node, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]);
4977
+ const node = _optionalChain([options, 'access', _266 => _266.node, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
4965
4978
  if (node) {
4966
4979
  if (!playName)
4967
4980
  throw new Error("runs.list options.node requires options.play.");
@@ -5035,8 +5048,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5035
5048
  * A different key starts another rerun.
5036
5049
  */
5037
5050
  async rerun(runId, options) {
5038
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _266 => _266.idempotencyKey, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
5039
- if (_optionalChain([options, 'optionalAccess', _269 => _269.idempotencyKey]) !== void 0 && !idempotencyKey) {
5051
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _269 => _269.idempotencyKey, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]);
5052
+ if (_optionalChain([options, 'optionalAccess', _272 => _272.idempotencyKey]) !== void 0 && !idempotencyKey) {
5040
5053
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5041
5054
  "runs.rerun idempotencyKey must not be empty.",
5042
5055
  void 0,
@@ -5045,7 +5058,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5045
5058
  }
5046
5059
  return this.http.post(
5047
5060
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
5048
- _optionalChain([options, 'optionalAccess', _270 => _270.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5061
+ _optionalChain([options, 'optionalAccess', _273 => _273.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5049
5062
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
5050
5063
  );
5051
5064
  }
@@ -5072,21 +5085,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
5072
5085
  * ```
5073
5086
  */
5074
5087
  async getRunLogs(runId, options) {
5075
- if (_optionalChain([options, 'optionalAccess', _271 => _271.all]) === true && options.failed === true) {
5088
+ if (_optionalChain([options, 'optionalAccess', _274 => _274.all]) === true && options.failed === true) {
5076
5089
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5077
5090
  "runs.logs cannot combine all and failed views.",
5078
5091
  void 0,
5079
5092
  "INVALID_RUN_LOG_VIEW"
5080
5093
  );
5081
5094
  }
5082
- if (_optionalChain([options, 'optionalAccess', _272 => _272.cursor]) !== void 0 && options.failed === true) {
5095
+ if (_optionalChain([options, 'optionalAccess', _275 => _275.cursor]) !== void 0 && options.failed === true) {
5083
5096
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5084
5097
  "runs.logs cannot combine failed with cursor.",
5085
5098
  void 0,
5086
5099
  "INVALID_RUN_LOG_VIEW"
5087
5100
  );
5088
5101
  }
5089
- if (_optionalChain([options, 'optionalAccess', _273 => _273.failed]) === true) {
5102
+ if (_optionalChain([options, 'optionalAccess', _276 => _276.failed]) === true) {
5090
5103
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
5091
5104
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
5092
5105
  const page = await this.http.get(
@@ -5111,18 +5124,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
5111
5124
  ...page.logsTruncated ? { logsTruncated: true } : {}
5112
5125
  };
5113
5126
  }
5114
- const beforeSequence = _optionalChain([options, 'optionalAccess', _274 => _274.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
5115
- const limit = _optionalChain([options, 'optionalAccess', _275 => _275.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _276 => _276.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
5127
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _277 => _277.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
5128
+ const limit = _optionalChain([options, 'optionalAccess', _278 => _278.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _279 => _279.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
5116
5129
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
5117
5130
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
5118
5131
  { retryApiErrors: true }
5119
5132
  );
5120
5133
  const probe = await fetchPage(0, 1);
5121
5134
  const lastStoredSeq = probe.lastStoredSeq;
5122
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _277 => _277.entries, 'access', _278 => _278[0], 'optionalAccess', _279 => _279.seq]), () => ( null));
5135
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _280 => _280.entries, 'access', _281 => _281[0], 'optionalAccess', _282 => _282.seq]), () => ( null));
5123
5136
  const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
5124
5137
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
5125
- let afterSeq = _optionalChain([options, 'optionalAccess', _280 => _280.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5138
+ let afterSeq = _optionalChain([options, 'optionalAccess', _283 => _283.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5126
5139
  const entries = [];
5127
5140
  while (entries.length < limit && afterSeq < upperSeq) {
5128
5141
  const page = await fetchPage(
@@ -5156,7 +5169,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5156
5169
  hasMore: olderLinesExist,
5157
5170
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
5158
5171
  entries: entries.map((entry) => entry.line),
5159
- view: _optionalChain([options, 'optionalAccess', _281 => _281.all]) ? "all" : "tail",
5172
+ view: _optionalChain([options, 'optionalAccess', _284 => _284.all]) ? "all" : "tail",
5160
5173
  ...probe.logsTruncated ? { logsTruncated: true } : {}
5161
5174
  };
5162
5175
  }
@@ -5332,7 +5345,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5332
5345
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
5333
5346
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
5334
5347
  });
5335
- if (_optionalChain([input, 'access', _282 => _282.runId, 'optionalAccess', _283 => _283.trim, 'call', _284 => _284()])) {
5348
+ if (_optionalChain([input, 'access', _285 => _285.runId, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
5336
5349
  params.set("runId", input.runId.trim());
5337
5350
  }
5338
5351
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -5345,9 +5358,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5345
5358
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
5346
5359
  { signal: input.signal }
5347
5360
  );
5348
- const requestedRunId = _optionalChain([input, 'access', _285 => _285.runId, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()]) || "";
5361
+ const requestedRunId = _optionalChain([input, 'access', _288 => _288.runId, 'optionalAccess', _289 => _289.trim, 'call', _290 => _290()]) || "";
5349
5362
  if (requestedRunId) {
5350
- const confirmedRunId = _optionalChain([result, 'access', _288 => _288.scope, 'optionalAccess', _289 => _289.kind]) === "run" ? result.scope.runId.trim() : "";
5363
+ const confirmedRunId = _optionalChain([result, 'access', _291 => _291.scope, 'optionalAccess', _292 => _292.kind]) === "run" ? result.scope.runId.trim() : "";
5351
5364
  const foreignRowRunIds = [
5352
5365
  ...new Set(
5353
5366
  result.rows.map(
@@ -5355,7 +5368,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5355
5368
  ).filter((runId) => runId && runId !== requestedRunId)
5356
5369
  )
5357
5370
  ];
5358
- if (_optionalChain([result, 'access', _290 => _290.scope, 'optionalAccess', _291 => _291.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5371
+ if (_optionalChain([result, 'access', _293 => _293.scope, 'optionalAccess', _294 => _294.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5359
5372
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5360
5373
  `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.`,
5361
5374
  void 0,
@@ -5384,7 +5397,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5384
5397
  async stopRun(runId, options) {
5385
5398
  return this.http.post(
5386
5399
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
5387
- _optionalChain([options, 'optionalAccess', _292 => _292.reason]) ? { reason: options.reason } : {}
5400
+ _optionalChain([options, 'optionalAccess', _295 => _295.reason]) ? { reason: options.reason } : {}
5388
5401
  );
5389
5402
  }
5390
5403
  /**
@@ -5402,11 +5415,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5402
5415
  * The method clears workspace run-slot state without requiring each run ID.
5403
5416
  */
5404
5417
  async stopAllRuns(options) {
5405
- const dryRun = _optionalChain([options, 'optionalAccess', _293 => _293.dryRun]) === true;
5418
+ const dryRun = _optionalChain([options, 'optionalAccess', _296 => _296.dryRun]) === true;
5406
5419
  const result = await this.http.post(
5407
5420
  "/api/v2/runs/stop-all",
5408
5421
  {
5409
- ..._optionalChain([options, 'optionalAccess', _294 => _294.reason]) ? { reason: options.reason } : {},
5422
+ ..._optionalChain([options, 'optionalAccess', _297 => _297.reason]) ? { reason: options.reason } : {},
5410
5423
  ...dryRun ? { dryRun: true } : {}
5411
5424
  }
5412
5425
  );
@@ -5427,7 +5440,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5427
5440
  * `origin: "owned"` for org-owned plays.
5428
5441
  */
5429
5442
  async listPlays(options) {
5430
- if (!_optionalChain([options, 'optionalAccess', _295 => _295.grep, 'optionalAccess', _296 => _296.trim, 'call', _297 => _297()])) {
5443
+ if (!_optionalChain([options, 'optionalAccess', _298 => _298.grep, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()])) {
5431
5444
  return (await this.requestPlaysPage(options, false)).plays;
5432
5445
  }
5433
5446
  const plays = [];
@@ -5449,46 +5462,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
5449
5462
  }
5450
5463
  async requestPlaysPage(options, paginateInventory = true) {
5451
5464
  const params = new URLSearchParams();
5452
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _298 => _298.grep, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()]))
5465
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _301 => _301.grep, 'optionalAccess', _302 => _302.trim, 'call', _303 => _303()]))
5453
5466
  params.set("inventory_paginated", "1");
5454
- if (_optionalChain([options, 'optionalAccess', _301 => _301.origin])) params.set("origin", options.origin);
5455
- if (_optionalChain([options, 'optionalAccess', _302 => _302.summaryOnly])) params.set("summary_only", "1");
5456
- if (_optionalChain([options, 'optionalAccess', _303 => _303.categories])) {
5467
+ if (_optionalChain([options, 'optionalAccess', _304 => _304.origin])) params.set("origin", options.origin);
5468
+ if (_optionalChain([options, 'optionalAccess', _305 => _305.summaryOnly])) params.set("summary_only", "1");
5469
+ if (_optionalChain([options, 'optionalAccess', _306 => _306.categories])) {
5457
5470
  params.set(
5458
5471
  "categories",
5459
5472
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5460
5473
  );
5461
5474
  }
5462
- if (_optionalChain([options, 'optionalAccess', _304 => _304.categories]) || _optionalChain([options, 'optionalAccess', _305 => _305.includeToolCategories])) {
5475
+ if (_optionalChain([options, 'optionalAccess', _307 => _307.categories]) || _optionalChain([options, 'optionalAccess', _308 => _308.includeToolCategories])) {
5463
5476
  params.set("include_tool_categories", "1");
5464
5477
  }
5465
- if (_optionalChain([options, 'optionalAccess', _306 => _306.tags])) {
5478
+ if (_optionalChain([options, 'optionalAccess', _309 => _309.tags])) {
5466
5479
  params.set(
5467
5480
  "tags",
5468
5481
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
5469
5482
  );
5470
5483
  }
5471
- if (_optionalChain([options, 'optionalAccess', _307 => _307.includeArchived])) params.set("include_archived", "1");
5472
- if (_optionalChain([options, 'optionalAccess', _308 => _308.includeCostEstimates])) {
5484
+ if (_optionalChain([options, 'optionalAccess', _310 => _310.includeArchived])) params.set("include_archived", "1");
5485
+ if (_optionalChain([options, 'optionalAccess', _311 => _311.includeCostEstimates])) {
5473
5486
  params.set("include_cost_estimates", "1");
5474
5487
  }
5475
- if (_optionalChain([options, 'optionalAccess', _309 => _309.grep, 'optionalAccess', _310 => _310.trim, 'call', _311 => _311()])) {
5488
+ if (_optionalChain([options, 'optionalAccess', _312 => _312.grep, 'optionalAccess', _313 => _313.trim, 'call', _314 => _314()])) {
5476
5489
  params.set("grep", options.grep.trim());
5477
5490
  params.set("limit", "60");
5478
5491
  }
5479
- if (_optionalChain([options, 'optionalAccess', _312 => _312.limit]) !== void 0) {
5492
+ if (_optionalChain([options, 'optionalAccess', _315 => _315.limit]) !== void 0) {
5480
5493
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
5481
5494
  throw new Error("Play page limit must be a positive integer");
5482
5495
  }
5483
5496
  params.set("limit", String(options.limit));
5484
5497
  }
5485
- if (_optionalChain([options, 'optionalAccess', _313 => _313.cursor])) params.set("cursor", options.cursor);
5498
+ if (_optionalChain([options, 'optionalAccess', _316 => _316.cursor])) params.set("cursor", options.cursor);
5486
5499
  const suffix = params.size ? `?${params.toString()}` : "";
5487
5500
  const response = await this.http.get(`/api/v2/plays${suffix}`);
5488
5501
  return {
5489
5502
  plays: _nullishCoalesce(response.plays, () => ( [])),
5490
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _314 => _314.pagination, 'optionalAccess', _315 => _315.cursor]), () => ( response.cursor)), () => ( null)),
5491
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _316 => _316.pagination, 'optionalAccess', _317 => _317.hasMore]), () => ( response.hasMore)))
5503
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _317 => _317.pagination, 'optionalAccess', _318 => _318.cursor]), () => ( response.cursor)), () => ( null)),
5504
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _319 => _319.pagination, 'optionalAccess', _320 => _320.hasMore]), () => ( response.hasMore)))
5492
5505
  };
5493
5506
  }
5494
5507
  /** Read definition-level settings, independently of code revisions. */
@@ -5582,7 +5595,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5582
5595
  return this.http.post("/api/v2/integrations/connect", {
5583
5596
  provider,
5584
5597
  credentials,
5585
- ..._optionalChain([options, 'optionalAccess', _318 => _318.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5598
+ ..._optionalChain([options, 'optionalAccess', _321 => _321.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5586
5599
  });
5587
5600
  }
5588
5601
  /** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
@@ -5595,7 +5608,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5595
5608
  }
5596
5609
  /** Start provider OAuth and return the URL to open in a browser. */
5597
5610
  async startIntegrationOAuth(provider, options = {}) {
5598
- const scopes = _optionalChain([options, 'access', _319 => _319.scopes, 'optionalAccess', _320 => _320.map, 'call', _321 => _321((scope) => scope.trim()), 'access', _322 => _322.filter, 'call', _323 => _323(Boolean)]);
5611
+ const scopes = _optionalChain([options, 'access', _322 => _322.scopes, 'optionalAccess', _323 => _323.map, 'call', _324 => _324((scope) => scope.trim()), 'access', _325 => _325.filter, 'call', _326 => _326(Boolean)]);
5599
5612
  if (scopes !== void 0 && scopes.length === 0) {
5600
5613
  throw new Error("scopes must contain at least one OAuth scope.");
5601
5614
  }
@@ -5611,8 +5624,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5611
5624
  return this.http.post("/api/v2/integrations/connect", {
5612
5625
  provider: "slack",
5613
5626
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5614
- ..._optionalChain([options, 'optionalAccess', _324 => _324.successUrl]) ? { success_url: options.successUrl } : {},
5615
- ..._optionalChain([options, 'optionalAccess', _325 => _325.failureUrl]) ? { failure_url: options.failureUrl } : {}
5627
+ ..._optionalChain([options, 'optionalAccess', _327 => _327.successUrl]) ? { success_url: options.successUrl } : {},
5628
+ ..._optionalChain([options, 'optionalAccess', _328 => _328.failureUrl]) ? { failure_url: options.failureUrl } : {}
5616
5629
  });
5617
5630
  }
5618
5631
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5687,7 +5700,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5687
5700
  }
5688
5701
  const targets = input.targets.map(parseNotificationGroupTarget);
5689
5702
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5690
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _326 => _326[0], 'optionalAccess', _327 => _327.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5703
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _329 => _329[0], 'optionalAccess', _330 => _330.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5691
5704
  if (legacyEvents.length > 0 && !legacyTarget) {
5692
5705
  throw new Error(
5693
5706
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5723,7 +5736,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5723
5736
  const existingGroup = current.configuration.groups.find(
5724
5737
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5725
5738
  );
5726
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _328 => _328.groupKey]), () => ( notificationObjectKey("group")));
5739
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _331 => _331.groupKey]), () => ( notificationObjectKey("group")));
5727
5740
  const group = _nullishCoalesce(existingGroup, () => ( {
5728
5741
  groupKey,
5729
5742
  name,
@@ -5951,7 +5964,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5951
5964
  /** Read one trigger inventory page without loading run histories. */
5952
5965
  async listPlayTriggerInventory(options) {
5953
5966
  const params = new URLSearchParams({ view: "inventory" });
5954
- if (_optionalChain([options, 'optionalAccess', _329 => _329.cursor])) params.set("cursor", options.cursor);
5967
+ if (_optionalChain([options, 'optionalAccess', _332 => _332.cursor])) params.set("cursor", options.cursor);
5955
5968
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5956
5969
  }
5957
5970
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5960,7 +5973,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5960
5973
  view: "history",
5961
5974
  binding_id: bindingId
5962
5975
  });
5963
- if (_optionalChain([options, 'optionalAccess', _330 => _330.limit]) !== void 0)
5976
+ if (_optionalChain([options, 'optionalAccess', _333 => _333.limit]) !== void 0)
5964
5977
  params.set("history_limit", String(options.limit));
5965
5978
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5966
5979
  }
@@ -6148,14 +6161,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6148
6161
  */
6149
6162
  async runPlay(code, csvPath, name, options) {
6150
6163
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
6151
- input: _optionalChain([options, 'optionalAccess', _331 => _331.input]),
6152
- sourceCode: _optionalChain([options, 'optionalAccess', _332 => _332.sourceCode]),
6153
- artifact: _optionalChain([options, 'optionalAccess', _333 => _333.artifact]),
6154
- compilerManifest: _optionalChain([options, 'optionalAccess', _334 => _334.compilerManifest]),
6155
- inputFile: _optionalChain([options, 'optionalAccess', _335 => _335.inputFile]),
6156
- packagedFiles: _optionalChain([options, 'optionalAccess', _336 => _336.packagedFiles]),
6157
- force: _optionalChain([options, 'optionalAccess', _337 => _337.force]),
6158
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _338 => _338.forceToolRefresh])
6164
+ input: _optionalChain([options, 'optionalAccess', _334 => _334.input]),
6165
+ sourceCode: _optionalChain([options, 'optionalAccess', _335 => _335.sourceCode]),
6166
+ artifact: _optionalChain([options, 'optionalAccess', _336 => _336.artifact]),
6167
+ compilerManifest: _optionalChain([options, 'optionalAccess', _337 => _337.compilerManifest]),
6168
+ inputFile: _optionalChain([options, 'optionalAccess', _338 => _338.inputFile]),
6169
+ packagedFiles: _optionalChain([options, 'optionalAccess', _339 => _339.packagedFiles]),
6170
+ force: _optionalChain([options, 'optionalAccess', _340 => _340.force]),
6171
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _341 => _341.forceToolRefresh])
6159
6172
  });
6160
6173
  const start = Date.now();
6161
6174
  const state = {
@@ -6166,7 +6179,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6166
6179
  latest: null
6167
6180
  };
6168
6181
  let terminalObserved = null;
6169
- if (_optionalChain([options, 'optionalAccess', _339 => _339.signal, 'optionalAccess', _340 => _340.aborted])) {
6182
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.signal, 'optionalAccess', _343 => _343.aborted])) {
6170
6183
  await this.cancelPlay(workflowId);
6171
6184
  return {
6172
6185
  success: false,
@@ -6177,9 +6190,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
6177
6190
  };
6178
6191
  }
6179
6192
  for await (const event of this.watchRunEvents(workflowId, {
6180
- signal: _optionalChain([options, 'optionalAccess', _341 => _341.signal])
6193
+ signal: _optionalChain([options, 'optionalAccess', _344 => _344.signal])
6181
6194
  })) {
6182
- if (_optionalChain([options, 'optionalAccess', _342 => _342.signal, 'optionalAccess', _343 => _343.aborted])) {
6195
+ if (_optionalChain([options, 'optionalAccess', _345 => _345.signal, 'optionalAccess', _346 => _346.aborted])) {
6183
6196
  await this.cancelPlay(workflowId);
6184
6197
  return {
6185
6198
  success: false,
@@ -6189,19 +6202,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
6189
6202
  error: "Cancelled by user"
6190
6203
  };
6191
6204
  }
6192
- const previousStatus = _optionalChain([state, 'access', _344 => _344.latest, 'optionalAccess', _345 => _345.status]);
6205
+ const previousStatus = _optionalChain([state, 'access', _347 => _347.latest, 'optionalAccess', _348 => _348.status]);
6193
6206
  const status = updatePlayLiveStatusState(state, event);
6194
6207
  if (!status) {
6195
6208
  continue;
6196
6209
  }
6197
6210
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
6198
- _optionalChain([options, 'optionalAccess', _346 => _346.onProgress, 'optionalCall', _347 => _347(status)]);
6211
+ _optionalChain([options, 'optionalAccess', _349 => _349.onProgress, 'optionalCall', _350 => _350(status)]);
6199
6212
  }
6200
6213
  if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
6201
6214
  terminalObserved = status;
6202
6215
  }
6203
6216
  }
6204
- if (_optionalChain([options, 'optionalAccess', _348 => _348.signal, 'optionalAccess', _349 => _349.aborted])) {
6217
+ if (_optionalChain([options, 'optionalAccess', _351 => _351.signal, 'optionalAccess', _352 => _352.aborted])) {
6205
6218
  await this.cancelPlay(workflowId);
6206
6219
  return {
6207
6220
  success: false,
@@ -6254,7 +6267,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6254
6267
  const response = await this.http.get(
6255
6268
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
6256
6269
  );
6257
- const event = _optionalChain([response, 'access', _350 => _350.entries, 'optionalAccess', _351 => _351[0]]);
6270
+ const event = _optionalChain([response, 'access', _353 => _353.entries, 'optionalAccess', _354 => _354[0]]);
6258
6271
  if (!event) {
6259
6272
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6260
6273
  "No usage event was found for this request_id.",
@@ -6429,7 +6442,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6429
6442
  async cancelBillingSubscription(options) {
6430
6443
  return this.http.post(
6431
6444
  "/api/v2/billing/subscription/cancel",
6432
- { action: _optionalChain([options, 'optionalAccess', _352 => _352.undo]) ? "undo_cancel" : "cancel" }
6445
+ { action: _optionalChain([options, 'optionalAccess', _355 => _355.undo]) ? "undo_cancel" : "cancel" }
6433
6446
  );
6434
6447
  }
6435
6448
  /**
@@ -6441,7 +6454,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6441
6454
  */
6442
6455
  async listBillingInvoices(options) {
6443
6456
  const params = new URLSearchParams();
6444
- if (_optionalChain([options, 'optionalAccess', _353 => _353.limit]) !== void 0) {
6457
+ if (_optionalChain([options, 'optionalAccess', _356 => _356.limit]) !== void 0) {
6445
6458
  params.set("limit", String(options.limit));
6446
6459
  }
6447
6460
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -6452,7 +6465,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6452
6465
  /** List the reviewed target plans and whether new acquisition is enabled. */
6453
6466
  async getTargetBillingPlans(options) {
6454
6467
  return this.http.get(
6455
- _optionalChain([options, 'optionalAccess', _354 => _354.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
6468
+ _optionalChain([options, 'optionalAccess', _357 => _357.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
6456
6469
  );
6457
6470
  }
6458
6471
  /** Read the workspace's normalized target plan, payment, and balance state. */
@@ -6554,7 +6567,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6554
6567
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6555
6568
  async createTargetBillingPortalSession(options) {
6556
6569
  const response = await this.http.post(
6557
- _optionalChain([options, 'optionalAccess', _355 => _355.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6570
+ _optionalChain([options, 'optionalAccess', _358 => _358.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6558
6571
  {}
6559
6572
  );
6560
6573
  return response.data;
@@ -6604,8 +6617,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6604
6617
  return this.http.request("/api/v2/monitors/audit", {
6605
6618
  method: "POST",
6606
6619
  body: {
6607
- ..._optionalChain([options, 'optionalAccess', _356 => _356.fleetId]) ? { fleet_id: options.fleetId } : {},
6608
- ..._optionalChain([options, 'optionalAccess', _357 => _357.cursor]) ? { cursor: options.cursor } : {}
6620
+ ..._optionalChain([options, 'optionalAccess', _359 => _359.fleetId]) ? { fleet_id: options.fleetId } : {},
6621
+ ..._optionalChain([options, 'optionalAccess', _360 => _360.cursor]) ? { cursor: options.cursor } : {}
6609
6622
  },
6610
6623
  maxRetries: 0
6611
6624
  });
@@ -6615,8 +6628,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6615
6628
  return this.http.request("/api/v2/monitors/repair", {
6616
6629
  method: "POST",
6617
6630
  body: {
6618
- ..._optionalChain([options, 'optionalAccess', _358 => _358.fleetId]) ? { fleet_id: options.fleetId } : {},
6619
- ..._optionalChain([options, 'optionalAccess', _359 => _359.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6631
+ ..._optionalChain([options, 'optionalAccess', _361 => _361.fleetId]) ? { fleet_id: options.fleetId } : {},
6632
+ ..._optionalChain([options, 'optionalAccess', _362 => _362.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6620
6633
  },
6621
6634
  maxRetries: 0
6622
6635
  });
@@ -6624,7 +6637,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6624
6637
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6625
6638
  async readMonitorsHealth(options) {
6626
6639
  const params = new URLSearchParams();
6627
- if (_optionalChain([options, 'optionalAccess', _360 => _360.fleetId])) params.set("fleet_id", options.fleetId);
6640
+ if (_optionalChain([options, 'optionalAccess', _363 => _363.fleetId])) params.set("fleet_id", options.fleetId);
6628
6641
  const query = params.toString();
6629
6642
  const suffix = query ? `?${query}` : "";
6630
6643
  return this.http.request(
@@ -6697,7 +6710,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6697
6710
  );
6698
6711
  }
6699
6712
  const params = new URLSearchParams();
6700
- if (_optionalChain([options, 'optionalAccess', _361 => _361.cursor])) params.set("cursor", options.cursor);
6713
+ if (_optionalChain([options, 'optionalAccess', _364 => _364.cursor])) params.set("cursor", options.cursor);
6701
6714
  const suffix = params.size > 0 ? `?${params}` : "";
6702
6715
  return this.http.request(
6703
6716
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6744,7 +6757,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6744
6757
  * a second charge. The submission is never replayed automatically.
6745
6758
  */
6746
6759
  async previewMonitor(definition, options) {
6747
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _362 => _362.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _363 => _363.crypto, 'optionalAccess', _364 => _364.randomUUID, 'optionalCall', _365 => _365()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6760
+ const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _366 => _366.crypto, 'optionalAccess', _367 => _367.randomUUID, 'optionalCall', _368 => _368()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6748
6761
  try {
6749
6762
  const result = await this.http.request(
6750
6763
  "/api/v2/monitors/preview",
@@ -6752,7 +6765,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6752
6765
  method: "POST",
6753
6766
  body: {
6754
6767
  ...definition,
6755
- ..._optionalChain([options, 'optionalAccess', _366 => _366.limit]) === void 0 ? {} : { limit: options.limit }
6768
+ ..._optionalChain([options, 'optionalAccess', _369 => _369.limit]) === void 0 ? {} : { limit: options.limit }
6756
6769
  },
6757
6770
  headers: { "Idempotency-Key": idempotencyKey },
6758
6771
  maxRetries: 0,
@@ -6774,7 +6787,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6774
6787
  * `client.monitors.deploy(...)`.
6775
6788
  */
6776
6789
  async deployMonitor(definition, options) {
6777
- if (_optionalChain([options, 'optionalAccess', _367 => _367.dryRun])) {
6790
+ if (_optionalChain([options, 'optionalAccess', _370 => _370.dryRun])) {
6778
6791
  return this.http.request("/api/v2/monitors/check", {
6779
6792
  method: "POST",
6780
6793
  body: definition
@@ -6810,12 +6823,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6810
6823
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6811
6824
  async listMonitors(options) {
6812
6825
  const params = new URLSearchParams();
6813
- if (_optionalChain([options, 'optionalAccess', _368 => _368.state])) params.set("state", options.state);
6814
- else if (_optionalChain([options, 'optionalAccess', _369 => _369.status])) params.set("status", options.status);
6815
- if (_optionalChain([options, 'optionalAccess', _370 => _370.limit]) !== void 0)
6826
+ if (_optionalChain([options, 'optionalAccess', _371 => _371.state])) params.set("state", options.state);
6827
+ else if (_optionalChain([options, 'optionalAccess', _372 => _372.status])) params.set("status", options.status);
6828
+ if (_optionalChain([options, 'optionalAccess', _373 => _373.limit]) !== void 0)
6816
6829
  params.set("limit", String(options.limit));
6817
- if (_optionalChain([options, 'optionalAccess', _371 => _371.cursor])) params.set("cursor", options.cursor);
6818
- if (_optionalChain([options, 'optionalAccess', _372 => _372.includeConsumers])) params.set("include_consumers", "true");
6830
+ if (_optionalChain([options, 'optionalAccess', _374 => _374.cursor])) params.set("cursor", options.cursor);
6831
+ if (_optionalChain([options, 'optionalAccess', _375 => _375.includeConsumers])) params.set("include_consumers", "true");
6819
6832
  const query = params.toString();
6820
6833
  const suffix = query ? `?${query}` : "";
6821
6834
  return this.http.request(
@@ -6826,17 +6839,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
6826
6839
  /** The Monitors list. Prefer `client.monitors.ledger(...)`. */
6827
6840
  async listMonitorLedger(options) {
6828
6841
  const params = new URLSearchParams();
6829
- if (_optionalChain([options, 'optionalAccess', _373 => _373.search])) params.set("q", options.search);
6830
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _374 => _374.states]), () => ( []))) params.append("state", state);
6831
- for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _375 => _375.signals]), () => ( [])))
6842
+ if (_optionalChain([options, 'optionalAccess', _376 => _376.search])) params.set("q", options.search);
6843
+ for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _377 => _377.states]), () => ( []))) params.append("state", state);
6844
+ for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _378 => _378.signals]), () => ( [])))
6832
6845
  params.append("signal", signal);
6833
- if (_optionalChain([options, 'optionalAccess', _376 => _376.play])) params.set("play", options.play);
6834
- if (_optionalChain([options, 'optionalAccess', _377 => _377.fleet])) params.set("fleet", options.fleet);
6835
- if (_optionalChain([options, 'optionalAccess', _378 => _378.sort])) params.set("sort", options.sort);
6836
- if (_optionalChain([options, 'optionalAccess', _379 => _379.window])) params.set("window", options.window);
6837
- if (_optionalChain([options, 'optionalAccess', _380 => _380.limit]) !== void 0)
6846
+ if (_optionalChain([options, 'optionalAccess', _379 => _379.play])) params.set("play", options.play);
6847
+ if (_optionalChain([options, 'optionalAccess', _380 => _380.fleet])) params.set("fleet", options.fleet);
6848
+ if (_optionalChain([options, 'optionalAccess', _381 => _381.sort])) params.set("sort", options.sort);
6849
+ if (_optionalChain([options, 'optionalAccess', _382 => _382.window])) params.set("window", options.window);
6850
+ if (_optionalChain([options, 'optionalAccess', _383 => _383.limit]) !== void 0)
6838
6851
  params.set("limit", String(options.limit));
6839
- if (_optionalChain([options, 'optionalAccess', _381 => _381.cursor])) params.set("cursor", options.cursor);
6852
+ if (_optionalChain([options, 'optionalAccess', _384 => _384.cursor])) params.set("cursor", options.cursor);
6840
6853
  const query = params.toString();
6841
6854
  const suffix = query ? `?${query}` : "";
6842
6855
  return this.http.request(
@@ -6853,7 +6866,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6853
6866
  }
6854
6867
  /** A monitor's recent findings. Prefer `client.monitors.ledgerFindings(...)`. */
6855
6868
  async listMonitorLedgerFindings(key, options) {
6856
- const suffix = _optionalChain([options, 'optionalAccess', _382 => _382.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
6869
+ const suffix = _optionalChain([options, 'optionalAccess', _385 => _385.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
6857
6870
  return this.http.request(
6858
6871
  `/api/v2/monitors/ledger/${encodeURIComponent(key)}/findings${suffix}`,
6859
6872
  { method: "GET" }
@@ -6867,7 +6880,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6867
6880
  );
6868
6881
  }
6869
6882
  async testMonitorWebhook(key, payload, options) {
6870
- if (_optionalChain([options, 'optionalAccess', _383 => _383.dispatch]) === true || _optionalChain([options, 'optionalAccess', _384 => _384.validationOnly]) === false) {
6883
+ if (_optionalChain([options, 'optionalAccess', _386 => _386.dispatch]) === true || _optionalChain([options, 'optionalAccess', _387 => _387.validationOnly]) === false) {
6871
6884
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6872
6885
  "Monitor tests are validation-only and cannot dispatch events.",
6873
6886
  void 0,
@@ -6922,7 +6935,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6922
6935
  }
6923
6936
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6924
6937
  async deleteMonitor(key, options) {
6925
- if (_optionalChain([options, 'optionalAccess', _385 => _385.localOnly]) === true) {
6938
+ if (_optionalChain([options, 'optionalAccess', _388 => _388.localOnly]) === true) {
6926
6939
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6927
6940
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6928
6941
  void 0,
@@ -6930,11 +6943,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6930
6943
  );
6931
6944
  }
6932
6945
  const params = new URLSearchParams();
6933
- if (_optionalChain([options, 'optionalAccess', _386 => _386.dryRun])) params.set("dry_run", "true");
6946
+ if (_optionalChain([options, 'optionalAccess', _389 => _389.dryRun])) params.set("dry_run", "true");
6934
6947
  const query = params.toString();
6935
6948
  return this.http.request(
6936
6949
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6937
- _optionalChain([options, 'optionalAccess', _387 => _387.dryRun]) ? { method: "DELETE" } : {
6950
+ _optionalChain([options, 'optionalAccess', _390 => _390.dryRun]) ? { method: "DELETE" } : {
6938
6951
  method: "DELETE",
6939
6952
  // Deletion is a provider lifecycle operation. A timeout is an
6940
6953
  // unknown outcome, not authority to begin another delete attempt.
@@ -6947,10 +6960,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6947
6960
  * Prefer `client.monitors.reactivate(...)`.
6948
6961
  */
6949
6962
  async reactivateMonitor(key, options) {
6950
- const query = _optionalChain([options, 'optionalAccess', _388 => _388.dryRun]) ? "?dry_run=true" : "";
6963
+ const query = _optionalChain([options, 'optionalAccess', _391 => _391.dryRun]) ? "?dry_run=true" : "";
6951
6964
  return this.http.request(
6952
6965
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6953
- _optionalChain([options, 'optionalAccess', _389 => _389.dryRun]) ? { method: "POST", body: {} } : {
6966
+ _optionalChain([options, 'optionalAccess', _392 => _392.dryRun]) ? { method: "POST", body: {} } : {
6954
6967
  method: "POST",
6955
6968
  body: {},
6956
6969
  // Reactivation can create an upstream resource, so it must not use
@@ -6964,7 +6977,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6964
6977
  // ——————————————————————————————————————————————————————————
6965
6978
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6966
6979
  monitorJobIdempotencyKey(operation) {
6967
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _390 => _390.crypto, 'optionalAccess', _391 => _391.randomUUID, 'optionalCall', _392 => _392()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6980
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _393 => _393.crypto, 'optionalAccess', _394 => _394.randomUUID, 'optionalCall', _395 => _395()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6968
6981
  const prefix = "monitor-job-";
6969
6982
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6970
6983
  const maxOperationLength = Math.max(
@@ -6975,7 +6988,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6975
6988
  }
6976
6989
  monitorJobHeaders(operation, idempotencyKey) {
6977
6990
  return {
6978
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) || this.monitorJobIdempotencyKey(operation)
6991
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _396 => _396.trim, 'call', _397 => _397()]) || this.monitorJobIdempotencyKey(operation)
6979
6992
  };
6980
6993
  }
6981
6994
  async deployMonitorBatch(definitions, options) {
@@ -6986,7 +6999,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6986
6999
  body: { version: 1, kind: "batch", monitors: definitions },
6987
7000
  headers: this.monitorJobHeaders(
6988
7001
  "batch-deploy",
6989
- _optionalChain([options, 'optionalAccess', _395 => _395.idempotencyKey])
7002
+ _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
6990
7003
  ),
6991
7004
  maxRetries: 0,
6992
7005
  exactUrlOnly: true
@@ -7005,11 +7018,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
7005
7018
  version: 1,
7006
7019
  kind: "batch",
7007
7020
  monitors: definitions,
7008
- ..._optionalChain([options, 'optionalAccess', _396 => _396.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
7021
+ ..._optionalChain([options, 'optionalAccess', _399 => _399.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
7009
7022
  },
7010
7023
  headers: this.monitorJobHeaders(
7011
7024
  `batch-sync-${batchId}`,
7012
- _optionalChain([options, 'optionalAccess', _397 => _397.idempotencyKey])
7025
+ _optionalChain([options, 'optionalAccess', _400 => _400.idempotencyKey])
7013
7026
  ),
7014
7027
  maxRetries: 0,
7015
7028
  exactUrlOnly: true
@@ -7024,7 +7037,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7024
7037
  body: {},
7025
7038
  headers: this.monitorJobHeaders(
7026
7039
  `batch-start-${batchId}`,
7027
- _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
7040
+ _optionalChain([options, 'optionalAccess', _401 => _401.idempotencyKey])
7028
7041
  ),
7029
7042
  maxRetries: 0,
7030
7043
  exactUrlOnly: true
@@ -7039,7 +7052,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7039
7052
  body: {},
7040
7053
  headers: this.monitorJobHeaders(
7041
7054
  `batch-stop-${batchId}`,
7042
- _optionalChain([options, 'optionalAccess', _399 => _399.idempotencyKey])
7055
+ _optionalChain([options, 'optionalAccess', _402 => _402.idempotencyKey])
7043
7056
  ),
7044
7057
  maxRetries: 0,
7045
7058
  exactUrlOnly: true
@@ -7060,7 +7073,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7060
7073
  body: {},
7061
7074
  headers: this.monitorJobHeaders(
7062
7075
  `${action}-${monitorKey}`,
7063
- _optionalChain([options, 'optionalAccess', _400 => _400.idempotencyKey])
7076
+ _optionalChain([options, 'optionalAccess', _403 => _403.idempotencyKey])
7064
7077
  ),
7065
7078
  maxRetries: 0,
7066
7079
  exactUrlOnly: true
@@ -7073,7 +7086,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7073
7086
  body: definition,
7074
7087
  headers: this.monitorJobHeaders(
7075
7088
  `sync-${definition.key}`,
7076
- _optionalChain([options, 'optionalAccess', _401 => _401.idempotencyKey])
7089
+ _optionalChain([options, 'optionalAccess', _404 => _404.idempotencyKey])
7077
7090
  ),
7078
7091
  maxRetries: 0,
7079
7092
  exactUrlOnly: true
@@ -7086,7 +7099,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7086
7099
  );
7087
7100
  }
7088
7101
  async getMonitorJobLogs(jobId, options) {
7089
- const query = _optionalChain([options, 'optionalAccess', _402 => _402.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7102
+ const query = _optionalChain([options, 'optionalAccess', _405 => _405.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7090
7103
  return this.http.request(
7091
7104
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
7092
7105
  { method: "GET" }
@@ -7099,15 +7112,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
7099
7112
  );
7100
7113
  }
7101
7114
  async waitForMonitorJob(jobId, options) {
7102
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _403 => _403.timeoutMs]), () => ( 10 * 6e4)));
7103
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _404 => _404.pollIntervalMs]), () => ( 2e3)));
7115
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _406 => _406.timeoutMs]), () => ( 10 * 6e4)));
7116
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _407 => _407.pollIntervalMs]), () => ( 2e3)));
7104
7117
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
7105
7118
  const startedAt = Date.now();
7106
7119
  let latest = await this.getMonitorJob(jobId);
7107
7120
  while (true) {
7108
- _optionalChain([options, 'optionalAccess', _405 => _405.onProgress, 'optionalCall', _406 => _406(latest)]);
7121
+ _optionalChain([options, 'optionalAccess', _408 => _408.onProgress, 'optionalCall', _409 => _409(latest)]);
7109
7122
  const job = latest.job;
7110
- const state = typeof _optionalChain([job, 'optionalAccess', _407 => _407.state]) === "string" ? job.state : void 0;
7123
+ const state = typeof _optionalChain([job, 'optionalAccess', _410 => _410.state]) === "string" ? job.state : void 0;
7111
7124
  if (state && terminal.has(state)) return latest;
7112
7125
  if (Date.now() - startedAt >= timeoutMs) return latest;
7113
7126
  await sleep(pollIntervalMs);
@@ -7118,12 +7131,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
7118
7131
  // Monitor Fleets
7119
7132
  // ——————————————————————————————————————————————————————————
7120
7133
  monitorFleetIdempotencyKey(operation) {
7121
- const uuid = _optionalChain([globalThis, 'access', _408 => _408.crypto, 'optionalAccess', _409 => _409.randomUUID, 'optionalCall', _410 => _410()]);
7134
+ const uuid = _optionalChain([globalThis, 'access', _411 => _411.crypto, 'optionalAccess', _412 => _412.randomUUID, 'optionalCall', _413 => _413()]);
7122
7135
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
7123
7136
  }
7124
7137
  monitorFleetHeaders(operation, idempotencyKey) {
7125
7138
  return {
7126
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _411 => _411.trim, 'call', _412 => _412()]) || this.monitorFleetIdempotencyKey(operation)
7139
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _414 => _414.trim, 'call', _415 => _415()]) || this.monitorFleetIdempotencyKey(operation)
7127
7140
  };
7128
7141
  }
7129
7142
  /**
@@ -7150,8 +7163,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
7150
7163
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
7151
7164
  const body = {
7152
7165
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
7153
- ..._optionalChain([options, 'optionalAccess', _413 => _413.dryRun]) ? { dry_run: true } : {},
7154
- ..._optionalChain([options, 'optionalAccess', _414 => _414.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7166
+ ..._optionalChain([options, 'optionalAccess', _416 => _416.dryRun]) ? { dry_run: true } : {},
7167
+ ..._optionalChain([options, 'optionalAccess', _417 => _417.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7155
7168
  };
7156
7169
  return this.http.request(
7157
7170
  this.monitorFleetPath(fleetId),
@@ -7159,7 +7172,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7159
7172
  method: "PUT",
7160
7173
  body,
7161
7174
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7162
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _415 => _415.idempotencyKey])),
7175
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _418 => _418.idempotencyKey])),
7163
7176
  maxRetries: 0,
7164
7177
  exactUrlOnly: true
7165
7178
  }
@@ -7173,10 +7186,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7173
7186
  /** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
7174
7187
  async listMonitorFleetOverviews(options) {
7175
7188
  const params = new URLSearchParams({ view: "overview" });
7176
- if (_optionalChain([options, 'optionalAccess', _416 => _416.q])) params.set("q", options.q);
7177
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.states]), () => ( []))) params.append("state", state);
7178
- if (_optionalChain([options, 'optionalAccess', _418 => _418.sort])) params.set("sort", options.sort);
7179
- if (_optionalChain([options, 'optionalAccess', _419 => _419.window])) params.set("window", options.window);
7189
+ if (_optionalChain([options, 'optionalAccess', _419 => _419.q])) params.set("q", options.q);
7190
+ for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _420 => _420.states]), () => ( []))) params.append("state", state);
7191
+ if (_optionalChain([options, 'optionalAccess', _421 => _421.sort])) params.set("sort", options.sort);
7192
+ if (_optionalChain([options, 'optionalAccess', _422 => _422.window])) params.set("window", options.window);
7180
7193
  return this.http.request(
7181
7194
  `/api/v2/monitors/fleets?${params.toString()}`,
7182
7195
  { method: "GET" }
@@ -7185,7 +7198,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7185
7198
  /** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
7186
7199
  async getMonitorFleetOverview(fleetId, options) {
7187
7200
  const params = new URLSearchParams({ view: "overview" });
7188
- if (_optionalChain([options, 'optionalAccess', _420 => _420.window])) params.set("window", options.window);
7201
+ if (_optionalChain([options, 'optionalAccess', _423 => _423.window])) params.set("window", options.window);
7189
7202
  return this.http.request(
7190
7203
  `${this.monitorFleetPath(fleetId)}?${params.toString()}`,
7191
7204
  { method: "GET" }
@@ -7194,10 +7207,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7194
7207
  /** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
7195
7208
  async listMonitorFleetIssues(fleetId, options) {
7196
7209
  const params = new URLSearchParams();
7197
- if (_optionalChain([options, 'optionalAccess', _421 => _421.group])) params.set("group", options.group);
7198
- if (_optionalChain([options, 'optionalAccess', _422 => _422.cause])) params.set("cause", options.cause);
7199
- if (_optionalChain([options, 'optionalAccess', _423 => _423.cursor])) params.set("cursor", options.cursor);
7200
- if (_optionalChain([options, 'optionalAccess', _424 => _424.limit]) !== void 0)
7210
+ if (_optionalChain([options, 'optionalAccess', _424 => _424.group])) params.set("group", options.group);
7211
+ if (_optionalChain([options, 'optionalAccess', _425 => _425.cause])) params.set("cause", options.cause);
7212
+ if (_optionalChain([options, 'optionalAccess', _426 => _426.cursor])) params.set("cursor", options.cursor);
7213
+ if (_optionalChain([options, 'optionalAccess', _427 => _427.limit]) !== void 0)
7201
7214
  params.set("limit", String(options.limit));
7202
7215
  const query = params.toString();
7203
7216
  return this.http.request(
@@ -7207,8 +7220,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
7207
7220
  }
7208
7221
  async getMonitorFleet(fleetId, options) {
7209
7222
  const params = new URLSearchParams();
7210
- if (_optionalChain([options, 'optionalAccess', _425 => _425.drift])) params.set("drift", "1");
7211
- if (_optionalChain([options, 'optionalAccess', _426 => _426.limit]) !== void 0)
7223
+ if (_optionalChain([options, 'optionalAccess', _428 => _428.drift])) params.set("drift", "1");
7224
+ if (_optionalChain([options, 'optionalAccess', _429 => _429.limit]) !== void 0)
7212
7225
  params.set("limit", String(options.limit));
7213
7226
  const query = params.toString();
7214
7227
  return this.http.request(
@@ -7221,11 +7234,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
7221
7234
  this.monitorFleetPath(fleetId),
7222
7235
  {
7223
7236
  method: "DELETE",
7224
- body: _optionalChain([options, 'optionalAccess', _427 => _427.dryRun]) ? { dry_run: true } : {},
7237
+ body: _optionalChain([options, 'optionalAccess', _430 => _430.dryRun]) ? { dry_run: true } : {},
7225
7238
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7226
7239
  headers: this.monitorFleetHeaders(
7227
7240
  "deactivate",
7228
- _optionalChain([options, 'optionalAccess', _428 => _428.idempotencyKey])
7241
+ _optionalChain([options, 'optionalAccess', _431 => _431.idempotencyKey])
7229
7242
  ),
7230
7243
  maxRetries: 0,
7231
7244
  exactUrlOnly: true
@@ -7241,7 +7254,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7241
7254
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7242
7255
  headers: this.monitorFleetHeaders(
7243
7256
  "reactivate",
7244
- _optionalChain([options, 'optionalAccess', _429 => _429.idempotencyKey])
7257
+ _optionalChain([options, 'optionalAccess', _432 => _432.idempotencyKey])
7245
7258
  ),
7246
7259
  maxRetries: 0,
7247
7260
  exactUrlOnly: true
@@ -7258,9 +7271,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
7258
7271
  * identical to "the request failed".
7259
7272
  */
7260
7273
  async waitForMonitorFleetConvergence(fleetId, options) {
7261
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _430 => _430.timeoutMs]), () => ( 10 * 6e4)));
7262
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _431 => _431.pollIntervalMs]), () => ( 2e3)));
7263
- const terminal = _optionalChain([options, 'optionalAccess', _432 => _432.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
7274
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _433 => _433.timeoutMs]), () => ( 10 * 6e4)));
7275
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _434 => _434.pollIntervalMs]), () => ( 2e3)));
7276
+ const terminal = _optionalChain([options, 'optionalAccess', _435 => _435.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
7264
7277
  "converged",
7265
7278
  "degraded",
7266
7279
  "deactivated",
@@ -7269,7 +7282,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7269
7282
  const startedAt = Date.now();
7270
7283
  let latest = await this.getMonitorFleet(fleetId);
7271
7284
  while (true) {
7272
- _optionalChain([options, 'optionalAccess', _433 => _433.onProgress, 'optionalCall', _434 => _434(latest)]);
7285
+ _optionalChain([options, 'optionalAccess', _436 => _436.onProgress, 'optionalCall', _437 => _437(latest)]);
7273
7286
  const status = typeof latest.status === "string" ? latest.status : void 0;
7274
7287
  if (status && terminal.has(status)) return latest;
7275
7288
  if (Date.now() - startedAt >= timeoutMs) return latest;