deepline 0.3.541 → 0.3.543

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 (243) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +106 -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 +17 -1
  8. package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
  9. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
  10. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
  11. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
  12. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  13. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
  14. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
  16. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
  17. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
  18. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
  19. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
  20. package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
  22. package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
  26. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
  28. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
  29. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
  38. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
  39. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
  40. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
  53. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
  54. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
  55. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
  56. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
  57. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
  59. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
  60. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
  61. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
  62. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
  63. package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
  64. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
  65. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
  66. package/dist/cli/{auth-WJXA7XGM.mjs → auth-ITAELTOA.mjs} +5 -5
  67. package/dist/cli/auth-S6B5WUU5.js +43 -0
  68. package/dist/cli/{billing-34IV5DSV.js → billing-33XVFDUJ.js} +101 -101
  69. package/dist/cli/{billing-SHS4HMWT.mjs → billing-WZ7RVZW4.mjs} +12 -12
  70. package/dist/cli/{chunk-UKO6POLZ.js → chunk-23D224GI.js} +37 -17
  71. package/dist/cli/{chunk-DF7ARQRB.mjs → chunk-274WKLSY.mjs} +2 -2
  72. package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
  73. package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
  74. package/dist/cli/{chunk-FVZ5Y5L6.js → chunk-2KTGZKRE.js} +18 -18
  75. package/dist/cli/{chunk-6TZEDCN7.js → chunk-2LNTKICO.js} +3 -3
  76. package/dist/cli/{chunk-FYQWTENQ.js → chunk-2NCJQEZH.js} +53 -53
  77. package/dist/cli/{chunk-CNBPATLI.js → chunk-3JZXU5OB.js} +5 -5
  78. package/dist/cli/{chunk-323I5KQ5.js → chunk-46BEBZ3M.js} +497 -328
  79. package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
  80. package/dist/cli/{chunk-XO2SGONT.mjs → chunk-4SKDSSPU.mjs} +2 -2
  81. package/dist/cli/{chunk-53QZ24DP.mjs → chunk-52YK3EII.mjs} +2 -2
  82. package/dist/cli/{chunk-S7NKIEHL.js → chunk-5MN3BKNB.js} +16 -16
  83. package/dist/cli/{chunk-XTR32PMA.mjs → chunk-5VIPTLRX.mjs} +1 -1
  84. package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
  85. package/dist/cli/{chunk-QI76LGE3.mjs → chunk-6SJZMMD5.mjs} +37 -190
  86. package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
  87. package/dist/cli/{chunk-GLINYHY7.mjs → chunk-AACKPOGA.mjs} +1 -1
  88. package/dist/cli/{chunk-Q66ADD4O.js → chunk-BGAUADV4.js} +41 -41
  89. package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
  90. package/dist/cli/{chunk-F3TLGM2U.js → chunk-C35NLLSA.js} +5 -5
  91. package/dist/cli/{chunk-LRPFCB2P.mjs → chunk-D6YAU3CF.mjs} +182 -13
  92. package/dist/cli/{chunk-FRPJSFNL.mjs → chunk-DH43ECTN.mjs} +7 -3
  93. package/dist/cli/{chunk-IZXMX65M.js → chunk-DI3GL3T6.js} +316 -469
  94. package/dist/cli/{chunk-OK4JMVTM.js → chunk-DUGTPVT7.js} +7 -7
  95. package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
  96. package/dist/cli/{chunk-KIYETQ6K.js → chunk-EHUG6EUT.js} +26 -26
  97. package/dist/cli/chunk-F6VSQ5LN.js +455 -0
  98. package/dist/cli/{chunk-JZNKEHXQ.mjs → chunk-FNW2SGPD.mjs} +2 -2
  99. package/dist/cli/{chunk-M6XIKHBS.js → chunk-GRCFX2EG.js} +4 -4
  100. package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
  101. package/dist/cli/{chunk-FTKX7OGB.mjs → chunk-HKJ26NRN.mjs} +5 -5
  102. package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
  103. package/dist/cli/{chunk-POZPEDW7.js → chunk-J2F6F5GL.js} +7 -7
  104. package/dist/cli/{chunk-7AUQSK24.mjs → chunk-JXG7HWBA.mjs} +1 -1
  105. package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
  106. package/dist/cli/{chunk-WIV3E6Y7.js → chunk-MCBUWK5K.js} +22 -22
  107. package/dist/cli/{chunk-2TAGAPLL.js → chunk-NHKP2NSU.js} +2 -2
  108. package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
  109. package/dist/cli/{chunk-UXXFCOE3.js → chunk-NLENABRU.js} +6 -6
  110. package/dist/cli/{chunk-DHC7EGI7.mjs → chunk-NR3O56FT.mjs} +5 -5
  111. package/dist/cli/{chunk-MPYM6TUO.js → chunk-O2KLWUNI.js} +44 -44
  112. package/dist/cli/{chunk-BMNLD63A.mjs → chunk-OAFKUHN5.mjs} +4 -4
  113. package/dist/cli/{chunk-RYYGNUNO.mjs → chunk-OELJKQOL.mjs} +24 -4
  114. package/dist/cli/{chunk-ZD673XAL.js → chunk-PX7XAVUC.js} +24 -20
  115. package/dist/cli/{chunk-FOCNY4GV.js → chunk-QFRMVI4S.js} +3 -3
  116. package/dist/cli/{chunk-AU7ZKXW5.mjs → chunk-R57UCXQG.mjs} +1 -1
  117. package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
  118. package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
  119. package/dist/cli/{chunk-BUCTWJBM.js → chunk-STXG2LFC.js} +2 -2
  120. package/dist/cli/{chunk-ECPCZVDM.mjs → chunk-SU4K4SUU.mjs} +1 -1
  121. package/dist/cli/{chunk-ABDXKELH.mjs → chunk-SYOPHFKB.mjs} +6 -6
  122. package/dist/cli/{chunk-H74CLEMB.mjs → chunk-SZNJENGT.mjs} +3 -3
  123. package/dist/cli/{chunk-5N4ENMYE.js → chunk-TBCNL2T5.js} +1 -1
  124. package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
  125. package/dist/cli/{chunk-C2LYJ3EX.js → chunk-UJ6GOV7K.js} +13 -13
  126. package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
  127. package/dist/cli/{chunk-6PJAC3P5.mjs → chunk-VSJEOSYL.mjs} +1 -1
  128. package/dist/cli/{chunk-NB4AIXEA.mjs → chunk-W2OPPSAZ.mjs} +3 -3
  129. package/dist/cli/{chunk-5LNWLEO3.mjs → chunk-XBM3KABD.mjs} +3 -3
  130. package/dist/cli/{chunk-VMIIUMAN.mjs → chunk-XFPVFWZR.mjs} +1 -1
  131. package/dist/cli/{chunk-UC5QFQGC.mjs → chunk-XSN6BAZT.mjs} +5 -5
  132. package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
  133. package/dist/cli/{chunk-S6FF7Q5P.js → chunk-YE3T73BV.js} +10 -10
  134. package/dist/cli/{chunk-CY5LW6DW.js → chunk-YJYKZ2U3.js} +2 -2
  135. package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
  136. package/dist/cli/{chunk-ZL2DER5D.mjs → chunk-ZRT2PNYY.mjs} +1 -1
  137. package/dist/cli/{chunk-WZMG2M65.mjs → chunk-ZSPBJB7I.mjs} +4 -4
  138. package/dist/cli/command-docs.js +3 -3
  139. package/dist/cli/command-docs.mjs +2 -2
  140. package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
  141. package/dist/cli/{concurrent-runs-help-ZJ77SAEU.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
  142. package/dist/cli/{csv-PX7F5YJN.mjs → csv-5QW2HPHT.mjs} +4 -4
  143. package/dist/cli/{csv-MJLIZZOR.js → csv-SSOFTXHU.js} +13 -13
  144. package/dist/cli/{db-BNCNAY4G.js → db-4LK5AJNO.js} +29 -29
  145. package/dist/cli/{db-KPKGTHPA.mjs → db-K2JMR6EM.mjs} +8 -8
  146. package/dist/cli/describe-AC6PLEFP.js +50 -0
  147. package/dist/cli/describe-AXHQZHTT.mjs +50 -0
  148. package/dist/cli/describe-core.d.mts +3 -3
  149. package/dist/cli/describe-core.d.ts +3 -3
  150. package/dist/cli/describe-core.js +3 -3
  151. package/dist/cli/describe-core.mjs +2 -2
  152. package/dist/cli/{executions-YNOFR7T2.js → executions-AATJQQAQ.js} +10 -10
  153. package/dist/cli/{executions-NMQY4GEY.mjs → executions-FY2XTX2W.mjs} +8 -8
  154. package/dist/cli/{feedback-LWYEO5LL.mjs → feedback-MKBPRGS6.mjs} +6 -6
  155. package/dist/cli/{feedback-RCP5DPO6.js → feedback-QPVJER75.js} +14 -14
  156. package/dist/cli/{git-3O4PFP3Q.mjs → git-AGRFZR3K.mjs} +5 -5
  157. package/dist/cli/git-RUYFQEJX.js +25 -0
  158. package/dist/cli/index.js +150 -146
  159. package/dist/cli/index.mjs +49 -45
  160. package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
  161. package/dist/cli/integrations-R6OUFZXI.js +98 -0
  162. package/dist/cli/{legacy-noops-KFP674JT.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
  163. package/dist/cli/{legacy-noops-ZPZRG366.js → legacy-noops-H7INM2QN.js} +9 -9
  164. package/dist/cli/{mcp-OCYUXQ6L.mjs → mcp-2Z2YVOLK.mjs} +72 -15
  165. package/dist/cli/{mcp-HCXDW6PL.js → mcp-33F7D7WI.js} +89 -32
  166. package/dist/cli/{monitors-7Q7YT22Y.js → monitors-KDUJHAKJ.js} +102 -102
  167. package/dist/cli/{monitors-V5KJIJJE.mjs → monitors-NZD2WIKK.mjs} +9 -9
  168. package/dist/cli/{org-S37K6QYH.js → org-4PQGHLEB.js} +164 -88
  169. package/dist/cli/{org-C3QLHX7U.mjs → org-EJW45RUA.mjs} +84 -8
  170. package/dist/cli/{play-MXQ2DKML.mjs → play-3CM5RT5J.mjs} +44 -25
  171. package/dist/cli/{play-MLREAYHJ.js → play-MLHMQL4G.js} +374 -355
  172. package/dist/cli/{providers-FDJ4ZOST.mjs → providers-BHYBJI4R.mjs} +10 -9
  173. package/dist/cli/{providers-PPDWY7DH.js → providers-YBJG7277.js} +13 -12
  174. package/dist/cli/{quickstart-2Z57AMB7.mjs → quickstart-LL3MR562.mjs} +4 -4
  175. package/dist/cli/{quickstart-BOWQM7S7.js → quickstart-O7L2NNGJ.js} +6 -6
  176. package/dist/cli/{run-66HXNJNV.js → run-HJ2AR6CM.js} +49 -48
  177. package/dist/cli/{run-5RNJGPQ2.mjs → run-OK545H5Q.mjs} +28 -27
  178. package/dist/cli/search-UUNS6BCC.js +32 -0
  179. package/dist/cli/{search-7G4FYQYO.mjs → search-Z5ZKMRTX.mjs} +9 -9
  180. package/dist/cli/{search-output-6K4FHCVI.mjs → search-output-Q5VHNUWG.mjs} +4 -4
  181. package/dist/cli/{search-output-L6ICQDBL.js → search-output-SVW4DETG.js} +6 -6
  182. package/dist/cli/{secrets-PWFJKF7G.js → secrets-ENQWMCB5.js} +17 -17
  183. package/dist/cli/{secrets-FTQPCU7O.mjs → secrets-QIKIEFWB.mjs} +8 -8
  184. package/dist/cli/{sessions-YSSAAQVJ.mjs → sessions-AETO22RF.mjs} +6 -6
  185. package/dist/cli/sessions-FNSUDERA.js +22 -0
  186. package/dist/cli/{settings-KN7GNZ5J.mjs → settings-G5RGRPFV.mjs} +16 -16
  187. package/dist/cli/{settings-CZEMF2WD.js → settings-OFLIFTMZ.js} +89 -89
  188. package/dist/cli/{setup-5WLHGH57.mjs → setup-G4N3X6KG.mjs} +9 -9
  189. package/dist/cli/{setup-RW4X6DX4.js → setup-QW7Y62XD.js} +49 -49
  190. package/dist/cli/skills-3IXIY2IV.js +36 -0
  191. package/dist/cli/{skills-DLVI7IZK.mjs → skills-QRFQGHNA.mjs} +7 -7
  192. package/dist/cli/{tools-JVYQF7P3.mjs → tools-52BH7UTF.mjs} +20 -19
  193. package/dist/cli/tools-MYBUMPKH.js +57 -0
  194. package/dist/cli/update-GT7574UU.js +34 -0
  195. package/dist/cli/{update-XKLXU7YS.mjs → update-SDGZLAGL.mjs} +9 -9
  196. package/dist/cli/{views-QRRCWP6B.mjs → views-3BIJFJMQ.mjs} +8 -8
  197. package/dist/cli/{views-YNUYFS3S.js → views-5QKAWYPI.js} +23 -23
  198. package/dist/cli/{workflow-YUKADKCJ.js → workflow-G67RPWVY.js} +19 -19
  199. package/dist/cli/{workflow-KYFMA4LM.mjs → workflow-QAK773FR.mjs} +9 -9
  200. package/dist/{client-B1fixtK1.d.ts → client-D1ga52xq.d.ts} +1 -1
  201. package/dist/{client-CE4QBVbp.d.mts → client-bd4QQIXo.d.mts} +1 -1
  202. package/dist/{client-core-C-3FVlVq.d.ts → client-core-B6eMVx8h.d.ts} +335 -4
  203. package/dist/{client-core-2BkNBgrx.d.mts → client-core-CqfWNf2Q.d.mts} +335 -4
  204. package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
  205. package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
  206. package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
  207. package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
  208. package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
  209. package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
  210. package/dist/index.d.mts +7 -7
  211. package/dist/index.d.ts +7 -7
  212. package/dist/index.js +12 -12
  213. package/dist/index.mjs +8 -8
  214. package/dist/install-integrity.json +147 -133
  215. package/dist/plays/bundle-play-file.d.mts +3 -3
  216. package/dist/plays/bundle-play-file.d.ts +3 -3
  217. package/dist/plays/bundle-play-file.mjs +23 -4
  218. package/dist/plays/play-description.d.mts +2 -2
  219. package/dist/plays/play-description.d.ts +2 -2
  220. package/dist/plays/run-request.d.mts +2 -2
  221. package/dist/plays/run-request.d.ts +2 -2
  222. package/dist/plays/run-request.js +2 -2
  223. package/dist/plays/run-request.mjs +1 -1
  224. package/dist/release.d.mts +1 -1
  225. package/dist/release.d.ts +1 -1
  226. package/dist/release.js +2 -2
  227. package/dist/release.mjs +1 -1
  228. package/dist/server.d.mts +4 -4
  229. package/dist/server.d.ts +4 -4
  230. package/dist/server.js +7 -7
  231. package/dist/server.mjs +5 -5
  232. package/package.json +1 -1
  233. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
  234. package/dist/cli/auth-V76O674K.js +0 -43
  235. package/dist/cli/concurrent-runs-help-MFEPUP6Y.js +0 -21
  236. package/dist/cli/describe-5OUJA5TH.mjs +0 -49
  237. package/dist/cli/describe-7MF5AHIU.js +0 -49
  238. package/dist/cli/git-WLQ3BS6K.js +0 -25
  239. package/dist/cli/search-LTUIIV6W.js +0 -32
  240. package/dist/cli/sessions-2IVFGTPA.js +0 -22
  241. package/dist/cli/skills-WT42AZVH.js +0 -36
  242. package/dist/cli/tools-D6STYBQG.js +0 -56
  243. package/dist/cli/update-XTUKBC3J.js +0 -34
@@ -1,3 +1,13 @@
1
+ import {
2
+ createIntegrationsNamespace,
3
+ type IntegrationsNamespace,
4
+ } from './integrations';
5
+ import type {
6
+ CalendarDelegationChange,
7
+ CalendarAvailabilityInventory,
8
+ CalendarDelegationSettings,
9
+ CalendarDelegationUpdate,
10
+ } from '../../shared_libs/integration-contracts/calendar-delegation';
1
11
  import type {
2
12
  BillingEntitlements,
3
13
  IncludedCompute,
@@ -3187,6 +3197,8 @@ export class DeeplineClient {
3187
3197
  readonly workspaces: WorkspacesNamespace;
3188
3198
  /** Monitors namespace: access, catalog, deploy/check, and lifecycle. */
3189
3199
  readonly monitors: MonitorsNamespace;
3200
+ /** Named workspace authorizations and provider setup wizard links. */
3201
+ readonly integrations: IntegrationsNamespace;
3190
3202
 
3191
3203
  /**
3192
3204
  * Create a low-level SDK client.
@@ -3205,6 +3217,7 @@ export class DeeplineClient {
3205
3217
  this.config = config;
3206
3218
  this.environment = this.config.environment ?? process.env;
3207
3219
  this.http = http;
3220
+ this.integrations = createIntegrationsNamespace(this);
3208
3221
  this.playClient = new PlayClient(this.http, this.environment);
3209
3222
  this.toolCalls = new ToolCalls(
3210
3223
  this.http,
@@ -6087,11 +6100,70 @@ export class DeeplineClient {
6087
6100
  label: string;
6088
6101
  status: string;
6089
6102
  authorizationVersion: number;
6103
+ grantedScopes?: string[];
6090
6104
  }>;
6091
6105
  }> {
6092
6106
  return this.http.get('/api/v2/integrations/connections');
6093
6107
  }
6094
6108
 
6109
+ async listWorkspaceConnectionInventory(
6110
+ provider?: string,
6111
+ options?: { authorizationsOnly?: boolean },
6112
+ ): Promise<{
6113
+ connections: Array<{
6114
+ id: string;
6115
+ provider: string;
6116
+ owner: 'workspace';
6117
+ name: string | null;
6118
+ type: string;
6119
+ label: string;
6120
+ status: string;
6121
+ authorizationVersion?: number;
6122
+ scopes?: string[];
6123
+ domain?: string;
6124
+ }>;
6125
+ }> {
6126
+ const params = new URLSearchParams({
6127
+ view: options?.authorizationsOnly ? 'authorizations' : 'inventory',
6128
+ });
6129
+ if (provider) params.set('provider', provider);
6130
+ return this.http.get(`/api/v2/integrations/connections?${params}`);
6131
+ }
6132
+
6133
+ async saveWorkspaceApiKeyConnection(input: {
6134
+ provider: 'close';
6135
+ name: string;
6136
+ apiKey: string;
6137
+ action: 'connect' | 'rotate';
6138
+ authorizationVersion?: number;
6139
+ }): Promise<{
6140
+ connection: { id: string; name: string; authorizationVersion: number };
6141
+ }> {
6142
+ return this.http.post('/api/v2/integrations/connections', {
6143
+ ...input,
6144
+ owner: 'workspace',
6145
+ type: 'api_key',
6146
+ });
6147
+ }
6148
+
6149
+ async listManagedConnectionMembers(
6150
+ provider: 'hubspot' | 'google_calendar_availability',
6151
+ cursor?: string,
6152
+ ): Promise<{
6153
+ members: Array<{
6154
+ memberId: string;
6155
+ name: string;
6156
+ email: string;
6157
+ status: string;
6158
+ account: { label: string; portalId?: string } | null;
6159
+ }>;
6160
+ nextCursor: string | null;
6161
+ }> {
6162
+ const params = new URLSearchParams({ view: 'members', provider });
6163
+ if (cursor) params.set('cursor', cursor);
6164
+ return this.http.get(`/api/v2/integrations/connections?${params}`);
6165
+ }
6166
+
6095
6167
  /** List workspace members' personal HubSpot connection status as an admin. */
6096
6168
  async listPersonalHubSpotMembers(cursor?: string): Promise<{
6097
6169
  members: Array<{
@@ -6115,13 +6187,45 @@ export class DeeplineClient {
6115
6187
  );
6116
6188
  }
6117
6189
 
6190
+ /** Read the Google Workspace delegate grant and a page of selectable members. */
6191
+ async getCalendarDelegation(
6192
+ cursor?: string,
6193
+ name?: string,
6194
+ domain?: string,
6195
+ ): Promise<CalendarDelegationSettings> {
6196
+ const path = '/api/v2/integrations/calendar-availability/delegation';
6197
+ const params = new URLSearchParams();
6198
+ if (cursor) params.set('cursor', cursor);
6199
+ if (name) params.set('name', name);
6200
+ if (domain) params.set('domain', domain);
6201
+ return this.http.get(params.size ? `${path}?${params}` : path);
6202
+ }
6203
+
6204
+ async listCalendarAvailabilityConnections(): Promise<CalendarAvailabilityInventory> {
6205
+ return this.http.get(
6206
+ '/api/v2/integrations/calendar-availability/delegation?view=inventory',
6207
+ );
6208
+ }
6209
+
6210
+ /** Verify, disconnect, or remove a Workspace approval. Legacy roster inputs remain supported. */
6211
+ async changeCalendarDelegation(
6212
+ change: CalendarDelegationChange,
6213
+ ): Promise<CalendarDelegationUpdate> {
6214
+ return this.http.post(
6215
+ '/api/v2/integrations/calendar-availability/delegation',
6216
+ change,
6217
+ );
6218
+ }
6219
+
6118
6220
  /** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
6119
6221
  async manageWorkspaceIntegrationConnection(input: {
6120
- action: 'connect' | 'reconnect' | 'replace' | 'disconnect';
6222
+ action: 'connect' | 'reconnect' | 'replace' | 'disconnect' | 'remove';
6121
6223
  provider: 'hubspot' | 'google_calendar_availability';
6224
+ name?: string;
6225
+ autoName?: true;
6122
6226
  connectionId?: string;
6123
6227
  authorizationVersion?: number;
6124
- }): Promise<{ url?: string }> {
6228
+ }): Promise<{ url?: string; name?: string; status?: string }> {
6125
6229
  return this.http.post('/api/v2/integrations/connections', {
6126
6230
  ...input,
6127
6231
  owner: 'workspace',
@@ -435,3 +435,10 @@ export type {
435
435
  } from './runs/receipts';
436
436
 
437
437
  export type { WorkspaceReuseResult } from './client-core.js';
438
+
439
+ export type {
440
+ IntegrationsNamespace,
441
+ WorkspaceConnection,
442
+ IntegrationChangeOptions,
443
+ IntegrationChangeResult,
444
+ } from './integrations.js';
@@ -0,0 +1,198 @@
1
+ import type { CalendarDelegationChange } from '../../shared_libs/integration-contracts/calendar-delegation';
2
+ import {
3
+ GOOGLE_WORKSPACE_DOMAIN_PATTERN,
4
+ GOOGLE_WORKSPACE_BOOKING_SCOPES,
5
+ GOOGLE_WORKSPACE_BOOKING_SCOPE,
6
+ } from '../../shared_libs/integration-contracts/calendar-delegation';
7
+ import type { DeeplineClient } from './client-core';
8
+ import { DeeplineError } from './errors';
9
+
10
+ type IntegrationClient = Pick<
11
+ DeeplineClient,
12
+ | 'listWorkspaceConnectionInventory'
13
+ | 'getCalendarDelegation'
14
+ | 'changeCalendarDelegation'
15
+ | 'manageWorkspaceIntegrationConnection'
16
+ | 'getIntegrationConnectLink'
17
+ | 'listManagedConnectionMembers'
18
+ >;
19
+
20
+ const CALENDAR_PROVIDER = 'google_calendar_availability';
21
+ export type WorkspaceConnection = Awaited<
22
+ ReturnType<DeeplineClient['listWorkspaceConnectionInventory']>
23
+ >['connections'][number];
24
+ export type IntegrationChangeOptions = {
25
+ provider?: string;
26
+ verificationEmail?: string;
27
+ dryRun?: boolean;
28
+ booking?: boolean;
29
+ };
30
+
31
+ function invalid(message: string): never {
32
+ throw new DeeplineError(message, 400, 'INVALID_ARGUMENT');
33
+ }
34
+
35
+ async function findConnection(
36
+ client: IntegrationClient,
37
+ name: string,
38
+ provider?: string,
39
+ ): Promise<WorkspaceConnection> {
40
+ const { connections } = await client.listWorkspaceConnectionInventory(
41
+ provider,
42
+ { authorizationsOnly: true },
43
+ );
44
+ const matches = connections.filter(
45
+ (row) => row.name === name && (!provider || row.provider === provider),
46
+ );
47
+ if (matches.length === 0)
48
+ throw new DeeplineError(
49
+ `No workspace connection named ${JSON.stringify(name)}. Run deepline integrations list --json.`,
50
+ 404,
51
+ 'NOT_FOUND',
52
+ );
53
+ if (matches.length > 1)
54
+ invalid('This name exists for multiple providers. Pass --provider.');
55
+ return matches[0]!;
56
+ }
57
+
58
+ async function changeConnection(
59
+ client: IntegrationClient,
60
+ action: 'reconnect' | 'disconnect' | 'delete',
61
+ name: string,
62
+ options: IntegrationChangeOptions,
63
+ ) {
64
+ const row = await findConnection(client, name, options.provider);
65
+ if (
66
+ options.booking &&
67
+ (action !== 'reconnect' || row.type !== 'workspace_delegation')
68
+ )
69
+ invalid('Use --booking with Google Workspace verify or reconnect.');
70
+ if (row.type === 'workspace_delegation') {
71
+ if (row.provider !== CALENDAR_PROVIDER || !row.domain)
72
+ invalid('The workspace approval is missing its provider or domain.');
73
+ if (row.authorizationVersion === undefined)
74
+ invalid('The API did not return a workspace approval revision.');
75
+ if (action === 'reconnect') {
76
+ return verifyWorkspace(client, row.domain, options, row);
77
+ }
78
+ if (options.verificationEmail)
79
+ invalid('Use --verification-email with reconnect or verify.');
80
+ if (action === 'delete' && row.status !== 'disconnected')
81
+ invalid('Disconnect this approval before deleting it.');
82
+ const change: CalendarDelegationChange =
83
+ action === 'delete'
84
+ ? {
85
+ action: 'remove_workspace',
86
+ domain: row.domain,
87
+ connectionId: row.id,
88
+ grantRevision: row.authorizationVersion,
89
+ }
90
+ : {
91
+ action: 'disable_workspace',
92
+ domain: row.domain,
93
+ connectionId: row.id,
94
+ grantRevision: row.authorizationVersion,
95
+ };
96
+ if (options.dryRun) return change;
97
+ return client.changeCalendarDelegation(change);
98
+ }
99
+ if (options.verificationEmail)
100
+ invalid('--verification-email applies to Google Workspace approvals.');
101
+ if (
102
+ row.type !== 'oauth' ||
103
+ (row.provider !== 'hubspot' && row.provider !== CALENDAR_PROVIDER)
104
+ )
105
+ invalid(
106
+ 'Manage this credential type through deepline integrations connect <provider> --link.',
107
+ );
108
+ if (row.authorizationVersion === undefined)
109
+ invalid('The API did not return a connection authorization version.');
110
+ const change = {
111
+ action: action === 'delete' ? ('remove' as const) : action,
112
+ provider: row.provider,
113
+ name,
114
+ connectionId: row.id,
115
+ authorizationVersion: row.authorizationVersion,
116
+ } satisfies Parameters<
117
+ IntegrationClient['manageWorkspaceIntegrationConnection']
118
+ >[0];
119
+ if (options.dryRun) return change;
120
+ return client.manageWorkspaceIntegrationConnection(change);
121
+ }
122
+
123
+ async function verifyWorkspace(
124
+ client: IntegrationClient,
125
+ domain: string,
126
+ options: IntegrationChangeOptions,
127
+ existing?: WorkspaceConnection,
128
+ ) {
129
+ domain = domain.trim().toLowerCase();
130
+ if (!GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(domain))
131
+ invalid('Enter a Google Workspace domain, such as example.com.');
132
+ const email = options.verificationEmail?.trim().toLowerCase();
133
+ if (
134
+ !email ||
135
+ email.length > 254 ||
136
+ !/^[^\s@]+@[^\s@]+$/.test(email) ||
137
+ email.split('@')[1] !== domain
138
+ )
139
+ invalid('Pass --verification-email with a work email in this domain.');
140
+ const settings = existing
141
+ ? {
142
+ grantRevision: existing.authorizationVersion,
143
+ connectionId: existing.id,
144
+ grantedScopes: existing.scopes,
145
+ }
146
+ : await client.getCalendarDelegation(undefined, undefined, domain);
147
+ if (settings.grantRevision === undefined)
148
+ invalid('The API did not return a workspace approval revision.');
149
+ const requestedScopes = options.booking
150
+ ? [...GOOGLE_WORKSPACE_BOOKING_SCOPES]
151
+ : settings.grantedScopes;
152
+ const change: CalendarDelegationChange = {
153
+ action: 'enable_workspace',
154
+ domain,
155
+ grantRevision: settings.grantRevision,
156
+ ...(settings.connectionId ? { connectionId: settings.connectionId } : {}),
157
+ verificationEmail: email,
158
+ ...(requestedScopes?.includes(GOOGLE_WORKSPACE_BOOKING_SCOPE)
159
+ ? { requestedScopes }
160
+ : {}),
161
+ };
162
+ if (options.dryRun) return change;
163
+ return client.changeCalendarDelegation(change);
164
+ }
165
+
166
+ /** Workspace authorization management. Personal setup completes in the returned dashboard wizard. */
167
+ export function createIntegrationsNamespace(client: IntegrationClient) {
168
+ return {
169
+ list: (options: { provider?: string } = {}) =>
170
+ client.listWorkspaceConnectionInventory(options.provider, {
171
+ authorizationsOnly: true,
172
+ }),
173
+ get: (name: string, options: { provider?: string } = {}) =>
174
+ findConnection(client, name, options.provider),
175
+ connect: (provider: string) => client.getIntegrationConnectLink(provider),
176
+ reconnect: (name: string, options: IntegrationChangeOptions = {}) =>
177
+ changeConnection(client, 'reconnect', name, options),
178
+ disconnect: (name: string, options: IntegrationChangeOptions = {}) =>
179
+ changeConnection(client, 'disconnect', name, options),
180
+ delete: (name: string, options: IntegrationChangeOptions = {}) =>
181
+ changeConnection(client, 'delete', name, options),
182
+ verify: (
183
+ domain: string,
184
+ options: IntegrationChangeOptions & { verificationEmail: string },
185
+ ) => verifyWorkspace(client, domain, options),
186
+ members: (
187
+ provider: 'hubspot' | 'google_calendar_availability',
188
+ options: { cursor?: string } = {},
189
+ ) => client.listManagedConnectionMembers(provider, options.cursor),
190
+ };
191
+ }
192
+
193
+ export type IntegrationsNamespace = ReturnType<
194
+ typeof createIntegrationsNamespace
195
+ >;
196
+ export type IntegrationChangeResult = Awaited<
197
+ ReturnType<IntegrationsNamespace['disconnect']>
198
+ >;
@@ -202,6 +202,9 @@ export function buildPlayRunStartBody(
202
202
  : {}),
203
203
  ...(request.force ? { force: true } : {}),
204
204
  ...(request.forceToolRefresh === true ? { forceToolRefresh: true } : {}),
205
+ ...(typeof request.cacheReuseWindowSeconds === 'number'
206
+ ? { cacheReuseWindowSeconds: request.cacheReuseWindowSeconds }
207
+ : {}),
205
208
  ...(typeof request.maxConcurrentExternalCalls === 'number'
206
209
  ? { maxConcurrentExternalCalls: request.maxConcurrentExternalCalls }
207
210
  : {}),
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
205
205
  // getters keep their established compatibility behavior.
206
206
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
207
207
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
208
- version: '0.3.541',
208
+ version: '0.3.543',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -1,4 +1,5 @@
1
1
  import { resolveLookupClientTimeoutMs } from '../../shared_libs/integration-contracts/lookup-execution-policy.js';
2
+ import { isToolConnectionName } from '../../shared_libs/integration-contracts/tool-connection.js';
2
3
  import type { ToolResultBilling } from '../../shared_libs/plays/tool-result-types.js';
3
4
  import {
4
5
  parseExecuteServerTiming,
@@ -121,6 +122,7 @@ function executionRecoveryError(input: {
121
122
  const DEEPLINEAGENT_EXECUTE_TIMEOUT_MS = 15 * 60 * 1000;
122
123
 
123
124
  export type ExecuteToolRawOptions = {
125
+ connection?: string;
124
126
  includeToolMetadata?: boolean;
125
127
  /** Use the atomic-tools endpoint, which rejects Plays before charge admission. */
126
128
  atomicToolOnly?: boolean;
@@ -352,6 +354,19 @@ export class ToolCalls {
352
354
  input: Record<string, unknown>,
353
355
  options?: ExecuteToolRawOptions,
354
356
  ): Promise<ToolExecution<TData, TMeta>> {
357
+ const connection = options?.connection;
358
+ if (
359
+ connection !== undefined &&
360
+ (!isToolConnectionName(connection) ||
361
+ options?.idempotencyKey !== undefined ||
362
+ options?.recover)
363
+ ) {
364
+ throw new DeeplineError(
365
+ 'Use a valid workspace connection name without execution recovery.',
366
+ 400,
367
+ 'NAMED_CONNECTION_INVALID',
368
+ );
369
+ }
355
370
  if (options?.cliInvocationId !== undefined) {
356
371
  validateCliInvocationId(options.cliInvocationId);
357
372
  }
@@ -463,6 +478,7 @@ export class ToolCalls {
463
478
  let useLegacyEndpoint = idempotencyKey === undefined;
464
479
  const atomicToolOnly = options?.atomicToolOnly === true;
465
480
  const retryAmbiguousDelivery =
481
+ connection === undefined &&
466
482
  atomicToolOnly &&
467
483
  !idempotencyKey &&
468
484
  options?.retryAmbiguousDelivery === true;
@@ -473,28 +489,35 @@ export class ToolCalls {
473
489
  let atomicToolsSupported = false;
474
490
  const post = () =>
475
491
  this.http.post<ToolExecution<TData, TMeta>>(
476
- atomicToolOnly
477
- ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute`
478
- : useLegacyEndpoint
479
- ? legacyEndpoint
480
- : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey!)}?tool_id=${encodeURIComponent(toolId)}`,
492
+ connection !== undefined
493
+ ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute-with-connection`
494
+ : atomicToolOnly
495
+ ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute`
496
+ : useLegacyEndpoint
497
+ ? legacyEndpoint
498
+ : `/api/v2/executions/by-key/${encodeURIComponent(idempotencyKey!)}?tool_id=${encodeURIComponent(toolId)}`,
481
499
  {
482
500
  payload: inputSnapshot,
501
+ ...(connection !== undefined ? { connection } : {}),
483
502
  ...(metadataSnapshot ? { metadata: metadataSnapshot } : {}),
484
503
  },
485
504
  headers,
486
505
  {
487
506
  timeout: requestTimeoutMs,
488
- maxRetries: idempotencyKey
489
- ? 0
490
- : (options?.maxRetries ?? (retryAmbiguousDelivery ? 2 : 0)),
491
- ...(atomicToolOnly &&
507
+ maxRetries:
508
+ connection !== undefined || idempotencyKey
509
+ ? 0
510
+ : (options?.maxRetries ?? (retryAmbiguousDelivery ? 2 : 0)),
511
+ ...(connection === undefined &&
512
+ atomicToolOnly &&
492
513
  !idempotencyKey &&
493
514
  options?.maxRetries === undefined
494
515
  ? { executePolicyMaxRetries: 2 }
495
516
  : {}),
496
- retryApiErrors: atomicToolOnly || options?.retryApiErrors === true,
497
- retryFromExecutePolicy: atomicToolOnly,
517
+ retryApiErrors:
518
+ connection === undefined &&
519
+ (atomicToolOnly || options?.retryApiErrors === true),
520
+ retryFromExecutePolicy: connection === undefined && atomicToolOnly,
498
521
  retryAmbiguousDelivery,
499
522
  exactUrlOnly: true,
500
523
  toolId,
@@ -529,6 +552,7 @@ export class ToolCalls {
529
552
  try {
530
553
  return await post();
531
554
  } catch (error) {
555
+ if (connection !== undefined) throw error;
532
556
  if (atomicToolOnly) {
533
557
  if (
534
558
  !atomicToolsSupported &&
@@ -209,6 +209,8 @@ export interface ProviderDefinition {
209
209
  displayName: string;
210
210
  toolCount: number;
211
211
  categories: string[];
212
+ /** Present when the provider is part of the Beta Integrations rollout. */
213
+ beta?: true;
212
214
  /** Present for providers in the recent-additions ledger. */
213
215
  version?: string;
214
216
  /** ISO-8601 date on which this provider was added. */
@@ -587,7 +589,13 @@ export interface SearchOptions extends ToolSearchOptions {
587
589
  export interface SearchResultItem {
588
590
  /** Tool id for tools and monitor types, play reference, or `docs/<path>`. */
589
591
  id: string;
590
- kind: 'tool' | 'monitor_type' | 'prebuilt_play' | 'custom_play' | 'doc';
592
+ kind:
593
+ | 'tool'
594
+ | 'monitor_type'
595
+ | 'prebuilt_play'
596
+ | 'custom_play'
597
+ | 'doc'
598
+ | 'mcp_tool';
591
599
  displayName?: string;
592
600
  description?: string;
593
601
  [field: string]: unknown;
@@ -1256,6 +1264,12 @@ export interface StopPlayRunResult {
1256
1264
  hitlCancelledCount: number;
1257
1265
  /** True if HITL state or its same-message Slack card still needs retrying. */
1258
1266
  hitlCancellationPending?: boolean;
1267
+ /** Managed message-wait rows cancelled in this stop request. */
1268
+ communicationCancelledCount?: number;
1269
+ /** The count is a lower bound; the durable Run fence already covers all waits. */
1270
+ communicationCancelledCountPartial?: boolean;
1271
+ /** True when managed message-wait cleanup needs another stop request. */
1272
+ communicationCancellationPending?: boolean;
1259
1273
  /**
1260
1274
  * True only when the scheduler and the canonical run ledger disagree and
1261
1275
  * the server could not confirm the stop.
@@ -2258,6 +2272,8 @@ export interface StartPlayRunRequest {
2258
2272
  force?: boolean;
2259
2273
  /** Explicit cache-bypass flag for durable dataset and tool-call reuse. */
2260
2274
  forceToolRefresh?: boolean;
2275
+ /** @internal Requires the `play_run.cache_reuse_window` capability. */
2276
+ cacheReuseWindowSeconds?: number;
2261
2277
  /**
2262
2278
  * Per-run ceiling for concurrently resident provider-tool executions and
2263
2279
  * direct ctx.fetch calls. The server validates the supported range.
@@ -0,0 +1,132 @@
1
+ export const CALENDAR_DELEGATION_ROSTER_LIMIT = 10;
2
+ export const GOOGLE_WORKSPACE_AVAILABILITY_SCOPE =
3
+ 'https://www.googleapis.com/auth/calendar.freebusy';
4
+ export const GOOGLE_WORKSPACE_BOOKING_SCOPE =
5
+ 'https://www.googleapis.com/auth/calendar.events.owned';
6
+ export const GOOGLE_WORKSPACE_BOOKING_SCOPES = [
7
+ GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
8
+ GOOGLE_WORKSPACE_BOOKING_SCOPE,
9
+ ] as const;
10
+ export const GOOGLE_WORKSPACE_DOMAIN_PATTERN =
11
+ /^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
12
+
13
+ export type CalendarDelegationSettings = {
14
+ connectionId?: string;
15
+ name?: string;
16
+ label?: string;
17
+ allMembers?: boolean;
18
+ grantRevision?: number;
19
+ rosterLimit: number;
20
+ domain: string;
21
+ clientId: string;
22
+ scope: string;
23
+ grantedScopes?: string[];
24
+ enabled: boolean;
25
+ connectionEnabled?: boolean;
26
+ revision: number;
27
+ selectedMemberIds: string[];
28
+ verifiedAt: number | null;
29
+ members: Array<{
30
+ memberId: string;
31
+ name: string;
32
+ email: string;
33
+ eligible: boolean;
34
+ }>;
35
+ nextCursor: string | null;
36
+ };
37
+
38
+ /** @deprecated Calendar targets belong in Play inputs. Retained for saved Plays. */
39
+ export type NamedCalendarAvailability = {
40
+ id: string;
41
+ name: string;
42
+ label: string;
43
+ enabled: boolean;
44
+ revision: number;
45
+ allMembers: boolean;
46
+ memberCount: number;
47
+ domain?: string;
48
+ approvalEnabled?: boolean;
49
+ };
50
+
51
+ export type GoogleWorkspaceApproval = {
52
+ id?: string;
53
+ domain: string;
54
+ enabled: boolean;
55
+ revision: number;
56
+ grantedScopes?: string[];
57
+ };
58
+
59
+ export type CalendarAvailabilityInventory = {
60
+ connections: NamedCalendarAvailability[];
61
+ grantEnabled: boolean;
62
+ grantRevision: number;
63
+ approvals?: GoogleWorkspaceApproval[];
64
+ };
65
+
66
+ type NamedCalendarChange = {
67
+ name: string;
68
+ domain?: string;
69
+ connectionId?: string;
70
+ grantRevision: number;
71
+ };
72
+
73
+ export type CalendarDelegationChange =
74
+ | { action: 'enable'; revision: number; memberIds: string[] }
75
+ | { action: 'disable'; revision: number }
76
+ | (NamedCalendarChange & {
77
+ action: 'enable';
78
+ revision: number;
79
+ label: string;
80
+ memberIds: string[];
81
+ allMembers: boolean;
82
+ })
83
+ | (NamedCalendarChange & { action: 'disable' | 'remove'; revision: number })
84
+ | {
85
+ action: 'enable_workspace';
86
+ domain?: string;
87
+ grantRevision: number;
88
+ connectionId?: string;
89
+ memberIds: string[];
90
+ }
91
+ | {
92
+ action: 'enable_workspace';
93
+ domain?: string;
94
+ grantRevision: number;
95
+ connectionId?: string;
96
+ verificationEmail: string;
97
+ requestedScopes?: string[];
98
+ }
99
+ | {
100
+ action: 'disable_workspace';
101
+ domain?: string;
102
+ grantRevision: number;
103
+ connectionId?: string;
104
+ }
105
+ | {
106
+ action: 'remove_workspace';
107
+ domain: string;
108
+ grantRevision: number;
109
+ connectionId: string;
110
+ };
111
+
112
+ export type CalendarDelegationCheck = {
113
+ memberId: string;
114
+ readiness:
115
+ | 'ready'
116
+ | 'runtime_identity'
117
+ | 'signing'
118
+ | 'google_grant'
119
+ | 'primary_calendar';
120
+ };
121
+
122
+ export type CalendarDelegationUpdate =
123
+ | {
124
+ status: 'enabled' | 'disabled' | 'removed';
125
+ revision: number;
126
+ checks?: CalendarDelegationCheck[];
127
+ }
128
+ | {
129
+ status: 'validation_failed';
130
+ checks: CalendarDelegationCheck[];
131
+ readiness?: Exclude<CalendarDelegationCheck['readiness'], 'ready'>;
132
+ };
@@ -0,0 +1,13 @@
1
+ import { GOOGLE_WORKSPACE_DOMAIN_PATTERN } from './calendar-delegation';
2
+
3
+ const workspaceConnectionName = /^[a-z][a-z0-9-]{0,39}$/;
4
+
5
+ export const TOOL_CONNECTION_NAME_PATTERN = `^(?:${workspaceConnectionName.source.slice(1, -1)}|${GOOGLE_WORKSPACE_DOMAIN_PATTERN.source.slice(1, -1)})$`;
6
+
7
+ export function isToolConnectionName(value: unknown): value is string {
8
+ return (
9
+ typeof value === 'string' &&
10
+ (workspaceConnectionName.test(value) ||
11
+ GOOGLE_WORKSPACE_DOMAIN_PATTERN.test(value))
12
+ );
13
+ }
@@ -147,7 +147,7 @@
147
147
  "@deepline/product-notifications": "workspace:*",
148
148
  "@vercel/oidc": "^3.0.5",
149
149
  "@vercel/queue": "^0.4.0",
150
- "next": "16.4.1",
150
+ "next": "16.4.6",
151
151
  "pg": "^8.19.0",
152
152
  "react": "19.2.5",
153
153
  "@deepline/integration-contracts": "workspace:*"