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