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
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
49
49
  // getters keep their established compatibility behavior.
50
50
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
51
51
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
52
- version: "0.3.542",
52
+ version: "0.3.544",
53
53
  updateSummary: {
54
54
  introducedIn: "0.3.90",
55
55
  summary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release."
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkE7B73LGTjs = require('./chunk-E7B73LGT.js');
3
+ var _chunkZY6FL4O4js = require('./chunk-ZY6FL4O4.js');
4
4
 
5
5
  // src/cli/maintenance-policy.ts
6
6
  var _commander = require('commander');
@@ -33,7 +33,7 @@ function recordCliTrace(event) {
33
33
  sinceStartMs: now - cliTraceStartedAt,
34
34
  ...event
35
35
  };
36
- _chunkE7B73LGTjs.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
36
+ _chunkZY6FL4O4js.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
37
37
  `);
38
38
  }
39
39
  async function traceCliSpan(phase, fields, run) {
@@ -2,11 +2,20 @@ import {
2
2
  addDescribeOptions,
3
3
  recordApiResponse,
4
4
  writeExecutionOutput
5
- } from "./chunk-QONO7FRF.mjs";
5
+ } from "./chunk-57G4NYOL.mjs";
6
+ import {
7
+ registerIntegrationBalanceCommand,
8
+ registerIntegrationConnectCommand,
9
+ registerLegacyAvailabilityCalendarsCommand,
10
+ registerLegacyCalendarDelegationCommand,
11
+ registerLegacyHubSpotMembersCommand,
12
+ registerLegacyWorkspaceConnectionCommand,
13
+ registerWorkspaceConnectionListCommand
14
+ } from "./chunk-WBSGPLH5.mjs";
6
15
  import {
7
16
  recentSearchRef,
8
17
  registerDeprecatedSearchCommand
9
- } from "./chunk-ZVNYBQ77.mjs";
18
+ } from "./chunk-SKS53WM6.mjs";
10
19
  import {
11
20
  Capability,
12
21
  arrayField,
@@ -27,7 +36,7 @@ import {
27
36
  toolInputFieldsForDisplay,
28
37
  toolMetadataJsonForDescribe,
29
38
  toolOutputFieldsForDisplay
30
- } from "./chunk-OVX3Q5Q3.mjs";
39
+ } from "./chunk-GWNYLIF7.mjs";
31
40
  import {
32
41
  rateLimitQualifier
33
42
  } from "./chunk-7AOFSZJM.mjs";
@@ -46,10 +55,10 @@ import {
46
55
  } from "./chunk-FIVKWNMT.mjs";
47
56
  import {
48
57
  DeeplineClient
49
- } from "./chunk-DADH3WPE.mjs";
58
+ } from "./chunk-GV45TTI6.mjs";
50
59
  import {
51
60
  validateExecutionIdempotencyKey
52
- } from "./chunk-5APOJWJF.mjs";
61
+ } from "./chunk-Q7ZOWNKR.mjs";
53
62
  import {
54
63
  stableStringify
55
64
  } from "./chunk-UBKA33KY.mjs";
@@ -59,18 +68,18 @@ import {
59
68
  maybeAutoUpdateAndRelaunch,
60
69
  registerCompatibilityCatalog,
61
70
  runToolExecuteStage
62
- } from "./chunk-PLIKPGOO.mjs";
71
+ } from "./chunk-LQ6RRYXN.mjs";
63
72
  import {
64
73
  isCliTraceEnabled,
65
74
  recordCliTrace,
66
75
  resolveCliMaintenancePolicy
67
- } from "./chunk-FFDZT255.mjs";
76
+ } from "./chunk-LW274RO7.mjs";
68
77
  import {
69
78
  checkSdkCompatibility,
70
79
  enforceSdkCompatibilityResponse,
71
80
  flushDeferredSkillsSyncNotices,
72
81
  syncSdkSkillsIfNeeded
73
- } from "./chunk-ORA5TMML.mjs";
82
+ } from "./chunk-BEQ7RQLT.mjs";
74
83
  import {
75
84
  errorToJsonPayload,
76
85
  printCommandEnvelope,
@@ -79,12 +88,12 @@ import {
79
88
  printJsonError,
80
89
  renderCommandEnvelopeText,
81
90
  shouldEmitJson
82
- } from "./chunk-TT4JUUC3.mjs";
91
+ } from "./chunk-DVDWAC2M.mjs";
83
92
  import {
84
93
  readSdkSkillsLocalVersion,
85
94
  resolveConfig,
86
95
  sdkCliStateDirPath
87
- } from "./chunk-Z5YRKX7K.mjs";
96
+ } from "./chunk-HXM2JUGD.mjs";
88
97
  import {
89
98
  DeeplineError
90
99
  } from "./chunk-JL2OTMSG.mjs";
@@ -813,7 +822,7 @@ Concepts:
813
822
  Common commands:
814
823
  deepline search "name and company domain -> work email"
815
824
  deepline describe hunter_email_verifier
816
- deepline tools connect hubspot --link
825
+ deepline integrations connect hubspot --link
817
826
  deepline run hunter_email_verifier --input '{"email":"a@b.com"}'
818
827
  deepline billing usage --request-id <request-id>
819
828
 
@@ -824,182 +833,13 @@ Output:
824
833
  activity.
825
834
  `
826
835
  );
