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