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