@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,1035 +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
|
-
}
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region src/events/runEvents.d.ts
|
|
365
|
-
type RunEvent = Readonly<{
|
|
366
|
-
kind: "runCreated";
|
|
367
|
-
runId: RunId;
|
|
368
|
-
workflowId: WorkflowId;
|
|
369
|
-
parent?: ParentExecutionRef;
|
|
370
|
-
at: string;
|
|
371
|
-
}> | Readonly<{
|
|
372
|
-
kind: "runSaved";
|
|
373
|
-
runId: RunId;
|
|
374
|
-
workflowId: WorkflowId;
|
|
375
|
-
parent?: ParentExecutionRef;
|
|
376
|
-
at: string;
|
|
377
|
-
state: PersistedRunState;
|
|
378
|
-
}> | Readonly<{
|
|
379
|
-
kind: "nodeQueued";
|
|
380
|
-
runId: RunId;
|
|
381
|
-
workflowId: WorkflowId;
|
|
382
|
-
parent?: ParentExecutionRef;
|
|
383
|
-
at: string;
|
|
384
|
-
snapshot: NodeExecutionSnapshot;
|
|
385
|
-
}> | Readonly<{
|
|
386
|
-
kind: "nodeStarted";
|
|
387
|
-
runId: RunId;
|
|
388
|
-
workflowId: WorkflowId;
|
|
389
|
-
parent?: ParentExecutionRef;
|
|
390
|
-
at: string;
|
|
391
|
-
snapshot: NodeExecutionSnapshot;
|
|
392
|
-
}> | Readonly<{
|
|
393
|
-
kind: "nodeCompleted";
|
|
394
|
-
runId: RunId;
|
|
395
|
-
workflowId: WorkflowId;
|
|
396
|
-
parent?: ParentExecutionRef;
|
|
397
|
-
at: string;
|
|
398
|
-
snapshot: NodeExecutionSnapshot;
|
|
399
|
-
}> | Readonly<{
|
|
400
|
-
kind: "nodeFailed";
|
|
401
|
-
runId: RunId;
|
|
402
|
-
workflowId: WorkflowId;
|
|
403
|
-
parent?: ParentExecutionRef;
|
|
404
|
-
at: string;
|
|
405
|
-
snapshot: NodeExecutionSnapshot;
|
|
406
|
-
}>;
|
|
407
|
-
interface RunEventSubscription {
|
|
408
|
-
close(): Promise<void>;
|
|
409
|
-
}
|
|
410
|
-
interface RunEventBus {
|
|
411
|
-
publish(event: RunEvent): Promise<void>;
|
|
412
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
413
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
414
|
-
}
|
|
415
|
-
//#endregion
|
|
416
|
-
//#region src/contracts/runtimeTypes.d.ts
|
|
417
|
-
interface WorkflowRunnerService {
|
|
418
|
-
runById(args: {
|
|
419
|
-
workflowId: WorkflowId;
|
|
420
|
-
startAt?: NodeId;
|
|
421
|
-
items: Items;
|
|
422
|
-
parent?: ParentExecutionRef;
|
|
423
|
-
}): Promise<RunResult>;
|
|
424
|
-
}
|
|
425
|
-
interface WorkflowRunnerResolver {
|
|
426
|
-
resolve(): WorkflowRunnerService | undefined;
|
|
427
|
-
}
|
|
428
|
-
interface WorkflowRepository {
|
|
429
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
430
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
431
|
-
}
|
|
432
|
-
interface WorkflowCatalog extends WorkflowRepository {
|
|
433
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
434
|
-
}
|
|
435
|
-
type WorkflowRegistry = WorkflowCatalog;
|
|
436
|
-
interface NodeResolver {
|
|
437
|
-
resolve<T>(token: TypeToken<T>): T;
|
|
438
|
-
getContainer(): Container | undefined;
|
|
439
|
-
}
|
|
440
|
-
interface NodeExecutionStatePublisher {
|
|
441
|
-
markQueued(args: {
|
|
442
|
-
nodeId: NodeId;
|
|
443
|
-
activationId?: NodeActivationId;
|
|
444
|
-
inputsByPort?: NodeInputsByPort;
|
|
445
|
-
}): Promise<void>;
|
|
446
|
-
markRunning(args: {
|
|
447
|
-
nodeId: NodeId;
|
|
448
|
-
activationId?: NodeActivationId;
|
|
449
|
-
inputsByPort?: NodeInputsByPort;
|
|
450
|
-
}): Promise<void>;
|
|
451
|
-
markCompleted(args: {
|
|
452
|
-
nodeId: NodeId;
|
|
453
|
-
activationId?: NodeActivationId;
|
|
454
|
-
inputsByPort?: NodeInputsByPort;
|
|
455
|
-
outputs?: NodeOutputs;
|
|
456
|
-
}): Promise<void>;
|
|
457
|
-
markFailed(args: {
|
|
458
|
-
nodeId: NodeId;
|
|
459
|
-
activationId?: NodeActivationId;
|
|
460
|
-
inputsByPort?: NodeInputsByPort;
|
|
461
|
-
error: Error;
|
|
462
|
-
}): Promise<void>;
|
|
463
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
464
|
-
}
|
|
465
|
-
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
466
|
-
interface BinaryStorageWriteRequest {
|
|
467
|
-
storageKey: string;
|
|
468
|
-
body: BinaryBody;
|
|
469
|
-
}
|
|
470
|
-
interface BinaryStorageWriteResult {
|
|
471
|
-
storageKey: string;
|
|
472
|
-
size: number;
|
|
473
|
-
sha256?: string;
|
|
474
|
-
}
|
|
475
|
-
interface BinaryStorageReadResult {
|
|
476
|
-
body: ReadableStream<Uint8Array>;
|
|
477
|
-
size?: number;
|
|
478
|
-
}
|
|
479
|
-
interface BinaryStorageStatResult {
|
|
480
|
-
exists: boolean;
|
|
481
|
-
size?: number;
|
|
482
|
-
}
|
|
483
|
-
interface BinaryStorage {
|
|
484
|
-
readonly driverName: string;
|
|
485
|
-
write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;
|
|
486
|
-
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
487
|
-
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
488
|
-
delete(storageKey: string): Promise<void>;
|
|
489
|
-
}
|
|
490
|
-
interface BinaryAttachmentCreateRequest {
|
|
491
|
-
name: string;
|
|
492
|
-
body: BinaryBody;
|
|
493
|
-
mimeType: string;
|
|
494
|
-
filename?: string;
|
|
495
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
496
|
-
}
|
|
497
|
-
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
498
|
-
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
499
|
-
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
500
|
-
}
|
|
501
|
-
interface ExecutionBinaryService {
|
|
502
|
-
forNode(args: {
|
|
503
|
-
nodeId: NodeId;
|
|
504
|
-
activationId: NodeActivationId;
|
|
505
|
-
}): NodeBinaryAttachmentService;
|
|
506
|
-
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
507
|
-
}
|
|
508
|
-
interface ExecutionContext {
|
|
509
|
-
runId: RunId;
|
|
510
|
-
workflowId: WorkflowId;
|
|
511
|
-
parent?: ParentExecutionRef;
|
|
512
|
-
/** This run's subworkflow depth (0 = root). */
|
|
513
|
-
subworkflowDepth: number;
|
|
514
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
515
|
-
engineMaxNodeActivations: number;
|
|
516
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
517
|
-
engineMaxSubworkflowDepth: number;
|
|
518
|
-
now: () => Date;
|
|
519
|
-
data: RunDataSnapshot;
|
|
520
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
521
|
-
binary: ExecutionBinaryService;
|
|
522
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
523
|
-
}
|
|
524
|
-
interface ExecutionContextFactory {
|
|
525
|
-
create(args: {
|
|
526
|
-
runId: RunId;
|
|
527
|
-
workflowId: WorkflowId;
|
|
528
|
-
parent?: ParentExecutionRef;
|
|
529
|
-
subworkflowDepth: number;
|
|
530
|
-
engineMaxNodeActivations: number;
|
|
531
|
-
engineMaxSubworkflowDepth: number;
|
|
532
|
-
data: RunDataSnapshot;
|
|
533
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
534
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
535
|
-
}): ExecutionContext;
|
|
536
|
-
}
|
|
537
|
-
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
538
|
-
nodeId: NodeId;
|
|
539
|
-
activationId: NodeActivationId;
|
|
540
|
-
config: TConfig;
|
|
541
|
-
binary: NodeBinaryAttachmentService;
|
|
542
|
-
}
|
|
543
|
-
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
544
|
-
trigger: TriggerInstanceId;
|
|
545
|
-
config: TConfig;
|
|
546
|
-
previousState: TSetupState$1;
|
|
547
|
-
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
548
|
-
emit(items: Items): Promise<void>;
|
|
549
|
-
}
|
|
550
|
-
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
551
|
-
trigger: TriggerInstanceId;
|
|
552
|
-
nodeId: NodeId;
|
|
553
|
-
config: TConfig;
|
|
554
|
-
previousState: TSetupState$1;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
558
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
559
|
-
* package-level setup code.
|
|
560
|
-
*/
|
|
561
|
-
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
562
|
-
trigger: TriggerInstanceId;
|
|
563
|
-
updatedAt: string;
|
|
564
|
-
state: TState;
|
|
565
|
-
}
|
|
566
|
-
interface TriggerSetupStateStore {
|
|
567
|
-
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
568
|
-
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
569
|
-
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
570
|
-
}
|
|
571
|
-
interface TriggerCleanupHandle {
|
|
572
|
-
stop(): Promise<void> | void;
|
|
573
|
-
}
|
|
574
|
-
interface EngineHost {
|
|
575
|
-
credentialSessions: CredentialSessionService;
|
|
576
|
-
workflows?: WorkflowRunnerService;
|
|
577
|
-
}
|
|
578
|
-
interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
579
|
-
kind: "node";
|
|
580
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
581
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
582
|
-
}
|
|
583
|
-
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
584
|
-
kind: "node";
|
|
585
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
586
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
587
|
-
}
|
|
588
|
-
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
589
|
-
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
590
|
-
kind: "trigger";
|
|
591
|
-
outputPorts: readonly ["main"];
|
|
592
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
593
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
594
|
-
}
|
|
595
|
-
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
596
|
-
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
597
|
-
}
|
|
598
|
-
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
599
|
-
interface NodeExecutionRequest {
|
|
600
|
-
runId: RunId;
|
|
601
|
-
activationId: NodeActivationId;
|
|
602
|
-
workflowId: WorkflowId;
|
|
603
|
-
nodeId: NodeId;
|
|
604
|
-
input: Items;
|
|
605
|
-
parent?: ParentExecutionRef;
|
|
606
|
-
queue?: string;
|
|
607
|
-
executionOptions?: RunExecutionOptions;
|
|
608
|
-
}
|
|
609
|
-
interface NodeExecutionScheduler {
|
|
610
|
-
enqueue(request: NodeExecutionRequest): Promise<{
|
|
611
|
-
receiptId: string;
|
|
612
|
-
}>;
|
|
613
|
-
cancel?(receiptId: string): Promise<void>;
|
|
614
|
-
}
|
|
615
|
-
type NodeActivationRequestBase = Readonly<{
|
|
616
|
-
runId: RunId;
|
|
617
|
-
activationId: NodeActivationId;
|
|
618
|
-
workflowId: WorkflowId;
|
|
619
|
-
nodeId: NodeId;
|
|
620
|
-
parent?: ParentExecutionRef;
|
|
621
|
-
executionOptions?: RunExecutionOptions;
|
|
622
|
-
batchId?: string;
|
|
623
|
-
ctx: NodeExecutionContext;
|
|
624
|
-
}>;
|
|
625
|
-
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
626
|
-
kind: "single";
|
|
627
|
-
input: Items;
|
|
628
|
-
}>) | (NodeActivationRequestBase & Readonly<{
|
|
629
|
-
kind: "multi";
|
|
630
|
-
inputsByPort: NodeInputsByPort;
|
|
631
|
-
}>);
|
|
632
|
-
interface NodeActivationReceipt {
|
|
633
|
-
receiptId: string;
|
|
634
|
-
mode?: "local" | "worker";
|
|
635
|
-
queue?: string;
|
|
636
|
-
}
|
|
637
|
-
interface NodeActivationContinuation {
|
|
638
|
-
markNodeRunning(args: {
|
|
639
|
-
runId: RunId;
|
|
640
|
-
activationId: NodeActivationId;
|
|
641
|
-
nodeId: NodeId;
|
|
642
|
-
inputsByPort: NodeInputsByPort;
|
|
643
|
-
}): Promise<void>;
|
|
644
|
-
resumeFromNodeResult(args: {
|
|
645
|
-
runId: RunId;
|
|
646
|
-
activationId: NodeActivationId;
|
|
647
|
-
nodeId: NodeId;
|
|
648
|
-
outputs: NodeOutputs;
|
|
649
|
-
}): Promise<RunResult>;
|
|
650
|
-
resumeFromNodeError(args: {
|
|
651
|
-
runId: RunId;
|
|
652
|
-
activationId: NodeActivationId;
|
|
653
|
-
nodeId: NodeId;
|
|
654
|
-
error: Error;
|
|
655
|
-
}): Promise<RunResult>;
|
|
656
|
-
}
|
|
657
|
-
interface NodeActivationScheduler {
|
|
658
|
-
setContinuation?(continuation: NodeActivationContinuation): void;
|
|
659
|
-
enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
|
|
660
|
-
notifyPendingStatePersisted?(runId: RunId): void;
|
|
661
|
-
cancel?(receiptId: string): Promise<void>;
|
|
662
|
-
}
|
|
663
|
-
interface WorkflowNodeInstanceFactory {
|
|
664
|
-
createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;
|
|
665
|
-
}
|
|
666
|
-
interface WorkflowSnapshotFactory {
|
|
667
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
668
|
-
}
|
|
669
|
-
interface WorkflowSnapshotResolver {
|
|
670
|
-
resolve(args: {
|
|
671
|
-
workflowId: WorkflowId;
|
|
672
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
673
|
-
}): WorkflowDefinition | undefined;
|
|
674
|
-
}
|
|
675
|
-
interface EngineDeps {
|
|
676
|
-
credentialSessions: CredentialSessionService;
|
|
677
|
-
workflowRunnerResolver: WorkflowRunnerResolver;
|
|
678
|
-
workflowCatalog: WorkflowCatalog;
|
|
679
|
-
workflowRepository: WorkflowRepository;
|
|
680
|
-
nodeResolver: NodeResolver;
|
|
681
|
-
triggerSetupStateStore: TriggerSetupStateStore;
|
|
682
|
-
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
683
|
-
runIdFactory: RunIdFactory;
|
|
684
|
-
activationIdFactory: ActivationIdFactory;
|
|
685
|
-
runStore: RunStateStore;
|
|
686
|
-
activationScheduler: NodeActivationScheduler;
|
|
687
|
-
runDataFactory: RunDataFactory;
|
|
688
|
-
executionContextFactory: ExecutionContextFactory;
|
|
689
|
-
eventBus?: RunEventBus;
|
|
690
|
-
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
691
|
-
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
692
|
-
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
693
|
-
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
694
|
-
}
|
|
695
|
-
//#endregion
|
|
696
|
-
//#region src/contracts/workflowTypes.d.ts
|
|
697
|
-
type WorkflowId = string;
|
|
698
|
-
type NodeId = string;
|
|
699
|
-
type OutputPortKey = string;
|
|
700
|
-
type InputPortKey = string;
|
|
701
|
-
type PersistedTokenId = string;
|
|
702
|
-
type NodeKind = "trigger" | "node";
|
|
703
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
704
|
-
interface JsonObject {
|
|
705
|
-
readonly [key: string]: JsonValue;
|
|
706
|
-
}
|
|
707
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
708
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
709
|
-
interface Edge {
|
|
710
|
-
from: {
|
|
711
|
-
nodeId: NodeId;
|
|
712
|
-
output: OutputPortKey;
|
|
713
|
-
};
|
|
714
|
-
to: {
|
|
715
|
-
nodeId: NodeId;
|
|
716
|
-
input: InputPortKey;
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
type NodeConnectionName = string;
|
|
720
|
-
/**
|
|
721
|
-
* Named connection from an executable parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
722
|
-
* but are not traversed by the main execution graph.
|
|
723
|
-
*/
|
|
724
|
-
interface WorkflowNodeConnection {
|
|
725
|
-
readonly parentNodeId: NodeId;
|
|
726
|
-
readonly connectionName: NodeConnectionName;
|
|
727
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
728
|
-
}
|
|
729
|
-
interface WorkflowDefinition {
|
|
730
|
-
id: WorkflowId;
|
|
731
|
-
name: string;
|
|
732
|
-
nodes: NodeDefinition[];
|
|
733
|
-
edges: Edge[];
|
|
734
|
-
/**
|
|
735
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
736
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
737
|
-
*/
|
|
738
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
739
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
740
|
-
discoveryPathSegments?: readonly string[];
|
|
741
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
742
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
743
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
744
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
745
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
746
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
747
|
-
}
|
|
748
|
-
interface WorkflowGraph {
|
|
749
|
-
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
750
|
-
nodeId: NodeId;
|
|
751
|
-
input: InputPortKey;
|
|
752
|
-
}>>;
|
|
753
|
-
}
|
|
754
|
-
interface WorkflowGraphFactory {
|
|
755
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
756
|
-
}
|
|
757
|
-
interface NodeConfigBase {
|
|
758
|
-
readonly kind: NodeKind;
|
|
759
|
-
readonly type: TypeToken<unknown>;
|
|
760
|
-
readonly name?: string;
|
|
761
|
-
readonly id?: NodeId;
|
|
762
|
-
readonly icon?: string;
|
|
763
|
-
readonly execution?: Readonly<{
|
|
764
|
-
hint?: "local" | "worker";
|
|
765
|
-
queue?: string;
|
|
766
|
-
}>;
|
|
767
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
768
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
769
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
770
|
-
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
771
|
-
/**
|
|
772
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
773
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
774
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
775
|
-
*/
|
|
776
|
-
readonly continueWhenEmptyOutput?: boolean;
|
|
777
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
778
|
-
}
|
|
779
|
-
declare const runnableNodeInputType: unique symbol;
|
|
780
|
-
declare const runnableNodeOutputType: unique symbol;
|
|
781
|
-
declare const triggerNodeOutputType: unique symbol;
|
|
782
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
783
|
-
readonly kind: "node";
|
|
784
|
-
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
785
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
786
|
-
}
|
|
787
|
-
declare const triggerNodeSetupStateType: unique symbol;
|
|
788
|
-
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
789
|
-
readonly kind: "trigger";
|
|
790
|
-
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
791
|
-
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
792
|
-
}
|
|
793
|
-
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
794
|
-
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
795
|
-
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
796
|
-
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
797
|
-
interface NodeDefinition {
|
|
798
|
-
id: NodeId;
|
|
799
|
-
kind: NodeKind;
|
|
800
|
-
type: TypeToken<unknown>;
|
|
801
|
-
name?: string;
|
|
802
|
-
config: NodeConfigBase;
|
|
803
|
-
}
|
|
804
|
-
interface NodeRef {
|
|
805
|
-
id: NodeId;
|
|
806
|
-
kind: NodeKind;
|
|
807
|
-
name?: string;
|
|
808
|
-
}
|
|
809
|
-
type PairedItemRef = Readonly<{
|
|
810
|
-
nodeId: NodeId;
|
|
811
|
-
output: OutputPortKey;
|
|
812
|
-
itemIndex: number;
|
|
813
|
-
}>;
|
|
814
|
-
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
815
|
-
type BinaryAttachment = Readonly<{
|
|
816
|
-
id: string;
|
|
817
|
-
storageKey: string;
|
|
818
|
-
mimeType: string;
|
|
819
|
-
size: number;
|
|
820
|
-
storageDriver: string;
|
|
821
|
-
previewKind: BinaryPreviewKind;
|
|
822
|
-
createdAt: string;
|
|
823
|
-
runId: RunId;
|
|
824
|
-
workflowId: WorkflowId;
|
|
825
|
-
nodeId: NodeId;
|
|
826
|
-
activationId: NodeActivationId;
|
|
827
|
-
filename?: string;
|
|
828
|
-
sha256?: string;
|
|
829
|
-
}>;
|
|
830
|
-
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
831
|
-
type Item<TJson = unknown> = Readonly<{
|
|
832
|
-
json: TJson;
|
|
833
|
-
binary?: ItemBinary;
|
|
834
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
835
|
-
paired?: ReadonlyArray<PairedItemRef>;
|
|
836
|
-
}>;
|
|
837
|
-
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
838
|
-
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
839
|
-
type RunId = string;
|
|
840
|
-
type NodeActivationId = string;
|
|
841
|
-
interface ParentExecutionRef {
|
|
842
|
-
runId: RunId;
|
|
843
|
-
workflowId: WorkflowId;
|
|
844
|
-
nodeId: NodeId;
|
|
845
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
846
|
-
subworkflowDepth?: number;
|
|
847
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
848
|
-
engineMaxNodeActivations?: number;
|
|
849
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
850
|
-
engineMaxSubworkflowDepth?: number;
|
|
851
|
-
}
|
|
852
|
-
interface RunDataSnapshot {
|
|
853
|
-
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
854
|
-
getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
|
|
855
|
-
getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
|
|
856
|
-
}
|
|
857
|
-
interface MutableRunData extends RunDataSnapshot {
|
|
858
|
-
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
859
|
-
dump(): Record<NodeId, NodeOutputs>;
|
|
860
|
-
}
|
|
861
|
-
interface RunDataFactory {
|
|
862
|
-
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
863
|
-
}
|
|
864
|
-
interface RunIdFactory {
|
|
865
|
-
makeRunId(): RunId;
|
|
866
|
-
}
|
|
867
|
-
interface ActivationIdFactory {
|
|
868
|
-
makeActivationId(): NodeActivationId;
|
|
869
|
-
}
|
|
870
|
-
type UpstreamRefPlaceholder = `$${number}`;
|
|
871
|
-
declare const branchRef: (index: number) => UpstreamRefPlaceholder;
|
|
872
|
-
type ExecutionMode = "local" | "worker";
|
|
873
|
-
interface NodeSchedulerDecision {
|
|
874
|
-
mode: ExecutionMode;
|
|
875
|
-
queue?: string;
|
|
876
|
-
}
|
|
877
|
-
interface NodeOffloadPolicy {
|
|
878
|
-
decide(args: {
|
|
879
|
-
workflowId: WorkflowId;
|
|
880
|
-
nodeId: NodeId;
|
|
881
|
-
config: NodeConfigBase;
|
|
882
|
-
}): NodeSchedulerDecision;
|
|
883
|
-
}
|
|
884
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
885
|
-
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
886
|
-
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
887
|
-
interface WorkflowStoragePolicyResolver {
|
|
888
|
-
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
889
|
-
}
|
|
890
|
-
interface WorkflowStoragePolicyDecisionArgs {
|
|
891
|
-
readonly runId: RunId;
|
|
892
|
-
readonly workflowId: WorkflowId;
|
|
893
|
-
readonly workflow: WorkflowDefinition;
|
|
894
|
-
readonly finalStatus: "completed" | "failed";
|
|
895
|
-
readonly startedAt: string;
|
|
896
|
-
readonly finishedAt: string;
|
|
897
|
-
}
|
|
898
|
-
interface WorkflowPrunePolicySpec {
|
|
899
|
-
readonly runDataRetentionSeconds?: number;
|
|
900
|
-
readonly binaryRetentionSeconds?: number;
|
|
901
|
-
}
|
|
902
|
-
interface PersistedRunPolicySnapshot {
|
|
903
|
-
readonly retentionSeconds?: number;
|
|
904
|
-
readonly binaryRetentionSeconds?: number;
|
|
905
|
-
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
906
|
-
}
|
|
907
|
-
interface WorkflowErrorHandler {
|
|
908
|
-
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
909
|
-
}
|
|
910
|
-
interface WorkflowErrorContext {
|
|
911
|
-
readonly runId: RunId;
|
|
912
|
-
readonly workflowId: WorkflowId;
|
|
913
|
-
readonly workflow: WorkflowDefinition;
|
|
914
|
-
readonly failedNodeId: NodeId;
|
|
915
|
-
readonly error: Error;
|
|
916
|
-
readonly startedAt: string;
|
|
917
|
-
readonly finishedAt: string;
|
|
918
|
-
}
|
|
919
|
-
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
920
|
-
interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
921
|
-
readonly kind: "single" | "multi";
|
|
922
|
-
readonly items: Items;
|
|
923
|
-
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
924
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
925
|
-
readonly error: Error;
|
|
926
|
-
}
|
|
927
|
-
interface NodeErrorHandler {
|
|
928
|
-
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
929
|
-
}
|
|
930
|
-
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
931
|
-
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
932
|
-
interface WorkflowPolicyRuntimeDefaults {
|
|
933
|
-
readonly retentionSeconds?: number;
|
|
934
|
-
readonly binaryRetentionSeconds?: number;
|
|
935
|
-
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
936
|
-
}
|
|
937
|
-
//#endregion
|
|
938
|
-
//#region src/contracts/credentialTypes.d.ts
|
|
939
|
-
type CredentialTypeId = string;
|
|
940
|
-
type CredentialInstanceId = string;
|
|
941
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
942
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
943
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
944
|
-
type CredentialFieldSchema = Readonly<{
|
|
945
|
-
key: string;
|
|
946
|
-
label: string;
|
|
947
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
948
|
-
required?: true;
|
|
949
|
-
order?: number;
|
|
950
|
-
placeholder?: string;
|
|
951
|
-
helpText?: string;
|
|
952
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
953
|
-
envVarName?: string;
|
|
954
|
-
}>;
|
|
955
|
-
type CredentialRequirement = Readonly<{
|
|
956
|
-
slotKey: string;
|
|
957
|
-
label: string;
|
|
958
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
959
|
-
optional?: true;
|
|
960
|
-
helpText?: string;
|
|
961
|
-
helpUrl?: string;
|
|
962
|
-
}>;
|
|
963
|
-
type CredentialBindingKey = Readonly<{
|
|
964
|
-
workflowId: WorkflowId;
|
|
965
|
-
nodeId: NodeId;
|
|
966
|
-
slotKey: string;
|
|
967
|
-
}>;
|
|
968
|
-
type CredentialBinding = Readonly<{
|
|
969
|
-
key: CredentialBindingKey;
|
|
970
|
-
instanceId: CredentialInstanceId;
|
|
971
|
-
updatedAt: string;
|
|
972
|
-
}>;
|
|
973
|
-
type CredentialHealth = Readonly<{
|
|
974
|
-
status: CredentialHealthStatus;
|
|
975
|
-
message?: string;
|
|
976
|
-
testedAt?: string;
|
|
977
|
-
expiresAt?: string;
|
|
978
|
-
details?: Readonly<Record<string, unknown>>;
|
|
979
|
-
}>;
|
|
980
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
981
|
-
authorizeUrlFieldKey: string;
|
|
982
|
-
tokenUrlFieldKey: string;
|
|
983
|
-
userInfoUrlFieldKey?: string;
|
|
984
|
-
}>;
|
|
985
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
986
|
-
kind: "oauth2";
|
|
987
|
-
providerId: string;
|
|
988
|
-
scopes: ReadonlyArray<string>;
|
|
989
|
-
clientIdFieldKey?: string;
|
|
990
|
-
clientSecretFieldKey?: string;
|
|
991
|
-
} | {
|
|
992
|
-
kind: "oauth2";
|
|
993
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
994
|
-
scopes: ReadonlyArray<string>;
|
|
995
|
-
clientIdFieldKey?: string;
|
|
996
|
-
clientSecretFieldKey?: string;
|
|
997
|
-
}>;
|
|
998
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
999
|
-
type CredentialTypeDefinition = Readonly<{
|
|
1000
|
-
typeId: CredentialTypeId;
|
|
1001
|
-
displayName: string;
|
|
1002
|
-
description?: string;
|
|
1003
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1004
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1005
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1006
|
-
auth?: CredentialAuthDefinition;
|
|
1007
|
-
}>;
|
|
1008
|
-
interface CredentialSessionService {
|
|
1009
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
1010
|
-
workflowId: WorkflowId;
|
|
1011
|
-
nodeId: NodeId;
|
|
1012
|
-
slotKey: string;
|
|
1013
|
-
}>): Promise<TSession>;
|
|
1014
|
-
}
|
|
1015
|
-
interface CredentialTypeRegistry {
|
|
1016
|
-
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
1017
|
-
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
1018
|
-
}
|
|
1019
|
-
declare class CredentialUnboundError extends Error {
|
|
1020
|
-
readonly bindingKey: CredentialBindingKey;
|
|
1021
|
-
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1022
|
-
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
1023
|
-
private static createMessage;
|
|
1024
|
-
}
|
|
1025
|
-
//#endregion
|
|
1026
|
-
//#region src/engine/adapters/registry/InMemoryWorkflowRegistry.d.ts
|
|
1027
|
-
declare class InMemoryWorkflowRegistry implements WorkflowCatalog {
|
|
1028
|
-
private readonly workflowsById;
|
|
1029
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
1030
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
1031
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
1032
|
-
}
|
|
1033
|
-
//#endregion
|
|
1034
|
-
export { RunId as $, RunStateResetRequest as $n, PersistedTriggerSetupState as $t, JsonPrimitive as A, ExecutionFrontierPlan as An, BinaryStorageReadResult as At, NodeId as B, PersistedWorkflowSnapshot as Bn, MultiInputNode as Bt, ExecutionMode as C, WebhookTriggerResolution as Cn, predicateAwareClassFactory as Cr, runnableNodeInputType as Ct, Items as D, ConnectionInvocationRecord as Dn, BinaryAttachmentCreateRequest as Dt, ItemBinary as E, ConnectionInvocationId as En, triggerNodeSetupStateType as Et, NodeConnectionName as F, PendingNodeExecution as Fn, EngineHost as Ft, NodeSchedulerDecision as G, RunCurrentState as Gn, NodeActivationRequestBase as Gt, NodeOffloadPolicy as H, PersistedWorkflowTokenRegistryLike as Hn, NodeActivationContinuation as Ht, NodeDefinition as I, PersistedMutableNodeState as In, ExecutableTriggerNode as It, ParentExecutionRef as J, RunListingStore as Jn, NodeExecutionContext as Jt, OutputPortKey as K, RunEventPublisherDeps as Kn, NodeActivationScheduler as Kt, NodeErrorHandler as L, PersistedMutableRunState as Ln, ExecutionBinaryService as Lt, MutableRunData as M, NodeExecutionSnapshot as Mn, BinaryStorageWriteRequest as Mt, NodeActivationId as N, NodeExecutionStatus as Nn, BinaryStorageWriteResult as Nt, JsonArray as O, CurrentStateExecutionRequest as On, BinaryBody as Ot, NodeConfigBase as P, NodeInputsByPort as Pn, EngineDeps as Pt, RunDataSnapshot as Q, RunResult as Qn, NodeResolver as Qt, NodeErrorHandlerArgs as R, PersistedRunControlState as Rn, ExecutionContext as Rt, Edge as S, WebhookTriggerMatcher as Sn, instancePerContainerCachingFactory as Sr, branchRef as St, Item as T, ConnectionInvocationAppendArgs as Tn, singleton as Tr, triggerNodeOutputType as Tt, NodeOutputs as U, PinnedNodeOutputsByPort as Un, NodeActivationReceipt as Ut, NodeKind as V, PersistedWorkflowSnapshotNode as Vn, Node as Vt, NodeRef as W, RunCompletionNotifier as Wn, NodeActivationRequest as Wt, PersistedTokenId as X, RunPruneListingStore as Xn, NodeExecutionScheduler as Xt, PersistedRunPolicySnapshot as Y, RunPruneCandidate as Yn, NodeExecutionRequest as Yt, RunDataFactory as Z, RunQueueEntry as Zn, NodeExecutionStatePublisher as Zt, CredentialUnboundError as _, RunEventSubscription as _n, delay as _r, WorkflowPrunePolicySpec as _t, CredentialFieldSchema as a, TriggerSetupStateStore as an, ExponentialRetryPolicySpec as ar, TriggerNodeOutputJson as at, BinaryAttachment as b, WebhookControlSignal as bn, injectable as br, WorkflowStoragePolicyResolver as bt, CredentialInstanceId as c, WorkflowNodeInstanceFactory as cn, RetryPolicySpec as cr, WorkflowDefinition as ct, CredentialRequirement as d, WorkflowRunnerResolver as dn, Disposable as dr, WorkflowErrorHandlerSpec as dt, TestableTriggerNode as en, RunStateStore as er, RunIdFactory as et, CredentialSessionService as f, WorkflowRunnerService as fn, InjectionToken as fr, WorkflowGraph as ft, CredentialTypeRegistry as g, RunEventBus as gn, container as gr, WorkflowPolicyRuntimeDefaults as gt, CredentialTypeId as h, RunEvent as hn, TypeToken as hr, WorkflowNodeConnection as ht, CredentialBindingKey as i, TriggerSetupStateFor as in, WebhookRunResult as ir, TriggerNodeConfig as it, JsonValue as j, NodeExecutionError as jn, BinaryStorageStatResult as jt, JsonObject as k, EngineRunCounters as kn, BinaryStorage as kt, CredentialMaterialSourceKind as l, WorkflowRegistry as ln, Container as lr, WorkflowErrorContext as lt, CredentialTypeDefinition as m, WorkflowSnapshotResolver as mn, RegistrationOptions as mr, WorkflowId as mt, CredentialAuthDefinition as n, TriggerNode as nn, RunStopCondition as nr, RunnableNodeInputJson as nt, CredentialHealth as o, TriggerTestItemsContext as on, FixedRetryPolicySpec as or, TriggerNodeSetupState as ot, CredentialSetupStatus as p, WorkflowSnapshotFactory as pn, Lifecycle as pr, WorkflowGraphFactory as pt, PairedItemRef as q, RunExecutionOptions as qn, NodeBinaryAttachmentService as qt, CredentialBinding as r, TriggerSetupContext as rn, RunSummary as rr, RunnableNodeOutputJson as rt, CredentialHealthStatus as s, WorkflowCatalog as sn, NoneRetryPolicySpec as sr, UpstreamRefPlaceholder as st, InMemoryWorkflowRegistry as t, TriggerCleanupHandle as tn, RunStatus as tr, RunnableNodeConfig as tt, CredentialOAuth2AuthDefinition as u, WorkflowRepository as un, DependencyContainer as ur, WorkflowErrorHandler as ut, OAuth2ProviderFromPublicConfig as v, HttpMethod as vn, inject as vr, WorkflowStoragePolicyDecisionArgs as vt, InputPortKey as w, WebhookTriggerRoutingDiagnostics as wn, registry as wr, runnableNodeOutputType as wt, BinaryPreviewKind as x, WebhookInvocationMatch as xn, instanceCachingFactory as xr, WorkflowStoragePolicySpec as xt, ActivationIdFactory as y, TriggerInstanceId as yn, injectAll as yr, WorkflowStoragePolicyMode as yt, NodeErrorHandlerSpec as z, PersistedRunState as zn, ExecutionContextFactory as zt };
|
|
1035
|
-
//# sourceMappingURL=InMemoryWorkflowRegistry-Dp5GiFF2.d.cts.map
|