deepline 0.3.542 → 0.3.544

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 (246) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +112 -2
  2. package/dist/bundling-sources/sdk/src/index.ts +7 -0
  3. package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
  7. package/dist/bundling-sources/sdk/src/types.ts +10 -0
  8. package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
  9. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +3 -1
  10. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
  11. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
  12. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
  13. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
  14. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  15. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
  16. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
  18. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
  19. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
  20. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
  22. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +29 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
  25. package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
  29. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
  30. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +43 -3
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
  42. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
  43. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +49 -55
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +229 -144
  54. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -2
  55. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
  56. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
  57. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
  58. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
  59. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
  60. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
  62. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
  63. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
  64. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
  65. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
  66. package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
  67. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
  68. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
  69. package/dist/cli/auth-ENBXAKQS.js +43 -0
  70. package/dist/cli/{auth-IGBGOB4E.mjs → auth-IMWJAHPU.mjs} +5 -5
  71. package/dist/cli/{billing-IB2TWE74.js → billing-Y55PR2PV.js} +101 -101
  72. package/dist/cli/{billing-N37W2I62.mjs → billing-YQMW3QJI.mjs} +12 -12
  73. package/dist/cli/chunk-22OBDYHP.js +455 -0
  74. package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
  75. package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
  76. package/dist/cli/{chunk-D44DP4KJ.js → chunk-3I26HMJ7.js} +37 -17
  77. package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-3JDA23NN.mjs} +2 -2
  78. package/dist/cli/{chunk-QXNOSCYL.js → chunk-3KGMM4KS.js} +1 -1
  79. package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-456RRXAP.mjs} +5 -5
  80. package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
  81. package/dist/cli/{chunk-FGGPCAGC.js → chunk-4PKHFW56.js} +18 -18
  82. package/dist/cli/{chunk-QONO7FRF.mjs → chunk-57G4NYOL.mjs} +1 -1
  83. package/dist/cli/{chunk-46V7QSJE.mjs → chunk-5PR4VLLL.mjs} +3 -3
  84. package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
  85. package/dist/cli/{chunk-AKY7KZRJ.js → chunk-7GNZEOTH.js} +6 -6
  86. package/dist/cli/{chunk-LFMQVSEI.js → chunk-7HMMTSDA.js} +5 -5
  87. package/dist/cli/{chunk-ORA5TMML.mjs → chunk-BEQ7RQLT.mjs} +5 -5
  88. package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
  89. package/dist/cli/{chunk-GM73TZ2W.js → chunk-C4P2KLWT.js} +41 -41
  90. package/dist/cli/{chunk-DNGACHFX.js → chunk-COJHT2KF.js} +22 -22
  91. package/dist/cli/{chunk-6SLEHAXX.js → chunk-DF2X7GJG.js} +5 -5
  92. package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DVDWAC2M.mjs} +7 -3
  93. package/dist/cli/{chunk-5CAVURVS.js → chunk-DYDHLBSK.js} +53 -53
  94. package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
  95. package/dist/cli/{chunk-EHLCWGWN.js → chunk-G26VJCNT.js} +4 -4
  96. package/dist/cli/{chunk-WL2GUGNZ.js → chunk-GQHRGBHV.js} +7 -7
  97. package/dist/cli/{chunk-DADH3WPE.mjs → chunk-GV45TTI6.mjs} +2 -2
  98. package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
  99. package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-H4SAHB3Q.mjs} +3 -3
  100. package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-HAQRF6DJ.mjs} +2 -2
  101. package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-HBSWATOU.mjs} +6 -6
  102. package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-HVJQF5BI.mjs} +2 -2
  103. package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
  104. package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-HXM2JUGD.mjs} +1 -1
  105. package/dist/cli/{chunk-JPT6VE54.js → chunk-IFIJ4DBJ.js} +2 -2
  106. package/dist/cli/{chunk-HAITCPCG.js → chunk-JBWOE6AP.js} +16 -16
  107. package/dist/cli/{chunk-AWLPERL3.js → chunk-JWVG7ZPX.js} +3 -3
  108. package/dist/cli/{chunk-3XXXMSSP.js → chunk-KE6CSCUF.js} +44 -44
  109. package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-LPUBBUKX.mjs} +24 -4
  110. package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-LQ6RRYXN.mjs} +5 -5
  111. package/dist/cli/{chunk-FFDZT255.mjs → chunk-LW274RO7.mjs} +1 -1
  112. package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
  113. package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
  114. package/dist/cli/{chunk-VHJUH3TB.js → chunk-ON56ISO6.js} +3 -3
  115. package/dist/cli/{chunk-4I47NCRI.js → chunk-PDJ4UDCO.js} +498 -328
  116. package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-PFGOCUH3.mjs} +1 -1
  117. package/dist/cli/{chunk-Q7WDXLYO.js → chunk-PKRW76XG.js} +2 -2
  118. package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-PMW5YP72.mjs} +37 -190
  119. package/dist/cli/{chunk-5APOJWJF.mjs → chunk-Q7ZOWNKR.mjs} +183 -13
  120. package/dist/cli/{chunk-WACIN4PR.mjs → chunk-REEOMNCO.mjs} +3 -3
  121. package/dist/cli/{chunk-DMXLZ57N.js → chunk-RG34YBDE.js} +2 -2
  122. package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-RJPDCSTD.mjs} +4 -4
  123. package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
  124. package/dist/cli/{chunk-AUFE624T.js → chunk-RUFR4PUO.js} +10 -10
  125. package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-SK3HPU2J.mjs} +1 -1
  126. package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-SKS53WM6.mjs} +4 -4
  127. package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
  128. package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
  129. package/dist/cli/{chunk-CFZCRM6R.js → chunk-UHIAQPVA.js} +26 -26
  130. package/dist/cli/{chunk-D7GWEBMF.js → chunk-UNMNGRPB.js} +7 -7
  131. package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
  132. package/dist/cli/{chunk-TTBHOMAA.js → chunk-W7X4KH45.js} +316 -469
  133. package/dist/cli/chunk-WBSGPLH5.mjs +455 -0
  134. package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-WUEORIOY.mjs} +1 -1
  135. package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
  136. package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-YIRVKMON.mjs} +1 -1
  137. package/dist/cli/{chunk-NDNEARE3.js → chunk-Z44YTSTA.js} +13 -13
  138. package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
  139. package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-ZHY4T5M6.mjs} +1 -1
  140. package/dist/cli/{chunk-E7B73LGT.js → chunk-ZY6FL4O4.js} +24 -20
  141. package/dist/cli/command-docs.js +3 -3
  142. package/dist/cli/command-docs.mjs +2 -2
  143. package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-KBWPKSTP.mjs} +7 -7
  144. package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
  145. package/dist/cli/{csv-CAVA3EMS.mjs → csv-M5EBEMZH.mjs} +4 -4
  146. package/dist/cli/{csv-XZAM7EYZ.js → csv-XGGDZTQI.js} +13 -13
  147. package/dist/cli/{db-PPGEOBNG.js → db-CVPR54XK.js} +29 -29
  148. package/dist/cli/{db-HD332QI7.mjs → db-M6FJ6J6E.mjs} +8 -8
  149. package/dist/cli/describe-RUODIS6M.js +50 -0
  150. package/dist/cli/describe-X6QA2U3C.mjs +50 -0
  151. package/dist/cli/describe-core.d.mts +3 -3
  152. package/dist/cli/describe-core.d.ts +3 -3
  153. package/dist/cli/describe-core.js +3 -3
  154. package/dist/cli/describe-core.mjs +2 -2
  155. package/dist/cli/{executions-AFEOLB4A.mjs → executions-EHTS2XJX.mjs} +8 -8
  156. package/dist/cli/{executions-4ZKBL7IC.js → executions-VJEEWN22.js} +10 -10
  157. package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-76VGY4GP.mjs} +6 -6
  158. package/dist/cli/{feedback-M6Y33JKT.js → feedback-DQPUCUXO.js} +14 -14
  159. package/dist/cli/{git-632RYEF6.mjs → git-IY6DKKLR.mjs} +5 -5
  160. package/dist/cli/git-RLHTSYRY.js +25 -0
  161. package/dist/cli/index.js +150 -146
  162. package/dist/cli/index.mjs +49 -45
  163. package/dist/cli/integrations-242LE3TQ.mjs +98 -0
  164. package/dist/cli/integrations-CQSTIKFY.js +98 -0
  165. package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
  166. package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-U72DO6ZF.js} +9 -9
  167. package/dist/cli/{mcp-PESLHAAC.mjs → mcp-JJH6JR52.mjs} +72 -15
  168. package/dist/cli/{mcp-35QA6YG7.js → mcp-L473BKLJ.js} +89 -32
  169. package/dist/cli/{monitors-4DTUZLAI.js → monitors-3TF2DOFD.js} +119 -104
  170. package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-VSYHUBKC.mjs} +26 -11
  171. package/dist/cli/{org-DJNKMFCZ.mjs → org-S5VIKU2E.mjs} +8 -8
  172. package/dist/cli/{org-FWCBZMER.js → org-YKVI2ZTI.js} +90 -90
  173. package/dist/cli/{play-PHVQEEEZ.mjs → play-C7T5A3QM.mjs} +44 -25
  174. package/dist/cli/{play-FZ45M4KD.js → play-DOWEG45Y.js} +374 -355
  175. package/dist/cli/{providers-46E67QG7.mjs → providers-BMVVX3VD.mjs} +10 -9
  176. package/dist/cli/{providers-QJU6FMDD.js → providers-TAZPPFTB.js} +13 -12
  177. package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-A3WKMKTW.mjs} +4 -4
  178. package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-HD6FQXGR.js} +6 -6
  179. package/dist/cli/{run-WKSIRXEC.js → run-BVVV2UX7.js} +49 -48
  180. package/dist/cli/{run-2W2TJ6QA.mjs → run-FV7TWNOC.mjs} +28 -27
  181. package/dist/cli/{search-Y2CFLSYB.mjs → search-MGK6WIKS.mjs} +9 -9
  182. package/dist/cli/search-VJFCWUZN.js +32 -0
  183. package/dist/cli/{search-output-2IK6ZZDY.js → search-output-6Y7KEPIE.js} +6 -6
  184. package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-GM7LDZKE.mjs} +4 -4
  185. package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-4RFAR7YI.mjs} +8 -8
  186. package/dist/cli/{secrets-JVJIHGU4.js → secrets-SISXIXSZ.js} +17 -17
  187. package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-CE3OMEG7.mjs} +6 -6
  188. package/dist/cli/sessions-OWWZJZXH.js +22 -0
  189. package/dist/cli/{settings-5WHMFRNQ.js → settings-4HPM3K4A.js} +89 -89
  190. package/dist/cli/{settings-YQOPF3AI.mjs → settings-E22IDSX2.mjs} +16 -16
  191. package/dist/cli/{setup-3VJMKDEU.js → setup-BDRSNLKX.js} +49 -49
  192. package/dist/cli/{setup-O5U5IEVW.mjs → setup-BK65MDZ6.mjs} +9 -9
  193. package/dist/cli/{skills-G6J5PF35.mjs → skills-FI2GZMR4.mjs} +7 -7
  194. package/dist/cli/skills-ZLBFUAFR.js +36 -0
  195. package/dist/cli/tools-3K72VE33.js +57 -0
  196. package/dist/cli/{tools-AG7SWL5Y.mjs → tools-HMMWYUNW.mjs} +20 -19
  197. package/dist/cli/update-QZV6DH5V.js +34 -0
  198. package/dist/cli/{update-K73DD6CR.mjs → update-WDKBSXV5.mjs} +9 -9
  199. package/dist/cli/{views-4D2OTLIO.js → views-775AUDWQ.js} +23 -23
  200. package/dist/cli/{views-MO6DIOMR.mjs → views-JYIJCO23.mjs} +8 -8
  201. package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-4H6KQRFQ.js} +19 -19
  202. package/dist/cli/{workflow-MMZMAELI.mjs → workflow-FKKHE3IU.mjs} +9 -9
  203. package/dist/{client-DLG9mHDh.d.mts → client-ANT3pyoa.d.mts} +1 -1
  204. package/dist/{client-X-FJD5Dp.d.ts → client-DD_FyJVd.d.ts} +1 -1
  205. package/dist/{client-core-WtnqyBwY.d.mts → client-core-Dg9tKhdB.d.mts} +339 -3
  206. package/dist/{client-core-0jmHfFBv.d.ts → client-core-QHmo73k1.d.ts} +339 -3
  207. package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
  208. package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
  209. package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
  210. package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
  211. package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
  212. package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
  213. package/dist/index.d.mts +7 -7
  214. package/dist/index.d.ts +7 -7
  215. package/dist/index.js +12 -12
  216. package/dist/index.mjs +8 -8
  217. package/dist/install-integrity.json +147 -133
  218. package/dist/plays/bundle-play-file.d.mts +3 -3
  219. package/dist/plays/bundle-play-file.d.ts +3 -3
  220. package/dist/plays/bundle-play-file.mjs +23 -4
  221. package/dist/plays/play-description.d.mts +2 -2
  222. package/dist/plays/play-description.d.ts +2 -2
  223. package/dist/plays/run-request.d.mts +2 -2
  224. package/dist/plays/run-request.d.ts +2 -2
  225. package/dist/plays/run-request.js +2 -2
  226. package/dist/plays/run-request.mjs +1 -1
  227. package/dist/release.d.mts +1 -1
  228. package/dist/release.d.ts +1 -1
  229. package/dist/release.js +2 -2
  230. package/dist/release.mjs +1 -1
  231. package/dist/server.d.mts +4 -4
  232. package/dist/server.d.ts +4 -4
  233. package/dist/server.js +7 -7
  234. package/dist/server.mjs +5 -5
  235. package/package.json +1 -1
  236. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
  237. package/dist/cli/auth-2PH6RSKL.js +0 -43
  238. package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
  239. package/dist/cli/describe-5TFFB2PM.js +0 -49
  240. package/dist/cli/describe-THQU7N47.mjs +0 -49
  241. package/dist/cli/git-AQLQYWRI.js +0 -25
  242. package/dist/cli/search-YLJFCJTK.js +0 -32
  243. package/dist/cli/sessions-TZ33UCPS.js +0 -22
  244. package/dist/cli/skills-WZY3XDT3.js +0 -36
  245. package/dist/cli/tools-BXQBL72Q.js +0 -56
  246. package/dist/cli/update-XYP5EII6.js +0 -34
@@ -3,11 +3,11 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
7
6
 
8
7
 
9
8
 
10
9
 
10
+ var _chunkTI6DTURFjs = require('./chunk-TI6DTURF.js');
11
11
 
12
12
 
13
13
 
@@ -20,7 +20,11 @@ var _chunkE4CABWXLjs = require('./chunk-E4CABWXL.js');
20
20
 
21
21
 
22
22
 
23
- var _chunkCQDQNZGHjs = require('./chunk-CQDQNZGH.js');
23
+
24
+
25
+
26
+
27
+ var _chunkSL6MYJYMjs = require('./chunk-SL6MYJYM.js');
24
28
 
25
29
 
26
30
 
@@ -32,7 +36,7 @@ var _chunkPMH4GLMDjs = require('./chunk-PMH4GLMD.js');
32
36
 
33
37
 
34
38
 
35
- var _chunkEHLCWGWNjs = require('./chunk-EHLCWGWN.js');
39
+ var _chunkG26VJCNTjs = require('./chunk-G26VJCNT.js');
36
40
 
37
41
 
38
42
  var _chunk2GJZLIKWjs = require('./chunk-2GJZLIKW.js');
