deepline 0.3.534 → 0.3.536

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 (235) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +254 -147
  2. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  3. package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/types.ts +2 -23
  7. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
  8. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
  9. package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
  10. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
  11. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
  12. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
  13. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
  14. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
  15. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
  17. package/dist/bundling-sources/shared_libs/play-runtime/call-requeue-state-machine.ts +420 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +727 -102
  19. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +26 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/durable-retry-policy.ts +624 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
  22. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
  23. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
  24. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +60 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +372 -10
  28. package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
  29. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +21 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
  31. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/provider-no-progress.ts +6 -2
  37. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +17 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
  39. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +63 -3
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
  49. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +90 -49
  50. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +136 -30
  51. package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
  52. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
  53. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +63 -13
  54. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
  55. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
  56. package/dist/cli/auth-6XQKFOLG.js +43 -0
  57. package/dist/cli/{auth-MHQYIMVX.mjs → auth-KCTCUO7P.mjs} +7 -7
  58. package/dist/cli/{billing-YQLNP4S5.js → billing-4VBGZ3CT.js} +273 -112
  59. package/dist/cli/{billing-LX2PSBJ4.mjs → billing-OOJHKLNS.mjs} +185 -24
  60. package/dist/cli/{chunk-DGKTHWWH.js → chunk-2B4IOGFD.js} +406 -382
  61. package/dist/cli/{chunk-MQORQ7WL.js → chunk-2FCSUOYN.js} +55 -55
  62. package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
  63. package/dist/cli/{chunk-6IFZPEJE.mjs → chunk-2YWJS76L.mjs} +1 -1
  64. package/dist/cli/{chunk-E7TP25I2.mjs → chunk-3PCYV6ZJ.mjs} +2 -2
  65. package/dist/cli/{chunk-LGRZCHKC.js → chunk-4E5JXZ3W.js} +18 -20
  66. package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
  67. package/dist/cli/{chunk-SUWTLXCV.js → chunk-6BBGUQJJ.js} +67 -146
  68. package/dist/cli/{chunk-JBBJDFUJ.js → chunk-6VUGBQZQ.js} +5 -5
  69. package/dist/cli/{chunk-2P3NVX65.mjs → chunk-AB2GBOD4.mjs} +40 -27
  70. package/dist/cli/{chunk-62SOZ67Y.mjs → chunk-ANUKBZ6W.mjs} +475 -11
  71. package/dist/cli/{chunk-MG6YL4M7.mjs → chunk-BASLYGXK.mjs} +101 -77
  72. package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
  73. package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
  74. package/dist/cli/{chunk-RH3YRMUY.js → chunk-CIDN5K23.js} +1 -1
  75. package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
  76. package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
  77. package/dist/cli/{chunk-UWNVFAFN.js → chunk-CWSLUNA6.js} +33 -33
  78. package/dist/cli/{chunk-5FXMEEF4.mjs → chunk-CXTW7SRW.mjs} +67 -146
  79. package/dist/cli/{chunk-O53LHONF.mjs → chunk-DA2I2M7D.mjs} +2 -2
  80. package/dist/cli/{chunk-EYXUAJAU.mjs → chunk-DQHUJMCL.mjs} +5 -5
  81. package/dist/cli/{chunk-7GFR5Y4J.mjs → chunk-DUYAMLOC.mjs} +1 -1
  82. package/dist/cli/{chunk-OMVVHX4U.mjs → chunk-E24UGPGG.mjs} +13 -15
  83. package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
  84. package/dist/cli/{chunk-KJVY7V2X.mjs → chunk-GF32SBST.mjs} +1 -1
  85. package/dist/cli/{chunk-AK622KIG.mjs → chunk-GHLDCLSC.mjs} +1 -1
  86. package/dist/cli/{chunk-A6HNT4EE.js → chunk-GTVZKY3F.js} +2 -2
  87. package/dist/cli/{chunk-BXIUZM5N.mjs → chunk-HAJQGP5V.mjs} +2 -2
  88. package/dist/cli/{chunk-6CEUQYMB.js → chunk-HWDKRN7L.js} +3 -3
  89. package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
  90. package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
  91. package/dist/cli/{chunk-WR4WETRU.mjs → chunk-JUHDJNSI.mjs} +4 -4
  92. package/dist/cli/{chunk-TQH3533L.mjs → chunk-KPQHUVYW.mjs} +5 -5
  93. package/dist/cli/{chunk-V7SCRUFQ.js → chunk-KWYGWO4Y.js} +9 -6
  94. package/dist/cli/{chunk-DZS4JC7I.js → chunk-LDGZFDUB.js} +2 -2
  95. package/dist/cli/{chunk-EGTUOYYG.js → chunk-LN6RXDTB.js} +523 -59
  96. package/dist/cli/{chunk-DQ5ADV2J.mjs → chunk-LZXZQPA2.mjs} +4 -1
  97. package/dist/cli/{chunk-MYSKWJMA.js → chunk-MSP4DTSD.js} +13 -13
  98. package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
  99. package/dist/cli/{chunk-NNAE7E23.mjs → chunk-OUDTOMZC.mjs} +7 -9
  100. package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
  101. package/dist/cli/{chunk-ENCA6O2D.mjs → chunk-PNY3BWHP.mjs} +2 -2
  102. package/dist/cli/{chunk-KSA2XE4T.js → chunk-Q4MNUOS4.js} +316 -303
  103. package/dist/cli/{chunk-GTXSUPCJ.js → chunk-Q5CXV3E3.js} +2 -2
  104. package/dist/cli/{chunk-VAG5YKP6.mjs → chunk-RVSSQPQO.mjs} +1 -1
  105. package/dist/cli/{chunk-VE7ZPLN2.js → chunk-SLPJ3LXI.js} +22 -22
  106. package/dist/cli/{chunk-IX45S5VC.js → chunk-TX5TUHJN.js} +17 -19
  107. package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
  108. package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
  109. package/dist/cli/{chunk-NDFNBJGL.js → chunk-VBDZIMWD.js} +26 -26
  110. package/dist/cli/{chunk-GVGQ6NZW.js → chunk-W7AEIGZR.js} +41 -41
  111. package/dist/cli/{chunk-WDNRPZED.mjs → chunk-WC5M3JXE.mjs} +2 -2
  112. package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
  113. package/dist/cli/{chunk-MQX363YF.js → chunk-XBAH3TKU.js} +5 -5
  114. package/dist/cli/{chunk-BDWZBMGV.mjs → chunk-XJD2GYUP.mjs} +5 -5
  115. package/dist/cli/{chunk-XRZJKHUA.mjs → chunk-XVZRJJDS.mjs} +4 -4
  116. package/dist/cli/{chunk-TVINIDHB.js → chunk-Y2NTPYGS.js} +17 -17
  117. package/dist/cli/{chunk-6GTGWZJG.mjs → chunk-YBMHOH6H.mjs} +4 -4
  118. package/dist/cli/{chunk-TG2UB3A5.mjs → chunk-YRLAUGQY.mjs} +3 -3
  119. package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
  120. package/dist/cli/{chunk-KXQCUX3X.mjs → chunk-Z7UIOGW4.mjs} +3 -3
  121. package/dist/cli/{chunk-HCD36BP6.js → chunk-ZEV2Y56V.js} +44 -44
  122. package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
  123. package/dist/cli/{chunk-XBK6WCVA.js → chunk-ZILSRDIN.js} +8 -8
  124. package/dist/cli/{chunk-B2AS3R5W.js → chunk-ZISEH7OL.js} +16 -16
  125. package/dist/cli/{chunk-HPJAE6PP.js → chunk-ZZ4MF2GI.js} +6 -6
  126. package/dist/cli/command-docs.js +2 -2
  127. package/dist/cli/command-docs.mjs +1 -1
  128. package/dist/cli/{csv-U3M2G76R.js → csv-2V2DIFNG.js} +15 -15
  129. package/dist/cli/{csv-4ID4E5W3.mjs → csv-P3HLK4GO.mjs} +6 -6
  130. package/dist/cli/{db-IHAQIKEQ.js → db-MREAQVW6.js} +36 -36
  131. package/dist/cli/{db-LHX5BBCZ.mjs → db-ZYOY3QRQ.mjs} +9 -9
  132. package/dist/cli/describe-IKZFOADR.mjs +49 -0
  133. package/dist/cli/describe-WW3OQRLP.js +49 -0
  134. package/dist/cli/describe-core.d.mts +3 -3
  135. package/dist/cli/describe-core.d.ts +3 -3
  136. package/dist/cli/describe-core.js +5 -5
  137. package/dist/cli/describe-core.mjs +4 -4
  138. package/dist/cli/{executions-CJ5LV23G.js → executions-H5IJ7QSQ.js} +11 -11
  139. package/dist/cli/{executions-UJ6JZUL5.mjs → executions-KTSY5M34.mjs} +9 -9
  140. package/dist/cli/{feedback-TGUBVGRP.js → feedback-724QK3Z5.js} +16 -16
  141. package/dist/cli/{feedback-YGTPJBRJ.mjs → feedback-WWJRIXEU.mjs} +8 -8
  142. package/dist/cli/git-PHYRD56H.js +25 -0
  143. package/dist/cli/{git-3DOTQHJO.mjs → git-R5VRG7X6.mjs} +7 -7
  144. package/dist/cli/index.js +151 -157
  145. package/dist/cli/index.mjs +51 -57
  146. package/dist/cli/{legacy-noops-BHEHVFHI.js → legacy-noops-C6GDEGPU.js} +11 -11
  147. package/dist/cli/{legacy-noops-RBBYRVLG.mjs → legacy-noops-PWZ5XLAO.mjs} +8 -8
  148. package/dist/cli/{monitors-XECKLAXA.js → monitors-VAVQ4WCE.js} +125 -122
  149. package/dist/cli/{monitors-5AJCG6IV.mjs → monitors-WQSKMHAP.mjs} +19 -16
  150. package/dist/cli/{org-DOBAIYWG.js → org-CWWRWXZQ.js} +89 -89
  151. package/dist/cli/{org-ZAAIEZKB.mjs → org-MAL4QPVF.mjs} +9 -9
  152. package/dist/cli/{play-KLYRMQPF.mjs → play-ILW6MSNG.mjs} +174 -80
  153. package/dist/cli/{play-E74VN6B7.js → play-WJOWK5PQ.js} +690 -596
  154. package/dist/cli/{providers-XTQXV5LB.mjs → providers-4V2NMLZZ.mjs} +9 -9
  155. package/dist/cli/{providers-APZ6SOSK.js → providers-W662ANCH.js} +12 -12
  156. package/dist/cli/{quickstart-S6WN6NWW.js → quickstart-BW6EBUYX.js} +8 -8
  157. package/dist/cli/{quickstart-X7RHHQCH.mjs → quickstart-C22BR743.mjs} +6 -6
  158. package/dist/cli/{run-3YLIJJ57.js → run-KW7KW4FX.js} +50 -53
  159. package/dist/cli/{run-TZPBBSPX.mjs → run-SPAU5IMW.mjs} +31 -34
  160. package/dist/cli/search-HLE54W5G.js +32 -0
  161. package/dist/cli/{search-VLHE2CMZ.mjs → search-XPC75HLM.mjs} +10 -11
  162. package/dist/cli/{search-output-73BYB7UE.mjs → search-output-JKYJSEPM.mjs} +6 -6
  163. package/dist/cli/{search-output-GCT7PQIT.js → search-output-VJYE7USJ.js} +8 -8
  164. package/dist/cli/{secrets-RLOTGKQZ.mjs → secrets-OJG73GXQ.mjs} +9 -9
  165. package/dist/cli/{secrets-J6CEKXKQ.js → secrets-YB57KGSB.js} +18 -18
  166. package/dist/cli/{sessions-7HZ7OZ62.mjs → sessions-7ZL37BW4.mjs} +8 -8
  167. package/dist/cli/sessions-VEBYZIEU.js +22 -0
  168. package/dist/cli/{settings-WRV5XEZC.js → settings-A7DD2ZYE.js} +88 -89
  169. package/dist/cli/{settings-72K5YCIS.mjs → settings-RKSQB7FA.mjs} +15 -16
  170. package/dist/cli/{setup-KQFY6WT4.mjs → setup-NXDUTITY.mjs} +11 -12
  171. package/dist/cli/{setup-QVXWT2EQ.js → setup-S3K5YU62.js} +51 -52
  172. package/dist/cli/skills-NVQ744CN.js +36 -0
  173. package/dist/cli/{skills-C3K3E473.mjs → skills-VMFAIDO6.mjs} +9 -10
  174. package/dist/cli/{tools-4A2OH6MB.mjs → tools-52NTHBSJ.mjs} +20 -21
  175. package/dist/cli/tools-SBDUL3WB.js +56 -0
  176. package/dist/cli/update-HHVFZPCV.js +34 -0
  177. package/dist/cli/{update-BS6USKPR.mjs → update-SAKBEKMV.mjs} +11 -12
  178. package/dist/cli/{views-WB6GFTRX.mjs → views-ACRV7MD6.mjs} +54 -10
  179. package/dist/cli/{views-4NZGAXHL.js → views-C3GJOBDG.js} +66 -22
  180. package/dist/cli/{workflow-2D4WX55R.mjs → workflow-CS22E7TC.mjs} +10 -10
  181. package/dist/cli/{workflow-L2QTQZYV.js → workflow-ZNWCZEGN.js} +20 -20
  182. package/dist/{client-DoUVSkqC.d.mts → client-BlLYQDNo.d.mts} +1 -1
  183. package/dist/{client-DQm56zMs.d.ts → client-DSQlkIDO.d.ts} +1 -1
  184. package/dist/{client-core-C7KkUIE_.d.ts → client-core-CDwapXy5.d.ts} +167 -108
  185. package/dist/{client-core-CPlwsC1Q.d.mts → client-core-rX7n2H8U.d.mts} +167 -108
  186. package/dist/{compiler-manifest-DsxsQP-T.d.mts → compiler-manifest-BHNC4RL-.d.mts} +58 -21
  187. package/dist/{compiler-manifest-DsxsQP-T.d.ts → compiler-manifest-BHNC4RL-.d.ts} +58 -21
  188. package/dist/{errors-qdJUVQ3g.d.mts → errors-D7sPXrvB.d.mts} +1 -1
  189. package/dist/{errors-Bk5h1D-C.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
  190. package/dist/{index-bL66eHYz.d.ts → index-CQTBHXHr.d.ts} +1 -1
  191. package/dist/{index-PaupwX1B.d.mts → index-NaDZq2xf.d.mts} +1 -1
  192. package/dist/index.d.mts +7 -7
  193. package/dist/index.d.ts +7 -7
  194. package/dist/index.js +15 -15
  195. package/dist/index.mjs +11 -11
  196. package/dist/install-integrity.json +131 -132
  197. package/dist/monitor-fleet-contract.d.mts +17 -11
  198. package/dist/monitor-fleet-contract.d.ts +17 -11
  199. package/dist/monitor-fleet-contract.js +3 -3
  200. package/dist/monitor-fleet-contract.mjs +2 -2
  201. package/dist/monitor-input-contract.js +2 -2
  202. package/dist/monitor-input-contract.mjs +1 -1
  203. package/dist/plays/bundle-play-file.d.mts +3 -3
  204. package/dist/plays/bundle-play-file.d.ts +3 -3
  205. package/dist/plays/bundle-play-file.mjs +67 -3
  206. package/dist/plays/csv-data-input.js +3 -3
  207. package/dist/plays/csv-data-input.mjs +2 -2
  208. package/dist/plays/play-description.d.mts +2 -2
  209. package/dist/plays/play-description.d.ts +2 -2
  210. package/dist/plays/run-request.d.mts +2 -2
  211. package/dist/plays/run-request.d.ts +2 -2
  212. package/dist/plays/run-request.js +3 -3
  213. package/dist/plays/run-request.mjs +2 -2
  214. package/dist/release.d.mts +1 -1
  215. package/dist/release.d.ts +1 -1
  216. package/dist/release.js +2 -2
  217. package/dist/release.mjs +1 -1
  218. package/dist/server.d.mts +4 -4
  219. package/dist/server.d.ts +4 -4
  220. package/dist/server.js +12 -12
  221. package/dist/server.mjs +6 -6
  222. package/package.json +1 -1
  223. package/dist/cli/auth-UP2RGPI6.js +0 -43
  224. package/dist/cli/chunk-5LZ5VSOK.mjs +0 -405
  225. package/dist/cli/chunk-D3J2Y2BP.js +0 -405
  226. package/dist/cli/describe-CI4MREFF.mjs +0 -50
  227. package/dist/cli/describe-IVTSD7ST.js +0 -50
  228. package/dist/cli/git-R3W25XIF.js +0 -25
  229. package/dist/cli/pages-FUOSF6BE.mjs +0 -266
  230. package/dist/cli/pages-TLC2N6L7.js +0 -266
  231. package/dist/cli/search-NB5CBALV.js +0 -33
  232. package/dist/cli/sessions-SFCZSB77.js +0 -22
  233. package/dist/cli/skills-WIJEHVLA.js +0 -37
  234. package/dist/cli/tools-VMMERMLO.js +0 -57
  235. package/dist/cli/update-54WZQDTS.js +0 -35
@@ -20,7 +20,7 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
20
20
 
21
21
 
22
22
 
23
- var _chunk2KHUFWTKjs = require('./chunk-2KHUFWTK.js');
23
+ var _chunkCQDQNZGHjs = require('./chunk-CQDQNZGH.js');
24
24
 
25
25
 
26
26
 
@@ -31,16 +31,16 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
31
31
 
32
32
 
33
33
 
34
- var _chunkUWNVFAFNjs = require('./chunk-UWNVFAFN.js');
34
+ var _chunkCWSLUNA6js = require('./chunk-CWSLUNA6.js');
35
35
 
36
36
 
37
- var _chunkT2N3B7IQjs = require('./chunk-T2N3B7IQ.js');
37
+ var _chunk2GJZLIKWjs = require('./chunk-2GJZLIKW.js');
38
38
 
39
39
 
40
40
 
41
41
 
42
42
 
43
- var _chunkSQWET4SLjs = require('./chunk-SQWET4SL.js');
43
+ var _chunkBBTKAASQjs = require('./chunk-BBTKAASQ.js');
44
44
 
45
45
  // src/pagination.ts
46
46
  async function* iterateCursorPages(fetchPage) {
@@ -74,7 +74,7 @@ function requireBillingIdempotencyKey(value) {
74
74
  }
75
75
  }
76
76
  if (!valid) {
77
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
77
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
78
78
  "Billing idempotencyKey must contain 1\u2013200 characters with no leading or trailing whitespace and be valid HTTP header text.",
79
79
  void 0,
80
80
  "INVALID_BILLING_IDEMPOTENCY_KEY"
@@ -86,23 +86,23 @@ function requireBillingIdempotencyKey(value) {
86
86
  // src/db/query.ts
87
87
  function planCustomerDbQuery(input, maxRetries = 3) {
88
88
  if (typeof input.sql !== "string" || !input.sql.trim())
89
- throw new (0, _chunkSQWET4SLjs.DeeplineError)("sql must not be empty.", 400, "INVALID_SQL");
89
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)("sql must not be empty.", 400, "INVALID_SQL");
90
90
  if (input.operationKey !== void 0 && typeof input.operationKey !== "string")
91
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
91
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
92
92
  "operationKey must be a string containing 1\u2013512 characters.",
93
93
  400,
94
94
  "INVALID_OPERATION_KEY"
95
95
  );
96
96
  const operationKey = input.operationKey;
97
97
  if (operationKey !== void 0 && (!operationKey.trim() || operationKey.length > 512)) {
98
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
98
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
99
99
  "operationKey must contain 1\u2013512 characters.",
100
100
  400,
101
101
  "INVALID_OPERATION_KEY"
102
102
  );
103
103
  }
104
104
  if (input.maxRows !== void 0 && (!Number.isSafeInteger(input.maxRows) || input.maxRows < 1 || input.maxRows > 1e3)) {
105
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
105
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
106
106
  "maxRows must be a whole number from 1 to 1000.",
107
107
  400,
108
108
  "INVALID_MAX_ROWS"
@@ -144,10 +144,10 @@ async function queryCustomerDatabase(http, input, maxRetries) {
144
144
  }
145
145
  );
146
146
  } catch (error) {
147
- if (error instanceof _chunkSQWET4SLjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
147
+ if (error instanceof _chunkBBTKAASQjs.DeeplineError && (_optionalChain([error, 'access', _ => _.code, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3("NETWORK_")]) || // Older API readers return PostgreSQL errors as HTTP 400, including
148
148
  // lost connections and explicitly unknown transaction resolution.
149
149
  /^08[A-Z0-9]{3}$/.test(_nullishCoalesce(error.code, () => ( ""))) || ["57P01", "57P02", "57P03"].includes(_nullishCoalesce(error.code, () => ( ""))) || error.statusCode === 408 || (_nullishCoalesce(error.statusCode, () => ( 0))) >= 500)) {
150
- throw new (0, _chunkT2N3B7IQjs.CustomerDbQueryOutcomeUnknownError)(
150
+ throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
151
151
  error,
152
152
  plan.request.body.operation_key
153
153
  );
@@ -155,8 +155,8 @@ async function queryCustomerDatabase(http, input, maxRetries) {
155
155
  throw error;
156
156
  }
157
157
  if (!result || typeof result !== "object" || Array.isArray(result) || typeof result.command !== "string" || !Array.isArray(result.columns) || !Array.isArray(result.rows) || typeof result.truncated !== "boolean" || result.row_count !== null && (!Number.isSafeInteger(result.row_count) || result.row_count < 0) || !Number.isSafeInteger(result.row_count_returned) || result.row_count_returned < 0) {
158
- throw new (0, _chunkT2N3B7IQjs.CustomerDbQueryOutcomeUnknownError)(
159
- new (0, _chunkSQWET4SLjs.DeeplineError)(
158
+ throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
159
+ new (0, _chunkBBTKAASQjs.DeeplineError)(
160
160
  "The SQL response did not contain a valid result.",
161
161
  200,
162
162
  "CUSTOMER_DB_QUERY_RESPONSE_INVALID"
@@ -166,8 +166,8 @@ async function queryCustomerDatabase(http, input, maxRetries) {
166
166
  }
167
167
  const operation = result.operation;
168
168
  if (input.operationKey !== void 0 && (!operation || operation.operation_key !== input.operationKey || !Number.isSafeInteger(operation.completed_at_ms) || operation.completed_at_ms < 0 || !["executed", "operation_recovery"].includes(operation.source))) {
169
- throw new (0, _chunkT2N3B7IQjs.CustomerDbQueryOutcomeUnknownError)(
170
- new (0, _chunkSQWET4SLjs.DeeplineError)(
169
+ throw new (0, _chunk2GJZLIKWjs.CustomerDbQueryOutcomeUnknownError)(
170
+ new (0, _chunkBBTKAASQjs.DeeplineError)(
171
171
  "The server did not confirm the original atomic SQL operation.",
172
172
  200,
173
173
  "CUSTOMER_DB_OPERATION_ACK_INVALID"
@@ -446,7 +446,7 @@ function usesExtendedBetterContactLauncherBudget(toolId) {
446
446
  var CLI_INVOCATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
447
447
  function validateCliInvocationId(value) {
448
448
  if (!CLI_INVOCATION_ID_PATTERN.test(value)) {
449
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
449
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
450
450
  "CLI invocation IDs must be UUID v4 values.",
451
451
  void 0,
452
452
  "CLI_INVOCATION_ID_INVALID"
@@ -462,7 +462,7 @@ var RAW_V2_EXECUTE_RESPONSE_CONTRACT = _chunkE4CABWXLjs.RAW_V2_TOOL_RESPONSE_CON
462
462
  var DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS = 15 * 60 * 1e3;
463
463
  function validateExecutionIdempotencyKey(key) {
464
464
  if (typeof key !== "string" || key.length < 1 || key.length > 200 || !/^[A-Za-z0-9._:-]+$/.test(key)) {
465
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
465
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
466
466
  "Execution idempotency keys must be 1\u2013200 ASCII letters, digits, dots, underscores, colons, or hyphens.",
467
467
  void 0,
468
468
  "IDEMPOTENCY_KEY_INVALID"
@@ -475,20 +475,20 @@ function getExecutionRecoveryState(value) {
475
475
  return state === "running" || state === "completed" || state === "outcome_unknown" ? state : null;
476
476
  }
477
477
  function isRecoverableExecutionAttemptError(error) {
478
- if (error instanceof _chunkSQWET4SLjs.ToolExecutionError) {
478
+ if (error instanceof _chunkBBTKAASQjs.ToolExecutionError) {
479
479
  return error.code === "EXECUTION_IN_PROGRESS" || error.origin === "deepline" && error.category === "network" && error.networkScope === "client_to_deepline";
480
480
  }
481
- return error instanceof _chunkSQWET4SLjs.DeeplineError && (error.code === "EXECUTION_IN_PROGRESS" || _optionalChain([error, 'access', _9 => _9.code, 'optionalAccess', _10 => _10.startsWith, 'call', _11 => _11("NETWORK_")]) === true && error.statusCode === void 0);
481
+ return error instanceof _chunkBBTKAASQjs.DeeplineError && (error.code === "EXECUTION_IN_PROGRESS" || _optionalChain([error, 'access', _9 => _9.code, 'optionalAccess', _10 => _10.startsWith, 'call', _11 => _11("NETWORK_")]) === true && error.statusCode === void 0);
482
482
  }
483
483
  function isRecoverableExecutionLookupError(error) {
484
484
  if (isRecoverableExecutionAttemptError(error)) return true;
485
- return error instanceof _chunkSQWET4SLjs.DeeplineError && (error.statusCode === 429 || error.statusCode !== void 0 && error.statusCode >= 500);
485
+ return error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 429 || error.statusCode !== void 0 && error.statusCode >= 500);
486
486
  }
487
487
  function timeoutWithinRecoveryBudget(requestTimeoutMs, defaultRequestTimeoutMs, remainingMs) {
488
488
  return Math.min(_nullishCoalesce(requestTimeoutMs, () => ( defaultRequestTimeoutMs)), remainingMs);
489
489
  }
490
490
  function executionRecoveryError(input) {
491
- return new (0, _chunkSQWET4SLjs.ToolExecutionError)(input.message, {
491
+ return new (0, _chunkBBTKAASQjs.ToolExecutionError)(input.message, {
492
492
  toolId: input.toolId,
493
493
  provider: null,
494
494
  operation: input.toolId,
@@ -596,7 +596,7 @@ var ToolCalls = class {
596
596
  if (idempotencyKey !== void 0) {
597
597
  validateExecutionIdempotencyKey(idempotencyKey);
598
598
  if (_optionalChain([options, 'optionalAccess', _16 => _16.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
599
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
599
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
600
600
  "recoveryTimeoutMs must be a finite, non-negative number.",
601
601
  void 0,
602
602
  "IDEMPOTENCY_KEY_INVALID"
@@ -613,8 +613,8 @@ var ToolCalls = class {
613
613
  const headers = {
614
614
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
615
615
  ...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
616
- [_chunkSQWET4SLjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
617
- _chunkSQWET4SLjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
616
+ [_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
617
+ _chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
618
618
  ),
619
619
  ..._optionalChain([options, 'optionalAccess', _20 => _20.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
620
620
  [EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.responseIntent]), () => ( "raw")),
@@ -627,7 +627,7 @@ var ToolCalls = class {
627
627
  if (!lastResponse) return;
628
628
  if (failure) {
629
629
  const { error } = failure;
630
- if (isRecoverableExecutionAttemptError(error) || !(error instanceof _chunkSQWET4SLjs.DeeplineError) || error.statusCode === void 0 || error.statusCode !== lastResponse.httpStatus || error.code === "EXECUTION_OUTCOME_UNKNOWN")
630
+ if (isRecoverableExecutionAttemptError(error) || !(error instanceof _chunkBBTKAASQjs.DeeplineError) || error.statusCode === void 0 || error.statusCode !== lastResponse.httpStatus || error.code === "EXECUTION_OUTCOME_UNKNOWN")
631
631
  return;
632
632
  }
633
633
  const body = lastResponse.body;
@@ -674,7 +674,7 @@ var ToolCalls = class {
674
674
  idempotencyKey,
675
675
  onResponse: (response2) => {
676
676
  lastResponse = null;
677
- atomicToolsSupported = response2.headers.get(_chunkUWNVFAFNjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
677
+ atomicToolsSupported = response2.headers.get(_chunkCWSLUNA6js.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
678
678
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
679
679
  if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
680
680
  try {
@@ -697,8 +697,8 @@ var ToolCalls = class {
697
697
  return await post();
698
698
  } catch (error) {
699
699
  if (atomicToolOnly) {
700
- if (!atomicToolsSupported && !recoverySupported && !(error instanceof _chunkSQWET4SLjs.ToolExecutionError) && error instanceof _chunkSQWET4SLjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
701
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
700
+ if (!atomicToolsSupported && !recoverySupported && !(error instanceof _chunkBBTKAASQjs.ToolExecutionError) && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
701
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
702
702
  "This server does not support atomic tool execution.",
703
703
  error.statusCode,
704
704
  "ATOMIC_TOOL_EXECUTE_UNSUPPORTED"
@@ -706,7 +706,7 @@ var ToolCalls = class {
706
706
  }
707
707
  throw error;
708
708
  }
709
- if (useLegacyEndpoint || recoverySupported || !(error instanceof _chunkSQWET4SLjs.DeeplineError) || error.statusCode !== 404 && error.statusCode !== 405)
709
+ if (useLegacyEndpoint || recoverySupported || !(error instanceof _chunkBBTKAASQjs.DeeplineError) || error.statusCode !== 404 && error.statusCode !== 405)
710
710
  throw error;
711
711
  lastResponse = null;
712
712
  await this.lookupExecutionByKey(
@@ -795,7 +795,7 @@ var ToolCalls = class {
795
795
  recoveryDeadline = Date.now() + recoveryTimeoutMs;
796
796
  }
797
797
  } catch (error) {
798
- if (idempotencyKey && error instanceof _chunkSQWET4SLjs.DeeplineError && error.code === "EXECUTION_OUTCOME_UNKNOWN") {
798
+ if (idempotencyKey && error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "EXECUTION_OUTCOME_UNKNOWN") {
799
799
  throw executionRecoveryError({
800
800
  toolId,
801
801
  idempotencyKey,
@@ -830,7 +830,7 @@ var ToolCalls = class {
830
830
  validateExecutionIdempotencyKey(idempotencyKey);
831
831
  const result = await this.lookupExecutionByKey(idempotencyKey);
832
832
  if (!result) {
833
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
833
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
834
834
  `No execution exists for idempotency key ${idempotencyKey}.`,
835
835
  404,
836
836
  "EXECUTION_NOT_FOUND"
@@ -856,7 +856,7 @@ var ToolCalls = class {
856
856
  }
857
857
  );
858
858
  if (!supported) {
859
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
859
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
860
860
  "This Deepline server does not support recoverable tool executions; no tool was dispatched.",
861
861
  422,
862
862
  "IDEMPOTENCY_NOT_SUPPORTED"
@@ -942,7 +942,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
942
942
  if (request.runtime !== void 0) {
943
943
  const runtime = normalizePlayRunRuntimeSelection(request.runtime);
944
944
  if (!runtime) {
945
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
945
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
946
946
  'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal", sandboxPlacementPolicy?: "policy_name@1" } with namespace matching ^[a-z][a-z0-9-]{0,30}$, or { environment: "native", sandboxPlacementPolicy: "policy_name@1" }.',
947
947
  void 0,
948
948
  "INVALID_RUNTIME_SELECTION"
@@ -955,7 +955,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
955
955
  const configuredToken = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
956
956
  const configuredPlacementPolicy = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
957
957
  if (_optionalChain([env, 'access', _46 => _46.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()])) {
958
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
958
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
959
959
  "DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.",
960
960
  void 0,
961
961
  "RUNTIME_GATEWAY_PROFILE_REMOVED"
@@ -970,7 +970,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
970
970
  present.push("DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY");
971
971
  }
972
972
  const isPlural = present.length > 1;
973
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
973
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
974
974
  [
975
975
  `Incomplete play runtime selection: ${present.join(" and ")} ${isPlural ? "are" : "is"} set but DEEPLINE_RUNTIME_ENVIRONMENT is not.`,
976
976
  "Preview routing requires DEEPLINE_RUNTIME_ENVIRONMENT=preview together with DEEPLINE_RUNTIME_NAMESPACE; the token alone authorizes nothing.",
@@ -988,7 +988,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
988
988
  configuredPlacementPolicy
989
989
  );
990
990
  if (configuredNamespace || !sandboxPlacementPolicy) {
991
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
991
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
992
992
  "DEEPLINE_RUNTIME_ENVIRONMENT=native requires DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY (such as modal_only@1) and no DEEPLINE_RUNTIME_NAMESPACE.",
993
993
  void 0,
994
994
  "INVALID_RUNTIME_ENVIRONMENT"
@@ -998,7 +998,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
998
998
  }
999
999
  const environment = normalizePlayRuntimeEnvironment(configured);
1000
1000
  if (!environment) {
1001
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1001
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1002
1002
  `DEEPLINE_RUNTIME_ENVIRONMENT must be preview or native. Received "${configured}". Omit it to use the app-native runtime.`,
1003
1003
  void 0,
1004
1004
  "INVALID_RUNTIME_ENVIRONMENT"
@@ -1006,7 +1006,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
1006
1006
  }
1007
1007
  const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
1008
1008
  if (!namespace) {
1009
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1009
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1010
1010
  "DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
1011
1011
  void 0,
1012
1012
  "INVALID_RUNTIME_NAMESPACE"
@@ -1015,14 +1015,14 @@ function resolvePlayRunRuntimeSelection(request, env) {
1015
1015
  const configuredBackendValue = _optionalChain([env, 'access', _49 => _49.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]);
1016
1016
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
1017
1017
  if (configuredBackendValue && !configuredBackend) {
1018
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1018
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1019
1019
  `DEEPLINE_PLAY_RUNNER_BACKEND must be daytona or modal for preview runtime selection. Received "${configuredBackendValue}".`,
1020
1020
  void 0,
1021
1021
  "INVALID_RUNTIME_BACKEND"
1022
1022
  );
1023
1023
  }
1024
1024
  if (configuredPlacementPolicy && !normalizePlayRuntimeSandboxPlacementPolicy(configuredPlacementPolicy)) {
1025
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1025
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1026
1026
  `DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY must be a versioned placement policy id such as daytona_only@1. Received "${configuredPlacementPolicy}".`,
1027
1027
  void 0,
1028
1028
  "INVALID_RUNTIME_SANDBOX_PLACEMENT_POLICY"
@@ -1052,7 +1052,7 @@ function runtimeSelectionHeaders(runtime, env) {
1052
1052
  if (!runtime || runtime.environment === "native") return void 0;
1053
1053
  const token = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
1054
1054
  if (!token) {
1055
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1055
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1056
1056
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
1057
1057
  void 0,
1058
1058
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
@@ -1060,15 +1060,15 @@ function runtimeSelectionHeaders(runtime, env) {
1060
1060
  }
1061
1061
  const receivers = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
1062
1062
  return {
1063
- [_chunkUWNVFAFNjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1064
- ...receivers ? { [_chunkUWNVFAFNjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1063
+ [_chunkCWSLUNA6js.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1064
+ ...receivers ? { [_chunkCWSLUNA6js.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1065
1065
  };
1066
1066
  }
1067
1067
  function normalizeTestPolicyOverrides(value, source) {
1068
1068
  if (value && typeof value === "object" && !Array.isArray(value)) {
1069
1069
  return value;
1070
1070
  }
1071
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1071
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1072
1072
  `${source} must be a JSON object.`,
1073
1073
  void 0,
1074
1074
  "INVALID_TEST_POLICY_OVERRIDES"
@@ -1083,7 +1083,7 @@ function parseEnvTestPolicyOverrides(env) {
1083
1083
  parsed = JSON.parse(trimmed);
1084
1084
  } catch (error) {
1085
1085
  const detail = error instanceof Error ? ` ${error.message}` : "";
1086
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
1086
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1087
1087
  `DEEPLINE_TEST_POLICY_OVERRIDES must be valid JSON.${detail}`,
1088
1088
  void 0,
1089
1089
  "INVALID_TEST_POLICY_OVERRIDES"
@@ -1095,10 +1095,10 @@ function isRecord2(value) {
1095
1095
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
1096
1096
  }
1097
1097
  function normalizePlayStatus(raw) {
1098
- const runPackage = _chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1098
+ const runPackage = _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1099
1099
  const packageRun = _optionalChain([runPackage, 'optionalAccess', _60 => _60.run]);
1100
1100
  const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _61 => _61.status]) === "string" ? packageRun.status : null;
1101
- const status = _chunk2KHUFWTKjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1101
+ const status = _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1102
1102
  if (!status) {
1103
1103
  throw new Error(
1104
1104
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
@@ -1129,10 +1129,10 @@ var PlayClient = class {
1129
1129
  async startPlayRun(request, options) {
1130
1130
  const resolved = resolveStartPlayRunRequest(request, this.environment);
1131
1131
  const headers = runtimeSelectionHeaders(resolved.runtime, this.environment);
1132
- return _chunk2KHUFWTKjs.startPlayRun.call(void 0,
1132
+ return _chunkCQDQNZGHjs.startPlayRun.call(void 0,
1133
1133
  this.http,
1134
1134
  resolved.request,
1135
- _optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkUWNVFAFNjs.SDK_API_MAJOR) } : headers,
1135
+ _optionalChain([options, 'optionalAccess', _65 => _65.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkCWSLUNA6js.SDK_API_MAJOR) } : headers,
1136
1136
  options
1137
1137
  );
1138
1138
  }
@@ -1406,13 +1406,13 @@ function stripLeadingTimestamp(line) {
1406
1406
 
1407
1407
  // src/runs/read-errors.ts
1408
1408
  function isTransientPlayRunReadError(error) {
1409
- if (error instanceof _chunkSQWET4SLjs.DeeplineError && error.code === "PLAY_START_OUTCOME_UNKNOWN") {
1409
+ if (error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "PLAY_START_OUTCOME_UNKNOWN") {
1410
1410
  return false;
1411
1411
  }
1412
- if (error instanceof _chunkSQWET4SLjs.DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
1412
+ if (error instanceof _chunkBBTKAASQjs.DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
1413
1413
  return true;
1414
1414
  }
1415
- if (error instanceof _chunkSQWET4SLjs.DeeplineError && typeof error.statusCode === "number") {
1415
+ if (error instanceof _chunkBBTKAASQjs.DeeplineError && typeof error.statusCode === "number") {
1416
1416
  return error.statusCode >= 500 && error.statusCode < 600;
1417
1417
  }
1418
1418
  const text = error instanceof Error ? error.message : String(error);
@@ -2698,7 +2698,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
2698
2698
 
2699
2699
  // ../play-runtime/run-snapshot-stream.ts
2700
2700
  function isTerminalPlayRunLiveStatus(status) {
2701
- return _chunk2KHUFWTKjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2701
+ return _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2702
2702
  }
2703
2703
  function makeRunStreamEvent(input) {
2704
2704
  return {
@@ -3146,7 +3146,7 @@ async function* watchRunEvents(options) {
3146
3146
 
3147
3147
  // src/client-core.ts
3148
3148
  function invalidToolDiscoveryResponse() {
3149
- return new (0, _chunkSQWET4SLjs.DeeplineError)(
3149
+ return new (0, _chunkBBTKAASQjs.DeeplineError)(
3150
3150
  "The server returned an invalid tool discovery response.",
3151
3151
  502,
3152
3152
  "INVALID_TOOL_DISCOVERY_RESPONSE"
@@ -3223,19 +3223,19 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3223
3223
  }
3224
3224
  const token = _optionalChain([env, 'access', _137 => _137.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()]);
3225
3225
  if (!token) {
3226
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
3226
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3227
3227
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
3228
3228
  void 0,
3229
3229
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3230
3230
  );
3231
3231
  }
3232
- return { [_chunkUWNVFAFNjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3232
+ return { [_chunkCWSLUNA6js.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3233
3233
  }
3234
3234
  function sleep(ms) {
3235
3235
  return new Promise((resolve) => setTimeout(resolve, ms));
3236
3236
  }
3237
3237
  function isTransientCompileManifestError(error) {
3238
- if (error instanceof _chunkSQWET4SLjs.DeeplineError && typeof error.statusCode === "number") {
3238
+ if (error instanceof _chunkBBTKAASQjs.DeeplineError && typeof error.statusCode === "number") {
3239
3239
  return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
3240
3240
  }
3241
3241
  const message = error instanceof Error ? error.message : String(error);
@@ -3246,7 +3246,7 @@ function isTransientCompileManifestError(error) {
3246
3246
  function requireCompileManifestResponse(response, playName) {
3247
3247
  const compilerManifest = _optionalChain([response, 'optionalAccess', _140 => _140.compilerManifest]);
3248
3248
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
3249
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
3249
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3250
3250
  `Compile manifest response did not include compilerManifest for ${playName}.`,
3251
3251
  502,
3252
3252
  "API_RESPONSE_INVALID",
@@ -3360,7 +3360,7 @@ function playLiveRunStatus(event) {
3360
3360
  return null;
3361
3361
  }
3362
3362
  const payload = getPlayLiveEventPayload(event);
3363
- return _nullishCoalesce(_chunk2KHUFWTKjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, payload) ? _chunk2KHUFWTKjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3363
+ return _nullishCoalesce(_chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3364
3364
  }
3365
3365
  function appendPlayLiveLogLines(state, payload) {
3366
3366
  const lines = readStringArray(payload.lines);
@@ -3392,7 +3392,7 @@ function updatePlayLiveStatusState(state, event) {
3392
3392
  if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
3393
3393
  return null;
3394
3394
  }
3395
- const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3395
+ const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3396
3396
  const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
3397
3397
  const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
3398
3398
  if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
@@ -3405,7 +3405,7 @@ function updatePlayLiveStatusState(state, event) {
3405
3405
  }
3406
3406
  if ("result" in payload) {
3407
3407
  state.result = payload.result;
3408
- } else if (_chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, payload)) {
3408
+ } else if (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload)) {
3409
3409
  state.result = payload;
3410
3410
  }
3411
3411
  if (typeof payload.error === "string" && payload.error.trim()) {
@@ -3418,7 +3418,7 @@ function updatePlayLiveStatusState(state, event) {
3418
3418
  ...payload,
3419
3419
  runId,
3420
3420
  status,
3421
- ..._chunk2KHUFWTKjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3421
+ ..._chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3422
3422
  progress: {
3423
3423
  ...progressRecord,
3424
3424
  status: typeof progressRecord.status === "string" ? progressRecord.status : status,
@@ -3537,7 +3537,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3537
3537
  usageEvent: (requestId) => this.getBillingUsageEvent(requestId),
3538
3538
  usageEvents: (options) => this.getBillingUsageEvents(options),
3539
3539
  usage: (options) => this.getBillingUsage(options),
3540
- targetPlans: () => this.getTargetBillingPlans(),
3540
+ targetPlans: (options) => this.getTargetBillingPlans(options),
3541
3541
  targetStatus: () => this.getTargetBillingStatus(),
3542
3542
  autoRecharge: {
3543
3543
  get: () => this.getTargetAutoRecharge(),
@@ -3552,6 +3552,37 @@ var DeeplineClient = (_class = class _DeeplineClient {
3552
3552
  ),
3553
3553
  update: (options) => this.updateTargetAutoRecharge(options)
3554
3554
  },
3555
+ cards: {
3556
+ list: (options) => {
3557
+ const query = new URLSearchParams();
3558
+ if (_optionalChain([options, 'optionalAccess', _158 => _158.limit]) !== void 0) {
3559
+ query.set("limit", String(options.limit));
3560
+ }
3561
+ if (_optionalChain([options, 'optionalAccess', _159 => _159.cursor])) query.set("cursor", options.cursor);
3562
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
3563
+ return this.http.get(
3564
+ `/api/v2/billing/payment-methods${suffix}`
3565
+ );
3566
+ },
3567
+ add: (options) => this.http.post(
3568
+ "/api/v2/billing/payment-method/setup",
3569
+ { make_default: _optionalChain([options, 'optionalAccess', _160 => _160.makeDefault]) === true }
3570
+ ),
3571
+ setDefault: (options) => this.http.post(
3572
+ "/api/v2/billing/payment-methods/default",
3573
+ {
3574
+ card_id: options.cardId,
3575
+ change_id: _nullishCoalesce(options.changeId, () => ( globalThis.crypto.randomUUID()))
3576
+ }
3577
+ ),
3578
+ remove: (options) => this.http.post(
3579
+ "/api/v2/billing/payment-methods/remove",
3580
+ {
3581
+ card_id: options.cardId,
3582
+ change_id: _nullishCoalesce(options.changeId, () => ( globalThis.crypto.randomUUID()))
3583
+ }
3584
+ )
3585
+ },
3555
3586
  purchaseCredits: (options) => this.purchaseTargetBillingCredits(options),
3556
3587
  recoverCreditPurchase: (options) => this.recoverTargetBillingCreditPurchase(options),
3557
3588
  transitionPlan: (options) => this.transitionTargetBillingPlan(options),
@@ -3559,7 +3590,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3559
3590
  };
3560
3591
  this.workspaces = {
3561
3592
  members: (options) => {
3562
- const query = _optionalChain([options, 'optionalAccess', _158 => _158.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3593
+ const query = _optionalChain([options, 'optionalAccess', _161 => _161.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3563
3594
  return this.http.get(`/api/v2/auth/workspace/members${query}`);
3564
3595
  },
3565
3596
  setMemberGrants: (memberId, grants) => this.http.patch(
@@ -3611,7 +3642,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3611
3642
  check: (definition) => this.checkMonitor(definition),
3612
3643
  preview: (definition, options) => this.previewMonitor(definition, options),
3613
3644
  deploy: (definition, options) => this.deployMonitor(definition, options),
3614
- sync: (definition, options) => _optionalChain([options, 'optionalAccess', _159 => _159.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3645
+ sync: (definition, options) => _optionalChain([options, 'optionalAccess', _162 => _162.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3615
3646
  list: (options) => this.listMonitors(options),
3616
3647
  ledger: (options) => this.listMonitorLedger(options),
3617
3648
  ledgerGet: (key) => this.getMonitorLedgerEntry(key),
@@ -3623,13 +3654,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3623
3654
  update: (key, patch) => this.updateMonitor(key, patch),
3624
3655
  delete: (key, options) => this.deleteMonitor(key, options),
3625
3656
  reactivate: (key, options) => this.reactivateMonitor(key, options),
3626
- start: (key, options) => _optionalChain([options, 'optionalAccess', _160 => _160.dryRun]) ? this.submitMonitorBatch({
3657
+ start: (key, options) => _optionalChain([options, 'optionalAccess', _163 => _163.dryRun]) ? this.submitMonitorBatch({
3627
3658
  kind: "reactivate",
3628
3659
  scope: { kind: "keys", monitorKeys: [key] },
3629
3660
  dryRun: true,
3630
3661
  idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3631
3662
  }) : this.submitScalarMonitorLifecycle(key, "start", options),
3632
- stop: (key, options) => _optionalChain([options, 'optionalAccess', _161 => _161.dryRun]) ? this.submitMonitorBatch({
3663
+ stop: (key, options) => _optionalChain([options, 'optionalAccess', _164 => _164.dryRun]) ? this.submitMonitorBatch({
3633
3664
  kind: "deactivate",
3634
3665
  scope: { kind: "keys", monitorKeys: [key] },
3635
3666
  dryRun: true,
@@ -3677,83 +3708,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
3677
3708
  // ——————————————————————————————————————————————————————————
3678
3709
  // Secrets
3679
3710
  // ——————————————————————————————————————————————————————————
3680
- /** List this workspace's hosted pages, newest update first. */
3681
- async listPages(input) {
3682
- const params = new URLSearchParams();
3683
- if (_optionalChain([input, 'optionalAccess', _162 => _162.cursor])) params.set("cursor", input.cursor);
3684
- if (_optionalChain([input, 'optionalAccess', _163 => _163.limit])) params.set("limit", String(input.limit));
3685
- const query = params.size > 0 ? `?${params}` : "";
3686
- return await this.http.get(`/api/v2/pages${query}`);
3687
- }
3688
- /** Read one hosted page's metadata. */
3689
- async getPage(name) {
3690
- return await this.http.get(
3691
- `/api/v2/pages/${encodeURIComponent(name)}`
3692
- );
3693
- }
3694
- /** Replace a page's whole content. `public` says who the write is for. */
3695
- async writePage(name, input) {
3696
- return await this.http.put(
3697
- `/api/v2/pages/${encodeURIComponent(name)}`,
3698
- {
3699
- public: input.public,
3700
- content_base64: input.contentBase64,
3701
- content_type: input.contentType,
3702
- description: input.description
3703
- }
3704
- );
3705
- }
3706
- /** Delete a page, its content, and its links. Safe to repeat. */
3707
- async deletePage(name) {
3708
- return await this.http.delete(
3709
- `/api/v2/pages/${encodeURIComponent(name)}`
3710
- );
3711
- }
3712
- /** Replace the origins allowed to read this page in a browser when public. */
3713
- async setPageAllowedOrigins(name, origins) {
3714
- return await this.http.put(
3715
- `/api/v2/pages/${encodeURIComponent(name)}/origins`,
3716
- { allowed_origins: origins }
3717
- );
3718
- }
3719
- /** The explicit way to change who can see an existing page. */
3720
- async setPageVisibility(name, isPublic) {
3721
- return await this.http.post(
3722
- `/api/v2/pages/${encodeURIComponent(name)}/visibility`,
3723
- { public: isPublic }
3724
- );
3725
- }
3726
- /** List a page's links. Their URLs cannot be shown again. */
3727
- async listPageLinks(name) {
3728
- return await this.http.get(
3729
- `/api/v2/pages/${encodeURIComponent(name)}/links`
3730
- );
3731
- }
3732
- /** The returned URL is shown once. Either expiry or `permanent` is required. */
3733
- async createPageLink(name, input) {
3734
- return await this.http.post(
3735
- `/api/v2/pages/${encodeURIComponent(name)}/links`,
3736
- {
3737
- expires_in_seconds: input.expiresInSeconds,
3738
- permanent: input.permanent,
3739
- label: input.label
3740
- }
3741
- );
3742
- }
3743
- /** Stop a link working. Safe to repeat. */
3744
- async revokePageLink(name, linkId) {
3745
- return await this.http.delete(
3746
- `/api/v2/pages/${encodeURIComponent(name)}/links/${encodeURIComponent(linkId)}`
3747
- );
3748
- }
3749
3711
  // ——————————————————————————————————————————————————————————
3750
3712
  // Views
3751
3713
  // ——————————————————————————————————————————————————————————
3752
3714
  /** List this workspace's views, most recently changed first. */
3753
3715
  async listViews(input) {
3754
3716
  const params = new URLSearchParams();
3755
- if (_optionalChain([input, 'optionalAccess', _164 => _164.cursor])) params.set("cursor", input.cursor);
3756
- if (_optionalChain([input, 'optionalAccess', _165 => _165.limit])) params.set("limit", String(input.limit));
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));
3757
3719
  const query = params.size > 0 ? `?${params}` : "";
3758
3720
  return await this.http.get(`/api/v2/views${query}`);
3759
3721
  }
@@ -3781,11 +3743,37 @@ var DeeplineClient = (_class = class _DeeplineClient {
3781
3743
  { access }
3782
3744
  );
3783
3745
  }
3746
+ /** The view's share links, newest first. Their tokens are never returned. */
3747
+ async listViewShareLinks(id) {
3748
+ return await this.http.get(
3749
+ `/api/v2/views/${encodeURIComponent(id)}/links`
3750
+ );
3751
+ }
3752
+ /**
3753
+ * Create a share link. `url` in the result is the only copy of the link;
3754
+ * keep it. With `emails`, Deepline also emails it to those people, except
3755
+ * `not_emailed` addresses that bounced or complained before. One
3756
+ * Idempotency-Key per call, so a retried request returns the same link
3757
+ * (with `url: null`) instead of making and emailing a second one.
3758
+ */
3759
+ async createViewShareLink(id, input) {
3760
+ return await this.http.post(
3761
+ `/api/v2/views/${encodeURIComponent(id)}/links`,
3762
+ input,
3763
+ { "Idempotency-Key": `view-link-${globalThis.crypto.randomUUID()}` }
3764
+ );
3765
+ }
3766
+ /** Revoke a share link. It stops opening the view at once. */
3767
+ async revokeViewShareLink(id, linkId) {
3768
+ return await this.http.delete(
3769
+ `/api/v2/views/${encodeURIComponent(id)}/links/${encodeURIComponent(linkId)}`
3770
+ );
3771
+ }
3784
3772
  /** Every run of the view's Play, newest first. */
3785
3773
  async listViewRuns(id, input) {
3786
3774
  const params = new URLSearchParams();
3787
- if (_optionalChain([input, 'optionalAccess', _166 => _166.limit])) params.set("limit", String(input.limit));
3788
- if (_optionalChain([input, 'optionalAccess', _167 => _167.offset])) params.set("offset", String(input.offset));
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));
3789
3777
  const query = params.size > 0 ? `?${params}` : "";
3790
3778
  return await this.http.get(
3791
3779
  `/api/v2/views/${encodeURIComponent(id)}/runs${query}`
@@ -3873,17 +3861,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3873
3861
  */
3874
3862
  async listTools(options) {
3875
3863
  const params = new URLSearchParams();
3876
- if (_optionalChain([options, 'optionalAccess', _168 => _168.categories, 'optionalAccess', _169 => _169.trim, 'call', _170 => _170()])) {
3864
+ if (_optionalChain([options, 'optionalAccess', _169 => _169.categories, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()])) {
3877
3865
  params.set("categories", options.categories.trim());
3878
3866
  }
3879
- if (_optionalChain([options, 'optionalAccess', _171 => _171.tags, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()])) {
3867
+ if (_optionalChain([options, 'optionalAccess', _172 => _172.tags, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
3880
3868
  params.set("tags", options.tags.trim());
3881
3869
  }
3882
- if (_optionalChain([options, 'optionalAccess', _174 => _174.grep, 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()])) {
3870
+ if (_optionalChain([options, 'optionalAccess', _175 => _175.grep, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()])) {
3883
3871
  params.set("grep", options.grep.trim());
3884
3872
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3885
3873
  }
3886
- params.set("compact", _optionalChain([options, 'optionalAccess', _177 => _177.compact]) === true ? "true" : "false");
3874
+ params.set("compact", _optionalChain([options, 'optionalAccess', _178 => _178.compact]) === true ? "true" : "false");
3887
3875
  const suffix = params.toString() ? `?${params.toString()}` : "";
3888
3876
  const res = await this.http.get(
3889
3877
  `/api/v2/tools${suffix}`
@@ -3907,7 +3895,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3907
3895
  async listToolsInCategory(category, options) {
3908
3896
  const normalizedCategory = category.trim();
3909
3897
  if (!normalizedCategory || category.includes(",")) {
3910
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
3898
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3911
3899
  "Provide one non-empty tool category.",
3912
3900
  400,
3913
3901
  "INVALID_TOOL_CATEGORY"
@@ -3916,7 +3904,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3916
3904
  const params = new URLSearchParams({
3917
3905
  view: "category",
3918
3906
  categories: normalizedCategory,
3919
- compact: _optionalChain([options, 'optionalAccess', _178 => _178.compact]) === true ? "true" : "false"
3907
+ compact: _optionalChain([options, 'optionalAccess', _179 => _179.compact]) === true ? "true" : "false"
3920
3908
  });
3921
3909
  const response = await this.http.get(
3922
3910
  `/api/v2/tools?${params}`
@@ -3931,7 +3919,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3931
3919
  }
3932
3920
  /** List discoverable providers without requiring a local plugin catalog. */
3933
3921
  async listProviders(options) {
3934
- const suffix = _optionalChain([options, 'optionalAccess', _179 => _179.changed]) ? "?changed=true" : "";
3922
+ const suffix = _optionalChain([options, 'optionalAccess', _180 => _180.changed]) ? "?changed=true" : "";
3935
3923
  const res = await this.http.get(
3936
3924
  `/api/v2/tools/providers${suffix}`
3937
3925
  );
@@ -3962,8 +3950,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3962
3950
  */
3963
3951
  async search(options = {}) {
3964
3952
  const params = searchParams(options);
3965
- if (_optionalChain([options, 'access', _180 => _180.types, 'optionalAccess', _181 => _181.length])) params.set("types", options.types.join(","));
3966
- if (_optionalChain([options, 'access', _182 => _182.exclude, 'optionalAccess', _183 => _183.length])) {
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])) {
3967
3955
  params.set("exclude", options.exclude.join(","));
3968
3956
  }
3969
3957
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3985,7 +3973,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3985
3973
  * ```
3986
3974
  */
3987
3975
  async getTool(toolId, options) {
3988
- if (_optionalChain([options, 'optionalAccess', _184 => _184.cliInvocationId]) !== void 0) {
3976
+ if (_optionalChain([options, 'optionalAccess', _185 => _185.cliInvocationId]) !== void 0) {
3989
3977
  validateCliInvocationId(options.cliInvocationId);
3990
3978
  }
3991
3979
  return this.http.request(
@@ -3998,7 +3986,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3998
3986
  retryApiErrors: true,
3999
3987
  headers: {
4000
3988
  "x-deepline-tool-meta-only": "1",
4001
- ..._optionalChain([options, 'optionalAccess', _185 => _185.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
3989
+ ..._optionalChain([options, 'optionalAccess', _186 => _186.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
4002
3990
  }
4003
3991
  }
4004
3992
  );
@@ -4089,7 +4077,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4089
4077
  return this.http.post(
4090
4078
  "/api/v2/ingestion/repair",
4091
4079
  {
4092
- ..._optionalChain([input, 'optionalAccess', _186 => _186.provider]) ? { provider: input.provider } : {}
4080
+ ..._optionalChain([input, 'optionalAccess', _187 => _187.provider]) ? { provider: input.provider } : {}
4093
4081
  }
4094
4082
  );
4095
4083
  }
@@ -4141,10 +4129,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4141
4129
  */
4142
4130
  async preparePlayRunAdmission(request, options) {
4143
4131
  const resolved = resolveStartPlayRunRequest(request, this.environment);
4144
- const prepared = await _chunk2KHUFWTKjs.preparePlayRunAdmission.call(void 0,
4132
+ const prepared = await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4145
4133
  this.http,
4146
4134
  resolved.request,
4147
- _optionalChain([options, 'optionalAccess', _187 => _187.onSubmission]),
4135
+ _optionalChain([options, 'optionalAccess', _188 => _188.onSubmission]),
4148
4136
  options
4149
4137
  );
4150
4138
  const bodyJson = JSON.stringify(prepared.body);
@@ -4152,9 +4140,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4152
4140
  resolved.runtime,
4153
4141
  this.environment
4154
4142
  );
4155
- const headers = _optionalChain([options, 'optionalAccess', _188 => _188.cliAdmission]) ? {
4143
+ const headers = _optionalChain([options, 'optionalAccess', _189 => _189.cliAdmission]) ? {
4156
4144
  ...runtimeHeaders,
4157
- "X-Deepline-API-Major": String(_chunkUWNVFAFNjs.SDK_API_MAJOR)
4145
+ "X-Deepline-API-Major": String(_chunkCWSLUNA6js.SDK_API_MAJOR)
4158
4146
  } : runtimeHeaders;
4159
4147
  const http = this.http;
4160
4148
  let submitted = false;
@@ -4162,38 +4150,38 @@ var DeeplineClient = (_class = class _DeeplineClient {
4162
4150
  ...prepared,
4163
4151
  async start(startOptions) {
4164
4152
  if (submitted && !prepared.supportsCallerIntent) {
4165
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4153
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4166
4154
  "This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
4167
4155
  409,
4168
4156
  "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
4169
4157
  );
4170
4158
  }
4171
4159
  if (submitted) {
4172
- if (!_optionalChain([options, 'optionalAccess', _189 => _189.callerIntentV2])) {
4173
- await _chunk2KHUFWTKjs.preparePlayRunAdmission.call(void 0,
4160
+ if (!_optionalChain([options, 'optionalAccess', _190 => _190.callerIntentV2])) {
4161
+ await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4174
4162
  http,
4175
4163
  JSON.parse(bodyJson),
4176
4164
  void 0,
4177
- { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _190 => _190.signal]), () => ( _optionalChain([options, 'optionalAccess', _191 => _191.signal]))) }
4165
+ { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _191 => _191.signal]), () => ( _optionalChain([options, 'optionalAccess', _192 => _192.signal]))) }
4178
4166
  );
4179
4167
  }
4180
4168
  }
4181
4169
  submitted = true;
4182
4170
  try {
4183
- return await _chunk2KHUFWTKjs.submitPreparedPlayRunAdmission.call(void 0,
4171
+ return await _chunkCQDQNZGHjs.submitPreparedPlayRunAdmission.call(void 0,
4184
4172
  http,
4185
4173
  JSON.parse(bodyJson),
4186
4174
  prepared.workflowId,
4187
4175
  prepared.supportsCallerIntent,
4188
4176
  headers,
4189
4177
  {
4190
- cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _192 => _192.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _193 => _193.cliAdmission]))),
4191
- callerIntentV2: _optionalChain([options, 'optionalAccess', _194 => _194.callerIntentV2]),
4192
- signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _195 => _195.signal]), () => ( _optionalChain([options, 'optionalAccess', _196 => _196.signal])))
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])))
4193
4181
  }
4194
4182
  );
4195
4183
  } catch (error) {
4196
- if (error instanceof _chunk2KHUFWTKjs.CliPlayAdmissionUnsupportedError || error instanceof _chunk2KHUFWTKjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
4184
+ if (error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
4197
4185
  submitted = false;
4198
4186
  }
4199
4187
  throw error;
@@ -4201,50 +4189,50 @@ var DeeplineClient = (_class = class _DeeplineClient {
4201
4189
  },
4202
4190
  async *startStream(streamOptions) {
4203
4191
  if (submitted && !prepared.supportsCallerIntent) {
4204
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4192
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4205
4193
  "This server has not enabled caller-owned admission recovery. Do not retry an ambiguous start.",
4206
4194
  409,
4207
4195
  "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
4208
4196
  );
4209
4197
  }
4210
4198
  if (submitted) {
4211
- if (!_optionalChain([options, 'optionalAccess', _197 => _197.callerIntentV2])) {
4212
- await _chunk2KHUFWTKjs.preparePlayRunAdmission.call(void 0,
4199
+ if (!_optionalChain([options, 'optionalAccess', _198 => _198.callerIntentV2])) {
4200
+ await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4213
4201
  http,
4214
4202
  JSON.parse(bodyJson),
4215
4203
  void 0,
4216
- { signal: _optionalChain([streamOptions, 'optionalAccess', _198 => _198.signal]) }
4204
+ { signal: _optionalChain([streamOptions, 'optionalAccess', _199 => _199.signal]) }
4217
4205
  );
4218
4206
  }
4219
4207
  }
4220
4208
  submitted = true;
4221
- const streamPath = _optionalChain([options, 'optionalAccess', _199 => _199.callerIntentV2]) ? _chunk2KHUFWTKjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _200 => _200.cliAdmission]) ? _chunk2KHUFWTKjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunk2KHUFWTKjs.PLAY_RUN_START_STREAM_PATH;
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
4210
  let cliAdmissionSupported = false;
4223
4211
  try {
4224
4212
  for await (const event of http.streamSse(streamPath, {
4225
4213
  method: "POST",
4226
4214
  body: JSON.parse(bodyJson),
4227
4215
  headers,
4228
- signal: _optionalChain([streamOptions, 'optionalAccess', _201 => _201.signal]),
4216
+ signal: _optionalChain([streamOptions, 'optionalAccess', _202 => _202.signal]),
4229
4217
  exactUrlOnly: true,
4230
- ..._optionalChain([options, 'optionalAccess', _202 => _202.cliAdmission]) ? {
4218
+ ..._optionalChain([options, 'optionalAccess', _203 => _203.cliAdmission]) ? {
4231
4219
  onResponse: (response) => {
4232
- cliAdmissionSupported = response.headers.get(_chunk2KHUFWTKjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4220
+ cliAdmissionSupported = response.headers.get(_chunkCQDQNZGHjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4233
4221
  }
4234
4222
  } : {}
4235
4223
  })) {
4236
4224
  if (event.scope === "play") yield event;
4237
4225
  }
4238
4226
  } catch (error) {
4239
- if (_optionalChain([options, 'optionalAccess', _203 => _203.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkSQWET4SLjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4227
+ if (_optionalChain([options, 'optionalAccess', _204 => _204.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4240
4228
  if (options.callerIntentV2) {
4241
4229
  submitted = false;
4242
- throw new (0, _chunk2KHUFWTKjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
4230
+ throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
4243
4231
  error.statusCode
4244
4232
  );
4245
4233
  }
4246
4234
  submitted = false;
4247
- throw new (0, _chunk2KHUFWTKjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4235
+ throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4248
4236
  }
4249
4237
  throw error;
4250
4238
  }
@@ -4257,7 +4245,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4257
4245
  * @internal
4258
4246
  */
4259
4247
  async prefetchPlayRunAdmissionCapability(options) {
4260
- return _chunk2KHUFWTKjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
4248
+ return _chunkCQDQNZGHjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
4261
4249
  }
4262
4250
  /**
4263
4251
  * Submit a play run through the legacy event response.
@@ -4274,7 +4262,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4274
4262
  */
4275
4263
  async *startPlayRunStream(request, options) {
4276
4264
  const prepared = await this.preparePlayRunAdmission(request, options);
4277
- yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _204 => _204.signal]) });
4265
+ yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _205 => _205.signal]) });
4278
4266
  }
4279
4267
  /**
4280
4268
  * Register a bundled play artifact.
@@ -4427,7 +4415,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4427
4415
  compilerManifest,
4428
4416
  ...input.input ? { input: input.input } : {},
4429
4417
  ...input.inputFile ? { inputFile: input.inputFile } : {},
4430
- ..._optionalChain([input, 'access', _205 => _205.packagedFiles, 'optionalAccess', _206 => _206.length]) ? { packagedFiles: input.packagedFiles } : {},
4418
+ ..._optionalChain([input, 'access', _206 => _206.packagedFiles, 'optionalAccess', _207 => _207.length]) ? { packagedFiles: input.packagedFiles } : {},
4431
4419
  ...input.force ? { force: true } : {},
4432
4420
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
4433
4421
  });
@@ -4457,29 +4445,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
4457
4445
  * ```
4458
4446
  */
4459
4447
  async submitPlay(code, csvPath, name, options) {
4460
- const runtimeInput = _optionalChain([options, 'optionalAccess', _207 => _207.input]) ? { ...options.input } : {};
4448
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _208 => _208.input]) ? { ...options.input } : {};
4461
4449
  if (csvPath) {
4462
4450
  runtimeInput.file = csvPath;
4463
4451
  }
4464
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _208 => _208.sourceCode]), () => ( code));
4465
- const artifact = _optionalChain([options, 'optionalAccess', _209 => _209.artifact]);
4466
- if (!_optionalChain([name, 'optionalAccess', _210 => _210.trim, 'call', _211 => _211()])) {
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()])) {
4467
4455
  throw new Error("submitPlay requires a play name.");
4468
4456
  }
4469
4457
  if (!artifact) {
4470
4458
  throw new Error("submitPlay requires a bundled play artifact.");
4471
4459
  }
4472
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _212 => _212.compilerManifest]), async () => ( await this.compilePlayManifest({
4460
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _213 => _213.compilerManifest]), async () => ( await this.compilePlayManifest({
4473
4461
  name,
4474
4462
  sourceCode,
4475
- sourceFiles: _optionalChain([options, 'optionalAccess', _213 => _213.sourceFiles]),
4463
+ sourceFiles: _optionalChain([options, 'optionalAccess', _214 => _214.sourceFiles]),
4476
4464
  artifact
4477
4465
  })));
4478
4466
  const registeredArtifact = await this.registerPlayArtifact({
4479
4467
  name,
4480
4468
  sourceCode,
4481
- sourceFiles: _optionalChain([options, 'optionalAccess', _214 => _214.sourceFiles]),
4482
- description: _optionalChain([options, 'optionalAccess', _215 => _215.description]),
4469
+ sourceFiles: _optionalChain([options, 'optionalAccess', _215 => _215.sourceFiles]),
4470
+ description: _optionalChain([options, 'optionalAccess', _216 => _216.description]),
4483
4471
  artifact,
4484
4472
  compilerManifest,
4485
4473
  publish: false
@@ -4493,17 +4481,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4493
4481
  name,
4494
4482
  artifactStorageKey: registeredArtifact.artifactStorageKey,
4495
4483
  sourceCode,
4496
- description: _optionalChain([options, 'optionalAccess', _216 => _216.description]),
4484
+ description: _optionalChain([options, 'optionalAccess', _217 => _217.description]),
4497
4485
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
4498
4486
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
4499
4487
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
4500
4488
  runtimeArtifact: artifact,
4501
4489
  compilerManifest,
4502
4490
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4503
- ..._optionalChain([options, 'optionalAccess', _217 => _217.inputFile]) ? { inputFile: options.inputFile } : {},
4504
- ..._optionalChain([options, 'optionalAccess', _218 => _218.packagedFiles, 'optionalAccess', _219 => _219.length]) ? { packagedFiles: options.packagedFiles } : {},
4505
- ..._optionalChain([options, 'optionalAccess', _220 => _220.force]) ? { force: true } : {},
4506
- ..._optionalChain([options, 'optionalAccess', _221 => _221.forceToolRefresh]) ? { forceToolRefresh: true } : {}
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 } : {}
4507
4495
  });
4508
4496
  }
4509
4497
  /**
@@ -4531,7 +4519,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4531
4519
  * ```
4532
4520
  */
4533
4521
  async stagePlayFiles(files) {
4534
- return _chunk2KHUFWTKjs.stagePlayFiles.call(void 0, this.http, files);
4522
+ return _chunkCQDQNZGHjs.stagePlayFiles.call(void 0, this.http, files);
4535
4523
  }
4536
4524
  /**
4537
4525
  * Mint short-lived presigned upload targets for staged play files.
@@ -4540,7 +4528,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4540
4528
  * For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
4541
4529
  */
4542
4530
  async mintStagedPlayFileUploads(files) {
4543
- return _chunk2KHUFWTKjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4531
+ return _chunkCQDQNZGHjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4544
4532
  }
4545
4533
  /**
4546
4534
  * Resolve staged play files by content hash without uploading bytes.
@@ -4579,13 +4567,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4579
4567
  for await (const event of watchRunEvents({
4580
4568
  http: this.http,
4581
4569
  runId: workflowId,
4582
- signal: _optionalChain([options, 'optionalAccess', _222 => _222.signal]),
4583
- onNotice: _optionalChain([options, 'optionalAccess', _223 => _223.onNotice]),
4584
- onRetry: _optionalChain([options, 'optionalAccess', _224 => _224.onRetry]),
4585
- deferLogs: _optionalChain([options, 'optionalAccess', _225 => _225.deferLogs]),
4586
- omitTerminalLogs: _optionalChain([options, 'optionalAccess', _226 => _226.omitTerminalLogs]),
4587
- onPoll: _optionalChain([options, 'optionalAccess', _227 => _227.onPoll]),
4588
- ..._optionalChain([options, 'optionalAccess', _228 => _228.terminalStatus]) ? {
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]) ? {
4589
4577
  terminalStatus: {
4590
4578
  ...options.terminalStatus,
4591
4579
  onStatus: async (raw, expectedStatus) => {
@@ -4595,7 +4583,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4595
4583
  `Run watch returned a mismatched terminal status for ${workflowId}.`
4596
4584
  );
4597
4585
  }
4598
- await _optionalChain([options, 'access', _229 => _229.terminalStatus, 'optionalAccess', _230 => _230.onStatus, 'call', _231 => _231(status)]);
4586
+ await _optionalChain([options, 'access', _230 => _230.terminalStatus, 'optionalAccess', _231 => _231.onStatus, 'call', _232 => _232(status)]);
4599
4587
  }
4600
4588
  }
4601
4589
  } : {}
@@ -4610,12 +4598,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4610
4598
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4611
4599
  */
4612
4600
  async *streamPlayRunEvents(workflowId, options) {
4613
- const headers = _optionalChain([options, 'optionalAccess', _232 => _232.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4601
+ const headers = _optionalChain([options, 'optionalAccess', _233 => _233.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4614
4602
  const params = new URLSearchParams();
4615
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _233 => _233.mode]), () => ( "cli")));
4603
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _234 => _234.mode]), () => ( "cli")));
4616
4604
  for await (const event of this.http.streamSse(
4617
4605
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4618
- { signal: _optionalChain([options, 'optionalAccess', _234 => _234.signal]), headers }
4606
+ { signal: _optionalChain([options, 'optionalAccess', _235 => _235.signal]), headers }
4619
4607
  )) {
4620
4608
  if (event.scope === "play") {
4621
4609
  yield event;
@@ -4631,8 +4619,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4631
4619
  */
4632
4620
  async *observeRunEvents(runId, options) {
4633
4621
  yield* this.watchRunEvents(runId, {
4634
- signal: _optionalChain([options, 'optionalAccess', _235 => _235.signal]),
4635
- onNotice: _optionalChain([options, 'optionalAccess', _236 => _236.onNotice])
4622
+ signal: _optionalChain([options, 'optionalAccess', _236 => _236.signal]),
4623
+ onNotice: _optionalChain([options, 'optionalAccess', _237 => _237.onNotice])
4636
4624
  });
4637
4625
  }
4638
4626
  /** Poll snapshots to terminal status and return the durable package. */
@@ -4640,9 +4628,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4640
4628
  let terminalObserved = false;
4641
4629
  let terminalStatus = null;
4642
4630
  for await (const event of this.watchRunEvents(runId, {
4643
- signal: _optionalChain([options, 'optionalAccess', _237 => _237.signal]),
4644
- onNotice: _optionalChain([options, 'optionalAccess', _238 => _238.onNotice]),
4645
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _239 => _239.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _240 => _240.onReconnect]))),
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]))),
4646
4634
  terminalStatus: {
4647
4635
  runStatus: true,
4648
4636
  onStatus: (status) => {
@@ -4650,19 +4638,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
4650
4638
  }
4651
4639
  }
4652
4640
  })) {
4653
- _optionalChain([options, 'optionalAccess', _241 => _241.onEvent, 'optionalCall', _242 => _242(event)]);
4654
- if (_chunk2KHUFWTKjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4641
+ _optionalChain([options, 'optionalAccess', _242 => _242.onEvent, 'optionalCall', _243 => _243(event)]);
4642
+ if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4655
4643
  terminalObserved = true;
4656
4644
  }
4657
4645
  }
4658
- if (_optionalChain([options, 'optionalAccess', _243 => _243.signal, 'optionalAccess', _244 => _244.aborted])) {
4659
- throw new (0, _chunkSQWET4SLjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4646
+ if (_optionalChain([options, 'optionalAccess', _244 => _244.signal, 'optionalAccess', _245 => _245.aborted])) {
4647
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4660
4648
  }
4661
4649
  const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
4662
- if (terminalObserved || _chunk2KHUFWTKjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4650
+ if (terminalObserved || _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4663
4651
  return refreshed;
4664
4652
  }
4665
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4653
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4666
4654
  `Run watch for ${runId} ended before a terminal status.`,
4667
4655
  void 0,
4668
4656
  "PLAY_WATCH_ENDED"
@@ -4735,7 +4723,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4735
4723
  /** List the org's workflows. `GET /api/v2/workflows`. */
4736
4724
  async listWorkflows(options) {
4737
4725
  const params = new URLSearchParams();
4738
- if (typeof _optionalChain([options, 'optionalAccess', _245 => _245.limit]) === "number") {
4726
+ if (typeof _optionalChain([options, 'optionalAccess', _246 => _246.limit]) === "number") {
4739
4727
  params.set("limit", String(options.limit));
4740
4728
  }
4741
4729
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4788,7 +4776,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4788
4776
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4789
4777
  async listWorkflowRuns(id, options) {
4790
4778
  const params = new URLSearchParams();
4791
- if (typeof _optionalChain([options, 'optionalAccess', _246 => _246.limit]) === "number") {
4779
+ if (typeof _optionalChain([options, 'optionalAccess', _247 => _247.limit]) === "number") {
4792
4780
  params.set("limit", String(options.limit));
4793
4781
  }
4794
4782
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4824,16 +4812,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4824
4812
  */
4825
4813
  async getRunStatus(runId, options) {
4826
4814
  const params = new URLSearchParams();
4827
- if (_optionalChain([options, 'optionalAccess', _247 => _247.full]) === true) {
4815
+ if (_optionalChain([options, 'optionalAccess', _248 => _248.full]) === true) {
4828
4816
  params.set("full", "true");
4829
4817
  }
4830
- if (_optionalChain([options, 'optionalAccess', _248 => _248.configuration]) === true) {
4818
+ if (_optionalChain([options, 'optionalAccess', _249 => _249.configuration]) === true) {
4831
4819
  params.append("include", "configuration");
4832
4820
  }
4833
- if (_optionalChain([options, 'optionalAccess', _249 => _249.performance]) === true) {
4821
+ if (_optionalChain([options, 'optionalAccess', _250 => _250.performance]) === true) {
4834
4822
  params.append("include", "performance");
4835
4823
  }
4836
- if (_optionalChain([options, 'optionalAccess', _250 => _250.retries]) === true) {
4824
+ if (_optionalChain([options, 'optionalAccess', _251 => _251.retries]) === true) {
4837
4825
  params.append("include", "retries");
4838
4826
  }
4839
4827
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4841,15 +4829,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
4841
4829
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4842
4830
  { headers: { "x-deepline-run-status": "1" } }
4843
4831
  );
4844
- if (_optionalChain([options, 'optionalAccess', _251 => _251.configuration]) === true && !Object.hasOwn(response, "contract")) {
4845
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4832
+ if (_optionalChain([options, 'optionalAccess', _252 => _252.configuration]) === true && !Object.hasOwn(response, "contract")) {
4833
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4846
4834
  "This server does not support recorded configuration reads.",
4847
4835
  void 0,
4848
4836
  "RUN_CONFIGURATION_UNAVAILABLE"
4849
4837
  );
4850
4838
  }
4851
4839
  const status = normalizePlayStatus(response);
4852
- if (_optionalChain([options, 'optionalAccess', _252 => _252.failedLogs]) !== true || status.status !== "failed") {
4840
+ if (_optionalChain([options, 'optionalAccess', _253 => _253.failedLogs]) !== true || status.status !== "failed") {
4853
4841
  return status;
4854
4842
  }
4855
4843
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4893,14 +4881,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
4893
4881
  async getRunChildren(parentRunId, options) {
4894
4882
  const launchKey = options.launchKey.trim();
4895
4883
  if (!launchKey) {
4896
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4884
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4897
4885
  "runs.children requires a nonempty launchKey.",
4898
4886
  void 0,
4899
4887
  "INVALID_CHILD_RUN_LAUNCH_KEY"
4900
4888
  );
4901
4889
  }
4902
4890
  if (options.limit !== void 0 && (!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 50)) {
4903
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
4891
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4904
4892
  "runs.children limit must be an integer from 1 to 50.",
4905
4893
  void 0,
4906
4894
  "INVALID_CHILD_RUN_PAGE_LIMIT"
@@ -4938,7 +4926,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4938
4926
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4939
4927
  async getRunsHistory(options = {}) {
4940
4928
  const params = new URLSearchParams();
4941
- const search = _optionalChain([options, 'access', _253 => _253.search, 'optionalAccess', _254 => _254.trim, 'call', _255 => _255()]);
4929
+ const search = _optionalChain([options, 'access', _254 => _254.search, 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
4942
4930
  if (search && search.length > 200) {
4943
4931
  throw new Error("Run search must be at most 200 characters.");
4944
4932
  }
@@ -4964,16 +4952,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4964
4952
  }
4965
4953
  /** Read one run page without discarding server pagination metadata. */
4966
4954
  async listRunsPage(options) {
4967
- const playName = _optionalChain([options, 'access', _256 => _256.play, 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()]);
4955
+ const playName = _optionalChain([options, 'access', _257 => _257.play, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
4968
4956
  const params = new URLSearchParams();
4969
4957
  if (playName) {
4970
4958
  params.set("play", playName);
4971
4959
  }
4972
- const status = _optionalChain([options, 'access', _259 => _259.status, 'optionalAccess', _260 => _260.trim, 'call', _261 => _261()]);
4960
+ const status = _optionalChain([options, 'access', _260 => _260.status, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
4973
4961
  if (status) {
4974
4962
  params.set("status", status);
4975
4963
  }
4976
- const node = _optionalChain([options, 'access', _262 => _262.node, 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]);
4964
+ const node = _optionalChain([options, 'access', _263 => _263.node, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]);
4977
4965
  if (node) {
4978
4966
  if (!playName)
4979
4967
  throw new Error("runs.list options.node requires options.play.");
@@ -5047,9 +5035,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5047
5035
  * A different key starts another rerun.
5048
5036
  */
5049
5037
  async rerun(runId, options) {
5050
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _265 => _265.idempotencyKey, 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()]);
5051
- if (_optionalChain([options, 'optionalAccess', _268 => _268.idempotencyKey]) !== void 0 && !idempotencyKey) {
5052
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
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) {
5040
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5053
5041
  "runs.rerun idempotencyKey must not be empty.",
5054
5042
  void 0,
5055
5043
  "INVALID_IDEMPOTENCY_KEY"
@@ -5057,7 +5045,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5057
5045
  }
5058
5046
  return this.http.post(
5059
5047
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
5060
- _optionalChain([options, 'optionalAccess', _269 => _269.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5048
+ _optionalChain([options, 'optionalAccess', _270 => _270.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5061
5049
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
5062
5050
  );
5063
5051
  }
@@ -5084,21 +5072,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
5084
5072
  * ```
5085
5073
  */
5086
5074
  async getRunLogs(runId, options) {
5087
- if (_optionalChain([options, 'optionalAccess', _270 => _270.all]) === true && options.failed === true) {
5088
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5075
+ if (_optionalChain([options, 'optionalAccess', _271 => _271.all]) === true && options.failed === true) {
5076
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5089
5077
  "runs.logs cannot combine all and failed views.",
5090
5078
  void 0,
5091
5079
  "INVALID_RUN_LOG_VIEW"
5092
5080
  );
5093
5081
  }
5094
- if (_optionalChain([options, 'optionalAccess', _271 => _271.cursor]) !== void 0 && options.failed === true) {
5095
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5082
+ if (_optionalChain([options, 'optionalAccess', _272 => _272.cursor]) !== void 0 && options.failed === true) {
5083
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5096
5084
  "runs.logs cannot combine failed with cursor.",
5097
5085
  void 0,
5098
5086
  "INVALID_RUN_LOG_VIEW"
5099
5087
  );
5100
5088
  }
5101
- if (_optionalChain([options, 'optionalAccess', _272 => _272.failed]) === true) {
5089
+ if (_optionalChain([options, 'optionalAccess', _273 => _273.failed]) === true) {
5102
5090
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
5103
5091
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
5104
5092
  const page = await this.http.get(
@@ -5123,18 +5111,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
5123
5111
  ...page.logsTruncated ? { logsTruncated: true } : {}
5124
5112
  };
5125
5113
  }
5126
- const beforeSequence = _optionalChain([options, 'optionalAccess', _273 => _273.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
5127
- const limit = _optionalChain([options, 'optionalAccess', _274 => _274.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _275 => _275.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
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;
5128
5116
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
5129
5117
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
5130
5118
  { retryApiErrors: true }
5131
5119
  );
5132
5120
  const probe = await fetchPage(0, 1);
5133
5121
  const lastStoredSeq = probe.lastStoredSeq;
5134
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _276 => _276.entries, 'access', _277 => _277[0], 'optionalAccess', _278 => _278.seq]), () => ( null));
5122
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _277 => _277.entries, 'access', _278 => _278[0], 'optionalAccess', _279 => _279.seq]), () => ( null));
5135
5123
  const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
5136
5124
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
5137
- let afterSeq = _optionalChain([options, 'optionalAccess', _279 => _279.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5125
+ let afterSeq = _optionalChain([options, 'optionalAccess', _280 => _280.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5138
5126
  const entries = [];
5139
5127
  while (entries.length < limit && afterSeq < upperSeq) {
5140
5128
  const page = await fetchPage(
@@ -5168,7 +5156,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5168
5156
  hasMore: olderLinesExist,
5169
5157
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
5170
5158
  entries: entries.map((entry) => entry.line),
5171
- view: _optionalChain([options, 'optionalAccess', _280 => _280.all]) ? "all" : "tail",
5159
+ view: _optionalChain([options, 'optionalAccess', _281 => _281.all]) ? "all" : "tail",
5172
5160
  ...probe.logsTruncated ? { logsTruncated: true } : {}
5173
5161
  };
5174
5162
  }
@@ -5242,7 +5230,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5242
5230
  if (selection !== void 0) {
5243
5231
  const runtime = normalizePlayRuntimeSelection(selection);
5244
5232
  if (!runtime) {
5245
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5233
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5246
5234
  "Run event queries require a valid Preview runtime selection.",
5247
5235
  void 0,
5248
5236
  "INVALID_RUNTIME_SELECTION"
@@ -5299,7 +5287,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5299
5287
  if (options.runtime !== void 0) {
5300
5288
  const runtime = normalizePlayRuntimeSelection(options.runtime);
5301
5289
  if (!runtime) {
5302
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5290
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5303
5291
  "runs.searchEvents runtime must be a valid Preview selection.",
5304
5292
  void 0,
5305
5293
  "INVALID_RUNTIME_SELECTION"
@@ -5344,7 +5332,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5344
5332
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
5345
5333
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
5346
5334
  });
5347
- if (_optionalChain([input, 'access', _281 => _281.runId, 'optionalAccess', _282 => _282.trim, 'call', _283 => _283()])) {
5335
+ if (_optionalChain([input, 'access', _282 => _282.runId, 'optionalAccess', _283 => _283.trim, 'call', _284 => _284()])) {
5348
5336
  params.set("runId", input.runId.trim());
5349
5337
  }
5350
5338
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -5357,9 +5345,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5357
5345
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
5358
5346
  { signal: input.signal }
5359
5347
  );
5360
- const requestedRunId = _optionalChain([input, 'access', _284 => _284.runId, 'optionalAccess', _285 => _285.trim, 'call', _286 => _286()]) || "";
5348
+ const requestedRunId = _optionalChain([input, 'access', _285 => _285.runId, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()]) || "";
5361
5349
  if (requestedRunId) {
5362
- const confirmedRunId = _optionalChain([result, 'access', _287 => _287.scope, 'optionalAccess', _288 => _288.kind]) === "run" ? result.scope.runId.trim() : "";
5350
+ const confirmedRunId = _optionalChain([result, 'access', _288 => _288.scope, 'optionalAccess', _289 => _289.kind]) === "run" ? result.scope.runId.trim() : "";
5363
5351
  const foreignRowRunIds = [
5364
5352
  ...new Set(
5365
5353
  result.rows.map(
@@ -5367,8 +5355,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5367
5355
  ).filter((runId) => runId && runId !== requestedRunId)
5368
5356
  )
5369
5357
  ];
5370
- if (_optionalChain([result, 'access', _289 => _289.scope, 'optionalAccess', _290 => _290.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5371
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5358
+ if (_optionalChain([result, 'access', _290 => _290.scope, 'optionalAccess', _291 => _291.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5359
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5372
5360
  `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.`,
5373
5361
  void 0,
5374
5362
  "RUN_EXPORT_SCOPE_MISMATCH",
@@ -5396,7 +5384,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5396
5384
  async stopRun(runId, options) {
5397
5385
  return this.http.post(
5398
5386
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
5399
- _optionalChain([options, 'optionalAccess', _291 => _291.reason]) ? { reason: options.reason } : {}
5387
+ _optionalChain([options, 'optionalAccess', _292 => _292.reason]) ? { reason: options.reason } : {}
5400
5388
  );
5401
5389
  }
5402
5390
  /**
@@ -5414,16 +5402,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
5414
5402
  * The method clears workspace run-slot state without requiring each run ID.
5415
5403
  */
5416
5404
  async stopAllRuns(options) {
5417
- const dryRun = _optionalChain([options, 'optionalAccess', _292 => _292.dryRun]) === true;
5405
+ const dryRun = _optionalChain([options, 'optionalAccess', _293 => _293.dryRun]) === true;
5418
5406
  const result = await this.http.post(
5419
5407
  "/api/v2/runs/stop-all",
5420
5408
  {
5421
- ..._optionalChain([options, 'optionalAccess', _293 => _293.reason]) ? { reason: options.reason } : {},
5409
+ ..._optionalChain([options, 'optionalAccess', _294 => _294.reason]) ? { reason: options.reason } : {},
5422
5410
  ...dryRun ? { dryRun: true } : {}
5423
5411
  }
5424
5412
  );
5425
5413
  if (dryRun && !isStopAllPlayRunsDryRunResult(result)) {
5426
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
5414
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5427
5415
  "This Deepline server does not support runs stop-all --dry-run and performed a real stop-all. Update the server before using --dry-run.",
5428
5416
  void 0,
5429
5417
  "STOP_ALL_DRY_RUN_UNSUPPORTED"
@@ -5439,7 +5427,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5439
5427
  * `origin: "owned"` for org-owned plays.
5440
5428
  */
5441
5429
  async listPlays(options) {
5442
- if (!_optionalChain([options, 'optionalAccess', _294 => _294.grep, 'optionalAccess', _295 => _295.trim, 'call', _296 => _296()])) {
5430
+ if (!_optionalChain([options, 'optionalAccess', _295 => _295.grep, 'optionalAccess', _296 => _296.trim, 'call', _297 => _297()])) {
5443
5431
  return (await this.requestPlaysPage(options, false)).plays;
5444
5432
  }
5445
5433
  const plays = [];
@@ -5461,46 +5449,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
5461
5449
  }
5462
5450
  async requestPlaysPage(options, paginateInventory = true) {
5463
5451
  const params = new URLSearchParams();
5464
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _297 => _297.grep, 'optionalAccess', _298 => _298.trim, 'call', _299 => _299()]))
5452
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _298 => _298.grep, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()]))
5465
5453
  params.set("inventory_paginated", "1");
5466
- if (_optionalChain([options, 'optionalAccess', _300 => _300.origin])) params.set("origin", options.origin);
5467
- if (_optionalChain([options, 'optionalAccess', _301 => _301.summaryOnly])) params.set("summary_only", "1");
5468
- if (_optionalChain([options, 'optionalAccess', _302 => _302.categories])) {
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])) {
5469
5457
  params.set(
5470
5458
  "categories",
5471
5459
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5472
5460
  );
5473
5461
  }
5474
- if (_optionalChain([options, 'optionalAccess', _303 => _303.categories]) || _optionalChain([options, 'optionalAccess', _304 => _304.includeToolCategories])) {
5462
+ if (_optionalChain([options, 'optionalAccess', _304 => _304.categories]) || _optionalChain([options, 'optionalAccess', _305 => _305.includeToolCategories])) {
5475
5463
  params.set("include_tool_categories", "1");
5476
5464
  }
5477
- if (_optionalChain([options, 'optionalAccess', _305 => _305.tags])) {
5465
+ if (_optionalChain([options, 'optionalAccess', _306 => _306.tags])) {
5478
5466
  params.set(
5479
5467
  "tags",
5480
5468
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
5481
5469
  );
5482
5470
  }
5483
- if (_optionalChain([options, 'optionalAccess', _306 => _306.includeArchived])) params.set("include_archived", "1");
5484
- if (_optionalChain([options, 'optionalAccess', _307 => _307.includeCostEstimates])) {
5471
+ if (_optionalChain([options, 'optionalAccess', _307 => _307.includeArchived])) params.set("include_archived", "1");
5472
+ if (_optionalChain([options, 'optionalAccess', _308 => _308.includeCostEstimates])) {
5485
5473
  params.set("include_cost_estimates", "1");
5486
5474
  }
5487
- if (_optionalChain([options, 'optionalAccess', _308 => _308.grep, 'optionalAccess', _309 => _309.trim, 'call', _310 => _310()])) {
5475
+ if (_optionalChain([options, 'optionalAccess', _309 => _309.grep, 'optionalAccess', _310 => _310.trim, 'call', _311 => _311()])) {
5488
5476
  params.set("grep", options.grep.trim());
5489
5477
  params.set("limit", "60");
5490
5478
  }
5491
- if (_optionalChain([options, 'optionalAccess', _311 => _311.limit]) !== void 0) {
5479
+ if (_optionalChain([options, 'optionalAccess', _312 => _312.limit]) !== void 0) {
5492
5480
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
5493
5481
  throw new Error("Play page limit must be a positive integer");
5494
5482
  }
5495
5483
  params.set("limit", String(options.limit));
5496
5484
  }
5497
- if (_optionalChain([options, 'optionalAccess', _312 => _312.cursor])) params.set("cursor", options.cursor);
5485
+ if (_optionalChain([options, 'optionalAccess', _313 => _313.cursor])) params.set("cursor", options.cursor);
5498
5486
  const suffix = params.size ? `?${params.toString()}` : "";
5499
5487
  const response = await this.http.get(`/api/v2/plays${suffix}`);
5500
5488
  return {
5501
5489
  plays: _nullishCoalesce(response.plays, () => ( [])),
5502
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _313 => _313.pagination, 'optionalAccess', _314 => _314.cursor]), () => ( response.cursor)), () => ( null)),
5503
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _315 => _315.pagination, 'optionalAccess', _316 => _316.hasMore]), () => ( response.hasMore)))
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)))
5504
5492
  };
5505
5493
  }
5506
5494
  /** Read definition-level settings, independently of code revisions. */
@@ -5509,6 +5497,22 @@ var DeeplineClient = (_class = class _DeeplineClient {
5509
5497
  `/api/v2/plays/${encodeURIComponent(playName)}/settings`
5510
5498
  );
5511
5499
  }
5500
+ /** Register an editing attempt so the author's open working canvas can show a rejected save. */
5501
+ async beginWorkingPlaySave(playName) {
5502
+ return this.http.post(
5503
+ `/api/v2/plays/${encodeURIComponent(playName)}/pipeline`,
5504
+ { action: "begin" },
5505
+ void 0,
5506
+ { maxRetries: 0, exactUrlOnly: true }
5507
+ );
5508
+ }
5509
+ /** Report a save outcome for that specific editing attempt. */
5510
+ async finishWorkingPlaySave(playName, attemptId, action) {
5511
+ return this.http.post(
5512
+ `/api/v2/plays/${encodeURIComponent(playName)}/pipeline`,
5513
+ { action, attemptId }
5514
+ );
5515
+ }
5512
5516
  /** Retry-safe field patch; omitted fields retain their current value. */
5513
5517
  async updatePlaySettings(playName, patch) {
5514
5518
  return this.http.patch(
@@ -5554,6 +5558,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
5554
5558
  async listWorkspaceIntegrationConnections() {
5555
5559
  return this.http.get("/api/v2/integrations/connections");
5556
5560
  }
5561
+ /** List workspace members' personal HubSpot connection status as an admin. */
5562
+ async listPersonalHubSpotMembers(cursor) {
5563
+ const path = "/api/v2/integrations/connections/hubspot-members";
5564
+ return this.http.get(
5565
+ cursor ? `${path}?${new URLSearchParams({ cursor })}` : path
5566
+ );
5567
+ }
5557
5568
  /** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
5558
5569
  async manageWorkspaceIntegrationConnection(input) {
5559
5570
  return this.http.post("/api/v2/integrations/connections", {
@@ -5571,7 +5582,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5571
5582
  return this.http.post("/api/v2/integrations/connect", {
5572
5583
  provider,
5573
5584
  credentials,
5574
- ..._optionalChain([options, 'optionalAccess', _317 => _317.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5585
+ ..._optionalChain([options, 'optionalAccess', _318 => _318.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5575
5586
  });
5576
5587
  }
5577
5588
  /** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
@@ -5584,7 +5595,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5584
5595
  }
5585
5596
  /** Start provider OAuth and return the URL to open in a browser. */
5586
5597
  async startIntegrationOAuth(provider, options = {}) {
5587
- const scopes = _optionalChain([options, 'access', _318 => _318.scopes, 'optionalAccess', _319 => _319.map, 'call', _320 => _320((scope) => scope.trim()), 'access', _321 => _321.filter, 'call', _322 => _322(Boolean)]);
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)]);
5588
5599
  if (scopes !== void 0 && scopes.length === 0) {
5589
5600
  throw new Error("scopes must contain at least one OAuth scope.");
5590
5601
  }
@@ -5600,8 +5611,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5600
5611
  return this.http.post("/api/v2/integrations/connect", {
5601
5612
  provider: "slack",
5602
5613
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5603
- ..._optionalChain([options, 'optionalAccess', _323 => _323.successUrl]) ? { success_url: options.successUrl } : {},
5604
- ..._optionalChain([options, 'optionalAccess', _324 => _324.failureUrl]) ? { failure_url: options.failureUrl } : {}
5614
+ ..._optionalChain([options, 'optionalAccess', _324 => _324.successUrl]) ? { success_url: options.successUrl } : {},
5615
+ ..._optionalChain([options, 'optionalAccess', _325 => _325.failureUrl]) ? { failure_url: options.failureUrl } : {}
5605
5616
  });
5606
5617
  }
5607
5618
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5676,7 +5687,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5676
5687
  }
5677
5688
  const targets = input.targets.map(parseNotificationGroupTarget);
5678
5689
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5679
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _325 => _325[0], 'optionalAccess', _326 => _326.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5690
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _326 => _326[0], 'optionalAccess', _327 => _327.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5680
5691
  if (legacyEvents.length > 0 && !legacyTarget) {
5681
5692
  throw new Error(
5682
5693
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5712,7 +5723,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5712
5723
  const existingGroup = current.configuration.groups.find(
5713
5724
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5714
5725
  );
5715
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _327 => _327.groupKey]), () => ( notificationObjectKey("group")));
5726
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _328 => _328.groupKey]), () => ( notificationObjectKey("group")));
5716
5727
  const group = _nullishCoalesce(existingGroup, () => ( {
5717
5728
  groupKey,
5718
5729
  name,
@@ -5940,7 +5951,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5940
5951
  /** Read one trigger inventory page without loading run histories. */
5941
5952
  async listPlayTriggerInventory(options) {
5942
5953
  const params = new URLSearchParams({ view: "inventory" });
5943
- if (_optionalChain([options, 'optionalAccess', _328 => _328.cursor])) params.set("cursor", options.cursor);
5954
+ if (_optionalChain([options, 'optionalAccess', _329 => _329.cursor])) params.set("cursor", options.cursor);
5944
5955
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5945
5956
  }
5946
5957
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5949,7 +5960,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5949
5960
  view: "history",
5950
5961
  binding_id: bindingId
5951
5962
  });
5952
- if (_optionalChain([options, 'optionalAccess', _329 => _329.limit]) !== void 0)
5963
+ if (_optionalChain([options, 'optionalAccess', _330 => _330.limit]) !== void 0)
5953
5964
  params.set("history_limit", String(options.limit));
5954
5965
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5955
5966
  }
@@ -6137,14 +6148,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6137
6148
  */
6138
6149
  async runPlay(code, csvPath, name, options) {
6139
6150
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
6140
- input: _optionalChain([options, 'optionalAccess', _330 => _330.input]),
6141
- sourceCode: _optionalChain([options, 'optionalAccess', _331 => _331.sourceCode]),
6142
- artifact: _optionalChain([options, 'optionalAccess', _332 => _332.artifact]),
6143
- compilerManifest: _optionalChain([options, 'optionalAccess', _333 => _333.compilerManifest]),
6144
- inputFile: _optionalChain([options, 'optionalAccess', _334 => _334.inputFile]),
6145
- packagedFiles: _optionalChain([options, 'optionalAccess', _335 => _335.packagedFiles]),
6146
- force: _optionalChain([options, 'optionalAccess', _336 => _336.force]),
6147
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _337 => _337.forceToolRefresh])
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])
6148
6159
  });
6149
6160
  const start = Date.now();
6150
6161
  const state = {
@@ -6155,7 +6166,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6155
6166
  latest: null
6156
6167
  };
6157
6168
  let terminalObserved = null;
6158
- if (_optionalChain([options, 'optionalAccess', _338 => _338.signal, 'optionalAccess', _339 => _339.aborted])) {
6169
+ if (_optionalChain([options, 'optionalAccess', _339 => _339.signal, 'optionalAccess', _340 => _340.aborted])) {
6159
6170
  await this.cancelPlay(workflowId);
6160
6171
  return {
6161
6172
  success: false,
@@ -6166,9 +6177,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
6166
6177
  };
6167
6178
  }
6168
6179
  for await (const event of this.watchRunEvents(workflowId, {
6169
- signal: _optionalChain([options, 'optionalAccess', _340 => _340.signal])
6180
+ signal: _optionalChain([options, 'optionalAccess', _341 => _341.signal])
6170
6181
  })) {
6171
- if (_optionalChain([options, 'optionalAccess', _341 => _341.signal, 'optionalAccess', _342 => _342.aborted])) {
6182
+ if (_optionalChain([options, 'optionalAccess', _342 => _342.signal, 'optionalAccess', _343 => _343.aborted])) {
6172
6183
  await this.cancelPlay(workflowId);
6173
6184
  return {
6174
6185
  success: false,
@@ -6178,19 +6189,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
6178
6189
  error: "Cancelled by user"
6179
6190
  };
6180
6191
  }
6181
- const previousStatus = _optionalChain([state, 'access', _343 => _343.latest, 'optionalAccess', _344 => _344.status]);
6192
+ const previousStatus = _optionalChain([state, 'access', _344 => _344.latest, 'optionalAccess', _345 => _345.status]);
6182
6193
  const status = updatePlayLiveStatusState(state, event);
6183
6194
  if (!status) {
6184
6195
  continue;
6185
6196
  }
6186
6197
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
6187
- _optionalChain([options, 'optionalAccess', _345 => _345.onProgress, 'optionalCall', _346 => _346(status)]);
6198
+ _optionalChain([options, 'optionalAccess', _346 => _346.onProgress, 'optionalCall', _347 => _347(status)]);
6188
6199
  }
6189
- if (_chunk2KHUFWTKjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
6200
+ if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
6190
6201
  terminalObserved = status;
6191
6202
  }
6192
6203
  }
6193
- if (_optionalChain([options, 'optionalAccess', _347 => _347.signal, 'optionalAccess', _348 => _348.aborted])) {
6204
+ if (_optionalChain([options, 'optionalAccess', _348 => _348.signal, 'optionalAccess', _349 => _349.aborted])) {
6194
6205
  await this.cancelPlay(workflowId);
6195
6206
  return {
6196
6207
  success: false,
@@ -6206,7 +6217,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6206
6217
  ).catch(() => terminalObserved);
6207
6218
  return playRunResultFromStatus(finalStatus, start, workflowId);
6208
6219
  }
6209
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6220
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6210
6221
  `Run watch for ${workflowId} ended before the run reached a terminal state.`,
6211
6222
  void 0,
6212
6223
  "PLAY_RUN_STREAM_ENDED",
@@ -6234,7 +6245,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6234
6245
  async getBillingUsageEvent(requestId) {
6235
6246
  const normalizedRequestId = requestId.trim();
6236
6247
  if (normalizedRequestId.length === 0 || normalizedRequestId.length > 200 || normalizedRequestId !== requestId) {
6237
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6248
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6238
6249
  "Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
6239
6250
  void 0,
6240
6251
  "INVALID_USAGE_REQUEST_ID"
@@ -6243,9 +6254,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
6243
6254
  const response = await this.http.get(
6244
6255
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
6245
6256
  );
6246
- const event = _optionalChain([response, 'access', _349 => _349.entries, 'optionalAccess', _350 => _350[0]]);
6257
+ const event = _optionalChain([response, 'access', _350 => _350.entries, 'optionalAccess', _351 => _351[0]]);
6247
6258
  if (!event) {
6248
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6259
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6249
6260
  "No usage event was found for this request_id.",
6250
6261
  void 0,
6251
6262
  "USAGE_EVENT_NOT_FOUND"
@@ -6259,7 +6270,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6259
6270
  */
6260
6271
  async getBillingUsageEvents(options = {}) {
6261
6272
  const invalid = (message) => {
6262
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6273
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6263
6274
  message,
6264
6275
  void 0,
6265
6276
  "INVALID_USAGE_EVENTS_OPTIONS"
@@ -6317,14 +6328,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6317
6328
  if (options.requestId !== void 0) {
6318
6329
  const requestId = options.requestId.trim();
6319
6330
  if (requestId.length === 0 || requestId.length > 200 || requestId !== options.requestId) {
6320
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6331
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6321
6332
  "Usage request_id must contain 1\u2013200 characters with no leading or trailing whitespace.",
6322
6333
  void 0,
6323
6334
  "INVALID_USAGE_REQUEST_ID"
6324
6335
  );
6325
6336
  }
6326
6337
  if (options.runId !== void 0 || options.cursor !== void 0 || options.offset !== void 0) {
6327
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6338
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6328
6339
  "requestId cannot be combined with runId, cursor, or offset.",
6329
6340
  void 0,
6330
6341
  "INVALID_USAGE_FILTERS"
@@ -6418,7 +6429,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6418
6429
  async cancelBillingSubscription(options) {
6419
6430
  return this.http.post(
6420
6431
  "/api/v2/billing/subscription/cancel",
6421
- { action: _optionalChain([options, 'optionalAccess', _351 => _351.undo]) ? "undo_cancel" : "cancel" }
6432
+ { action: _optionalChain([options, 'optionalAccess', _352 => _352.undo]) ? "undo_cancel" : "cancel" }
6422
6433
  );
6423
6434
  }
6424
6435
  /**
@@ -6430,7 +6441,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6430
6441
  */
6431
6442
  async listBillingInvoices(options) {
6432
6443
  const params = new URLSearchParams();
6433
- if (_optionalChain([options, 'optionalAccess', _352 => _352.limit]) !== void 0) {
6444
+ if (_optionalChain([options, 'optionalAccess', _353 => _353.limit]) !== void 0) {
6434
6445
  params.set("limit", String(options.limit));
6435
6446
  }
6436
6447
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -6439,8 +6450,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6439
6450
  );
6440
6451
  }
6441
6452
  /** List the reviewed target plans and whether new acquisition is enabled. */
6442
- async getTargetBillingPlans() {
6443
- return this.http.get("/api/v2/billing/plans");
6453
+ async getTargetBillingPlans(options) {
6454
+ return this.http.get(
6455
+ _optionalChain([options, 'optionalAccess', _354 => _354.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
6456
+ );
6444
6457
  }
6445
6458
  /** Read the workspace's normalized target plan, payment, and balance state. */
6446
6459
  async getTargetBillingStatus() {
@@ -6488,7 +6501,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6488
6501
  /** Recover only the original workspace, credit amount, and purchase key; never charge. */
6489
6502
  async recoverTargetBillingCreditPurchase(options) {
6490
6503
  if (typeof options.idempotencyKey !== "string") {
6491
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6504
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6492
6505
  "The original billing idempotencyKey is required.",
6493
6506
  void 0,
6494
6507
  "INVALID_BILLING_IDEMPOTENCY_KEY"
@@ -6498,14 +6511,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6498
6511
  options.idempotencyKey
6499
6512
  );
6500
6513
  if (!Number.isSafeInteger(options.credits) || options.credits <= 0) {
6501
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6514
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6502
6515
  "credits must be a positive safe integer.",
6503
6516
  void 0,
6504
6517
  "INVALID_CREDITS"
6505
6518
  );
6506
6519
  }
6507
6520
  if (typeof options.orgId !== "string" || !options.orgId.trim() || options.orgId !== options.orgId.trim()) {
6508
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6521
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6509
6522
  "The original orgId is required without surrounding whitespace.",
6510
6523
  void 0,
6511
6524
  "INVALID_ORG_ID"
@@ -6531,7 +6544,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6531
6544
  {
6532
6545
  action: options.action,
6533
6546
  ...options.action === "start_or_change" && options.billingEmail ? { billing_email: options.billingEmail } : {},
6534
- ...options.targetPlanSku ? { target_plan_sku: options.targetPlanSku } : {}
6547
+ ...options.targetPlanSku ? { target_plan_sku: options.targetPlanSku } : {},
6548
+ ...options.action === "start_or_change" && options.promoCode ? { promo_code: options.promoCode } : {}
6535
6549
  },
6536
6550
  { "Idempotency-Key": idempotencyKey },
6537
6551
  { maxRetries: 0, exactUrlOnly: true }
@@ -6540,7 +6554,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6540
6554
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6541
6555
  async createTargetBillingPortalSession(options) {
6542
6556
  const response = await this.http.post(
6543
- _optionalChain([options, 'optionalAccess', _353 => _353.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6557
+ _optionalChain([options, 'optionalAccess', _355 => _355.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6544
6558
  {}
6545
6559
  );
6546
6560
  return response.data;
@@ -6590,8 +6604,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6590
6604
  return this.http.request("/api/v2/monitors/audit", {
6591
6605
  method: "POST",
6592
6606
  body: {
6593
- ..._optionalChain([options, 'optionalAccess', _354 => _354.fleetId]) ? { fleet_id: options.fleetId } : {},
6594
- ..._optionalChain([options, 'optionalAccess', _355 => _355.cursor]) ? { cursor: options.cursor } : {}
6607
+ ..._optionalChain([options, 'optionalAccess', _356 => _356.fleetId]) ? { fleet_id: options.fleetId } : {},
6608
+ ..._optionalChain([options, 'optionalAccess', _357 => _357.cursor]) ? { cursor: options.cursor } : {}
6595
6609
  },
6596
6610
  maxRetries: 0
6597
6611
  });
@@ -6601,8 +6615,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6601
6615
  return this.http.request("/api/v2/monitors/repair", {
6602
6616
  method: "POST",
6603
6617
  body: {
6604
- ..._optionalChain([options, 'optionalAccess', _356 => _356.fleetId]) ? { fleet_id: options.fleetId } : {},
6605
- ..._optionalChain([options, 'optionalAccess', _357 => _357.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6618
+ ..._optionalChain([options, 'optionalAccess', _358 => _358.fleetId]) ? { fleet_id: options.fleetId } : {},
6619
+ ..._optionalChain([options, 'optionalAccess', _359 => _359.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6606
6620
  },
6607
6621
  maxRetries: 0
6608
6622
  });
@@ -6610,7 +6624,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6610
6624
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6611
6625
  async readMonitorsHealth(options) {
6612
6626
  const params = new URLSearchParams();
6613
- if (_optionalChain([options, 'optionalAccess', _358 => _358.fleetId])) params.set("fleet_id", options.fleetId);
6627
+ if (_optionalChain([options, 'optionalAccess', _360 => _360.fleetId])) params.set("fleet_id", options.fleetId);
6614
6628
  const query = params.toString();
6615
6629
  const suffix = query ? `?${query}` : "";
6616
6630
  return this.http.request(
@@ -6622,7 +6636,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6622
6636
  async submitMonitorBatch(options) {
6623
6637
  const idempotencyKey = options.idempotencyKey.trim();
6624
6638
  if (!idempotencyKey) {
6625
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6639
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6626
6640
  "Monitor batch idempotencyKey is required.",
6627
6641
  void 0,
6628
6642
  "INVALID_MONITOR_BATCH_IDEMPOTENCY_KEY"
@@ -6630,7 +6644,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6630
6644
  }
6631
6645
  if (options.kind === "deploy") {
6632
6646
  if (!options.manifestNdjson.trim()) {
6633
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6647
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6634
6648
  "Monitor batch deploy requires a non-empty NDJSON manifest.",
6635
6649
  void 0,
6636
6650
  "INVALID_MONITOR_BATCH_MANIFEST"
@@ -6676,14 +6690,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6676
6690
  async getMonitorBatch(operationId, options) {
6677
6691
  const runId = operationId.trim();
6678
6692
  if (!runId) {
6679
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6693
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6680
6694
  "Monitor batch operation id is required.",
6681
6695
  void 0,
6682
6696
  "INVALID_MONITOR_BATCH_OPERATION_ID"
6683
6697
  );
6684
6698
  }
6685
6699
  const params = new URLSearchParams();
6686
- if (_optionalChain([options, 'optionalAccess', _359 => _359.cursor])) params.set("cursor", options.cursor);
6700
+ if (_optionalChain([options, 'optionalAccess', _361 => _361.cursor])) params.set("cursor", options.cursor);
6687
6701
  const suffix = params.size > 0 ? `?${params}` : "";
6688
6702
  return this.http.request(
6689
6703
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6730,7 +6744,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6730
6744
  * a second charge. The submission is never replayed automatically.
6731
6745
  */
6732
6746
  async previewMonitor(definition, options) {
6733
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _360 => _360.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _361 => _361.crypto, 'optionalAccess', _362 => _362.randomUUID, 'optionalCall', _363 => _363()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
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)}`))}`));
6734
6748
  try {
6735
6749
  const result = await this.http.request(
6736
6750
  "/api/v2/monitors/preview",
@@ -6738,7 +6752,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6738
6752
  method: "POST",
6739
6753
  body: {
6740
6754
  ...definition,
6741
- ..._optionalChain([options, 'optionalAccess', _364 => _364.limit]) === void 0 ? {} : { limit: options.limit }
6755
+ ..._optionalChain([options, 'optionalAccess', _366 => _366.limit]) === void 0 ? {} : { limit: options.limit }
6742
6756
  },
6743
6757
  headers: { "Idempotency-Key": idempotencyKey },
6744
6758
  maxRetries: 0,
@@ -6760,7 +6774,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6760
6774
  * `client.monitors.deploy(...)`.
6761
6775
  */
6762
6776
  async deployMonitor(definition, options) {
6763
- if (_optionalChain([options, 'optionalAccess', _365 => _365.dryRun])) {
6777
+ if (_optionalChain([options, 'optionalAccess', _367 => _367.dryRun])) {
6764
6778
  return this.http.request("/api/v2/monitors/check", {
6765
6779
  method: "POST",
6766
6780
  body: definition
@@ -6796,12 +6810,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6796
6810
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6797
6811
  async listMonitors(options) {
6798
6812
  const params = new URLSearchParams();
6799
- if (_optionalChain([options, 'optionalAccess', _366 => _366.state])) params.set("state", options.state);
6800
- else if (_optionalChain([options, 'optionalAccess', _367 => _367.status])) params.set("status", options.status);
6801
- if (_optionalChain([options, 'optionalAccess', _368 => _368.limit]) !== void 0)
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)
6802
6816
  params.set("limit", String(options.limit));
6803
- if (_optionalChain([options, 'optionalAccess', _369 => _369.cursor])) params.set("cursor", options.cursor);
6804
- if (_optionalChain([options, 'optionalAccess', _370 => _370.includeConsumers])) params.set("include_consumers", "true");
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");
6805
6819
  const query = params.toString();
6806
6820
  const suffix = query ? `?${query}` : "";
6807
6821
  return this.http.request(
@@ -6812,17 +6826,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
6812
6826
  /** The Monitors list. Prefer `client.monitors.ledger(...)`. */
6813
6827
  async listMonitorLedger(options) {
6814
6828
  const params = new URLSearchParams();
6815
- if (_optionalChain([options, 'optionalAccess', _371 => _371.search])) params.set("q", options.search);
6816
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _372 => _372.states]), () => ( []))) params.append("state", state);
6817
- for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _373 => _373.signals]), () => ( [])))
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]), () => ( [])))
6818
6832
  params.append("signal", signal);
6819
- if (_optionalChain([options, 'optionalAccess', _374 => _374.play])) params.set("play", options.play);
6820
- if (_optionalChain([options, 'optionalAccess', _375 => _375.fleet])) params.set("fleet", options.fleet);
6821
- if (_optionalChain([options, 'optionalAccess', _376 => _376.sort])) params.set("sort", options.sort);
6822
- if (_optionalChain([options, 'optionalAccess', _377 => _377.window])) params.set("window", options.window);
6823
- if (_optionalChain([options, 'optionalAccess', _378 => _378.limit]) !== void 0)
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)
6824
6838
  params.set("limit", String(options.limit));
6825
- if (_optionalChain([options, 'optionalAccess', _379 => _379.cursor])) params.set("cursor", options.cursor);
6839
+ if (_optionalChain([options, 'optionalAccess', _381 => _381.cursor])) params.set("cursor", options.cursor);
6826
6840
  const query = params.toString();
6827
6841
  const suffix = query ? `?${query}` : "";
6828
6842
  return this.http.request(
@@ -6839,7 +6853,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6839
6853
  }
6840
6854
  /** A monitor's recent findings. Prefer `client.monitors.ledgerFindings(...)`. */
6841
6855
  async listMonitorLedgerFindings(key, options) {
6842
- const suffix = _optionalChain([options, 'optionalAccess', _380 => _380.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
6856
+ const suffix = _optionalChain([options, 'optionalAccess', _382 => _382.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
6843
6857
  return this.http.request(
6844
6858
  `/api/v2/monitors/ledger/${encodeURIComponent(key)}/findings${suffix}`,
6845
6859
  { method: "GET" }
@@ -6853,8 +6867,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6853
6867
  );
6854
6868
  }
6855
6869
  async testMonitorWebhook(key, payload, options) {
6856
- if (_optionalChain([options, 'optionalAccess', _381 => _381.dispatch]) === true || _optionalChain([options, 'optionalAccess', _382 => _382.validationOnly]) === false) {
6857
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6870
+ if (_optionalChain([options, 'optionalAccess', _383 => _383.dispatch]) === true || _optionalChain([options, 'optionalAccess', _384 => _384.validationOnly]) === false) {
6871
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6858
6872
  "Monitor tests are validation-only and cannot dispatch events.",
6859
6873
  void 0,
6860
6874
  "MONITOR_TEST_DISPATCH_NOT_SUPPORTED"
@@ -6908,19 +6922,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
6908
6922
  }
6909
6923
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6910
6924
  async deleteMonitor(key, options) {
6911
- if (_optionalChain([options, 'optionalAccess', _383 => _383.localOnly]) === true) {
6912
- throw new (0, _chunkSQWET4SLjs.DeeplineError)(
6925
+ if (_optionalChain([options, 'optionalAccess', _385 => _385.localOnly]) === true) {
6926
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6913
6927
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6914
6928
  void 0,
6915
6929
  "MONITOR_LOCAL_ONLY_DELETE_NOT_SUPPORTED"
6916
6930
  );
6917
6931
  }
6918
6932
  const params = new URLSearchParams();
6919
- if (_optionalChain([options, 'optionalAccess', _384 => _384.dryRun])) params.set("dry_run", "true");
6933
+ if (_optionalChain([options, 'optionalAccess', _386 => _386.dryRun])) params.set("dry_run", "true");
6920
6934
  const query = params.toString();
6921
6935
  return this.http.request(
6922
6936
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6923
- _optionalChain([options, 'optionalAccess', _385 => _385.dryRun]) ? { method: "DELETE" } : {
6937
+ _optionalChain([options, 'optionalAccess', _387 => _387.dryRun]) ? { method: "DELETE" } : {
6924
6938
  method: "DELETE",
6925
6939
  // Deletion is a provider lifecycle operation. A timeout is an
6926
6940
  // unknown outcome, not authority to begin another delete attempt.
@@ -6933,10 +6947,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6933
6947
  * Prefer `client.monitors.reactivate(...)`.
6934
6948
  */
6935
6949
  async reactivateMonitor(key, options) {
6936
- const query = _optionalChain([options, 'optionalAccess', _386 => _386.dryRun]) ? "?dry_run=true" : "";
6950
+ const query = _optionalChain([options, 'optionalAccess', _388 => _388.dryRun]) ? "?dry_run=true" : "";
6937
6951
  return this.http.request(
6938
6952
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6939
- _optionalChain([options, 'optionalAccess', _387 => _387.dryRun]) ? { method: "POST", body: {} } : {
6953
+ _optionalChain([options, 'optionalAccess', _389 => _389.dryRun]) ? { method: "POST", body: {} } : {
6940
6954
  method: "POST",
6941
6955
  body: {},
6942
6956
  // Reactivation can create an upstream resource, so it must not use
@@ -6950,7 +6964,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6950
6964
  // ——————————————————————————————————————————————————————————
6951
6965
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6952
6966
  monitorJobIdempotencyKey(operation) {
6953
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _388 => _388.crypto, 'optionalAccess', _389 => _389.randomUUID, 'optionalCall', _390 => _390()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
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)}`));
6954
6968
  const prefix = "monitor-job-";
6955
6969
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6956
6970
  const maxOperationLength = Math.max(
@@ -6961,7 +6975,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6961
6975
  }
6962
6976
  monitorJobHeaders(operation, idempotencyKey) {
6963
6977
  return {
6964
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _391 => _391.trim, 'call', _392 => _392()]) || this.monitorJobIdempotencyKey(operation)
6978
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) || this.monitorJobIdempotencyKey(operation)
6965
6979
  };
6966
6980
  }
6967
6981
  async deployMonitorBatch(definitions, options) {
@@ -6972,7 +6986,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6972
6986
  body: { version: 1, kind: "batch", monitors: definitions },
6973
6987
  headers: this.monitorJobHeaders(
6974
6988
  "batch-deploy",
6975
- _optionalChain([options, 'optionalAccess', _393 => _393.idempotencyKey])
6989
+ _optionalChain([options, 'optionalAccess', _395 => _395.idempotencyKey])
6976
6990
  ),
6977
6991
  maxRetries: 0,
6978
6992
  exactUrlOnly: true
@@ -6991,11 +7005,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6991
7005
  version: 1,
6992
7006
  kind: "batch",
6993
7007
  monitors: definitions,
6994
- ..._optionalChain([options, 'optionalAccess', _394 => _394.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
7008
+ ..._optionalChain([options, 'optionalAccess', _396 => _396.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
6995
7009
  },
6996
7010
  headers: this.monitorJobHeaders(
6997
7011
  `batch-sync-${batchId}`,
6998
- _optionalChain([options, 'optionalAccess', _395 => _395.idempotencyKey])
7012
+ _optionalChain([options, 'optionalAccess', _397 => _397.idempotencyKey])
6999
7013
  ),
7000
7014
  maxRetries: 0,
7001
7015
  exactUrlOnly: true
@@ -7010,7 +7024,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7010
7024
  body: {},
7011
7025
  headers: this.monitorJobHeaders(
7012
7026
  `batch-start-${batchId}`,
7013
- _optionalChain([options, 'optionalAccess', _396 => _396.idempotencyKey])
7027
+ _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
7014
7028
  ),
7015
7029
  maxRetries: 0,
7016
7030
  exactUrlOnly: true
@@ -7025,7 +7039,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7025
7039
  body: {},
7026
7040
  headers: this.monitorJobHeaders(
7027
7041
  `batch-stop-${batchId}`,
7028
- _optionalChain([options, 'optionalAccess', _397 => _397.idempotencyKey])
7042
+ _optionalChain([options, 'optionalAccess', _399 => _399.idempotencyKey])
7029
7043
  ),
7030
7044
  maxRetries: 0,
7031
7045
  exactUrlOnly: true
@@ -7046,7 +7060,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7046
7060
  body: {},
7047
7061
  headers: this.monitorJobHeaders(
7048
7062
  `${action}-${monitorKey}`,
7049
- _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
7063
+ _optionalChain([options, 'optionalAccess', _400 => _400.idempotencyKey])
7050
7064
  ),
7051
7065
  maxRetries: 0,
7052
7066
  exactUrlOnly: true
@@ -7059,7 +7073,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7059
7073
  body: definition,
7060
7074
  headers: this.monitorJobHeaders(
7061
7075
  `sync-${definition.key}`,
7062
- _optionalChain([options, 'optionalAccess', _399 => _399.idempotencyKey])
7076
+ _optionalChain([options, 'optionalAccess', _401 => _401.idempotencyKey])
7063
7077
  ),
7064
7078
  maxRetries: 0,
7065
7079
  exactUrlOnly: true
@@ -7072,7 +7086,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7072
7086
  );
7073
7087
  }
7074
7088
  async getMonitorJobLogs(jobId, options) {
7075
- const query = _optionalChain([options, 'optionalAccess', _400 => _400.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7089
+ const query = _optionalChain([options, 'optionalAccess', _402 => _402.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7076
7090
  return this.http.request(
7077
7091
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
7078
7092
  { method: "GET" }
@@ -7085,15 +7099,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
7085
7099
  );
7086
7100
  }
7087
7101
  async waitForMonitorJob(jobId, options) {
7088
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _401 => _401.timeoutMs]), () => ( 10 * 6e4)));
7089
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _402 => _402.pollIntervalMs]), () => ( 2e3)));
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)));
7090
7104
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
7091
7105
  const startedAt = Date.now();
7092
7106
  let latest = await this.getMonitorJob(jobId);
7093
7107
  while (true) {
7094
- _optionalChain([options, 'optionalAccess', _403 => _403.onProgress, 'optionalCall', _404 => _404(latest)]);
7108
+ _optionalChain([options, 'optionalAccess', _405 => _405.onProgress, 'optionalCall', _406 => _406(latest)]);
7095
7109
  const job = latest.job;
7096
- const state = typeof _optionalChain([job, 'optionalAccess', _405 => _405.state]) === "string" ? job.state : void 0;
7110
+ const state = typeof _optionalChain([job, 'optionalAccess', _407 => _407.state]) === "string" ? job.state : void 0;
7097
7111
  if (state && terminal.has(state)) return latest;
7098
7112
  if (Date.now() - startedAt >= timeoutMs) return latest;
7099
7113
  await sleep(pollIntervalMs);
@@ -7104,14 +7118,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
7104
7118
  // Monitor Fleets
7105
7119
  // ——————————————————————————————————————————————————————————
7106
7120
  monitorFleetIdempotencyKey(operation) {
7107
- const uuid = _optionalChain([globalThis, 'access', _406 => _406.crypto, 'optionalAccess', _407 => _407.randomUUID, 'optionalCall', _408 => _408()]);
7121
+ const uuid = _optionalChain([globalThis, 'access', _408 => _408.crypto, 'optionalAccess', _409 => _409.randomUUID, 'optionalCall', _410 => _410()]);
7108
7122
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
7109
7123
  }
7110
7124
  monitorFleetHeaders(operation, idempotencyKey) {
7111
7125
  return {
7112
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _409 => _409.trim, 'call', _410 => _410()]) || this.monitorFleetIdempotencyKey(operation)
7126
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _411 => _411.trim, 'call', _412 => _412()]) || this.monitorFleetIdempotencyKey(operation)
7113
7127
  };
7114
7128
  }
7129
+ /**
7130
+ * Fleet writes plan against the whole fleet inside one request, so they
7131
+ * wait as long as the server lets those routes run (300 s) plus transit,
7132
+ * not the client's default. A ten-thousand-member deploy took 62 s; giving
7133
+ * up at 60 s reported a timeout for a plan the server then committed.
7134
+ */
7135
+ static __initStatic2() {this.MONITOR_FLEET_WRITE_TIMEOUT_MS = 31e4}
7115
7136
  monitorFleetPath(fleetId) {
7116
7137
  return `/api/v2/monitors/fleets/${encodeURIComponent(fleetId)}`;
7117
7138
  }
@@ -7129,15 +7150,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
7129
7150
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
7130
7151
  const body = {
7131
7152
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
7132
- ..._optionalChain([options, 'optionalAccess', _411 => _411.dryRun]) ? { dry_run: true } : {},
7133
- ..._optionalChain([options, 'optionalAccess', _412 => _412.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7153
+ ..._optionalChain([options, 'optionalAccess', _413 => _413.dryRun]) ? { dry_run: true } : {},
7154
+ ..._optionalChain([options, 'optionalAccess', _414 => _414.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7134
7155
  };
7135
7156
  return this.http.request(
7136
7157
  this.monitorFleetPath(fleetId),
7137
7158
  {
7138
7159
  method: "PUT",
7139
7160
  body,
7140
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _413 => _413.idempotencyKey])),
7161
+ timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7162
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _415 => _415.idempotencyKey])),
7141
7163
  maxRetries: 0,
7142
7164
  exactUrlOnly: true
7143
7165
  }
@@ -7151,10 +7173,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7151
7173
  /** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
7152
7174
  async listMonitorFleetOverviews(options) {
7153
7175
  const params = new URLSearchParams({ view: "overview" });
7154
- if (_optionalChain([options, 'optionalAccess', _414 => _414.q])) params.set("q", options.q);
7155
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _415 => _415.states]), () => ( []))) params.append("state", state);
7156
- if (_optionalChain([options, 'optionalAccess', _416 => _416.sort])) params.set("sort", options.sort);
7157
- if (_optionalChain([options, 'optionalAccess', _417 => _417.window])) params.set("window", options.window);
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);
7158
7180
  return this.http.request(
7159
7181
  `/api/v2/monitors/fleets?${params.toString()}`,
7160
7182
  { method: "GET" }
@@ -7163,7 +7185,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7163
7185
  /** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
7164
7186
  async getMonitorFleetOverview(fleetId, options) {
7165
7187
  const params = new URLSearchParams({ view: "overview" });
7166
- if (_optionalChain([options, 'optionalAccess', _418 => _418.window])) params.set("window", options.window);
7188
+ if (_optionalChain([options, 'optionalAccess', _420 => _420.window])) params.set("window", options.window);
7167
7189
  return this.http.request(
7168
7190
  `${this.monitorFleetPath(fleetId)}?${params.toString()}`,
7169
7191
  { method: "GET" }
@@ -7172,10 +7194,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7172
7194
  /** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
7173
7195
  async listMonitorFleetIssues(fleetId, options) {
7174
7196
  const params = new URLSearchParams();
7175
- if (_optionalChain([options, 'optionalAccess', _419 => _419.group])) params.set("group", options.group);
7176
- if (_optionalChain([options, 'optionalAccess', _420 => _420.cause])) params.set("cause", options.cause);
7177
- if (_optionalChain([options, 'optionalAccess', _421 => _421.cursor])) params.set("cursor", options.cursor);
7178
- if (_optionalChain([options, 'optionalAccess', _422 => _422.limit]) !== void 0)
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)
7179
7201
  params.set("limit", String(options.limit));
7180
7202
  const query = params.toString();
7181
7203
  return this.http.request(
@@ -7185,8 +7207,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
7185
7207
  }
7186
7208
  async getMonitorFleet(fleetId, options) {
7187
7209
  const params = new URLSearchParams();
7188
- if (_optionalChain([options, 'optionalAccess', _423 => _423.drift])) params.set("drift", "1");
7189
- if (_optionalChain([options, 'optionalAccess', _424 => _424.limit]) !== void 0)
7210
+ if (_optionalChain([options, 'optionalAccess', _425 => _425.drift])) params.set("drift", "1");
7211
+ if (_optionalChain([options, 'optionalAccess', _426 => _426.limit]) !== void 0)
7190
7212
  params.set("limit", String(options.limit));
7191
7213
  const query = params.toString();
7192
7214
  return this.http.request(
@@ -7199,10 +7221,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
7199
7221
  this.monitorFleetPath(fleetId),
7200
7222
  {
7201
7223
  method: "DELETE",
7202
- body: _optionalChain([options, 'optionalAccess', _425 => _425.dryRun]) ? { dry_run: true } : {},
7224
+ body: _optionalChain([options, 'optionalAccess', _427 => _427.dryRun]) ? { dry_run: true } : {},
7225
+ timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7203
7226
  headers: this.monitorFleetHeaders(
7204
7227
  "deactivate",
7205
- _optionalChain([options, 'optionalAccess', _426 => _426.idempotencyKey])
7228
+ _optionalChain([options, 'optionalAccess', _428 => _428.idempotencyKey])
7206
7229
  ),
7207
7230
  maxRetries: 0,
7208
7231
  exactUrlOnly: true
@@ -7215,9 +7238,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7215
7238
  {
7216
7239
  method: "POST",
7217
7240
  body: {},
7241
+ timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7218
7242
  headers: this.monitorFleetHeaders(
7219
7243
  "reactivate",
7220
- _optionalChain([options, 'optionalAccess', _427 => _427.idempotencyKey])
7244
+ _optionalChain([options, 'optionalAccess', _429 => _429.idempotencyKey])
7221
7245
  ),
7222
7246
  maxRetries: 0,
7223
7247
  exactUrlOnly: true
@@ -7234,9 +7258,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
7234
7258
  * identical to "the request failed".
7235
7259
  */
7236
7260
  async waitForMonitorFleetConvergence(fleetId, options) {
7237
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _428 => _428.timeoutMs]), () => ( 10 * 6e4)));
7238
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _429 => _429.pollIntervalMs]), () => ( 2e3)));
7239
- const terminal = _optionalChain([options, 'optionalAccess', _430 => _430.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
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([
7240
7264
  "converged",
7241
7265
  "degraded",
7242
7266
  "deactivated",
@@ -7245,7 +7269,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7245
7269
  const startedAt = Date.now();
7246
7270
  let latest = await this.getMonitorFleet(fleetId);
7247
7271
  while (true) {
7248
- _optionalChain([options, 'optionalAccess', _431 => _431.onProgress, 'optionalCall', _432 => _432(latest)]);
7272
+ _optionalChain([options, 'optionalAccess', _433 => _433.onProgress, 'optionalCall', _434 => _434(latest)]);
7249
7273
  const status = typeof latest.status === "string" ? latest.status : void 0;
7250
7274
  if (status && terminal.has(status)) return latest;
7251
7275
  if (Date.now() - startedAt >= timeoutMs) return latest;
@@ -7281,7 +7305,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7281
7305
  async health() {
7282
7306
  return this.http.get("/api/v2/health");
7283
7307
  }
7284
- }, _class.__initStatic(), _class);
7308
+ }, _class.__initStatic(), _class.__initStatic2(), _class);
7285
7309
 
7286
7310
 
7287
7311