@codemation/core 0.0.7 → 0.0.11
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/package.json +6 -1
- package/dist/EngineExecutionLimitsPolicy-8MEFIYx1.d.cts +0 -160
- package/dist/EngineExecutionLimitsPolicy-BWAXW9D6.d.cts +0 -160
- package/dist/EngineExecutionLimitsPolicy-Bp8PS1Ss.d.cts +0 -159
- package/dist/EngineExecutionLimitsPolicy-CLxcN-D2.d.ts +0 -159
- package/dist/EngineExecutionLimitsPolicy-DZXuix51.d.ts +0 -160
- package/dist/EngineExecutionLimitsPolicy-Gfz6ngFd.d.ts +0 -160
- package/dist/EngineFactory-CBnntY3J.cjs +0 -3152
- package/dist/EngineFactory-CBnntY3J.cjs.map +0 -1
- package/dist/EngineFactory-Cwn3R2YA.js +0 -3087
- package/dist/EngineFactory-Cwn3R2YA.js.map +0 -1
- package/dist/EngineFactory-DWCnNocp.js +0 -3063
- package/dist/EngineFactory-DWCnNocp.js.map +0 -1
- package/dist/EngineFactory-DhPFou4p.cjs +0 -3188
- package/dist/EngineFactory-DhPFou4p.cjs.map +0 -1
- package/dist/EngineFactory-l_9xmBtv.cjs +0 -3190
- package/dist/EngineFactory-l_9xmBtv.cjs.map +0 -1
- package/dist/EngineFactory-w-aOWuqh.js +0 -3089
- package/dist/EngineFactory-w-aOWuqh.js.map +0 -1
- package/dist/InMemoryLiveWorkflowRepository-1J9MHN_I.js +0 -18
- package/dist/InMemoryLiveWorkflowRepository-1J9MHN_I.js.map +0 -1
- package/dist/InMemoryLiveWorkflowRepository-CULNqv96.d.ts +0 -1300
- package/dist/InMemoryLiveWorkflowRepository-D6eiiXxF.d.cts +0 -1168
- package/dist/InMemoryLiveWorkflowRepository-D7l8cjdZ.d.cts +0 -1130
- package/dist/InMemoryLiveWorkflowRepository-DL7LmC9S.d.ts +0 -1340
- package/dist/InMemoryLiveWorkflowRepository-jnv-OnOP.d.ts +0 -1300
- package/dist/InMemoryLiveWorkflowRepository-xny1_Z6i.cjs +0 -24
- package/dist/InMemoryLiveWorkflowRepository-xny1_Z6i.cjs.map +0 -1
- package/dist/InMemoryLiveWorkflowRepository-xr7b4kvi.d.ts +0 -1338
- package/dist/InMemoryWorkflowCatalog-BIdFpwbK.d.ts +0 -1205
- package/dist/InMemoryWorkflowCatalog-BW00_3N3.d.cts +0 -12
- package/dist/InMemoryWorkflowCatalog-BiYHGoPw.cjs +0 -24
- package/dist/InMemoryWorkflowCatalog-BiYHGoPw.cjs.map +0 -1
- package/dist/InMemoryWorkflowCatalog-BrG0ApMO.d.cts +0 -1115
- package/dist/InMemoryWorkflowCatalog-BzrAr--Y.js +0 -139
- package/dist/InMemoryWorkflowCatalog-BzrAr--Y.js.map +0 -1
- package/dist/InMemoryWorkflowCatalog-C-EJlJ7y.d.cts +0 -1120
- package/dist/InMemoryWorkflowCatalog-C4482bpw.cjs +0 -24
- package/dist/InMemoryWorkflowCatalog-C4482bpw.cjs.map +0 -1
- package/dist/InMemoryWorkflowCatalog-CZ0kZpOv.d.ts +0 -1289
- package/dist/InMemoryWorkflowCatalog-C_ACeLyW.d.cts +0 -1119
- package/dist/InMemoryWorkflowCatalog-CiHWIu5E.d.cts +0 -12
- package/dist/InMemoryWorkflowCatalog-CkH7gkya.js +0 -18
- package/dist/InMemoryWorkflowCatalog-CkH7gkya.js.map +0 -1
- package/dist/InMemoryWorkflowCatalog-CnpZVJM9.d.ts +0 -1205
- package/dist/InMemoryWorkflowCatalog-Cu68S8YR.js +0 -18
- package/dist/InMemoryWorkflowCatalog-Cu68S8YR.js.map +0 -1
- package/dist/InMemoryWorkflowCatalog-D2w9nMj2.cjs +0 -151
- package/dist/InMemoryWorkflowCatalog-D2w9nMj2.cjs.map +0 -1
- package/dist/InMemoryWorkflowCatalog-D5eMxEf7.js +0 -18
- package/dist/InMemoryWorkflowCatalog-D5eMxEf7.js.map +0 -1
- package/dist/InMemoryWorkflowCatalog-D5nCp2yZ.d.ts +0 -1267
- package/dist/InMemoryWorkflowCatalog-DIq0bjqN.d.ts +0 -12
- package/dist/InMemoryWorkflowCatalog-DLgaEaw_.d.ts +0 -1288
- package/dist/InMemoryWorkflowCatalog-DNBFdK-x.d.cts +0 -1120
- package/dist/InMemoryWorkflowCatalog-DQBkCzb7.cjs +0 -24
- package/dist/InMemoryWorkflowCatalog-DQBkCzb7.cjs.map +0 -1
- package/dist/InMemoryWorkflowCatalog-DS4-eX6i.d.cts +0 -1118
- package/dist/InMemoryWorkflowCatalog-DdVfy8MY.d.ts +0 -12
- package/dist/InMemoryWorkflowCatalog-DeVZu3g8.d.ts +0 -12
- package/dist/InMemoryWorkflowCatalog-GxkQjvt5.d.ts +0 -1200
- package/dist/InMemoryWorkflowCatalog-qaVRn1Lc.d.cts +0 -1115
- package/dist/InMemoryWorkflowCatalog-z1aIT4TC.d.cts +0 -12
- package/dist/InMemoryWorkflowRegistry-BBuOovLL.d.ts +0 -1007
- package/dist/InMemoryWorkflowRegistry-BIFnSl3k.d.ts +0 -1201
- package/dist/InMemoryWorkflowRegistry-BnGilthz.d.ts +0 -1137
- package/dist/InMemoryWorkflowRegistry-CEp5I8No.d.ts +0 -1146
- package/dist/InMemoryWorkflowRegistry-CHyMB9jW.d.cts +0 -976
- package/dist/InMemoryWorkflowRegistry-CUN7K86m.d.cts +0 -1061
- package/dist/InMemoryWorkflowRegistry-CVfHyELh.d.cts +0 -971
- package/dist/InMemoryWorkflowRegistry-CXXJrwAr.d.cts +0 -1052
- package/dist/InMemoryWorkflowRegistry-DDGfPTJy.d.ts +0 -1013
- package/dist/InMemoryWorkflowRegistry-DnYSOoT5.d.ts +0 -1120
- package/dist/InMemoryWorkflowRegistry-Dp5GiFF2.d.cts +0 -1035
- package/dist/InMemoryWorkflowRegistry-DypDBeOw.d.cts +0 -1116
- package/dist/InMemoryWorkflowRegistry-SzwJCAxT.d.ts +0 -1012
- package/dist/InMemoryWorkflowRegistry-jupvqyGc.d.cts +0 -977
- package/dist/InMemoryWorkflowRegistry-rAdKVWYT.d.ts +0 -1117
- package/dist/InProcessRetryRunner-BBNPkXjy.d.cts +0 -292
- package/dist/PersistedWorkflowSnapshotFactory-7RkOL3Kg.d.ts +0 -14
- package/dist/PersistedWorkflowSnapshotFactory-BmANa46W.cjs +0 -141
- package/dist/PersistedWorkflowSnapshotFactory-BmANa46W.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Bwb_etSt.js +0 -118
- package/dist/PersistedWorkflowSnapshotFactory-Bwb_etSt.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-CRkKGNV6.js +0 -123
- package/dist/PersistedWorkflowSnapshotFactory-CRkKGNV6.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-CZolnGy5.js +0 -101
- package/dist/PersistedWorkflowSnapshotFactory-CZolnGy5.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Ca_oysOv.cjs +0 -131
- package/dist/PersistedWorkflowSnapshotFactory-Ca_oysOv.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-CqIcShnX.js +0 -103
- package/dist/PersistedWorkflowSnapshotFactory-CqIcShnX.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-D-tBk4_G.js +0 -119
- package/dist/PersistedWorkflowSnapshotFactory-D-tBk4_G.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-D4cXl2e2.cjs +0 -131
- package/dist/PersistedWorkflowSnapshotFactory-D4cXl2e2.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-DINoP12r.cjs +0 -131
- package/dist/PersistedWorkflowSnapshotFactory-DINoP12r.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-DJAwSuHU.js +0 -103
- package/dist/PersistedWorkflowSnapshotFactory-DJAwSuHU.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-DSUjVCcf.cjs +0 -131
- package/dist/PersistedWorkflowSnapshotFactory-DSUjVCcf.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-DdHuhkDb.cjs +0 -107
- package/dist/PersistedWorkflowSnapshotFactory-DdHuhkDb.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Dqc6NHis.js +0 -119
- package/dist/PersistedWorkflowSnapshotFactory-Dqc6NHis.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Dxa2dSrw.cjs +0 -130
- package/dist/PersistedWorkflowSnapshotFactory-Dxa2dSrw.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Ep79Ah1G.js +0 -123
- package/dist/PersistedWorkflowSnapshotFactory-Ep79Ah1G.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-GyLfRuiJ.js +0 -119
- package/dist/PersistedWorkflowSnapshotFactory-GyLfRuiJ.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-HTpBsBzn.js +0 -102
- package/dist/PersistedWorkflowSnapshotFactory-HTpBsBzn.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-LVmaaf3t.cjs +0 -141
- package/dist/PersistedWorkflowSnapshotFactory-LVmaaf3t.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-PZCpo2ZS.js +0 -119
- package/dist/PersistedWorkflowSnapshotFactory-PZCpo2ZS.js.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-UjQ1SJev.cjs +0 -109
- package/dist/PersistedWorkflowSnapshotFactory-UjQ1SJev.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Y8kCrhcy.cjs +0 -109
- package/dist/PersistedWorkflowSnapshotFactory-Y8kCrhcy.cjs.map +0 -1
- package/dist/PersistedWorkflowSnapshotFactory-Z_nB-fmB.cjs +0 -108
- package/dist/PersistedWorkflowSnapshotFactory-Z_nB-fmB.cjs.map +0 -1
- package/dist/RunIntentService-1EE6N8ZL.cjs +0 -963
- package/dist/RunIntentService-1EE6N8ZL.cjs.map +0 -1
- package/dist/RunIntentService-2ivFmNQh.cjs +0 -3462
- package/dist/RunIntentService-2ivFmNQh.cjs.map +0 -1
- package/dist/RunIntentService-B0sUL5q-.js +0 -761
- package/dist/RunIntentService-B0sUL5q-.js.map +0 -1
- package/dist/RunIntentService-BFVbsOcg.js +0 -3131
- package/dist/RunIntentService-BFVbsOcg.js.map +0 -1
- package/dist/RunIntentService-BsBOwpVN.cjs +0 -1051
- package/dist/RunIntentService-BsBOwpVN.cjs.map +0 -1
- package/dist/RunIntentService-CSk3ETyn.js +0 -858
- package/dist/RunIntentService-CSk3ETyn.js.map +0 -1
- package/dist/RunIntentService-Ckn3u3tA.d.cts +0 -326
- package/dist/RunIntentService-DEo6GTTo.d.cts +0 -289
- package/dist/RunIntentService-DKrGtL0B.js +0 -782
- package/dist/RunIntentService-DKrGtL0B.js.map +0 -1
- package/dist/RunIntentService-DNOJc1R7.cjs +0 -942
- package/dist/RunIntentService-DNOJc1R7.cjs.map +0 -1
- package/dist/RunIntentService-Dq3pV53j.d.cts +0 -289
- package/dist/RunIntentService-NKobsfMQ.d.cts +0 -274
- package/dist/WorkflowSnapshotCodec-C3fuuS_R.d.cts +0 -22
- package/dist/WorkflowSnapshotCodec-CUudUo6f.js +0 -123
- package/dist/WorkflowSnapshotCodec-CUudUo6f.js.map +0 -1
- package/dist/WorkflowSnapshotCodec-CuCPQZTc.cjs +0 -129
- package/dist/WorkflowSnapshotCodec-CuCPQZTc.cjs.map +0 -1
- package/dist/WorkflowSnapshotCodec-DLiXQNvV.d.cts +0 -22
- package/dist/WorkflowSnapshotCodec-DNtdrZ7l.d.cts +0 -22
- package/dist/WorkflowSnapshotCodec-DTdWkoW_.d.cts +0 -22
- package/dist/credentialTypes-B5h3dI7r.d.cts +0 -1107
- package/dist/credentialTypes-B9okPCVo.d.cts +0 -963
- package/dist/credentialTypes-BFL70rgZ.d.cts +0 -964
- package/dist/credentialTypes-BGkh1O07.d.ts +0 -1010
- package/dist/credentialTypes-BNLi4Q7u.d.ts +0 -1030
- package/dist/credentialTypes-CeSoZGj3.d.cts +0 -994
- package/dist/credentialTypes-CpHc32Ig.d.cts +0 -984
- package/dist/credentialTypes-D0m7MQQl.d.cts +0 -1107
- package/dist/credentialTypes-D4nL2sUd.d.ts +0 -1000
- package/dist/credentialTypes-DBYK2Qbu.d.ts +0 -999
- package/dist/credentialTypes-DMJVy0r1.d.ts +0 -1000
- package/dist/credentialTypes-DhUAjYQp.d.ts +0 -1020
- package/dist/credentialTypes-gGITj5KL.d.cts +0 -964
- package/dist/credentialTypes-r3KVBJBE.d.cts +0 -974
- package/dist/diTokens-ClO27tjK.cjs +0 -34
- package/dist/diTokens-ClO27tjK.cjs.map +0 -1
- package/dist/diTokens-CoHBkwG6.js +0 -28
- package/dist/diTokens-CoHBkwG6.js.map +0 -1
- package/dist/index-6Doxmfnd.d.ts +0 -857
- package/dist/index-9g6Pfe9Z.d.ts +0 -689
- package/dist/index-AZ72Ej-K.d.ts +0 -920
- package/dist/index-BEk9V-q-.d.ts +0 -667
- package/dist/index-Bjt7_7oS.d.ts +0 -1192
- package/dist/index-CFGxsYXy.d.ts +0 -708
- package/dist/index-C_u8xFgn.d.ts +0 -690
- package/dist/index-CpbfsvOJ.d.ts +0 -1192
- package/dist/index-CsReNJN_.d.ts +0 -859
- package/dist/index-D5iNnXaW.d.ts +0 -667
- package/dist/index-DD_Eft1q.d.ts +0 -708
- package/dist/index-DiSYUe0G.d.ts +0 -1192
- package/dist/index-gIcH60sp.d.ts +0 -674
- package/dist/runtime-BIvd-1JA.cjs +0 -4112
- package/dist/runtime-BIvd-1JA.cjs.map +0 -1
- package/dist/runtime-D3eWKSQK.cjs +0 -3986
- package/dist/runtime-D3eWKSQK.cjs.map +0 -1
- package/dist/runtime-Dvp4xAjg.js +0 -3799
- package/dist/runtime-Dvp4xAjg.js.map +0 -1
- package/dist/runtime-vc76SSAa.js +0 -3685
- package/dist/runtime-vc76SSAa.js.map +0 -1
- package/dist/runtimeTypes-BK0b8SaG.d.cts +0 -884
- package/dist/runtimeTypes-CoYZkYQq.d.cts +0 -851
- package/dist/runtimeTypes-D-Pm0Uas.d.cts +0 -849
- package/dist/types-Cb5UK7Y6.d.ts +0 -857
|
@@ -1,1289 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import { DependencyContainer, DependencyContainer as Container, Disposable, InjectionToken, InjectionToken as TypeToken, Lifecycle, RegistrationOptions, container, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe";
|
|
3
|
-
import { ReadableStream } from "node:stream/web";
|
|
4
|
-
|
|
5
|
-
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
9
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
10
|
-
*
|
|
11
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
12
|
-
*/
|
|
13
|
-
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
14
|
-
interface NoneRetryPolicySpec {
|
|
15
|
-
readonly kind: "none";
|
|
16
|
-
}
|
|
17
|
-
interface FixedRetryPolicySpec {
|
|
18
|
-
readonly kind: "fixed";
|
|
19
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
20
|
-
readonly maxAttempts: number;
|
|
21
|
-
readonly delayMs: number;
|
|
22
|
-
}
|
|
23
|
-
interface ExponentialRetryPolicySpec {
|
|
24
|
-
readonly kind: "exponential";
|
|
25
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
26
|
-
readonly maxAttempts: number;
|
|
27
|
-
readonly initialDelayMs: number;
|
|
28
|
-
readonly multiplier: number;
|
|
29
|
-
readonly maxDelayMs?: number;
|
|
30
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
31
|
-
readonly jitter?: boolean;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/contracts/NoRetryPolicy.d.ts
|
|
35
|
-
declare class NoRetryPolicy implements NoneRetryPolicySpec {
|
|
36
|
-
readonly kind: "none";
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/contracts/RetryPolicy.d.ts
|
|
40
|
-
declare class RetryPolicy implements FixedRetryPolicySpec {
|
|
41
|
-
readonly maxAttempts: number;
|
|
42
|
-
readonly delayMs: number;
|
|
43
|
-
readonly kind: "fixed";
|
|
44
|
-
constructor(maxAttempts: number, delayMs: number);
|
|
45
|
-
/** Default for HTTP-style transient failures: 3 tries, 1s between attempts. */
|
|
46
|
-
static readonly defaultForHttp: FixedRetryPolicySpec;
|
|
47
|
-
/** Default for LLM / agent calls: 3 tries, 2s fixed backoff. */
|
|
48
|
-
static readonly defaultForAiAgent: FixedRetryPolicySpec;
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/contracts/ExpRetryPolicy.d.ts
|
|
52
|
-
declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
|
|
53
|
-
readonly maxAttempts: number;
|
|
54
|
-
readonly initialDelayMs: number;
|
|
55
|
-
readonly multiplier: number;
|
|
56
|
-
readonly maxDelayMs?: number | undefined;
|
|
57
|
-
readonly jitter?: boolean | undefined;
|
|
58
|
-
readonly kind: "exponential";
|
|
59
|
-
constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/events/runEvents.d.ts
|
|
63
|
-
type RunEvent = Readonly<{
|
|
64
|
-
kind: "runCreated";
|
|
65
|
-
runId: RunId;
|
|
66
|
-
workflowId: WorkflowId;
|
|
67
|
-
parent?: ParentExecutionRef;
|
|
68
|
-
at: string;
|
|
69
|
-
}> | Readonly<{
|
|
70
|
-
kind: "runSaved";
|
|
71
|
-
runId: RunId;
|
|
72
|
-
workflowId: WorkflowId;
|
|
73
|
-
parent?: ParentExecutionRef;
|
|
74
|
-
at: string;
|
|
75
|
-
state: PersistedRunState;
|
|
76
|
-
}> | Readonly<{
|
|
77
|
-
kind: "nodeQueued";
|
|
78
|
-
runId: RunId;
|
|
79
|
-
workflowId: WorkflowId;
|
|
80
|
-
parent?: ParentExecutionRef;
|
|
81
|
-
at: string;
|
|
82
|
-
snapshot: NodeExecutionSnapshot;
|
|
83
|
-
}> | Readonly<{
|
|
84
|
-
kind: "nodeStarted";
|
|
85
|
-
runId: RunId;
|
|
86
|
-
workflowId: WorkflowId;
|
|
87
|
-
parent?: ParentExecutionRef;
|
|
88
|
-
at: string;
|
|
89
|
-
snapshot: NodeExecutionSnapshot;
|
|
90
|
-
}> | Readonly<{
|
|
91
|
-
kind: "nodeCompleted";
|
|
92
|
-
runId: RunId;
|
|
93
|
-
workflowId: WorkflowId;
|
|
94
|
-
parent?: ParentExecutionRef;
|
|
95
|
-
at: string;
|
|
96
|
-
snapshot: NodeExecutionSnapshot;
|
|
97
|
-
}> | Readonly<{
|
|
98
|
-
kind: "nodeFailed";
|
|
99
|
-
runId: RunId;
|
|
100
|
-
workflowId: WorkflowId;
|
|
101
|
-
parent?: ParentExecutionRef;
|
|
102
|
-
at: string;
|
|
103
|
-
snapshot: NodeExecutionSnapshot;
|
|
104
|
-
}>;
|
|
105
|
-
interface RunEventSubscription {
|
|
106
|
-
close(): Promise<void>;
|
|
107
|
-
}
|
|
108
|
-
interface RunEventBus {
|
|
109
|
-
publish(event: RunEvent): Promise<void>;
|
|
110
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
111
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/contracts/runTypes.d.ts
|
|
115
|
-
interface RunExecutionOptions {
|
|
116
|
-
localOnly?: boolean;
|
|
117
|
-
webhook?: boolean;
|
|
118
|
-
mode?: "manual" | "debug";
|
|
119
|
-
sourceWorkflowId?: WorkflowId;
|
|
120
|
-
sourceRunId?: RunId;
|
|
121
|
-
derivedFromRunId?: RunId;
|
|
122
|
-
isMutable?: boolean;
|
|
123
|
-
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
124
|
-
subworkflowDepth?: number;
|
|
125
|
-
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
126
|
-
maxNodeActivations?: number;
|
|
127
|
-
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
128
|
-
maxSubworkflowDepth?: number;
|
|
129
|
-
}
|
|
130
|
-
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
131
|
-
interface EngineRunCounters {
|
|
132
|
-
completedNodeActivations: number;
|
|
133
|
-
}
|
|
134
|
-
type RunStopCondition = Readonly<{
|
|
135
|
-
kind: "workflowCompleted";
|
|
136
|
-
}> | Readonly<{
|
|
137
|
-
kind: "nodeCompleted";
|
|
138
|
-
nodeId: NodeId;
|
|
139
|
-
}>;
|
|
140
|
-
interface RunStateResetRequest {
|
|
141
|
-
clearFromNodeId: NodeId;
|
|
142
|
-
}
|
|
143
|
-
interface PersistedRunControlState {
|
|
144
|
-
stopCondition?: RunStopCondition;
|
|
145
|
-
}
|
|
146
|
-
interface PersistedWorkflowSnapshotNode {
|
|
147
|
-
id: NodeId;
|
|
148
|
-
kind: NodeKind;
|
|
149
|
-
name?: string;
|
|
150
|
-
nodeTokenId: PersistedTokenId;
|
|
151
|
-
configTokenId: PersistedTokenId;
|
|
152
|
-
tokenName?: string;
|
|
153
|
-
configTokenName?: string;
|
|
154
|
-
config: unknown;
|
|
155
|
-
}
|
|
156
|
-
interface PersistedWorkflowSnapshot {
|
|
157
|
-
id: WorkflowId;
|
|
158
|
-
name: string;
|
|
159
|
-
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
160
|
-
edges: ReadonlyArray<Edge>;
|
|
161
|
-
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
162
|
-
workflowErrorHandlerConfigured?: boolean;
|
|
163
|
-
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
164
|
-
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
165
|
-
}
|
|
166
|
-
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
167
|
-
interface PersistedMutableNodeState {
|
|
168
|
-
pinnedOutputsByPort?: PinnedNodeOutputsByPort;
|
|
169
|
-
lastDebugInput?: Items;
|
|
170
|
-
}
|
|
171
|
-
interface PersistedMutableRunState {
|
|
172
|
-
nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
|
|
173
|
-
}
|
|
174
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
175
|
-
interface RunQueueEntry {
|
|
176
|
-
nodeId: NodeId;
|
|
177
|
-
input: Items;
|
|
178
|
-
toInput?: InputPortKey;
|
|
179
|
-
batchId?: string;
|
|
180
|
-
from?: Readonly<{
|
|
181
|
-
nodeId: NodeId;
|
|
182
|
-
output: OutputPortKey;
|
|
183
|
-
}>;
|
|
184
|
-
collect?: Readonly<{
|
|
185
|
-
expectedInputs: ReadonlyArray<InputPortKey>;
|
|
186
|
-
received: Readonly<Record<InputPortKey, Items>>;
|
|
187
|
-
}>;
|
|
188
|
-
}
|
|
189
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
190
|
-
interface NodeExecutionError {
|
|
191
|
-
message: string;
|
|
192
|
-
name?: string;
|
|
193
|
-
stack?: string;
|
|
194
|
-
}
|
|
195
|
-
interface NodeExecutionSnapshot {
|
|
196
|
-
runId: RunId;
|
|
197
|
-
workflowId: WorkflowId;
|
|
198
|
-
nodeId: NodeId;
|
|
199
|
-
activationId?: NodeActivationId;
|
|
200
|
-
parent?: ParentExecutionRef;
|
|
201
|
-
status: NodeExecutionStatus;
|
|
202
|
-
usedPinnedOutput?: boolean;
|
|
203
|
-
queuedAt?: string;
|
|
204
|
-
startedAt?: string;
|
|
205
|
-
finishedAt?: string;
|
|
206
|
-
updatedAt: string;
|
|
207
|
-
inputsByPort?: NodeInputsByPort;
|
|
208
|
-
outputs?: NodeOutputs;
|
|
209
|
-
error?: NodeExecutionError;
|
|
210
|
-
}
|
|
211
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
212
|
-
type ConnectionInvocationId = string;
|
|
213
|
-
/**
|
|
214
|
-
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
215
|
-
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
216
|
-
*/
|
|
217
|
-
interface ConnectionInvocationRecord {
|
|
218
|
-
readonly invocationId: ConnectionInvocationId;
|
|
219
|
-
readonly runId: RunId;
|
|
220
|
-
readonly workflowId: WorkflowId;
|
|
221
|
-
readonly connectionNodeId: NodeId;
|
|
222
|
-
readonly parentAgentNodeId: NodeId;
|
|
223
|
-
readonly parentAgentActivationId: NodeActivationId;
|
|
224
|
-
readonly status: NodeExecutionStatus;
|
|
225
|
-
readonly managedInput?: JsonValue;
|
|
226
|
-
readonly managedOutput?: JsonValue;
|
|
227
|
-
readonly error?: NodeExecutionError;
|
|
228
|
-
readonly queuedAt?: string;
|
|
229
|
-
readonly startedAt?: string;
|
|
230
|
-
readonly finishedAt?: string;
|
|
231
|
-
readonly updatedAt: string;
|
|
232
|
-
}
|
|
233
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
234
|
-
type ConnectionInvocationAppendArgs = Readonly<{
|
|
235
|
-
invocationId: ConnectionInvocationId;
|
|
236
|
-
connectionNodeId: NodeId;
|
|
237
|
-
parentAgentNodeId: NodeId;
|
|
238
|
-
parentAgentActivationId: NodeActivationId;
|
|
239
|
-
status: NodeExecutionStatus;
|
|
240
|
-
managedInput?: JsonValue;
|
|
241
|
-
managedOutput?: JsonValue;
|
|
242
|
-
error?: NodeExecutionError;
|
|
243
|
-
queuedAt?: string;
|
|
244
|
-
startedAt?: string;
|
|
245
|
-
finishedAt?: string;
|
|
246
|
-
}>;
|
|
247
|
-
interface RunCurrentState {
|
|
248
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
249
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
250
|
-
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
251
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
252
|
-
mutableState?: PersistedMutableRunState;
|
|
253
|
-
}
|
|
254
|
-
interface CurrentStateExecutionRequest {
|
|
255
|
-
workflow: WorkflowDefinition;
|
|
256
|
-
items?: Items;
|
|
257
|
-
parent?: ParentExecutionRef;
|
|
258
|
-
executionOptions?: RunExecutionOptions;
|
|
259
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
260
|
-
mutableState?: PersistedMutableRunState;
|
|
261
|
-
currentState?: RunCurrentState;
|
|
262
|
-
stopCondition?: RunStopCondition;
|
|
263
|
-
reset?: RunStateResetRequest;
|
|
264
|
-
}
|
|
265
|
-
interface ExecutionFrontierPlan {
|
|
266
|
-
rootNodeId?: NodeId;
|
|
267
|
-
rootNodeInput?: Items;
|
|
268
|
-
queue: RunQueueEntry[];
|
|
269
|
-
currentState: RunCurrentState;
|
|
270
|
-
stopCondition: RunStopCondition;
|
|
271
|
-
satisfiedNodeIds: ReadonlyArray<NodeId>;
|
|
272
|
-
skippedNodeIds: ReadonlyArray<NodeId>;
|
|
273
|
-
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
274
|
-
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
275
|
-
}
|
|
276
|
-
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
277
|
-
interface RunSummary {
|
|
278
|
-
runId: RunId;
|
|
279
|
-
workflowId: WorkflowId;
|
|
280
|
-
startedAt: string;
|
|
281
|
-
status: RunStatus;
|
|
282
|
-
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
283
|
-
finishedAt?: string;
|
|
284
|
-
parent?: ParentExecutionRef;
|
|
285
|
-
executionOptions?: RunExecutionOptions;
|
|
286
|
-
}
|
|
287
|
-
interface PendingNodeExecution {
|
|
288
|
-
runId: RunId;
|
|
289
|
-
activationId: NodeActivationId;
|
|
290
|
-
workflowId: WorkflowId;
|
|
291
|
-
nodeId: NodeId;
|
|
292
|
-
itemsIn: number;
|
|
293
|
-
inputsByPort: NodeInputsByPort;
|
|
294
|
-
receiptId: string;
|
|
295
|
-
queue?: string;
|
|
296
|
-
batchId?: string;
|
|
297
|
-
enqueuedAt: string;
|
|
298
|
-
}
|
|
299
|
-
interface PersistedRunState {
|
|
300
|
-
runId: RunId;
|
|
301
|
-
workflowId: WorkflowId;
|
|
302
|
-
startedAt: string;
|
|
303
|
-
parent?: ParentExecutionRef;
|
|
304
|
-
executionOptions?: RunExecutionOptions;
|
|
305
|
-
control?: PersistedRunControlState;
|
|
306
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
307
|
-
mutableState?: PersistedMutableRunState;
|
|
308
|
-
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
309
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
310
|
-
/** Successful node completions so far (for activation budget). */
|
|
311
|
-
engineCounters?: EngineRunCounters;
|
|
312
|
-
status: RunStatus;
|
|
313
|
-
pending?: PendingNodeExecution;
|
|
314
|
-
queue: RunQueueEntry[];
|
|
315
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
316
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
317
|
-
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
318
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
319
|
-
}
|
|
320
|
-
interface RunStateStore {
|
|
321
|
-
createRun(args: {
|
|
322
|
-
runId: RunId;
|
|
323
|
-
workflowId: WorkflowId;
|
|
324
|
-
startedAt: string;
|
|
325
|
-
parent?: ParentExecutionRef;
|
|
326
|
-
executionOptions?: RunExecutionOptions;
|
|
327
|
-
control?: PersistedRunControlState;
|
|
328
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
329
|
-
mutableState?: PersistedMutableRunState;
|
|
330
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
331
|
-
engineCounters?: EngineRunCounters;
|
|
332
|
-
}): Promise<void>;
|
|
333
|
-
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
334
|
-
save(state: PersistedRunState): Promise<void>;
|
|
335
|
-
deleteRun?(runId: RunId): Promise<void>;
|
|
336
|
-
}
|
|
337
|
-
interface RunListingStore {
|
|
338
|
-
listRuns(args?: Readonly<{
|
|
339
|
-
workflowId?: WorkflowId;
|
|
340
|
-
limit?: number;
|
|
341
|
-
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
342
|
-
}
|
|
343
|
-
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
344
|
-
interface RunPruneCandidate {
|
|
345
|
-
readonly runId: RunId;
|
|
346
|
-
readonly workflowId: WorkflowId;
|
|
347
|
-
readonly startedAt: string;
|
|
348
|
-
readonly finishedAt: string;
|
|
349
|
-
}
|
|
350
|
-
interface RunPruneListingStore {
|
|
351
|
-
listRunsOlderThan(args: Readonly<{
|
|
352
|
-
beforeIso: string;
|
|
353
|
-
limit?: number;
|
|
354
|
-
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
355
|
-
}
|
|
356
|
-
type RunResult = {
|
|
357
|
-
runId: RunId;
|
|
358
|
-
workflowId: WorkflowId;
|
|
359
|
-
startedAt: string;
|
|
360
|
-
status: "completed";
|
|
361
|
-
outputs: Items;
|
|
362
|
-
} | {
|
|
363
|
-
runId: RunId;
|
|
364
|
-
workflowId: WorkflowId;
|
|
365
|
-
startedAt: string;
|
|
366
|
-
status: "pending";
|
|
367
|
-
pending: PendingNodeExecution;
|
|
368
|
-
} | {
|
|
369
|
-
runId: RunId;
|
|
370
|
-
workflowId: WorkflowId;
|
|
371
|
-
startedAt: string;
|
|
372
|
-
status: "failed";
|
|
373
|
-
error: {
|
|
374
|
-
message: string;
|
|
375
|
-
};
|
|
376
|
-
};
|
|
377
|
-
type WebhookRunResult = Readonly<{
|
|
378
|
-
runId: RunId;
|
|
379
|
-
workflowId: WorkflowId;
|
|
380
|
-
startedAt: string;
|
|
381
|
-
runStatus: "pending" | "completed";
|
|
382
|
-
response: Items;
|
|
383
|
-
}>;
|
|
384
|
-
interface PersistedWorkflowTokenRegistryLike {
|
|
385
|
-
register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
|
|
386
|
-
getTokenId(type: TypeToken<unknown>): string | undefined;
|
|
387
|
-
resolve(tokenId: string): TypeToken<unknown> | undefined;
|
|
388
|
-
registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
389
|
-
}
|
|
390
|
-
interface RunCompletionNotifier {
|
|
391
|
-
resolveRunCompletion(result: RunResult): void;
|
|
392
|
-
resolveWebhookResponse(result: WebhookRunResult): void;
|
|
393
|
-
}
|
|
394
|
-
interface RunEventPublisherDeps {
|
|
395
|
-
eventBus?: RunEventBus;
|
|
396
|
-
}
|
|
397
|
-
//#endregion
|
|
398
|
-
//#region src/contracts/workflowActivationPolicy.d.ts
|
|
399
|
-
/**
|
|
400
|
-
* Host-controlled policy: when false, trigger {@link TriggerNode} setup is skipped and webhook routes
|
|
401
|
-
* for that workflow are not registered (see engine trigger runtime + webhook matcher).
|
|
402
|
-
*/
|
|
403
|
-
interface WorkflowActivationPolicy {
|
|
404
|
-
isActive(workflowId: WorkflowId): boolean;
|
|
405
|
-
}
|
|
406
|
-
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
407
|
-
declare class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy {
|
|
408
|
-
isActive(_workflowId: WorkflowId): boolean;
|
|
409
|
-
}
|
|
410
|
-
//#endregion
|
|
411
|
-
//#region src/contracts/webhookTypes.d.ts
|
|
412
|
-
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
413
|
-
interface WebhookControlSignal {
|
|
414
|
-
readonly __webhookControl: true;
|
|
415
|
-
readonly kind: "respondNow" | "respondNowAndContinue";
|
|
416
|
-
readonly responseItems: Items;
|
|
417
|
-
readonly continueItems?: Items;
|
|
418
|
-
}
|
|
419
|
-
interface WebhookTriggerRoutingDiagnostics {
|
|
420
|
-
warn(message: string): void;
|
|
421
|
-
/** Inactive workflows omitted from the webhook route index (optional; host should wire for clarity at boot/reload). */
|
|
422
|
-
info?(message: string): void;
|
|
423
|
-
}
|
|
424
|
-
interface TriggerInstanceId {
|
|
425
|
-
workflowId: WorkflowId;
|
|
426
|
-
nodeId: NodeId;
|
|
427
|
-
}
|
|
428
|
-
/** Match for an incoming HTTP request: user-defined URL segment + workflow trigger node. */
|
|
429
|
-
interface WebhookInvocationMatch {
|
|
430
|
-
/** Same value as the webhook trigger's configured endpoint key (URL segment under the webhook base path). */
|
|
431
|
-
endpointPath: string;
|
|
432
|
-
workflowId: WorkflowId;
|
|
433
|
-
nodeId: NodeId;
|
|
434
|
-
methods: ReadonlyArray<HttpMethod>;
|
|
435
|
-
parseJsonBody?: (body: unknown) => unknown;
|
|
436
|
-
}
|
|
437
|
-
/** Result of resolving an HTTP method + endpoint path against the catalog webhook index (404 vs 405 vs match). */
|
|
438
|
-
type WebhookTriggerResolution = {
|
|
439
|
-
status: "notFound";
|
|
440
|
-
} | {
|
|
441
|
-
status: "methodNotAllowed";
|
|
442
|
-
match: WebhookInvocationMatch;
|
|
443
|
-
} | {
|
|
444
|
-
status: "ok";
|
|
445
|
-
match: WebhookInvocationMatch;
|
|
446
|
-
};
|
|
447
|
-
/**
|
|
448
|
-
* Resolves webhook routes from workflow definitions (catalog-backed index, no registration at trigger setup).
|
|
449
|
-
*/
|
|
450
|
-
interface WebhookTriggerMatcher {
|
|
451
|
-
match(args: {
|
|
452
|
-
endpointPath: string;
|
|
453
|
-
method: HttpMethod;
|
|
454
|
-
}): WebhookInvocationMatch | undefined;
|
|
455
|
-
lookup(endpointPath: string): WebhookInvocationMatch | undefined;
|
|
456
|
-
onEngineWorkflowsLoaded?(): void;
|
|
457
|
-
onEngineStopped?(): void;
|
|
458
|
-
/** Rebuild route index after activation changes without stopping the engine. */
|
|
459
|
-
reloadWebhookRoutes?(): void;
|
|
460
|
-
}
|
|
461
|
-
//#endregion
|
|
462
|
-
//#region src/contracts/runtimeTypes.d.ts
|
|
463
|
-
interface WorkflowRunnerService {
|
|
464
|
-
runById(args: {
|
|
465
|
-
workflowId: WorkflowId;
|
|
466
|
-
startAt?: NodeId;
|
|
467
|
-
items: Items;
|
|
468
|
-
parent?: ParentExecutionRef;
|
|
469
|
-
}): Promise<RunResult>;
|
|
470
|
-
}
|
|
471
|
-
interface WorkflowRunnerResolver {
|
|
472
|
-
resolve(): WorkflowRunnerService | undefined;
|
|
473
|
-
}
|
|
474
|
-
interface WorkflowRepository {
|
|
475
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
476
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
477
|
-
}
|
|
478
|
-
interface WorkflowCatalog extends WorkflowRepository {
|
|
479
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
480
|
-
}
|
|
481
|
-
interface NodeResolver {
|
|
482
|
-
resolve<T>(token: TypeToken<T>): T;
|
|
483
|
-
getContainer(): Container | undefined;
|
|
484
|
-
}
|
|
485
|
-
interface NodeExecutionStatePublisher {
|
|
486
|
-
markQueued(args: {
|
|
487
|
-
nodeId: NodeId;
|
|
488
|
-
activationId?: NodeActivationId;
|
|
489
|
-
inputsByPort?: NodeInputsByPort;
|
|
490
|
-
}): Promise<void>;
|
|
491
|
-
markRunning(args: {
|
|
492
|
-
nodeId: NodeId;
|
|
493
|
-
activationId?: NodeActivationId;
|
|
494
|
-
inputsByPort?: NodeInputsByPort;
|
|
495
|
-
}): Promise<void>;
|
|
496
|
-
markCompleted(args: {
|
|
497
|
-
nodeId: NodeId;
|
|
498
|
-
activationId?: NodeActivationId;
|
|
499
|
-
inputsByPort?: NodeInputsByPort;
|
|
500
|
-
outputs?: NodeOutputs;
|
|
501
|
-
}): Promise<void>;
|
|
502
|
-
markFailed(args: {
|
|
503
|
-
nodeId: NodeId;
|
|
504
|
-
activationId?: NodeActivationId;
|
|
505
|
-
inputsByPort?: NodeInputsByPort;
|
|
506
|
-
error: Error;
|
|
507
|
-
}): Promise<void>;
|
|
508
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
509
|
-
}
|
|
510
|
-
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
511
|
-
interface BinaryStorageWriteRequest {
|
|
512
|
-
storageKey: string;
|
|
513
|
-
body: BinaryBody;
|
|
514
|
-
}
|
|
515
|
-
interface BinaryStorageWriteResult {
|
|
516
|
-
storageKey: string;
|
|
517
|
-
size: number;
|
|
518
|
-
sha256?: string;
|
|
519
|
-
}
|
|
520
|
-
interface BinaryStorageReadResult {
|
|
521
|
-
body: ReadableStream<Uint8Array>;
|
|
522
|
-
size?: number;
|
|
523
|
-
}
|
|
524
|
-
interface BinaryStorageStatResult {
|
|
525
|
-
exists: boolean;
|
|
526
|
-
size?: number;
|
|
527
|
-
}
|
|
528
|
-
interface BinaryStorage {
|
|
529
|
-
readonly driverName: string;
|
|
530
|
-
write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;
|
|
531
|
-
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
532
|
-
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
533
|
-
delete(storageKey: string): Promise<void>;
|
|
534
|
-
}
|
|
535
|
-
interface BinaryAttachmentCreateRequest {
|
|
536
|
-
name: string;
|
|
537
|
-
body: BinaryBody;
|
|
538
|
-
mimeType: string;
|
|
539
|
-
filename?: string;
|
|
540
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
541
|
-
}
|
|
542
|
-
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
543
|
-
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
544
|
-
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
545
|
-
}
|
|
546
|
-
interface ExecutionBinaryService {
|
|
547
|
-
forNode(args: {
|
|
548
|
-
nodeId: NodeId;
|
|
549
|
-
activationId: NodeActivationId;
|
|
550
|
-
}): NodeBinaryAttachmentService;
|
|
551
|
-
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
552
|
-
}
|
|
553
|
-
interface ExecutionContext {
|
|
554
|
-
runId: RunId;
|
|
555
|
-
workflowId: WorkflowId;
|
|
556
|
-
parent?: ParentExecutionRef;
|
|
557
|
-
/** This run's subworkflow depth (0 = root). */
|
|
558
|
-
subworkflowDepth: number;
|
|
559
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
560
|
-
engineMaxNodeActivations: number;
|
|
561
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
562
|
-
engineMaxSubworkflowDepth: number;
|
|
563
|
-
now: () => Date;
|
|
564
|
-
data: RunDataSnapshot;
|
|
565
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
566
|
-
binary: ExecutionBinaryService;
|
|
567
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
568
|
-
}
|
|
569
|
-
interface ExecutionContextFactory {
|
|
570
|
-
create(args: {
|
|
571
|
-
runId: RunId;
|
|
572
|
-
workflowId: WorkflowId;
|
|
573
|
-
parent?: ParentExecutionRef;
|
|
574
|
-
subworkflowDepth: number;
|
|
575
|
-
engineMaxNodeActivations: number;
|
|
576
|
-
engineMaxSubworkflowDepth: number;
|
|
577
|
-
data: RunDataSnapshot;
|
|
578
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
579
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
580
|
-
}): ExecutionContext;
|
|
581
|
-
}
|
|
582
|
-
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
583
|
-
nodeId: NodeId;
|
|
584
|
-
activationId: NodeActivationId;
|
|
585
|
-
config: TConfig;
|
|
586
|
-
binary: NodeBinaryAttachmentService;
|
|
587
|
-
}
|
|
588
|
-
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
589
|
-
trigger: TriggerInstanceId;
|
|
590
|
-
config: TConfig;
|
|
591
|
-
previousState: TSetupState$1;
|
|
592
|
-
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
593
|
-
emit(items: Items): Promise<void>;
|
|
594
|
-
}
|
|
595
|
-
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
596
|
-
trigger: TriggerInstanceId;
|
|
597
|
-
nodeId: NodeId;
|
|
598
|
-
config: TConfig;
|
|
599
|
-
previousState: TSetupState$1;
|
|
600
|
-
}
|
|
601
|
-
/**
|
|
602
|
-
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
603
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
604
|
-
* package-level setup code.
|
|
605
|
-
*/
|
|
606
|
-
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
607
|
-
trigger: TriggerInstanceId;
|
|
608
|
-
updatedAt: string;
|
|
609
|
-
state: TState;
|
|
610
|
-
}
|
|
611
|
-
interface TriggerSetupStateStore {
|
|
612
|
-
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
613
|
-
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
614
|
-
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
615
|
-
}
|
|
616
|
-
interface TriggerCleanupHandle {
|
|
617
|
-
stop(): Promise<void> | void;
|
|
618
|
-
}
|
|
619
|
-
interface EngineHost {
|
|
620
|
-
credentialSessions: CredentialSessionService;
|
|
621
|
-
workflows?: WorkflowRunnerService;
|
|
622
|
-
}
|
|
623
|
-
interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
624
|
-
kind: "node";
|
|
625
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
626
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
627
|
-
}
|
|
628
|
-
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
629
|
-
kind: "node";
|
|
630
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
631
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
632
|
-
}
|
|
633
|
-
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
634
|
-
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
635
|
-
kind: "trigger";
|
|
636
|
-
outputPorts: readonly ["main"];
|
|
637
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
638
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
639
|
-
}
|
|
640
|
-
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
641
|
-
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
642
|
-
}
|
|
643
|
-
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
644
|
-
interface NodeExecutionRequest {
|
|
645
|
-
runId: RunId;
|
|
646
|
-
activationId: NodeActivationId;
|
|
647
|
-
workflowId: WorkflowId;
|
|
648
|
-
nodeId: NodeId;
|
|
649
|
-
input: Items;
|
|
650
|
-
parent?: ParentExecutionRef;
|
|
651
|
-
queue?: string;
|
|
652
|
-
executionOptions?: RunExecutionOptions;
|
|
653
|
-
}
|
|
654
|
-
interface NodeExecutionScheduler {
|
|
655
|
-
enqueue(request: NodeExecutionRequest): Promise<{
|
|
656
|
-
receiptId: string;
|
|
657
|
-
}>;
|
|
658
|
-
cancel?(receiptId: string): Promise<void>;
|
|
659
|
-
}
|
|
660
|
-
type NodeActivationRequestBase = Readonly<{
|
|
661
|
-
runId: RunId;
|
|
662
|
-
activationId: NodeActivationId;
|
|
663
|
-
workflowId: WorkflowId;
|
|
664
|
-
nodeId: NodeId;
|
|
665
|
-
parent?: ParentExecutionRef;
|
|
666
|
-
executionOptions?: RunExecutionOptions;
|
|
667
|
-
batchId?: string;
|
|
668
|
-
ctx: NodeExecutionContext;
|
|
669
|
-
}>;
|
|
670
|
-
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
671
|
-
kind: "single";
|
|
672
|
-
input: Items;
|
|
673
|
-
}>) | (NodeActivationRequestBase & Readonly<{
|
|
674
|
-
kind: "multi";
|
|
675
|
-
inputsByPort: NodeInputsByPort;
|
|
676
|
-
}>);
|
|
677
|
-
interface NodeActivationReceipt {
|
|
678
|
-
receiptId: string;
|
|
679
|
-
mode?: "local" | "worker";
|
|
680
|
-
queue?: string;
|
|
681
|
-
}
|
|
682
|
-
interface NodeActivationContinuation {
|
|
683
|
-
markNodeRunning(args: {
|
|
684
|
-
runId: RunId;
|
|
685
|
-
activationId: NodeActivationId;
|
|
686
|
-
nodeId: NodeId;
|
|
687
|
-
inputsByPort: NodeInputsByPort;
|
|
688
|
-
}): Promise<void>;
|
|
689
|
-
resumeFromNodeResult(args: {
|
|
690
|
-
runId: RunId;
|
|
691
|
-
activationId: NodeActivationId;
|
|
692
|
-
nodeId: NodeId;
|
|
693
|
-
outputs: NodeOutputs;
|
|
694
|
-
}): Promise<RunResult>;
|
|
695
|
-
resumeFromNodeError(args: {
|
|
696
|
-
runId: RunId;
|
|
697
|
-
activationId: NodeActivationId;
|
|
698
|
-
nodeId: NodeId;
|
|
699
|
-
error: Error;
|
|
700
|
-
}): Promise<RunResult>;
|
|
701
|
-
}
|
|
702
|
-
interface NodeActivationScheduler {
|
|
703
|
-
setContinuation?(continuation: NodeActivationContinuation): void;
|
|
704
|
-
enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
|
|
705
|
-
notifyPendingStatePersisted?(runId: RunId): void;
|
|
706
|
-
cancel?(receiptId: string): Promise<void>;
|
|
707
|
-
}
|
|
708
|
-
interface WorkflowNodeInstanceFactory {
|
|
709
|
-
createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;
|
|
710
|
-
createByType(type: TypeToken<unknown>): unknown;
|
|
711
|
-
}
|
|
712
|
-
interface NodeExecutor {
|
|
713
|
-
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
714
|
-
}
|
|
715
|
-
interface WorkflowSnapshotFactory {
|
|
716
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
717
|
-
}
|
|
718
|
-
interface WorkflowSnapshotResolver {
|
|
719
|
-
resolve(args: {
|
|
720
|
-
workflowId: WorkflowId;
|
|
721
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
722
|
-
}): WorkflowDefinition | undefined;
|
|
723
|
-
}
|
|
724
|
-
/** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */
|
|
725
|
-
interface TriggerRuntimeDiagnostics {
|
|
726
|
-
info(message: string): void;
|
|
727
|
-
warn(message: string): void;
|
|
728
|
-
}
|
|
729
|
-
interface EngineDeps {
|
|
730
|
-
credentialSessions: CredentialSessionService;
|
|
731
|
-
workflowRunnerResolver: WorkflowRunnerResolver;
|
|
732
|
-
workflowCatalog: WorkflowCatalog;
|
|
733
|
-
workflowRepository: WorkflowRepository;
|
|
734
|
-
/** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
|
|
735
|
-
workflowActivationPolicy: WorkflowActivationPolicy;
|
|
736
|
-
nodeResolver: NodeResolver;
|
|
737
|
-
triggerSetupStateStore: TriggerSetupStateStore;
|
|
738
|
-
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
739
|
-
runIdFactory: RunIdFactory;
|
|
740
|
-
activationIdFactory: ActivationIdFactory;
|
|
741
|
-
runStore: RunStateStore;
|
|
742
|
-
activationScheduler: NodeActivationScheduler;
|
|
743
|
-
runDataFactory: RunDataFactory;
|
|
744
|
-
executionContextFactory: ExecutionContextFactory;
|
|
745
|
-
eventBus?: RunEventBus;
|
|
746
|
-
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
747
|
-
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
748
|
-
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
749
|
-
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
750
|
-
/** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
|
|
751
|
-
triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
|
|
752
|
-
}
|
|
753
|
-
//#endregion
|
|
754
|
-
//#region src/contracts/workflowTypes.d.ts
|
|
755
|
-
type WorkflowId = string;
|
|
756
|
-
type NodeId = string;
|
|
757
|
-
type OutputPortKey = string;
|
|
758
|
-
type InputPortKey = string;
|
|
759
|
-
type PersistedTokenId = string;
|
|
760
|
-
type NodeKind = "trigger" | "node";
|
|
761
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
762
|
-
interface JsonObject {
|
|
763
|
-
readonly [key: string]: JsonValue;
|
|
764
|
-
}
|
|
765
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
766
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
767
|
-
interface Edge {
|
|
768
|
-
from: {
|
|
769
|
-
nodeId: NodeId;
|
|
770
|
-
output: OutputPortKey;
|
|
771
|
-
};
|
|
772
|
-
to: {
|
|
773
|
-
nodeId: NodeId;
|
|
774
|
-
input: InputPortKey;
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
type NodeConnectionName = string;
|
|
778
|
-
/**
|
|
779
|
-
* Named connection from an executable parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
780
|
-
* but are not traversed by the main execution graph.
|
|
781
|
-
*/
|
|
782
|
-
interface WorkflowNodeConnection {
|
|
783
|
-
readonly parentNodeId: NodeId;
|
|
784
|
-
readonly connectionName: NodeConnectionName;
|
|
785
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
786
|
-
}
|
|
787
|
-
interface WorkflowDefinition {
|
|
788
|
-
id: WorkflowId;
|
|
789
|
-
name: string;
|
|
790
|
-
nodes: NodeDefinition[];
|
|
791
|
-
edges: Edge[];
|
|
792
|
-
/**
|
|
793
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
794
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
795
|
-
*/
|
|
796
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
797
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
798
|
-
discoveryPathSegments?: readonly string[];
|
|
799
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
800
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
801
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
802
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
803
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
804
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
805
|
-
}
|
|
806
|
-
interface WorkflowGraph {
|
|
807
|
-
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
808
|
-
nodeId: NodeId;
|
|
809
|
-
input: InputPortKey;
|
|
810
|
-
}>>;
|
|
811
|
-
}
|
|
812
|
-
interface WorkflowGraphFactory {
|
|
813
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
814
|
-
}
|
|
815
|
-
interface NodeConfigBase {
|
|
816
|
-
readonly kind: NodeKind;
|
|
817
|
-
readonly type: TypeToken<unknown>;
|
|
818
|
-
readonly name?: string;
|
|
819
|
-
readonly id?: NodeId;
|
|
820
|
-
readonly icon?: string;
|
|
821
|
-
readonly execution?: Readonly<{
|
|
822
|
-
hint?: "local" | "worker";
|
|
823
|
-
queue?: string;
|
|
824
|
-
}>;
|
|
825
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
826
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
827
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
828
|
-
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
829
|
-
/**
|
|
830
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
831
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
832
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
833
|
-
*/
|
|
834
|
-
readonly continueWhenEmptyOutput?: boolean;
|
|
835
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
836
|
-
}
|
|
837
|
-
declare const runnableNodeInputType: unique symbol;
|
|
838
|
-
declare const runnableNodeOutputType: unique symbol;
|
|
839
|
-
declare const triggerNodeOutputType: unique symbol;
|
|
840
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
841
|
-
readonly kind: "node";
|
|
842
|
-
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
843
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
844
|
-
}
|
|
845
|
-
declare const triggerNodeSetupStateType: unique symbol;
|
|
846
|
-
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
847
|
-
readonly kind: "trigger";
|
|
848
|
-
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
849
|
-
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
850
|
-
}
|
|
851
|
-
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
852
|
-
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
853
|
-
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
854
|
-
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
855
|
-
interface NodeDefinition {
|
|
856
|
-
id: NodeId;
|
|
857
|
-
kind: NodeKind;
|
|
858
|
-
type: TypeToken<unknown>;
|
|
859
|
-
name?: string;
|
|
860
|
-
config: NodeConfigBase;
|
|
861
|
-
}
|
|
862
|
-
interface NodeRef {
|
|
863
|
-
id: NodeId;
|
|
864
|
-
kind: NodeKind;
|
|
865
|
-
name?: string;
|
|
866
|
-
}
|
|
867
|
-
type PairedItemRef = Readonly<{
|
|
868
|
-
nodeId: NodeId;
|
|
869
|
-
output: OutputPortKey;
|
|
870
|
-
itemIndex: number;
|
|
871
|
-
}>;
|
|
872
|
-
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
873
|
-
type BinaryAttachment = Readonly<{
|
|
874
|
-
id: string;
|
|
875
|
-
storageKey: string;
|
|
876
|
-
mimeType: string;
|
|
877
|
-
size: number;
|
|
878
|
-
storageDriver: string;
|
|
879
|
-
previewKind: BinaryPreviewKind;
|
|
880
|
-
createdAt: string;
|
|
881
|
-
runId: RunId;
|
|
882
|
-
workflowId: WorkflowId;
|
|
883
|
-
nodeId: NodeId;
|
|
884
|
-
activationId: NodeActivationId;
|
|
885
|
-
filename?: string;
|
|
886
|
-
sha256?: string;
|
|
887
|
-
}>;
|
|
888
|
-
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
889
|
-
type Item<TJson = unknown> = Readonly<{
|
|
890
|
-
json: TJson;
|
|
891
|
-
binary?: ItemBinary;
|
|
892
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
893
|
-
paired?: ReadonlyArray<PairedItemRef>;
|
|
894
|
-
}>;
|
|
895
|
-
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
896
|
-
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
897
|
-
type RunId = string;
|
|
898
|
-
type NodeActivationId = string;
|
|
899
|
-
interface ParentExecutionRef {
|
|
900
|
-
runId: RunId;
|
|
901
|
-
workflowId: WorkflowId;
|
|
902
|
-
nodeId: NodeId;
|
|
903
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
904
|
-
subworkflowDepth?: number;
|
|
905
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
906
|
-
engineMaxNodeActivations?: number;
|
|
907
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
908
|
-
engineMaxSubworkflowDepth?: number;
|
|
909
|
-
}
|
|
910
|
-
interface RunDataSnapshot {
|
|
911
|
-
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
912
|
-
getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
|
|
913
|
-
getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
|
|
914
|
-
}
|
|
915
|
-
interface MutableRunData extends RunDataSnapshot {
|
|
916
|
-
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
917
|
-
dump(): Record<NodeId, NodeOutputs>;
|
|
918
|
-
}
|
|
919
|
-
interface RunDataFactory {
|
|
920
|
-
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
921
|
-
}
|
|
922
|
-
interface RunIdFactory {
|
|
923
|
-
makeRunId(): RunId;
|
|
924
|
-
}
|
|
925
|
-
interface ActivationIdFactory {
|
|
926
|
-
makeActivationId(): NodeActivationId;
|
|
927
|
-
}
|
|
928
|
-
type UpstreamRefPlaceholder = `$${number}`;
|
|
929
|
-
declare const branchRef: (index: number) => UpstreamRefPlaceholder;
|
|
930
|
-
type ExecutionMode = "local" | "worker";
|
|
931
|
-
interface NodeSchedulerDecision {
|
|
932
|
-
mode: ExecutionMode;
|
|
933
|
-
queue?: string;
|
|
934
|
-
}
|
|
935
|
-
interface NodeOffloadPolicy {
|
|
936
|
-
decide(args: {
|
|
937
|
-
workflowId: WorkflowId;
|
|
938
|
-
nodeId: NodeId;
|
|
939
|
-
config: NodeConfigBase;
|
|
940
|
-
}): NodeSchedulerDecision;
|
|
941
|
-
}
|
|
942
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
943
|
-
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
944
|
-
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
945
|
-
interface WorkflowStoragePolicyResolver {
|
|
946
|
-
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
947
|
-
}
|
|
948
|
-
interface WorkflowStoragePolicyDecisionArgs {
|
|
949
|
-
readonly runId: RunId;
|
|
950
|
-
readonly workflowId: WorkflowId;
|
|
951
|
-
readonly workflow: WorkflowDefinition;
|
|
952
|
-
readonly finalStatus: "completed" | "failed";
|
|
953
|
-
readonly startedAt: string;
|
|
954
|
-
readonly finishedAt: string;
|
|
955
|
-
}
|
|
956
|
-
interface WorkflowPrunePolicySpec {
|
|
957
|
-
readonly runDataRetentionSeconds?: number;
|
|
958
|
-
readonly binaryRetentionSeconds?: number;
|
|
959
|
-
}
|
|
960
|
-
interface PersistedRunPolicySnapshot {
|
|
961
|
-
readonly retentionSeconds?: number;
|
|
962
|
-
readonly binaryRetentionSeconds?: number;
|
|
963
|
-
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
964
|
-
}
|
|
965
|
-
interface WorkflowErrorHandler {
|
|
966
|
-
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
967
|
-
}
|
|
968
|
-
interface WorkflowErrorContext {
|
|
969
|
-
readonly runId: RunId;
|
|
970
|
-
readonly workflowId: WorkflowId;
|
|
971
|
-
readonly workflow: WorkflowDefinition;
|
|
972
|
-
readonly failedNodeId: NodeId;
|
|
973
|
-
readonly error: Error;
|
|
974
|
-
readonly startedAt: string;
|
|
975
|
-
readonly finishedAt: string;
|
|
976
|
-
}
|
|
977
|
-
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
978
|
-
interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
979
|
-
readonly kind: "single" | "multi";
|
|
980
|
-
readonly items: Items;
|
|
981
|
-
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
982
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
983
|
-
readonly error: Error;
|
|
984
|
-
}
|
|
985
|
-
interface NodeErrorHandler {
|
|
986
|
-
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
987
|
-
}
|
|
988
|
-
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
989
|
-
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
990
|
-
interface WorkflowPolicyRuntimeDefaults {
|
|
991
|
-
readonly retentionSeconds?: number;
|
|
992
|
-
readonly binaryRetentionSeconds?: number;
|
|
993
|
-
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
994
|
-
}
|
|
995
|
-
//#endregion
|
|
996
|
-
//#region src/contracts/credentialTypes.d.ts
|
|
997
|
-
type CredentialTypeId = string;
|
|
998
|
-
type CredentialInstanceId = string;
|
|
999
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
1000
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
1001
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
1002
|
-
type CredentialFieldSchema = Readonly<{
|
|
1003
|
-
key: string;
|
|
1004
|
-
label: string;
|
|
1005
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
1006
|
-
required?: true;
|
|
1007
|
-
order?: number;
|
|
1008
|
-
placeholder?: string;
|
|
1009
|
-
helpText?: string;
|
|
1010
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
1011
|
-
envVarName?: string;
|
|
1012
|
-
/**
|
|
1013
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
1014
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
1015
|
-
*/
|
|
1016
|
-
copyValue?: string;
|
|
1017
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
1018
|
-
copyButtonLabel?: string;
|
|
1019
|
-
}>;
|
|
1020
|
-
type CredentialRequirement = Readonly<{
|
|
1021
|
-
slotKey: string;
|
|
1022
|
-
label: string;
|
|
1023
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1024
|
-
optional?: true;
|
|
1025
|
-
helpText?: string;
|
|
1026
|
-
helpUrl?: string;
|
|
1027
|
-
}>;
|
|
1028
|
-
type CredentialBindingKey = Readonly<{
|
|
1029
|
-
workflowId: WorkflowId;
|
|
1030
|
-
nodeId: NodeId;
|
|
1031
|
-
slotKey: string;
|
|
1032
|
-
}>;
|
|
1033
|
-
type CredentialBinding = Readonly<{
|
|
1034
|
-
key: CredentialBindingKey;
|
|
1035
|
-
instanceId: CredentialInstanceId;
|
|
1036
|
-
updatedAt: string;
|
|
1037
|
-
}>;
|
|
1038
|
-
type CredentialHealth = Readonly<{
|
|
1039
|
-
status: CredentialHealthStatus;
|
|
1040
|
-
message?: string;
|
|
1041
|
-
testedAt?: string;
|
|
1042
|
-
expiresAt?: string;
|
|
1043
|
-
details?: Readonly<Record<string, unknown>>;
|
|
1044
|
-
}>;
|
|
1045
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
1046
|
-
authorizeUrlFieldKey: string;
|
|
1047
|
-
tokenUrlFieldKey: string;
|
|
1048
|
-
userInfoUrlFieldKey?: string;
|
|
1049
|
-
}>;
|
|
1050
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
1051
|
-
kind: "oauth2";
|
|
1052
|
-
providerId: string;
|
|
1053
|
-
scopes: ReadonlyArray<string>;
|
|
1054
|
-
clientIdFieldKey?: string;
|
|
1055
|
-
clientSecretFieldKey?: string;
|
|
1056
|
-
} | {
|
|
1057
|
-
kind: "oauth2";
|
|
1058
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
1059
|
-
scopes: ReadonlyArray<string>;
|
|
1060
|
-
clientIdFieldKey?: string;
|
|
1061
|
-
clientSecretFieldKey?: string;
|
|
1062
|
-
}>;
|
|
1063
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
1064
|
-
type CredentialTypeDefinition = Readonly<{
|
|
1065
|
-
typeId: CredentialTypeId;
|
|
1066
|
-
displayName: string;
|
|
1067
|
-
description?: string;
|
|
1068
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1069
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1070
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1071
|
-
auth?: CredentialAuthDefinition;
|
|
1072
|
-
}>;
|
|
1073
|
-
/**
|
|
1074
|
-
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
1075
|
-
*/
|
|
1076
|
-
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
1077
|
-
/**
|
|
1078
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
1079
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
1080
|
-
* assignable here for session/test callbacks.
|
|
1081
|
-
*/
|
|
1082
|
-
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
1083
|
-
instanceId: CredentialInstanceId;
|
|
1084
|
-
typeId: CredentialTypeId;
|
|
1085
|
-
displayName: string;
|
|
1086
|
-
sourceKind: CredentialMaterialSourceKind;
|
|
1087
|
-
publicConfig: TPublicConfig;
|
|
1088
|
-
secretRef: CredentialJsonRecord;
|
|
1089
|
-
tags: ReadonlyArray<string>;
|
|
1090
|
-
setupStatus: CredentialSetupStatus;
|
|
1091
|
-
createdAt: string;
|
|
1092
|
-
updatedAt: string;
|
|
1093
|
-
}>;
|
|
1094
|
-
/**
|
|
1095
|
-
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
1096
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
1097
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
1098
|
-
*/
|
|
1099
|
-
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
1100
|
-
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
1101
|
-
material: TMaterial;
|
|
1102
|
-
publicConfig: TPublicConfig;
|
|
1103
|
-
}>;
|
|
1104
|
-
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
1105
|
-
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
1106
|
-
/**
|
|
1107
|
-
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
1108
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
1109
|
-
*/
|
|
1110
|
-
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
1111
|
-
definition: CredentialTypeDefinition;
|
|
1112
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
1113
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
1114
|
-
}>;
|
|
1115
|
-
/**
|
|
1116
|
-
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
1117
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
1118
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
1119
|
-
*/
|
|
1120
|
-
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
1121
|
-
interface CredentialSessionService {
|
|
1122
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
1123
|
-
workflowId: WorkflowId;
|
|
1124
|
-
nodeId: NodeId;
|
|
1125
|
-
slotKey: string;
|
|
1126
|
-
}>): Promise<TSession>;
|
|
1127
|
-
}
|
|
1128
|
-
interface CredentialTypeRegistry {
|
|
1129
|
-
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
1130
|
-
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
1131
|
-
}
|
|
1132
|
-
declare class CredentialUnboundError extends Error {
|
|
1133
|
-
readonly bindingKey: CredentialBindingKey;
|
|
1134
|
-
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1135
|
-
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
1136
|
-
private static createMessage;
|
|
1137
|
-
}
|
|
1138
|
-
//#endregion
|
|
1139
|
-
//#region src/contracts/runFinishedAtFactory.d.ts
|
|
1140
|
-
type RunFinishedAtSource = Pick<PersistedRunState, "status" | "nodeSnapshotsByNodeId">;
|
|
1141
|
-
/** Derives workflow end time from node snapshots for run listings. */
|
|
1142
|
-
declare class RunFinishedAtFactory {
|
|
1143
|
-
static resolveIso(state: RunFinishedAtSource): string | undefined;
|
|
1144
|
-
}
|
|
1145
|
-
//#endregion
|
|
1146
|
-
//#region src/workflow/dsl/workflowBuilderTypes.d.ts
|
|
1147
|
-
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
|
|
1148
|
-
type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
|
|
1149
|
-
type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
|
|
1150
|
-
type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
|
|
1151
|
-
type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
|
|
1152
|
-
type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
|
|
1153
|
-
type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
|
|
1154
|
-
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
|
|
1155
|
-
type BooleanWhenOverloads<TCurrentJson, TReturn> = {
|
|
1156
|
-
<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
|
|
1157
|
-
<TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
|
|
1158
|
-
};
|
|
1159
|
-
//#endregion
|
|
1160
|
-
//#region src/workflow/dsl/WhenBuilder.d.ts
|
|
1161
|
-
declare class WhenBuilder<TCurrentJson> {
|
|
1162
|
-
private readonly wf;
|
|
1163
|
-
private readonly from;
|
|
1164
|
-
private readonly branchPort;
|
|
1165
|
-
constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
|
|
1166
|
-
addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
|
|
1167
|
-
readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
|
|
1168
|
-
build(): WorkflowDefinition;
|
|
1169
|
-
}
|
|
1170
|
-
//#endregion
|
|
1171
|
-
//#region src/workflow/dsl/ChainCursorResolver.d.ts
|
|
1172
|
-
type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
|
|
1173
|
-
<TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
|
|
1174
|
-
true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
|
|
1175
|
-
false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TFalseSteps> : never;
|
|
1176
|
-
}> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
|
|
1177
|
-
};
|
|
1178
|
-
declare class ChainCursor<TCurrentJson> {
|
|
1179
|
-
private readonly wf;
|
|
1180
|
-
private readonly cursor;
|
|
1181
|
-
private readonly cursorOutput;
|
|
1182
|
-
constructor(wf: WorkflowBuilder, cursor: NodeRef, cursorOutput: OutputPortKey);
|
|
1183
|
-
then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1184
|
-
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
1185
|
-
build(): WorkflowDefinition;
|
|
1186
|
-
}
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/workflow/dsl/WorkflowBuilder.d.ts
|
|
1189
|
-
declare class WorkflowBuilder {
|
|
1190
|
-
private readonly meta;
|
|
1191
|
-
private readonly options?;
|
|
1192
|
-
private readonly nodes;
|
|
1193
|
-
private readonly edges;
|
|
1194
|
-
private seq;
|
|
1195
|
-
constructor(meta: {
|
|
1196
|
-
id: WorkflowId;
|
|
1197
|
-
name: string;
|
|
1198
|
-
}, options?: Readonly<{
|
|
1199
|
-
makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
|
|
1200
|
-
}> | undefined);
|
|
1201
|
-
private add;
|
|
1202
|
-
private connect;
|
|
1203
|
-
trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
|
|
1204
|
-
start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1205
|
-
build(): WorkflowDefinition;
|
|
1206
|
-
}
|
|
1207
|
-
//#endregion
|
|
1208
|
-
//#region src/workflow/definition/ConnectionInvocationIdFactory.d.ts
|
|
1209
|
-
/**
|
|
1210
|
-
* Unique ids for persisted connection invocation history rows (LLM/tool calls under an owning node).
|
|
1211
|
-
*/
|
|
1212
|
-
declare class ConnectionInvocationIdFactory {
|
|
1213
|
-
static create(): string;
|
|
1214
|
-
/** Deterministic id for tests when a stable sequence is needed. */
|
|
1215
|
-
static createForTest(runId: string, connectionNodeId: NodeId, sequence: number): string;
|
|
1216
|
-
}
|
|
1217
|
-
//#endregion
|
|
1218
|
-
//#region src/workflow/definition/ConnectionNodeIdFactory.d.ts
|
|
1219
|
-
/**
|
|
1220
|
-
* Deterministic ids for workflow connection-owned child nodes (LLM slot, tools, etc.).
|
|
1221
|
-
* These are stable across loads.
|
|
1222
|
-
*/
|
|
1223
|
-
declare class ConnectionNodeIdFactory {
|
|
1224
|
-
static readonly connectionSegment: "__conn__";
|
|
1225
|
-
static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId;
|
|
1226
|
-
static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId;
|
|
1227
|
-
static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean;
|
|
1228
|
-
static isToolConnectionNodeId(nodeId: NodeId): boolean;
|
|
1229
|
-
/** True when `nodeId` is a connection-owned child of `parentNodeId` (LLM or tool slot). */
|
|
1230
|
-
static isConnectionOwnedDescendantOf(parentNodeId: NodeId, nodeId: NodeId): boolean;
|
|
1231
|
-
/** Normalizes a tool display name to a stable id segment. */
|
|
1232
|
-
static normalizeToolName(toolName: string): string;
|
|
1233
|
-
}
|
|
1234
|
-
//#endregion
|
|
1235
|
-
//#region src/workflow/definition/WorkflowExecutableNodeClassifier.d.ts
|
|
1236
|
-
/**
|
|
1237
|
-
* Derives which workflow nodes participate in the main execution graph vs connection-only children.
|
|
1238
|
-
*/
|
|
1239
|
-
declare class WorkflowExecutableNodeClassifier {
|
|
1240
|
-
private readonly connectionOwnedIds;
|
|
1241
|
-
constructor(workflow: WorkflowDefinition);
|
|
1242
|
-
isConnectionOwnedNodeId(nodeId: NodeId): boolean;
|
|
1243
|
-
isExecutableNodeId(nodeId: NodeId): boolean;
|
|
1244
|
-
filterExecutableNodeDefinitions(nodes: ReadonlyArray<NodeDefinition>): ReadonlyArray<NodeDefinition>;
|
|
1245
|
-
private collectConnectionOwnedIds;
|
|
1246
|
-
/**
|
|
1247
|
-
* Resolves the default start node: first trigger, else first executable node with no incoming edges from executable nodes.
|
|
1248
|
-
*/
|
|
1249
|
-
findDefaultExecutableStartNodeId(workflow: WorkflowDefinition): NodeId;
|
|
1250
|
-
firstExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId | undefined;
|
|
1251
|
-
lastExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId;
|
|
1252
|
-
}
|
|
1253
|
-
//#endregion
|
|
1254
|
-
//#region src/workflow/definition/WorkflowExecutableNodeClassifierFactory.d.ts
|
|
1255
|
-
declare function createWorkflowExecutableNodeClassifier(workflow: WorkflowDefinition): WorkflowExecutableNodeClassifier;
|
|
1256
|
-
//#endregion
|
|
1257
|
-
//#region src/workflow/graph/DefaultWorkflowGraphFactory.d.ts
|
|
1258
|
-
declare class DefaultWorkflowGraphFactory implements WorkflowGraphFactory {
|
|
1259
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
1260
|
-
}
|
|
1261
|
-
//#endregion
|
|
1262
|
-
//#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
|
|
1263
|
-
declare class WorkflowSnapshotCodec {
|
|
1264
|
-
private readonly tokenRegistry;
|
|
1265
|
-
constructor(tokenRegistry: PersistedWorkflowTokenRegistryLike);
|
|
1266
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
1267
|
-
hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
|
|
1268
|
-
private serializeConfig;
|
|
1269
|
-
private injectTokenIds;
|
|
1270
|
-
private mergeValue;
|
|
1271
|
-
private mergeNestedValue;
|
|
1272
|
-
private restoreNonSerializableProperties;
|
|
1273
|
-
private restoreTypeProperty;
|
|
1274
|
-
private resolveTokenId;
|
|
1275
|
-
private resolveTokenName;
|
|
1276
|
-
private asTypeToken;
|
|
1277
|
-
private asRecord;
|
|
1278
|
-
}
|
|
1279
|
-
//#endregion
|
|
1280
|
-
//#region src/runtime/InMemoryWorkflowCatalog.d.ts
|
|
1281
|
-
declare class InMemoryWorkflowCatalog implements WorkflowCatalog {
|
|
1282
|
-
private readonly workflowsById;
|
|
1283
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
1284
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
1285
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
1286
|
-
}
|
|
1287
|
-
//#endregion
|
|
1288
|
-
export { JsonArray as $, CurrentStateExecutionRequest as $n, ExponentialRetryPolicySpec as $r, BinaryBody as $t, CredentialJsonRecord as A, TriggerSetupContext as An, RunEvent as Ar, TriggerNodeOutputJson as At, CredentialTypeId as B, WorkflowSnapshotResolver as Bn, container as Br, WorkflowNodeConnection as Bt, CredentialBindingKey as C, NodeExecutor as Cn, RunResult as Cr, RunDataSnapshot as Ct, CredentialHealthTester as D, TriggerCleanupHandle as Dn, RunStopCondition as Dr, RunnableNodeInputJson as Dt, CredentialHealthStatus as E, TestableTriggerNode as En, RunStatus as Er, RunnableNodeConfig as Et, CredentialSessionFactoryArgs as F, WorkflowNodeInstanceFactory as Fn, Disposable as Fr, WorkflowErrorHandler as Ft, BinaryAttachment as G, WebhookTriggerMatcher as Gn, instanceCachingFactory as Gr, WorkflowStoragePolicyResolver as Gt, CredentialUnboundError as H, TriggerInstanceId as Hn, inject as Hr, WorkflowPrunePolicySpec as Ht, CredentialSessionService as I, WorkflowRepository as In, InjectionToken as Ir, WorkflowErrorHandlerSpec as It, ExecutionMode as J, AllWorkflowsActiveWorkflowActivationPolicy as Jn, registry as Jr, runnableNodeInputType as Jt, BinaryPreviewKind as K, WebhookTriggerResolution as Kn, instancePerContainerCachingFactory as Kr, WorkflowStoragePolicySpec as Kt, CredentialSetupStatus as L, WorkflowRunnerResolver as Ln, Lifecycle as Lr, WorkflowGraph as Lt, CredentialOAuth2AuthDefinition as M, TriggerSetupStateStore as Mn, RunEventSubscription as Mr, UpstreamRefPlaceholder as Mt, CredentialRequirement as N, TriggerTestItemsContext as Nn, Container as Nr, WorkflowDefinition as Nt, CredentialInstanceId as O, TriggerNode as On, RunSummary as Or, RunnableNodeOutputJson as Ot, CredentialSessionFactory as P, WorkflowCatalog as Pn, DependencyContainer as Pr, WorkflowErrorContext as Pt, Items as Q, ConnectionInvocationRecord as Qn, NoRetryPolicy as Qr, BinaryAttachmentCreateRequest as Qt, CredentialType as R, WorkflowRunnerService as Rn, RegistrationOptions as Rr, WorkflowGraphFactory as Rt, CredentialBinding as S, NodeExecutionStatePublisher as Sn, RunQueueEntry as Sr, RunDataFactory as St, CredentialHealth as T, PersistedTriggerSetupState as Tn, RunStateStore as Tr, RunIdFactory as Tt, OAuth2ProviderFromPublicConfig as U, WebhookControlSignal as Un, injectAll as Ur, WorkflowStoragePolicyDecisionArgs as Ut, CredentialTypeRegistry as V, HttpMethod as Vn, delay as Vr, WorkflowPolicyRuntimeDefaults as Vt, ActivationIdFactory as W, WebhookInvocationMatch as Wn, injectable as Wr, WorkflowStoragePolicyMode as Wt, Item as X, ConnectionInvocationAppendArgs as Xn, ExpRetryPolicy as Xr, triggerNodeOutputType as Xt, InputPortKey as Y, WorkflowActivationPolicy as Yn, singleton as Yr, runnableNodeOutputType as Yt, ItemBinary as Z, ConnectionInvocationId as Zn, RetryPolicy as Zr, triggerNodeSetupStateType as Zt, StepSequenceOutput as _, NodeActivationScheduler as _n, RunEventPublisherDeps as _r, OutputPortKey as _t, WorkflowExecutableNodeClassifier as a, EngineDeps as an, NodeInputsByPort as ar, NodeConfigBase as at, AnyCredentialType as b, NodeExecutionRequest as bn, RunPruneCandidate as br, PersistedRunPolicySnapshot as bt, WorkflowBuilder as c, ExecutionBinaryService as cn, PersistedMutableRunState as cr, NodeErrorHandler as ct, AnyRunnableNodeConfig as d, MultiInputNode as dn, PersistedWorkflowSnapshot as dr, NodeId as dt, FixedRetryPolicySpec as ei, BinaryStorage as en, EngineRunCounters as er, JsonObject as et, AnyTriggerNodeConfig as f, Node as fn, PersistedWorkflowSnapshotNode as fr, NodeKind as ft, BranchStepsArg as g, NodeActivationRequestBase as gn, RunCurrentState as gr, NodeSchedulerDecision as gt, BranchOutputGuard as h, NodeActivationRequest as hn, RunCompletionNotifier as hr, NodeRef as ht, createWorkflowExecutableNodeClassifier as i, BinaryStorageWriteResult as in, NodeExecutionStatus as ir, NodeActivationId as it, CredentialMaterialSourceKind as j, TriggerSetupStateFor as jn, RunEventBus as jr, TriggerNodeSetupState as jt, CredentialInstanceRecord as k, TriggerRuntimeDiagnostics as kn, WebhookRunResult as kr, TriggerNodeConfig as kt, ChainCursor as l, ExecutionContext as ln, PersistedRunControlState as lr, NodeErrorHandlerArgs as lt, BranchMoreArgs as m, NodeActivationReceipt as mn, PinnedNodeOutputsByPort as mr, NodeOutputs as mt, WorkflowSnapshotCodec as n, RetryPolicySpec as ni, BinaryStorageStatResult as nn, NodeExecutionError as nr, JsonValue as nt, ConnectionNodeIdFactory as o, EngineHost as on, PendingNodeExecution as or, NodeConnectionName as ot, BooleanWhenOverloads as p, NodeActivationContinuation as pn, PersistedWorkflowTokenRegistryLike as pr, NodeOffloadPolicy as pt, Edge as q, WebhookTriggerRoutingDiagnostics as qn, predicateAwareClassFactory as qr, branchRef as qt, DefaultWorkflowGraphFactory as r, BinaryStorageWriteRequest as rn, NodeExecutionSnapshot as rr, MutableRunData as rt, ConnectionInvocationIdFactory as s, ExecutableTriggerNode as sn, PersistedMutableNodeState as sr, NodeDefinition as st, InMemoryWorkflowCatalog as t, NoneRetryPolicySpec as ti, BinaryStorageReadResult as tn, ExecutionFrontierPlan as tr, JsonPrimitive as tt, WhenBuilder as u, ExecutionContextFactory as un, PersistedRunState as ur, NodeErrorHandlerSpec as ut, ValidStepSequence as v, NodeBinaryAttachmentService as vn, RunExecutionOptions as vr, PairedItemRef as vt, CredentialFieldSchema as w, NodeResolver as wn, RunStateResetRequest as wr, RunId as wt, CredentialAuthDefinition as x, NodeExecutionScheduler as xn, RunPruneListingStore as xr, PersistedTokenId as xt, RunFinishedAtFactory as y, NodeExecutionContext as yn, RunListingStore as yr, ParentExecutionRef as yt, CredentialTypeDefinition as z, WorkflowSnapshotFactory as zn, TypeToken as zr, WorkflowId as zt };
|
|
1289
|
-
//# sourceMappingURL=InMemoryWorkflowCatalog-CZ0kZpOv.d.ts.map
|