@@ -459,7 +463,7 @@ function validateCliInvocationId(value) {
459
463
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
460
464
  var EXECUTE_RESPONSE_CONTRACT_HEADER = "x-deepline-execute-response-contract";
461
465
  var EXECUTE_RESPONSE_INTENT_HEADER = "x-deepline-execute-response-intent";
462
- var RAW_V2_EXECUTE_RESPONSE_CONTRACT = _chunkE4CABWXLjs.RAW_V2_TOOL_RESPONSE_CONTRACT;
466
+ var RAW_V2_EXECUTE_RESPONSE_CONTRACT = _chunkTI6DTURFjs.RAW_V2_TOOL_RESPONSE_CONTRACT;
463
467
  var DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS = 15 * 60 * 1e3;
464
468
  function validateExecutionIdempotencyKey(key) {
465
469
  if (typeof key !== "string" || key.length < 1 || key.length > 200 || !/^[A-Za-z0-9._:-]+$/.test(key)) {
@@ -557,7 +561,7 @@ function materializeToolExecutionResponse(response) {
557
561
  }
558
562
  const rawV2 = toolResponse.rawV2;
559
563
  const view = toolResponse.view;
560
- const providerMeta = _chunkE4CABWXLjs.providerMetaFromToolResponseRawV2.call(void 0,
564
+ const providerMeta = _chunkTI6DTURFjs.providerMetaFromToolResponseRawV2.call(void 0,
561
565
  rawV2,
562
566
  _nullishCoalesce(view, () => ( "rawV2"))
563
567
  );
@@ -566,7 +570,7 @@ function materializeToolExecutionResponse(response) {
566
570
  ...response,
567
571
  toolResponse: {
568
572
  ...toolResponse,
569
- raw: _chunkE4CABWXLjs.legacyRawFromToolResponseRawV2.call(void 0,
573
+ raw: _chunkTI6DTURFjs.legacyRawFromToolResponseRawV2.call(void 0,
570
574
  rawV2,
571
575
  _nullishCoalesce(view, () => ( "rawV2")),
572
576
  responseMeta
@@ -588,24 +592,32 @@ var ToolCalls = class {
588
592
  this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
589
593
  }
590
594
  async call(toolId, input, options) {
591
- if (_optionalChain([options, 'optionalAccess', _12 => _12.cliInvocationId]) !== void 0) {
595
+ const connection = _optionalChain([options, 'optionalAccess', _12 => _12.connection]);
596
+ if (connection !== void 0 && (!_chunkTI6DTURFjs.isToolConnectionName.call(void 0, connection) || _optionalChain([options, 'optionalAccess', _13 => _13.idempotencyKey]) !== void 0 || _optionalChain([options, 'optionalAccess', _14 => _14.recover]))) {
597
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
598
+ "Use a valid workspace connection name without execution recovery.",
599
+ 400,
600
+ "NAMED_CONNECTION_INVALID"
601
+ );
602
+ }
603
+ if (_optionalChain([options, 'optionalAccess', _15 => _15.cliInvocationId]) !== void 0) {
592
604
  validateCliInvocationId(options.cliInvocationId);
593
605
  }
594
606
  const inputSnapshot = JSON.parse(JSON.stringify(input));
595
- const metadataSnapshot = _optionalChain([options, 'optionalAccess', _13 => _13.metadata]) ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
596
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _14 => _14.idempotencyKey]), () => ( (_optionalChain([options, 'optionalAccess', _15 => _15.recover]) ? crypto.randomUUID() : void 0)));
607
+ const metadataSnapshot = _optionalChain([options, 'optionalAccess', _16 => _16.metadata]) ? JSON.parse(JSON.stringify(options.metadata)) : void 0;
608
+ const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _17 => _17.idempotencyKey]), () => ( (_optionalChain([options, 'optionalAccess', _18 => _18.recover]) ? crypto.randomUUID() : void 0)));
597
609
  if (idempotencyKey !== void 0) {
598
610
  validateExecutionIdempotencyKey(idempotencyKey);
599
- if (_optionalChain([options, 'optionalAccess', _16 => _16.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
611
+ if (_optionalChain([options, 'optionalAccess', _19 => _19.recoveryTimeoutMs]) !== void 0 && (!Number.isFinite(options.recoveryTimeoutMs) || options.recoveryTimeoutMs < 0)) {
600
612
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
601
613
  "recoveryTimeoutMs must be a finite, non-negative number.",
602
614
  void 0,
603
615
  "IDEMPOTENCY_KEY_INVALID"
604
616
  );
605
617
  }
606
- await _optionalChain([options, 'optionalAccess', _17 => _17.onExecution, 'optionalCall', _18 => _18({ idempotencyKey })]);
618
+ await _optionalChain([options, 'optionalAccess', _20 => _20.onExecution, 'optionalCall', _21 => _21({ idempotencyKey })]);
607
619
  }
608
- const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _19 => _19.timeout]), () => ( resolveToolExecuteTimeoutMs(
620
+ const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _22 => _22.timeout]), () => ( resolveToolExecuteTimeoutMs(
609
621
  toolId,
610
622
  inputSnapshot,
611
623
  this.configuredRequestTimeoutMs
@@ -617,11 +629,11 @@ var ToolCalls = class {
617
629
  [_chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
618
630
  _chunkBBTKAASQjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
619
631
  ),
620
- ..._optionalChain([options, 'optionalAccess', _20 => _20.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
621
- [EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _21 => _21.responseIntent]), () => ( "raw")),
632
+ ..._optionalChain([options, 'optionalAccess', _23 => _23.includeToolMetadata]) ? { [INCLUDE_TOOL_METADATA_HEADER]: "true" } : {},
633
+ [EXECUTE_RESPONSE_INTENT_HEADER]: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.responseIntent]), () => ( "raw")),
622
634
  ...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {},
623
- ..._optionalChain([options, 'optionalAccess', _22 => _22.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
624
- ..._optionalChain([options, 'optionalAccess', _23 => _23.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
635
+ ..._optionalChain([options, 'optionalAccess', _25 => _25.searchRef]) ? { "x-deepline-search-ref": options.searchRef } : {},
636
+ ..._optionalChain([options, 'optionalAccess', _26 => _26.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
625
637
  };
626
638
  let lastResponse = null;
627
639
  const observeTerminal = (failure) => {
@@ -636,7 +648,7 @@ var ToolCalls = class {
636
648
  if (recovery === "running" || recovery === "outcome_unknown") return;
637
649
  const state = isRecord(body) ? body.status : null;
638
650
  const terminal = state === "completed" || state === "failed" || state === "cancelled" ? state : state === "canceled" ? "cancelled" : failure ? "failed" : null;
639
- if (!terminal || !_optionalChain([options, 'optionalAccess', _24 => _24.onResponseReceived])) return;
651
+ if (!terminal || !_optionalChain([options, 'optionalAccess', _27 => _27.onResponseReceived])) return;
640
652
  const reportObservationFailure = () => console.error("[tools.execute] response observation failed");
641
653
  try {
642
654
  const notification = options.onResponseReceived({
@@ -651,33 +663,34 @@ var ToolCalls = class {
651
663
  };
652
664
  const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
653
665
  let useLegacyEndpoint = idempotencyKey === void 0;
654
- const atomicToolOnly = _optionalChain([options, 'optionalAccess', _25 => _25.atomicToolOnly]) === true;
655
- const retryAmbiguousDelivery = atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _26 => _26.retryAmbiguousDelivery]) === true;
666
+ const atomicToolOnly = _optionalChain([options, 'optionalAccess', _28 => _28.atomicToolOnly]) === true;
667
+ const retryAmbiguousDelivery = connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _29 => _29.retryAmbiguousDelivery]) === true;
656
668
  const dispatchRequest = async (requestTimeoutMs) => {
657
669
  let recoverySupported = false;
658
670
  let atomicToolsSupported = false;
659
671
  const post = () => this.http.post(
660
- atomicToolOnly ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute` : useLegacyEndpoint ? legacyEndpoint : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey)}?tool_id=${encodeURIComponent(toolId)}`,
672
+ connection !== void 0 ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute-with-connection` : atomicToolOnly ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute` : useLegacyEndpoint ? legacyEndpoint : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey)}?tool_id=${encodeURIComponent(toolId)}`,
661
673
  {
662
674
  payload: inputSnapshot,
675
+ ...connection !== void 0 ? { connection } : {},
663
676
  ...metadataSnapshot ? { metadata: metadataSnapshot } : {}
664
677
  },
665
678
  headers,
666
679
  {
667
680
  timeout: requestTimeoutMs,
668
- maxRetries: idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _27 => _27.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
669
- ...atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _28 => _28.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
670
- retryApiErrors: atomicToolOnly || _optionalChain([options, 'optionalAccess', _29 => _29.retryApiErrors]) === true,
671
- retryFromExecutePolicy: atomicToolOnly,
681
+ maxRetries: connection !== void 0 || idempotencyKey ? 0 : _nullishCoalesce(_optionalChain([options, 'optionalAccess', _30 => _30.maxRetries]), () => ( (retryAmbiguousDelivery ? 2 : 0))),
682
+ ...connection === void 0 && atomicToolOnly && !idempotencyKey && _optionalChain([options, 'optionalAccess', _31 => _31.maxRetries]) === void 0 ? { executePolicyMaxRetries: 2 } : {},
683
+ retryApiErrors: connection === void 0 && (atomicToolOnly || _optionalChain([options, 'optionalAccess', _32 => _32.retryApiErrors]) === true),
684
+ retryFromExecutePolicy: connection === void 0 && atomicToolOnly,
672
685
  retryAmbiguousDelivery,
673
686
  exactUrlOnly: true,
674
687
  toolId,
675
688
  idempotencyKey,
676
689
  onResponse: (response2) => {
677
690
  lastResponse = null;
678
- atomicToolsSupported = response2.headers.get(_chunkEHLCWGWNjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
691
+ atomicToolsSupported = response2.headers.get(_chunkG26VJCNTjs.ATOMIC_TOOL_EXECUTE_SUPPORTED_HEADER) === "true";
679
692
  recoverySupported = response2.headers.get("X-Deepline-Idempotency-Supported") === "true";
680
- if (_optionalChain([options, 'optionalAccess', _30 => _30.onServerTiming])) {
693
+ if (_optionalChain([options, 'optionalAccess', _33 => _33.onServerTiming])) {
681
694
  try {
682
695
  const notification = options.onServerTiming(
683
696
  parseExecuteServerTiming(
@@ -697,6 +710,7 @@ var ToolCalls = class {
697
710
  try {
698
711
  return await post();
699
712
  } catch (error) {
713
+ if (connection !== void 0) throw error;
700
714
  if (atomicToolOnly) {
701
715
  if (!atomicToolsSupported && !recoverySupported && !(error instanceof _chunkBBTKAASQjs.ToolExecutionError) && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
702
716
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
@@ -713,7 +727,7 @@ var ToolCalls = class {
713
727
  await this.lookupExecutionByKey(
714
728
  idempotencyKey,
715
729
  requestTimeoutMs,
716
- _optionalChain([options, 'optionalAccess', _31 => _31.cliInvocationId])
730
+ _optionalChain([options, 'optionalAccess', _34 => _34.cliInvocationId])
717
731
  );
718
732
  useLegacyEndpoint = true;
719
733
  return post();
@@ -730,7 +744,7 @@ var ToolCalls = class {
730
744
  };
731
745
  let response;
732
746
  let recoveryDeadline = null;
733
- const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _32 => _32.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
747
+ const recoveryTimeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _35 => _35.recoveryTimeoutMs]), () => ( DEFAULT_EXECUTION_RECOVERY_TIMEOUT_MS));
734
748
  let retryDelayMs = 1e3;
735
749
  const recoveryTimeoutError = () => executionRecoveryError({
736
750
  toolId,
@@ -758,7 +772,7 @@ var ToolCalls = class {
758
772
  this.defaultRequestTimeoutMs,
759
773
  remainingMs
760
774
  ),
761
- _optionalChain([options, 'optionalAccess', _33 => _33.cliInvocationId])
775
+ _optionalChain([options, 'optionalAccess', _36 => _36.cliInvocationId])
762
776
  );
763
777
  } catch (error) {
764
778
  if (!isRecoverableExecutionLookupError(error)) throw error;
@@ -897,7 +911,7 @@ function normalizePlayRuntimeSelection(value) {
897
911
  if (record.sandboxPlacementPolicy !== void 0 && sandboxPlacementPolicy === null) {
898
912
  return null;
899
913
  }
900
- if (record.backend !== void 0 && record.backend !== _chunkE4CABWXLjs.PLAY_RUNTIME_BACKENDS.daytona && record.backend !== _chunkE4CABWXLjs.PLAY_RUNTIME_BACKENDS.modal) {
914
+ if (record.backend !== void 0 && record.backend !== _chunkTI6DTURFjs.PLAY_RUNTIME_BACKENDS.daytona && record.backend !== _chunkTI6DTURFjs.PLAY_RUNTIME_BACKENDS.modal) {
901
915
  return null;
902
916
  }
903
917
  return {
@@ -951,11 +965,11 @@ function resolvePlayRunRuntimeSelection(request, env) {
951
965
  }
952
966
  return runtime;
953
967
  }
954
- const configured = _optionalChain([env, 'access', _34 => _34.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]);
955
- const configuredNamespace = _optionalChain([env, 'access', _37 => _37.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
956
- const configuredToken = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
957
- const configuredPlacementPolicy = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
958
- if (_optionalChain([env, 'access', _46 => _46.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()])) {
968
+ const configured = _optionalChain([env, 'access', _37 => _37.DEEPLINE_RUNTIME_ENVIRONMENT, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]);
969
+ const configuredNamespace = _optionalChain([env, 'access', _40 => _40.DEEPLINE_RUNTIME_NAMESPACE, 'optionalAccess', _41 => _41.trim, 'call', _42 => _42()]);
970
+ const configuredToken = _optionalChain([env, 'access', _43 => _43.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
971
+ const configuredPlacementPolicy = _optionalChain([env, 'access', _46 => _46.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY, 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]);
972
+ if (_optionalChain([env, 'access', _49 => _49.DEEPLINE_RUNTIME_GATEWAY_PROFILE, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()])) {
959
973
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
960
974
  "DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.",
961
975
  void 0,
@@ -1013,7 +1027,7 @@ function resolvePlayRunRuntimeSelection(request, env) {
1013
1027
  "INVALID_RUNTIME_NAMESPACE"
1014
1028
  );
1015
1029
  }
1016
- const configuredBackendValue = _optionalChain([env, 'access', _49 => _49.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]);
1030
+ const configuredBackendValue = _optionalChain([env, 'access', _52 => _52.DEEPLINE_PLAY_RUNNER_BACKEND, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
1017
1031
  const configuredBackend = configuredBackendValue === "daytona" || configuredBackendValue === "modal" ? configuredBackendValue : void 0;
1018
1032
  if (configuredBackendValue && !configuredBackend) {
1019
1033
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
@@ -1051,7 +1065,7 @@ function resolveStartPlayRunRequest(request, env) {
1051
1065
  }
1052
1066
  function runtimeSelectionHeaders(runtime, env) {
1053
1067
  if (!runtime || runtime.environment === "native") return void 0;
1054
- const token = _optionalChain([env, 'access', _52 => _52.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _53 => _53.trim, 'call', _54 => _54()]);
1068
+ const token = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
1055
1069
  if (!token) {
1056
1070
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
1057
1071
  "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
@@ -1059,17 +1073,17 @@ function runtimeSelectionHeaders(runtime, env) {
1059
1073
  "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
1060
1074
  );
1061
1075
  }
1062
- const receivers = _optionalChain([env, 'access', _55 => _55.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]);
1076
+ const receivers = _optionalChain([env, 'access', _58 => _58.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
1063
1077
  return {
1064
- [_chunkEHLCWGWNjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1065
- ...receivers ? { [_chunkEHLCWGWNjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1078
+ [_chunkG26VJCNTjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
1079
+ ...receivers ? { [_chunkG26VJCNTjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
1066
1080
  };
1067
1081
  }
1068
1082
  function playRunStartHeaders(runtime, env) {
1069
1083
  const headers = runtimeSelectionHeaders(runtime, env);
1070
- const experimentSwitches = _optionalChain([env, 'access', _58 => _58.DEEPLINE_EXPERIMENT_SWITCHES, 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
1084
+ const experimentSwitches = _optionalChain([env, 'access', _61 => _61.DEEPLINE_EXPERIMENT_SWITCHES, 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
1071
1085
  if (!experimentSwitches) return headers;
1072
- return { ...headers, [_chunkEHLCWGWNjs.EXPERIMENT_SWITCHES_HEADER]: experimentSwitches };
1086
+ return { ...headers, [_chunkG26VJCNTjs.EXPERIMENT_SWITCHES_HEADER]: experimentSwitches };
1073
1087
  }
1074
1088
  function normalizeTestPolicyOverrides(value, source) {
1075
1089
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -1083,7 +1097,7 @@ function normalizeTestPolicyOverrides(value, source) {
1083
1097
  }
1084
1098
  function parseEnvTestPolicyOverrides(env) {
1085
1099
  const raw = env.DEEPLINE_TEST_POLICY_OVERRIDES;
1086
- const trimmed = _optionalChain([raw, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62()]);
1100
+ const trimmed = _optionalChain([raw, 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()]);
1087
1101
  if (!trimmed) return void 0;
1088
1102
  let parsed;
1089
1103
  try {
@@ -1102,18 +1116,18 @@ function isRecord2(value) {
1102
1116
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
1103
1117
  }
1104
1118
  function normalizePlayStatus(raw) {
1105
- const runPackage = _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1106
- const packageRun = _optionalChain([runPackage, 'optionalAccess', _63 => _63.run]);
1107
- const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _64 => _64.status]) === "string" ? packageRun.status : null;
1108
- const status = _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1119
+ const runPackage = _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, raw) ? raw : _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, raw.package) ? raw.package : null;
1120
+ const packageRun = _optionalChain([runPackage, 'optionalAccess', _66 => _66.run]);
1121
+ const rawStatus = typeof raw.status === "string" ? raw.status : typeof _optionalChain([packageRun, 'optionalAccess', _67 => _67.status]) === "string" ? packageRun.status : null;
1122
+ const status = _chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, rawStatus);
1109
1123
  if (!status) {
1110
1124
  throw new Error(
1111
1125
  `Invalid play run lifecycle status in API response: ${JSON.stringify(rawStatus)}.`
1112
1126
  );
1113
1127
  }
1114
- const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _65 => _65.id]), () => ( ""));
1115
- const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _66 => _66.overview]), () => ( raw.overview));
1116
- const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _67 => _67.runStatus]), () => ( raw.runStatus));
1128
+ const runId = typeof raw.runId === "string" ? raw.runId : typeof raw.workflowId === "string" ? raw.workflowId : _nullishCoalesce(_optionalChain([packageRun, 'optionalAccess', _68 => _68.id]), () => ( ""));
1129
+ const legacyOverview = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _69 => _69.overview]), () => ( raw.overview));
1130
+ const runStatus = _nullishCoalesce(_optionalChain([runPackage, 'optionalAccess', _70 => _70.runStatus]), () => ( raw.runStatus));
1117
1131
  return {
1118
1132
  ...raw,
1119
1133
  runId,
@@ -1136,25 +1150,25 @@ var PlayClient = class {
1136
1150
  async startPlayRun(request, options) {
1137
1151
  const resolved = resolveStartPlayRunRequest(request, this.environment);
1138
1152
  const headers = playRunStartHeaders(resolved.runtime, this.environment);
1139
- return _chunkCQDQNZGHjs.startPlayRun.call(void 0,
1153
+ return _chunkSL6MYJYMjs.startPlayRun.call(void 0,
1140
1154
  this.http,
1141
1155
  resolved.request,
1142
- _optionalChain([options, 'optionalAccess', _68 => _68.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkEHLCWGWNjs.SDK_API_MAJOR) } : headers,
1156
+ _optionalChain([options, 'optionalAccess', _71 => _71.cliAdmission]) ? { ...headers, "X-Deepline-API-Major": String(_chunkG26VJCNTjs.SDK_API_MAJOR) } : headers,
1143
1157
  options
1144
1158
  );
1145
1159
  }
1146
1160
  async getPlayStatus(workflowId, options) {
1147
1161
  const params = new URLSearchParams();
1148
- if (_optionalChain([options, 'optionalAccess', _69 => _69.billing]) === false) {
1162
+ if (_optionalChain([options, 'optionalAccess', _72 => _72.billing]) === false) {
1149
1163
  params.set("billing", "false");
1150
1164
  }
1151
- if (_optionalChain([options, 'optionalAccess', _70 => _70.full]) === true) {
1165
+ if (_optionalChain([options, 'optionalAccess', _73 => _73.full]) === true) {
1152
1166
  params.set("full", "true");
1153
1167
  }
1154
1168
  const query = params.size > 0 ? `?${params.toString()}` : "";
1155
1169
  const response = await this.http.get(
1156
1170
  `/api/v2/runs/${encodeURIComponent(workflowId)}${query}`,
1157
- _optionalChain([options, 'optionalAccess', _71 => _71.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
1171
+ _optionalChain([options, 'optionalAccess', _74 => _74.runStatus]) === true ? { headers: { "x-deepline-run-status": "1" } } : void 0
1158
1172
  );
1159
1173
  return normalizePlayStatus(response);
1160
1174
  }
@@ -1167,7 +1181,7 @@ var PlayClient = class {
1167
1181
  async stopPlay(workflowId, options) {
1168
1182
  return this.http.post(
1169
1183
  `/api/v2/runs/${encodeURIComponent(workflowId)}/stop`,
1170
- _optionalChain([options, 'optionalAccess', _72 => _72.reason]) ? { reason: options.reason } : {}
1184
+ _optionalChain([options, 'optionalAccess', _75 => _75.reason]) ? { reason: options.reason } : {}
1171
1185
  );
1172
1186
  }
1173
1187
  async listPlayRuns(playName) {
@@ -1179,7 +1193,7 @@ var PlayClient = class {
1179
1193
  }
1180
1194
  async getPlay(name, options) {
1181
1195
  const encodedName = encodeURIComponent(name);
1182
- const query = _optionalChain([options, 'optionalAccess', _73 => _73.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _74 => _74.guidance]) ? "?include=guidance" : "";
1196
+ const query = _optionalChain([options, 'optionalAccess', _76 => _76.source]) ? `?include=source&revision=${encodeURIComponent(options.source)}` : _optionalChain([options, 'optionalAccess', _77 => _77.guidance]) ? "?include=guidance" : "";
1183
1197
  return this.http.get(`/api/v2/plays/${encodedName}${query}`);
1184
1198
  }
1185
1199
  async clearPlayHistory(name, request = {}) {
@@ -1191,7 +1205,7 @@ var PlayClient = class {
1191
1205
  }
1192
1206
  async listPlayVersions(name, options) {
1193
1207
  const encodedName = encodeURIComponent(name);
1194
- const suffix = _optionalChain([options, 'optionalAccess', _75 => _75.full]) ? "?full=true" : "";
1208
+ const suffix = _optionalChain([options, 'optionalAccess', _78 => _78.full]) ? "?full=true" : "";
1195
1209
  const response = await this.http.get(
1196
1210
  `/api/v2/plays/${encodedName}/versions${suffix}`
1197
1211
  );
@@ -2148,7 +2162,7 @@ function parseDsl(input) {
2148
2162
  input.slice(position)
2149
2163
  );
2150
2164
  if (!operation) {
2151
- const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _76 => _76.exec, 'call', _77 => _77(input.slice(position)), 'optionalAccess', _78 => _78[0]]), () => ( input[position])), () => ( "<end>"));
2165
+ const token = _nullishCoalesce(_nullishCoalesce(_optionalChain([/^(?:[=!<>~]+|[A-Za-z_]+)/, 'access', _79 => _79.exec, 'call', _80 => _80(input.slice(position)), 'optionalAccess', _81 => _81[0]]), () => ( input[position])), () => ( "<end>"));
2152
2166
  if (token === "=") {
2153
2167
  const corrected = `${input.slice(0, position)}==${input.slice(position + 1)}`;
2154
2168
  fail(
@@ -2227,7 +2241,7 @@ function normalizeRunEventQueryTimestamp(value) {
2227
2241
  return /[1-9]/.test(extraMicros) ? canonical2.replace(/Z$/, `${extraMicros}Z`) : canonical2;
2228
2242
  }
2229
2243
  function timestampMicros(value) {
2230
- const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _79 => _79.exec, 'call', _80 => _80(value), 'optionalAccess', _81 => _81[1]]), () => ( ""));
2244
+ const fraction = _nullishCoalesce(_optionalChain([/\.(\d+)Z$/, 'access', _82 => _82.exec, 'call', _83 => _83(value), 'optionalAccess', _84 => _84[1]]), () => ( ""));
2231
2245
  return BigInt(Date.parse(value)) * BigInt(1e3) + BigInt(fraction.padEnd(6, "0").slice(3));
2232
2246
  }
2233
2247
  function time(value, nowMs, fallback) {
@@ -2403,6 +2417,118 @@ function isStopAllPlayRunsDryRunResult(result) {
2403
2417
  return "dryRun" in result && result.dryRun === true;
2404
2418
  }
2405
2419
 
2420
+ // src/integrations.ts
2421
+ var CALENDAR_PROVIDER = "google_calendar_availability";
2422
+ function invalid(message) {
2423
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(message, 400, "INVALID_ARGUMENT");
2424
+ }
2425
+ async function findConnection(client, name, provider) {
2426
+ const { connections } = await client.listWorkspaceConnectionInventory(
2427
+ provider,
2428
+ { authorizationsOnly: true }
2429
+ );
2430
+ const matches = connections.filter(
2431
+ (row) => row.name === name && (!provider || row.provider === provider)
2432
+ );
2433
+ if (matches.length === 0)
2434
+ throw new (0, _chunkBBTKAASQjs.DeeplineError)(
2435
+ `No workspace connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
2436
+ 404,
2437
+ "NOT_FOUND"
2438
+ );
2439
+ if (matches.length > 1)
2440
+ invalid("This name exists for multiple providers. Pass --provider.");
2441
+ return matches[0];
2442
+ }
2443
+ async function changeConnection(client, action, name, options) {
2444
+ const row = await findConnection(client, name, options.provider);
2445
+ if (options.booking && (action !== "reconnect" || row.type !== "workspace_delegation"))
2446
+ invalid("Use --booking with Google Workspace verify or reconnect.");
2447
+ if (row.type === "workspace_delegation") {
2448
+ if (row.provider !== CALENDAR_PROVIDER || !row.domain)
2449
+ invalid("The workspace approval is missing its provider or domain.");
2450
+ if (row.authorizationVersion === void 0)
2451
+ invalid("The API did not return a workspace approval revision.");
2452
+ if (action === "reconnect") {
2453
+ return verifyWorkspace(client, row.domain, options, row);
2454
+ }
2455
+ if (options.verificationEmail)
2456
+ invalid("Use --verification-email with reconnect or verify.");
2457
+ if (action === "delete" && row.status !== "disconnected")
2458
+ invalid("Disconnect this approval before deleting it.");
2459
+ const change2 = action === "delete" ? {
2460
+ action: "remove_workspace",
2461
+ domain: row.domain,
2462
+ connectionId: row.id,
2463
+ grantRevision: row.authorizationVersion
2464
+ } : {
2465
+ action: "disable_workspace",
2466
+ domain: row.domain,
2467
+ connectionId: row.id,
2468
+ grantRevision: row.authorizationVersion
2469
+ };
2470
+ if (options.dryRun) return change2;
2471
+ return client.changeCalendarDelegation(change2);
2472
+ }
2473
+ if (options.verificationEmail)
2474
+ invalid("--verification-email applies to Google Workspace approvals.");
2475
+ if (row.type !== "oauth" || row.provider !== "hubspot" && row.provider !== CALENDAR_PROVIDER)
2476
+ invalid(
2477
+ "Manage this credential type through deepline integrations connect <provider> --link."
2478
+ );
2479
+ if (row.authorizationVersion === void 0)
2480
+ invalid("The API did not return a connection authorization version.");
2481
+ const change = {
2482
+ action: action === "delete" ? "remove" : action,
2483
+ provider: row.provider,
2484
+ name,
2485
+ connectionId: row.id,
2486
+ authorizationVersion: row.authorizationVersion
2487
+ };
2488
+ if (options.dryRun) return change;
2489
+ return client.manageWorkspaceIntegrationConnection(change);
2490
+ }
2491
+ async function verifyWorkspace(client, domain, options, existing) {
2492
+ domain = domain.trim().toLowerCase();
2493
+ if (!_chunkTI6DTURFjs.GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
2494
+ invalid("Enter a Google Workspace domain, such as example.com.");
2495
+ const email = _optionalChain([options, 'access', _85 => _85.verificationEmail, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87(), 'access', _88 => _88.toLowerCase, 'call', _89 => _89()]);
2496
+ if (!email || email.length > 254 || !/^[^\s@]+@[^\s@]+$/.test(email) || email.split("@")[1] !== domain)
2497
+ invalid("Pass --verification-email with a work email in this domain.");
2498
+ const settings = existing ? {
2499
+ grantRevision: existing.authorizationVersion,
2500
+ connectionId: existing.id,
2501
+ grantedScopes: existing.scopes
2502
+ } : await client.getCalendarDelegation(void 0, void 0, domain);
2503
+ if (settings.grantRevision === void 0)
2504
+ invalid("The API did not return a workspace approval revision.");
2505
+ const requestedScopes = options.booking ? [..._chunkTI6DTURFjs.GOOGLE_WORKSPACE_BOOKING_SCOPES] : settings.grantedScopes;
2506
+ const change = {
2507
+ action: "enable_workspace",
2508
+ domain,
2509
+ grantRevision: settings.grantRevision,
2510
+ ...settings.connectionId ? { connectionId: settings.connectionId } : {},
2511
+ verificationEmail: email,
2512
+ ..._optionalChain([requestedScopes, 'optionalAccess', _90 => _90.includes, 'call', _91 => _91(_chunkTI6DTURFjs.GOOGLE_WORKSPACE_BOOKING_SCOPE)]) ? { requestedScopes } : {}
2513
+ };
2514
+ if (options.dryRun) return change;
2515
+ return client.changeCalendarDelegation(change);
2516
+ }
2517
+ function createIntegrationsNamespace(client) {
2518
+ return {
2519
+ list: (options = {}) => client.listWorkspaceConnectionInventory(options.provider, {
2520
+ authorizationsOnly: true
2521
+ }),
2522
+ get: (name, options = {}) => findConnection(client, name, options.provider),
2523
+ connect: (provider) => client.getIntegrationConnectLink(provider),
2524
+ reconnect: (name, options = {}) => changeConnection(client, "reconnect", name, options),
2525
+ disconnect: (name, options = {}) => changeConnection(client, "disconnect", name, options),
2526
+ delete: (name, options = {}) => changeConnection(client, "delete", name, options),
2527
+ verify: (domain, options) => verifyWorkspace(client, domain, options),
2528
+ members: (provider, options = {}) => client.listManagedConnectionMembers(provider, options.cursor)
2529
+ };
2530
+ }
2531
+
2406
2532
  // ../plays/trigger-config-route.ts
2407
2533
  function playTriggerConfigPath(playName) {
2408
2534
  return `/api/v2/plays/${encodeURIComponent(playName)}/triggers`;
@@ -2705,7 +2831,7 @@ var TERMINAL_STATUS_BY_EVENT_TYPE = {
2705
2831
 
2706
2832
  // ../play-runtime/run-snapshot-stream.ts
2707
2833
  function isTerminalPlayRunLiveStatus(status) {
2708
- return _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2834
+ return _chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, status);
2709
2835
  }
2710
2836
  function makeRunStreamEvent(input) {
2711
2837
  return {
@@ -2735,10 +2861,10 @@ function getStepStatusSignature(snapshot) {
2735
2861
  _nullishCoalesce(state.artifactTableNamespace, () => ( "")),
2736
2862
  _nullishCoalesce(state.startedAt, () => ( "")),
2737
2863
  _nullishCoalesce(state.completedAt, () => ( "")),
2738
- _nullishCoalesce(_optionalChain([state, 'access', _82 => _82.progress, 'optionalAccess', _83 => _83.startedAt]), () => ( "")),
2739
- _nullishCoalesce(_optionalChain([state, 'access', _84 => _84.progress, 'optionalAccess', _85 => _85.completedAt]), () => ( "")),
2864
+ _nullishCoalesce(_optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.startedAt]), () => ( "")),
2865
+ _nullishCoalesce(_optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.completedAt]), () => ( "")),
2740
2866
  _nullishCoalesce(state.updatedAt, () => ( "")),
2741
- _nullishCoalesce(_optionalChain([state, 'access', _86 => _86.progress, 'optionalAccess', _87 => _87.updatedAt]), () => ( ""))
2867
+ _nullishCoalesce(_optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.updatedAt]), () => ( ""))
2742
2868
  ].join(":")
2743
2869
  ).join("|");
2744
2870
  }
@@ -2747,11 +2873,11 @@ function getStepProgressSignature(snapshot) {
2747
2873
  snapshot.nodeStates.map((state) => [
2748
2874
  state.nodeId,
2749
2875
  projectPlayStepProgressCounters(_nullishCoalesce(state.progress, () => ( {}))),
2750
- _nullishCoalesce(_optionalChain([state, 'access', _88 => _88.progress, 'optionalAccess', _89 => _89.artifactTableNamespace]), () => ( "")),
2751
- _nullishCoalesce(_optionalChain([state, 'access', _90 => _90.progress, 'optionalAccess', _91 => _91.startedAt]), () => ( "")),
2752
- _nullishCoalesce(_optionalChain([state, 'access', _92 => _92.progress, 'optionalAccess', _93 => _93.completedAt]), () => ( "")),
2753
- _nullishCoalesce(_optionalChain([state, 'access', _94 => _94.progress, 'optionalAccess', _95 => _95.updatedAt]), () => ( "")),
2754
- _nullishCoalesce(_optionalChain([state, 'access', _96 => _96.progress, 'optionalAccess', _97 => _97.message]), () => ( ""))
2876
+ _nullishCoalesce(_optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.artifactTableNamespace]), () => ( "")),
2877
+ _nullishCoalesce(_optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.startedAt]), () => ( "")),
2878
+ _nullishCoalesce(_optionalChain([state, 'access', _102 => _102.progress, 'optionalAccess', _103 => _103.completedAt]), () => ( "")),
2879
+ _nullishCoalesce(_optionalChain([state, 'access', _104 => _104.progress, 'optionalAccess', _105 => _105.updatedAt]), () => ( "")),
2880
+ _nullishCoalesce(_optionalChain([state, 'access', _106 => _106.progress, 'optionalAccess', _107 => _107.message]), () => ( ""))
2755
2881
  ])
