deepline 0.3.546 → 0.3.548

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +13 -0
  2. package/dist/bundling-sources/sdk/src/index.ts +7 -1
  3. package/dist/bundling-sources/sdk/src/integrations.ts +17 -7
  4. package/dist/bundling-sources/sdk/src/play.ts +71 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +13 -4
  7. package/dist/bundling-sources/sdk/src/types.ts +33 -0
  8. package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +7 -0
  9. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +2 -0
  10. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
  11. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -1
  12. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +17 -2
  13. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +57 -5
  14. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +295 -52
  15. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -1
  16. package/dist/bundling-sources/shared_libs/play-runtime/docflow-decision-tracker.ts +135 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/docflow-fail-open.ts +177 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/docflow-node-io.ts +99 -2
  19. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -10
  20. package/dist/bundling-sources/shared_libs/play-runtime/fenced-call-diagnostics.ts +211 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +52 -14
  22. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +68 -2
  23. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +18 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +68 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +100 -3
  26. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +9 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +48 -0
  28. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
  29. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +716 -51
  30. package/dist/bundling-sources/shared_libs/plays/docflow-decision-arms.ts +146 -0
  31. package/dist/bundling-sources/shared_libs/plays/docflow-flow-order.ts +94 -0
  32. package/dist/bundling-sources/shared_libs/plays/docflow-unreached-reason.ts +10 -1
  33. package/dist/bundling-sources/shared_libs/plays/docflow.ts +787 -117
  34. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +8 -2
  35. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -0
  36. package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +13 -0
  37. package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +25 -0
  38. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +3 -0
  39. package/dist/bundling-sources/shared_libs/security/email-domain.ts +24 -0
  40. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +56 -0
  41. package/dist/cli/auth-7UJFY5BY.js +43 -0
  42. package/dist/cli/{auth-KFWG72AZ.mjs → auth-YOOVLLUL.mjs} +5 -5
  43. package/dist/cli/{billing-MMZ336HO.mjs → billing-2NCNX6L2.mjs} +10 -10
  44. package/dist/cli/{billing-OQVOAZ4S.js → billing-HETIOUD6.js} +96 -96
  45. package/dist/cli/{chunk-JVOUQFHT.js → chunk-2OG2KBYJ.js} +1 -1
  46. package/dist/cli/{chunk-JA633HRV.mjs → chunk-3QRU6RY7.mjs} +3 -3
  47. package/dist/cli/{chunk-TI6DTURF.js → chunk-4WAM6TLD.js} +7 -1
  48. package/dist/cli/{chunk-RO66FPTS.mjs → chunk-53QLWPZK.mjs} +1 -1
  49. package/dist/cli/{chunk-6LG7MLJ2.js → chunk-5OJOFUMO.js} +44 -44
  50. package/dist/cli/{chunk-F2VEFMU5.js → chunk-5XFJBIQT.js} +13 -13
  51. package/dist/cli/{chunk-UQJBV5PM.js → chunk-5XXPP3PR.js} +10 -10
  52. package/dist/cli/{chunk-6FBDTYR2.mjs → chunk-64BFUBXX.mjs} +2 -2
  53. package/dist/cli/{chunk-VAT2SXFF.js → chunk-6GIZNOXQ.js} +12 -12
  54. package/dist/cli/{chunk-7MY7KWJS.mjs → chunk-7AJ5V3BK.mjs} +1 -1
  55. package/dist/cli/{chunk-MEGHIX4M.js → chunk-7H6TQ6W2.js} +5 -5
  56. package/dist/cli/{chunk-PMDHY2YK.js → chunk-7JIOJLTS.js} +7 -7
  57. package/dist/cli/{chunk-EEJHB76U.js → chunk-7UJZWI5Z.js} +12 -12
  58. package/dist/cli/{chunk-X5KOHDJN.mjs → chunk-ATTURFOV.mjs} +1 -1
  59. package/dist/cli/{chunk-SH32HL7I.js → chunk-AUYBBFPT.js} +53 -53
  60. package/dist/cli/{chunk-JCWNF44W.js → chunk-BDBEEV6X.js} +22 -22
  61. package/dist/cli/{chunk-WKHPLBJK.js → chunk-BWJZ4NQJ.js} +15 -15
  62. package/dist/cli/{chunk-2JHYYB3F.js → chunk-CSPHSNBW.js} +3 -3
  63. package/dist/cli/{chunk-4AZLGNXV.js → chunk-CXZLHBNK.js} +4 -4
  64. package/dist/cli/{chunk-J65HJCJO.mjs → chunk-F4ON5COB.mjs} +2 -2
  65. package/dist/cli/{chunk-KUK7ARXA.mjs → chunk-FMQA7UZZ.mjs} +2 -2
  66. package/dist/cli/{chunk-UREAIHUU.mjs → chunk-FUUYWEF4.mjs} +3 -3
  67. package/dist/cli/{chunk-HXIR3VQL.mjs → chunk-FZHMNK6F.mjs} +7 -1
  68. package/dist/cli/{chunk-PU3ZAG6V.mjs → chunk-GCEGQ7TQ.mjs} +1 -1
  69. package/dist/cli/{chunk-BLYW6FFB.js → chunk-GJA2PRHJ.js} +2 -2
  70. package/dist/cli/{chunk-TBWYZOSV.js → chunk-GUIYFOG2.js} +3 -3
  71. package/dist/cli/{chunk-BTFUAGHC.js → chunk-HDLMX7SG.js} +16 -16
  72. package/dist/cli/{chunk-VTK3HGMN.mjs → chunk-HIMZ57QD.mjs} +5 -5
  73. package/dist/cli/{chunk-JYG4XZLT.js → chunk-HTZIJORU.js} +99 -99
  74. package/dist/cli/{chunk-VPERQ3U6.mjs → chunk-HU3DDLGD.mjs} +5 -5
  75. package/dist/cli/{chunk-H7Q5IDO3.js → chunk-I2JIWKCQ.js} +20 -20
  76. package/dist/cli/{chunk-MXQP7CXZ.js → chunk-IIWXBRDK.js} +3 -3
  77. package/dist/cli/{chunk-MI7X6V6V.mjs → chunk-IQBXX54G.mjs} +3 -3
  78. package/dist/cli/{chunk-SYTWWVIQ.js → chunk-JQWX377P.js} +5 -5
  79. package/dist/cli/{chunk-Z3UEBFIN.js → chunk-LAVPP6WD.js} +41 -41
  80. package/dist/cli/{chunk-JCH4UNNS.js → chunk-M2OZORIH.js} +2 -2
  81. package/dist/cli/{chunk-Z7SXGOIQ.mjs → chunk-MF7PCM6C.mjs} +1 -1
  82. package/dist/cli/{chunk-7ZW67ME6.mjs → chunk-MQSKSISW.mjs} +1 -1
  83. package/dist/cli/{chunk-JARZ47OP.mjs → chunk-MWQ4WWZF.mjs} +2 -2
  84. package/dist/cli/{chunk-EEG46QZY.mjs → chunk-NFMX7BRF.mjs} +2 -2
  85. package/dist/cli/{chunk-VXTTAYOT.mjs → chunk-OGDQFVCP.mjs} +3 -3
  86. package/dist/cli/{chunk-3DUNNZB6.mjs → chunk-OQCYSLML.mjs} +4 -4
  87. package/dist/cli/{chunk-5W4ENHWM.js → chunk-PVE3A2BO.js} +285 -264
  88. package/dist/cli/{chunk-F5YQXCP3.js → chunk-PVQCX6KQ.js} +50 -7
  89. package/dist/cli/{chunk-GYTSDSQD.mjs → chunk-QQBRXMZM.mjs} +11 -11
  90. package/dist/cli/{chunk-6Y5TU3R7.mjs → chunk-QZ74ZC55.mjs} +1 -1
  91. package/dist/cli/{chunk-5OEFXAKP.mjs → chunk-RMCCB3XY.mjs} +50 -7
  92. package/dist/cli/{chunk-5V7NZKGG.js → chunk-T3RDWG5J.js} +2 -2
  93. package/dist/cli/{chunk-OAKWSLKS.mjs → chunk-TKGFHRHE.mjs} +28 -7
  94. package/dist/cli/{chunk-HJR2DDJS.mjs → chunk-U35ZLVBA.mjs} +2 -2
  95. package/dist/cli/{chunk-ND7SFRQL.js → chunk-U7HJXE6Y.js} +2 -2
  96. package/dist/cli/{chunk-LX2TC3HO.mjs → chunk-UBQQR56I.mjs} +4 -4
  97. package/dist/cli/{chunk-5VNQMVCU.js → chunk-VK2GSTRN.js} +26 -26
  98. package/dist/cli/{chunk-K2XELBPF.mjs → chunk-VSACOMIA.mjs} +5 -5
  99. package/dist/cli/{chunk-IVWU7SJC.js → chunk-WI4MCR7M.js} +5 -5
  100. package/dist/cli/{chunk-LIJKRDDG.js → chunk-WIHQAZPV.js} +6 -6
  101. package/dist/cli/{chunk-LHE2TSV6.mjs → chunk-WVZF4DU7.mjs} +1 -1
  102. package/dist/cli/{chunk-2HSZCQMT.mjs → chunk-WYT3H6JD.mjs} +1 -1
  103. package/dist/cli/{chunk-GOOF7E2B.mjs → chunk-XKEBQVCP.mjs} +5 -5
  104. package/dist/cli/{chunk-P7A3H6G5.mjs → chunk-XU3D2KFR.mjs} +1 -1
  105. package/dist/cli/command-docs.js +2 -2
  106. package/dist/cli/command-docs.mjs +1 -1
  107. package/dist/cli/concurrent-runs-help-A2IQVZRJ.js +21 -0
  108. package/dist/cli/{concurrent-runs-help-C2O5YKQA.mjs → concurrent-runs-help-FDCCZ45D.mjs} +6 -6
  109. package/dist/cli/{csv-Z4DNGR54.mjs → csv-GJYLQ52D.mjs} +4 -4
  110. package/dist/cli/{csv-MJDNOIQJ.js → csv-OCEQWZO3.js} +13 -13
  111. package/dist/cli/{db-4RL2BNOF.mjs → db-5MA2UUHQ.mjs} +7 -7
  112. package/dist/cli/{db-S5QVPK5E.js → db-G5QGXFAX.js} +28 -28
  113. package/dist/cli/{describe-L4P5SZLQ.mjs → describe-4DOJ4DHA.mjs} +19 -19
  114. package/dist/cli/describe-SD7DRTBW.js +50 -0
  115. package/dist/cli/describe-core.d.mts +4 -4
  116. package/dist/cli/describe-core.d.ts +4 -4
  117. package/dist/cli/{executions-RR6O3XK5.mjs → executions-C7SMBHHB.mjs} +7 -7
  118. package/dist/cli/{executions-MFZ2Z36O.js → executions-IYEVUPJI.js} +9 -9
  119. package/dist/cli/{feedback-YDAG7VH2.js → feedback-GYAF46GA.js} +14 -14
  120. package/dist/cli/{feedback-EQBQ3ABB.mjs → feedback-XUU2UKM6.mjs} +6 -6
  121. package/dist/cli/git-7YYVMY6L.js +25 -0
  122. package/dist/cli/{git-YGLCCU35.mjs → git-WVCMK5AH.mjs} +5 -5
  123. package/dist/cli/index.js +146 -146
  124. package/dist/cli/index.mjs +45 -45
  125. package/dist/cli/{integrations-FWYXSBHK.mjs → integrations-FXADGAX2.mjs} +11 -9
  126. package/dist/cli/{integrations-IQXYMRMW.js → integrations-YYBJJFVX.js} +19 -17
  127. package/dist/cli/{legacy-noops-I4YRIX5F.mjs → legacy-noops-LJY7LDUE.mjs} +6 -6
  128. package/dist/cli/{legacy-noops-U7LI7UXC.js → legacy-noops-REZCYES2.js} +9 -9
  129. package/dist/cli/{mcp-GX2UKKWU.js → mcp-L5PURE5S.js} +24 -24
  130. package/dist/cli/{mcp-QJBMB6VS.mjs → mcp-XSB3ZJFR.mjs} +4 -4
  131. package/dist/cli/{monitors-WCJYINGX.js → monitors-I5EIHSGV.js} +119 -101
  132. package/dist/cli/{monitors-Z6EGKYJP.mjs → monitors-UBPF2OLO.mjs} +26 -8
  133. package/dist/cli/{org-NNHICBR2.mjs → org-PHHIN2ER.mjs} +7 -7
  134. package/dist/cli/{org-7SKG423N.js → org-SGSTGGUD.js} +89 -89
  135. package/dist/cli/{play-CXDFPJ7Z.mjs → play-LEJNJLWY.mjs} +295 -67
  136. package/dist/cli/{play-4P4DTG3Q.js → play-WQEKMANL.js} +897 -669
  137. package/dist/cli/{providers-VQLQ7DTR.mjs → providers-3W26ZDAV.mjs} +7 -7
  138. package/dist/cli/{providers-EE4TUE3O.js → providers-RSDXBXIS.js} +10 -10
  139. package/dist/cli/{quickstart-IYNJRB5G.mjs → quickstart-LGJD2M36.mjs} +4 -4
  140. package/dist/cli/{quickstart-RVXHK4WA.js → quickstart-U3QX4EMI.js} +6 -6
  141. package/dist/cli/{run-R3F34KU3.js → run-F2UPZUJS.js} +45 -45
  142. package/dist/cli/{run-VBQPPMEX.mjs → run-YWZ3W5HK.mjs} +25 -25
  143. package/dist/cli/search-K6ANAXLF.js +32 -0
  144. package/dist/cli/{search-B7R62HX5.mjs → search-O2OJH3PY.mjs} +8 -8
  145. package/dist/cli/{search-output-LNQQXIGZ.mjs → search-output-H5BF6SJ3.mjs} +4 -4
  146. package/dist/cli/{search-output-LWHWEPOT.js → search-output-W7OCBYBU.js} +6 -6
  147. package/dist/cli/{secrets-NM3VAJLO.mjs → secrets-65XCAA7U.mjs} +7 -7
  148. package/dist/cli/{secrets-QBOZ7WTD.js → secrets-BN4GYVRI.js} +16 -16
  149. package/dist/cli/sessions-M52QWLA6.js +22 -0
  150. package/dist/cli/{sessions-R5BSIJ4I.mjs → sessions-SVEVESCQ.mjs} +6 -6
  151. package/dist/cli/{settings-POYWKNRD.js → settings-7YMDAFCN.js} +86 -86
  152. package/dist/cli/{settings-S4PN7WLY.mjs → settings-HAU2NP2H.mjs} +13 -13
  153. package/dist/cli/{setup-PFLXVBTL.mjs → setup-5RXHZ6YI.mjs} +9 -9
  154. package/dist/cli/{setup-VHB4Z654.js → setup-G37QXQGM.js} +49 -49
  155. package/dist/cli/{skills-W2TELEU7.mjs → skills-Q7A3XFAU.mjs} +7 -7
  156. package/dist/cli/skills-ZK4D5BJW.js +36 -0
  157. package/dist/cli/tools-DBZTLYFM.js +57 -0
  158. package/dist/cli/{tools-M4FA6N3Y.mjs → tools-ZG4NYRGB.mjs} +18 -18
  159. package/dist/cli/{update-W7LIHEA7.mjs → update-2CMZTZCL.mjs} +9 -9
  160. package/dist/cli/update-LC5HGEEH.js +34 -0
  161. package/dist/cli/{views-KTVPV6UP.mjs → views-A6IIY4OQ.mjs} +7 -7
  162. package/dist/cli/{views-DJXAGD7V.js → views-XUMDMDIE.js} +22 -22
  163. package/dist/cli/{workflow-NVZDJKH2.js → workflow-4EEW6MCD.js} +18 -18
  164. package/dist/cli/{workflow-LGKCRODX.mjs → workflow-74MYISHU.mjs} +8 -8
  165. package/dist/{client-Tp1LSULB.d.mts → client-D1uWA2Vc.d.mts} +1 -1
  166. package/dist/{client-CCyWJqAI.d.ts → client-Hz7SsBXs.d.ts} +1 -1
  167. package/dist/{client-core-BpYiYEfu.d.ts → client-core-D3Ad7Flt.d.ts} +554 -504
  168. package/dist/{client-core-D8eCZz3O.d.mts → client-core-Db_e63Hb.d.mts} +554 -504
  169. package/dist/{compiler-manifest-EBWEUj0b.d.ts → compiler-manifest-BqwVrOri.d.mts} +38 -18
  170. package/dist/{compiler-manifest-EBWEUj0b.d.mts → compiler-manifest-BqwVrOri.d.ts} +38 -18
  171. package/dist/{errors-CParKUQR.d.mts → errors-BU8FB99X.d.mts} +1 -1
  172. package/dist/{errors-Qt0OTA7_.d.ts → errors-DfVN_FUG.d.ts} +1 -1
  173. package/dist/{index-CoqDkIw0.d.ts → index-BGnvtYGc.d.ts} +6 -1
  174. package/dist/{index-BMUVCNp7.d.mts → index-DjZgwpGw.d.mts} +6 -1
  175. package/dist/index.d.mts +28 -8
  176. package/dist/index.d.ts +28 -8
  177. package/dist/index.js +64 -39
  178. package/dist/index.mjs +32 -7
  179. package/dist/install-integrity.json +133 -128
  180. package/dist/plays/bundle-play-file.d.mts +3 -3
  181. package/dist/plays/bundle-play-file.d.ts +3 -3
  182. package/dist/plays/bundle-play-file.mjs +620 -124
  183. package/dist/plays/play-description.d.mts +3 -3
  184. package/dist/plays/play-description.d.ts +3 -3
  185. package/dist/plays/run-request.d.mts +2 -2
  186. package/dist/plays/run-request.d.ts +2 -2
  187. package/dist/release.d.mts +1 -1
  188. package/dist/release.d.ts +1 -1
  189. package/dist/release.js +2 -2
  190. package/dist/release.mjs +1 -1
  191. package/dist/server.d.mts +4 -4
  192. package/dist/server.d.ts +4 -4
  193. package/dist/server.js +6 -6
  194. package/dist/server.mjs +4 -4
  195. package/package.json +1 -1
  196. package/dist/cli/auth-W32GMYND.js +0 -43
  197. package/dist/cli/concurrent-runs-help-6QT7ZR4W.js +0 -21
  198. package/dist/cli/describe-VLU2LUDJ.js +0 -50
  199. package/dist/cli/git-E6W44F5M.js +0 -25
  200. package/dist/cli/search-UUVFXZRA.js +0 -32
  201. package/dist/cli/sessions-K3PD73Q2.js +0 -22
  202. package/dist/cli/skills-QNE2EYT3.js +0 -36
  203. package/dist/cli/tools-3RLI4HGF.js +0 -57
  204. package/dist/cli/update-UT6KIW2W.js +0 -34