827
- tools.command("balance <provider>").description(
828
- "Read a fresh balance using this workspace\u2019s own provider connection (LeadMagic)."
829
- ).option("--json", "Print the balance and observation timestamp as JSON").action(async (provider, options) => {
830
- const balance = await new DeeplineClient().getIntegrationBalance(
831
- provider
832
- );
833
- if (shouldEmitJson(options.json)) console.log(JSON.stringify(balance));
834
- else
835
- console.log(
836
- `${balance.provider}: ${balance.balance.value} ${balance.unit} (observed ${balance.observedAt})`
837
- );
838
- });
839
- tools.command("workspace-connections").description(
840
- "List shared OAuth connections in a workspace enrolled in the pilot."
841
- ).option("--json", "Print connection summaries as JSON").action(async (options) => {
842
- const { connections } = await new DeeplineClient().listWorkspaceIntegrationConnections();
843
- if (shouldEmitJson(options.json))
844
- console.log(JSON.stringify(connections));
845
- else if (connections.length === 0)
846
- console.log("No workspace connections.");
847
- else
848
- for (const row of connections)
849
- console.log(`${row.provider} ${row.status} ${row.label}`);
850
- });
851
- tools.command("hubspot-members").description(
852
- "List personal HubSpot connection status for workspace members."
853
- ).option("--cursor <cursor>", "Read the next roster page").option("--json", "Print the roster page as JSON").action(async (options) => {
854
- const page = await new DeeplineClient().listPersonalHubSpotMembers(
855
- options.cursor
856
- );
857
- if (shouldEmitJson(options.json)) {
858
- console.log(JSON.stringify(page));
859
- return;
860
- }
861
- if (page.members.length === 0)
862
- console.log("No workspace members on this page.");
863
- for (const member of page.members) {
864
- const account = member.account ? ` Portal ${member.account.portalId} User ${member.account.userId}` : "";
865
- console.log(
866
- `${JSON.stringify(member.name || member.email)} ${member.status}${account}`
867
- );
868
- }
869
- if (page.nextCursor)
870
- console.error(`Next page cursor: ${page.nextCursor}`);
871
- });
872
- tools.command("workspace-connection <provider> <action>").description(
873
- "Open shared OAuth setup or disconnect the current connection."
874
- ).option("--json", "Print the result as JSON").action(
875
- async (provider, action, options) => {
876
- if (provider !== "hubspot" && provider !== "google_calendar_availability")
877
- throw new Error("Choose hubspot or google_calendar_availability.");
878
- if (action !== "connect" && action !== "reconnect" && action !== "replace" && action !== "disconnect")
879
- throw new Error("Choose connect, reconnect, replace, or disconnect.");
880
- const client = new DeeplineClient();
881
- const { connections } = await client.listWorkspaceIntegrationConnections();
882
- const row = connections.find(
883
- (connection) => connection.provider === provider
884
- );
885
- const result = await client.manageWorkspaceIntegrationConnection({
886
- provider,
887
- action,
888
- connectionId: row?.id,
889
- authorizationVersion: row?.authorizationVersion
890
- });
891
- if (shouldEmitJson(options.json)) console.log(JSON.stringify(result));
892
- else console.log(result.url ?? "Workspace connection disconnected.");
893
- }
894
- );
895
- tools.command("availability-calendars").description("Calendar discovery compatibility command for the pilot.").option("--cursor <cursor>", "Legacy calendar page cursor").option("--json", "Print the response as JSON").action(async (options) => {
896
- const page = await new DeeplineClient().listAvailabilityCalendars(
897
- options.cursor
898
- );
899
- if (shouldEmitJson(options.json)) {
900
- console.log(JSON.stringify(page));
901
- return;
902
- }
903
- for (const calendar of page.calendars)
904
- console.log(`${JSON.stringify(calendar.name)} ${calendar.id}`);
905
- if (page.cursor)
906
- console.log(`Next page cursor: ${JSON.stringify(page.cursor)}`);
907
- });
908
- tools.command("connect <provider>").description(
909
- "Get a dashboard connection link or connect a provider with credentials or OAuth."
910
- ).addOption(
911
- new Option("--link", "Print a shareable dashboard link").conflicts([
912
- "credentialsFile",
913
- "oauth",
914
- "preset",
915
- "scopes",
916
- "optionalScopes",
917
- "expectedConnectionId"
918
- ])
919
- ).option(
920
- "--credentials-file <path>",
921
- "JSON object of credential field names and string values; keep this file private"
922
- ).option("--oauth", "Return an OAuth authorization URL").addOption(new Option("--expected-connection-id <id>").hideHelp()).option("--preset <id>", "Server-defined access preset (HubSpot only)").option("--scopes <scopes>", "Comma-separated OAuth scopes").option(
923
- "--optional-scopes <scopes>",
924
- "Comma-separated optional OAuth scopes"
925
- ).option("--json", "Print JSON without credential values").action(
926
- async (provider, options) => {
927
- if (options.expectedConnectionId !== void 0 && (!options.expectedConnectionId.trim() || provider !== "google_calendar_availability" || !options.credentialsFile || options.oauth)) {
928
- throw new Error(
929
- "--expected-connection-id requires Calendar availability and a credentials file."
930
- );
931
- }
932
- if (options.link) {
933
- const link = await new DeeplineClient().getIntegrationConnectLink(
934
- provider
935
- );
936
- if (shouldEmitJson(options.json)) console.log(JSON.stringify(link));
937
- else console.log(link.connect_url);
938
- return;
939
- }
940
- if (options.oauth) {
941
- if (options.credentialsFile)
942
- throw new Error("Use --oauth or --credentials-file, not both.");
943
- if (options.preset !== void 0 && (options.scopes !== void 0 || options.optionalScopes !== void 0))
944
- throw new Error("Use --preset or individual scopes, not both.");
945
- const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
946
- const result2 = await new DeeplineClient().startIntegrationOAuth(
947
- provider,
948
- {
949
- ...options.preset !== void 0 ? { preset: options.preset } : {},
950
- ...options.scopes !== void 0 ? { scopes: splitScopes(options.scopes) } : {},
951
- ...options.optionalScopes !== void 0 ? { optionalScopes: splitScopes(options.optionalScopes) } : {}
952
- }
953
- );
954
- if (!result2.ok || typeof result2.redirect_url !== "string" || !result2.redirect_url)
955
- throw new Error(
956
- "The API did not return an OAuth authorization URL."
957
- );
958
- if (shouldEmitJson(options.json))
959
- console.log(
960
- JSON.stringify({ provider, redirect_url: result2.redirect_url })
961
- );
962
- else console.log(result2.redirect_url);
963
- return;
964
- }
965
- if (!options.credentialsFile || options.preset !== void 0 || options.scopes !== void 0 || options.optionalScopes !== void 0)
966
- throw new Error(
967
- "Use --link for a dashboard link, --credentials-file to save credentials, or --oauth to request access."
968
- );
969
- let credentials;
970
- try {
971
- credentials = JSON.parse(
972
- readFileSync2(resolve(options.credentialsFile), "utf8")
973
- );
974
- } catch {
975
- throw new Error(
976
- "Unable to read --credentials-file as a JSON object."
977
- );
978
- }
979
- if (!credentials || typeof credentials !== "object" || Array.isArray(credentials) || Object.keys(credentials).length === 0 || Object.values(credentials).some((value) => typeof value !== "string")) {
980
- throw new Error(
981
- "--credentials-file must contain a nonempty JSON object of string credential values."
982
- );
983
- }
984
- const result = await new DeeplineClient().setIntegrationCredentials(
985
- provider,
986
- credentials,
987
- { expectedConnectionId: options.expectedConnectionId }
988
- );
989
- if (!result.ok || result.credential_saved !== true) {
990
- throw new Error(
991
- "The API did not confirm that provider credentials were saved. Inspect the integration before retrying."
992
- );
993
- }
994
- const confirmation = { provider, credential_saved: true };
995
- if (shouldEmitJson(options.json))
996
- console.log(JSON.stringify(confirmation));
997
- else
998
- console.log(
999
- `Credentials saved for ${provider} in the active workspace.`
1000
- );
1001
- }
1002
- );
836
+ registerIntegrationBalanceCommand(tools, true);
837
+ registerWorkspaceConnectionListCommand(tools, "workspace-connections", true);
838
+ registerLegacyHubSpotMembersCommand(tools, true);
839
+ registerLegacyWorkspaceConnectionCommand(tools, true);
840
+ registerLegacyCalendarDelegationCommand(tools, true);
841
+ registerLegacyAvailabilityCalendarsCommand(tools, true);
842
+ registerIntegrationConnectCommand(tools, false, true);
1003
843
  tools.command("list [category]").description("Browse tool categories, or list every tool in a category.").addHelpText(
1004
844
  "after",
1005
845
  `
@@ -1137,7 +977,7 @@ Examples:
1137
977
  process.exitCode = await narrowView();
1138
978
  return;
1139
979
  }
1140
- const { describeAnything } = await import("./describe-THQU7N47.mjs");
980
+ const { describeAnything } = await import("./describe-X6QA2U3C.mjs");
1141
981
  process.exitCode = await describeAnything(
1142
982
  toolId,
1143
983
  {
@@ -1157,7 +997,7 @@ Examples:
1157
997
  { json: false }
1158
998
  )
1159
999
  );
1160
- tools.command("execute <toolId>", { hidden: true }).alias("call").description("Execute a tool by id.").addHelpText(
1000
+ tools.command("execute <toolId>", { hidden: true }).alias("call").description("Execute a tool by id.").option("--connection <name>", "Use an exact named workspace connection").addHelpText(
1161
1001
  "after",
1162
1002
  `
1163
1003
  Notes:
@@ -2252,6 +2092,11 @@ function parseExecuteOptions(toolId, options, output) {
2252
2092
  if (options.idempotencyKey !== void 0) {
2253
2093
  validateExecutionIdempotencyKey(options.idempotencyKey);
2254
2094
  }
2095
+ if (options.connection !== void 0 && (options.recover || options.idempotencyKey !== void 0)) {
2096
+ throw new Error(
2097
+ "--connection cannot be combined with --recover or --idempotency-key."
2098
+ );
2099
+ }
2255
2100
  if (options.recoveryTimeoutMs !== void 0) {
2256
2101
  const parsed = Number(options.recoveryTimeoutMs);
2257
2102
  if (!options.recoveryTimeoutMs.trim() || !Number.isFinite(parsed) || parsed < 0) {
@@ -2267,6 +2112,7 @@ function parseExecuteOptions(toolId, options, output) {
2267
2112
  outPath: options.out !== void 0 ? resolve(options.out) : null,
2268
2113
  timeoutMs: options.timeout !== void 0 ? parseToolExecuteTimeout(options.timeout) : void 0,
2269
2114
  idempotencyKey: options.idempotencyKey,
2115
+ connection: options.connection,
2270
2116
  recover: options.recover === true,
2271
2117
  recoveryTimeoutMs
2272
2118
  };
@@ -2869,6 +2715,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
2869
2715
  const executeOptions = {
2870
2716
  ...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {},
2871
2717
  responseIntent,
2718
+ ...parsed.connection !== void 0 ? { connection: parsed.connection } : {},
2872
2719
  ...idempotencyKey ? { idempotencyKey } : {},
2873
2720
  ...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
2874
2721
  searchRef: recentSearchRef(parsed.toolId),
@@ -2900,7 +2747,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
2900
2747
  ...metadata?.executionMetadata?.retrySafeAmbiguousDelivery === true ? { retryAmbiguousDelivery: true } : {}
2901
2748
  });
2902
2749
  } catch (error) {
2903
- if (!(error instanceof DeeplineError) || error.code !== "ATOMIC_TOOL_EXECUTE_UNSUPPORTED")
2750
+ if (parsed.connection !== void 0 || !(error instanceof DeeplineError) || error.code !== "ATOMIC_TOOL_EXECUTE_UNSUPPORTED")
2904
2751
  throw error;
2905
2752
  const baseUrl = resolveConfig().baseUrl;
2906
2753
  if (maintenancePolicy !== "off") {
@@ -1,9 +1,13 @@
1
1
  import {
2
+ GOOGLE_WORKSPACE_BOOKING_SCOPE,
3
+ GOOGLE_WORKSPACE_BOOKING_SCOPES,
4
+ GOOGLE_WORKSPACE_DOMAIN_PATTERN,
2
5
  PLAY_RUNTIME_BACKENDS,
3
6
  RAW_V2_TOOL_RESPONSE_CONTRACT,
7
+ isToolConnectionName,
4
8
  legacyRawFromToolResponseRawV2,
5
9
  providerMetaFromToolResponseRawV2
6
- } from "./chunk-L2VKAASU.mjs";
10
+ } from "./chunk-HXIR3VQL.mjs";
7
11
  import {
8
12
  CLI_PLAY_RUN_CALLER_INTENT_V2_START_STREAM_PATH,
9
13
  CLI_PLAY_RUN_START_STREAM_PATH,
@@ -20,7 +24,7 @@ import {
20
24
  stagePlayFiles,
21
25
  startPlayRun,
22
26
  submitPreparedPlayRunAdmission
23
- } from "./chunk-Z2XA6YU4.mjs";
27
+ } from "./chunk-LX35AXTN.mjs";
24
28
  import {
25
29
  describePlayDetail,
26
30
  describePlayListItem
@@ -32,7 +36,7 @@ import {
32
36
  RETAINED_PIPELINE_RECEIVERS_HEADER,
33
37
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
34
38
  SDK_API_MAJOR
35
- } from "./chunk-2VRKBHMD.mjs";
39
+ } from "./chunk-ZHY4T5M6.mjs";
36
40
  import {
37
41
  CustomerDbQueryOutcomeUnknownError
38
42
  } from "./chunk-CQBIO6HW.mjs";
@@ -588,6 +592,14 @@ var ToolCalls = class {
588
592
  this.configuredRequestTimeoutMs = configuredRequestTimeoutMs;
589
593
  }
590
594
  async call(toolId, input, options) {
595
+ const connection = options?.connection;
596
+ if (connection !== void 0 && (!isToolConnectionName(connection) || options?.idempotencyKey !== void 0 || options?.recover)) {
597
+ throw new DeeplineError(
598
+ "Use a valid workspace connection name without execution recovery.",
599
+ 400,
600
+ "NAMED_CONNECTION_INVALID"
601
+ );
602
+ }
591
603
  if (options?.cliInvocationId !== void 0) {
592
604
  validateCliInvocationId(options.cliInvocationId);
593
605
  }
@@ -652,23 +664,24 @@ var ToolCalls = class {
652
664
  const legacyEndpoint = `/api/v2/integrations/${encodeURIComponent(toolId)}/execute`;
653
665
  let useLegacyEndpoint = idempotencyKey === void 0;
654
666
  const atomicToolOnly = options?.atomicToolOnly === true;
655
- const retryAmbiguousDelivery = atomicToolOnly && !idempotencyKey && options?.retryAmbiguousDelivery === true;
667
+ const retryAmbiguousDelivery = connection === void 0 && atomicToolOnly && !idempotencyKey && options?.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 : options?.maxRetries ?? (retryAmbiguousDelivery ? 2 : 0),
669
- ...atomicToolOnly && !idempotencyKey && options?.maxRetries === void 0 ? { executePolicyMaxRetries: 2 } : {},
670
- retryApiErrors: atomicToolOnly || options?.retryApiErrors === true,
671
- retryFromExecutePolicy: atomicToolOnly,
681
+ maxRetries: connection !== void 0 || idempotencyKey ? 0 : options?.maxRetries ?? (retryAmbiguousDelivery ? 2 : 0),
682
+ ...connection === void 0 && atomicToolOnly && !idempotencyKey && options?.maxRetries === void 0 ? { executePolicyMaxRetries: 2 } : {},
683
+ retryApiErrors: connection === void 0 && (atomicToolOnly || options?.retryApiErrors === true),
684
+ retryFromExecutePolicy: connection === void 0 && atomicToolOnly,
672
685
  retryAmbiguousDelivery,
673
686
  exactUrlOnly: true,
674
687
  toolId,
@@ -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 ToolExecutionError) && error instanceof DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
702
716
  throw new DeeplineError(
@@ -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 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 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 (!GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
2494
+ invalid("Enter a Google Workspace domain, such as example.com.");
2495
+ const email = options.verificationEmail?.trim().toLowerCase();
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 ? [...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
+ ...requestedScopes?.includes(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`;
@@ -3471,6 +3597,8 @@ var DeeplineClient = class _DeeplineClient {
3471
3597
  workspaces;
3472
3598
  /** Monitors namespace: access, catalog, deploy/check, and lifecycle. */
3473
3599
  monitors;
3600
+ /** Named workspace authorizations and provider setup wizard links. */
3601
+ integrations;
3474
3602
  /**
3475
3603
  * Create a low-level SDK client.
3476
3604
  *
@@ -3484,6 +3612,7 @@ var DeeplineClient = class _DeeplineClient {
3484
3612
  this.config = config;
3485
3613
  this.environment = 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,
@@ -5571,6 +5700,25 @@ var DeeplineClient = 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: options?.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 _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", {
@@ -6282,7 +6451,7 @@ var DeeplineClient = 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 DeeplineError(
6287
6456
  message,
6288
6457
  void 0,
@@ -6290,14 +6459,14 @@ var DeeplineClient = 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 _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
  }
@@ -7164,6 +7333,7 @@ var DeeplineClient = class _DeeplineClient {
7164
7333
  const body = {
7165
7334
  ...typeof definitionOrId === "string" ? {} : { definition: definitionOrId },
7166
7335
  ...options?.dryRun ? { dry_run: true } : {},
7336
+ ...options?.adoptExisting ? { adopt_existing: true } : {},
7167
7337
  ...options?.expectedGeneration !== void 0 ? { expected_generation: options.expectedGeneration } : {}
7168
7338
  };
7169
7339
  return this.http.request(