2756
2882
  );
2757
2883
  }
@@ -2821,8 +2947,8 @@ function diffPlayRunStreamEvents(input) {
2821
2947
  if (state.status === "idle") {
2822
2948
  continue;
2823
2949
  }
2824
- const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _98 => _98.progress, 'optionalAccess', _99 => _99.startedAt]))), () => ( null));
2825
- const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _100 => _100.progress, 'optionalAccess', _101 => _101.completedAt]))), () => ( null));
2950
+ const persistedStartedAt = _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _108 => _108.progress, 'optionalAccess', _109 => _109.startedAt]))), () => ( null));
2951
+ const persistedCompletedAt = _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _110 => _110.progress, 'optionalAccess', _111 => _111.completedAt]))), () => ( null));
2826
2952
  events.push(
2827
2953
  makeRunStreamEvent({
2828
2954
  cursor,
@@ -2836,7 +2962,7 @@ function diffPlayRunStreamEvents(input) {
2836
2962
  ...resolveTimingWindow({
2837
2963
  startedAt: persistedStartedAt,
2838
2964
  completedAt: persistedCompletedAt,
2839
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _102 => _102.progress, 'optionalAccess', _103 => _103.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2965
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _112 => _112.progress, 'optionalAccess', _113 => _113.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2840
2966
  })
2841
2967
  }
2842
2968
  })
@@ -2890,9 +3016,9 @@ function diffPlayRunStreamEvents(input) {
2890
3016
  if (next.snapshotSignature !== previous.snapshotSignature) {
2891
3017
  const enrichedNodeStates = snapshot.nodeStates.map((state) => {
2892
3018
  const timing = resolveTimingWindow({
2893
- startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _104 => _104.progress, 'optionalAccess', _105 => _105.startedAt]))), () => ( null)),
2894
- completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _106 => _106.progress, 'optionalAccess', _107 => _107.completedAt]))), () => ( null)),
2895
- updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _108 => _108.progress, 'optionalAccess', _109 => _109.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
3019
+ startedAt: _nullishCoalesce(_nullishCoalesce(state.startedAt, () => ( _optionalChain([state, 'access', _114 => _114.progress, 'optionalAccess', _115 => _115.startedAt]))), () => ( null)),
3020
+ completedAt: _nullishCoalesce(_nullishCoalesce(state.completedAt, () => ( _optionalChain([state, 'access', _116 => _116.progress, 'optionalAccess', _117 => _117.completedAt]))), () => ( null)),
3021
+ updatedAt: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(state.updatedAt, () => ( _optionalChain([state, 'access', _118 => _118.progress, 'optionalAccess', _119 => _119.updatedAt]))), () => ( snapshot.updatedAt)), () => ( null))
2896
3022
  });
