deepline 0.3.546 → 0.3.547
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.
- package/dist/bundling-sources/sdk/src/client-core.ts +13 -0
- package/dist/bundling-sources/sdk/src/index.ts +7 -1
- package/dist/bundling-sources/sdk/src/integrations.ts +17 -7
- package/dist/bundling-sources/sdk/src/play.ts +71 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +13 -4
- package/dist/bundling-sources/sdk/src/types.ts +33 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +7 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +17 -2
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +57 -5
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +295 -52
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -1
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-decision-tracker.ts +135 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-fail-open.ts +177 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-node-io.ts +99 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -10
- package/dist/bundling-sources/shared_libs/play-runtime/fenced-call-diagnostics.ts +211 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +52 -14
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +21 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +48 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +716 -51
- package/dist/bundling-sources/shared_libs/plays/docflow-decision-arms.ts +146 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-flow-order.ts +94 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-unreached-reason.ts +10 -1
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +787 -117
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +8 -2
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +13 -0
- package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +25 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +56 -0
- package/dist/cli/auth-AC5277PI.js +43 -0
- package/dist/cli/{auth-KFWG72AZ.mjs → auth-WJEY4IDX.mjs} +5 -5
- package/dist/cli/{billing-OQVOAZ4S.js → billing-IJITDDRQ.js} +96 -96
- package/dist/cli/{billing-MMZ336HO.mjs → billing-PHJUDYF3.mjs} +10 -10
- package/dist/cli/{chunk-TBWYZOSV.js → chunk-2AHY47SI.js} +3 -3
- package/dist/cli/{chunk-MXQP7CXZ.js → chunk-2HPTLBNB.js} +3 -3
- package/dist/cli/{chunk-TI6DTURF.js → chunk-4WAM6TLD.js} +7 -1
- package/dist/cli/{chunk-JARZ47OP.mjs → chunk-56MEAGWA.mjs} +2 -2
- package/dist/cli/{chunk-GYTSDSQD.mjs → chunk-5SFHPMBY.mjs} +11 -11
- package/dist/cli/{chunk-Z3UEBFIN.js → chunk-ABLTVG3J.js} +41 -41
- package/dist/cli/{chunk-LX2TC3HO.mjs → chunk-AEQ5VWZ5.mjs} +4 -4
- package/dist/cli/{chunk-MI7X6V6V.mjs → chunk-CKIRKYW7.mjs} +3 -3
- package/dist/cli/{chunk-2JHYYB3F.js → chunk-CSPHSNBW.js} +3 -3
- package/dist/cli/{chunk-IVWU7SJC.js → chunk-D6OIEH47.js} +5 -5
- package/dist/cli/{chunk-KUK7ARXA.mjs → chunk-DIUNDLSX.mjs} +2 -2
- package/dist/cli/{chunk-RO66FPTS.mjs → chunk-DJI5CLLW.mjs} +1 -1
- package/dist/cli/{chunk-LIJKRDDG.js → chunk-DZC7LMYM.js} +6 -6
- package/dist/cli/{chunk-UQJBV5PM.js → chunk-E2OIYPB4.js} +10 -10
- package/dist/cli/{chunk-JA633HRV.mjs → chunk-ECUD4QPD.mjs} +3 -3
- package/dist/cli/{chunk-VPERQ3U6.mjs → chunk-ESCVHDNY.mjs} +5 -5
- package/dist/cli/{chunk-JVOUQFHT.js → chunk-FFBXLFKV.js} +1 -1
- package/dist/cli/{chunk-3DUNNZB6.mjs → chunk-FMQXAOVE.mjs} +4 -4
- package/dist/cli/{chunk-HXIR3VQL.mjs → chunk-FZHMNK6F.mjs} +7 -1
- package/dist/cli/{chunk-PU3ZAG6V.mjs → chunk-G6KW764N.mjs} +1 -1
- package/dist/cli/{chunk-EEG46QZY.mjs → chunk-G6XTCG3J.mjs} +2 -2
- package/dist/cli/{chunk-EEJHB76U.js → chunk-GIGAYLY6.js} +12 -12
- package/dist/cli/{chunk-BLYW6FFB.js → chunk-GJA2PRHJ.js} +2 -2
- package/dist/cli/{chunk-H7Q5IDO3.js → chunk-GJOGFWX3.js} +20 -20
- package/dist/cli/{chunk-6Y5TU3R7.mjs → chunk-GPAWLXW3.mjs} +1 -1
- package/dist/cli/{chunk-5W4ENHWM.js → chunk-GZFZZQL4.js} +285 -264
- package/dist/cli/{chunk-P7A3H6G5.mjs → chunk-HARZ4AAX.mjs} +1 -1
- package/dist/cli/{chunk-MEGHIX4M.js → chunk-HFIFKP3A.js} +5 -5
- package/dist/cli/{chunk-LHE2TSV6.mjs → chunk-IGAK22XO.mjs} +1 -1
- package/dist/cli/{chunk-VTK3HGMN.mjs → chunk-IKYN6PLO.mjs} +5 -5
- package/dist/cli/{chunk-UREAIHUU.mjs → chunk-ITLZBDSR.mjs} +3 -3
- package/dist/cli/{chunk-6LG7MLJ2.js → chunk-IVFFCAV2.js} +44 -44
- package/dist/cli/{chunk-SYTWWVIQ.js → chunk-K3GMDSUX.js} +5 -5
- package/dist/cli/{chunk-WKHPLBJK.js → chunk-L5J6UJ2X.js} +15 -15
- package/dist/cli/{chunk-X5KOHDJN.mjs → chunk-L6QE2XVM.mjs} +1 -1
- package/dist/cli/{chunk-SH32HL7I.js → chunk-LMLSOHTU.js} +53 -53
- package/dist/cli/{chunk-JCWNF44W.js → chunk-MBQELFL7.js} +22 -22
- package/dist/cli/{chunk-Z7SXGOIQ.mjs → chunk-MF7PCM6C.mjs} +1 -1
- package/dist/cli/{chunk-F2VEFMU5.js → chunk-MO7TGNXB.js} +13 -13
- package/dist/cli/{chunk-7ZW67ME6.mjs → chunk-MOZEAGSR.mjs} +1 -1
- package/dist/cli/{chunk-5VNQMVCU.js → chunk-N63U5CRG.js} +26 -26
- package/dist/cli/{chunk-JCH4UNNS.js → chunk-NBYFQZ6O.js} +2 -2
- package/dist/cli/{chunk-BTFUAGHC.js → chunk-OVYXYTEP.js} +16 -16
- package/dist/cli/{chunk-J65HJCJO.mjs → chunk-PBMO36BP.mjs} +2 -2
- package/dist/cli/{chunk-F5YQXCP3.js → chunk-PVQCX6KQ.js} +50 -7
- package/dist/cli/{chunk-K2XELBPF.mjs → chunk-QLE3QKJ2.mjs} +5 -5
- package/dist/cli/{chunk-VAT2SXFF.js → chunk-QU3K3IY6.js} +12 -12
- package/dist/cli/{chunk-JYG4XZLT.js → chunk-REAFIEV5.js} +99 -99
- package/dist/cli/{chunk-5OEFXAKP.mjs → chunk-RMCCB3XY.mjs} +50 -7
- package/dist/cli/{chunk-HJR2DDJS.mjs → chunk-RXRC2COC.mjs} +2 -2
- package/dist/cli/{chunk-4AZLGNXV.js → chunk-SAJWYN4B.js} +4 -4
- package/dist/cli/{chunk-VXTTAYOT.mjs → chunk-TNJG4ZPN.mjs} +3 -3
- package/dist/cli/{chunk-PMDHY2YK.js → chunk-VNOQEDVC.js} +7 -7
- package/dist/cli/{chunk-GOOF7E2B.mjs → chunk-VPF54TXQ.mjs} +5 -5
- package/dist/cli/{chunk-2HSZCQMT.mjs → chunk-WYT3H6JD.mjs} +1 -1
- package/dist/cli/{chunk-OAKWSLKS.mjs → chunk-XMBVHJPR.mjs} +28 -7
- package/dist/cli/{chunk-7MY7KWJS.mjs → chunk-XNTDTAKC.mjs} +1 -1
- package/dist/cli/{chunk-5V7NZKGG.js → chunk-YURGAKI3.js} +2 -2
- package/dist/cli/{chunk-ND7SFRQL.js → chunk-YVKLF7RW.js} +2 -2
- package/dist/cli/{chunk-6FBDTYR2.mjs → chunk-Z2YGQZWV.mjs} +2 -2
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{concurrent-runs-help-C2O5YKQA.mjs → concurrent-runs-help-ZNGP563R.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-ZYISYOQA.js +21 -0
- package/dist/cli/{csv-Z4DNGR54.mjs → csv-VAHQHYYV.mjs} +4 -4
- package/dist/cli/{csv-MJDNOIQJ.js → csv-X6D4ZELE.js} +13 -13
- package/dist/cli/{db-4RL2BNOF.mjs → db-4G4S2VOV.mjs} +7 -7
- package/dist/cli/{db-S5QVPK5E.js → db-YA5ZGVEX.js} +28 -28
- package/dist/cli/{describe-L4P5SZLQ.mjs → describe-EVXEM2S6.mjs} +19 -19
- package/dist/cli/describe-GYYSLZLV.js +50 -0
- package/dist/cli/describe-core.d.mts +4 -4
- package/dist/cli/describe-core.d.ts +4 -4
- package/dist/cli/{executions-MFZ2Z36O.js → executions-5YC7ABF6.js} +9 -9
- package/dist/cli/{executions-RR6O3XK5.mjs → executions-HR6CTN5M.mjs} +7 -7
- package/dist/cli/{feedback-EQBQ3ABB.mjs → feedback-GEU5SPLR.mjs} +6 -6
- package/dist/cli/{feedback-YDAG7VH2.js → feedback-MJHSYLFF.js} +14 -14
- package/dist/cli/git-FZIQZNI4.js +25 -0
- package/dist/cli/{git-YGLCCU35.mjs → git-NPFF6QUS.mjs} +5 -5
- package/dist/cli/index.js +146 -146
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-IQXYMRMW.js → integrations-YPHFI77G.js} +19 -17
- package/dist/cli/{integrations-FWYXSBHK.mjs → integrations-Z7EGVBHF.mjs} +11 -9
- package/dist/cli/{legacy-noops-U7LI7UXC.js → legacy-noops-246E3KKG.js} +9 -9
- package/dist/cli/{legacy-noops-I4YRIX5F.mjs → legacy-noops-5IYCFWWX.mjs} +6 -6
- package/dist/cli/{mcp-QJBMB6VS.mjs → mcp-WUYGZXPI.mjs} +4 -4
- package/dist/cli/{mcp-GX2UKKWU.js → mcp-YTYTW67G.js} +24 -24
- package/dist/cli/{monitors-Z6EGKYJP.mjs → monitors-73DQKCU7.mjs} +26 -8
- package/dist/cli/{monitors-WCJYINGX.js → monitors-SA6ILD6Z.js} +119 -101
- package/dist/cli/{org-NNHICBR2.mjs → org-WVQRB2KX.mjs} +7 -7
- package/dist/cli/{org-7SKG423N.js → org-X7ELDV7B.js} +89 -89
- package/dist/cli/{play-CXDFPJ7Z.mjs → play-QI6V2EUQ.mjs} +295 -67
- package/dist/cli/{play-4P4DTG3Q.js → play-QTYOAJPE.js} +897 -669
- package/dist/cli/{providers-VQLQ7DTR.mjs → providers-DPVMVDS4.mjs} +7 -7
- package/dist/cli/{providers-EE4TUE3O.js → providers-XXFLVREV.js} +10 -10
- package/dist/cli/{quickstart-RVXHK4WA.js → quickstart-33ISXQJU.js} +6 -6
- package/dist/cli/{quickstart-IYNJRB5G.mjs → quickstart-YWGNHULM.mjs} +4 -4
- package/dist/cli/{run-R3F34KU3.js → run-BWHZXLTD.js} +45 -45
- package/dist/cli/{run-VBQPPMEX.mjs → run-J6FCAKQC.mjs} +25 -25
- package/dist/cli/search-JCWJX2XD.js +32 -0
- package/dist/cli/{search-B7R62HX5.mjs → search-Z3UU3WBB.mjs} +8 -8
- package/dist/cli/{search-output-LNQQXIGZ.mjs → search-output-OJYY4J7E.mjs} +4 -4
- package/dist/cli/{search-output-LWHWEPOT.js → search-output-YIPV74ME.js} +6 -6
- package/dist/cli/{secrets-QBOZ7WTD.js → secrets-UXRJCEN4.js} +16 -16
- package/dist/cli/{secrets-NM3VAJLO.mjs → secrets-YZZN2WST.mjs} +7 -7
- package/dist/cli/{sessions-R5BSIJ4I.mjs → sessions-ITCGPD7Z.mjs} +6 -6
- package/dist/cli/sessions-NA4SJH6Q.js +22 -0
- package/dist/cli/{settings-POYWKNRD.js → settings-LAFYMILP.js} +86 -86
- package/dist/cli/{settings-S4PN7WLY.mjs → settings-ZP2LSVNM.mjs} +13 -13
- package/dist/cli/{setup-VHB4Z654.js → setup-4AL3XYM5.js} +49 -49
- package/dist/cli/{setup-PFLXVBTL.mjs → setup-WEQAQSYC.mjs} +9 -9
- package/dist/cli/{skills-W2TELEU7.mjs → skills-NQH4HFW2.mjs} +7 -7
- package/dist/cli/skills-XZ4Y6SZ7.js +36 -0
- package/dist/cli/{tools-M4FA6N3Y.mjs → tools-CXK2GSI4.mjs} +18 -18
- package/dist/cli/tools-WJQ6Y7E4.js +57 -0
- package/dist/cli/{update-W7LIHEA7.mjs → update-3ROF3Z75.mjs} +9 -9
- package/dist/cli/update-ZLRLTBRD.js +34 -0
- package/dist/cli/{views-KTVPV6UP.mjs → views-AOUHVGV2.mjs} +7 -7
- package/dist/cli/{views-DJXAGD7V.js → views-XJFO5CEH.js} +22 -22
- package/dist/cli/{workflow-NVZDJKH2.js → workflow-GY3DBHXX.js} +18 -18
- package/dist/cli/{workflow-LGKCRODX.mjs → workflow-KBS2QJK6.mjs} +8 -8
- package/dist/{client-Tp1LSULB.d.mts → client-D1uWA2Vc.d.mts} +1 -1
- package/dist/{client-CCyWJqAI.d.ts → client-Hz7SsBXs.d.ts} +1 -1
- package/dist/{client-core-BpYiYEfu.d.ts → client-core-D3Ad7Flt.d.ts} +554 -504
- package/dist/{client-core-D8eCZz3O.d.mts → client-core-Db_e63Hb.d.mts} +554 -504
- package/dist/{compiler-manifest-EBWEUj0b.d.ts → compiler-manifest-BqwVrOri.d.mts} +38 -18
- package/dist/{compiler-manifest-EBWEUj0b.d.mts → compiler-manifest-BqwVrOri.d.ts} +38 -18
- package/dist/{errors-CParKUQR.d.mts → errors-BU8FB99X.d.mts} +1 -1
- package/dist/{errors-Qt0OTA7_.d.ts → errors-DfVN_FUG.d.ts} +1 -1
- package/dist/{index-CoqDkIw0.d.ts → index-BGnvtYGc.d.ts} +6 -1
- package/dist/{index-BMUVCNp7.d.mts → index-DjZgwpGw.d.mts} +6 -1
- package/dist/index.d.mts +28 -8
- package/dist/index.d.ts +28 -8
- package/dist/index.js +64 -39
- package/dist/index.mjs +32 -7
- package/dist/install-integrity.json +133 -128
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +620 -124
- package/dist/plays/play-description.d.mts +3 -3
- package/dist/plays/play-description.d.ts +3 -3
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-W32GMYND.js +0 -43
- package/dist/cli/concurrent-runs-help-6QT7ZR4W.js +0 -21
- package/dist/cli/describe-VLU2LUDJ.js +0 -50
- package/dist/cli/git-E6W44F5M.js +0 -25
- package/dist/cli/search-UUVFXZRA.js +0 -32
- package/dist/cli/sessions-K3PD73Q2.js +0 -22
- package/dist/cli/skills-QNE2EYT3.js +0 -36
- package/dist/cli/tools-3RLI4HGF.js +0 -57
- 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 {
|
|
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
|
-
|
|
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 =
|
|
150
|
-
|
|
151
|
-
|
|
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
|
|
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.
|
|
208
|
+
version: '0.3.547',
|
|
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
|
|
236
|
-
|
|
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
|
-
:
|
|
256
|
+
: pastInteractive
|
|
250
257
|
? RUN_WATCH_POLL_INTERVAL_MS
|
|
251
|
-
:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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,
|