deepline 0.3.532 → 0.3.534
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 +46 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +148 -63
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +32 -14
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +2 -0
- package/dist/cli/{auth-ZB3NN4E7.mjs → auth-MHQYIMVX.mjs} +5 -5
- package/dist/cli/auth-UP2RGPI6.js +43 -0
- package/dist/cli/{billing-5GGO7DQS.mjs → billing-LX2PSBJ4.mjs} +7 -7
- package/dist/cli/{billing-32EF4HJM.js → billing-YQLNP4S5.js} +82 -82
- package/dist/cli/{chunk-W5KSUNTE.mjs → chunk-2P3NVX65.mjs} +68 -13
- package/dist/cli/{chunk-EVXRQXNV.mjs → chunk-5FXMEEF4.mjs} +35 -0
- package/dist/cli/{chunk-YM6JAKYP.mjs → chunk-5LZ5VSOK.mjs} +2 -2
- package/dist/cli/{chunk-S2HHY26V.mjs → chunk-62SOZ67Y.mjs} +2 -2
- package/dist/cli/{chunk-QZINISXP.js → chunk-6CEUQYMB.js} +3 -3
- package/dist/cli/{chunk-6LBD6G6U.mjs → chunk-6GTGWZJG.mjs} +2 -2
- package/dist/cli/{chunk-CRWX26LR.mjs → chunk-6IFZPEJE.mjs} +1 -1
- package/dist/cli/{chunk-F2YLC4ZG.mjs → chunk-7GFR5Y4J.mjs} +1 -1
- package/dist/cli/{chunk-L5V5SLI7.js → chunk-A6HNT4EE.js} +2 -2
- package/dist/cli/{chunk-3NUYO5QO.mjs → chunk-AK622KIG.mjs} +1 -1
- package/dist/cli/{chunk-FU4MMUGM.js → chunk-B2AS3R5W.js} +16 -16
- package/dist/cli/{chunk-VCRCMK7M.mjs → chunk-BDWZBMGV.mjs} +5 -5
- package/dist/cli/{chunk-B77ZRM6M.mjs → chunk-BXIUZM5N.mjs} +2 -2
- package/dist/cli/{chunk-2ZGZBN6D.js → chunk-D3J2Y2BP.js} +14 -14
- package/dist/cli/{chunk-VHHD5D44.js → chunk-DGKTHWWH.js} +122 -104
- package/dist/cli/{chunk-T2QY36E3.mjs → chunk-DQ5ADV2J.mjs} +1 -1
- package/dist/cli/{chunk-SMDX4BM5.js → chunk-DZS4JC7I.js} +2 -2
- package/dist/cli/{chunk-VN432I4S.mjs → chunk-E7TP25I2.mjs} +1 -1
- package/dist/cli/{chunk-KEE57BF2.js → chunk-EGTUOYYG.js} +7 -7
- package/dist/cli/{chunk-DSNTHXR7.mjs → chunk-ENCA6O2D.mjs} +2 -2
- package/dist/cli/{chunk-GABQIZJR.mjs → chunk-EYXUAJAU.mjs} +5 -5
- package/dist/cli/{chunk-2T7YE5UH.js → chunk-GTXSUPCJ.js} +2 -2
- package/dist/cli/{chunk-NQDUXVBK.js → chunk-GVGQ6NZW.js} +41 -41
- package/dist/cli/{chunk-AQHMHYXX.js → chunk-HCD36BP6.js} +44 -44
- package/dist/cli/{chunk-NBIDYAN6.js → chunk-HPJAE6PP.js} +6 -6
- package/dist/cli/{chunk-7S3DJFW5.js → chunk-IX45S5VC.js} +11 -11
- package/dist/cli/{chunk-TS6XF2QP.js → chunk-JBBJDFUJ.js} +5 -5
- package/dist/cli/{chunk-THQPLSJD.mjs → chunk-KJVY7V2X.mjs} +1 -1
- package/dist/cli/{chunk-GBVTSWL3.js → chunk-KSA2XE4T.js} +182 -127
- package/dist/cli/{chunk-VZKCZO4J.mjs → chunk-KXQCUX3X.mjs} +3 -3
- package/dist/cli/{chunk-WU33X2QL.js → chunk-LGRZCHKC.js} +16 -16
- package/dist/cli/{chunk-RRCSFOF3.mjs → chunk-MG6YL4M7.mjs} +24 -6
- package/dist/cli/{chunk-KQW27FSR.js → chunk-MQORQ7WL.js} +53 -53
- package/dist/cli/{chunk-O7JU5GUR.js → chunk-MQX363YF.js} +5 -5
- package/dist/cli/{chunk-4S3ONSLF.js → chunk-MYSKWJMA.js} +13 -13
- package/dist/cli/{chunk-HR2RDDAC.js → chunk-NDFNBJGL.js} +26 -26
- package/dist/cli/{chunk-TFWREZYG.mjs → chunk-NNAE7E23.mjs} +6 -6
- package/dist/cli/{chunk-VIC2MI4W.mjs → chunk-O53LHONF.mjs} +2 -2
- package/dist/cli/{chunk-EJLCIQA4.mjs → chunk-OMVVHX4U.mjs} +5 -5
- package/dist/cli/{chunk-64CEFPF4.js → chunk-RH3YRMUY.js} +1 -1
- package/dist/cli/{chunk-V6LUMGVI.js → chunk-SUWTLXCV.js} +35 -0
- package/dist/cli/{chunk-47UF3DDN.mjs → chunk-TG2UB3A5.mjs} +1 -1
- package/dist/cli/{chunk-C6VCDDDD.mjs → chunk-TQH3533L.mjs} +5 -5
- package/dist/cli/{chunk-MHTKWZM3.js → chunk-TVINIDHB.js} +9 -9
- package/dist/cli/{chunk-CSMLW5VE.js → chunk-UWNVFAFN.js} +4 -4
- package/dist/cli/{chunk-H6OYTU2Y.js → chunk-V7SCRUFQ.js} +6 -6
- package/dist/cli/{chunk-HREGFD2I.mjs → chunk-VAG5YKP6.mjs} +1 -1
- package/dist/cli/{chunk-JJSJ47CA.js → chunk-VE7ZPLN2.js} +22 -22
- package/dist/cli/{chunk-O2A4C4WP.mjs → chunk-WDNRPZED.mjs} +2 -2
- package/dist/cli/{chunk-VWEDIFHT.mjs → chunk-WR4WETRU.mjs} +4 -4
- package/dist/cli/{chunk-BQ2KAFVQ.js → chunk-XBK6WCVA.js} +3 -3
- package/dist/cli/{chunk-AOAXIJL2.mjs → chunk-XRZJKHUA.mjs} +3 -3
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-LM44ZFL3.mjs → csv-4ID4E5W3.mjs} +4 -4
- package/dist/cli/{csv-4JBCPMEH.js → csv-U3M2G76R.js} +13 -13
- package/dist/cli/{db-UVNXGK6L.js → db-IHAQIKEQ.js} +27 -27
- package/dist/cli/{db-IFJEGJ6M.mjs → db-LHX5BBCZ.mjs} +6 -6
- package/dist/cli/{describe-TWTOPGII.mjs → describe-CI4MREFF.mjs} +18 -18
- package/dist/cli/describe-IVTSD7ST.js +50 -0
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-3I6RU7AO.js → executions-CJ5LV23G.js} +8 -8
- package/dist/cli/{executions-NEV2P5MX.mjs → executions-UJ6JZUL5.mjs} +6 -6
- package/dist/cli/{feedback-NHO56EWZ.js → feedback-TGUBVGRP.js} +14 -14
- package/dist/cli/{feedback-IO5ZAWKK.mjs → feedback-YGTPJBRJ.mjs} +6 -6
- package/dist/cli/{git-MQISNZ5F.mjs → git-3DOTQHJO.mjs} +5 -5
- package/dist/cli/git-R3W25XIF.js +25 -0
- package/dist/cli/index.js +145 -145
- package/dist/cli/index.mjs +44 -44
- package/dist/cli/{legacy-noops-SLAQE7HN.js → legacy-noops-BHEHVFHI.js} +9 -9
- package/dist/cli/{legacy-noops-DNRJHNQB.mjs → legacy-noops-RBBYRVLG.mjs} +6 -6
- package/dist/cli/{monitors-NAX7SUAR.mjs → monitors-5AJCG6IV.mjs} +7 -7
- package/dist/cli/{monitors-JRNATYS2.js → monitors-XECKLAXA.js} +100 -100
- package/dist/cli/{org-BHOREX5D.js → org-DOBAIYWG.js} +86 -86
- package/dist/cli/{org-34VCNPUD.mjs → org-ZAAIEZKB.mjs} +6 -6
- package/dist/cli/{pages-ZWVHNJOE.mjs → pages-FUOSF6BE.mjs} +6 -6
- package/dist/cli/{pages-GB337AQG.js → pages-TLC2N6L7.js} +18 -18
- package/dist/cli/{play-DAUQ7OAO.js → play-E74VN6B7.js} +317 -317
- package/dist/cli/{play-GJ7OEYSB.mjs → play-KLYRMQPF.mjs} +18 -18
- package/dist/cli/{providers-W7QY5FUK.js → providers-APZ6SOSK.js} +9 -9
- package/dist/cli/{providers-KA2RKD6E.mjs → providers-XTQXV5LB.mjs} +6 -6
- package/dist/cli/{quickstart-D4DPUR7R.js → quickstart-S6WN6NWW.js} +6 -6
- package/dist/cli/{quickstart-7KOAL3BD.mjs → quickstart-X7RHHQCH.mjs} +4 -4
- package/dist/cli/{run-QFVN2WUQ.js → run-3YLIJJ57.js} +41 -41
- package/dist/cli/{run-AYJSQED7.mjs → run-TZPBBSPX.mjs} +23 -23
- package/dist/cli/search-NB5CBALV.js +33 -0
- package/dist/cli/{search-MEE7OV2B.mjs → search-VLHE2CMZ.mjs} +8 -8
- package/dist/cli/{search-output-G36JH6D6.mjs → search-output-73BYB7UE.mjs} +4 -4
- package/dist/cli/{search-output-OW6UPOI6.js → search-output-GCT7PQIT.js} +6 -6
- package/dist/cli/{secrets-CJJQJUJC.js → secrets-J6CEKXKQ.js} +15 -15
- package/dist/cli/{secrets-OFNYIJT6.mjs → secrets-RLOTGKQZ.mjs} +6 -6
- package/dist/cli/{sessions-B6VCVU4Z.mjs → sessions-7HZ7OZ62.mjs} +6 -6
- package/dist/cli/sessions-SFCZSB77.js +22 -0
- package/dist/cli/{settings-PPFLSXDP.mjs → settings-72K5YCIS.mjs} +13 -13
- package/dist/cli/{settings-H4Q524LF.js → settings-WRV5XEZC.js} +86 -86
- package/dist/cli/{setup-WI3WDRRE.mjs → setup-KQFY6WT4.mjs} +10 -10
- package/dist/cli/{setup-SJAM7XHR.js → setup-QVXWT2EQ.js} +50 -50
- package/dist/cli/{skills-QSRYGMG2.mjs → skills-C3K3E473.mjs} +8 -8
- package/dist/cli/skills-WIJEHVLA.js +37 -0
- package/dist/cli/{tools-RUC4ULAD.mjs → tools-4A2OH6MB.mjs} +17 -17
- package/dist/cli/tools-VMMERMLO.js +57 -0
- package/dist/cli/update-54WZQDTS.js +35 -0
- package/dist/cli/{update-DPWNL2UB.mjs → update-BS6USKPR.mjs} +10 -10
- package/dist/cli/{views-CVDVQALA.js → views-4NZGAXHL.js} +18 -18
- package/dist/cli/{views-JP66QRA3.mjs → views-WB6GFTRX.mjs} +6 -6
- package/dist/cli/{workflow-MVTX2PY3.mjs → workflow-2D4WX55R.mjs} +7 -7
- package/dist/cli/{workflow-JM6JUI7I.js → workflow-L2QTQZYV.js} +17 -17
- package/dist/{client-CBCVhL8U.d.ts → client-DQm56zMs.d.ts} +1 -1
- package/dist/{client-Bd2meveV.d.mts → client-DoUVSkqC.d.mts} +1 -1
- package/dist/{client-core-CsRRWCFy.d.ts → client-core-C7KkUIE_.d.ts} +32 -1
- package/dist/{client-core-CGj8V9mw.d.mts → client-core-CPlwsC1Q.d.mts} +32 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +110 -110
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- 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 +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-7YWTPQSQ.js +0 -43
- package/dist/cli/describe-AF73GGH6.js +0 -50
- package/dist/cli/git-AOKC6WL3.js +0 -25
- package/dist/cli/search-JVCK5AB4.js +0 -33
- package/dist/cli/sessions-DXN6BQ7Q.js +0 -22
- package/dist/cli/skills-6MNJK2VQ.js +0 -37
- package/dist/cli/tools-OT43MSZE.js +0 -57
- package/dist/cli/update-PHOSO3TL.js +0 -35
|
@@ -3544,10 +3544,7 @@ export class DeeplineClient {
|
|
|
3544
3544
|
}
|
|
3545
3545
|
|
|
3546
3546
|
/** Who can open a view: workspace members, or anyone with its URL. */
|
|
3547
|
-
async setViewAccess(
|
|
3548
|
-
id: string,
|
|
3549
|
-
access: ViewAccess,
|
|
3550
|
-
): Promise<View> {
|
|
3547
|
+
async setViewAccess(id: string, access: ViewAccess): Promise<View> {
|
|
3551
3548
|
return await this.http.post<View>(
|
|
3552
3549
|
`/api/v2/views/${encodeURIComponent(id)}/access`,
|
|
3553
3550
|
{ access },
|
|
@@ -3590,9 +3587,7 @@ export class DeeplineClient {
|
|
|
3590
3587
|
|
|
3591
3588
|
/** Delete a view. Its Play and runs are not touched. */
|
|
3592
3589
|
async deleteView(id: string): Promise<{ id: string; deleted: boolean }> {
|
|
3593
|
-
return await this.http.delete(
|
|
3594
|
-
`/api/v2/views/${encodeURIComponent(id)}`,
|
|
3595
|
-
);
|
|
3590
|
+
return await this.http.delete(`/api/v2/views/${encodeURIComponent(id)}`);
|
|
3596
3591
|
}
|
|
3597
3592
|
|
|
3598
3593
|
/** The workspace view rules and what the caller may do. */
|
|
@@ -6002,6 +5997,33 @@ export class DeeplineClient {
|
|
|
6002
5997
|
return this.http.get(`/api/v2/integrations/balance?${params}`);
|
|
6003
5998
|
}
|
|
6004
5999
|
|
|
6000
|
+
/** List the internal pilot's workspace connections. */
|
|
6001
|
+
async listWorkspaceIntegrationConnections(): Promise<{
|
|
6002
|
+
connections: Array<{
|
|
6003
|
+
id: string;
|
|
6004
|
+
provider: string;
|
|
6005
|
+
owner: 'workspace';
|
|
6006
|
+
label: string;
|
|
6007
|
+
status: string;
|
|
6008
|
+
authorizationVersion: number;
|
|
6009
|
+
}>;
|
|
6010
|
+
}> {
|
|
6011
|
+
return this.http.get('/api/v2/integrations/connections');
|
|
6012
|
+
}
|
|
6013
|
+
|
|
6014
|
+
/** Manage a workspace-owned OAuth connection. Consent completes in the browser. */
|
|
6015
|
+
async manageWorkspaceIntegrationConnection(input: {
|
|
6016
|
+
action: 'connect' | 'reconnect' | 'replace' | 'disconnect';
|
|
6017
|
+
provider: 'hubspot' | 'google_calendar_availability';
|
|
6018
|
+
connectionId?: string;
|
|
6019
|
+
authorizationVersion?: number;
|
|
6020
|
+
}): Promise<{ url?: string }> {
|
|
6021
|
+
return this.http.post('/api/v2/integrations/connections', {
|
|
6022
|
+
...input,
|
|
6023
|
+
owner: 'workspace',
|
|
6024
|
+
});
|
|
6025
|
+
}
|
|
6026
|
+
|
|
6005
6027
|
/** Get the dashboard link where a workspace owner or admin can connect a provider. */
|
|
6006
6028
|
async getIntegrationConnectLink(
|
|
6007
6029
|
provider: string,
|
|
@@ -6014,13 +6036,30 @@ export class DeeplineClient {
|
|
|
6014
6036
|
async setIntegrationCredentials(
|
|
6015
6037
|
provider: string,
|
|
6016
6038
|
credentials: Record<string, string>,
|
|
6039
|
+
options?: { expectedConnectionId?: string },
|
|
6017
6040
|
): Promise<{ ok: boolean; credential_saved?: boolean }> {
|
|
6018
6041
|
return this.http.post('/api/v2/integrations/connect', {
|
|
6019
6042
|
provider,
|
|
6020
6043
|
credentials,
|
|
6044
|
+
...(options?.expectedConnectionId
|
|
6045
|
+
? { expected_connection_id: options.expectedConnectionId }
|
|
6046
|
+
: {}),
|
|
6021
6047
|
});
|
|
6022
6048
|
}
|
|
6023
6049
|
|
|
6050
|
+
/** Calendar discovery compatibility method. The managed pilot requires calendar IDs in tool and Play inputs. */
|
|
6051
|
+
async listAvailabilityCalendars(cursor?: string): Promise<{
|
|
6052
|
+
connection_id: string;
|
|
6053
|
+
calendars: Array<{ id: string; name: string }>;
|
|
6054
|
+
cursor: string | null;
|
|
6055
|
+
}> {
|
|
6056
|
+
const params = new URLSearchParams();
|
|
6057
|
+
if (cursor) params.set('cursor', cursor);
|
|
6058
|
+
return this.http.get(
|
|
6059
|
+
`/api/v2/integrations/calendar-availability/calendars?${params}`,
|
|
6060
|
+
);
|
|
6061
|
+
}
|
|
6062
|
+
|
|
6024
6063
|
/** Start provider OAuth and return the URL to open in a browser. */
|
|
6025
6064
|
async startIntegrationOAuth(
|
|
6026
6065
|
provider: string,
|
|
@@ -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.534',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -714,6 +714,16 @@ const authoredStepContext = new AsyncLocalStorage<{
|
|
|
714
714
|
invocationId?: string;
|
|
715
715
|
}>();
|
|
716
716
|
const toolExecutionOverrides = new AsyncLocalStorage<{ force: boolean }>();
|
|
717
|
+
/**
|
|
718
|
+
* `ctx.runSteps` passes each `runIf` leg to `ctx.step` with a receipt gate
|
|
719
|
+
* keyed by the leg's body. Unless the run's checkpoint already holds the
|
|
720
|
+
* step, the gate evaluates the condition inside the step: after its
|
|
721
|
+
* occurrence and boundary are allocated, in its authored scope and work
|
|
722
|
+
* window. False means the step returns its body's value without reading or
|
|
723
|
+
* writing its receipt. Module-private, so `ctx.step` gains no public
|
|
724
|
+
* parameter.
|
|
725
|
+
*/
|
|
726
|
+
const runStepsReceiptGates = new WeakMap<object, () => Promise<boolean>>();
|
|
717
727
|
|
|
718
728
|
/**
|
|
719
729
|
* Diagnostic split of one direct tool call, recorded only in the existing
|
|
@@ -13450,45 +13460,63 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
13450
13460
|
),
|
|
13451
13461
|
});
|
|
13452
13462
|
}
|
|
13453
|
-
const runStep = async () =>
|
|
13454
|
-
options?.checkpointSteps
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
|
|
13463
|
+
const runStep = async () => {
|
|
13464
|
+
if (!options?.checkpointSteps) {
|
|
13465
|
+
return await this.executeStepProgramStep(
|
|
13466
|
+
step,
|
|
13467
|
+
currentRow,
|
|
13468
|
+
index,
|
|
13469
|
+
stepPath,
|
|
13470
|
+
undefined,
|
|
13471
|
+
stageExecution,
|
|
13472
|
+
);
|
|
13473
|
+
}
|
|
13474
|
+
// Set by the receipt gate below, so the body reuses the decision
|
|
13475
|
+
// instead of evaluating the condition a second time.
|
|
13476
|
+
let decision: { shouldRun: boolean } | undefined;
|
|
13477
|
+
const body = async () =>
|
|
13478
|
+
await this.executeStepProgramStep(
|
|
13479
|
+
step,
|
|
13480
|
+
currentRow,
|
|
13481
|
+
index,
|
|
13482
|
+
stepPath,
|
|
13483
|
+
undefined,
|
|
13484
|
+
stageExecution,
|
|
13485
|
+
decision ? { ...options, decision } : options,
|
|
13486
|
+
);
|
|
13487
|
+
const conditional = step.resolver;
|
|
13488
|
+
if (isRuntimeConditionalStepResolver(conditional)) {
|
|
13489
|
+
// A `runIf` leg the row does not take returns its declared else
|
|
13490
|
+
// value and runs nothing. Its receipt read and write were serial
|
|
13491
|
+
// gateway requests at the end of every waterfall row, so it skips
|
|
13492
|
+
// them. It stays a step: the same occurrence and boundary, the same
|
|
13493
|
+
// events, and its condition evaluated in the step's scope.
|
|
13494
|
+
runStepsReceiptGates.set(body, async () => {
|
|
13495
|
+
// Truthiness, as the body tests it: a condition that returns
|
|
13496
|
+
// nothing skips its leg.
|
|
13497
|
+
decision = {
|
|
13498
|
+
shouldRun: Boolean(await conditional.when(currentRow, index)),
|
|
13499
|
+
};
|
|
13500
|
+
return decision.shouldRun;
|
|
13501
|
+
});
|
|
13502
|
+
}
|
|
13503
|
+
return await this.step(stepPath.join('.'), body, {
|
|
13504
|
+
semanticKey: stableDigest(
|
|
13505
|
+
stableStringify({
|
|
13487
13506
|
index,
|
|
13507
|
+
input: currentRow,
|
|
13488
13508
|
stepPath,
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13509
|
+
}),
|
|
13510
|
+
),
|
|
13511
|
+
...(step.staleAfterSeconds !== undefined
|
|
13512
|
+
? { staleAfterSeconds: step.staleAfterSeconds }
|
|
13513
|
+
: options?.defaultStaleAfterSeconds !== undefined
|
|
13514
|
+
? {
|
|
13515
|
+
staleAfterSeconds: options.defaultStaleAfterSeconds,
|
|
13516
|
+
}
|
|
13517
|
+
: {}),
|
|
13518
|
+
});
|
|
13519
|
+
};
|
|
13492
13520
|
let value: unknown;
|
|
13493
13521
|
try {
|
|
13494
13522
|
value = await runStep();
|
|
@@ -13620,7 +13648,11 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
13620
13648
|
path: string[],
|
|
13621
13649
|
previousCell?: PreviousCell,
|
|
13622
13650
|
stageExecution?: { skipped: boolean },
|
|
13623
|
-
options?: {
|
|
13651
|
+
options?: {
|
|
13652
|
+
defaultStaleAfterSeconds?: number | null;
|
|
13653
|
+
/** A `runIf` decision the caller already evaluated for this row. */
|
|
13654
|
+
decision?: { shouldRun: boolean };
|
|
13655
|
+
},
|
|
13624
13656
|
): Promise<unknown> {
|
|
13625
13657
|
const resolver = step.resolver;
|
|
13626
13658
|
const store = rowContext.getStore();
|
|
@@ -13650,7 +13682,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
13650
13682
|
}
|
|
13651
13683
|
|
|
13652
13684
|
if (isRuntimeConditionalStepResolver(resolver)) {
|
|
13653
|
-
const shouldRun =
|
|
13685
|
+
const shouldRun = options?.decision
|
|
13686
|
+
? options.decision.shouldRun
|
|
13687
|
+
: await resolver.when(currentRow, index);
|
|
13654
13688
|
// ADR 0019: the per-row branch this evaluator selected, written onto the
|
|
13655
13689
|
// cell the decision governs. `run`/`else` is the runtime's own vocabulary
|
|
13656
13690
|
// for a `runIf` conditional — the only per-row branch construct the
|
|
@@ -14905,6 +14939,22 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
14905
14939
|
input: Record<string, unknown>,
|
|
14906
14940
|
options?: ToolCallOptions,
|
|
14907
14941
|
): Promise<unknown> {
|
|
14942
|
+
if (
|
|
14943
|
+
toolId.trim() === 'google_calendar_availability_get_free_busy' &&
|
|
14944
|
+
this.activeInlineComposition
|
|
14945
|
+
) {
|
|
14946
|
+
throw new Error(
|
|
14947
|
+
'Google Calendar Availability must be called directly by the approved published Play.',
|
|
14948
|
+
);
|
|
14949
|
+
}
|
|
14950
|
+
if (
|
|
14951
|
+
this.activeInlineComposition &&
|
|
14952
|
+
toolId.trim().startsWith('google_calendar_availability_')
|
|
14953
|
+
) {
|
|
14954
|
+
throw new Error(
|
|
14955
|
+
'Call the Google Calendar booking tool directly in the admitted Play.',
|
|
14956
|
+
);
|
|
14957
|
+
}
|
|
14908
14958
|
if (!this.usesExplicitFreshness) {
|
|
14909
14959
|
return this.executeToolLegacyInternal(key, toolId, input, options);
|
|
14910
14960
|
}
|
|
@@ -15164,7 +15214,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
15164
15214
|
completedAt: Date.now(),
|
|
15165
15215
|
unavailableReason: liveDataset
|
|
15166
15216
|
? 'Dataset rows are live observations; the dataset owner controls pagination and recovery.'
|
|
15167
|
-
:
|
|
15217
|
+
: toolId === 'google_calendar_availability_get_free_busy'
|
|
15218
|
+
? 'Team availability and its approval are checked on every invocation.'
|
|
15219
|
+
: 'Workspace reviewer edits and conflict checks must be observed on every invocation.',
|
|
15168
15220
|
};
|
|
15169
15221
|
return isToolExecuteResult(value)
|
|
15170
15222
|
? cloneToolExecuteResultWithExecution(value, {
|
|
@@ -17999,6 +18051,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
17999
18051
|
run: () => T | Promise<T>,
|
|
18000
18052
|
options?: RuntimeStepOptions,
|
|
18001
18053
|
): Promise<T> {
|
|
18054
|
+
const readsReceipt = runStepsReceiptGates.get(run);
|
|
18002
18055
|
if (!rowContext.getStore()) this.assertRowAdmissionOpen();
|
|
18003
18056
|
this.assertNoPendingDurableSuspension();
|
|
18004
18057
|
validatePlayAuthoringField('ctx.step.id', key);
|
|
@@ -18064,6 +18117,37 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18064
18117
|
const boundaryId = this.durableBoundaryId(
|
|
18065
18118
|
`step-${scope}:${normalizedKey}${explicitStepScope ? `:${explicitStepScope}` : ''}${boundarySuffix}`,
|
|
18066
18119
|
);
|
|
18120
|
+
// The step's own work: the call positions and sleeps it takes. A `runIf`
|
|
18121
|
+
// gate runs in the same capture before the receipt read, so the
|
|
18122
|
+
// condition's calls and sleeps count as the step's, as they did when the
|
|
18123
|
+
// condition ran at the start of the step's body.
|
|
18124
|
+
const callAdvances = new Map<string, number>();
|
|
18125
|
+
// Sleeps the gate's condition took on this attempt. The step's recorded
|
|
18126
|
+
// count includes them; a receipt recovered after the gate counts them
|
|
18127
|
+
// already, so recovery advances only the rest.
|
|
18128
|
+
let conditionSleeps = 0;
|
|
18129
|
+
const inStepWindow = async <R>(work: () => R | Promise<R>): Promise<R> =>
|
|
18130
|
+
rowStore?.replayCallIndexes
|
|
18131
|
+
? await rowContext.run(
|
|
18132
|
+
{
|
|
18133
|
+
...rowStore,
|
|
18134
|
+
replayStepCaptures: [
|
|
18135
|
+
...(rowStore.replayStepCaptures ?? []),
|
|
18136
|
+
callAdvances,
|
|
18137
|
+
],
|
|
18138
|
+
},
|
|
18139
|
+
work,
|
|
18140
|
+
)
|
|
18141
|
+
: await work();
|
|
18142
|
+
const checkpointedStep = () => {
|
|
18143
|
+
const existing = assertKnownResolvedBoundary(
|
|
18144
|
+
boundaryId,
|
|
18145
|
+
this.checkpoint.resolvedBoundaries?.[boundaryId],
|
|
18146
|
+
);
|
|
18147
|
+
return existing?.kind === 'step' && 'output' in existing
|
|
18148
|
+
? existing
|
|
18149
|
+
: null;
|
|
18150
|
+
};
|
|
18067
18151
|
const advanceRecoveredSleepCursor = async (
|
|
18068
18152
|
receipt?: RuntimeStepReceipt,
|
|
18069
18153
|
) => {
|
|
@@ -18078,15 +18162,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18078
18162
|
: receipt?.runId === this.currentReceiptOwnerRunId
|
|
18079
18163
|
? ((await this.readStepSleepCount(boundaryId)) ?? 0)
|
|
18080
18164
|
: 0;
|
|
18081
|
-
|
|
18082
|
-
|
|
18165
|
+
const remaining = sleepCount - Math.min(conditionSleeps, sleepCount);
|
|
18166
|
+
if (Number.isSafeInteger(remaining) && remaining > 0)
|
|
18167
|
+
this.sleepBoundaryIndex += remaining;
|
|
18083
18168
|
};
|
|
18084
18169
|
const executeStep = async (): Promise<T> => {
|
|
18085
|
-
const existing =
|
|
18086
|
-
|
|
18087
|
-
this.checkpoint.resolvedBoundaries?.[boundaryId],
|
|
18088
|
-
);
|
|
18089
|
-
if (existing?.kind === 'step' && 'output' in existing) {
|
|
18170
|
+
const existing = checkpointedStep();
|
|
18171
|
+
if (existing) {
|
|
18090
18172
|
this.runtimeLog(
|
|
18091
18173
|
`ctx.step(${normalizedKey}): recovered result from checkpoint`,
|
|
18092
18174
|
);
|
|
@@ -18095,19 +18177,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18095
18177
|
}
|
|
18096
18178
|
|
|
18097
18179
|
const sleepBoundaryIndexBefore = this.sleepBoundaryIndex;
|
|
18098
|
-
const
|
|
18099
|
-
const output = rowStore?.replayCallIndexes
|
|
18100
|
-
? await rowContext.run(
|
|
18101
|
-
{
|
|
18102
|
-
...rowStore,
|
|
18103
|
-
replayStepCaptures: [
|
|
18104
|
-
...(rowStore.replayStepCaptures ?? []),
|
|
18105
|
-
callAdvances,
|
|
18106
|
-
],
|
|
18107
|
-
},
|
|
18108
|
-
run,
|
|
18109
|
-
)
|
|
18110
|
-
: await run();
|
|
18180
|
+
const output = await inStepWindow(run);
|
|
18111
18181
|
assertJsonSerializableStepOutput(normalizedKey, output);
|
|
18112
18182
|
// A caught durable suspension is still the invocation's outcome. Never
|
|
18113
18183
|
// publish an enclosing step fallback that would make a later resume skip
|
|
@@ -18115,7 +18185,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18115
18185
|
this.assertNoPendingDurableSuspension();
|
|
18116
18186
|
const sleepCount = rowStore?.replayCallIndexes
|
|
18117
18187
|
? (callAdvances.get('sleep:legacy') ?? 0)
|
|
18118
|
-
: this.sleepBoundaryIndex - sleepBoundaryIndexBefore;
|
|
18188
|
+
: this.sleepBoundaryIndex - sleepBoundaryIndexBefore + conditionSleeps;
|
|
18119
18189
|
if (sleepCount > 0 && this.durableDirectToolResultsBackedByReceipts) {
|
|
18120
18190
|
await this.persistStepSleepCount(boundaryId, sleepCount);
|
|
18121
18191
|
}
|
|
@@ -18151,6 +18221,18 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18151
18221
|
...(freshnessPolicy ? { invocationId: boundaryId } : {}),
|
|
18152
18222
|
},
|
|
18153
18223
|
async () => {
|
|
18224
|
+
// A step this run's checkpoint already holds is recovered as any
|
|
18225
|
+
// step is, without evaluating its condition again.
|
|
18226
|
+
if (readsReceipt && !checkpointedStep()) {
|
|
18227
|
+
const gateSleepStart = this.sleepBoundaryIndex;
|
|
18228
|
+
const takesReceipt = await inStepWindow(readsReceipt);
|
|
18229
|
+
// A row counts its own sleeps, as `executeStep` does: the shared
|
|
18230
|
+
// cursor also moves for sleeps in concurrent rows.
|
|
18231
|
+
conditionSleeps = rowStore?.replayCallIndexes
|
|
18232
|
+
? (callAdvances.get('sleep:legacy') ?? 0)
|
|
18233
|
+
: this.sleepBoundaryIndex - gateSleepStart;
|
|
18234
|
+
if (!takesReceipt) return await executeStep();
|
|
18235
|
+
}
|
|
18154
18236
|
if (freshnessPolicy) {
|
|
18155
18237
|
const semanticKey = stableStringify({
|
|
18156
18238
|
operation: 'step',
|
|
@@ -18188,7 +18270,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18188
18270
|
return {
|
|
18189
18271
|
output: value === undefined ? null : value,
|
|
18190
18272
|
undefinedOutput: value === undefined,
|
|
18191
|
-
sleepCount:
|
|
18273
|
+
sleepCount:
|
|
18274
|
+
this.sleepBoundaryIndex - before + conditionSleeps,
|
|
18192
18275
|
completedAt:
|
|
18193
18276
|
(boundary?.kind === 'step'
|
|
18194
18277
|
? boundary.completedAt
|
|
@@ -18197,7 +18280,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
18197
18280
|
},
|
|
18198
18281
|
onOutcome: (value, freshness) => {
|
|
18199
18282
|
if (freshness.source !== 'executed') {
|
|
18200
|
-
this.sleepBoundaryIndex +=
|
|
18283
|
+
this.sleepBoundaryIndex +=
|
|
18284
|
+
value.sleepCount -
|
|
18285
|
+
Math.min(conditionSleeps, value.sleepCount);
|
|
18201
18286
|
}
|
|
18202
18287
|
return value;
|
|
18203
18288
|
},
|
|
@@ -41,6 +41,28 @@ export const RUNTIME_EXECUTION_CAPABILITIES = [
|
|
|
41
41
|
export type RuntimeExecutionCapability =
|
|
42
42
|
(typeof RUNTIME_EXECUTION_CAPABILITIES)[number];
|
|
43
43
|
|
|
44
|
+
export type CalendarBookingBinding = {
|
|
45
|
+
connectionId: string;
|
|
46
|
+
grantGeneration: number;
|
|
47
|
+
apiKeyId: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export function isCalendarBookingBinding(
|
|
51
|
+
value: unknown,
|
|
52
|
+
): value is CalendarBookingBinding {
|
|
53
|
+
if (!value || typeof value !== 'object') return false;
|
|
54
|
+
const binding = value as Partial<CalendarBookingBinding>;
|
|
55
|
+
return (
|
|
56
|
+
typeof binding.connectionId === 'string' &&
|
|
57
|
+
/^[a-z0-9]{16,64}$/.test(binding.connectionId) &&
|
|
58
|
+
typeof binding.apiKeyId === 'string' &&
|
|
59
|
+
/^[a-z0-9]{16,64}$/.test(binding.apiKeyId) &&
|
|
60
|
+
typeof binding.grantGeneration === 'number' &&
|
|
61
|
+
Number.isSafeInteger(binding.grantGeneration) &&
|
|
62
|
+
binding.grantGeneration > 0
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
44
66
|
const CAPABILITY_SET = new Set<string>(RUNTIME_EXECUTION_CAPABILITIES);
|
|
45
67
|
|
|
46
68
|
/**
|
|
@@ -50,6 +72,8 @@ const CAPABILITY_SET = new Set<string>(RUNTIME_EXECUTION_CAPABILITIES);
|
|
|
50
72
|
export type RuntimeAuthorityDescriptor = {
|
|
51
73
|
/** Server-owned restriction inherited by every descendant and attempt. */
|
|
52
74
|
operationPolicy?: ExecutionOperationPolicy;
|
|
75
|
+
/** Exact workspace Calendar connection authorized at root run admission. */
|
|
76
|
+
calendarBookingBinding?: CalendarBookingBinding;
|
|
53
77
|
orgId: string;
|
|
54
78
|
workflowId: string;
|
|
55
79
|
runId: string;
|
|
@@ -181,6 +205,8 @@ export function requireRuntimeAuthorityDescriptor(
|
|
|
181
205
|
capabilities.length === 0 ||
|
|
182
206
|
(descriptor.operationPolicy !== undefined &&
|
|
183
207
|
!isExecutionOperationPolicy(descriptor.operationPolicy)) ||
|
|
208
|
+
(descriptor.calendarBookingBinding !== undefined &&
|
|
209
|
+
!isCalendarBookingBinding(descriptor.calendarBookingBinding)) ||
|
|
184
210
|
!fixtureBehavior.ok ||
|
|
185
211
|
(fixtureBehavior.behavior !== null &&
|
|
186
212
|
descriptor.integrationMode !== 'fixture')
|
|
@@ -89,11 +89,31 @@ export type FreshExecutionReplay = { freshInvocation: true };
|
|
|
89
89
|
/** recoverUnbound's answer when the call should execute instead. */
|
|
90
90
|
const EXECUTE: unique symbol = Symbol('execute');
|
|
91
91
|
|
|
92
|
+
/** The author-facing message for each replay refusal reason. */
|
|
93
|
+
function durableReplayInputMismatchMessage(
|
|
94
|
+
operation: string,
|
|
95
|
+
callId: string,
|
|
96
|
+
reason: ReplayRefusal['reason'],
|
|
97
|
+
): string {
|
|
98
|
+
switch (reason) {
|
|
99
|
+
case 'input_changed':
|
|
100
|
+
return `DURABLE_REPLAY_INPUT_MISMATCH: ctx.${operation}("${callId}") was replayed with a different input than the call recorded in this run. Deepline did not return the recorded result or repeat the call, because it may write. Make the input deterministic (no current time or random values), or give each distinct call its own id.`;
|
|
101
|
+
case 'credential_or_action_changed':
|
|
102
|
+
return `DURABLE_REPLAY_INPUT_MISMATCH: ctx.${operation}("${callId}") was replayed with the same input but a different credential or action revision than the call recorded in this run. Deepline did not return the recorded result or repeat the call, because it may write.`;
|
|
103
|
+
case 'recorded_identity_mismatch':
|
|
104
|
+
return `DURABLE_REPLAY_INPUT_MISMATCH: ctx.${operation}("${callId}") could not be matched to its recorded result. This run started on an older Deepline build whose saved history cannot prove which call this was, and the recorded result belongs to a different request. Deepline did not return that result or repeat the call, because it may write. Start a new run.`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
92
108
|
/**
|
|
93
109
|
* A replay reached a recorded operation of a different request and the call
|
|
94
110
|
* may write. Returning the recorded result would hand back another request's
|
|
95
|
-
* output; executing could repeat a write. Not retryable
|
|
96
|
-
* must be made deterministic, or each distinct call
|
|
111
|
+
* output; executing could repeat a write. Not retryable. For a binding
|
|
112
|
+
* refusal the Play's input must be made deterministic, or each distinct call
|
|
113
|
+
* given its own id. For `recorded_identity_mismatch` (pre-binding history)
|
|
114
|
+
* nothing proves the input changed: an older build numbered identical calls
|
|
115
|
+
* in tool-layer entry order, so the slot may hold a sibling's result, and
|
|
116
|
+
* the run must be started again.
|
|
97
117
|
*/
|
|
98
118
|
export class DurableReplayInputMismatchError extends Error {
|
|
99
119
|
readonly code = 'DURABLE_REPLAY_INPUT_MISMATCH';
|
|
@@ -102,13 +122,9 @@ export class DurableReplayInputMismatchError extends Error {
|
|
|
102
122
|
constructor(
|
|
103
123
|
readonly operation: string,
|
|
104
124
|
readonly callId: string,
|
|
105
|
-
readonly reason: '
|
|
125
|
+
readonly reason: ReplayRefusal['reason'],
|
|
106
126
|
) {
|
|
107
|
-
super(
|
|
108
|
-
reason === 'input_changed'
|
|
109
|
-
? `DURABLE_REPLAY_INPUT_MISMATCH: ctx.${operation}("${callId}") was replayed with a different input than the call recorded in this run. Deepline did not return the recorded result or repeat the call, because it may write. Make the input deterministic (no current time or random values), or give each distinct call its own id.`
|
|
110
|
-
: `DURABLE_REPLAY_INPUT_MISMATCH: ctx.${operation}("${callId}") was replayed with the same input but a different credential or action revision than the call recorded in this run. Deepline did not return the recorded result or repeat the call, because it may write.`,
|
|
111
|
-
);
|
|
127
|
+
super(durableReplayInputMismatchMessage(operation, callId, reason));
|
|
112
128
|
this.name = 'DurableReplayInputMismatchError';
|
|
113
129
|
}
|
|
114
130
|
}
|
|
@@ -313,9 +329,11 @@ function recordedIdentitySources(
|
|
|
313
329
|
: null;
|
|
314
330
|
const execution = result?._metadata?.execution;
|
|
315
331
|
if (
|
|
316
|
-
[
|
|
317
|
-
|
|
318
|
-
|
|
332
|
+
[
|
|
333
|
+
execution?.cacheKey,
|
|
334
|
+
execution?.receiptKey,
|
|
335
|
+
execution?.resultReceiptKey,
|
|
336
|
+
].some((key) => typeof key === 'string' && key.trim())
|
|
319
337
|
) {
|
|
320
338
|
sources.push('result_metadata');
|
|
321
339
|
}
|
|
@@ -744,8 +762,8 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
744
762
|
if (stored?.status !== 'completed' && stored?.status !== 'skipped') {
|
|
745
763
|
throw new Error(
|
|
746
764
|
key === operationKey ||
|
|
747
|
-
|
|
748
|
-
|
|
765
|
+
key === exactRequestOperationKey ||
|
|
766
|
+
key.startsWith(`${cachePrefix}:reusable:`)
|
|
749
767
|
? 'Completed freshness receipt publication failed.'
|
|
750
768
|
: `Tool Result Receipt ${key} could not publish a completed result.`,
|
|
751
769
|
);
|
|
@@ -891,7 +909,7 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
891
909
|
throw new DurableReplayInputMismatchError(
|
|
892
910
|
input.operation ?? 'call',
|
|
893
911
|
input.callId ?? 'unknown',
|
|
894
|
-
'
|
|
912
|
+
'recorded_identity_mismatch',
|
|
895
913
|
);
|
|
896
914
|
};
|
|
897
915
|
/**
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS } from './/runtime-constants';
|
|
2
2
|
import {
|
|
3
3
|
isExecutionOperationPolicy,
|
|
4
|
+
isCalendarBookingBinding,
|
|
5
|
+
type CalendarBookingBinding,
|
|
4
6
|
type ExecutionOperationPolicy,
|
|
5
7
|
DEFAULT_RUNTIME_EXECUTION_CAPABILITIES,
|
|
6
8
|
isRuntimeExecutionCapability,
|
|
@@ -306,6 +308,7 @@ export type WorkflowRunExecutionTokenClaims =
|
|
|
306
308
|
WorkflowInternalTokenBaseClaims & {
|
|
307
309
|
purpose: typeof INTERNAL_WORKFLOW_EXECUTION_PURPOSE;
|
|
308
310
|
operation_policy?: ExecutionOperationPolicy;
|
|
311
|
+
calendar_booking_binding?: CalendarBookingBinding;
|
|
309
312
|
workflow_id: string;
|
|
310
313
|
run_id: string;
|
|
311
314
|
// Billing owner for this execution. Defaults to run_id on older tokens and
|
|
@@ -652,6 +655,8 @@ function isValidWorkflowClaimsShape(
|
|
|
652
655
|
validateFixtureBehavior(claims.fixture_behavior).ok)) &&
|
|
653
656
|
(claims.operation_policy === undefined ||
|
|
654
657
|
isExecutionOperationPolicy(claims.operation_policy)) &&
|
|
658
|
+
(claims.calendar_booking_binding === undefined ||
|
|
659
|
+
isCalendarBookingBinding(claims.calendar_booking_binding)) &&
|
|
655
660
|
(claims.synthetic === undefined || claims.synthetic === true) &&
|
|
656
661
|
(claims.actor_user_id === undefined ||
|
|
657
662
|
typeof claims.actor_user_id === 'string') &&
|
|
@@ -752,6 +757,7 @@ export async function mintIngestionSubscriptionExecutionToken(input: {
|
|
|
752
757
|
|
|
753
758
|
export async function mintWorkflowRunExecutionToken(input: {
|
|
754
759
|
operationPolicy?: ExecutionOperationPolicy;
|
|
760
|
+
calendarBookingBinding?: CalendarBookingBinding;
|
|
755
761
|
orgId: string;
|
|
756
762
|
workflowId: string;
|
|
757
763
|
runId: string;
|
|
@@ -800,6 +806,9 @@ export async function mintWorkflowRunExecutionToken(input: {
|
|
|
800
806
|
...(input.operationPolicy
|
|
801
807
|
? { operation_policy: input.operationPolicy }
|
|
802
808
|
: {}),
|
|
809
|
+
...(input.calendarBookingBinding
|
|
810
|
+
? { calendar_booking_binding: input.calendarBookingBinding }
|
|
811
|
+
: {}),
|
|
803
812
|
org_id: input.orgId,
|
|
804
813
|
workflow_id: input.workflowId,
|
|
805
814
|
run_id: input.runId,
|
package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts
CHANGED
|
@@ -97,6 +97,7 @@ export function createPlayRunAttemptSuspensionJob(ports: {
|
|
|
97
97
|
const resumed = await ports.store.resumeAfterPark({
|
|
98
98
|
claim: input.attempt,
|
|
99
99
|
suspension: input.suspension,
|
|
100
|
+
checkpoint: engineOutcome.checkpoint,
|
|
100
101
|
});
|
|
101
102
|
if (resumed.kind === 'fence_lost') {
|
|
102
103
|
return { kind: 'fence_lost', stage: 'resume' };
|
|
@@ -53,6 +53,8 @@ export type PlayRunAttemptStore = {
|
|
|
53
53
|
resumeAfterPark(input: {
|
|
54
54
|
claim: PlayRunAttemptClaim;
|
|
55
55
|
suspension: PlayExecutionSuspension;
|
|
56
|
+
/** Omission preserves the stored checkpoint for older callers. */
|
|
57
|
+
checkpoint?: unknown;
|
|
56
58
|
}): Promise<
|
|
57
59
|
| { kind: 'resumed'; lifecycle: PlayRunAttemptLifecycle }
|
|
58
60
|
| { kind: 'fence_lost' }
|
package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts
CHANGED
|
@@ -169,13 +169,14 @@ export function createPostgresPlayRunAttemptStore(input: {
|
|
|
169
169
|
? { kind: 'parked', lifecycle: parked }
|
|
170
170
|
: { kind: 'fence_lost' };
|
|
171
171
|
},
|
|
172
|
-
async resumeAfterPark({ claim, suspension }) {
|
|
172
|
+
async resumeAfterPark({ claim, suspension, checkpoint }) {
|
|
173
173
|
const resumed = await markPostgresSchedulerAttemptRunning(
|
|
174
174
|
input.client,
|
|
175
175
|
{
|
|
176
176
|
runId: claim.runId,
|
|
177
177
|
attempt: claim.number,
|
|
178
178
|
leaseToken: claim.fenceId,
|
|
179
|
+
checkpoint,
|
|
179
180
|
preserveHeartbeatAt: suspension.kind === 'detached_runner',
|
|
180
181
|
},
|
|
181
182
|
options,
|
|
@@ -3,6 +3,7 @@ import { mintWorkflowExecutorToken } from './/workflow-executor-auth';
|
|
|
3
3
|
import {
|
|
4
4
|
normalizeRuntimeExecutionCapabilities,
|
|
5
5
|
PLAY_RUNTIME_EXECUTION_CAPABILITIES,
|
|
6
|
+
type CalendarBookingBinding,
|
|
6
7
|
type ExecutionOperationPolicy,
|
|
7
8
|
type RuntimeAuthorityDescriptor,
|
|
8
9
|
type RuntimeExecutionCapability,
|
|
@@ -95,6 +96,7 @@ export async function mintPlayRunRuntimeAuthorityDescriptor(input: {
|
|
|
95
96
|
|
|
96
97
|
export async function mintPlayRunRuntimeAuthority(input: {
|
|
97
98
|
operationPolicy?: ExecutionOperationPolicy;
|
|
99
|
+
calendarBookingBinding?: CalendarBookingBinding;
|
|
98
100
|
orgId: string;
|
|
99
101
|
workflowId: string;
|
|
100
102
|
runId: string;
|
|
@@ -119,6 +121,9 @@ export async function mintPlayRunRuntimeAuthority(input: {
|
|
|
119
121
|
...(input.operationPolicy
|
|
120
122
|
? { operationPolicy: input.operationPolicy }
|
|
121
123
|
: {}),
|
|
124
|
+
...(input.calendarBookingBinding
|
|
125
|
+
? { calendarBookingBinding: input.calendarBookingBinding }
|
|
126
|
+
: {}),
|
|
122
127
|
orgId: input.orgId,
|
|
123
128
|
workflowId: input.workflowId,
|
|
124
129
|
runId: input.runId,
|
|
@@ -163,6 +168,9 @@ export function runtimeAuthorityMintInput(
|
|
|
163
168
|
...(descriptor.operationPolicy
|
|
164
169
|
? { operationPolicy: descriptor.operationPolicy }
|
|
165
170
|
: {}),
|
|
171
|
+
...(descriptor.calendarBookingBinding
|
|
172
|
+
? { calendarBookingBinding: descriptor.calendarBookingBinding }
|
|
173
|
+
: {}),
|
|
166
174
|
orgId: descriptor.orgId,
|
|
167
175
|
workflowId: descriptor.workflowId,
|
|
168
176
|
runId: descriptor.runId,
|