2897
3023
  return {
2898
3024
  ...state,
@@ -2942,18 +3068,18 @@ var RUN_WATCH_SERVER_WAIT_MS = 0;
2942
3068
  var RUN_WATCH_SERVER_WAIT_FROM_START = false;
2943
3069
  var TERMINAL_LOG_PROJECTION_RETRY_LIMIT = 3;
2944
3070
  function waitForNextPoll(ms, signal) {
2945
- if (_optionalChain([signal, 'optionalAccess', _110 => _110.aborted])) {
3071
+ if (_optionalChain([signal, 'optionalAccess', _120 => _120.aborted])) {
2946
3072
  return Promise.resolve(false);
2947
3073
  }
2948
3074
  return new Promise((resolve) => {
2949
3075
  const finish = (elapsed) => {
2950
3076
  clearTimeout(timeout);
2951
- _optionalChain([signal, 'optionalAccess', _111 => _111.removeEventListener, 'call', _112 => _112("abort", onAbort)]);
3077
+ _optionalChain([signal, 'optionalAccess', _121 => _121.removeEventListener, 'call', _122 => _122("abort", onAbort)]);
2952
3078
  resolve(elapsed);
2953
3079
  };
2954
3080
  const onAbort = () => finish(false);
2955
3081
  const timeout = setTimeout(() => finish(true), ms);
2956
- _optionalChain([signal, 'optionalAccess', _113 => _113.addEventListener, 'call', _114 => _114("abort", onAbort, { once: true })]);
3082
+ _optionalChain([signal, 'optionalAccess', _123 => _123.addEventListener, 'call', _124 => _124("abort", onAbort, { once: true })]);
2957
3083
  });
2958
3084
  }
2959
3085
  function readSnapshotResponse(response, runId) {
@@ -3034,7 +3160,7 @@ async function* watchRunEvents(options) {
3034
3160
  let outageNoticeSent = false;
3035
3161
  let pollCount = 0;
3036
3162
  let terminalLogProjectionRetries = 0;
3037
- while (!_optionalChain([signal, 'optionalAccess', _115 => _115.aborted])) {
3163
+ while (!_optionalChain([signal, 'optionalAccess', _125 => _125.aborted])) {
3038
3164
  const pollStartedAt = Date.now();
3039
3165
  const poll = ++pollCount;
3040
3166
  const pastStartup = pollStartedAt - watchStartedAt >= RUN_WATCH_STARTUP_WINDOW_MS;
@@ -3083,7 +3209,7 @@ async function* watchRunEvents(options) {
3083
3209
  reportPoll();
3084
3210
  } catch (error) {
3085
3211
  reportPoll();
3086
- if (_optionalChain([signal, 'optionalAccess', _116 => _116.aborted])) {
3212
+ if (_optionalChain([signal, 'optionalAccess', _126 => _126.aborted])) {
3087
3213
  return;
3088
3214
  }
3089
3215
  if (!isTransientPlayRunReadError(error)) {
@@ -3092,12 +3218,12 @@ async function* watchRunEvents(options) {
3092
3218
  consecutiveFailures += 1;
3093
3219
  const reason = error instanceof Error ? error.message : String(error);
3094
3220
  if (!outageNoticeSent) {
3095
- _optionalChain([options, 'access', _117 => _117.onRetry, 'optionalCall', _118 => _118({
3221
+ _optionalChain([options, 'access', _127 => _127.onRetry, 'optionalCall', _128 => _128({
3096
3222
  attempt: consecutiveFailures,
3097
3223
  delayMs: pollIntervalMs,
3098
3224
  reason
3099
3225
  })]);
3100
- _optionalChain([options, 'access', _119 => _119.onNotice, 'optionalCall', _120 => _120(
3226
+ _optionalChain([options, 'access', _129 => _129.onNotice, 'optionalCall', _130 => _130(
3101
3227
  `[watch] run snapshot request failed; retrying snapshot polling (${reason})`
3102
3228
  )]);
3103
3229
  outageNoticeSent = true;
@@ -3112,7 +3238,7 @@ async function* watchRunEvents(options) {
3112
3238
  continue;
3113
3239
  }
3114
3240
  if (outageNoticeSent) {
3115
- _optionalChain([options, 'access', _121 => _121.onNotice, 'optionalCall', _122 => _122("[watch] run snapshot polling recovered")]);
3241
+ _optionalChain([options, 'access', _131 => _131.onNotice, 'optionalCall', _132 => _132("[watch] run snapshot polling recovered")]);
3116
3242
  outageNoticeSent = false;
3117
3243
  }
3118
3244
  consecutiveFailures = 0;
@@ -3127,14 +3253,14 @@ async function* watchRunEvents(options) {
3127
3253
  if (!await waitForNextPoll(remaining2, signal)) return;
3128
3254
  continue;
3129
3255
  }
3130
- _optionalChain([options, 'access', _123 => _123.onNotice, 'optionalCall', _124 => _124(
3256
+ _optionalChain([options, 'access', _133 => _133.onNotice, 'optionalCall', _134 => _134(
3131
3257
  `[watch] terminal status is complete, but final logs are unavailable in this watch; fetch retained logs with deepline runs logs ${runId}`
3132
3258
  )]);
3133
3259
  } else {
3134
3260
  terminalLogProjectionRetries = 0;
3135
3261
  }
3136
3262
  if (terminalStatus) {
3137
- await _optionalChain([options, 'access', _125 => _125.terminalStatus, 'optionalAccess', _126 => _126.onStatus, 'call', _127 => _127(terminalStatus, snapshot.status)]);
3263
+ await _optionalChain([options, 'access', _135 => _135.terminalStatus, 'optionalAccess', _136 => _136.onStatus, 'call', _137 => _137(terminalStatus, snapshot.status)]);
3138
3264
  }
3139
3265
  const diff = diffPlayRunStreamEvents({
3140
3266
  streamId,
@@ -3198,7 +3324,7 @@ function parseNotificationGroupTarget(value) {
3198
3324
  }
3199
3325
  return { kind: "email", email };
3200
3326
  }
3201
- const slack = _optionalChain([/^slack:(.+)$/i, 'access', _128 => _128.exec, 'call', _129 => _129(normalized), 'optionalAccess', _130 => _130[1], 'optionalAccess', _131 => _131.trim, 'call', _132 => _132()]);
3327
+ const slack = _optionalChain([/^slack:(.+)$/i, 'access', _138 => _138.exec, 'call', _139 => _139(normalized), 'optionalAccess', _140 => _140[1], 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]);
3202
3328
  if (!slack) {
3203
3329
  const provider = normalized.split(":", 1)[0] || normalized;
3204
3330
  throw new Error(
@@ -3206,7 +3332,7 @@ function parseNotificationGroupTarget(value) {
3206
3332
  );
3207
3333
  }
3208
3334
  const member = /^member:([UW][A-Z0-9]{8,})$/i.exec(slack);
3209
- if (_optionalChain([member, 'optionalAccess', _133 => _133[1]])) {
3335
+ if (_optionalChain([member, 'optionalAccess', _143 => _143[1]])) {
3210
3336
  return { kind: "slack", memberId: member[1].toUpperCase() };
3211
3337
  }
3212
3338
  if (slack.toLowerCase().startsWith("member:")) {
@@ -3231,11 +3357,11 @@ var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
3231
3357
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
3232
3358
  var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
3233
3359
  function isolatedCiRuntimeEventReadHeaders(env) {
3234
- const schema = _optionalChain([env, 'access', _134 => _134.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _135 => _135.trim, 'call', _136 => _136()]);
3235
- if (_optionalChain([env, 'access', _137 => _137.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3360
+ const schema = _optionalChain([env, 'access', _144 => _144.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()]);
3361
+ if (_optionalChain([env, 'access', _147 => _147.DEEPLINE_SYNTHETIC_RUN, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()]) !== "1" || !schema || !/^fly_absurd_pr_\d+_\d+(?:_\d+)?$/.test(schema)) {
3236
3362
  return void 0;
3237
3363
  }
3238
- const token = _optionalChain([env, 'access', _140 => _140.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]);
3364
+ const token = _optionalChain([env, 'access', _150 => _150.DEEPLINE_INTERNAL_TOKEN, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]);
3239
3365
  if (!token) {
3240
3366
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3241
3367
  "DEEPLINE_INTERNAL_TOKEN is required for isolated CI runtime event reads.",
@@ -3243,7 +3369,7 @@ function isolatedCiRuntimeEventReadHeaders(env) {
3243
3369
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
3244
3370
  );
3245
3371
  }
3246
- return { [_chunkEHLCWGWNjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3372
+ return { [_chunkG26VJCNTjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
3247
3373
  }
3248
3374
  function sleep(ms) {
3249
3375
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -3258,7 +3384,7 @@ function isTransientCompileManifestError(error) {
3258
3384
  );
3259
3385
  }
3260
3386
  function requireCompileManifestResponse(response, playName) {
3261
- const compilerManifest = _optionalChain([response, 'optionalAccess', _143 => _143.compilerManifest]);
3387
+ const compilerManifest = _optionalChain([response, 'optionalAccess', _153 => _153.compilerManifest]);
3262
3388
  if (!compilerManifest || typeof compilerManifest !== "object" || Array.isArray(compilerManifest)) {
3263
3389
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
3264
3390
  `Compile manifest response did not include compilerManifest for ${playName}.`,
@@ -3310,7 +3436,7 @@ function chunkRegisterPlayArtifacts(artifacts) {
3310
3436
  }
3311
3437
  function searchParams(options) {
3312
3438
  const params = new URLSearchParams();
3313
- params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _144 => _144.query, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()]), () => ( "")));
3439
+ params.set("q", _nullishCoalesce(_optionalChain([options, 'access', _154 => _154.query, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()]), () => ( "")));
3314
3440
  params.set(
3315
3441
  "include_search_debug",
3316
3442
  options.includeSearchDebug ? "true" : "false"
@@ -3320,13 +3446,13 @@ function searchParams(options) {
3320
3446
  if (options.offset !== void 0) {
3321
3447
  params.set("offset", String(options.offset));
3322
3448
  }
3323
- if (_optionalChain([options, 'access', _147 => _147.categories, 'optionalAccess', _148 => _148.trim, 'call', _149 => _149()])) {
3449
+ if (_optionalChain([options, 'access', _157 => _157.categories, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()])) {
3324
3450
  params.set("categories", options.categories.trim());
3325
3451
  }
3326
- if (_optionalChain([options, 'access', _150 => _150.searchTerms, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
3452
+ if (_optionalChain([options, 'access', _160 => _160.searchTerms, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()])) {
3327
3453
  params.set("search_terms", options.searchTerms.trim());
3328
3454
  }
3329
- if (_optionalChain([options, 'access', _153 => _153.task, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()])) params.set("task", options.task.trim());
3455
+ if (_optionalChain([options, 'access', _163 => _163.task, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()])) params.set("task", options.task.trim());
3330
3456
  return params;
3331
3457
  }
3332
3458
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -3374,7 +3500,7 @@ function playLiveRunStatus(event) {
3374
3500
  return null;
3375
3501
  }
3376
3502
  const payload = getPlayLiveEventPayload(event);
3377
- return _nullishCoalesce(_chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? _chunkCQDQNZGHjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3503
+ return _nullishCoalesce(_chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, payload.status), () => ( (_chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? _chunkSL6MYJYMjs.decodePlayRunPublicStatus.call(void 0, payload.run.status) : null)));
3378
3504
  }
3379
3505
  function appendPlayLiveLogLines(state, payload) {
3380
3506
  const lines = readStringArray(payload.lines);
@@ -3406,7 +3532,7 @@ function updatePlayLiveStatusState(state, event) {
3406
3532
  if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
3407
3533
  return null;
3408
3534
  }
3409
- const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3535
+ const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : _chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? payload.run.id : state.runId;
3410
3536
  const status = _nullishCoalesce(playLiveRunStatus(event), () => ( state.status));
3411
3537
  const progressPayload = isRecord3(payload.progress) ? payload.progress : {};
3412
3538
  if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
@@ -3419,7 +3545,7 @@ function updatePlayLiveStatusState(state, event) {
3419
3545
  }
3420
3546
  if ("result" in payload) {
3421
3547
  state.result = payload.result;
3422
- } else if (_chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload)) {
3548
+ } else if (_chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload)) {
3423
3549
  state.result = payload;
3424
3550
  }
3425
3551
  if (typeof payload.error === "string" && payload.error.trim()) {
@@ -3432,7 +3558,7 @@ function updatePlayLiveStatusState(state, event) {
3432
3558
  ...payload,
3433
3559
  runId,
3434
3560
  status,
3435
- ..._chunkCQDQNZGHjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3561
+ ..._chunkSL6MYJYMjs.isPlayRunPackage.call(void 0, payload) ? { package: payload, outputs: payload.outputs } : {},
3436
3562
  progress: {
3437
3563
  ...progressRecord,
3438
3564
  status: typeof progressRecord.status === "string" ? progressRecord.status : status,
@@ -3450,9 +3576,9 @@ function playRunResultFromStatus(status, startedAt, fallbackRunId) {
3450
3576
  runId: status.runId || fallbackRunId,
3451
3577
  result: _nullishCoalesce(status.package, () => ( status.result)),
3452
3578
  ...status.package ? { package: status.package } : {},
3453
- logs: _nullishCoalesce(_optionalChain([status, 'access', _156 => _156.progress, 'optionalAccess', _157 => _157.logs]), () => ( [])),
3579
+ logs: _nullishCoalesce(_optionalChain([status, 'access', _166 => _166.progress, 'optionalAccess', _167 => _167.logs]), () => ( [])),
3454
3580
  durationMs: Date.now() - startedAt,
3455
- error: _nullishCoalesce(_optionalChain([status, 'access', _158 => _158.progress, 'optionalAccess', _159 => _159.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3581
+ error: _nullishCoalesce(_optionalChain([status, 'access', _168 => _168.progress, 'optionalAccess', _169 => _169.error]), () => ( (status.status !== "completed" ? status.status : void 0)))
3456
3582
  };
3457
3583
  }
3458
3584
  var DeeplineClient = (_class = class _DeeplineClient {
@@ -3471,6 +3597,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3471
3597
 
3472
3598
  /** Monitors namespace: access, catalog, deploy/check, and lifecycle. */
3473
3599
 
3600
+ /** Named workspace authorizations and provider setup wizard links. */
3601
+
3474
3602
  /**
3475
3603
  * Create a low-level SDK client.
3476
3604
  *
@@ -3484,6 +3612,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3484
3612
  this.config = config;
3485
3613
  this.environment = _nullishCoalesce(this.config.environment, () => ( process.env));
3486
3614
  this.http = http;
3615
+ this.integrations = createIntegrationsNamespace(this);
3487
3616
  this.playClient = new PlayClient(this.http, this.environment);
3488
3617
  this.toolCalls = new ToolCalls(
3489
3618
  this.http,
@@ -3561,7 +3690,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3561
3690
  {},
3562
3691
  {
3563
3692
  "Idempotency-Key": requireBillingIdempotencyKey(
3564
- _nullishCoalesce(_optionalChain([options, 'optionalAccess', _160 => _160.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3693
+ _nullishCoalesce(_optionalChain([options, 'optionalAccess', _170 => _170.idempotencyKey]), () => ( globalThis.crypto.randomUUID()))
3565
3694
  )
3566
3695
  }
3567
3696
  ),
@@ -3570,10 +3699,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
3570
3699
  cards: {
3571
3700
  list: (options) => {
3572
3701
  const query = new URLSearchParams();
3573
- if (_optionalChain([options, 'optionalAccess', _161 => _161.limit]) !== void 0) {
3702
+ if (_optionalChain([options, 'optionalAccess', _171 => _171.limit]) !== void 0) {
3574
3703
  query.set("limit", String(options.limit));
3575
3704
  }
3576
- if (_optionalChain([options, 'optionalAccess', _162 => _162.cursor])) query.set("cursor", options.cursor);
3705
+ if (_optionalChain([options, 'optionalAccess', _172 => _172.cursor])) query.set("cursor", options.cursor);
3577
3706
  const suffix = query.size > 0 ? `?${query.toString()}` : "";
3578
3707
  return this.http.get(
3579
3708
  `/api/v2/billing/payment-methods${suffix}`
@@ -3581,7 +3710,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3581
3710
  },
3582
3711
  add: (options) => this.http.post(
3583
3712
  "/api/v2/billing/payment-method/setup",
3584
- { make_default: _optionalChain([options, 'optionalAccess', _163 => _163.makeDefault]) === true }
3713
+ { make_default: _optionalChain([options, 'optionalAccess', _173 => _173.makeDefault]) === true }
3585
3714
  ),
3586
3715
  setDefault: (options) => this.http.post(
3587
3716
  "/api/v2/billing/payment-methods/default",
@@ -3605,7 +3734,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3605
3734
  };
3606
3735
  this.workspaces = {
3607
3736
  members: (options) => {
3608
- const query = _optionalChain([options, 'optionalAccess', _164 => _164.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3737
+ const query = _optionalChain([options, 'optionalAccess', _174 => _174.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
3609
3738
  return this.http.get(`/api/v2/auth/workspace/members${query}`);
3610
3739
  },
3611
3740
  setMemberGrants: (memberId, grants) => this.http.patch(
@@ -3657,7 +3786,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3657
3786
  check: (definition) => this.checkMonitor(definition),
3658
3787
  preview: (definition, options) => this.previewMonitor(definition, options),
3659
3788
  deploy: (definition, options) => this.deployMonitor(definition, options),
3660
- sync: (definition, options) => _optionalChain([options, 'optionalAccess', _165 => _165.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3789
+ sync: (definition, options) => _optionalChain([options, 'optionalAccess', _175 => _175.dryRun]) ? this.deployMonitor(definition, { dryRun: true }) : this.syncScalarMonitor(definition, options),
3661
3790
  list: (options) => this.listMonitors(options),
3662
3791
  ledger: (options) => this.listMonitorLedger(options),
3663
3792
  ledgerGet: (key) => this.getMonitorLedgerEntry(key),
@@ -3669,13 +3798,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
3669
3798
  update: (key, patch) => this.updateMonitor(key, patch),
3670
3799
  delete: (key, options) => this.deleteMonitor(key, options),
3671
3800
  reactivate: (key, options) => this.reactivateMonitor(key, options),
3672
- start: (key, options) => _optionalChain([options, 'optionalAccess', _166 => _166.dryRun]) ? this.submitMonitorBatch({
3801
+ start: (key, options) => _optionalChain([options, 'optionalAccess', _176 => _176.dryRun]) ? this.submitMonitorBatch({
3673
3802
  kind: "reactivate",
3674
3803
  scope: { kind: "keys", monitorKeys: [key] },
3675
3804
  dryRun: true,
3676
3805
  idempotencyKey: _nullishCoalesce(options.idempotencyKey, () => ( this.monitorJobIdempotencyKey(`start-${key}`)))
3677
3806
  }) : this.submitScalarMonitorLifecycle(key, "start", options),
3678
- stop: (key, options) => _optionalChain([options, 'optionalAccess', _167 => _167.dryRun]) ? this.submitMonitorBatch({
3807
+ stop: (key, options) => _optionalChain([options, 'optionalAccess', _177 => _177.dryRun]) ? this.submitMonitorBatch({
3679
3808
  kind: "deactivate",
3680
3809
  scope: { kind: "keys", monitorKeys: [key] },
3681
3810
  dryRun: true,
@@ -3729,8 +3858,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3729
3858
  /** List this workspace's views, most recently changed first. */
3730
3859
  async listViews(input) {
3731
3860
  const params = new URLSearchParams();
3732
- if (_optionalChain([input, 'optionalAccess', _168 => _168.cursor])) params.set("cursor", input.cursor);
3733
- if (_optionalChain([input, 'optionalAccess', _169 => _169.limit])) params.set("limit", String(input.limit));
3861
+ if (_optionalChain([input, 'optionalAccess', _178 => _178.cursor])) params.set("cursor", input.cursor);
3862
+ if (_optionalChain([input, 'optionalAccess', _179 => _179.limit])) params.set("limit", String(input.limit));
3734
3863
  const query = params.size > 0 ? `?${params}` : "";
3735
3864
  return await this.http.get(`/api/v2/views${query}`);
3736
3865
  }
@@ -3785,8 +3914,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3785
3914
  /** Every run of the view's Play, newest first. */
3786
3915
  async listViewRuns(id, input) {
3787
3916
  const params = new URLSearchParams();
3788
- if (_optionalChain([input, 'optionalAccess', _170 => _170.limit])) params.set("limit", String(input.limit));
3789
- if (_optionalChain([input, 'optionalAccess', _171 => _171.offset])) params.set("offset", String(input.offset));
3917
+ if (_optionalChain([input, 'optionalAccess', _180 => _180.limit])) params.set("limit", String(input.limit));
3918
+ if (_optionalChain([input, 'optionalAccess', _181 => _181.offset])) params.set("offset", String(input.offset));
3790
3919
  const query = params.size > 0 ? `?${params}` : "";
3791
3920
  return await this.http.get(
3792
3921
  `/api/v2/views/${encodeURIComponent(id)}/runs${query}`
@@ -3874,17 +4003,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
3874
4003
  */
3875
4004
  async listTools(options) {
3876
4005
  const params = new URLSearchParams();
3877
- if (_optionalChain([options, 'optionalAccess', _172 => _172.categories, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()])) {
4006
+ if (_optionalChain([options, 'optionalAccess', _182 => _182.categories, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()])) {
3878
4007
  params.set("categories", options.categories.trim());
3879
4008
  }
3880
- if (_optionalChain([options, 'optionalAccess', _175 => _175.tags, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()])) {
4009
+ if (_optionalChain([options, 'optionalAccess', _185 => _185.tags, 'optionalAccess', _186 => _186.trim, 'call', _187 => _187()])) {
3881
4010
  params.set("tags", options.tags.trim());
3882
4011
  }
3883
- if (_optionalChain([options, 'optionalAccess', _178 => _178.grep, 'optionalAccess', _179 => _179.trim, 'call', _180 => _180()])) {
4012
+ if (_optionalChain([options, 'optionalAccess', _188 => _188.grep, 'optionalAccess', _189 => _189.trim, 'call', _190 => _190()])) {
3884
4013
  params.set("grep", options.grep.trim());
3885
4014
  params.set("grep_mode", _nullishCoalesce(options.grepMode, () => ( "all")));
3886
4015
  }
3887
- params.set("compact", _optionalChain([options, 'optionalAccess', _181 => _181.compact]) === true ? "true" : "false");
4016
+ params.set("compact", _optionalChain([options, 'optionalAccess', _191 => _191.compact]) === true ? "true" : "false");
3888
4017
  const suffix = params.toString() ? `?${params.toString()}` : "";
3889
4018
  const res = await this.http.get(
3890
4019
  `/api/v2/tools${suffix}`
@@ -3917,7 +4046,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3917
4046
  const params = new URLSearchParams({
3918
4047
  view: "category",
3919
4048
  categories: normalizedCategory,
3920
- compact: _optionalChain([options, 'optionalAccess', _182 => _182.compact]) === true ? "true" : "false"
4049
+ compact: _optionalChain([options, 'optionalAccess', _192 => _192.compact]) === true ? "true" : "false"
3921
4050
  });
3922
4051
  const response = await this.http.get(
3923
4052
  `/api/v2/tools?${params}`
@@ -3932,7 +4061,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3932
4061
  }
3933
4062
  /** List discoverable providers without requiring a local plugin catalog. */
3934
4063
  async listProviders(options) {
3935
- const suffix = _optionalChain([options, 'optionalAccess', _183 => _183.changed]) ? "?changed=true" : "";
4064
+ const suffix = _optionalChain([options, 'optionalAccess', _193 => _193.changed]) ? "?changed=true" : "";
3936
4065
  const res = await this.http.get(
3937
4066
  `/api/v2/tools/providers${suffix}`
3938
4067
  );
@@ -3963,8 +4092,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3963
4092
  */
3964
4093
  async search(options = {}) {
3965
4094
  const params = searchParams(options);
3966
- if (_optionalChain([options, 'access', _184 => _184.types, 'optionalAccess', _185 => _185.length])) params.set("types", options.types.join(","));
3967
- if (_optionalChain([options, 'access', _186 => _186.exclude, 'optionalAccess', _187 => _187.length])) {
4095
+ if (_optionalChain([options, 'access', _194 => _194.types, 'optionalAccess', _195 => _195.length])) params.set("types", options.types.join(","));
4096
+ if (_optionalChain([options, 'access', _196 => _196.exclude, 'optionalAccess', _197 => _197.length])) {
3968
4097
  params.set("exclude", options.exclude.join(","));
3969
4098
  }
3970
4099
  return this.http.get(`/api/v2/search?${params.toString()}`);
@@ -3986,7 +4115,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3986
4115
  * ```
3987
4116
  */
3988
4117
  async getTool(toolId, options) {
3989
- if (_optionalChain([options, 'optionalAccess', _188 => _188.cliInvocationId]) !== void 0) {
4118
+ if (_optionalChain([options, 'optionalAccess', _198 => _198.cliInvocationId]) !== void 0) {
3990
4119
  validateCliInvocationId(options.cliInvocationId);
3991
4120
  }
3992
4121
  return this.http.request(
@@ -3999,7 +4128,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
3999
4128
  retryApiErrors: true,
4000
4129
  headers: {
4001
4130
  "x-deepline-tool-meta-only": "1",
4002
- ..._optionalChain([options, 'optionalAccess', _189 => _189.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
4131
+ ..._optionalChain([options, 'optionalAccess', _199 => _199.cliInvocationId]) !== void 0 ? { "x-deepline-cli-invocation-id": options.cliInvocationId } : {}
4003
4132
  }
4004
4133
  }
4005
4134
  );
@@ -4090,7 +4219,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4090
4219
  return this.http.post(
4091
4220
  "/api/v2/ingestion/repair",
4092
4221
  {
4093
- ..._optionalChain([input, 'optionalAccess', _190 => _190.provider]) ? { provider: input.provider } : {}
4222
+ ..._optionalChain([input, 'optionalAccess', _200 => _200.provider]) ? { provider: input.provider } : {}
4094
4223
  }
4095
4224
  );
4096
4225
  }
@@ -4142,10 +4271,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
4142
4271
  */
4143
4272
  async preparePlayRunAdmission(request, options) {
4144
4273
  const resolved = resolveStartPlayRunRequest(request, this.environment);
4145
- const prepared = await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4274
+ const prepared = await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
4146
4275
  this.http,
4147
4276
  resolved.request,
4148
- _optionalChain([options, 'optionalAccess', _191 => _191.onSubmission]),
4277
+ _optionalChain([options, 'optionalAccess', _201 => _201.onSubmission]),
4149
4278
  options
4150
4279
  );
4151
4280
  const bodyJson = JSON.stringify(prepared.body);
@@ -4153,9 +4282,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4153
4282
  resolved.runtime,
4154
4283
  this.environment
4155
4284
  );
4156
- const headers = _optionalChain([options, 'optionalAccess', _192 => _192.cliAdmission]) ? {
4285
+ const headers = _optionalChain([options, 'optionalAccess', _202 => _202.cliAdmission]) ? {
4157
4286
  ...runtimeHeaders,
4158
- "X-Deepline-API-Major": String(_chunkEHLCWGWNjs.SDK_API_MAJOR)
4287
+ "X-Deepline-API-Major": String(_chunkG26VJCNTjs.SDK_API_MAJOR)
4159
4288
  } : runtimeHeaders;
4160
4289
  const http = this.http;
4161
4290
  let submitted = false;
@@ -4170,31 +4299,31 @@ var DeeplineClient = (_class = class _DeeplineClient {
4170
4299
  );
4171
4300
  }
4172
4301
  if (submitted) {
4173
- if (!_optionalChain([options, 'optionalAccess', _193 => _193.callerIntentV2])) {
4174
- await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4302
+ if (!_optionalChain([options, 'optionalAccess', _203 => _203.callerIntentV2])) {
4303
+ await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
4175
4304
  http,
4176
4305
  JSON.parse(bodyJson),
4177
4306
  void 0,
4178
- { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _194 => _194.signal]), () => ( _optionalChain([options, 'optionalAccess', _195 => _195.signal]))) }
4307
+ { signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _204 => _204.signal]), () => ( _optionalChain([options, 'optionalAccess', _205 => _205.signal]))) }
4179
4308
  );
4180
4309
  }
4181
4310
  }
4182
4311
  submitted = true;
4183
4312
  try {
4184
- return await _chunkCQDQNZGHjs.submitPreparedPlayRunAdmission.call(void 0,
4313
+ return await _chunkSL6MYJYMjs.submitPreparedPlayRunAdmission.call(void 0,
4185
4314
  http,
4186
4315
  JSON.parse(bodyJson),
4187
4316
  prepared.workflowId,
4188
4317
  prepared.supportsCallerIntent,
4189
4318
  headers,
4190
4319
  {
4191
- cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _196 => _196.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _197 => _197.cliAdmission]))),
4192
- callerIntentV2: _optionalChain([options, 'optionalAccess', _198 => _198.callerIntentV2]),
4193
- signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _199 => _199.signal]), () => ( _optionalChain([options, 'optionalAccess', _200 => _200.signal])))
4320
+ cliAdmission: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _206 => _206.cliAdmission]), () => ( _optionalChain([options, 'optionalAccess', _207 => _207.cliAdmission]))),
4321
+ callerIntentV2: _optionalChain([options, 'optionalAccess', _208 => _208.callerIntentV2]),
4322
+ signal: _nullishCoalesce(_optionalChain([startOptions, 'optionalAccess', _209 => _209.signal]), () => ( _optionalChain([options, 'optionalAccess', _210 => _210.signal])))
4194
4323
  }
4195
4324
  );
4196
4325
  } catch (error) {
4197
- if (error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
4326
+ if (error instanceof _chunkSL6MYJYMjs.CliPlayAdmissionUnsupportedError || error instanceof _chunkSL6MYJYMjs.CliPlayAdmissionCallerIntentV2UnsupportedError) {
4198
4327
  submitted = false;
4199
4328
  }
4200
4329
  throw error;
@@ -4209,43 +4338,43 @@ var DeeplineClient = (_class = class _DeeplineClient {
4209
4338
  );
4210
4339
  }
4211
4340
  if (submitted) {
4212
- if (!_optionalChain([options, 'optionalAccess', _201 => _201.callerIntentV2])) {
4213
- await _chunkCQDQNZGHjs.preparePlayRunAdmission.call(void 0,
4341
+ if (!_optionalChain([options, 'optionalAccess', _211 => _211.callerIntentV2])) {
4342
+ await _chunkSL6MYJYMjs.preparePlayRunAdmission.call(void 0,
4214
4343
  http,
4215
4344
  JSON.parse(bodyJson),
4216
4345
  void 0,
4217
- { signal: _optionalChain([streamOptions, 'optionalAccess', _202 => _202.signal]) }
4346
+ { signal: _optionalChain([streamOptions, 'optionalAccess', _212 => _212.signal]) }
4218
4347
  );
4219
4348
  }
4220
4349
  }
4221
4350
  submitted = true;
4222
- const streamPath = _optionalChain([options, 'optionalAccess', _203 => _203.callerIntentV2]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _204 => _204.cliAdmission]) ? _chunkCQDQNZGHjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkCQDQNZGHjs.PLAY_RUN_START_STREAM_PATH;
4351
+ const streamPath = _optionalChain([options, 'optionalAccess', _213 => _213.callerIntentV2]) ? _chunkSL6MYJYMjs.CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH : _optionalChain([options, 'optionalAccess', _214 => _214.cliAdmission]) ? _chunkSL6MYJYMjs.CLI_PLAY_RUN_START_STREAM_PATH : _chunkSL6MYJYMjs.PLAY_RUN_START_STREAM_PATH;
4223
4352
  let cliAdmissionSupported = false;
4224
4353
  try {
4225
4354
  for await (const event of http.streamSse(streamPath, {
4226
4355
  method: "POST",
4227
4356
  body: JSON.parse(bodyJson),
4228
4357
  headers,
4229
- signal: _optionalChain([streamOptions, 'optionalAccess', _205 => _205.signal]),
4358
+ signal: _optionalChain([streamOptions, 'optionalAccess', _215 => _215.signal]),
4230
4359
  exactUrlOnly: true,
4231
- ..._optionalChain([options, 'optionalAccess', _206 => _206.cliAdmission]) ? {
4360
+ ..._optionalChain([options, 'optionalAccess', _216 => _216.cliAdmission]) ? {
4232
4361
  onResponse: (response) => {
4233
- cliAdmissionSupported = response.headers.get(_chunkCQDQNZGHjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4362
+ cliAdmissionSupported = response.headers.get(_chunkSL6MYJYMjs.CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
4234
4363
  }
4235
4364
  } : {}
4236
4365
  })) {
4237
4366
  if (event.scope === "play") yield event;
4238
4367
  }
4239
4368
  } catch (error) {
4240
- if (_optionalChain([options, 'optionalAccess', _207 => _207.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4369
+ if (_optionalChain([options, 'optionalAccess', _217 => _217.cliAdmission]) && !cliAdmissionSupported && error instanceof _chunkBBTKAASQjs.DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
4241
4370
  if (options.callerIntentV2) {
4242
4371
  submitted = false;
4243
- throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
4372
+ throw new (0, _chunkSL6MYJYMjs.CliPlayAdmissionCallerIntentV2UnsupportedError)(
4244
4373
  error.statusCode
4245
4374
  );
4246
4375
  }
4247
4376
  submitted = false;
4248
- throw new (0, _chunkCQDQNZGHjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4377
+ throw new (0, _chunkSL6MYJYMjs.CliPlayAdmissionUnsupportedError)(error.statusCode);
4249
4378
  }
4250
4379
  throw error;
4251
4380
  }
@@ -4258,7 +4387,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4258
4387
  * @internal
4259
4388
  */
4260
4389
  async prefetchPlayRunAdmissionCapability(options) {
4261
- return _chunkCQDQNZGHjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
4390
+ return _chunkSL6MYJYMjs.readPlayRunAdmissionCapability.call(void 0, this.http, options);
4262
4391
  }
4263
4392
  /**
4264
4393
  * Submit a play run through the legacy event response.
@@ -4275,7 +4404,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4275
4404
  */
4276
4405
  async *startPlayRunStream(request, options) {
4277
4406
  const prepared = await this.preparePlayRunAdmission(request, options);
4278
- yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _208 => _208.signal]) });
4407
+ yield* prepared.startStream({ signal: _optionalChain([options, 'optionalAccess', _218 => _218.signal]) });
4279
4408
  }
4280
4409
  /**
4281
4410
  * Register a bundled play artifact.
@@ -4428,7 +4557,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4428
4557
  compilerManifest,
4429
4558
  ...input.input ? { input: input.input } : {},
4430
4559
  ...input.inputFile ? { inputFile: input.inputFile } : {},
4431
- ..._optionalChain([input, 'access', _209 => _209.packagedFiles, 'optionalAccess', _210 => _210.length]) ? { packagedFiles: input.packagedFiles } : {},
4560
+ ..._optionalChain([input, 'access', _219 => _219.packagedFiles, 'optionalAccess', _220 => _220.length]) ? { packagedFiles: input.packagedFiles } : {},
4432
4561
  ...input.force ? { force: true } : {},
4433
4562
  ...input.forceToolRefresh ? { forceToolRefresh: true } : {}
4434
4563
  });
@@ -4458,29 +4587,29 @@ var DeeplineClient = (_class = class _DeeplineClient {
4458
4587
  * ```
4459
4588
  */
4460
4589
  async submitPlay(code, csvPath, name, options) {
4461
- const runtimeInput = _optionalChain([options, 'optionalAccess', _211 => _211.input]) ? { ...options.input } : {};
4590
+ const runtimeInput = _optionalChain([options, 'optionalAccess', _221 => _221.input]) ? { ...options.input } : {};
4462
4591
  if (csvPath) {
4463
4592
  runtimeInput.file = csvPath;
4464
4593
  }
4465
- const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _212 => _212.sourceCode]), () => ( code));
4466
- const artifact = _optionalChain([options, 'optionalAccess', _213 => _213.artifact]);
4467
- if (!_optionalChain([name, 'optionalAccess', _214 => _214.trim, 'call', _215 => _215()])) {
4594
+ const sourceCode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _222 => _222.sourceCode]), () => ( code));
4595
+ const artifact = _optionalChain([options, 'optionalAccess', _223 => _223.artifact]);
4596
+ if (!_optionalChain([name, 'optionalAccess', _224 => _224.trim, 'call', _225 => _225()])) {
4468
4597
  throw new Error("submitPlay requires a play name.");
4469
4598
  }
4470
4599
  if (!artifact) {
4471
4600
  throw new Error("submitPlay requires a bundled play artifact.");
4472
4601
  }
4473
- const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _216 => _216.compilerManifest]), async () => ( await this.compilePlayManifest({
4602
+ const compilerManifest = await _asyncNullishCoalesce(await _asyncOptionalChain([options, 'optionalAccess', async _226 => _226.compilerManifest]), async () => ( await this.compilePlayManifest({
4474
4603
  name,
4475
4604
  sourceCode,
4476
- sourceFiles: _optionalChain([options, 'optionalAccess', _217 => _217.sourceFiles]),
4605
+ sourceFiles: _optionalChain([options, 'optionalAccess', _227 => _227.sourceFiles]),
4477
4606
  artifact
4478
4607
  })));
4479
4608
  const registeredArtifact = await this.registerPlayArtifact({
4480
4609
  name,
4481
4610
  sourceCode,
4482
- sourceFiles: _optionalChain([options, 'optionalAccess', _218 => _218.sourceFiles]),
4483
- description: _optionalChain([options, 'optionalAccess', _219 => _219.description]),
4611
+ sourceFiles: _optionalChain([options, 'optionalAccess', _228 => _228.sourceFiles]),
4612
+ description: _optionalChain([options, 'optionalAccess', _229 => _229.description]),
4484
4613
  artifact,
4485
4614
  compilerManifest,
4486
4615
  publish: false
@@ -4494,17 +4623,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
4494
4623
  name,
4495
4624
  artifactStorageKey: registeredArtifact.artifactStorageKey,
4496
4625
  sourceCode,
4497
- description: _optionalChain([options, 'optionalAccess', _220 => _220.description]),
4626
+ description: _optionalChain([options, 'optionalAccess', _230 => _230.description]),
4498
4627
  staticPipeline: _nullishCoalesce(registeredArtifact.staticPipeline, () => ( null)),
4499
4628
  artifactHash: typeof artifact.artifactHash === "string" ? artifact.artifactHash : void 0,
4500
4629
  graphHash: typeof artifact.graphHash === "string" ? artifact.graphHash : void 0,
4501
4630
  runtimeArtifact: artifact,
4502
4631
  compilerManifest,
4503
4632
  ...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
4504
- ..._optionalChain([options, 'optionalAccess', _221 => _221.inputFile]) ? { inputFile: options.inputFile } : {},
4505
- ..._optionalChain([options, 'optionalAccess', _222 => _222.packagedFiles, 'optionalAccess', _223 => _223.length]) ? { packagedFiles: options.packagedFiles } : {},
4506
- ..._optionalChain([options, 'optionalAccess', _224 => _224.force]) ? { force: true } : {},
4507
- ..._optionalChain([options, 'optionalAccess', _225 => _225.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4633
+ ..._optionalChain([options, 'optionalAccess', _231 => _231.inputFile]) ? { inputFile: options.inputFile } : {},
4634
+ ..._optionalChain([options, 'optionalAccess', _232 => _232.packagedFiles, 'optionalAccess', _233 => _233.length]) ? { packagedFiles: options.packagedFiles } : {},
4635
+ ..._optionalChain([options, 'optionalAccess', _234 => _234.force]) ? { force: true } : {},
4636
+ ..._optionalChain([options, 'optionalAccess', _235 => _235.forceToolRefresh]) ? { forceToolRefresh: true } : {}
4508
4637
  });
4509
4638
  }
4510
4639
  /**
@@ -4532,7 +4661,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4532
4661
  * ```
4533
4662
  */
4534
4663
  async stagePlayFiles(files) {
4535
- return _chunkCQDQNZGHjs.stagePlayFiles.call(void 0, this.http, files);
4664
+ return _chunkSL6MYJYMjs.stagePlayFiles.call(void 0, this.http, files);
4536
4665
  }
4537
4666
  /**
4538
4667
  * Mint short-lived presigned upload targets for staged play files.
@@ -4541,7 +4670,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4541
4670
  * For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
4542
4671
  */
4543
4672
  async mintStagedPlayFileUploads(files) {
4544
- return _chunkCQDQNZGHjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4673
+ return _chunkSL6MYJYMjs.mintStagedPlayFileUploads.call(void 0, this.http, files);
4545
4674
  }
4546
4675
  /**
4547
4676
  * Resolve staged play files by content hash without uploading bytes.
@@ -4580,13 +4709,13 @@ var DeeplineClient = (_class = class _DeeplineClient {
4580
4709
  for await (const event of watchRunEvents({
4581
4710
  http: this.http,
4582
4711
  runId: workflowId,
4583
- signal: _optionalChain([options, 'optionalAccess', _226 => _226.signal]),
4584
- onNotice: _optionalChain([options, 'optionalAccess', _227 => _227.onNotice]),
4585
- onRetry: _optionalChain([options, 'optionalAccess', _228 => _228.onRetry]),
4586
- deferLogs: _optionalChain([options, 'optionalAccess', _229 => _229.deferLogs]),
4587
- omitTerminalLogs: _optionalChain([options, 'optionalAccess', _230 => _230.omitTerminalLogs]),
4588
- onPoll: _optionalChain([options, 'optionalAccess', _231 => _231.onPoll]),
4589
- ..._optionalChain([options, 'optionalAccess', _232 => _232.terminalStatus]) ? {
4712
+ signal: _optionalChain([options, 'optionalAccess', _236 => _236.signal]),
4713
+ onNotice: _optionalChain([options, 'optionalAccess', _237 => _237.onNotice]),
4714
+ onRetry: _optionalChain([options, 'optionalAccess', _238 => _238.onRetry]),
4715
+ deferLogs: _optionalChain([options, 'optionalAccess', _239 => _239.deferLogs]),
4716
+ omitTerminalLogs: _optionalChain([options, 'optionalAccess', _240 => _240.omitTerminalLogs]),
4717
+ onPoll: _optionalChain([options, 'optionalAccess', _241 => _241.onPoll]),
4718
+ ..._optionalChain([options, 'optionalAccess', _242 => _242.terminalStatus]) ? {
4590
4719
  terminalStatus: {
4591
4720
  ...options.terminalStatus,
4592
4721
  onStatus: async (raw, expectedStatus) => {
@@ -4596,7 +4725,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4596
4725
  `Run watch returned a mismatched terminal status for ${workflowId}.`
4597
4726
  );
4598
4727
  }
4599
- await _optionalChain([options, 'access', _233 => _233.terminalStatus, 'optionalAccess', _234 => _234.onStatus, 'call', _235 => _235(status)]);
4728
+ await _optionalChain([options, 'access', _243 => _243.terminalStatus, 'optionalAccess', _244 => _244.onStatus, 'call', _245 => _245(status)]);
4600
4729
  }
4601
4730
  }
4602
4731
  } : {}
@@ -4611,12 +4740,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
4611
4740
  * @deprecated Use `watchRunEvents` for ordinary run watching.
4612
4741
  */
4613
4742
  async *streamPlayRunEvents(workflowId, options) {
4614
- const headers = _optionalChain([options, 'optionalAccess', _236 => _236.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4743
+ const headers = _optionalChain([options, 'optionalAccess', _246 => _246.lastEventId]) && options.lastEventId.trim() ? { "Last-Event-ID": options.lastEventId.trim() } : void 0;
4615
4744
  const params = new URLSearchParams();
4616
- params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _237 => _237.mode]), () => ( "cli")));
4745
+ params.set("mode", _nullishCoalesce(_optionalChain([options, 'optionalAccess', _247 => _247.mode]), () => ( "cli")));
4617
4746
  for await (const event of this.http.streamSse(
4618
4747
  `/api/v2/runs/${encodeURIComponent(workflowId)}/tail?${params.toString()}`,
4619
- { signal: _optionalChain([options, 'optionalAccess', _238 => _238.signal]), headers }
4748
+ { signal: _optionalChain([options, 'optionalAccess', _248 => _248.signal]), headers }
4620
4749
  )) {
4621
4750
  if (event.scope === "play") {
4622
4751
  yield event;
@@ -4632,8 +4761,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
4632
4761
  */
4633
4762
  async *observeRunEvents(runId, options) {
4634
4763
  yield* this.watchRunEvents(runId, {
4635
- signal: _optionalChain([options, 'optionalAccess', _239 => _239.signal]),
4636
- onNotice: _optionalChain([options, 'optionalAccess', _240 => _240.onNotice])
4764
+ signal: _optionalChain([options, 'optionalAccess', _249 => _249.signal]),
4765
+ onNotice: _optionalChain([options, 'optionalAccess', _250 => _250.onNotice])
4637
4766
  });
4638
4767
  }
4639
4768
  /** Poll snapshots to terminal status and return the durable package. */
@@ -4641,9 +4770,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
4641
4770
  let terminalObserved = false;
4642
4771
  let terminalStatus = null;
4643
4772
  for await (const event of this.watchRunEvents(runId, {
4644
- signal: _optionalChain([options, 'optionalAccess', _241 => _241.signal]),
4645
- onNotice: _optionalChain([options, 'optionalAccess', _242 => _242.onNotice]),
4646
- onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _243 => _243.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _244 => _244.onReconnect]))),
4773
+ signal: _optionalChain([options, 'optionalAccess', _251 => _251.signal]),
4774
+ onNotice: _optionalChain([options, 'optionalAccess', _252 => _252.onNotice]),
4775
+ onRetry: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _253 => _253.onRetry]), () => ( _optionalChain([options, 'optionalAccess', _254 => _254.onReconnect]))),
4647
4776
  terminalStatus: {
4648
4777
  runStatus: true,
4649
4778
  onStatus: (status) => {
@@ -4651,16 +4780,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4651
4780
  }
4652
4781
  }
4653
4782
  })) {
4654
- _optionalChain([options, 'optionalAccess', _245 => _245.onEvent, 'optionalCall', _246 => _246(event)]);
4655
- if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4783
+ _optionalChain([options, 'optionalAccess', _255 => _255.onEvent, 'optionalCall', _256 => _256(event)]);
4784
+ if (_chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, playLiveRunStatus(event))) {
4656
4785
  terminalObserved = true;
4657
4786
  }
4658
4787
  }
4659
- if (_optionalChain([options, 'optionalAccess', _247 => _247.signal, 'optionalAccess', _248 => _248.aborted])) {
4788
+ if (_optionalChain([options, 'optionalAccess', _257 => _257.signal, 'optionalAccess', _258 => _258.aborted])) {
4660
4789
  throw new (0, _chunkBBTKAASQjs.DeeplineError)("Run watch aborted.", void 0, "ABORTED");
4661
4790
  }
4662
4791
  const refreshed = await _asyncNullishCoalesce(terminalStatus, async () => ( await this.getRunStatus(runId)));
4663
- if (terminalObserved || _chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4792
+ if (terminalObserved || _chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, refreshed.status)) {
4664
4793
  return refreshed;
4665
4794
  }
4666
4795
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
@@ -4736,7 +4865,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4736
4865
  /** List the org's workflows. `GET /api/v2/workflows`. */
4737
4866
  async listWorkflows(options) {
4738
4867
  const params = new URLSearchParams();
4739
- if (typeof _optionalChain([options, 'optionalAccess', _249 => _249.limit]) === "number") {
4868
+ if (typeof _optionalChain([options, 'optionalAccess', _259 => _259.limit]) === "number") {
4740
4869
  params.set("limit", String(options.limit));
4741
4870
  }
4742
4871
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4789,7 +4918,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4789
4918
  /** List a workflow's runs. `GET /api/v2/workflows/:id/runs`. */
4790
4919
  async listWorkflowRuns(id, options) {
4791
4920
  const params = new URLSearchParams();
4792
- if (typeof _optionalChain([options, 'optionalAccess', _250 => _250.limit]) === "number") {
4921
+ if (typeof _optionalChain([options, 'optionalAccess', _260 => _260.limit]) === "number") {
4793
4922
  params.set("limit", String(options.limit));
4794
4923
  }
4795
4924
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4825,16 +4954,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4825
4954
  */
4826
4955
  async getRunStatus(runId, options) {
4827
4956
  const params = new URLSearchParams();
4828
- if (_optionalChain([options, 'optionalAccess', _251 => _251.full]) === true) {
4957
+ if (_optionalChain([options, 'optionalAccess', _261 => _261.full]) === true) {
4829
4958
  params.set("full", "true");
4830
4959
  }
4831
- if (_optionalChain([options, 'optionalAccess', _252 => _252.configuration]) === true) {
4960
+ if (_optionalChain([options, 'optionalAccess', _262 => _262.configuration]) === true) {
4832
4961
  params.append("include", "configuration");
4833
4962
  }
4834
- if (_optionalChain([options, 'optionalAccess', _253 => _253.performance]) === true) {
4963
+ if (_optionalChain([options, 'optionalAccess', _263 => _263.performance]) === true) {
4835
4964
  params.append("include", "performance");
4836
4965
  }
4837
- if (_optionalChain([options, 'optionalAccess', _254 => _254.retries]) === true) {
4966
+ if (_optionalChain([options, 'optionalAccess', _264 => _264.retries]) === true) {
4838
4967
  params.append("include", "retries");
4839
4968
  }
4840
4969
  const query = params.size > 0 ? `?${params.toString()}` : "";
@@ -4842,7 +4971,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4842
4971
  `/api/v2/runs/${encodeURIComponent(runId)}${query}`,
4843
4972
  { headers: { "x-deepline-run-status": "1" } }
4844
4973
  );
4845
- if (_optionalChain([options, 'optionalAccess', _255 => _255.configuration]) === true && !Object.hasOwn(response, "contract")) {
4974
+ if (_optionalChain([options, 'optionalAccess', _265 => _265.configuration]) === true && !Object.hasOwn(response, "contract")) {
4846
4975
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
4847
4976
  "This server does not support recorded configuration reads.",
4848
4977
  void 0,
@@ -4850,7 +4979,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4850
4979
  );
4851
4980
  }
4852
4981
  const status = normalizePlayStatus(response);
4853
- if (_optionalChain([options, 'optionalAccess', _256 => _256.failedLogs]) !== true || status.status !== "failed") {
4982
+ if (_optionalChain([options, 'optionalAccess', _266 => _266.failedLogs]) !== true || status.status !== "failed") {
4854
4983
  return status;
4855
4984
  }
4856
4985
  const requestedFailedLogLimit = typeof options.failedLogLimit === "number" && Number.isFinite(options.failedLogLimit) ? Math.max(1, Math.floor(options.failedLogLimit)) : RUNS_FAILED_LOG_LIMIT;
@@ -4939,7 +5068,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
4939
5068
  /** The same tenant-scoped run history searched by the dashboard and CLI. */
4940
5069
  async getRunsHistory(options = {}) {
4941
5070
  const params = new URLSearchParams();
4942
- const search = _optionalChain([options, 'access', _257 => _257.search, 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
5071
+ const search = _optionalChain([options, 'access', _267 => _267.search, 'optionalAccess', _268 => _268.trim, 'call', _269 => _269()]);
4943
5072
  if (search && search.length > 200) {
4944
5073
  throw new Error("Run search must be at most 200 characters.");
4945
5074
  }
@@ -4965,16 +5094,16 @@ var DeeplineClient = (_class = class _DeeplineClient {
4965
5094
  }
4966
5095
  /** Read one run page without discarding server pagination metadata. */
4967
5096
  async listRunsPage(options) {
4968
- const playName = _optionalChain([options, 'access', _260 => _260.play, 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
5097
+ const playName = _optionalChain([options, 'access', _270 => _270.play, 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]);
4969
5098
  const params = new URLSearchParams();
4970
5099
  if (playName) {
4971
5100
  params.set("play", playName);
4972
5101
  }
4973
- const status = _optionalChain([options, 'access', _263 => _263.status, 'optionalAccess', _264 => _264.trim, 'call', _265 => _265()]);
5102
+ const status = _optionalChain([options, 'access', _273 => _273.status, 'optionalAccess', _274 => _274.trim, 'call', _275 => _275()]);
4974
5103
  if (status) {
4975
5104
  params.set("status", status);
4976
5105
  }
4977
- const node = _optionalChain([options, 'access', _266 => _266.node, 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
5106
+ const node = _optionalChain([options, 'access', _276 => _276.node, 'optionalAccess', _277 => _277.trim, 'call', _278 => _278()]);
4978
5107
  if (node) {
4979
5108
  if (!playName)
4980
5109
  throw new Error("runs.list options.node requires options.play.");
@@ -5048,8 +5177,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5048
5177
  * A different key starts another rerun.
5049
5178
  */
5050
5179
  async rerun(runId, options) {
5051
- const idempotencyKey = _optionalChain([options, 'optionalAccess', _269 => _269.idempotencyKey, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]);
5052
- if (_optionalChain([options, 'optionalAccess', _272 => _272.idempotencyKey]) !== void 0 && !idempotencyKey) {
5180
+ const idempotencyKey = _optionalChain([options, 'optionalAccess', _279 => _279.idempotencyKey, 'optionalAccess', _280 => _280.trim, 'call', _281 => _281()]);
5181
+ if (_optionalChain([options, 'optionalAccess', _282 => _282.idempotencyKey]) !== void 0 && !idempotencyKey) {
5053
5182
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5054
5183
  "runs.rerun idempotencyKey must not be empty.",
5055
5184
  void 0,
@@ -5058,7 +5187,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5058
5187
  }
5059
5188
  return this.http.post(
5060
5189
  `/api/v2/runs/${encodeURIComponent(runId)}/rerun`,
5061
- _optionalChain([options, 'optionalAccess', _273 => _273.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5190
+ _optionalChain([options, 'optionalAccess', _283 => _283.inputOverrides]) ? { inputOverrides: options.inputOverrides } : {},
5062
5191
  { "Idempotency-Key": idempotencyKey || globalThis.crypto.randomUUID() }
5063
5192
  );
5064
5193
  }
@@ -5085,21 +5214,21 @@ var DeeplineClient = (_class = class _DeeplineClient {
5085
5214
  * ```
5086
5215
  */
5087
5216
  async getRunLogs(runId, options) {
5088
- if (_optionalChain([options, 'optionalAccess', _274 => _274.all]) === true && options.failed === true) {
5217
+ if (_optionalChain([options, 'optionalAccess', _284 => _284.all]) === true && options.failed === true) {
5089
5218
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5090
5219
  "runs.logs cannot combine all and failed views.",
5091
5220
  void 0,
5092
5221
  "INVALID_RUN_LOG_VIEW"
5093
5222
  );
5094
5223
  }
5095
- if (_optionalChain([options, 'optionalAccess', _275 => _275.cursor]) !== void 0 && options.failed === true) {
5224
+ if (_optionalChain([options, 'optionalAccess', _285 => _285.cursor]) !== void 0 && options.failed === true) {
5096
5225
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5097
5226
  "runs.logs cannot combine failed with cursor.",
5098
5227
  void 0,
5099
5228
  "INVALID_RUN_LOG_VIEW"
5100
5229
  );
5101
5230
  }
5102
- if (_optionalChain([options, 'optionalAccess', _276 => _276.failed]) === true) {
5231
+ if (_optionalChain([options, 'optionalAccess', _286 => _286.failed]) === true) {
5103
5232
  const requestedLimit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : RUNS_FAILED_LOG_LIMIT;
5104
5233
  const failedLimit = Math.min(RUNS_FAILED_LOG_LIMIT, requestedLimit);
5105
5234
  const page = await this.http.get(
@@ -5124,18 +5253,18 @@ var DeeplineClient = (_class = class _DeeplineClient {
5124
5253
  ...page.logsTruncated ? { logsTruncated: true } : {}
5125
5254
  };
5126
5255
  }
5127
- const beforeSequence = _optionalChain([options, 'optionalAccess', _277 => _277.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
5128
- const limit = _optionalChain([options, 'optionalAccess', _278 => _278.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _279 => _279.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
5256
+ const beforeSequence = _optionalChain([options, 'optionalAccess', _287 => _287.cursor]) !== void 0 ? parseRunLogsCursor(options.cursor) : null;
5257
+ const limit = _optionalChain([options, 'optionalAccess', _288 => _288.all]) ? Number.MAX_SAFE_INTEGER : typeof _optionalChain([options, 'optionalAccess', _289 => _289.limit]) === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.trunc(options.limit) : 200;
5129
5258
  const fetchPage = (afterSeq2, pageLimit) => this.http.get(
5130
5259
  `/api/v2/runs/${encodeURIComponent(runId)}/logs?afterSeq=${afterSeq2}&limit=${pageLimit}`,
5131
5260
  { retryApiErrors: true }
5132
5261
  );
5133
5262
  const probe = await fetchPage(0, 1);
5134
5263
  const lastStoredSeq = probe.lastStoredSeq;
5135
- const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _280 => _280.entries, 'access', _281 => _281[0], 'optionalAccess', _282 => _282.seq]), () => ( null));
5264
+ const oldestStoredSeq = _nullishCoalesce(_optionalChain([probe, 'access', _290 => _290.entries, 'access', _291 => _291[0], 'optionalAccess', _292 => _292.seq]), () => ( null));
5136
5265
  const upperSeq = beforeSequence === null ? lastStoredSeq : Math.min(beforeSequence - 1, lastStoredSeq);
5137
5266
  const windowEndSeq = Math.min(upperSeq, lastStoredSeq);
5138
- let afterSeq = _optionalChain([options, 'optionalAccess', _283 => _283.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5267
+ let afterSeq = _optionalChain([options, 'optionalAccess', _293 => _293.all]) ? 0 : Math.max(0, windowEndSeq - limit);
5139
5268
  const entries = [];
5140
5269
  while (entries.length < limit && afterSeq < upperSeq) {
5141
5270
  const page = await fetchPage(
@@ -5169,7 +5298,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5169
5298
  hasMore: olderLinesExist,
5170
5299
  nextCursor: olderLinesExist ? encodeRunLogsCursor(firstSequence) : null,
5171
5300
  entries: entries.map((entry) => entry.line),
5172
- view: _optionalChain([options, 'optionalAccess', _284 => _284.all]) ? "all" : "tail",
5301
+ view: _optionalChain([options, 'optionalAccess', _294 => _294.all]) ? "all" : "tail",
5173
5302
  ...probe.logsTruncated ? { logsTruncated: true } : {}
5174
5303
  };
5175
5304
  }
@@ -5345,7 +5474,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5345
5474
  limit: String(_nullishCoalesce(input.limit, () => ( 5e3))),
5346
5475
  offset: String(_nullishCoalesce(input.offset, () => ( 0)))
5347
5476
  });
5348
- if (_optionalChain([input, 'access', _285 => _285.runId, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()])) {
5477
+ if (_optionalChain([input, 'access', _295 => _295.runId, 'optionalAccess', _296 => _296.trim, 'call', _297 => _297()])) {
5349
5478
  params.set("runId", input.runId.trim());
5350
5479
  }
5351
5480
  if (input.rowMode === "all" || input.rowMode === "live") {
@@ -5358,9 +5487,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
5358
5487
  `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
5359
5488
  { signal: input.signal }
5360
5489
  );
5361
- const requestedRunId = _optionalChain([input, 'access', _288 => _288.runId, 'optionalAccess', _289 => _289.trim, 'call', _290 => _290()]) || "";
5490
+ const requestedRunId = _optionalChain([input, 'access', _298 => _298.runId, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()]) || "";
5362
5491
  if (requestedRunId) {
5363
- const confirmedRunId = _optionalChain([result, 'access', _291 => _291.scope, 'optionalAccess', _292 => _292.kind]) === "run" ? result.scope.runId.trim() : "";
5492
+ const confirmedRunId = _optionalChain([result, 'access', _301 => _301.scope, 'optionalAccess', _302 => _302.kind]) === "run" ? result.scope.runId.trim() : "";
5364
5493
  const foreignRowRunIds = [
5365
5494
  ...new Set(
5366
5495
  result.rows.map(
@@ -5368,7 +5497,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5368
5497
  ).filter((runId) => runId && runId !== requestedRunId)
5369
5498
  )
5370
5499
  ];
5371
- if (_optionalChain([result, 'access', _293 => _293.scope, 'optionalAccess', _294 => _294.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5500
+ if (_optionalChain([result, 'access', _303 => _303.scope, 'optionalAccess', _304 => _304.kind]) !== "run" || confirmedRunId !== requestedRunId || foreignRowRunIds.length > 0) {
5372
5501
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
5373
5502
  `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.`,
5374
5503
  void 0,
@@ -5397,7 +5526,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5397
5526
  async stopRun(runId, options) {
5398
5527
  return this.http.post(
5399
5528
  `/api/v2/runs/${encodeURIComponent(runId)}/stop`,
5400
- _optionalChain([options, 'optionalAccess', _295 => _295.reason]) ? { reason: options.reason } : {}
5529
+ _optionalChain([options, 'optionalAccess', _305 => _305.reason]) ? { reason: options.reason } : {}
5401
5530
  );
5402
5531
  }
5403
5532
  /**
@@ -5415,11 +5544,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
5415
5544
  * The method clears workspace run-slot state without requiring each run ID.
5416
5545
  */
5417
5546
  async stopAllRuns(options) {
5418
- const dryRun = _optionalChain([options, 'optionalAccess', _296 => _296.dryRun]) === true;
5547
+ const dryRun = _optionalChain([options, 'optionalAccess', _306 => _306.dryRun]) === true;
5419
5548
  const result = await this.http.post(
5420
5549
  "/api/v2/runs/stop-all",
5421
5550
  {
5422
- ..._optionalChain([options, 'optionalAccess', _297 => _297.reason]) ? { reason: options.reason } : {},
5551
+ ..._optionalChain([options, 'optionalAccess', _307 => _307.reason]) ? { reason: options.reason } : {},
5423
5552
  ...dryRun ? { dryRun: true } : {}
5424
5553
  }
5425
5554
  );
@@ -5440,7 +5569,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5440
5569
  * `origin: "owned"` for org-owned plays.
5441
5570
  */
5442
5571
  async listPlays(options) {
5443
- if (!_optionalChain([options, 'optionalAccess', _298 => _298.grep, 'optionalAccess', _299 => _299.trim, 'call', _300 => _300()])) {
5572
+ if (!_optionalChain([options, 'optionalAccess', _308 => _308.grep, 'optionalAccess', _309 => _309.trim, 'call', _310 => _310()])) {
5444
5573
  return (await this.requestPlaysPage(options, false)).plays;
5445
5574
  }
5446
5575
  const plays = [];
@@ -5462,46 +5591,46 @@ var DeeplineClient = (_class = class _DeeplineClient {
5462
5591
  }
5463
5592
  async requestPlaysPage(options, paginateInventory = true) {
5464
5593
  const params = new URLSearchParams();
5465
- if (paginateInventory && !_optionalChain([options, 'optionalAccess', _301 => _301.grep, 'optionalAccess', _302 => _302.trim, 'call', _303 => _303()]))
5594
+ if (paginateInventory && !_optionalChain([options, 'optionalAccess', _311 => _311.grep, 'optionalAccess', _312 => _312.trim, 'call', _313 => _313()]))
5466
5595
  params.set("inventory_paginated", "1");
5467
- if (_optionalChain([options, 'optionalAccess', _304 => _304.origin])) params.set("origin", options.origin);
5468
- if (_optionalChain([options, 'optionalAccess', _305 => _305.summaryOnly])) params.set("summary_only", "1");
5469
- if (_optionalChain([options, 'optionalAccess', _306 => _306.categories])) {
5596
+ if (_optionalChain([options, 'optionalAccess', _314 => _314.origin])) params.set("origin", options.origin);
5597
+ if (_optionalChain([options, 'optionalAccess', _315 => _315.summaryOnly])) params.set("summary_only", "1");
5598
+ if (_optionalChain([options, 'optionalAccess', _316 => _316.categories])) {
5470
5599
  params.set(
5471
5600
  "categories",
5472
5601
  Array.isArray(options.categories) ? options.categories.join(",") : options.categories
5473
5602
  );
5474
5603
  }
5475
- if (_optionalChain([options, 'optionalAccess', _307 => _307.categories]) || _optionalChain([options, 'optionalAccess', _308 => _308.includeToolCategories])) {
5604
+ if (_optionalChain([options, 'optionalAccess', _317 => _317.categories]) || _optionalChain([options, 'optionalAccess', _318 => _318.includeToolCategories])) {
5476
5605
  params.set("include_tool_categories", "1");
5477
5606
  }
5478
- if (_optionalChain([options, 'optionalAccess', _309 => _309.tags])) {
5607
+ if (_optionalChain([options, 'optionalAccess', _319 => _319.tags])) {
5479
5608
  params.set(
5480
5609
  "tags",
5481
5610
  Array.isArray(options.tags) ? options.tags.join(",") : options.tags
5482
5611
  );
5483
5612
  }
5484
- if (_optionalChain([options, 'optionalAccess', _310 => _310.includeArchived])) params.set("include_archived", "1");
5485
- if (_optionalChain([options, 'optionalAccess', _311 => _311.includeCostEstimates])) {
5613
+ if (_optionalChain([options, 'optionalAccess', _320 => _320.includeArchived])) params.set("include_archived", "1");
5614
+ if (_optionalChain([options, 'optionalAccess', _321 => _321.includeCostEstimates])) {
5486
5615
  params.set("include_cost_estimates", "1");
5487
5616
  }
5488
- if (_optionalChain([options, 'optionalAccess', _312 => _312.grep, 'optionalAccess', _313 => _313.trim, 'call', _314 => _314()])) {
5617
+ if (_optionalChain([options, 'optionalAccess', _322 => _322.grep, 'optionalAccess', _323 => _323.trim, 'call', _324 => _324()])) {
5489
5618
  params.set("grep", options.grep.trim());
5490
5619
  params.set("limit", "60");
5491
5620
  }
5492
- if (_optionalChain([options, 'optionalAccess', _315 => _315.limit]) !== void 0) {
5621
+ if (_optionalChain([options, 'optionalAccess', _325 => _325.limit]) !== void 0) {
5493
5622
  if (!Number.isSafeInteger(options.limit) || options.limit < 1) {
5494
5623
  throw new Error("Play page limit must be a positive integer");
5495
5624
  }
5496
5625
  params.set("limit", String(options.limit));
5497
5626
  }
5498
- if (_optionalChain([options, 'optionalAccess', _316 => _316.cursor])) params.set("cursor", options.cursor);
5627
+ if (_optionalChain([options, 'optionalAccess', _326 => _326.cursor])) params.set("cursor", options.cursor);
5499
5628
  const suffix = params.size ? `?${params.toString()}` : "";
5500
5629
  const response = await this.http.get(`/api/v2/plays${suffix}`);
5501
5630
  return {
5502
5631
  plays: _nullishCoalesce(response.plays, () => ( [])),
5503
- cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _317 => _317.pagination, 'optionalAccess', _318 => _318.cursor]), () => ( response.cursor)), () => ( null)),
5504
- hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _319 => _319.pagination, 'optionalAccess', _320 => _320.hasMore]), () => ( response.hasMore)))
5632
+ cursor: _nullishCoalesce(_nullishCoalesce(_optionalChain([response, 'access', _327 => _327.pagination, 'optionalAccess', _328 => _328.cursor]), () => ( response.cursor)), () => ( null)),
5633
+ hasMore: Boolean(_nullishCoalesce(_optionalChain([response, 'access', _329 => _329.pagination, 'optionalAccess', _330 => _330.hasMore]), () => ( response.hasMore)))
5505
5634
  };
5506
5635
  }
5507
5636
  /** Read definition-level settings, independently of code revisions. */
@@ -5571,6 +5700,25 @@ var DeeplineClient = (_class = class _DeeplineClient {
5571
5700
  async listWorkspaceIntegrationConnections() {
5572
5701
  return this.http.get("/api/v2/integrations/connections");
5573
5702
  }
5703
+ async listWorkspaceConnectionInventory(provider, options) {
5704
+ const params = new URLSearchParams({
5705
+ view: _optionalChain([options, 'optionalAccess', _331 => _331.authorizationsOnly]) ? "authorizations" : "inventory"
5706
+ });
5707
+ if (provider) params.set("provider", provider);
5708
+ return this.http.get(`/api/v2/integrations/connections?${params}`);
5709
+ }
5710
+ async saveWorkspaceApiKeyConnection(input) {
5711
+ return this.http.post("/api/v2/integrations/connections", {
5712
+ ...input,
5713
+ owner: "workspace",
5714
+ type: "api_key"
5715
+ });
5716
+ }
5717
+ async listManagedConnectionMembers(provider, cursor) {
5718
+ const params = new URLSearchParams({ view: "members", provider });
5719
+ if (cursor) params.set("cursor", cursor);
5720
+ return this.http.get(`/api/v2/integrations/connections?${params}`);
5721
+ }
5574
5722
  /** List workspace members' personal HubSpot connection status as an admin. */
5575
5723
  async listPersonalHubSpotMembers(cursor) {
5576
5724
  const path = "/api/v2/integrations/connections/hubspot-members";
@@ -5578,6 +5726,27 @@ var DeeplineClient = (_class = class _DeeplineClient {
5578
5726
  cursor ? `${path}?${new URLSearchParams({ cursor })}` : path
5579
5727
  );
5580
5728
  }
5729
+ /** Read the Google Workspace delegate grant and a page of selectable members. */
5730
+ async getCalendarDelegation(cursor, name, domain) {
5731
+ const path = "/api/v2/integrations/calendar-availability/delegation";
5732
+ const params = new URLSearchParams();
5733
+ if (cursor) params.set("cursor", cursor);
5734
+ if (name) params.set("name", name);
5735
+ if (domain) params.set("domain", domain);
5736
+ return this.http.get(params.size ? `${path}?${params}` : path);
5737
+ }
5738
+ async listCalendarAvailabilityConnections() {
5739
+ return this.http.get(
5740
+ "/api/v2/integrations/calendar-availability/delegation?view=inventory"
5741
+ );
5742
+ }
5743
+ /** Verify, disconnect, or remove a Workspace approval. Legacy roster inputs remain supported. */
5744
+ async changeCalendarDelegation(change) {
5745
+ return this.http.post(
5746
+ "/api/v2/integrations/calendar-availability/delegation",
5747
+ change
5748
+ );
5749
+ }
5581
5750
  /** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
5582
5751
  async manageWorkspaceIntegrationConnection(input) {
5583
5752
  return this.http.post("/api/v2/integrations/connections", {
@@ -5595,7 +5764,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5595
5764
  return this.http.post("/api/v2/integrations/connect", {
5596
5765
  provider,
5597
5766
  credentials,
5598
- ..._optionalChain([options, 'optionalAccess', _321 => _321.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5767
+ ..._optionalChain([options, 'optionalAccess', _332 => _332.expectedConnectionId]) ? { expected_connection_id: options.expectedConnectionId } : {}
5599
5768
  });
5600
5769
  }
5601
5770
  /** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
@@ -5608,7 +5777,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5608
5777
  }
5609
5778
  /** Start provider OAuth and return the URL to open in a browser. */
5610
5779
  async startIntegrationOAuth(provider, options = {}) {
5611
- const scopes = _optionalChain([options, 'access', _322 => _322.scopes, 'optionalAccess', _323 => _323.map, 'call', _324 => _324((scope) => scope.trim()), 'access', _325 => _325.filter, 'call', _326 => _326(Boolean)]);
5780
+ const scopes = _optionalChain([options, 'access', _333 => _333.scopes, 'optionalAccess', _334 => _334.map, 'call', _335 => _335((scope) => scope.trim()), 'access', _336 => _336.filter, 'call', _337 => _337(Boolean)]);
5612
5781
  if (scopes !== void 0 && scopes.length === 0) {
5613
5782
  throw new Error("scopes must contain at least one OAuth scope.");
5614
5783
  }
@@ -5624,8 +5793,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
5624
5793
  return this.http.post("/api/v2/integrations/connect", {
5625
5794
  provider: "slack",
5626
5795
  scopes: [...PRODUCT_NOTIFICATION_SLACK_OAUTH_SCOPES],
5627
- ..._optionalChain([options, 'optionalAccess', _327 => _327.successUrl]) ? { success_url: options.successUrl } : {},
5628
- ..._optionalChain([options, 'optionalAccess', _328 => _328.failureUrl]) ? { failure_url: options.failureUrl } : {}
5796
+ ..._optionalChain([options, 'optionalAccess', _338 => _338.successUrl]) ? { success_url: options.successUrl } : {},
5797
+ ..._optionalChain([options, 'optionalAccess', _339 => _339.failureUrl]) ? { failure_url: options.failureUrl } : {}
5629
5798
  });
5630
5799
  }
5631
5800
  /** List Slack channels visible to the connected Deepline Slack app. */
@@ -5700,7 +5869,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5700
5869
  }
5701
5870
  const targets = input.targets.map(parseNotificationGroupTarget);
5702
5871
  const legacyEvents = _nullishCoalesce(input.legacyEvents, () => ( []));
5703
- const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _329 => _329[0], 'optionalAccess', _330 => _330.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5872
+ const legacyTarget = targets.length === 1 && _optionalChain([targets, 'access', _340 => _340[0], 'optionalAccess', _341 => _341.kind]) === "slack" && legacyEvents.length > 0 ? targets[0] : null;
5704
5873
  if (legacyEvents.length > 0 && !legacyTarget) {
5705
5874
  throw new Error(
5706
5875
  "--for is supported only by the legacy one-Slack-target form. Create the group first, then add rules in notification configuration."
@@ -5736,7 +5905,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5736
5905
  const existingGroup = current.configuration.groups.find(
5737
5906
  (candidate) => candidate.name.toLowerCase() === name.toLowerCase()
5738
5907
  );
5739
- const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _331 => _331.groupKey]), () => ( notificationObjectKey("group")));
5908
+ const groupKey = _nullishCoalesce(_optionalChain([existingGroup, 'optionalAccess', _342 => _342.groupKey]), () => ( notificationObjectKey("group")));
5740
5909
  const group = _nullishCoalesce(existingGroup, () => ( {
5741
5910
  groupKey,
5742
5911
  name,
@@ -5964,7 +6133,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5964
6133
  /** Read one trigger inventory page without loading run histories. */
5965
6134
  async listPlayTriggerInventory(options) {
5966
6135
  const params = new URLSearchParams({ view: "inventory" });
5967
- if (_optionalChain([options, 'optionalAccess', _332 => _332.cursor])) params.set("cursor", options.cursor);
6136
+ if (_optionalChain([options, 'optionalAccess', _343 => _343.cursor])) params.set("cursor", options.cursor);
5968
6137
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5969
6138
  }
5970
6139
  /** Read one trigger's recent runs, with an explicit partial-history flag. */
@@ -5973,7 +6142,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
5973
6142
  view: "history",
5974
6143
  binding_id: bindingId
5975
6144
  });
5976
- if (_optionalChain([options, 'optionalAccess', _333 => _333.limit]) !== void 0)
6145
+ if (_optionalChain([options, 'optionalAccess', _344 => _344.limit]) !== void 0)
5977
6146
  params.set("history_limit", String(options.limit));
5978
6147
  return this.http.get(`/api/v2/plays/triggers?${params}`);
5979
6148
  }
@@ -6161,14 +6330,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6161
6330
  */
6162
6331
  async runPlay(code, csvPath, name, options) {
6163
6332
  const { workflowId } = await this.submitPlay(code, csvPath, name, {
6164
- input: _optionalChain([options, 'optionalAccess', _334 => _334.input]),
6165
- sourceCode: _optionalChain([options, 'optionalAccess', _335 => _335.sourceCode]),
6166
- artifact: _optionalChain([options, 'optionalAccess', _336 => _336.artifact]),
6167
- compilerManifest: _optionalChain([options, 'optionalAccess', _337 => _337.compilerManifest]),
6168
- inputFile: _optionalChain([options, 'optionalAccess', _338 => _338.inputFile]),
6169
- packagedFiles: _optionalChain([options, 'optionalAccess', _339 => _339.packagedFiles]),
6170
- force: _optionalChain([options, 'optionalAccess', _340 => _340.force]),
6171
- forceToolRefresh: _optionalChain([options, 'optionalAccess', _341 => _341.forceToolRefresh])
6333
+ input: _optionalChain([options, 'optionalAccess', _345 => _345.input]),
6334
+ sourceCode: _optionalChain([options, 'optionalAccess', _346 => _346.sourceCode]),
6335
+ artifact: _optionalChain([options, 'optionalAccess', _347 => _347.artifact]),
6336
+ compilerManifest: _optionalChain([options, 'optionalAccess', _348 => _348.compilerManifest]),
6337
+ inputFile: _optionalChain([options, 'optionalAccess', _349 => _349.inputFile]),
6338
+ packagedFiles: _optionalChain([options, 'optionalAccess', _350 => _350.packagedFiles]),
6339
+ force: _optionalChain([options, 'optionalAccess', _351 => _351.force]),
6340
+ forceToolRefresh: _optionalChain([options, 'optionalAccess', _352 => _352.forceToolRefresh])
6172
6341
  });
6173
6342
  const start = Date.now();
6174
6343
  const state = {
@@ -6179,7 +6348,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6179
6348
  latest: null
6180
6349
  };
6181
6350
  let terminalObserved = null;
6182
- if (_optionalChain([options, 'optionalAccess', _342 => _342.signal, 'optionalAccess', _343 => _343.aborted])) {
6351
+ if (_optionalChain([options, 'optionalAccess', _353 => _353.signal, 'optionalAccess', _354 => _354.aborted])) {
6183
6352
  await this.cancelPlay(workflowId);
6184
6353
  return {
6185
6354
  success: false,
@@ -6190,9 +6359,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
6190
6359
  };
6191
6360
  }
6192
6361
  for await (const event of this.watchRunEvents(workflowId, {
6193
- signal: _optionalChain([options, 'optionalAccess', _344 => _344.signal])
6362
+ signal: _optionalChain([options, 'optionalAccess', _355 => _355.signal])
6194
6363
  })) {
6195
- if (_optionalChain([options, 'optionalAccess', _345 => _345.signal, 'optionalAccess', _346 => _346.aborted])) {
6364
+ if (_optionalChain([options, 'optionalAccess', _356 => _356.signal, 'optionalAccess', _357 => _357.aborted])) {
6196
6365
  await this.cancelPlay(workflowId);
6197
6366
  return {
6198
6367
  success: false,
@@ -6202,19 +6371,19 @@ var DeeplineClient = (_class = class _DeeplineClient {
6202
6371
  error: "Cancelled by user"
6203
6372
  };
6204
6373
  }
6205
- const previousStatus = _optionalChain([state, 'access', _347 => _347.latest, 'optionalAccess', _348 => _348.status]);
6374
+ const previousStatus = _optionalChain([state, 'access', _358 => _358.latest, 'optionalAccess', _359 => _359.status]);
6206
6375
  const status = updatePlayLiveStatusState(state, event);
6207
6376
  if (!status) {
6208
6377
  continue;
6209
6378
  }
6210
6379
  if (event.type !== "play.run.status" || status.status !== previousStatus) {
6211
- _optionalChain([options, 'optionalAccess', _349 => _349.onProgress, 'optionalCall', _350 => _350(status)]);
6380
+ _optionalChain([options, 'optionalAccess', _360 => _360.onProgress, 'optionalCall', _361 => _361(status)]);
6212
6381
  }
6213
- if (_chunkCQDQNZGHjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
6382
+ if (_chunkSL6MYJYMjs.isTerminalPlayRunLifecycleStatus.call(void 0, status.status)) {
6214
6383
  terminalObserved = status;
6215
6384
  }
6216
6385
  }
6217
- if (_optionalChain([options, 'optionalAccess', _351 => _351.signal, 'optionalAccess', _352 => _352.aborted])) {
6386
+ if (_optionalChain([options, 'optionalAccess', _362 => _362.signal, 'optionalAccess', _363 => _363.aborted])) {
6218
6387
  await this.cancelPlay(workflowId);
6219
6388
  return {
6220
6389
  success: false,
@@ -6267,7 +6436,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6267
6436
  const response = await this.http.get(
6268
6437
  `/api/v2/usage/events?request_id=${encodeURIComponent(normalizedRequestId)}`
6269
6438
  );
6270
- const event = _optionalChain([response, 'access', _353 => _353.entries, 'optionalAccess', _354 => _354[0]]);
6439
+ const event = _optionalChain([response, 'access', _364 => _364.entries, 'optionalAccess', _365 => _365[0]]);
6271
6440
  if (!event) {
6272
6441
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6273
6442
  "No usage event was found for this request_id.",
@@ -6282,7 +6451,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6282
6451
  * charge or settlement oracle. Empty pages may still carry a continuation.
6283
6452
  */
6284
6453
  async getBillingUsageEvents(options = {}) {
6285
- const invalid = (message) => {
6454
+ const invalid2 = (message) => {
6286
6455
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6287
6456
  message,
6288
6457
  void 0,
@@ -6290,14 +6459,14 @@ var DeeplineClient = (_class = class _DeeplineClient {
6290
6459
  );
6291
6460
  };
6292
6461
  if ("offset" in options) {
6293
- invalid(
6462
+ invalid2(
6294
6463
  "Usage events do not support offset; use the preceding next_cursor."
6295
6464
  );
6296
6465
  }
6297
6466
  const params = new URLSearchParams();
6298
6467
  if (options.limit !== void 0) {
6299
6468
  if (!Number.isInteger(options.limit) || options.limit < 1 || options.limit > 500) {
6300
- invalid("Usage events limit must be an integer from 1 to 500.");
6469
+ invalid2("Usage events limit must be an integer from 1 to 500.");
6301
6470
  }
6302
6471
  params.set("limit", String(options.limit));
6303
6472
  }
@@ -6307,7 +6476,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6307
6476
  ]) {
6308
6477
  if (value !== void 0) {
6309
6478
  if (typeof value !== "string" || !value || value !== value.trim()) {
6310
- invalid(
6479
+ invalid2(
6311
6480
  `Usage events ${name} must be a non-empty string without surrounding whitespace.`
6312
6481
  );
6313
6482
  }
@@ -6442,7 +6611,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6442
6611
  async cancelBillingSubscription(options) {
6443
6612
  return this.http.post(
6444
6613
  "/api/v2/billing/subscription/cancel",
6445
- { action: _optionalChain([options, 'optionalAccess', _355 => _355.undo]) ? "undo_cancel" : "cancel" }
6614
+ { action: _optionalChain([options, 'optionalAccess', _366 => _366.undo]) ? "undo_cancel" : "cancel" }
6446
6615
  );
6447
6616
  }
6448
6617
  /**
@@ -6454,7 +6623,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6454
6623
  */
6455
6624
  async listBillingInvoices(options) {
6456
6625
  const params = new URLSearchParams();
6457
- if (_optionalChain([options, 'optionalAccess', _356 => _356.limit]) !== void 0) {
6626
+ if (_optionalChain([options, 'optionalAccess', _367 => _367.limit]) !== void 0) {
6458
6627
  params.set("limit", String(options.limit));
6459
6628
  }
6460
6629
  const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
@@ -6465,7 +6634,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6465
6634
  /** List the reviewed target plans and whether new acquisition is enabled. */
6466
6635
  async getTargetBillingPlans(options) {
6467
6636
  return this.http.get(
6468
- _optionalChain([options, 'optionalAccess', _357 => _357.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
6637
+ _optionalChain([options, 'optionalAccess', _368 => _368.promoCode]) ? `/api/v2/billing/plans?promo_code=${encodeURIComponent(options.promoCode)}` : "/api/v2/billing/plans"
6469
6638
  );
6470
6639
  }
6471
6640
  /** Read the workspace's normalized target plan, payment, and balance state. */
@@ -6567,7 +6736,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6567
6736
  /** Create a Stripe-hosted portal session for payment recovery and invoices. */
6568
6737
  async createTargetBillingPortalSession(options) {
6569
6738
  const response = await this.http.post(
6570
- _optionalChain([options, 'optionalAccess', _358 => _358.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6739
+ _optionalChain([options, 'optionalAccess', _369 => _369.flow]) === "customer_update" ? "/api/v2/billing/portal-sessions?flow=customer_update" : "/api/v2/billing/portal-sessions",
6571
6740
  {}
6572
6741
  );
6573
6742
  return response.data;
@@ -6617,8 +6786,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6617
6786
  return this.http.request("/api/v2/monitors/audit", {
6618
6787
  method: "POST",
6619
6788
  body: {
6620
- ..._optionalChain([options, 'optionalAccess', _359 => _359.fleetId]) ? { fleet_id: options.fleetId } : {},
6621
- ..._optionalChain([options, 'optionalAccess', _360 => _360.cursor]) ? { cursor: options.cursor } : {}
6789
+ ..._optionalChain([options, 'optionalAccess', _370 => _370.fleetId]) ? { fleet_id: options.fleetId } : {},
6790
+ ..._optionalChain([options, 'optionalAccess', _371 => _371.cursor]) ? { cursor: options.cursor } : {}
6622
6791
  },
6623
6792
  maxRetries: 0
6624
6793
  });
@@ -6628,8 +6797,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
6628
6797
  return this.http.request("/api/v2/monitors/repair", {
6629
6798
  method: "POST",
6630
6799
  body: {
6631
- ..._optionalChain([options, 'optionalAccess', _361 => _361.fleetId]) ? { fleet_id: options.fleetId } : {},
6632
- ..._optionalChain([options, 'optionalAccess', _362 => _362.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6800
+ ..._optionalChain([options, 'optionalAccess', _372 => _372.fleetId]) ? { fleet_id: options.fleetId } : {},
6801
+ ..._optionalChain([options, 'optionalAccess', _373 => _373.dryRun]) === void 0 ? {} : { dry_run: options.dryRun }
6633
6802
  },
6634
6803
  maxRetries: 0
6635
6804
  });
@@ -6637,7 +6806,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6637
6806
  /** Delivery and convergence health. Prefer `client.monitors.health(...)`. */
6638
6807
  async readMonitorsHealth(options) {
6639
6808
  const params = new URLSearchParams();
6640
- if (_optionalChain([options, 'optionalAccess', _363 => _363.fleetId])) params.set("fleet_id", options.fleetId);
6809
+ if (_optionalChain([options, 'optionalAccess', _374 => _374.fleetId])) params.set("fleet_id", options.fleetId);
6641
6810
  const query = params.toString();
6642
6811
  const suffix = query ? `?${query}` : "";
6643
6812
  return this.http.request(
@@ -6710,7 +6879,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6710
6879
  );
6711
6880
  }
6712
6881
  const params = new URLSearchParams();
6713
- if (_optionalChain([options, 'optionalAccess', _364 => _364.cursor])) params.set("cursor", options.cursor);
6882
+ if (_optionalChain([options, 'optionalAccess', _375 => _375.cursor])) params.set("cursor", options.cursor);
6714
6883
  const suffix = params.size > 0 ? `?${params}` : "";
6715
6884
  return this.http.request(
6716
6885
  `/api/v2/monitors/batch/${encodeURIComponent(runId)}${suffix}`,
@@ -6757,7 +6926,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6757
6926
  * a second charge. The submission is never replayed automatically.
6758
6927
  */
6759
6928
  async previewMonitor(definition, options) {
6760
- const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _365 => _365.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _366 => _366.crypto, 'optionalAccess', _367 => _367.randomUUID, 'optionalCall', _368 => _368()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6929
+ const idempotencyKey = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _376 => _376.idempotencyKey]), () => ( `monitor-preview-${_nullishCoalesce(_optionalChain([globalThis, 'access', _377 => _377.crypto, 'optionalAccess', _378 => _378.randomUUID, 'optionalCall', _379 => _379()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`));
6761
6930
  try {
6762
6931
  const result = await this.http.request(
6763
6932
  "/api/v2/monitors/preview",
@@ -6765,7 +6934,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6765
6934
  method: "POST",
6766
6935
  body: {
6767
6936
  ...definition,
6768
- ..._optionalChain([options, 'optionalAccess', _369 => _369.limit]) === void 0 ? {} : { limit: options.limit }
6937
+ ..._optionalChain([options, 'optionalAccess', _380 => _380.limit]) === void 0 ? {} : { limit: options.limit }
6769
6938
  },
6770
6939
  headers: { "Idempotency-Key": idempotencyKey },
6771
6940
  maxRetries: 0,
@@ -6787,7 +6956,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6787
6956
  * `client.monitors.deploy(...)`.
6788
6957
  */
6789
6958
  async deployMonitor(definition, options) {
6790
- if (_optionalChain([options, 'optionalAccess', _370 => _370.dryRun])) {
6959
+ if (_optionalChain([options, 'optionalAccess', _381 => _381.dryRun])) {
6791
6960
  return this.http.request("/api/v2/monitors/check", {
6792
6961
  method: "POST",
6793
6962
  body: definition
@@ -6823,12 +6992,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
6823
6992
  /** List deployed monitors. Prefer `client.monitors.list(...)`. */
6824
6993
  async listMonitors(options) {
6825
6994
  const params = new URLSearchParams();
6826
- if (_optionalChain([options, 'optionalAccess', _371 => _371.state])) params.set("state", options.state);
6827
- else if (_optionalChain([options, 'optionalAccess', _372 => _372.status])) params.set("status", options.status);
6828
- if (_optionalChain([options, 'optionalAccess', _373 => _373.limit]) !== void 0)
6995
+ if (_optionalChain([options, 'optionalAccess', _382 => _382.state])) params.set("state", options.state);
6996
+ else if (_optionalChain([options, 'optionalAccess', _383 => _383.status])) params.set("status", options.status);
6997
+ if (_optionalChain([options, 'optionalAccess', _384 => _384.limit]) !== void 0)
6829
6998
  params.set("limit", String(options.limit));
6830
- if (_optionalChain([options, 'optionalAccess', _374 => _374.cursor])) params.set("cursor", options.cursor);
6831
- if (_optionalChain([options, 'optionalAccess', _375 => _375.includeConsumers])) params.set("include_consumers", "true");
6999
+ if (_optionalChain([options, 'optionalAccess', _385 => _385.cursor])) params.set("cursor", options.cursor);
7000
+ if (_optionalChain([options, 'optionalAccess', _386 => _386.includeConsumers])) params.set("include_consumers", "true");
6832
7001
  const query = params.toString();
6833
7002
  const suffix = query ? `?${query}` : "";
6834
7003
  return this.http.request(
@@ -6839,17 +7008,17 @@ var DeeplineClient = (_class = class _DeeplineClient {
6839
7008
  /** The Monitors list. Prefer `client.monitors.ledger(...)`. */
6840
7009
  async listMonitorLedger(options) {
6841
7010
  const params = new URLSearchParams();
6842
- if (_optionalChain([options, 'optionalAccess', _376 => _376.search])) params.set("q", options.search);
6843
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _377 => _377.states]), () => ( []))) params.append("state", state);
6844
- for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _378 => _378.signals]), () => ( [])))
7011
+ if (_optionalChain([options, 'optionalAccess', _387 => _387.search])) params.set("q", options.search);
7012
+ for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _388 => _388.states]), () => ( []))) params.append("state", state);
7013
+ for (const signal of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _389 => _389.signals]), () => ( [])))
6845
7014
  params.append("signal", signal);
6846
- if (_optionalChain([options, 'optionalAccess', _379 => _379.play])) params.set("play", options.play);
6847
- if (_optionalChain([options, 'optionalAccess', _380 => _380.fleet])) params.set("fleet", options.fleet);
6848
- if (_optionalChain([options, 'optionalAccess', _381 => _381.sort])) params.set("sort", options.sort);
6849
- if (_optionalChain([options, 'optionalAccess', _382 => _382.window])) params.set("window", options.window);
6850
- if (_optionalChain([options, 'optionalAccess', _383 => _383.limit]) !== void 0)
7015
+ if (_optionalChain([options, 'optionalAccess', _390 => _390.play])) params.set("play", options.play);
7016
+ if (_optionalChain([options, 'optionalAccess', _391 => _391.fleet])) params.set("fleet", options.fleet);
7017
+ if (_optionalChain([options, 'optionalAccess', _392 => _392.sort])) params.set("sort", options.sort);
7018
+ if (_optionalChain([options, 'optionalAccess', _393 => _393.window])) params.set("window", options.window);
7019
+ if (_optionalChain([options, 'optionalAccess', _394 => _394.limit]) !== void 0)
6851
7020
  params.set("limit", String(options.limit));
6852
- if (_optionalChain([options, 'optionalAccess', _384 => _384.cursor])) params.set("cursor", options.cursor);
7021
+ if (_optionalChain([options, 'optionalAccess', _395 => _395.cursor])) params.set("cursor", options.cursor);
6853
7022
  const query = params.toString();
6854
7023
  const suffix = query ? `?${query}` : "";
6855
7024
  return this.http.request(
@@ -6866,7 +7035,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6866
7035
  }
6867
7036
  /** A monitor's recent findings. Prefer `client.monitors.ledgerFindings(...)`. */
6868
7037
  async listMonitorLedgerFindings(key, options) {
6869
- const suffix = _optionalChain([options, 'optionalAccess', _385 => _385.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
7038
+ const suffix = _optionalChain([options, 'optionalAccess', _396 => _396.cursor]) ? `?cursor=${encodeURIComponent(options.cursor)}` : "";
6870
7039
  return this.http.request(
6871
7040
  `/api/v2/monitors/ledger/${encodeURIComponent(key)}/findings${suffix}`,
6872
7041
  { method: "GET" }
@@ -6880,7 +7049,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6880
7049
  );
6881
7050
  }
6882
7051
  async testMonitorWebhook(key, payload, options) {
6883
- if (_optionalChain([options, 'optionalAccess', _386 => _386.dispatch]) === true || _optionalChain([options, 'optionalAccess', _387 => _387.validationOnly]) === false) {
7052
+ if (_optionalChain([options, 'optionalAccess', _397 => _397.dispatch]) === true || _optionalChain([options, 'optionalAccess', _398 => _398.validationOnly]) === false) {
6884
7053
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6885
7054
  "Monitor tests are validation-only and cannot dispatch events.",
6886
7055
  void 0,
@@ -6935,7 +7104,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6935
7104
  }
6936
7105
  /** Delete a deployed monitor and its upstream provider resource. `dryRun` returns the delete plan. Prefer `client.monitors.delete(...)`. */
6937
7106
  async deleteMonitor(key, options) {
6938
- if (_optionalChain([options, 'optionalAccess', _388 => _388.localOnly]) === true) {
7107
+ if (_optionalChain([options, 'optionalAccess', _399 => _399.localOnly]) === true) {
6939
7108
  throw new (0, _chunkBBTKAASQjs.DeeplineError)(
6940
7109
  "localOnly monitor deletion is no longer supported. Monitor deletion always deprovisions the upstream provider resource.",
6941
7110
  void 0,
@@ -6943,11 +7112,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
6943
7112
  );
6944
7113
  }
6945
7114
  const params = new URLSearchParams();
6946
- if (_optionalChain([options, 'optionalAccess', _389 => _389.dryRun])) params.set("dry_run", "true");
7115
+ if (_optionalChain([options, 'optionalAccess', _400 => _400.dryRun])) params.set("dry_run", "true");
6947
7116
  const query = params.toString();
6948
7117
  return this.http.request(
6949
7118
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
6950
- _optionalChain([options, 'optionalAccess', _390 => _390.dryRun]) ? { method: "DELETE" } : {
7119
+ _optionalChain([options, 'optionalAccess', _401 => _401.dryRun]) ? { method: "DELETE" } : {
6951
7120
  method: "DELETE",
6952
7121
  // Deletion is a provider lifecycle operation. A timeout is an
6953
7122
  // unknown outcome, not authority to begin another delete attempt.
@@ -6960,10 +7129,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
6960
7129
  * Prefer `client.monitors.reactivate(...)`.
6961
7130
  */
6962
7131
  async reactivateMonitor(key, options) {
6963
- const query = _optionalChain([options, 'optionalAccess', _391 => _391.dryRun]) ? "?dry_run=true" : "";
7132
+ const query = _optionalChain([options, 'optionalAccess', _402 => _402.dryRun]) ? "?dry_run=true" : "";
6964
7133
  return this.http.request(
6965
7134
  `/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
6966
- _optionalChain([options, 'optionalAccess', _392 => _392.dryRun]) ? { method: "POST", body: {} } : {
7135
+ _optionalChain([options, 'optionalAccess', _403 => _403.dryRun]) ? { method: "POST", body: {} } : {
6967
7136
  method: "POST",
6968
7137
  body: {},
6969
7138
  // Reactivation can create an upstream resource, so it must not use
@@ -6977,7 +7146,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6977
7146
  // ——————————————————————————————————————————————————————————
6978
7147
  static __initStatic() {this.MONITOR_JOB_IDEMPOTENCY_KEY_MAX_LENGTH = 96}
6979
7148
  monitorJobIdempotencyKey(operation) {
6980
- const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _393 => _393.crypto, 'optionalAccess', _394 => _394.randomUUID, 'optionalCall', _395 => _395()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
7149
+ const uuid = _nullishCoalesce(_optionalChain([globalThis, 'access', _404 => _404.crypto, 'optionalAccess', _405 => _405.randomUUID, 'optionalCall', _406 => _406()]), () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`));
6981
7150
  const prefix = "monitor-job-";
6982
7151
  const safeOperation = operation.replace(/[^A-Za-z0-9._-]/g, "-");
6983
7152
  const maxOperationLength = Math.max(
@@ -6988,7 +7157,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6988
7157
  }
6989
7158
  monitorJobHeaders(operation, idempotencyKey) {
6990
7159
  return {
6991
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _396 => _396.trim, 'call', _397 => _397()]) || this.monitorJobIdempotencyKey(operation)
7160
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _407 => _407.trim, 'call', _408 => _408()]) || this.monitorJobIdempotencyKey(operation)
6992
7161
  };
6993
7162
  }
6994
7163
  async deployMonitorBatch(definitions, options) {
@@ -6999,7 +7168,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
6999
7168
  body: { version: 1, kind: "batch", monitors: definitions },
7000
7169
  headers: this.monitorJobHeaders(
7001
7170
  "batch-deploy",
7002
- _optionalChain([options, 'optionalAccess', _398 => _398.idempotencyKey])
7171
+ _optionalChain([options, 'optionalAccess', _409 => _409.idempotencyKey])
7003
7172
  ),
7004
7173
  maxRetries: 0,
7005
7174
  exactUrlOnly: true
@@ -7018,11 +7187,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
7018
7187
  version: 1,
7019
7188
  kind: "batch",
7020
7189
  monitors: definitions,
7021
- ..._optionalChain([options, 'optionalAccess', _399 => _399.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
7190
+ ..._optionalChain([options, 'optionalAccess', _410 => _410.expectedGeneration]) === void 0 ? {} : { expected_generation: options.expectedGeneration }
7022
7191
  },
7023
7192
  headers: this.monitorJobHeaders(
7024
7193
  `batch-sync-${batchId}`,
7025
- _optionalChain([options, 'optionalAccess', _400 => _400.idempotencyKey])
7194
+ _optionalChain([options, 'optionalAccess', _411 => _411.idempotencyKey])
7026
7195
  ),
7027
7196
  maxRetries: 0,
7028
7197
  exactUrlOnly: true
@@ -7037,7 +7206,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7037
7206
  body: {},
7038
7207
  headers: this.monitorJobHeaders(
7039
7208
  `batch-start-${batchId}`,
7040
- _optionalChain([options, 'optionalAccess', _401 => _401.idempotencyKey])
7209
+ _optionalChain([options, 'optionalAccess', _412 => _412.idempotencyKey])
7041
7210
  ),
7042
7211
  maxRetries: 0,
7043
7212
  exactUrlOnly: true
@@ -7052,7 +7221,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7052
7221
  body: {},
7053
7222
  headers: this.monitorJobHeaders(
7054
7223
  `batch-stop-${batchId}`,
7055
- _optionalChain([options, 'optionalAccess', _402 => _402.idempotencyKey])
7224
+ _optionalChain([options, 'optionalAccess', _413 => _413.idempotencyKey])
7056
7225
  ),
7057
7226
  maxRetries: 0,
7058
7227
  exactUrlOnly: true
@@ -7073,7 +7242,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7073
7242
  body: {},
7074
7243
  headers: this.monitorJobHeaders(
7075
7244
  `${action}-${monitorKey}`,
7076
- _optionalChain([options, 'optionalAccess', _403 => _403.idempotencyKey])
7245
+ _optionalChain([options, 'optionalAccess', _414 => _414.idempotencyKey])
7077
7246
  ),
7078
7247
  maxRetries: 0,
7079
7248
  exactUrlOnly: true
@@ -7086,7 +7255,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7086
7255
  body: definition,
7087
7256
  headers: this.monitorJobHeaders(
7088
7257
  `sync-${definition.key}`,
7089
- _optionalChain([options, 'optionalAccess', _404 => _404.idempotencyKey])
7258
+ _optionalChain([options, 'optionalAccess', _415 => _415.idempotencyKey])
7090
7259
  ),
7091
7260
  maxRetries: 0,
7092
7261
  exactUrlOnly: true
@@ -7099,7 +7268,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7099
7268
  );
7100
7269
  }
7101
7270
  async getMonitorJobLogs(jobId, options) {
7102
- const query = _optionalChain([options, 'optionalAccess', _405 => _405.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7271
+ const query = _optionalChain([options, 'optionalAccess', _416 => _416.limit]) === void 0 ? "" : `?limit=${encodeURIComponent(String(options.limit))}`;
7103
7272
  return this.http.request(
7104
7273
  `/api/v2/monitors/jobs/${encodeURIComponent(jobId)}/logs${query}`,
7105
7274
  { method: "GET" }
@@ -7112,15 +7281,15 @@ var DeeplineClient = (_class = class _DeeplineClient {
7112
7281
  );
7113
7282
  }
7114
7283
  async waitForMonitorJob(jobId, options) {
7115
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _406 => _406.timeoutMs]), () => ( 10 * 6e4)));
7116
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _407 => _407.pollIntervalMs]), () => ( 2e3)));
7284
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.timeoutMs]), () => ( 10 * 6e4)));
7285
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _418 => _418.pollIntervalMs]), () => ( 2e3)));
7117
7286
  const terminal = /* @__PURE__ */ new Set(["succeeded", "failed", "cancelled"]);
7118
7287
  const startedAt = Date.now();
7119
7288
  let latest = await this.getMonitorJob(jobId);
7120
7289
  while (true) {
7121
- _optionalChain([options, 'optionalAccess', _408 => _408.onProgress, 'optionalCall', _409 => _409(latest)]);
7290
+ _optionalChain([options, 'optionalAccess', _419 => _419.onProgress, 'optionalCall', _420 => _420(latest)]);
7122
7291
  const job = latest.job;
7123
- const state = typeof _optionalChain([job, 'optionalAccess', _410 => _410.state]) === "string" ? job.state : void 0;
7292
+ const state = typeof _optionalChain([job, 'optionalAccess', _421 => _421.state]) === "string" ? job.state : void 0;
7124
7293
  if (state && terminal.has(state)) return latest;
7125
7294
  if (Date.now() - startedAt >= timeoutMs) return latest;
7126
7295
  await sleep(pollIntervalMs);
@@ -7131,12 +7300,12 @@ var DeeplineClient = (_class = class _DeeplineClient {
7131
7300
  // Monitor Fleets
7132
7301
  // ——————————————————————————————————————————————————————————
7133
7302
  monitorFleetIdempotencyKey(operation) {
7134
- const uuid = _optionalChain([globalThis, 'access', _411 => _411.crypto, 'optionalAccess', _412 => _412.randomUUID, 'optionalCall', _413 => _413()]);
7303
+ const uuid = _optionalChain([globalThis, 'access', _422 => _422.crypto, 'optionalAccess', _423 => _423.randomUUID, 'optionalCall', _424 => _424()]);
7135
7304
  return `monitor-fleet-${operation}-${_nullishCoalesce(uuid, () => ( `${Date.now()}-${Math.random().toString(36).slice(2)}`))}`;
7136
7305
  }
7137
7306
  monitorFleetHeaders(operation, idempotencyKey) {
7138
7307
  return {
7139
- "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _414 => _414.trim, 'call', _415 => _415()]) || this.monitorFleetIdempotencyKey(operation)
7308
+ "Idempotency-Key": _optionalChain([idempotencyKey, 'optionalAccess', _425 => _425.trim, 'call', _426 => _426()]) || this.monitorFleetIdempotencyKey(operation)
7140
7309
  };
7141
7310
  }
7142
7311
  /**
@@ -7163,8 +7332,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
7163
7332
  const fleetId = typeof definitionOrId === "string" ? definitionOrId : definitionOrId.id;
7164
7333
  const body = {
7165
7334
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
7166
- ..._optionalChain([options, 'optionalAccess', _416 => _416.dryRun]) ? { dry_run: true } : {},
7167
- ..._optionalChain([options, 'optionalAccess', _417 => _417.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7335
+ ..._optionalChain([options, 'optionalAccess', _427 => _427.dryRun]) ? { dry_run: true } : {},
7336
+ ..._optionalChain([options, 'optionalAccess', _428 => _428.adoptExisting]) ? { adopt_existing: true } : {},
7337
+ ..._optionalChain([options, 'optionalAccess', _429 => _429.expectedGeneration]) !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7168
7338
  };
7169
7339
  return this.http.request(
7170
7340
  this.monitorFleetPath(fleetId),
@@ -7172,7 +7342,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7172
7342
  method: "PUT",
7173
7343
  body,
7174
7344
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7175
- headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _418 => _418.idempotencyKey])),
7345
+ headers: this.monitorFleetHeaders("sync", _optionalChain([options, 'optionalAccess', _430 => _430.idempotencyKey])),
7176
7346
  maxRetries: 0,
7177
7347
  exactUrlOnly: true
7178
7348
  }
@@ -7186,10 +7356,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7186
7356
  /** The Fleets list. Prefer `client.monitors.fleets.overview()`. */
7187
7357
  async listMonitorFleetOverviews(options) {
7188
7358
  const params = new URLSearchParams({ view: "overview" });
7189
- if (_optionalChain([options, 'optionalAccess', _419 => _419.q])) params.set("q", options.q);
7190
- for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _420 => _420.states]), () => ( []))) params.append("state", state);
7191
- if (_optionalChain([options, 'optionalAccess', _421 => _421.sort])) params.set("sort", options.sort);
7192
- if (_optionalChain([options, 'optionalAccess', _422 => _422.window])) params.set("window", options.window);
7359
+ if (_optionalChain([options, 'optionalAccess', _431 => _431.q])) params.set("q", options.q);
7360
+ for (const state of _nullishCoalesce(_optionalChain([options, 'optionalAccess', _432 => _432.states]), () => ( []))) params.append("state", state);
7361
+ if (_optionalChain([options, 'optionalAccess', _433 => _433.sort])) params.set("sort", options.sort);
7362
+ if (_optionalChain([options, 'optionalAccess', _434 => _434.window])) params.set("window", options.window);
7193
7363
  return this.http.request(
7194
7364
  `/api/v2/monitors/fleets?${params.toString()}`,
7195
7365
  { method: "GET" }
@@ -7198,7 +7368,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7198
7368
  /** One fleet's overview. Prefer `client.monitors.fleets.overview(fleetId)`. */
7199
7369
  async getMonitorFleetOverview(fleetId, options) {
7200
7370
  const params = new URLSearchParams({ view: "overview" });
7201
- if (_optionalChain([options, 'optionalAccess', _423 => _423.window])) params.set("window", options.window);
7371
+ if (_optionalChain([options, 'optionalAccess', _435 => _435.window])) params.set("window", options.window);
7202
7372
  return this.http.request(
7203
7373
  `${this.monitorFleetPath(fleetId)}?${params.toString()}`,
7204
7374
  { method: "GET" }
@@ -7207,10 +7377,10 @@ var DeeplineClient = (_class = class _DeeplineClient {
7207
7377
  /** A fleet's problem members. Prefer `client.monitors.fleets.issues(...)`. */
7208
7378
  async listMonitorFleetIssues(fleetId, options) {
7209
7379
  const params = new URLSearchParams();
7210
- if (_optionalChain([options, 'optionalAccess', _424 => _424.group])) params.set("group", options.group);
7211
- if (_optionalChain([options, 'optionalAccess', _425 => _425.cause])) params.set("cause", options.cause);
7212
- if (_optionalChain([options, 'optionalAccess', _426 => _426.cursor])) params.set("cursor", options.cursor);
7213
- if (_optionalChain([options, 'optionalAccess', _427 => _427.limit]) !== void 0)
7380
+ if (_optionalChain([options, 'optionalAccess', _436 => _436.group])) params.set("group", options.group);
7381
+ if (_optionalChain([options, 'optionalAccess', _437 => _437.cause])) params.set("cause", options.cause);
7382
+ if (_optionalChain([options, 'optionalAccess', _438 => _438.cursor])) params.set("cursor", options.cursor);
7383
+ if (_optionalChain([options, 'optionalAccess', _439 => _439.limit]) !== void 0)
7214
7384
  params.set("limit", String(options.limit));
7215
7385
  const query = params.toString();
7216
7386
  return this.http.request(
@@ -7220,8 +7390,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
7220
7390
  }
7221
7391
  async getMonitorFleet(fleetId, options) {
7222
7392
  const params = new URLSearchParams();
7223
- if (_optionalChain([options, 'optionalAccess', _428 => _428.drift])) params.set("drift", "1");
7224
- if (_optionalChain([options, 'optionalAccess', _429 => _429.limit]) !== void 0)
7393
+ if (_optionalChain([options, 'optionalAccess', _440 => _440.drift])) params.set("drift", "1");
7394
+ if (_optionalChain([options, 'optionalAccess', _441 => _441.limit]) !== void 0)
7225
7395
  params.set("limit", String(options.limit));
7226
7396
  const query = params.toString();
7227
7397
  return this.http.request(
@@ -7234,11 +7404,11 @@ var DeeplineClient = (_class = class _DeeplineClient {
7234
7404
  this.monitorFleetPath(fleetId),
7235
7405
  {
7236
7406
  method: "DELETE",
7237
- body: _optionalChain([options, 'optionalAccess', _430 => _430.dryRun]) ? { dry_run: true } : {},
7407
+ body: _optionalChain([options, 'optionalAccess', _442 => _442.dryRun]) ? { dry_run: true } : {},
7238
7408
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7239
7409
  headers: this.monitorFleetHeaders(
7240
7410
  "deactivate",
7241
- _optionalChain([options, 'optionalAccess', _431 => _431.idempotencyKey])
7411
+ _optionalChain([options, 'optionalAccess', _443 => _443.idempotencyKey])
7242
7412
  ),
7243
7413
  maxRetries: 0,
7244
7414
  exactUrlOnly: true
@@ -7254,7 +7424,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7254
7424
  timeout: _DeeplineClient.MONITOR_FLEET_WRITE_TIMEOUT_MS,
7255
7425
  headers: this.monitorFleetHeaders(
7256
7426
  "reactivate",
7257
- _optionalChain([options, 'optionalAccess', _432 => _432.idempotencyKey])
7427
+ _optionalChain([options, 'optionalAccess', _444 => _444.idempotencyKey])
7258
7428
  ),
7259
7429
  maxRetries: 0,
7260
7430
  exactUrlOnly: true
@@ -7271,9 +7441,9 @@ var DeeplineClient = (_class = class _DeeplineClient {
7271
7441
  * identical to "the request failed".
7272
7442
  */
7273
7443
  async waitForMonitorFleetConvergence(fleetId, options) {
7274
- const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _433 => _433.timeoutMs]), () => ( 10 * 6e4)));
7275
- const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _434 => _434.pollIntervalMs]), () => ( 2e3)));
7276
- const terminal = _optionalChain([options, 'optionalAccess', _435 => _435.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
7444
+ const timeoutMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _445 => _445.timeoutMs]), () => ( 10 * 6e4)));
7445
+ const pollIntervalMs = Math.max(1, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _446 => _446.pollIntervalMs]), () => ( 2e3)));
7446
+ const terminal = _optionalChain([options, 'optionalAccess', _447 => _447.until]) === "deactivated" ? /* @__PURE__ */ new Set(["deactivated", "degraded", "billing_suspended"]) : /* @__PURE__ */ new Set([
7277
7447
  "converged",
7278
7448
  "degraded",
7279
7449
  "deactivated",
@@ -7282,7 +7452,7 @@ var DeeplineClient = (_class = class _DeeplineClient {
7282
7452
  const startedAt = Date.now();
7283
7453
  let latest = await this.getMonitorFleet(fleetId);
7284
7454
  while (true) {
7285
- _optionalChain([options, 'optionalAccess', _436 => _436.onProgress, 'optionalCall', _437 => _437(latest)]);
7455
+ _optionalChain([options, 'optionalAccess', _448 => _448.onProgress, 'optionalCall', _449 => _449(latest)]);
7286
7456
  const status = typeof latest.status === "string" ? latest.status : void 0;
7287
7457
  if (status && terminal.has(status)) return latest;
7288
7458
  if (Date.now() - startedAt >= timeoutMs) return latest;