@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,1052 +0,0 @@
|
|
|
1
|
-
import { DependencyContainer, DependencyContainer as Container, Disposable, InjectionToken, InjectionToken as TypeToken, Lifecycle, RegistrationOptions, container, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe";
|
|
2
|
-
import { ReadableStream } from "node:stream/web";
|
|
3
|
-
|
|
4
|
-
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
8
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
9
|
-
*
|
|
10
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
11
|
-
*/
|
|
12
|
-
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
13
|
-
interface NoneRetryPolicySpec {
|
|
14
|
-
readonly kind: "none";
|
|
15
|
-
}
|
|
16
|
-
interface FixedRetryPolicySpec {
|
|
17
|
-
readonly kind: "fixed";
|
|
18
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
19
|
-
readonly maxAttempts: number;
|
|
20
|
-
readonly delayMs: number;
|
|
21
|
-
}
|
|
22
|
-
interface ExponentialRetryPolicySpec {
|
|
23
|
-
readonly kind: "exponential";
|
|
24
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
25
|
-
readonly maxAttempts: number;
|
|
26
|
-
readonly initialDelayMs: number;
|
|
27
|
-
readonly multiplier: number;
|
|
28
|
-
readonly maxDelayMs?: number;
|
|
29
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
30
|
-
readonly jitter?: boolean;
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/contracts/runTypes.d.ts
|
|
34
|
-
interface RunExecutionOptions {
|
|
35
|
-
localOnly?: boolean;
|
|
36
|
-
webhook?: boolean;
|
|
37
|
-
mode?: "manual" | "debug";
|
|
38
|
-
sourceWorkflowId?: WorkflowId;
|
|
39
|
-
sourceRunId?: RunId;
|
|
40
|
-
derivedFromRunId?: RunId;
|
|
41
|
-
isMutable?: boolean;
|
|
42
|
-
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
43
|
-
subworkflowDepth?: number;
|
|
44
|
-
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
45
|
-
maxNodeActivations?: number;
|
|
46
|
-
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
47
|
-
maxSubworkflowDepth?: number;
|
|
48
|
-
}
|
|
49
|
-
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
50
|
-
interface EngineRunCounters {
|
|
51
|
-
completedNodeActivations: number;
|
|
52
|
-
}
|
|
53
|
-
type RunStopCondition = Readonly<{
|
|
54
|
-
kind: "workflowCompleted";
|
|
55
|
-
}> | Readonly<{
|
|
56
|
-
kind: "nodeCompleted";
|
|
57
|
-
nodeId: NodeId;
|
|
58
|
-
}>;
|
|
59
|
-
interface RunStateResetRequest {
|
|
60
|
-
clearFromNodeId: NodeId;
|
|
61
|
-
}
|
|
62
|
-
interface PersistedRunControlState {
|
|
63
|
-
stopCondition?: RunStopCondition;
|
|
64
|
-
}
|
|
65
|
-
interface PersistedWorkflowSnapshotNode {
|
|
66
|
-
id: NodeId;
|
|
67
|
-
kind: NodeKind;
|
|
68
|
-
name?: string;
|
|
69
|
-
nodeTokenId: PersistedTokenId;
|
|
70
|
-
configTokenId: PersistedTokenId;
|
|
71
|
-
tokenName?: string;
|
|
72
|
-
configTokenName?: string;
|
|
73
|
-
config: unknown;
|
|
74
|
-
}
|
|
75
|
-
interface PersistedWorkflowSnapshot {
|
|
76
|
-
id: WorkflowId;
|
|
77
|
-
name: string;
|
|
78
|
-
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
79
|
-
edges: ReadonlyArray<Edge>;
|
|
80
|
-
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
81
|
-
workflowErrorHandlerConfigured?: boolean;
|
|
82
|
-
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
83
|
-
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
84
|
-
}
|
|
85
|
-
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
86
|
-
interface PersistedMutableNodeState {
|
|
87
|
-
pinnedOutputsByPort?: PinnedNodeOutputsByPort;
|
|
88
|
-
lastDebugInput?: Items;
|
|
89
|
-
}
|
|
90
|
-
interface PersistedMutableRunState {
|
|
91
|
-
nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
|
|
92
|
-
}
|
|
93
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
94
|
-
interface RunQueueEntry {
|
|
95
|
-
nodeId: NodeId;
|
|
96
|
-
input: Items;
|
|
97
|
-
toInput?: InputPortKey;
|
|
98
|
-
batchId?: string;
|
|
99
|
-
from?: Readonly<{
|
|
100
|
-
nodeId: NodeId;
|
|
101
|
-
output: OutputPortKey;
|
|
102
|
-
}>;
|
|
103
|
-
collect?: Readonly<{
|
|
104
|
-
expectedInputs: ReadonlyArray<InputPortKey>;
|
|
105
|
-
received: Readonly<Record<InputPortKey, Items>>;
|
|
106
|
-
}>;
|
|
107
|
-
}
|
|
108
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
109
|
-
interface NodeExecutionError {
|
|
110
|
-
message: string;
|
|
111
|
-
name?: string;
|
|
112
|
-
stack?: string;
|
|
113
|
-
}
|
|
114
|
-
interface NodeExecutionSnapshot {
|
|
115
|
-
runId: RunId;
|
|
116
|
-
workflowId: WorkflowId;
|
|
117
|
-
nodeId: NodeId;
|
|
118
|
-
activationId?: NodeActivationId;
|
|
119
|
-
parent?: ParentExecutionRef;
|
|
120
|
-
status: NodeExecutionStatus;
|
|
121
|
-
usedPinnedOutput?: boolean;
|
|
122
|
-
queuedAt?: string;
|
|
123
|
-
startedAt?: string;
|
|
124
|
-
finishedAt?: string;
|
|
125
|
-
updatedAt: string;
|
|
126
|
-
inputsByPort?: NodeInputsByPort;
|
|
127
|
-
outputs?: NodeOutputs;
|
|
128
|
-
error?: NodeExecutionError;
|
|
129
|
-
}
|
|
130
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
131
|
-
type ConnectionInvocationId = string;
|
|
132
|
-
/**
|
|
133
|
-
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
134
|
-
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
135
|
-
*/
|
|
136
|
-
interface ConnectionInvocationRecord {
|
|
137
|
-
readonly invocationId: ConnectionInvocationId;
|
|
138
|
-
readonly runId: RunId;
|
|
139
|
-
readonly workflowId: WorkflowId;
|
|
140
|
-
readonly connectionNodeId: NodeId;
|
|
141
|
-
readonly parentAgentNodeId: NodeId;
|
|
142
|
-
readonly parentAgentActivationId: NodeActivationId;
|
|
143
|
-
readonly status: NodeExecutionStatus;
|
|
144
|
-
readonly managedInput?: JsonValue;
|
|
145
|
-
readonly managedOutput?: JsonValue;
|
|
146
|
-
readonly error?: NodeExecutionError;
|
|
147
|
-
readonly queuedAt?: string;
|
|
148
|
-
readonly startedAt?: string;
|
|
149
|
-
readonly finishedAt?: string;
|
|
150
|
-
readonly updatedAt: string;
|
|
151
|
-
}
|
|
152
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
153
|
-
type ConnectionInvocationAppendArgs = Readonly<{
|
|
154
|
-
invocationId: ConnectionInvocationId;
|
|
155
|
-
connectionNodeId: NodeId;
|
|
156
|
-
parentAgentNodeId: NodeId;
|
|
157
|
-
parentAgentActivationId: NodeActivationId;
|
|
158
|
-
status: NodeExecutionStatus;
|
|
159
|
-
managedInput?: JsonValue;
|
|
160
|
-
managedOutput?: JsonValue;
|
|
161
|
-
error?: NodeExecutionError;
|
|
162
|
-
queuedAt?: string;
|
|
163
|
-
startedAt?: string;
|
|
164
|
-
finishedAt?: string;
|
|
165
|
-
}>;
|
|
166
|
-
interface RunCurrentState {
|
|
167
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
168
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
169
|
-
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
170
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
171
|
-
mutableState?: PersistedMutableRunState;
|
|
172
|
-
}
|
|
173
|
-
interface CurrentStateExecutionRequest {
|
|
174
|
-
workflow: WorkflowDefinition;
|
|
175
|
-
items?: Items;
|
|
176
|
-
parent?: ParentExecutionRef;
|
|
177
|
-
executionOptions?: RunExecutionOptions;
|
|
178
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
179
|
-
mutableState?: PersistedMutableRunState;
|
|
180
|
-
currentState?: RunCurrentState;
|
|
181
|
-
stopCondition?: RunStopCondition;
|
|
182
|
-
reset?: RunStateResetRequest;
|
|
183
|
-
}
|
|
184
|
-
interface ExecutionFrontierPlan {
|
|
185
|
-
rootNodeId?: NodeId;
|
|
186
|
-
rootNodeInput?: Items;
|
|
187
|
-
queue: RunQueueEntry[];
|
|
188
|
-
currentState: RunCurrentState;
|
|
189
|
-
stopCondition: RunStopCondition;
|
|
190
|
-
satisfiedNodeIds: ReadonlyArray<NodeId>;
|
|
191
|
-
skippedNodeIds: ReadonlyArray<NodeId>;
|
|
192
|
-
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
193
|
-
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
194
|
-
}
|
|
195
|
-
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
196
|
-
interface RunSummary {
|
|
197
|
-
runId: RunId;
|
|
198
|
-
workflowId: WorkflowId;
|
|
199
|
-
startedAt: string;
|
|
200
|
-
status: RunStatus;
|
|
201
|
-
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
202
|
-
finishedAt?: string;
|
|
203
|
-
parent?: ParentExecutionRef;
|
|
204
|
-
executionOptions?: RunExecutionOptions;
|
|
205
|
-
}
|
|
206
|
-
interface PendingNodeExecution {
|
|
207
|
-
runId: RunId;
|
|
208
|
-
activationId: NodeActivationId;
|
|
209
|
-
workflowId: WorkflowId;
|
|
210
|
-
nodeId: NodeId;
|
|
211
|
-
itemsIn: number;
|
|
212
|
-
inputsByPort: NodeInputsByPort;
|
|
213
|
-
receiptId: string;
|
|
214
|
-
queue?: string;
|
|
215
|
-
batchId?: string;
|
|
216
|
-
enqueuedAt: string;
|
|
217
|
-
}
|
|
218
|
-
interface PersistedRunState {
|
|
219
|
-
runId: RunId;
|
|
220
|
-
workflowId: WorkflowId;
|
|
221
|
-
startedAt: string;
|
|
222
|
-
parent?: ParentExecutionRef;
|
|
223
|
-
executionOptions?: RunExecutionOptions;
|
|
224
|
-
control?: PersistedRunControlState;
|
|
225
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
226
|
-
mutableState?: PersistedMutableRunState;
|
|
227
|
-
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
228
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
229
|
-
/** Successful node completions so far (for activation budget). */
|
|
230
|
-
engineCounters?: EngineRunCounters;
|
|
231
|
-
status: RunStatus;
|
|
232
|
-
pending?: PendingNodeExecution;
|
|
233
|
-
queue: RunQueueEntry[];
|
|
234
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
235
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
236
|
-
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
237
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
238
|
-
}
|
|
239
|
-
interface RunStateStore {
|
|
240
|
-
createRun(args: {
|
|
241
|
-
runId: RunId;
|
|
242
|
-
workflowId: WorkflowId;
|
|
243
|
-
startedAt: string;
|
|
244
|
-
parent?: ParentExecutionRef;
|
|
245
|
-
executionOptions?: RunExecutionOptions;
|
|
246
|
-
control?: PersistedRunControlState;
|
|
247
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
248
|
-
mutableState?: PersistedMutableRunState;
|
|
249
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
250
|
-
engineCounters?: EngineRunCounters;
|
|
251
|
-
}): Promise<void>;
|
|
252
|
-
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
253
|
-
save(state: PersistedRunState): Promise<void>;
|
|
254
|
-
deleteRun?(runId: RunId): Promise<void>;
|
|
255
|
-
}
|
|
256
|
-
interface RunListingStore {
|
|
257
|
-
listRuns(args?: Readonly<{
|
|
258
|
-
workflowId?: WorkflowId;
|
|
259
|
-
limit?: number;
|
|
260
|
-
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
261
|
-
}
|
|
262
|
-
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
263
|
-
interface RunPruneCandidate {
|
|
264
|
-
readonly runId: RunId;
|
|
265
|
-
readonly workflowId: WorkflowId;
|
|
266
|
-
readonly startedAt: string;
|
|
267
|
-
readonly finishedAt: string;
|
|
268
|
-
}
|
|
269
|
-
interface RunPruneListingStore {
|
|
270
|
-
listRunsOlderThan(args: Readonly<{
|
|
271
|
-
beforeIso: string;
|
|
272
|
-
limit?: number;
|
|
273
|
-
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
274
|
-
}
|
|
275
|
-
type RunResult = {
|
|
276
|
-
runId: RunId;
|
|
277
|
-
workflowId: WorkflowId;
|
|
278
|
-
startedAt: string;
|
|
279
|
-
status: "completed";
|
|
280
|
-
outputs: Items;
|
|
281
|
-
} | {
|
|
282
|
-
runId: RunId;
|
|
283
|
-
workflowId: WorkflowId;
|
|
284
|
-
startedAt: string;
|
|
285
|
-
status: "pending";
|
|
286
|
-
pending: PendingNodeExecution;
|
|
287
|
-
} | {
|
|
288
|
-
runId: RunId;
|
|
289
|
-
workflowId: WorkflowId;
|
|
290
|
-
startedAt: string;
|
|
291
|
-
status: "failed";
|
|
292
|
-
error: {
|
|
293
|
-
message: string;
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
type WebhookRunResult = Readonly<{
|
|
297
|
-
runId: RunId;
|
|
298
|
-
workflowId: WorkflowId;
|
|
299
|
-
startedAt: string;
|
|
300
|
-
runStatus: "pending" | "completed";
|
|
301
|
-
response: Items;
|
|
302
|
-
}>;
|
|
303
|
-
interface PersistedWorkflowTokenRegistryLike {
|
|
304
|
-
register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
|
|
305
|
-
getTokenId(type: TypeToken<unknown>): string | undefined;
|
|
306
|
-
resolve(tokenId: string): TypeToken<unknown> | undefined;
|
|
307
|
-
registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
308
|
-
}
|
|
309
|
-
interface RunCompletionNotifier {
|
|
310
|
-
resolveRunCompletion(result: RunResult): void;
|
|
311
|
-
resolveWebhookResponse(result: WebhookRunResult): void;
|
|
312
|
-
}
|
|
313
|
-
interface RunEventPublisherDeps {
|
|
314
|
-
eventBus?: RunEventBus;
|
|
315
|
-
}
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region src/contracts/webhookTypes.d.ts
|
|
318
|
-
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
319
|
-
interface WebhookControlSignal {
|
|
320
|
-
readonly __webhookControl: true;
|
|
321
|
-
readonly kind: "respondNow" | "respondNowAndContinue";
|
|
322
|
-
readonly responseItems: Items;
|
|
323
|
-
readonly continueItems?: Items;
|
|
324
|
-
}
|
|
325
|
-
interface WebhookTriggerRoutingDiagnostics {
|
|
326
|
-
warn(message: string): void;
|
|
327
|
-
}
|
|
328
|
-
interface TriggerInstanceId {
|
|
329
|
-
workflowId: WorkflowId;
|
|
330
|
-
nodeId: NodeId;
|
|
331
|
-
}
|
|
332
|
-
/** Match for an incoming HTTP request: user-defined URL segment + workflow trigger node. */
|
|
333
|
-
interface WebhookInvocationMatch {
|
|
334
|
-
/** Same value as the webhook trigger's configured endpoint key (URL segment under the webhook base path). */
|
|
335
|
-
endpointPath: string;
|
|
336
|
-
workflowId: WorkflowId;
|
|
337
|
-
nodeId: NodeId;
|
|
338
|
-
methods: ReadonlyArray<HttpMethod>;
|
|
339
|
-
parseJsonBody?: (body: unknown) => unknown;
|
|
340
|
-
}
|
|
341
|
-
/** Result of resolving an HTTP method + endpoint path against the catalog webhook index (404 vs 405 vs match). */
|
|
342
|
-
type WebhookTriggerResolution = {
|
|
343
|
-
status: "notFound";
|
|
344
|
-
} | {
|
|
345
|
-
status: "methodNotAllowed";
|
|
346
|
-
match: WebhookInvocationMatch;
|
|
347
|
-
} | {
|
|
348
|
-
status: "ok";
|
|
349
|
-
match: WebhookInvocationMatch;
|
|
350
|
-
};
|
|
351
|
-
/**
|
|
352
|
-
* Resolves webhook routes from workflow definitions (catalog-backed index, no registration at trigger setup).
|
|
353
|
-
*/
|
|
354
|
-
interface WebhookTriggerMatcher {
|
|
355
|
-
match(args: {
|
|
356
|
-
endpointPath: string;
|
|
357
|
-
method: HttpMethod;
|
|
358
|
-
}): WebhookInvocationMatch | undefined;
|
|
359
|
-
lookup(endpointPath: string): WebhookInvocationMatch | undefined;
|
|
360
|
-
onEngineWorkflowsLoaded?(): void;
|
|
361
|
-
onEngineStopped?(): void;
|
|
362
|
-
/** Rebuild route index after activation changes without stopping the engine. */
|
|
363
|
-
reloadWebhookRoutes?(): void;
|
|
364
|
-
}
|
|
365
|
-
//#endregion
|
|
366
|
-
//#region src/contracts/workflowActivationPolicy.d.ts
|
|
367
|
-
/**
|
|
368
|
-
* Host-controlled policy: when false, trigger {@link TriggerNode} setup is skipped and webhook routes
|
|
369
|
-
* for that workflow are not registered (see engine trigger runtime + webhook matcher).
|
|
370
|
-
*/
|
|
371
|
-
interface WorkflowActivationPolicy {
|
|
372
|
-
isActive(workflowId: WorkflowId): boolean;
|
|
373
|
-
}
|
|
374
|
-
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
375
|
-
declare class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy {
|
|
376
|
-
isActive(_workflowId: WorkflowId): boolean;
|
|
377
|
-
}
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region src/events/runEvents.d.ts
|
|
380
|
-
type RunEvent = Readonly<{
|
|
381
|
-
kind: "runCreated";
|
|
382
|
-
runId: RunId;
|
|
383
|
-
workflowId: WorkflowId;
|
|
384
|
-
parent?: ParentExecutionRef;
|
|
385
|
-
at: string;
|
|
386
|
-
}> | Readonly<{
|
|
387
|
-
kind: "runSaved";
|
|
388
|
-
runId: RunId;
|
|
389
|
-
workflowId: WorkflowId;
|
|
390
|
-
parent?: ParentExecutionRef;
|
|
391
|
-
at: string;
|
|
392
|
-
state: PersistedRunState;
|
|
393
|
-
}> | Readonly<{
|
|
394
|
-
kind: "nodeQueued";
|
|
395
|
-
runId: RunId;
|
|
396
|
-
workflowId: WorkflowId;
|
|
397
|
-
parent?: ParentExecutionRef;
|
|
398
|
-
at: string;
|
|
399
|
-
snapshot: NodeExecutionSnapshot;
|
|
400
|
-
}> | Readonly<{
|
|
401
|
-
kind: "nodeStarted";
|
|
402
|
-
runId: RunId;
|
|
403
|
-
workflowId: WorkflowId;
|
|
404
|
-
parent?: ParentExecutionRef;
|
|
405
|
-
at: string;
|
|
406
|
-
snapshot: NodeExecutionSnapshot;
|
|
407
|
-
}> | Readonly<{
|
|
408
|
-
kind: "nodeCompleted";
|
|
409
|
-
runId: RunId;
|
|
410
|
-
workflowId: WorkflowId;
|
|
411
|
-
parent?: ParentExecutionRef;
|
|
412
|
-
at: string;
|
|
413
|
-
snapshot: NodeExecutionSnapshot;
|
|
414
|
-
}> | Readonly<{
|
|
415
|
-
kind: "nodeFailed";
|
|
416
|
-
runId: RunId;
|
|
417
|
-
workflowId: WorkflowId;
|
|
418
|
-
parent?: ParentExecutionRef;
|
|
419
|
-
at: string;
|
|
420
|
-
snapshot: NodeExecutionSnapshot;
|
|
421
|
-
}>;
|
|
422
|
-
interface RunEventSubscription {
|
|
423
|
-
close(): Promise<void>;
|
|
424
|
-
}
|
|
425
|
-
interface RunEventBus {
|
|
426
|
-
publish(event: RunEvent): Promise<void>;
|
|
427
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
428
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
429
|
-
}
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region src/contracts/runtimeTypes.d.ts
|
|
432
|
-
interface WorkflowRunnerService {
|
|
433
|
-
runById(args: {
|
|
434
|
-
workflowId: WorkflowId;
|
|
435
|
-
startAt?: NodeId;
|
|
436
|
-
items: Items;
|
|
437
|
-
parent?: ParentExecutionRef;
|
|
438
|
-
}): Promise<RunResult>;
|
|
439
|
-
}
|
|
440
|
-
interface WorkflowRunnerResolver {
|
|
441
|
-
resolve(): WorkflowRunnerService | undefined;
|
|
442
|
-
}
|
|
443
|
-
interface WorkflowRepository {
|
|
444
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
445
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
446
|
-
}
|
|
447
|
-
interface WorkflowCatalog extends WorkflowRepository {
|
|
448
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
449
|
-
}
|
|
450
|
-
type WorkflowRegistry = WorkflowCatalog;
|
|
451
|
-
interface NodeResolver {
|
|
452
|
-
resolve<T>(token: TypeToken<T>): T;
|
|
453
|
-
getContainer(): Container | undefined;
|
|
454
|
-
}
|
|
455
|
-
interface NodeExecutionStatePublisher {
|
|
456
|
-
markQueued(args: {
|
|
457
|
-
nodeId: NodeId;
|
|
458
|
-
activationId?: NodeActivationId;
|
|
459
|
-
inputsByPort?: NodeInputsByPort;
|
|
460
|
-
}): Promise<void>;
|
|
461
|
-
markRunning(args: {
|
|
462
|
-
nodeId: NodeId;
|
|
463
|
-
activationId?: NodeActivationId;
|
|
464
|
-
inputsByPort?: NodeInputsByPort;
|
|
465
|
-
}): Promise<void>;
|
|
466
|
-
markCompleted(args: {
|
|
467
|
-
nodeId: NodeId;
|
|
468
|
-
activationId?: NodeActivationId;
|
|
469
|
-
inputsByPort?: NodeInputsByPort;
|
|
470
|
-
outputs?: NodeOutputs;
|
|
471
|
-
}): Promise<void>;
|
|
472
|
-
markFailed(args: {
|
|
473
|
-
nodeId: NodeId;
|
|
474
|
-
activationId?: NodeActivationId;
|
|
475
|
-
inputsByPort?: NodeInputsByPort;
|
|
476
|
-
error: Error;
|
|
477
|
-
}): Promise<void>;
|
|
478
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
479
|
-
}
|
|
480
|
-
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
481
|
-
interface BinaryStorageWriteRequest {
|
|
482
|
-
storageKey: string;
|
|
483
|
-
body: BinaryBody;
|
|
484
|
-
}
|
|
485
|
-
interface BinaryStorageWriteResult {
|
|
486
|
-
storageKey: string;
|
|
487
|
-
size: number;
|
|
488
|
-
sha256?: string;
|
|
489
|
-
}
|
|
490
|
-
interface BinaryStorageReadResult {
|
|
491
|
-
body: ReadableStream<Uint8Array>;
|
|
492
|
-
size?: number;
|
|
493
|
-
}
|
|
494
|
-
interface BinaryStorageStatResult {
|
|
495
|
-
exists: boolean;
|
|
496
|
-
size?: number;
|
|
497
|
-
}
|
|
498
|
-
interface BinaryStorage {
|
|
499
|
-
readonly driverName: string;
|
|
500
|
-
write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;
|
|
501
|
-
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
502
|
-
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
503
|
-
delete(storageKey: string): Promise<void>;
|
|
504
|
-
}
|
|
505
|
-
interface BinaryAttachmentCreateRequest {
|
|
506
|
-
name: string;
|
|
507
|
-
body: BinaryBody;
|
|
508
|
-
mimeType: string;
|
|
509
|
-
filename?: string;
|
|
510
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
511
|
-
}
|
|
512
|
-
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
513
|
-
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
514
|
-
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
515
|
-
}
|
|
516
|
-
interface ExecutionBinaryService {
|
|
517
|
-
forNode(args: {
|
|
518
|
-
nodeId: NodeId;
|
|
519
|
-
activationId: NodeActivationId;
|
|
520
|
-
}): NodeBinaryAttachmentService;
|
|
521
|
-
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
522
|
-
}
|
|
523
|
-
interface ExecutionContext {
|
|
524
|
-
runId: RunId;
|
|
525
|
-
workflowId: WorkflowId;
|
|
526
|
-
parent?: ParentExecutionRef;
|
|
527
|
-
/** This run's subworkflow depth (0 = root). */
|
|
528
|
-
subworkflowDepth: number;
|
|
529
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
530
|
-
engineMaxNodeActivations: number;
|
|
531
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
532
|
-
engineMaxSubworkflowDepth: number;
|
|
533
|
-
now: () => Date;
|
|
534
|
-
data: RunDataSnapshot;
|
|
535
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
536
|
-
binary: ExecutionBinaryService;
|
|
537
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
538
|
-
}
|
|
539
|
-
interface ExecutionContextFactory {
|
|
540
|
-
create(args: {
|
|
541
|
-
runId: RunId;
|
|
542
|
-
workflowId: WorkflowId;
|
|
543
|
-
parent?: ParentExecutionRef;
|
|
544
|
-
subworkflowDepth: number;
|
|
545
|
-
engineMaxNodeActivations: number;
|
|
546
|
-
engineMaxSubworkflowDepth: number;
|
|
547
|
-
data: RunDataSnapshot;
|
|
548
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
549
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
550
|
-
}): ExecutionContext;
|
|
551
|
-
}
|
|
552
|
-
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
553
|
-
nodeId: NodeId;
|
|
554
|
-
activationId: NodeActivationId;
|
|
555
|
-
config: TConfig;
|
|
556
|
-
binary: NodeBinaryAttachmentService;
|
|
557
|
-
}
|
|
558
|
-
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
559
|
-
trigger: TriggerInstanceId;
|
|
560
|
-
config: TConfig;
|
|
561
|
-
previousState: TSetupState$1;
|
|
562
|
-
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
563
|
-
emit(items: Items): Promise<void>;
|
|
564
|
-
}
|
|
565
|
-
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
566
|
-
trigger: TriggerInstanceId;
|
|
567
|
-
nodeId: NodeId;
|
|
568
|
-
config: TConfig;
|
|
569
|
-
previousState: TSetupState$1;
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
573
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
574
|
-
* package-level setup code.
|
|
575
|
-
*/
|
|
576
|
-
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
577
|
-
trigger: TriggerInstanceId;
|
|
578
|
-
updatedAt: string;
|
|
579
|
-
state: TState;
|
|
580
|
-
}
|
|
581
|
-
interface TriggerSetupStateStore {
|
|
582
|
-
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
583
|
-
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
584
|
-
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
585
|
-
}
|
|
586
|
-
interface TriggerCleanupHandle {
|
|
587
|
-
stop(): Promise<void> | void;
|
|
588
|
-
}
|
|
589
|
-
interface EngineHost {
|
|
590
|
-
credentialSessions: CredentialSessionService;
|
|
591
|
-
workflows?: WorkflowRunnerService;
|
|
592
|
-
}
|
|
593
|
-
interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
594
|
-
kind: "node";
|
|
595
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
596
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
597
|
-
}
|
|
598
|
-
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
599
|
-
kind: "node";
|
|
600
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
601
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
602
|
-
}
|
|
603
|
-
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
604
|
-
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
605
|
-
kind: "trigger";
|
|
606
|
-
outputPorts: readonly ["main"];
|
|
607
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
608
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
609
|
-
}
|
|
610
|
-
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
611
|
-
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
612
|
-
}
|
|
613
|
-
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
614
|
-
interface NodeExecutionRequest {
|
|
615
|
-
runId: RunId;
|
|
616
|
-
activationId: NodeActivationId;
|
|
617
|
-
workflowId: WorkflowId;
|
|
618
|
-
nodeId: NodeId;
|
|
619
|
-
input: Items;
|
|
620
|
-
parent?: ParentExecutionRef;
|
|
621
|
-
queue?: string;
|
|
622
|
-
executionOptions?: RunExecutionOptions;
|
|
623
|
-
}
|
|
624
|
-
interface NodeExecutionScheduler {
|
|
625
|
-
enqueue(request: NodeExecutionRequest): Promise<{
|
|
626
|
-
receiptId: string;
|
|
627
|
-
}>;
|
|
628
|
-
cancel?(receiptId: string): Promise<void>;
|
|
629
|
-
}
|
|
630
|
-
type NodeActivationRequestBase = Readonly<{
|
|
631
|
-
runId: RunId;
|
|
632
|
-
activationId: NodeActivationId;
|
|
633
|
-
workflowId: WorkflowId;
|
|
634
|
-
nodeId: NodeId;
|
|
635
|
-
parent?: ParentExecutionRef;
|
|
636
|
-
executionOptions?: RunExecutionOptions;
|
|
637
|
-
batchId?: string;
|
|
638
|
-
ctx: NodeExecutionContext;
|
|
639
|
-
}>;
|
|
640
|
-
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
641
|
-
kind: "single";
|
|
642
|
-
input: Items;
|
|
643
|
-
}>) | (NodeActivationRequestBase & Readonly<{
|
|
644
|
-
kind: "multi";
|
|
645
|
-
inputsByPort: NodeInputsByPort;
|
|
646
|
-
}>);
|
|
647
|
-
interface NodeActivationReceipt {
|
|
648
|
-
receiptId: string;
|
|
649
|
-
mode?: "local" | "worker";
|
|
650
|
-
queue?: string;
|
|
651
|
-
}
|
|
652
|
-
interface NodeActivationContinuation {
|
|
653
|
-
markNodeRunning(args: {
|
|
654
|
-
runId: RunId;
|
|
655
|
-
activationId: NodeActivationId;
|
|
656
|
-
nodeId: NodeId;
|
|
657
|
-
inputsByPort: NodeInputsByPort;
|
|
658
|
-
}): Promise<void>;
|
|
659
|
-
resumeFromNodeResult(args: {
|
|
660
|
-
runId: RunId;
|
|
661
|
-
activationId: NodeActivationId;
|
|
662
|
-
nodeId: NodeId;
|
|
663
|
-
outputs: NodeOutputs;
|
|
664
|
-
}): Promise<RunResult>;
|
|
665
|
-
resumeFromNodeError(args: {
|
|
666
|
-
runId: RunId;
|
|
667
|
-
activationId: NodeActivationId;
|
|
668
|
-
nodeId: NodeId;
|
|
669
|
-
error: Error;
|
|
670
|
-
}): Promise<RunResult>;
|
|
671
|
-
}
|
|
672
|
-
interface NodeActivationScheduler {
|
|
673
|
-
setContinuation?(continuation: NodeActivationContinuation): void;
|
|
674
|
-
enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
|
|
675
|
-
notifyPendingStatePersisted?(runId: RunId): void;
|
|
676
|
-
cancel?(receiptId: string): Promise<void>;
|
|
677
|
-
}
|
|
678
|
-
interface WorkflowNodeInstanceFactory {
|
|
679
|
-
createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;
|
|
680
|
-
}
|
|
681
|
-
interface WorkflowSnapshotFactory {
|
|
682
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
683
|
-
}
|
|
684
|
-
interface WorkflowSnapshotResolver {
|
|
685
|
-
resolve(args: {
|
|
686
|
-
workflowId: WorkflowId;
|
|
687
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
688
|
-
}): WorkflowDefinition | undefined;
|
|
689
|
-
}
|
|
690
|
-
interface EngineDeps {
|
|
691
|
-
credentialSessions: CredentialSessionService;
|
|
692
|
-
workflowRunnerResolver: WorkflowRunnerResolver;
|
|
693
|
-
workflowCatalog: WorkflowCatalog;
|
|
694
|
-
workflowRepository: WorkflowRepository;
|
|
695
|
-
/** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
|
|
696
|
-
workflowActivationPolicy: WorkflowActivationPolicy;
|
|
697
|
-
nodeResolver: NodeResolver;
|
|
698
|
-
triggerSetupStateStore: TriggerSetupStateStore;
|
|
699
|
-
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
700
|
-
runIdFactory: RunIdFactory;
|
|
701
|
-
activationIdFactory: ActivationIdFactory;
|
|
702
|
-
runStore: RunStateStore;
|
|
703
|
-
activationScheduler: NodeActivationScheduler;
|
|
704
|
-
runDataFactory: RunDataFactory;
|
|
705
|
-
executionContextFactory: ExecutionContextFactory;
|
|
706
|
-
eventBus?: RunEventBus;
|
|
707
|
-
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
708
|
-
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
709
|
-
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
710
|
-
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
711
|
-
}
|
|
712
|
-
//#endregion
|
|
713
|
-
//#region src/contracts/workflowTypes.d.ts
|
|
714
|
-
type WorkflowId = string;
|
|
715
|
-
type NodeId = string;
|
|
716
|
-
type OutputPortKey = string;
|
|
717
|
-
type InputPortKey = string;
|
|
718
|
-
type PersistedTokenId = string;
|
|
719
|
-
type NodeKind = "trigger" | "node";
|
|
720
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
721
|
-
interface JsonObject {
|
|
722
|
-
readonly [key: string]: JsonValue;
|
|
723
|
-
}
|
|
724
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
725
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
726
|
-
interface Edge {
|
|
727
|
-
from: {
|
|
728
|
-
nodeId: NodeId;
|
|
729
|
-
output: OutputPortKey;
|
|
730
|
-
};
|
|
731
|
-
to: {
|
|
732
|
-
nodeId: NodeId;
|
|
733
|
-
input: InputPortKey;
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
type NodeConnectionName = string;
|
|
737
|
-
/**
|
|
738
|
-
* Named connection from an executable parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
739
|
-
* but are not traversed by the main execution graph.
|
|
740
|
-
*/
|
|
741
|
-
interface WorkflowNodeConnection {
|
|
742
|
-
readonly parentNodeId: NodeId;
|
|
743
|
-
readonly connectionName: NodeConnectionName;
|
|
744
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
745
|
-
}
|
|
746
|
-
interface WorkflowDefinition {
|
|
747
|
-
id: WorkflowId;
|
|
748
|
-
name: string;
|
|
749
|
-
nodes: NodeDefinition[];
|
|
750
|
-
edges: Edge[];
|
|
751
|
-
/**
|
|
752
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
753
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
754
|
-
*/
|
|
755
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
756
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
757
|
-
discoveryPathSegments?: readonly string[];
|
|
758
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
759
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
760
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
761
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
762
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
763
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
764
|
-
}
|
|
765
|
-
interface WorkflowGraph {
|
|
766
|
-
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
767
|
-
nodeId: NodeId;
|
|
768
|
-
input: InputPortKey;
|
|
769
|
-
}>>;
|
|
770
|
-
}
|
|
771
|
-
interface WorkflowGraphFactory {
|
|
772
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
773
|
-
}
|
|
774
|
-
interface NodeConfigBase {
|
|
775
|
-
readonly kind: NodeKind;
|
|
776
|
-
readonly type: TypeToken<unknown>;
|
|
777
|
-
readonly name?: string;
|
|
778
|
-
readonly id?: NodeId;
|
|
779
|
-
readonly icon?: string;
|
|
780
|
-
readonly execution?: Readonly<{
|
|
781
|
-
hint?: "local" | "worker";
|
|
782
|
-
queue?: string;
|
|
783
|
-
}>;
|
|
784
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
785
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
786
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
787
|
-
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
788
|
-
/**
|
|
789
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
790
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
791
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
792
|
-
*/
|
|
793
|
-
readonly continueWhenEmptyOutput?: boolean;
|
|
794
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
795
|
-
}
|
|
796
|
-
declare const runnableNodeInputType: unique symbol;
|
|
797
|
-
declare const runnableNodeOutputType: unique symbol;
|
|
798
|
-
declare const triggerNodeOutputType: unique symbol;
|
|
799
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
800
|
-
readonly kind: "node";
|
|
801
|
-
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
802
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
803
|
-
}
|
|
804
|
-
declare const triggerNodeSetupStateType: unique symbol;
|
|
805
|
-
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
806
|
-
readonly kind: "trigger";
|
|
807
|
-
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
808
|
-
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
809
|
-
}
|
|
810
|
-
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
811
|
-
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
812
|
-
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
813
|
-
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
814
|
-
interface NodeDefinition {
|
|
815
|
-
id: NodeId;
|
|
816
|
-
kind: NodeKind;
|
|
817
|
-
type: TypeToken<unknown>;
|
|
818
|
-
name?: string;
|
|
819
|
-
config: NodeConfigBase;
|
|
820
|
-
}
|
|
821
|
-
interface NodeRef {
|
|
822
|
-
id: NodeId;
|
|
823
|
-
kind: NodeKind;
|
|
824
|
-
name?: string;
|
|
825
|
-
}
|
|
826
|
-
type PairedItemRef = Readonly<{
|
|
827
|
-
nodeId: NodeId;
|
|
828
|
-
output: OutputPortKey;
|
|
829
|
-
itemIndex: number;
|
|
830
|
-
}>;
|
|
831
|
-
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
832
|
-
type BinaryAttachment = Readonly<{
|
|
833
|
-
id: string;
|
|
834
|
-
storageKey: string;
|
|
835
|
-
mimeType: string;
|
|
836
|
-
size: number;
|
|
837
|
-
storageDriver: string;
|
|
838
|
-
previewKind: BinaryPreviewKind;
|
|
839
|
-
createdAt: string;
|
|
840
|
-
runId: RunId;
|
|
841
|
-
workflowId: WorkflowId;
|
|
842
|
-
nodeId: NodeId;
|
|
843
|
-
activationId: NodeActivationId;
|
|
844
|
-
filename?: string;
|
|
845
|
-
sha256?: string;
|
|
846
|
-
}>;
|
|
847
|
-
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
848
|
-
type Item<TJson = unknown> = Readonly<{
|
|
849
|
-
json: TJson;
|
|
850
|
-
binary?: ItemBinary;
|
|
851
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
852
|
-
paired?: ReadonlyArray<PairedItemRef>;
|
|
853
|
-
}>;
|
|
854
|
-
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
855
|
-
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
856
|
-
type RunId = string;
|
|
857
|
-
type NodeActivationId = string;
|
|
858
|
-
interface ParentExecutionRef {
|
|
859
|
-
runId: RunId;
|
|
860
|
-
workflowId: WorkflowId;
|
|
861
|
-
nodeId: NodeId;
|
|
862
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
863
|
-
subworkflowDepth?: number;
|
|
864
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
865
|
-
engineMaxNodeActivations?: number;
|
|
866
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
867
|
-
engineMaxSubworkflowDepth?: number;
|
|
868
|
-
}
|
|
869
|
-
interface RunDataSnapshot {
|
|
870
|
-
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
871
|
-
getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
|
|
872
|
-
getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
|
|
873
|
-
}
|
|
874
|
-
interface MutableRunData extends RunDataSnapshot {
|
|
875
|
-
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
876
|
-
dump(): Record<NodeId, NodeOutputs>;
|
|
877
|
-
}
|
|
878
|
-
interface RunDataFactory {
|
|
879
|
-
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
880
|
-
}
|
|
881
|
-
interface RunIdFactory {
|
|
882
|
-
makeRunId(): RunId;
|
|
883
|
-
}
|
|
884
|
-
interface ActivationIdFactory {
|
|
885
|
-
makeActivationId(): NodeActivationId;
|
|
886
|
-
}
|
|
887
|
-
type UpstreamRefPlaceholder = `$${number}`;
|
|
888
|
-
declare const branchRef: (index: number) => UpstreamRefPlaceholder;
|
|
889
|
-
type ExecutionMode = "local" | "worker";
|
|
890
|
-
interface NodeSchedulerDecision {
|
|
891
|
-
mode: ExecutionMode;
|
|
892
|
-
queue?: string;
|
|
893
|
-
}
|
|
894
|
-
interface NodeOffloadPolicy {
|
|
895
|
-
decide(args: {
|
|
896
|
-
workflowId: WorkflowId;
|
|
897
|
-
nodeId: NodeId;
|
|
898
|
-
config: NodeConfigBase;
|
|
899
|
-
}): NodeSchedulerDecision;
|
|
900
|
-
}
|
|
901
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
902
|
-
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
903
|
-
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
904
|
-
interface WorkflowStoragePolicyResolver {
|
|
905
|
-
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
906
|
-
}
|
|
907
|
-
interface WorkflowStoragePolicyDecisionArgs {
|
|
908
|
-
readonly runId: RunId;
|
|
909
|
-
readonly workflowId: WorkflowId;
|
|
910
|
-
readonly workflow: WorkflowDefinition;
|
|
911
|
-
readonly finalStatus: "completed" | "failed";
|
|
912
|
-
readonly startedAt: string;
|
|
913
|
-
readonly finishedAt: string;
|
|
914
|
-
}
|
|
915
|
-
interface WorkflowPrunePolicySpec {
|
|
916
|
-
readonly runDataRetentionSeconds?: number;
|
|
917
|
-
readonly binaryRetentionSeconds?: number;
|
|
918
|
-
}
|
|
919
|
-
interface PersistedRunPolicySnapshot {
|
|
920
|
-
readonly retentionSeconds?: number;
|
|
921
|
-
readonly binaryRetentionSeconds?: number;
|
|
922
|
-
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
923
|
-
}
|
|
924
|
-
interface WorkflowErrorHandler {
|
|
925
|
-
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
926
|
-
}
|
|
927
|
-
interface WorkflowErrorContext {
|
|
928
|
-
readonly runId: RunId;
|
|
929
|
-
readonly workflowId: WorkflowId;
|
|
930
|
-
readonly workflow: WorkflowDefinition;
|
|
931
|
-
readonly failedNodeId: NodeId;
|
|
932
|
-
readonly error: Error;
|
|
933
|
-
readonly startedAt: string;
|
|
934
|
-
readonly finishedAt: string;
|
|
935
|
-
}
|
|
936
|
-
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
937
|
-
interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
938
|
-
readonly kind: "single" | "multi";
|
|
939
|
-
readonly items: Items;
|
|
940
|
-
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
941
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
942
|
-
readonly error: Error;
|
|
943
|
-
}
|
|
944
|
-
interface NodeErrorHandler {
|
|
945
|
-
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
946
|
-
}
|
|
947
|
-
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
948
|
-
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
949
|
-
interface WorkflowPolicyRuntimeDefaults {
|
|
950
|
-
readonly retentionSeconds?: number;
|
|
951
|
-
readonly binaryRetentionSeconds?: number;
|
|
952
|
-
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
953
|
-
}
|
|
954
|
-
//#endregion
|
|
955
|
-
//#region src/contracts/credentialTypes.d.ts
|
|
956
|
-
type CredentialTypeId = string;
|
|
957
|
-
type CredentialInstanceId = string;
|
|
958
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
959
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
960
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
961
|
-
type CredentialFieldSchema = Readonly<{
|
|
962
|
-
key: string;
|
|
963
|
-
label: string;
|
|
964
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
965
|
-
required?: true;
|
|
966
|
-
order?: number;
|
|
967
|
-
placeholder?: string;
|
|
968
|
-
helpText?: string;
|
|
969
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
970
|
-
envVarName?: string;
|
|
971
|
-
}>;
|
|
972
|
-
type CredentialRequirement = Readonly<{
|
|
973
|
-
slotKey: string;
|
|
974
|
-
label: string;
|
|
975
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
976
|
-
optional?: true;
|
|
977
|
-
helpText?: string;
|
|
978
|
-
helpUrl?: string;
|
|
979
|
-
}>;
|
|
980
|
-
type CredentialBindingKey = Readonly<{
|
|
981
|
-
workflowId: WorkflowId;
|
|
982
|
-
nodeId: NodeId;
|
|
983
|
-
slotKey: string;
|
|
984
|
-
}>;
|
|
985
|
-
type CredentialBinding = Readonly<{
|
|
986
|
-
key: CredentialBindingKey;
|
|
987
|
-
instanceId: CredentialInstanceId;
|
|
988
|
-
updatedAt: string;
|
|
989
|
-
}>;
|
|
990
|
-
type CredentialHealth = Readonly<{
|
|
991
|
-
status: CredentialHealthStatus;
|
|
992
|
-
message?: string;
|
|
993
|
-
testedAt?: string;
|
|
994
|
-
expiresAt?: string;
|
|
995
|
-
details?: Readonly<Record<string, unknown>>;
|
|
996
|
-
}>;
|
|
997
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
998
|
-
authorizeUrlFieldKey: string;
|
|
999
|
-
tokenUrlFieldKey: string;
|
|
1000
|
-
userInfoUrlFieldKey?: string;
|
|
1001
|
-
}>;
|
|
1002
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
1003
|
-
kind: "oauth2";
|
|
1004
|
-
providerId: string;
|
|
1005
|
-
scopes: ReadonlyArray<string>;
|
|
1006
|
-
clientIdFieldKey?: string;
|
|
1007
|
-
clientSecretFieldKey?: string;
|
|
1008
|
-
} | {
|
|
1009
|
-
kind: "oauth2";
|
|
1010
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
1011
|
-
scopes: ReadonlyArray<string>;
|
|
1012
|
-
clientIdFieldKey?: string;
|
|
1013
|
-
clientSecretFieldKey?: string;
|
|
1014
|
-
}>;
|
|
1015
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
1016
|
-
type CredentialTypeDefinition = Readonly<{
|
|
1017
|
-
typeId: CredentialTypeId;
|
|
1018
|
-
displayName: string;
|
|
1019
|
-
description?: string;
|
|
1020
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1021
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1022
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1023
|
-
auth?: CredentialAuthDefinition;
|
|
1024
|
-
}>;
|
|
1025
|
-
interface CredentialSessionService {
|
|
1026
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
1027
|
-
workflowId: WorkflowId;
|
|
1028
|
-
nodeId: NodeId;
|
|
1029
|
-
slotKey: string;
|
|
1030
|
-
}>): Promise<TSession>;
|
|
1031
|
-
}
|
|
1032
|
-
interface CredentialTypeRegistry {
|
|
1033
|
-
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
1034
|
-
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
1035
|
-
}
|
|
1036
|
-
declare class CredentialUnboundError extends Error {
|
|
1037
|
-
readonly bindingKey: CredentialBindingKey;
|
|
1038
|
-
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1039
|
-
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
1040
|
-
private static createMessage;
|
|
1041
|
-
}
|
|
1042
|
-
//#endregion
|
|
1043
|
-
//#region src/engine/adapters/registry/InMemoryWorkflowRegistry.d.ts
|
|
1044
|
-
declare class InMemoryWorkflowRegistry implements WorkflowCatalog {
|
|
1045
|
-
private readonly workflowsById;
|
|
1046
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
1047
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
1048
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
1049
|
-
}
|
|
1050
|
-
//#endregion
|
|
1051
|
-
export { RunId as $, RunQueueEntry as $n, PersistedTriggerSetupState as $t, JsonPrimitive as A, CurrentStateExecutionRequest as An, BinaryStorageReadResult as At, NodeId as B, PersistedRunControlState as Bn, MultiInputNode as Bt, ExecutionMode as C, WebhookInvocationMatch as Cn, instanceCachingFactory as Cr, runnableNodeInputType as Ct, Items as D, ConnectionInvocationAppendArgs as Dn, singleton as Dr, BinaryAttachmentCreateRequest as Dt, ItemBinary as E, WebhookTriggerRoutingDiagnostics as En, registry as Er, triggerNodeSetupStateType as Et, NodeConnectionName as F, NodeExecutionStatus as Fn, EngineHost as Ft, NodeSchedulerDecision as G, PinnedNodeOutputsByPort as Gn, NodeActivationRequestBase as Gt, NodeOffloadPolicy as H, PersistedWorkflowSnapshot as Hn, NodeActivationContinuation as Ht, NodeDefinition as I, NodeInputsByPort as In, ExecutableTriggerNode as It, ParentExecutionRef as J, RunEventPublisherDeps as Jn, NodeExecutionContext as Jt, OutputPortKey as K, RunCompletionNotifier as Kn, NodeActivationScheduler as Kt, NodeErrorHandler as L, PendingNodeExecution as Ln, ExecutionBinaryService as Lt, MutableRunData as M, ExecutionFrontierPlan as Mn, BinaryStorageWriteRequest as Mt, NodeActivationId as N, NodeExecutionError as Nn, BinaryStorageWriteResult as Nt, JsonArray as O, ConnectionInvocationId as On, BinaryBody as Ot, NodeConfigBase as P, NodeExecutionSnapshot as Pn, EngineDeps as Pt, RunDataSnapshot as Q, RunPruneListingStore as Qn, NodeResolver as Qt, NodeErrorHandlerArgs as R, PersistedMutableNodeState as Rn, ExecutionContext as Rt, Edge as S, WebhookControlSignal as Sn, injectable as Sr, branchRef as St, Item as T, WebhookTriggerResolution as Tn, predicateAwareClassFactory as Tr, triggerNodeOutputType as Tt, NodeOutputs as U, PersistedWorkflowSnapshotNode as Un, NodeActivationReceipt as Ut, NodeKind as V, PersistedRunState as Vn, Node as Vt, NodeRef as W, PersistedWorkflowTokenRegistryLike as Wn, NodeActivationRequest as Wt, PersistedTokenId as X, RunListingStore as Xn, NodeExecutionScheduler as Xt, PersistedRunPolicySnapshot as Y, RunExecutionOptions as Yn, NodeExecutionRequest as Yt, RunDataFactory as Z, RunPruneCandidate as Zn, NodeExecutionStatePublisher as Zt, CredentialUnboundError as _, RunEventSubscription as _n, TypeToken as _r, WorkflowPrunePolicySpec as _t, CredentialFieldSchema as a, TriggerSetupStateStore as an, RunSummary as ar, TriggerNodeOutputJson as at, BinaryAttachment as b, HttpMethod as bn, inject as br, WorkflowStoragePolicyResolver as bt, CredentialInstanceId as c, WorkflowNodeInstanceFactory as cn, FixedRetryPolicySpec as cr, WorkflowDefinition as ct, CredentialRequirement as d, WorkflowRunnerResolver as dn, Container as dr, WorkflowErrorHandlerSpec as dt, TestableTriggerNode as en, RunResult as er, RunIdFactory as et, CredentialSessionService as f, WorkflowRunnerService as fn, DependencyContainer as fr, WorkflowGraph as ft, CredentialTypeRegistry as g, RunEventBus as gn, RegistrationOptions as gr, WorkflowPolicyRuntimeDefaults as gt, CredentialTypeId as h, RunEvent as hn, Lifecycle as hr, WorkflowNodeConnection as ht, CredentialBindingKey as i, TriggerSetupStateFor as in, RunStopCondition as ir, TriggerNodeConfig as it, JsonValue as j, EngineRunCounters as jn, BinaryStorageStatResult as jt, JsonObject as k, ConnectionInvocationRecord as kn, BinaryStorage as kt, CredentialMaterialSourceKind as l, WorkflowRegistry as ln, NoneRetryPolicySpec as lr, WorkflowErrorContext as lt, CredentialTypeDefinition as m, WorkflowSnapshotResolver as mn, InjectionToken as mr, WorkflowId as mt, CredentialAuthDefinition as n, TriggerNode as nn, RunStateStore as nr, RunnableNodeInputJson as nt, CredentialHealth as o, TriggerTestItemsContext as on, WebhookRunResult as or, TriggerNodeSetupState as ot, CredentialSetupStatus as p, WorkflowSnapshotFactory as pn, Disposable as pr, WorkflowGraphFactory as pt, PairedItemRef as q, RunCurrentState as qn, NodeBinaryAttachmentService as qt, CredentialBinding as r, TriggerSetupContext as rn, RunStatus as rr, RunnableNodeOutputJson as rt, CredentialHealthStatus as s, WorkflowCatalog as sn, ExponentialRetryPolicySpec as sr, UpstreamRefPlaceholder as st, InMemoryWorkflowRegistry as t, TriggerCleanupHandle as tn, RunStateResetRequest as tr, RunnableNodeConfig as tt, CredentialOAuth2AuthDefinition as u, WorkflowRepository as un, RetryPolicySpec as ur, WorkflowErrorHandler as ut, OAuth2ProviderFromPublicConfig as v, AllWorkflowsActiveWorkflowActivationPolicy as vn, container as vr, WorkflowStoragePolicyDecisionArgs as vt, InputPortKey as w, WebhookTriggerMatcher as wn, instancePerContainerCachingFactory as wr, runnableNodeOutputType as wt, BinaryPreviewKind as x, TriggerInstanceId as xn, injectAll as xr, WorkflowStoragePolicySpec as xt, ActivationIdFactory as y, WorkflowActivationPolicy as yn, delay as yr, WorkflowStoragePolicyMode as yt, NodeErrorHandlerSpec as z, PersistedMutableRunState as zn, ExecutionContextFactory as zt };
|
|
1052
|
-
//# sourceMappingURL=InMemoryWorkflowRegistry-CXXJrwAr.d.cts.map
|