@@ -556,6 +556,8 @@ export type RunsListOptions = {
556
556
  status?: string;
557
557
  /** Mermaid node id; returns that node's latest settled input/output per run. Requires play. */
558
558
  node?: string;
559
+ /** Include each run's per-step outcome and the diagram's steps. Requires play; at most 50 runs per page. */
560
+ steps?: boolean;
559
561
  limit?: number;
560
562
  /** Zero-based page offset. Requires `play` because status-only inventory is not paginated. */
561
563
  offset?: number;
@@ -564,6 +566,10 @@ export type RunsListOptions = {
564
566
  /** One server page; legacy runs.list continues to return an array. */
565
567
  export type RunsListPage = {
566
568
  runs: PlayRunListItem[];
569
+ /** The diagram's steps in flow order, when `steps` was asked for. */
570
+ stepNodes?: import('./types').PlayRunStepNode[];
571
+ /** Set when `steps` was asked for but the Play draws no diagram. */
572
+ stepsUnavailable?: 'no_diagram';
567
573
  total?: number;
568
574
  offset?: number;
569
575
  limit?: number;
@@ -5309,6 +5315,13 @@ export class DeeplineClient {
5309
5315
  );
5310
5316
  params.set('node', node);
5311
5317
  }
5318
+ if (options.steps) {
5319
+ if (!playName)
5320
+ throw new Error('runs.list options.steps requires options.play.');
5321
+ if (node)
5322
+ throw new Error('runs.list options.steps cannot be combined with node.');
5323
+ params.set('steps', 'true');
5324
+ }
5312
5325
  if (typeof options.limit === 'number' && Number.isFinite(options.limit)) {
5313
5326
  params.set('limit', String(Math.max(1, Math.floor(options.limit))));
5314
5327
  }
@@ -315,7 +315,13 @@ export {
315
315
  readList,
316
316
  steps,
317
317
  } from './play';
318
- export { deepline as default, deepline, runScriptPlay } from './play';
318
+ export {
319
+ deepline as default,
320
+ deepline,
321
+ runScriptPlay,
322
+ __deeplineCurrentDocflowContext,
323
+ __deeplineRunWithDocflowContext,
324
+ } from './play';
319
325
  export type { ScriptPlayContext } from './play';
320
326
 
321
327
  // ——— Tool output processing ———
@@ -1,8 +1,9 @@
1
1
  import type { CalendarDelegationChange } from '../../shared_libs/integration-contracts/calendar-delegation';
2
2
  import {
3
3
  GOOGLE_WORKSPACE_DOMAIN_PATTERN,
4
- GOOGLE_WORKSPACE_BOOKING_SCOPES,
4
+ GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
5
5
  GOOGLE_WORKSPACE_BOOKING_SCOPE,
6
+ GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE,
6
7
  } from '../../shared_libs/integration-contracts/calendar-delegation';
7
8
  import type { DeeplineClient } from './client-core';
8
9
  import { DeeplineError } from './errors';
@@ -26,6 +27,7 @@ export type IntegrationChangeOptions = {
26
27
  verificationEmail?: string;
27
28
  dryRun?: boolean;
28
29
  booking?: boolean;
30
+ listCalendars?: boolean;
29
31
  };
30
32
 
31
33
  function invalid(message: string): never {
@@ -67,6 +69,11 @@ async function changeConnection(
67
69
  (action !== 'reconnect' || row.type !== 'workspace_delegation')
68
70
  )
69
71
  invalid('Use --booking with Google Workspace verify or reconnect.');
72
+ if (
73
+ options.listCalendars &&
74
+ (action !== 'reconnect' || row.type !== 'workspace_delegation')
75
+ )
76
+ invalid('Use --list-calendars with Google Workspace verify or reconnect.');
70
77
  if (row.type === 'workspace_delegation') {
71
78
  if (row.provider !== CALENDAR_PROVIDER || !row.domain)
72
79
  invalid('The workspace approval is missing its provider or domain.');
@@ -146,18 +153,21 @@ async function verifyWorkspace(
146
153
  : await client.getCalendarDelegation(undefined, undefined, domain);
147
154
  if (settings.grantRevision === undefined)
148
155
  invalid('The API did not return a workspace approval revision.');
149
- const requestedScopes = options.booking
150
- ? [...GOOGLE_WORKSPACE_BOOKING_SCOPES]
151
- : settings.grantedScopes;
156
+ const requestedScopes = [
157
+ ...new Set([
158
+ GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
159
+ ...(settings.grantedScopes ?? []),
160
+ ...(options.booking ? [GOOGLE_WORKSPACE_BOOKING_SCOPE] : []),
161
+ ...(options.listCalendars ? [GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE] : []),
162
+ ]),
163
+ ];
152
164
  const change: CalendarDelegationChange = {
153
165
  action: 'enable_workspace',
154
166
  domain,
155
167
  grantRevision: settings.grantRevision,
156
168
  ...(settings.connectionId ? { connectionId: settings.connectionId } : {}),
157
169
  verificationEmail: email,
158
- ...(requestedScopes?.includes(GOOGLE_WORKSPACE_BOOKING_SCOPE)
159
- ? { requestedScopes }
160
- : {}),
170
+ ...(requestedScopes.length > 1 ? { requestedScopes } : {}),
161
171
  };
162
172
  if (options.dryRun) return change;
163
173
  return client.changeCalendarDelegation(change);
@@ -516,6 +516,77 @@ type ScriptRun = {
516
516
 
517
517
  const scriptRuns = new AsyncLocalStorage<ScriptRun>();
518
518
 
519
+ /**
520
+ * The context of the definePlay run executing in this async flow. The bundler
521
+ * wraps an entry's run function in {@link __deeplineRunWithDocflowContext}
522
+ * only when an imported helper module holds a diagram box the entry draws.
523
+ */
524
+ /*
525
+ * Created on first use, not at module load: the SDK is bundled into every Play,
526
+ * and a module-level `new` is a side effect esbuild cannot drop, so a Play
527
+ * without helper-module diagram boxes would otherwise carry it.
528
+ */
529
+ let docflowRunContexts: AsyncLocalStorage<DeeplinePlayRuntimeContext> | null =
530
+ null;
531
+
532
+ /**
533
+ * Runs a play body with its context published for compiler-instrumented
534
+ * diagram boxes in helper modules, which have no context in scope.
535
+ *
536
+ * @internal
537
+ */
538
+ export function __deeplineRunWithDocflowContext<T>(
539
+ context: DeeplinePlayRuntimeContext,
540
+ body: () => T,
541
+ ): T {
542
+ docflowRunContexts ??= new AsyncLocalStorage<DeeplinePlayRuntimeContext>();
543
+ return docflowRunContexts.run(context, body);
544
+ }
545
+
546
+ /** What a helper module's compiler-injected box observation calls. */
547
+ type DocflowHelperObserver = {
548
+ __deeplineObserveDocflowNode(
549
+ nodeId: string,
550
+ inputCaptures: readonly unknown[],
551
+ outputPaths: readonly string[],
552
+ execute: () => unknown,
553
+ ): unknown;
554
+ };
555
+
556
+ /**
557
+ * The observer a helper module's diagram box reports through, or null outside
558
+ * a run (unit tests, module initialization), where the box is a pass-through.
559
+ * Observations are marked `origin: 'helper'` so the runtime can decline ones
560
+ * made inside a dataset row: maps observe at the node level (ADR 0016).
561
+ *
562
+ * @internal
563
+ */
564
+ export function __deeplineCurrentDocflowContext(): DocflowHelperObserver | null {
565
+ const context =
566
+ docflowRunContexts?.getStore() ??
567
+ scriptRuns.getStore()?.context ??
568
+ null;
569
+ if (!context) return null;
570
+ // Display-only: a context that cannot be read is no context at all.
571
+ let observe: unknown;
572
+ try {
573
+ // A runtime that predates helper observation would ignore `origin` and
574
+ // observe a helper once per dataset row: only one declaring it is used.
575
+ if (Reflect.get(context, '__deeplineDocflowHelperObservation') !== true)
576
+ return null;
577
+ observe = Reflect.get(context, '__deeplineObserveDocflowNode');
578
+ } catch {
579
+ return null;
580
+ }
581
+ if (typeof observe !== 'function') return null;
582
+ return {
583
+ __deeplineObserveDocflowNode: (nodeId, inputCaptures, outputPaths, execute) =>
584
+ observe.call(context, nodeId, inputCaptures, outputPaths, execute, {
585
+ origin: 'helper',
586
+ }),
587
+ };
588
+ }
589
+
519
590
  /**
520
591
  * The run whose context a callback the runtime invokes outside the play's
521
592
  * async flow belongs to, such as a dataset `key` function called while rows
@@ -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.546',
208
+ version: '0.3.548',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -15,6 +15,12 @@ export const RUN_WATCH_POLL_INTERVAL_MS = 2_000;
15
15
  // two-second steady-state cadence below.
16
16
  const RUN_WATCH_STARTUP_POLL_INTERVAL_MS = 300;
17
17
  const RUN_WATCH_STARTUP_WINDOW_MS = 6_000;
18
+ // Interactive Plays usually finish 6–30 s after the watch starts (admission,
19
+ // sandbox launch and a few calls). A 2 s cadence there made the CLI notice a
20
+ // finished run up to 2 s late (Production 1-call runs, 2026-11-18). Poll every
21
+ // 500 ms until 30 s, then fall back to the steady-state cadence.
22
+ const RUN_WATCH_INTERACTIVE_POLL_INTERVAL_MS = 500;
23
+ const RUN_WATCH_INTERACTIVE_WINDOW_MS = 30_000;
18
24
  /**
19
25
  * Server-held wait per snapshot request once the startup window has passed:
20
26
  * the run route answers as soon as the run is terminal, or after this bound,
@@ -232,8 +238,9 @@ export async function* watchRunEvents(
232
238
  const poll = ++pollCount;
233
239
  // Keep terminal detection responsive through the sandbox startup window,
234
240
  // then reduce snapshot reads for runs that continue beyond it.
235
- const pastStartup =
236
- pollStartedAt - watchStartedAt >= RUN_WATCH_STARTUP_WINDOW_MS;
241
+ const watchedMs = pollStartedAt - watchStartedAt;
242
+ const pastStartup = watchedMs >= RUN_WATCH_STARTUP_WINDOW_MS;
243
+ const pastInteractive = watchedMs >= RUN_WATCH_INTERACTIVE_WINDOW_MS;
237
244
  const serverWaitMs =
238
245
  options.pollIntervalMs === undefined &&
239
246
  options.deferLogs &&
@@ -246,9 +253,11 @@ export async function* watchRunEvents(
246
253
  options.pollIntervalMs ??
247
254
  (serverWaitMs > 0
248
255
  ? 0
249
- : pastStartup
256
+ : pastInteractive
250
257
  ? RUN_WATCH_POLL_INTERVAL_MS
251
- : RUN_WATCH_STARTUP_POLL_INTERVAL_MS);
258
+ : pastStartup
259
+ ? RUN_WATCH_INTERACTIVE_POLL_INTERVAL_MS
260
+ : RUN_WATCH_STARTUP_POLL_INTERVAL_MS);
252
261
  let snapshot: PlayRunLiveSnapshot;
253
262
  let terminalStatus: Record<string, unknown> | undefined;
254
263
  let responseStatus: number | undefined;
@@ -1460,6 +1460,11 @@ export interface PlayRunListItem {
1460
1460
  inputsTruncated: boolean;
1461
1461
  outputsTruncated: boolean;
1462
1462
  } | null;
1463
+ /**
1464
+ * What the run did at each diagram step it reached, when `runs.list` asks
1465
+ * for `steps`. Fixed size per step; unreached steps are absent.
1466
+ */
1467
+ steps?: PlayRunStepSummary[];
1463
1468
  /** Metadata attached to the workflow. */
1464
1469
  memo: {
1465
1470
  /** Organization that owns this run. */
@@ -1471,6 +1476,28 @@ export interface PlayRunListItem {
1471
1476
  };
1472
1477
  }
1473
1478
 
1479
+ /** One run's outcome at one diagram step (`runs.list` with `steps`). */
1480
+ export interface PlayRunStepSummary {
1481
+ /** Diagram node id. */
1482
+ nodeId: string;
1483
+ status: 'completed' | 'failed' | 'running';
1484
+ /** The step's one-line result, as its canvas card shows it (≤ 80 chars). */
1485
+ label: string | null;
1486
+ /** The arm a decision took, as drawn (≤ 80 chars). */
1487
+ arm: string | null;
1488
+ /** Why the step failed, first line (≤ 160 chars). */
1489
+ error: string | null;
1490
+ }
1491
+
1492
+ /** One diagram step, in flow order (`runs.list` with `steps`). */
1493
+ export interface PlayRunStepNode {
1494
+ id: string;
1495
+ label: string;
1496
+ kind: string;
1497
+ regionId: string | null;
1498
+ regionLabel: string | null;
1499
+ }
1500
+
1474
1501
  /**
1475
1502
  * A single revision (version) of a play's code and configuration.
1476
1503
  */
@@ -2117,6 +2144,12 @@ export interface PlayCheckIssue {
2117
2144
  hint?: string;
2118
2145
  validOptions?: string[];
2119
2146
  docsHint?: string;
2147
+ /** The diagram box or subgraph id a diagram issue is about. */
2148
+ node?: string;
2149
+ /** The checked entry file's 1-based line to edit, when known. */
2150
+ line?: number;
2151
+ /** One line to paste that fixes this issue, tailored to it. */
2152
+ fix?: string;
2120
2153
  }
2121
2154
 
2122
2155
  /**
@@ -3,10 +3,16 @@ export const GOOGLE_WORKSPACE_AVAILABILITY_SCOPE =
3
3
  'https://www.googleapis.com/auth/calendar.freebusy';
4
4
  export const GOOGLE_WORKSPACE_BOOKING_SCOPE =
5
5
  'https://www.googleapis.com/auth/calendar.events.owned';
6
+ export const GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE =
7
+ 'https://www.googleapis.com/auth/calendar.calendarlist.readonly';
6
8
  export const GOOGLE_WORKSPACE_BOOKING_SCOPES = [
7
9
  GOOGLE_WORKSPACE_AVAILABILITY_SCOPE,
8
10
  GOOGLE_WORKSPACE_BOOKING_SCOPE,
9
11
  ] as const;
12
+ export const GOOGLE_WORKSPACE_APPROVAL_SCOPES = [
13
+ ...GOOGLE_WORKSPACE_BOOKING_SCOPES,
14
+ GOOGLE_WORKSPACE_CALENDAR_LIST_SCOPE,
15
+ ] as const;
10
16
  export const GOOGLE_WORKSPACE_DOMAIN_PATTERN =
11
17
  /^(?=.{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
18
 
@@ -116,6 +122,7 @@ export type CalendarDelegationCheck = {
116
122
  | 'runtime_identity'
117
123
  | 'signing'
118
124
  | 'google_grant'
125
+ | 'calendar_list'
119
126
  | 'primary_calendar';
120
127
  };
121
128
 
@@ -540,6 +540,8 @@ export const PROVIDER_MONITOR_BATCH_CHANGE_BUCKETS: Readonly<
540
540
  deleted_monitor_intent_closed: 'removed',
541
541
  fleet_member_removed: 'removed',
542
542
  fleet_converged_inactive: 'removed',
543
+ // A billing suspension's confirmed delete (desired state kept).
544
+ fleet_suspended: 'removed',
543
545
  provider_batch_created_then_stopped: 'removed',
544
546
  provider_batch_created_then_deleted: 'removed',
545
547
  // A start's radar deleted, never adopted, after a newer stop (KAR-198).
@@ -29,6 +29,7 @@ export const RB2B_POST_DEPLOY_GUIDANCE = {
29
29
  'In RB2B, open Integrations and choose Webhook.',
30
30
  'Paste {{callback_url}} as the single webhook URL and save.',
31
31
  "Use RB2B's Send a Test Event action to verify the connection.",
32
+ "Optional: turn on Send company-only profiles to also receive company-level visits. They arrive with profile_type 'company' and no person fields.",
32
33
  ],
33
34
  documentation: [
34
35
  {
@@ -284,7 +284,7 @@
284
284
  "owner": "evals",
285
285
  "criticality": "reporting",
286
286
  "purpose": "Run each prebuilt play on its fixed labeled sample in the persistent benchmark workspace on Production with the published CLI (reusing results under 4 days old when nothing changed) and publish found, exact, recall, precision and settled credits.",
287
- "successDefinition": "Every benchmark exports its rows (or reuses a recent fresh run), scores them, settles within its credit cap and the workspace's 2000-credit monthly usage cap, and the summary uploads.",
287
+ "successDefinition": "Every benchmark exports its rows (or reuses a recent fresh run), scores them, settles within its credit cap and the workspace's monthly usage cap, and the summary uploads.",
288
288
  "failureDefinition": "A dataset load, play run, export, scoring or credit-cap overrun fails, or the workspace's monthly usage cap is missing or used up.",
289
289
  "startGraceMs": 600000,
290
290
  "runTimeoutMs": 18000000,
@@ -1126,6 +1126,24 @@
1126
1126
  "failureAlert": "convex_action_wrapper",
1127
1127
  "domainReportRequired": true
1128
1128
  },
1129
+ {
1130
+ "id": "convex.monitor-billing-policy-continuation",
1131
+ "name": "Monitor billing policy pass continuation",
1132
+ "scheduler": "convex_scheduled_action",
1133
+ "cadence": "runAfter(0) when a billing policy pass reaches its 200-page invocation budget, and runAfter with 30 s doubling backoff to retry a failed continuation",
1134
+ "timezone": "UTC",
1135
+ "source": "packages/convex/scheduledJobsNode.ts",
1136
+ "locator": "dispatchMonitorBillingPolicyPassContinuation",
1137
+ "owner": "billing",
1138
+ "criticality": "critical",
1139
+ "purpose": "Continue a workspace or Fleet billing policy pass (spend shutdown, cap change, credit recovery, sweep or operator run) past one invocation from its committed cursor, so Monitors past the first 20,000 definitions are switched off or revived and the pass's notification and cap recovery run once at its last page.",
1140
+ "successDefinition": "The invocation commits its pages and schedules the next one, or reads the last page and runs the post-pass work, or ends the chain as superseded because the cap, the wallet's admission or the archive changed; a failed page or spend re-check schedules a retry from the last committed page.",
1141
+ "failureDefinition": "Five attempts at the same continuation fail, so the rest of the pass, its shutdown or recovery notification and its cap recovery do not run. The hourly provider-monitor policy sweep remains the backstop.",
1142
+ "startGraceMs": 120000,
1143
+ "runTimeoutMs": 600000,
1144
+ "failureAlert": "convex_action_wrapper",
1145
+ "domainReportRequired": true
1146
+ },
1129
1147
  {
1130
1148
  "id": "inngest.workflow-run-watchdog",
1131
1149
  "name": "Workflow run watchdog",
@@ -199,10 +199,24 @@ export async function confirmR2ObjectAbsent(
199
199
  );
200
200
  return false;
201
201
  } catch (error) {
202
- const details = error as {
202
+ if (isMissingR2Object(error)) return true;
203
+ throw error;
204
+ }
205
+ }
206
+
207
+ /**
208
+ * The object store answered that the key does not exist (and nothing else).
209
+ * A reader that wraps the store's error keeps it as its cause.
210
+ */
211
+ export function isMissingR2Object(error: unknown): boolean {
212
+ let current: unknown = error;
213
+ for (let depth = 0; depth < 4; depth += 1) {
214
+ if (!current || typeof current !== 'object') return false;
215
+ const details = current as {
203
216
  name?: string;
204
217
  Code?: string;
205
218
  $metadata?: { httpStatusCode?: number };
219
+ cause?: unknown;
206
220
  };
207
221
  if (
208
222
  details.$metadata?.httpStatusCode === 404 ||
@@ -212,8 +226,9 @@ export async function confirmR2ObjectAbsent(
212
226
  details.Code === 'NoSuchKey'
213
227
  )
214
228
  return true;
215
- throw error;
229
+ current = details.cause;
216
230
  }
231
+ return false;
217
232
  }
218
233
 
219
234
  export async function uploadBufferToR2(input: {
@@ -96,6 +96,8 @@ export type AsyncOperationResultMaterialization = {
96
96
 
97
97
  export type AsyncOperationContractWire = {
98
98
  version: 1;
99
+ /** External delivery is caller-owned; completion is not available to this runtime. */
100
+ delivery?: { kind: 'external_callback'; callbackInputField: string };
99
101
  /**
100
102
  * Keep a default synchronous Play call in the runner process: launch the
101
103
  * provider job, expose its handle in run progress, then poll companion tools
@@ -239,7 +241,34 @@ export function defineAsyncOperation(
239
241
  contract: AsyncOperationContract,
240
242
  ): AsyncOperationContract {
241
243
  required(contract.lifecycle.startAction, 'lifecycle.startAction');
242
- if (contract.lifecycle.pollActions.length === 0) {
244
+ const externalCallback = contract.delivery?.kind === 'external_callback';
245
+ if (contract.delivery) {
246
+ if (!externalCallback)
247
+ throw new Error('Unsupported async operation delivery kind.');
248
+ required(
249
+ contract.delivery.callbackInputField,
250
+ 'delivery.callbackInputField',
251
+ );
252
+ if (
253
+ contract.wait.kind !== 'caller_managed' ||
254
+ contract.runtimeManagedWait !== undefined ||
255
+ contract.recoveryWait !== undefined ||
256
+ contract.lifecycle.finishAction !== undefined ||
257
+ contract.lifecycle.cancelAction !== undefined ||
258
+ contract.lifecycle.pollActions.length !== 0 ||
259
+ contract.job.idPaths.length !== 0 ||
260
+ contract.launch !== undefined ||
261
+ contract.result.source !== 'start_result' ||
262
+ typeof contract.compatibility?.asyncGetAction === 'string' ||
263
+ contract.terminal.defaultOutcome !== 'running' ||
264
+ contract.terminal.rules.some((rule) => rule.outcome !== 'running')
265
+ ) {
266
+ throw new Error(
267
+ 'External callback delivery requires a caller-managed submission with no managed wait, recovery, polling, job ID, finish, cancel, or terminal enrichment result.',
268
+ );
269
+ }
270
+ }
271
+ if (!externalCallback && contract.lifecycle.pollActions.length === 0) {
243
272
  throw new Error(
244
273
  'AsyncOperationContract requires at least one lifecycle.pollActions entry.',
245
274
  );
@@ -318,7 +347,7 @@ export function defineAsyncOperation(
318
347
  'lifecycle.cancelAction',
319
348
  );
320
349
  }
321
- if (contract.job.idPaths.length === 0) {
350
+ if (!externalCallback && contract.job.idPaths.length === 0) {
322
351
  throw new Error(
323
352
  'AsyncOperationContract requires at least one job.idPaths entry.',
324
353
  );
@@ -437,8 +466,8 @@ export function projectAsyncGetAction(
437
466
  }
438
467
  return (
439
468
  contract.lifecycle.finishAction?.action ??
440
- contract.lifecycle.pollActions[contract.lifecycle.pollActions.length - 1]!
441
- .action
469
+ contract.lifecycle.pollActions[contract.lifecycle.pollActions.length - 1]
470
+ ?.action
442
471
  );
443
472
  }
444
473
 
@@ -493,12 +522,30 @@ export function resolveAsyncOperationPolling(input: {
493
522
  };
494
523
  }
495
524
 
525
+ /** A callback-only API has no poll action, provider handle, or runtime-owned completion. */
526
+ export function defineExternalCallbackAsyncOperation(input: {
527
+ startAction: string;
528
+ callbackInputField: string;
529
+ }): AsyncOperationContract {
530
+ return defineCallerManagedAsyncOperation({
531
+ startAction: input.startAction,
532
+ delivery: {
533
+ kind: 'external_callback',
534
+ callbackInputField: input.callbackInputField,
535
+ },
536
+ pollActions: [],
537
+ jobIdPaths: [],
538
+ asyncGetAction: null,
539
+ });
540
+ }
541
+
496
542
  /**
497
543
  * Compatibility-preserving declaration for intentionally caller-managed jobs.
498
544
  * The runner publishes the full lifecycle metadata but never polls it unless a
499
545
  * later provider migration explicitly changes `wait`.
500
546
  */
501
547
  export function defineCallerManagedAsyncOperation(input: {
548
+ delivery?: AsyncOperationContract['delivery'];
502
549
  startAction: string;
503
550
  pollActions: readonly string[];
504
551
  finishAction?: string;
@@ -526,6 +573,7 @@ export function defineCallerManagedAsyncOperation(input: {
526
573
  });
527
574
  return defineAsyncOperation({
528
575
  version: 1,
576
+ ...(input.delivery ? { delivery: input.delivery } : {}),
529
577
  compatibility: {
530
578
  asyncGetAction:
531
579
  input.asyncGetAction !== undefined
@@ -588,7 +636,11 @@ export function defineCallerManagedAsyncOperation(input: {
588
636
  export function projectAsyncOperationPollExecution(
589
637
  contract: AsyncOperationContractWire,
590
638
  ): AsyncOperationPollExecution | null {
591
- if (contract.wait.kind !== 'caller_managed') return null;
639
+ if (
640
+ contract.wait.kind !== 'caller_managed' ||
641
+ contract.delivery?.kind === 'external_callback'
642
+ )
643
+ return null;
592
644
  return {
593
645
  checkTimeoutMs:
594
646
  contract.polling.checkTimeoutMs ?? contract.polling.intervalMs,