@codemation/core 0.0.5 → 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/dist/{InMemoryLiveWorkflowRepository-DL7LmC9S.d.ts → InMemoryLiveWorkflowRepository-DxoualoC.d.ts} +6 -2
- package/dist/{InMemoryLiveWorkflowRepository-D6eiiXxF.d.cts → InMemoryLiveWorkflowRepository-orY1VsWG.d.cts} +6 -2
- package/dist/{RunIntentService-NKobsfMQ.d.cts → RunIntentService-ByuUYsAL.d.cts} +8 -3
- package/dist/{RunIntentService-BFVbsOcg.js → RunIntentService-CYnn140t.js} +9 -4
- package/dist/RunIntentService-CYnn140t.js.map +1 -0
- package/dist/{RunIntentService-2ivFmNQh.cjs → RunIntentService-DlQH5eZ2.cjs} +9 -4
- package/dist/RunIntentService-DlQH5eZ2.cjs.map +1 -0
- package/dist/{WorkflowSnapshotCodec-DTdWkoW_.d.cts → WorkflowSnapshotCodec-DSEzKyt3.d.cts} +2 -2
- package/dist/bootstrap/index.cjs +133 -4
- package/dist/bootstrap/index.cjs.map +1 -1
- package/dist/bootstrap/index.d.cts +4 -3
- package/dist/bootstrap/index.d.ts +3 -2
- package/dist/bootstrap/index.js +133 -4
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{index-9g6Pfe9Z.d.ts → index-CTjfVHJh.d.ts} +8 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +1 -1
- package/package.json +6 -1
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +10 -2
- package/src/contracts/runtimeTypes.ts +5 -0
- package/src/execution/NodeActivationRequestComposer.ts +15 -4
- package/src/orchestration/Engine.ts +12 -1
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +179 -0
- package/src/runtime/EngineFactory.ts +13 -0
- 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-D7l8cjdZ.d.cts +0 -1130
- 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.map +0 -1
- package/dist/RunIntentService-B0sUL5q-.js +0 -761
- package/dist/RunIntentService-B0sUL5q-.js.map +0 -1
- 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/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/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-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,1338 +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/events/runEvents.d.ts
|
|
63
|
-
type RunEvent = Readonly<{
|
|
64
|
-
kind: "runCreated";
|
|
65
|
-
runId: RunId;
|
|
66
|
-
workflowId: WorkflowId;
|
|
67
|
-
parent?: ParentExecutionRef;
|
|
68
|
-
at: string;
|
|
69
|
-
}> | Readonly<{
|
|
70
|
-
kind: "runSaved";
|
|
71
|
-
runId: RunId;
|
|
72
|
-
workflowId: WorkflowId;
|
|
73
|
-
parent?: ParentExecutionRef;
|
|
74
|
-
at: string;
|
|
75
|
-
state: PersistedRunState;
|
|
76
|
-
}> | Readonly<{
|
|
77
|
-
kind: "nodeQueued";
|
|
78
|
-
runId: RunId;
|
|
79
|
-
workflowId: WorkflowId;
|
|
80
|
-
parent?: ParentExecutionRef;
|
|
81
|
-
at: string;
|
|
82
|
-
snapshot: NodeExecutionSnapshot;
|
|
83
|
-
}> | Readonly<{
|
|
84
|
-
kind: "nodeStarted";
|
|
85
|
-
runId: RunId;
|
|
86
|
-
workflowId: WorkflowId;
|
|
87
|
-
parent?: ParentExecutionRef;
|
|
88
|
-
at: string;
|
|
89
|
-
snapshot: NodeExecutionSnapshot;
|
|
90
|
-
}> | Readonly<{
|
|
91
|
-
kind: "nodeCompleted";
|
|
92
|
-
runId: RunId;
|
|
93
|
-
workflowId: WorkflowId;
|
|
94
|
-
parent?: ParentExecutionRef;
|
|
95
|
-
at: string;
|
|
96
|
-
snapshot: NodeExecutionSnapshot;
|
|
97
|
-
}> | Readonly<{
|
|
98
|
-
kind: "nodeFailed";
|
|
99
|
-
runId: RunId;
|
|
100
|
-
workflowId: WorkflowId;
|
|
101
|
-
parent?: ParentExecutionRef;
|
|
102
|
-
at: string;
|
|
103
|
-
snapshot: NodeExecutionSnapshot;
|
|
104
|
-
}>;
|
|
105
|
-
interface RunEventSubscription {
|
|
106
|
-
close(): Promise<void>;
|
|
107
|
-
}
|
|
108
|
-
interface RunEventBus {
|
|
109
|
-
publish(event: RunEvent): Promise<void>;
|
|
110
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
111
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/policies/executionLimits/EngineExecutionLimitsPolicy.d.ts
|
|
115
|
-
interface EngineExecutionLimitsPolicyConfig {
|
|
116
|
-
readonly defaultMaxNodeActivations: number;
|
|
117
|
-
readonly hardMaxNodeActivations: number;
|
|
118
|
-
readonly defaultMaxSubworkflowDepth: number;
|
|
119
|
-
readonly hardMaxSubworkflowDepth: number;
|
|
120
|
-
}
|
|
121
|
-
/** Framework defaults for {@link EngineExecutionLimitsPolicy} (merged with host `runtime.engineExecutionLimits`). */
|
|
122
|
-
declare const ENGINE_EXECUTION_LIMITS_DEFAULTS: EngineExecutionLimitsPolicyConfig;
|
|
123
|
-
/**
|
|
124
|
-
* Resolves per-run execution limits: defaults, hard ceilings, and subworkflow depth for new runs.
|
|
125
|
-
*/
|
|
126
|
-
declare class EngineExecutionLimitsPolicy {
|
|
127
|
-
private readonly config;
|
|
128
|
-
constructor(config?: EngineExecutionLimitsPolicyConfig);
|
|
129
|
-
/**
|
|
130
|
-
* Effective options for a new root run (depth 0): defaults merged with engine ceilings.
|
|
131
|
-
* Replaces a separate one-method factory for root-run bootstrap.
|
|
132
|
-
*/
|
|
133
|
-
createRootExecutionOptions(): RunExecutionOptions;
|
|
134
|
-
mergeExecutionOptionsForNewRun(parent: ParentExecutionRef | undefined, user: RunExecutionOptions | undefined): RunExecutionOptions;
|
|
135
|
-
private capNumber;
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/di/CoreTokens.d.ts
|
|
139
|
-
declare const CoreTokens: {
|
|
140
|
-
readonly PersistedWorkflowTokenRegistry: TypeToken<PersistedWorkflowTokenRegistryLike>;
|
|
141
|
-
readonly CredentialSessionService: TypeToken<CredentialSessionService>;
|
|
142
|
-
readonly CredentialTypeRegistry: TypeToken<CredentialTypeRegistry>;
|
|
143
|
-
readonly WorkflowRunnerService: TypeToken<WorkflowRunnerService>;
|
|
144
|
-
readonly LiveWorkflowRepository: TypeToken<LiveWorkflowRepository>;
|
|
145
|
-
readonly WorkflowRepository: TypeToken<WorkflowRepository>;
|
|
146
|
-
readonly NodeResolver: TypeToken<NodeResolver>;
|
|
147
|
-
readonly WorkflowNodeInstanceFactory: TypeToken<WorkflowNodeInstanceFactory>;
|
|
148
|
-
readonly RunIdFactory: TypeToken<RunIdFactory>;
|
|
149
|
-
readonly ActivationIdFactory: TypeToken<ActivationIdFactory>;
|
|
150
|
-
readonly WorkflowExecutionRepository: TypeToken<WorkflowExecutionRepository>;
|
|
151
|
-
readonly TriggerSetupStateRepository: TypeToken<TriggerSetupStateRepository>;
|
|
152
|
-
readonly NodeActivationScheduler: TypeToken<NodeActivationScheduler>;
|
|
153
|
-
readonly RunDataFactory: TypeToken<RunDataFactory>;
|
|
154
|
-
readonly ExecutionContextFactory: TypeToken<ExecutionContextFactory>;
|
|
155
|
-
readonly RunEventBus: TypeToken<RunEventBus>;
|
|
156
|
-
readonly BinaryStorage: TypeToken<BinaryStorage>;
|
|
157
|
-
readonly WebhookBasePath: TypeToken<string>;
|
|
158
|
-
/** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */
|
|
159
|
-
readonly EngineExecutionLimitsPolicy: TypeToken<EngineExecutionLimitsPolicy>;
|
|
160
|
-
readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
|
|
161
|
-
};
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/contracts/runTypes.d.ts
|
|
164
|
-
interface RunExecutionOptions {
|
|
165
|
-
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
166
|
-
localOnly?: boolean;
|
|
167
|
-
/** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
|
|
168
|
-
webhook?: boolean;
|
|
169
|
-
mode?: "manual" | "debug";
|
|
170
|
-
sourceWorkflowId?: WorkflowId;
|
|
171
|
-
sourceRunId?: RunId;
|
|
172
|
-
derivedFromRunId?: RunId;
|
|
173
|
-
isMutable?: boolean;
|
|
174
|
-
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
175
|
-
subworkflowDepth?: number;
|
|
176
|
-
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
177
|
-
maxNodeActivations?: number;
|
|
178
|
-
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
179
|
-
maxSubworkflowDepth?: number;
|
|
180
|
-
}
|
|
181
|
-
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
182
|
-
interface EngineRunCounters {
|
|
183
|
-
completedNodeActivations: number;
|
|
184
|
-
}
|
|
185
|
-
type RunStopCondition = Readonly<{
|
|
186
|
-
kind: "workflowCompleted";
|
|
187
|
-
}> | Readonly<{
|
|
188
|
-
kind: "nodeCompleted";
|
|
189
|
-
nodeId: NodeId;
|
|
190
|
-
}>;
|
|
191
|
-
interface RunStateResetRequest {
|
|
192
|
-
clearFromNodeId: NodeId;
|
|
193
|
-
}
|
|
194
|
-
interface PersistedRunControlState {
|
|
195
|
-
stopCondition?: RunStopCondition;
|
|
196
|
-
}
|
|
197
|
-
interface PersistedWorkflowSnapshotNode {
|
|
198
|
-
id: NodeId;
|
|
199
|
-
kind: NodeKind;
|
|
200
|
-
name?: string;
|
|
201
|
-
nodeTokenId: PersistedTokenId;
|
|
202
|
-
configTokenId: PersistedTokenId;
|
|
203
|
-
tokenName?: string;
|
|
204
|
-
configTokenName?: string;
|
|
205
|
-
config: unknown;
|
|
206
|
-
}
|
|
207
|
-
interface PersistedWorkflowSnapshot {
|
|
208
|
-
id: WorkflowId;
|
|
209
|
-
name: string;
|
|
210
|
-
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
211
|
-
edges: ReadonlyArray<Edge>;
|
|
212
|
-
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
213
|
-
workflowErrorHandlerConfigured?: boolean;
|
|
214
|
-
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
215
|
-
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
216
|
-
}
|
|
217
|
-
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
218
|
-
interface PersistedMutableNodeState {
|
|
219
|
-
pinnedOutputsByPort?: PinnedNodeOutputsByPort;
|
|
220
|
-
lastDebugInput?: Items;
|
|
221
|
-
}
|
|
222
|
-
interface PersistedMutableRunState {
|
|
223
|
-
nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
|
|
224
|
-
}
|
|
225
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
226
|
-
interface RunQueueEntry {
|
|
227
|
-
nodeId: NodeId;
|
|
228
|
-
input: Items;
|
|
229
|
-
toInput?: InputPortKey;
|
|
230
|
-
batchId?: string;
|
|
231
|
-
from?: Readonly<{
|
|
232
|
-
nodeId: NodeId;
|
|
233
|
-
output: OutputPortKey;
|
|
234
|
-
}>;
|
|
235
|
-
collect?: Readonly<{
|
|
236
|
-
expectedInputs: ReadonlyArray<InputPortKey>;
|
|
237
|
-
received: Readonly<Record<InputPortKey, Items>>;
|
|
238
|
-
}>;
|
|
239
|
-
}
|
|
240
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
241
|
-
interface NodeExecutionError {
|
|
242
|
-
message: string;
|
|
243
|
-
name?: string;
|
|
244
|
-
stack?: string;
|
|
245
|
-
}
|
|
246
|
-
interface NodeExecutionSnapshot {
|
|
247
|
-
runId: RunId;
|
|
248
|
-
workflowId: WorkflowId;
|
|
249
|
-
nodeId: NodeId;
|
|
250
|
-
activationId?: NodeActivationId;
|
|
251
|
-
parent?: ParentExecutionRef;
|
|
252
|
-
status: NodeExecutionStatus;
|
|
253
|
-
usedPinnedOutput?: boolean;
|
|
254
|
-
queuedAt?: string;
|
|
255
|
-
startedAt?: string;
|
|
256
|
-
finishedAt?: string;
|
|
257
|
-
updatedAt: string;
|
|
258
|
-
inputsByPort?: NodeInputsByPort;
|
|
259
|
-
outputs?: NodeOutputs;
|
|
260
|
-
error?: NodeExecutionError;
|
|
261
|
-
}
|
|
262
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
263
|
-
type ConnectionInvocationId = string;
|
|
264
|
-
/**
|
|
265
|
-
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
266
|
-
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
267
|
-
*/
|
|
268
|
-
interface ConnectionInvocationRecord {
|
|
269
|
-
readonly invocationId: ConnectionInvocationId;
|
|
270
|
-
readonly runId: RunId;
|
|
271
|
-
readonly workflowId: WorkflowId;
|
|
272
|
-
readonly connectionNodeId: NodeId;
|
|
273
|
-
readonly parentAgentNodeId: NodeId;
|
|
274
|
-
readonly parentAgentActivationId: NodeActivationId;
|
|
275
|
-
readonly status: NodeExecutionStatus;
|
|
276
|
-
readonly managedInput?: JsonValue;
|
|
277
|
-
readonly managedOutput?: JsonValue;
|
|
278
|
-
readonly error?: NodeExecutionError;
|
|
279
|
-
readonly queuedAt?: string;
|
|
280
|
-
readonly startedAt?: string;
|
|
281
|
-
readonly finishedAt?: string;
|
|
282
|
-
readonly updatedAt: string;
|
|
283
|
-
}
|
|
284
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
285
|
-
type ConnectionInvocationAppendArgs = Readonly<{
|
|
286
|
-
invocationId: ConnectionInvocationId;
|
|
287
|
-
connectionNodeId: NodeId;
|
|
288
|
-
parentAgentNodeId: NodeId;
|
|
289
|
-
parentAgentActivationId: NodeActivationId;
|
|
290
|
-
status: NodeExecutionStatus;
|
|
291
|
-
managedInput?: JsonValue;
|
|
292
|
-
managedOutput?: JsonValue;
|
|
293
|
-
error?: NodeExecutionError;
|
|
294
|
-
queuedAt?: string;
|
|
295
|
-
startedAt?: string;
|
|
296
|
-
finishedAt?: string;
|
|
297
|
-
}>;
|
|
298
|
-
interface RunCurrentState {
|
|
299
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
300
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
301
|
-
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
302
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
303
|
-
mutableState?: PersistedMutableRunState;
|
|
304
|
-
}
|
|
305
|
-
interface CurrentStateExecutionRequest {
|
|
306
|
-
workflow: WorkflowDefinition;
|
|
307
|
-
items?: Items;
|
|
308
|
-
parent?: ParentExecutionRef;
|
|
309
|
-
executionOptions?: RunExecutionOptions;
|
|
310
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
311
|
-
mutableState?: PersistedMutableRunState;
|
|
312
|
-
currentState?: RunCurrentState;
|
|
313
|
-
stopCondition?: RunStopCondition;
|
|
314
|
-
reset?: RunStateResetRequest;
|
|
315
|
-
}
|
|
316
|
-
interface ExecutionFrontierPlan {
|
|
317
|
-
rootNodeId?: NodeId;
|
|
318
|
-
rootNodeInput?: Items;
|
|
319
|
-
queue: RunQueueEntry[];
|
|
320
|
-
currentState: RunCurrentState;
|
|
321
|
-
stopCondition: RunStopCondition;
|
|
322
|
-
satisfiedNodeIds: ReadonlyArray<NodeId>;
|
|
323
|
-
skippedNodeIds: ReadonlyArray<NodeId>;
|
|
324
|
-
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
325
|
-
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
326
|
-
}
|
|
327
|
-
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
328
|
-
interface RunSummary {
|
|
329
|
-
runId: RunId;
|
|
330
|
-
workflowId: WorkflowId;
|
|
331
|
-
startedAt: string;
|
|
332
|
-
status: RunStatus;
|
|
333
|
-
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
334
|
-
finishedAt?: string;
|
|
335
|
-
parent?: ParentExecutionRef;
|
|
336
|
-
executionOptions?: RunExecutionOptions;
|
|
337
|
-
}
|
|
338
|
-
interface PendingNodeExecution {
|
|
339
|
-
runId: RunId;
|
|
340
|
-
activationId: NodeActivationId;
|
|
341
|
-
workflowId: WorkflowId;
|
|
342
|
-
nodeId: NodeId;
|
|
343
|
-
itemsIn: number;
|
|
344
|
-
inputsByPort: NodeInputsByPort;
|
|
345
|
-
receiptId: string;
|
|
346
|
-
queue?: string;
|
|
347
|
-
batchId?: string;
|
|
348
|
-
enqueuedAt: string;
|
|
349
|
-
}
|
|
350
|
-
interface PersistedRunState {
|
|
351
|
-
runId: RunId;
|
|
352
|
-
workflowId: WorkflowId;
|
|
353
|
-
startedAt: string;
|
|
354
|
-
parent?: ParentExecutionRef;
|
|
355
|
-
executionOptions?: RunExecutionOptions;
|
|
356
|
-
control?: PersistedRunControlState;
|
|
357
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
358
|
-
mutableState?: PersistedMutableRunState;
|
|
359
|
-
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
360
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
361
|
-
/** Successful node completions so far (for activation budget). */
|
|
362
|
-
engineCounters?: EngineRunCounters;
|
|
363
|
-
status: RunStatus;
|
|
364
|
-
pending?: PendingNodeExecution;
|
|
365
|
-
queue: RunQueueEntry[];
|
|
366
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
367
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
368
|
-
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
369
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
370
|
-
}
|
|
371
|
-
interface WorkflowExecutionRepository {
|
|
372
|
-
createRun(args: {
|
|
373
|
-
runId: RunId;
|
|
374
|
-
workflowId: WorkflowId;
|
|
375
|
-
startedAt: string;
|
|
376
|
-
parent?: ParentExecutionRef;
|
|
377
|
-
executionOptions?: RunExecutionOptions;
|
|
378
|
-
control?: PersistedRunControlState;
|
|
379
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
380
|
-
mutableState?: PersistedMutableRunState;
|
|
381
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
382
|
-
engineCounters?: EngineRunCounters;
|
|
383
|
-
}): Promise<void>;
|
|
384
|
-
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
385
|
-
save(state: PersistedRunState): Promise<void>;
|
|
386
|
-
deleteRun?(runId: RunId): Promise<void>;
|
|
387
|
-
}
|
|
388
|
-
interface WorkflowExecutionListingRepository {
|
|
389
|
-
listRuns(args?: Readonly<{
|
|
390
|
-
workflowId?: WorkflowId;
|
|
391
|
-
limit?: number;
|
|
392
|
-
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
393
|
-
}
|
|
394
|
-
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
395
|
-
interface RunPruneCandidate {
|
|
396
|
-
readonly runId: RunId;
|
|
397
|
-
readonly workflowId: WorkflowId;
|
|
398
|
-
readonly startedAt: string;
|
|
399
|
-
readonly finishedAt: string;
|
|
400
|
-
}
|
|
401
|
-
interface WorkflowExecutionPruneRepository {
|
|
402
|
-
listRunsOlderThan(args: Readonly<{
|
|
403
|
-
beforeIso: string;
|
|
404
|
-
limit?: number;
|
|
405
|
-
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
406
|
-
}
|
|
407
|
-
type RunResult = {
|
|
408
|
-
runId: RunId;
|
|
409
|
-
workflowId: WorkflowId;
|
|
410
|
-
startedAt: string;
|
|
411
|
-
status: "completed";
|
|
412
|
-
outputs: Items;
|
|
413
|
-
} | {
|
|
414
|
-
runId: RunId;
|
|
415
|
-
workflowId: WorkflowId;
|
|
416
|
-
startedAt: string;
|
|
417
|
-
status: "pending";
|
|
418
|
-
pending: PendingNodeExecution;
|
|
419
|
-
} | {
|
|
420
|
-
runId: RunId;
|
|
421
|
-
workflowId: WorkflowId;
|
|
422
|
-
startedAt: string;
|
|
423
|
-
status: "failed";
|
|
424
|
-
error: {
|
|
425
|
-
message: string;
|
|
426
|
-
};
|
|
427
|
-
};
|
|
428
|
-
type WebhookRunResult = Readonly<{
|
|
429
|
-
runId: RunId;
|
|
430
|
-
workflowId: WorkflowId;
|
|
431
|
-
startedAt: string;
|
|
432
|
-
runStatus: "pending" | "completed";
|
|
433
|
-
response: Items;
|
|
434
|
-
}>;
|
|
435
|
-
interface PersistedWorkflowTokenRegistryLike {
|
|
436
|
-
register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
|
|
437
|
-
getTokenId(type: TypeToken<unknown>): string | undefined;
|
|
438
|
-
resolve(tokenId: string): TypeToken<unknown> | undefined;
|
|
439
|
-
registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
440
|
-
}
|
|
441
|
-
interface RunCompletionNotifier {
|
|
442
|
-
resolveRunCompletion(result: RunResult): void;
|
|
443
|
-
resolveWebhookResponse(result: WebhookRunResult): void;
|
|
444
|
-
}
|
|
445
|
-
interface RunEventPublisherDeps {
|
|
446
|
-
eventBus?: RunEventBus;
|
|
447
|
-
}
|
|
448
|
-
//#endregion
|
|
449
|
-
//#region src/contracts/workflowActivationPolicy.d.ts
|
|
450
|
-
/**
|
|
451
|
-
* Host-controlled policy: when false, trigger {@link TriggerNode} setup is skipped and webhook routes
|
|
452
|
-
* for that workflow are not registered (see engine trigger runtime + webhook matcher).
|
|
453
|
-
*/
|
|
454
|
-
interface WorkflowActivationPolicy {
|
|
455
|
-
isActive(workflowId: WorkflowId): boolean;
|
|
456
|
-
}
|
|
457
|
-
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
458
|
-
declare class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy {
|
|
459
|
-
isActive(_workflowId: WorkflowId): boolean;
|
|
460
|
-
}
|
|
461
|
-
//#endregion
|
|
462
|
-
//#region src/contracts/webhookTypes.d.ts
|
|
463
|
-
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
464
|
-
interface WebhookControlSignal {
|
|
465
|
-
readonly __webhookControl: true;
|
|
466
|
-
readonly kind: "respondNow" | "respondNowAndContinue";
|
|
467
|
-
readonly responseItems: Items;
|
|
468
|
-
readonly continueItems?: Items;
|
|
469
|
-
}
|
|
470
|
-
interface WebhookTriggerRoutingDiagnostics {
|
|
471
|
-
warn(message: string): void;
|
|
472
|
-
/** Inactive workflows omitted from the webhook route index (optional; host should wire for clarity at boot/reload). */
|
|
473
|
-
info?(message: string): void;
|
|
474
|
-
}
|
|
475
|
-
interface TriggerInstanceId {
|
|
476
|
-
workflowId: WorkflowId;
|
|
477
|
-
nodeId: NodeId;
|
|
478
|
-
}
|
|
479
|
-
/** Match for an incoming HTTP request: user-defined URL segment + workflow trigger node. */
|
|
480
|
-
interface WebhookInvocationMatch {
|
|
481
|
-
/** Same value as the webhook trigger's configured endpoint key (URL segment under the webhook base path). */
|
|
482
|
-
endpointPath: string;
|
|
483
|
-
workflowId: WorkflowId;
|
|
484
|
-
nodeId: NodeId;
|
|
485
|
-
methods: ReadonlyArray<HttpMethod>;
|
|
486
|
-
parseJsonBody?: (body: unknown) => unknown;
|
|
487
|
-
}
|
|
488
|
-
/** Result of resolving an HTTP method + endpoint path against the catalog webhook index (404 vs 405 vs match). */
|
|
489
|
-
type WebhookTriggerResolution = {
|
|
490
|
-
status: "notFound";
|
|
491
|
-
} | {
|
|
492
|
-
status: "methodNotAllowed";
|
|
493
|
-
match: WebhookInvocationMatch;
|
|
494
|
-
} | {
|
|
495
|
-
status: "ok";
|
|
496
|
-
match: WebhookInvocationMatch;
|
|
497
|
-
};
|
|
498
|
-
/**
|
|
499
|
-
* Resolves webhook routes from workflow definitions (catalog-backed index, no registration at trigger setup).
|
|
500
|
-
*/
|
|
501
|
-
interface WebhookTriggerMatcher {
|
|
502
|
-
match(args: {
|
|
503
|
-
endpointPath: string;
|
|
504
|
-
method: HttpMethod;
|
|
505
|
-
}): WebhookInvocationMatch | undefined;
|
|
506
|
-
lookup(endpointPath: string): WebhookInvocationMatch | undefined;
|
|
507
|
-
onEngineWorkflowsLoaded?(): void;
|
|
508
|
-
onEngineStopped?(): void;
|
|
509
|
-
/** Rebuild route index after activation changes without stopping the engine. */
|
|
510
|
-
reloadWebhookRoutes?(): void;
|
|
511
|
-
}
|
|
512
|
-
//#endregion
|
|
513
|
-
//#region src/contracts/runtimeTypes.d.ts
|
|
514
|
-
interface WorkflowRunnerService {
|
|
515
|
-
runById(args: {
|
|
516
|
-
workflowId: WorkflowId;
|
|
517
|
-
startAt?: NodeId;
|
|
518
|
-
items: Items;
|
|
519
|
-
parent?: ParentExecutionRef;
|
|
520
|
-
}): Promise<RunResult>;
|
|
521
|
-
}
|
|
522
|
-
interface WorkflowRunnerResolver {
|
|
523
|
-
resolve(): WorkflowRunnerService | undefined;
|
|
524
|
-
}
|
|
525
|
-
interface WorkflowRepository {
|
|
526
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
527
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
528
|
-
}
|
|
529
|
-
interface LiveWorkflowRepository extends WorkflowRepository {
|
|
530
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
531
|
-
}
|
|
532
|
-
interface NodeResolver {
|
|
533
|
-
resolve<T>(token: TypeToken<T>): T;
|
|
534
|
-
}
|
|
535
|
-
interface NodeExecutionStatePublisher {
|
|
536
|
-
markQueued(args: {
|
|
537
|
-
nodeId: NodeId;
|
|
538
|
-
activationId?: NodeActivationId;
|
|
539
|
-
inputsByPort?: NodeInputsByPort;
|
|
540
|
-
}): Promise<void>;
|
|
541
|
-
markRunning(args: {
|
|
542
|
-
nodeId: NodeId;
|
|
543
|
-
activationId?: NodeActivationId;
|
|
544
|
-
inputsByPort?: NodeInputsByPort;
|
|
545
|
-
}): Promise<void>;
|
|
546
|
-
markCompleted(args: {
|
|
547
|
-
nodeId: NodeId;
|
|
548
|
-
activationId?: NodeActivationId;
|
|
549
|
-
inputsByPort?: NodeInputsByPort;
|
|
550
|
-
outputs?: NodeOutputs;
|
|
551
|
-
}): Promise<void>;
|
|
552
|
-
markFailed(args: {
|
|
553
|
-
nodeId: NodeId;
|
|
554
|
-
activationId?: NodeActivationId;
|
|
555
|
-
inputsByPort?: NodeInputsByPort;
|
|
556
|
-
error: Error;
|
|
557
|
-
}): Promise<void>;
|
|
558
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
559
|
-
}
|
|
560
|
-
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
561
|
-
interface BinaryStorageWriteRequest {
|
|
562
|
-
storageKey: string;
|
|
563
|
-
body: BinaryBody;
|
|
564
|
-
}
|
|
565
|
-
interface BinaryStorageWriteResult {
|
|
566
|
-
storageKey: string;
|
|
567
|
-
size: number;
|
|
568
|
-
sha256?: string;
|
|
569
|
-
}
|
|
570
|
-
interface BinaryStorageReadResult {
|
|
571
|
-
body: ReadableStream<Uint8Array>;
|
|
572
|
-
size?: number;
|
|
573
|
-
}
|
|
574
|
-
interface BinaryStorageStatResult {
|
|
575
|
-
exists: boolean;
|
|
576
|
-
size?: number;
|
|
577
|
-
}
|
|
578
|
-
interface BinaryStorage {
|
|
579
|
-
readonly driverName: string;
|
|
580
|
-
write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;
|
|
581
|
-
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
582
|
-
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
583
|
-
delete(storageKey: string): Promise<void>;
|
|
584
|
-
}
|
|
585
|
-
interface BinaryAttachmentCreateRequest {
|
|
586
|
-
name: string;
|
|
587
|
-
body: BinaryBody;
|
|
588
|
-
mimeType: string;
|
|
589
|
-
filename?: string;
|
|
590
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
591
|
-
}
|
|
592
|
-
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
593
|
-
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
594
|
-
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
595
|
-
}
|
|
596
|
-
interface ExecutionBinaryService {
|
|
597
|
-
forNode(args: {
|
|
598
|
-
nodeId: NodeId;
|
|
599
|
-
activationId: NodeActivationId;
|
|
600
|
-
}): NodeBinaryAttachmentService;
|
|
601
|
-
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
602
|
-
}
|
|
603
|
-
interface ExecutionContext {
|
|
604
|
-
runId: RunId;
|
|
605
|
-
workflowId: WorkflowId;
|
|
606
|
-
parent?: ParentExecutionRef;
|
|
607
|
-
/** This run's subworkflow depth (0 = root). */
|
|
608
|
-
subworkflowDepth: number;
|
|
609
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
610
|
-
engineMaxNodeActivations: number;
|
|
611
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
612
|
-
engineMaxSubworkflowDepth: number;
|
|
613
|
-
now: () => Date;
|
|
614
|
-
data: RunDataSnapshot;
|
|
615
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
616
|
-
binary: ExecutionBinaryService;
|
|
617
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
618
|
-
}
|
|
619
|
-
interface ExecutionContextFactory {
|
|
620
|
-
create(args: {
|
|
621
|
-
runId: RunId;
|
|
622
|
-
workflowId: WorkflowId;
|
|
623
|
-
parent?: ParentExecutionRef;
|
|
624
|
-
subworkflowDepth: number;
|
|
625
|
-
engineMaxNodeActivations: number;
|
|
626
|
-
engineMaxSubworkflowDepth: number;
|
|
627
|
-
data: RunDataSnapshot;
|
|
628
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
629
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
630
|
-
}): ExecutionContext;
|
|
631
|
-
}
|
|
632
|
-
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
633
|
-
nodeId: NodeId;
|
|
634
|
-
activationId: NodeActivationId;
|
|
635
|
-
config: TConfig;
|
|
636
|
-
binary: NodeBinaryAttachmentService;
|
|
637
|
-
}
|
|
638
|
-
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
639
|
-
trigger: TriggerInstanceId;
|
|
640
|
-
config: TConfig;
|
|
641
|
-
previousState: TSetupState$1;
|
|
642
|
-
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
643
|
-
emit(items: Items): Promise<void>;
|
|
644
|
-
}
|
|
645
|
-
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
646
|
-
trigger: TriggerInstanceId;
|
|
647
|
-
nodeId: NodeId;
|
|
648
|
-
config: TConfig;
|
|
649
|
-
previousState: TSetupState$1;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
653
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
654
|
-
* package-level setup code.
|
|
655
|
-
*/
|
|
656
|
-
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
657
|
-
trigger: TriggerInstanceId;
|
|
658
|
-
updatedAt: string;
|
|
659
|
-
state: TState;
|
|
660
|
-
}
|
|
661
|
-
interface TriggerSetupStateRepository {
|
|
662
|
-
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
663
|
-
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
664
|
-
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
665
|
-
}
|
|
666
|
-
interface TriggerCleanupHandle {
|
|
667
|
-
stop(): Promise<void> | void;
|
|
668
|
-
}
|
|
669
|
-
interface EngineHost {
|
|
670
|
-
credentialSessions: CredentialSessionService;
|
|
671
|
-
workflows?: WorkflowRunnerService;
|
|
672
|
-
}
|
|
673
|
-
interface Node<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
674
|
-
kind: "node";
|
|
675
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
676
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
677
|
-
}
|
|
678
|
-
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
679
|
-
kind: "node";
|
|
680
|
-
outputPorts: ReadonlyArray<OutputPortKey>;
|
|
681
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
682
|
-
}
|
|
683
|
-
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
684
|
-
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
685
|
-
kind: "trigger";
|
|
686
|
-
outputPorts: readonly ["main"];
|
|
687
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
688
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
689
|
-
}
|
|
690
|
-
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
691
|
-
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
692
|
-
}
|
|
693
|
-
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
694
|
-
interface NodeExecutionRequest {
|
|
695
|
-
runId: RunId;
|
|
696
|
-
activationId: NodeActivationId;
|
|
697
|
-
workflowId: WorkflowId;
|
|
698
|
-
nodeId: NodeId;
|
|
699
|
-
input: Items;
|
|
700
|
-
parent?: ParentExecutionRef;
|
|
701
|
-
queue?: string;
|
|
702
|
-
executionOptions?: RunExecutionOptions;
|
|
703
|
-
}
|
|
704
|
-
interface NodeExecutionScheduler {
|
|
705
|
-
enqueue(request: NodeExecutionRequest): Promise<{
|
|
706
|
-
receiptId: string;
|
|
707
|
-
}>;
|
|
708
|
-
cancel?(receiptId: string): Promise<void>;
|
|
709
|
-
}
|
|
710
|
-
type NodeActivationRequestBase = Readonly<{
|
|
711
|
-
runId: RunId;
|
|
712
|
-
activationId: NodeActivationId;
|
|
713
|
-
workflowId: WorkflowId;
|
|
714
|
-
nodeId: NodeId;
|
|
715
|
-
parent?: ParentExecutionRef;
|
|
716
|
-
executionOptions?: RunExecutionOptions;
|
|
717
|
-
batchId?: string;
|
|
718
|
-
ctx: NodeExecutionContext;
|
|
719
|
-
}>;
|
|
720
|
-
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
721
|
-
kind: "single";
|
|
722
|
-
input: Items;
|
|
723
|
-
}>) | (NodeActivationRequestBase & Readonly<{
|
|
724
|
-
kind: "multi";
|
|
725
|
-
inputsByPort: NodeInputsByPort;
|
|
726
|
-
}>);
|
|
727
|
-
interface NodeActivationReceipt {
|
|
728
|
-
receiptId: string;
|
|
729
|
-
mode?: "local" | "worker";
|
|
730
|
-
queue?: string;
|
|
731
|
-
}
|
|
732
|
-
interface NodeActivationContinuation {
|
|
733
|
-
markNodeRunning(args: {
|
|
734
|
-
runId: RunId;
|
|
735
|
-
activationId: NodeActivationId;
|
|
736
|
-
nodeId: NodeId;
|
|
737
|
-
inputsByPort: NodeInputsByPort;
|
|
738
|
-
}): Promise<void>;
|
|
739
|
-
resumeFromNodeResult(args: {
|
|
740
|
-
runId: RunId;
|
|
741
|
-
activationId: NodeActivationId;
|
|
742
|
-
nodeId: NodeId;
|
|
743
|
-
outputs: NodeOutputs;
|
|
744
|
-
}): Promise<RunResult>;
|
|
745
|
-
resumeFromNodeError(args: {
|
|
746
|
-
runId: RunId;
|
|
747
|
-
activationId: NodeActivationId;
|
|
748
|
-
nodeId: NodeId;
|
|
749
|
-
error: Error;
|
|
750
|
-
}): Promise<RunResult>;
|
|
751
|
-
}
|
|
752
|
-
interface NodeActivationScheduler {
|
|
753
|
-
setContinuation?(continuation: NodeActivationContinuation): void;
|
|
754
|
-
enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
|
|
755
|
-
notifyPendingStatePersisted?(runId: RunId): void;
|
|
756
|
-
cancel?(receiptId: string): Promise<void>;
|
|
757
|
-
}
|
|
758
|
-
interface WorkflowNodeInstanceFactory {
|
|
759
|
-
createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;
|
|
760
|
-
createByType(type: TypeToken<unknown>): unknown;
|
|
761
|
-
}
|
|
762
|
-
interface NodeExecutor {
|
|
763
|
-
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
764
|
-
}
|
|
765
|
-
interface WorkflowSnapshotFactory {
|
|
766
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
767
|
-
}
|
|
768
|
-
interface WorkflowSnapshotResolver {
|
|
769
|
-
resolve(args: {
|
|
770
|
-
workflowId: WorkflowId;
|
|
771
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
772
|
-
}): WorkflowDefinition | undefined;
|
|
773
|
-
}
|
|
774
|
-
/** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */
|
|
775
|
-
interface TriggerRuntimeDiagnostics {
|
|
776
|
-
info(message: string): void;
|
|
777
|
-
warn(message: string): void;
|
|
778
|
-
}
|
|
779
|
-
interface EngineDeps {
|
|
780
|
-
credentialSessions: CredentialSessionService;
|
|
781
|
-
liveWorkflowRepository: LiveWorkflowRepository;
|
|
782
|
-
workflowRepository: WorkflowRepository;
|
|
783
|
-
/** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
|
|
784
|
-
workflowActivationPolicy: WorkflowActivationPolicy;
|
|
785
|
-
nodeResolver: NodeResolver;
|
|
786
|
-
triggerSetupStateRepository: TriggerSetupStateRepository;
|
|
787
|
-
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
788
|
-
runIdFactory: RunIdFactory;
|
|
789
|
-
activationIdFactory: ActivationIdFactory;
|
|
790
|
-
workflowExecutionRepository: WorkflowExecutionRepository;
|
|
791
|
-
activationScheduler: NodeActivationScheduler;
|
|
792
|
-
runDataFactory: RunDataFactory;
|
|
793
|
-
executionContextFactory: ExecutionContextFactory;
|
|
794
|
-
eventBus?: RunEventBus;
|
|
795
|
-
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
796
|
-
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
797
|
-
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
798
|
-
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
799
|
-
/** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
|
|
800
|
-
triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
|
|
801
|
-
}
|
|
802
|
-
//#endregion
|
|
803
|
-
//#region src/contracts/workflowTypes.d.ts
|
|
804
|
-
type WorkflowId = string;
|
|
805
|
-
type NodeId = string;
|
|
806
|
-
type OutputPortKey = string;
|
|
807
|
-
type InputPortKey = string;
|
|
808
|
-
type PersistedTokenId = string;
|
|
809
|
-
type NodeKind = "trigger" | "node";
|
|
810
|
-
type JsonPrimitive = string | number | boolean | null;
|
|
811
|
-
interface JsonObject {
|
|
812
|
-
readonly [key: string]: JsonValue;
|
|
813
|
-
}
|
|
814
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
815
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
816
|
-
interface Edge {
|
|
817
|
-
from: {
|
|
818
|
-
nodeId: NodeId;
|
|
819
|
-
output: OutputPortKey;
|
|
820
|
-
};
|
|
821
|
-
to: {
|
|
822
|
-
nodeId: NodeId;
|
|
823
|
-
input: InputPortKey;
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
type NodeConnectionName = string;
|
|
827
|
-
/**
|
|
828
|
-
* Named connection from an executable parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
829
|
-
* but are not traversed by the main execution graph.
|
|
830
|
-
*/
|
|
831
|
-
interface WorkflowNodeConnection {
|
|
832
|
-
readonly parentNodeId: NodeId;
|
|
833
|
-
readonly connectionName: NodeConnectionName;
|
|
834
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
835
|
-
}
|
|
836
|
-
interface WorkflowDefinition {
|
|
837
|
-
id: WorkflowId;
|
|
838
|
-
name: string;
|
|
839
|
-
nodes: NodeDefinition[];
|
|
840
|
-
edges: Edge[];
|
|
841
|
-
/**
|
|
842
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
843
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
844
|
-
*/
|
|
845
|
-
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
846
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
847
|
-
discoveryPathSegments?: readonly string[];
|
|
848
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
849
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
850
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
851
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
852
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
853
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
854
|
-
}
|
|
855
|
-
interface WorkflowGraph {
|
|
856
|
-
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
857
|
-
nodeId: NodeId;
|
|
858
|
-
input: InputPortKey;
|
|
859
|
-
}>>;
|
|
860
|
-
}
|
|
861
|
-
interface WorkflowGraphFactory {
|
|
862
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
863
|
-
}
|
|
864
|
-
interface NodeConfigBase {
|
|
865
|
-
readonly kind: NodeKind;
|
|
866
|
-
readonly type: TypeToken<unknown>;
|
|
867
|
-
readonly name?: string;
|
|
868
|
-
readonly id?: NodeId;
|
|
869
|
-
readonly icon?: string;
|
|
870
|
-
readonly execution?: Readonly<{
|
|
871
|
-
hint?: "local" | "worker";
|
|
872
|
-
queue?: string;
|
|
873
|
-
}>;
|
|
874
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
875
|
-
readonly retryPolicy?: RetryPolicySpec;
|
|
876
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
877
|
-
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
878
|
-
/**
|
|
879
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
880
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
881
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
882
|
-
*/
|
|
883
|
-
readonly continueWhenEmptyOutput?: boolean;
|
|
884
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
885
|
-
}
|
|
886
|
-
declare const runnableNodeInputType: unique symbol;
|
|
887
|
-
declare const runnableNodeOutputType: unique symbol;
|
|
888
|
-
declare const triggerNodeOutputType: unique symbol;
|
|
889
|
-
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
890
|
-
readonly kind: "node";
|
|
891
|
-
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
892
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
893
|
-
}
|
|
894
|
-
declare const triggerNodeSetupStateType: unique symbol;
|
|
895
|
-
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
896
|
-
readonly kind: "trigger";
|
|
897
|
-
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
898
|
-
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
899
|
-
}
|
|
900
|
-
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
901
|
-
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
902
|
-
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
903
|
-
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
904
|
-
interface NodeDefinition {
|
|
905
|
-
id: NodeId;
|
|
906
|
-
kind: NodeKind;
|
|
907
|
-
type: TypeToken<unknown>;
|
|
908
|
-
name?: string;
|
|
909
|
-
config: NodeConfigBase;
|
|
910
|
-
}
|
|
911
|
-
interface NodeRef {
|
|
912
|
-
id: NodeId;
|
|
913
|
-
kind: NodeKind;
|
|
914
|
-
name?: string;
|
|
915
|
-
}
|
|
916
|
-
type PairedItemRef = Readonly<{
|
|
917
|
-
nodeId: NodeId;
|
|
918
|
-
output: OutputPortKey;
|
|
919
|
-
itemIndex: number;
|
|
920
|
-
}>;
|
|
921
|
-
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
922
|
-
type BinaryAttachment = Readonly<{
|
|
923
|
-
id: string;
|
|
924
|
-
storageKey: string;
|
|
925
|
-
mimeType: string;
|
|
926
|
-
size: number;
|
|
927
|
-
storageDriver: string;
|
|
928
|
-
previewKind: BinaryPreviewKind;
|
|
929
|
-
createdAt: string;
|
|
930
|
-
runId: RunId;
|
|
931
|
-
workflowId: WorkflowId;
|
|
932
|
-
nodeId: NodeId;
|
|
933
|
-
activationId: NodeActivationId;
|
|
934
|
-
filename?: string;
|
|
935
|
-
sha256?: string;
|
|
936
|
-
}>;
|
|
937
|
-
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
938
|
-
type Item<TJson = unknown> = Readonly<{
|
|
939
|
-
json: TJson;
|
|
940
|
-
binary?: ItemBinary;
|
|
941
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
942
|
-
paired?: ReadonlyArray<PairedItemRef>;
|
|
943
|
-
}>;
|
|
944
|
-
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
945
|
-
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
946
|
-
type RunId = string;
|
|
947
|
-
type NodeActivationId = string;
|
|
948
|
-
interface ParentExecutionRef {
|
|
949
|
-
runId: RunId;
|
|
950
|
-
workflowId: WorkflowId;
|
|
951
|
-
nodeId: NodeId;
|
|
952
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
953
|
-
subworkflowDepth?: number;
|
|
954
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
955
|
-
engineMaxNodeActivations?: number;
|
|
956
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
957
|
-
engineMaxSubworkflowDepth?: number;
|
|
958
|
-
}
|
|
959
|
-
interface RunDataSnapshot {
|
|
960
|
-
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
961
|
-
getOutputItems(nodeId: NodeId, output?: OutputPortKey): Items;
|
|
962
|
-
getOutputItem(nodeId: NodeId, itemIndex: number, output?: OutputPortKey): Item | undefined;
|
|
963
|
-
}
|
|
964
|
-
interface MutableRunData extends RunDataSnapshot {
|
|
965
|
-
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
966
|
-
dump(): Record<NodeId, NodeOutputs>;
|
|
967
|
-
}
|
|
968
|
-
interface RunDataFactory {
|
|
969
|
-
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
970
|
-
}
|
|
971
|
-
interface RunIdFactory {
|
|
972
|
-
makeRunId(): RunId;
|
|
973
|
-
}
|
|
974
|
-
interface ActivationIdFactory {
|
|
975
|
-
makeActivationId(): NodeActivationId;
|
|
976
|
-
}
|
|
977
|
-
type UpstreamRefPlaceholder = `$${number}`;
|
|
978
|
-
declare const branchRef: (index: number) => UpstreamRefPlaceholder;
|
|
979
|
-
type ExecutionMode = "local" | "worker";
|
|
980
|
-
interface NodeSchedulerDecision {
|
|
981
|
-
mode: ExecutionMode;
|
|
982
|
-
queue?: string;
|
|
983
|
-
}
|
|
984
|
-
interface NodeOffloadPolicy {
|
|
985
|
-
decide(args: {
|
|
986
|
-
workflowId: WorkflowId;
|
|
987
|
-
nodeId: NodeId;
|
|
988
|
-
config: NodeConfigBase;
|
|
989
|
-
}): NodeSchedulerDecision;
|
|
990
|
-
}
|
|
991
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
992
|
-
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
993
|
-
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
994
|
-
interface WorkflowStoragePolicyResolver {
|
|
995
|
-
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
996
|
-
}
|
|
997
|
-
interface WorkflowStoragePolicyDecisionArgs {
|
|
998
|
-
readonly runId: RunId;
|
|
999
|
-
readonly workflowId: WorkflowId;
|
|
1000
|
-
readonly workflow: WorkflowDefinition;
|
|
1001
|
-
readonly finalStatus: "completed" | "failed";
|
|
1002
|
-
readonly startedAt: string;
|
|
1003
|
-
readonly finishedAt: string;
|
|
1004
|
-
}
|
|
1005
|
-
interface WorkflowPrunePolicySpec {
|
|
1006
|
-
readonly runDataRetentionSeconds?: number;
|
|
1007
|
-
readonly binaryRetentionSeconds?: number;
|
|
1008
|
-
}
|
|
1009
|
-
interface PersistedRunPolicySnapshot {
|
|
1010
|
-
readonly retentionSeconds?: number;
|
|
1011
|
-
readonly binaryRetentionSeconds?: number;
|
|
1012
|
-
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
1013
|
-
}
|
|
1014
|
-
interface WorkflowErrorHandler {
|
|
1015
|
-
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
1016
|
-
}
|
|
1017
|
-
interface WorkflowErrorContext {
|
|
1018
|
-
readonly runId: RunId;
|
|
1019
|
-
readonly workflowId: WorkflowId;
|
|
1020
|
-
readonly workflow: WorkflowDefinition;
|
|
1021
|
-
readonly failedNodeId: NodeId;
|
|
1022
|
-
readonly error: Error;
|
|
1023
|
-
readonly startedAt: string;
|
|
1024
|
-
readonly finishedAt: string;
|
|
1025
|
-
}
|
|
1026
|
-
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
1027
|
-
interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
1028
|
-
readonly kind: "single" | "multi";
|
|
1029
|
-
readonly items: Items;
|
|
1030
|
-
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
1031
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
1032
|
-
readonly error: Error;
|
|
1033
|
-
}
|
|
1034
|
-
interface NodeErrorHandler {
|
|
1035
|
-
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
1036
|
-
}
|
|
1037
|
-
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
1038
|
-
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
1039
|
-
interface WorkflowPolicyRuntimeDefaults {
|
|
1040
|
-
readonly retentionSeconds?: number;
|
|
1041
|
-
readonly binaryRetentionSeconds?: number;
|
|
1042
|
-
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
1043
|
-
}
|
|
1044
|
-
//#endregion
|
|
1045
|
-
//#region src/contracts/credentialTypes.d.ts
|
|
1046
|
-
type CredentialTypeId = string;
|
|
1047
|
-
type CredentialInstanceId = string;
|
|
1048
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
1049
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
1050
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
1051
|
-
type CredentialFieldSchema = Readonly<{
|
|
1052
|
-
key: string;
|
|
1053
|
-
label: string;
|
|
1054
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
1055
|
-
required?: true;
|
|
1056
|
-
order?: number;
|
|
1057
|
-
placeholder?: string;
|
|
1058
|
-
helpText?: string;
|
|
1059
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
1060
|
-
envVarName?: string;
|
|
1061
|
-
/**
|
|
1062
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
1063
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
1064
|
-
*/
|
|
1065
|
-
copyValue?: string;
|
|
1066
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
1067
|
-
copyButtonLabel?: string;
|
|
1068
|
-
}>;
|
|
1069
|
-
type CredentialRequirement = Readonly<{
|
|
1070
|
-
slotKey: string;
|
|
1071
|
-
label: string;
|
|
1072
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1073
|
-
optional?: true;
|
|
1074
|
-
helpText?: string;
|
|
1075
|
-
helpUrl?: string;
|
|
1076
|
-
}>;
|
|
1077
|
-
type CredentialBindingKey = Readonly<{
|
|
1078
|
-
workflowId: WorkflowId;
|
|
1079
|
-
nodeId: NodeId;
|
|
1080
|
-
slotKey: string;
|
|
1081
|
-
}>;
|
|
1082
|
-
type CredentialBinding = Readonly<{
|
|
1083
|
-
key: CredentialBindingKey;
|
|
1084
|
-
instanceId: CredentialInstanceId;
|
|
1085
|
-
updatedAt: string;
|
|
1086
|
-
}>;
|
|
1087
|
-
type CredentialHealth = Readonly<{
|
|
1088
|
-
status: CredentialHealthStatus;
|
|
1089
|
-
message?: string;
|
|
1090
|
-
testedAt?: string;
|
|
1091
|
-
expiresAt?: string;
|
|
1092
|
-
details?: Readonly<Record<string, unknown>>;
|
|
1093
|
-
}>;
|
|
1094
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
1095
|
-
authorizeUrlFieldKey: string;
|
|
1096
|
-
tokenUrlFieldKey: string;
|
|
1097
|
-
userInfoUrlFieldKey?: string;
|
|
1098
|
-
}>;
|
|
1099
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
1100
|
-
kind: "oauth2";
|
|
1101
|
-
providerId: string;
|
|
1102
|
-
scopes: ReadonlyArray<string>;
|
|
1103
|
-
clientIdFieldKey?: string;
|
|
1104
|
-
clientSecretFieldKey?: string;
|
|
1105
|
-
} | {
|
|
1106
|
-
kind: "oauth2";
|
|
1107
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
1108
|
-
scopes: ReadonlyArray<string>;
|
|
1109
|
-
clientIdFieldKey?: string;
|
|
1110
|
-
clientSecretFieldKey?: string;
|
|
1111
|
-
}>;
|
|
1112
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
1113
|
-
type CredentialTypeDefinition = Readonly<{
|
|
1114
|
-
typeId: CredentialTypeId;
|
|
1115
|
-
displayName: string;
|
|
1116
|
-
description?: string;
|
|
1117
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1118
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
1119
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
1120
|
-
auth?: CredentialAuthDefinition;
|
|
1121
|
-
}>;
|
|
1122
|
-
/**
|
|
1123
|
-
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
1124
|
-
*/
|
|
1125
|
-
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
1126
|
-
/**
|
|
1127
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
1128
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
1129
|
-
* assignable here for session/test callbacks.
|
|
1130
|
-
*/
|
|
1131
|
-
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
1132
|
-
instanceId: CredentialInstanceId;
|
|
1133
|
-
typeId: CredentialTypeId;
|
|
1134
|
-
displayName: string;
|
|
1135
|
-
sourceKind: CredentialMaterialSourceKind;
|
|
1136
|
-
publicConfig: TPublicConfig;
|
|
1137
|
-
secretRef: CredentialJsonRecord;
|
|
1138
|
-
tags: ReadonlyArray<string>;
|
|
1139
|
-
setupStatus: CredentialSetupStatus;
|
|
1140
|
-
createdAt: string;
|
|
1141
|
-
updatedAt: string;
|
|
1142
|
-
}>;
|
|
1143
|
-
/**
|
|
1144
|
-
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
1145
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
1146
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
1147
|
-
*/
|
|
1148
|
-
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
1149
|
-
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
1150
|
-
material: TMaterial;
|
|
1151
|
-
publicConfig: TPublicConfig;
|
|
1152
|
-
}>;
|
|
1153
|
-
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
1154
|
-
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
1155
|
-
/**
|
|
1156
|
-
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
1157
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
1158
|
-
*/
|
|
1159
|
-
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
1160
|
-
definition: CredentialTypeDefinition;
|
|
1161
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
1162
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
1163
|
-
}>;
|
|
1164
|
-
/**
|
|
1165
|
-
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
1166
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
1167
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
1168
|
-
*/
|
|
1169
|
-
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
1170
|
-
interface CredentialSessionService {
|
|
1171
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
1172
|
-
workflowId: WorkflowId;
|
|
1173
|
-
nodeId: NodeId;
|
|
1174
|
-
slotKey: string;
|
|
1175
|
-
}>): Promise<TSession>;
|
|
1176
|
-
}
|
|
1177
|
-
interface CredentialTypeRegistry {
|
|
1178
|
-
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
1179
|
-
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
1180
|
-
}
|
|
1181
|
-
declare class CredentialUnboundError extends Error {
|
|
1182
|
-
readonly bindingKey: CredentialBindingKey;
|
|
1183
|
-
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
1184
|
-
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
1185
|
-
private static createMessage;
|
|
1186
|
-
}
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/contracts/runFinishedAtFactory.d.ts
|
|
1189
|
-
type RunFinishedAtSource = Pick<PersistedRunState, "status" | "nodeSnapshotsByNodeId">;
|
|
1190
|
-
/** Derives workflow end time from node snapshots for run listings. */
|
|
1191
|
-
declare class RunFinishedAtFactory {
|
|
1192
|
-
static resolveIso(state: RunFinishedAtSource): string | undefined;
|
|
1193
|
-
}
|
|
1194
|
-
//#endregion
|
|
1195
|
-
//#region src/workflow/dsl/workflowBuilderTypes.d.ts
|
|
1196
|
-
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
|
|
1197
|
-
type AnyTriggerNodeConfig = TriggerNodeConfig<any>;
|
|
1198
|
-
type ValidStepSequence<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? readonly [TFirst, ...ValidStepSequence<TNextJson, TRest>] : never : never : TSteps;
|
|
1199
|
-
type StepSequenceOutput<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig<TCurrentJson, infer TNextJson> ? TRest extends ReadonlyArray<AnyRunnableNodeConfig> ? StepSequenceOutput<TNextJson, TRest> : never : never : TCurrentJson : TCurrentJson;
|
|
1200
|
-
type TypesMatch<TLeft, TRight> = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false;
|
|
1201
|
-
type BranchOutputGuard<TCurrentJson, TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined> = TypesMatch<StepSequenceOutput<TCurrentJson, TTrueSteps>, StepSequenceOutput<TCurrentJson, TFalseSteps>> extends true ? unknown : never;
|
|
1202
|
-
type BranchStepsArg<TCurrentJson, TSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TSteps & ValidStepSequence<TCurrentJson, TSteps>;
|
|
1203
|
-
type BranchMoreArgs<TCurrentJson, TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>> = TRestSteps & ValidStepSequence<RunnableNodeOutputJson<TFirstStep>, TRestSteps>;
|
|
1204
|
-
type BooleanWhenOverloads<TCurrentJson, TReturn> = {
|
|
1205
|
-
<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, steps: BranchStepsArg<TCurrentJson, TSteps>): TReturn;
|
|
1206
|
-
<TFirstStep extends RunnableNodeConfig<TCurrentJson, any>, TRestSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs<TCurrentJson, TFirstStep, TRestSteps>): TReturn;
|
|
1207
|
-
};
|
|
1208
|
-
//#endregion
|
|
1209
|
-
//#region src/workflow/dsl/WhenBuilder.d.ts
|
|
1210
|
-
declare class WhenBuilder<TCurrentJson> {
|
|
1211
|
-
private readonly wf;
|
|
1212
|
-
private readonly from;
|
|
1213
|
-
private readonly branchPort;
|
|
1214
|
-
constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey);
|
|
1215
|
-
addBranch<TSteps extends ReadonlyArray<AnyRunnableNodeConfig>>(steps: TSteps & ValidStepSequence<TCurrentJson, TSteps>): this;
|
|
1216
|
-
readonly when: BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>>;
|
|
1217
|
-
build(): WorkflowDefinition;
|
|
1218
|
-
}
|
|
1219
|
-
//#endregion
|
|
1220
|
-
//#region src/workflow/dsl/ChainCursorResolver.d.ts
|
|
1221
|
-
type ChainCursorWhenOverloads<TCurrentJson> = BooleanWhenOverloads<TCurrentJson, WhenBuilder<TCurrentJson>> & {
|
|
1222
|
-
<TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined, TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> | undefined>(branches: Readonly<{
|
|
1223
|
-
true?: TTrueSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TTrueSteps> : never;
|
|
1224
|
-
false?: TFalseSteps extends ReadonlyArray<AnyRunnableNodeConfig> ? BranchStepsArg<TCurrentJson, TFalseSteps> : never;
|
|
1225
|
-
}> & BranchOutputGuard<TCurrentJson, TTrueSteps, TFalseSteps>): ChainCursor<StepSequenceOutput<TCurrentJson, TTrueSteps>>;
|
|
1226
|
-
};
|
|
1227
|
-
declare class ChainCursor<TCurrentJson> {
|
|
1228
|
-
private readonly wf;
|
|
1229
|
-
private readonly cursor;
|
|
1230
|
-
private readonly cursorOutput;
|
|
1231
|
-
constructor(wf: WorkflowBuilder, cursor: NodeRef, cursorOutput: OutputPortKey);
|
|
1232
|
-
then<TConfig extends RunnableNodeConfig<TCurrentJson, any>>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1233
|
-
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
1234
|
-
build(): WorkflowDefinition;
|
|
1235
|
-
}
|
|
1236
|
-
//#endregion
|
|
1237
|
-
//#region src/workflow/dsl/WorkflowBuilder.d.ts
|
|
1238
|
-
declare class WorkflowBuilder {
|
|
1239
|
-
private readonly meta;
|
|
1240
|
-
private readonly options?;
|
|
1241
|
-
private readonly nodes;
|
|
1242
|
-
private readonly edges;
|
|
1243
|
-
private seq;
|
|
1244
|
-
constructor(meta: {
|
|
1245
|
-
id: WorkflowId;
|
|
1246
|
-
name: string;
|
|
1247
|
-
}, options?: Readonly<{
|
|
1248
|
-
makeMergeNode?: (name: string) => AnyRunnableNodeConfig;
|
|
1249
|
-
}> | undefined);
|
|
1250
|
-
private add;
|
|
1251
|
-
private connect;
|
|
1252
|
-
trigger<TConfig extends AnyTriggerNodeConfig>(config: TConfig): ChainCursor<TriggerNodeOutputJson<TConfig>>;
|
|
1253
|
-
start<TConfig extends AnyRunnableNodeConfig>(config: TConfig): ChainCursor<RunnableNodeOutputJson<TConfig>>;
|
|
1254
|
-
build(): WorkflowDefinition;
|
|
1255
|
-
}
|
|
1256
|
-
//#endregion
|
|
1257
|
-
//#region src/workflow/definition/ConnectionInvocationIdFactory.d.ts
|
|
1258
|
-
/**
|
|
1259
|
-
* Unique ids for persisted connection invocation history rows (LLM/tool calls under an owning node).
|
|
1260
|
-
*/
|
|
1261
|
-
declare class ConnectionInvocationIdFactory {
|
|
1262
|
-
static create(): string;
|
|
1263
|
-
/** Deterministic id for tests when a stable sequence is needed. */
|
|
1264
|
-
static createForTest(runId: string, connectionNodeId: NodeId, sequence: number): string;
|
|
1265
|
-
}
|
|
1266
|
-
//#endregion
|
|
1267
|
-
//#region src/workflow/definition/ConnectionNodeIdFactory.d.ts
|
|
1268
|
-
/**
|
|
1269
|
-
* Deterministic ids for workflow connection-owned child nodes (LLM slot, tools, etc.).
|
|
1270
|
-
* These are stable across loads.
|
|
1271
|
-
*/
|
|
1272
|
-
declare class ConnectionNodeIdFactory {
|
|
1273
|
-
static readonly connectionSegment: "__conn__";
|
|
1274
|
-
static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId;
|
|
1275
|
-
static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId;
|
|
1276
|
-
static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean;
|
|
1277
|
-
static isToolConnectionNodeId(nodeId: NodeId): boolean;
|
|
1278
|
-
/** True when `nodeId` is a connection-owned child of `parentNodeId` (LLM or tool slot). */
|
|
1279
|
-
static isConnectionOwnedDescendantOf(parentNodeId: NodeId, nodeId: NodeId): boolean;
|
|
1280
|
-
/** Normalizes a tool display name to a stable id segment. */
|
|
1281
|
-
static normalizeToolName(toolName: string): string;
|
|
1282
|
-
}
|
|
1283
|
-
//#endregion
|
|
1284
|
-
//#region src/workflow/definition/WorkflowExecutableNodeClassifier.d.ts
|
|
1285
|
-
/**
|
|
1286
|
-
* Derives which workflow nodes participate in the main execution graph vs connection-only children.
|
|
1287
|
-
*/
|
|
1288
|
-
declare class WorkflowExecutableNodeClassifier {
|
|
1289
|
-
private readonly connectionOwnedIds;
|
|
1290
|
-
constructor(workflow: WorkflowDefinition);
|
|
1291
|
-
isConnectionOwnedNodeId(nodeId: NodeId): boolean;
|
|
1292
|
-
isExecutableNodeId(nodeId: NodeId): boolean;
|
|
1293
|
-
filterExecutableNodeDefinitions(nodes: ReadonlyArray<NodeDefinition>): ReadonlyArray<NodeDefinition>;
|
|
1294
|
-
private collectConnectionOwnedIds;
|
|
1295
|
-
/**
|
|
1296
|
-
* Resolves the default start node: first trigger, else first executable node with no incoming edges from executable nodes.
|
|
1297
|
-
*/
|
|
1298
|
-
findDefaultExecutableStartNodeId(workflow: WorkflowDefinition): NodeId;
|
|
1299
|
-
firstExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId | undefined;
|
|
1300
|
-
lastExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId;
|
|
1301
|
-
}
|
|
1302
|
-
//#endregion
|
|
1303
|
-
//#region src/workflow/definition/WorkflowExecutableNodeClassifierFactory.d.ts
|
|
1304
|
-
declare function createWorkflowExecutableNodeClassifier(workflow: WorkflowDefinition): WorkflowExecutableNodeClassifier;
|
|
1305
|
-
//#endregion
|
|
1306
|
-
//#region src/workflow/graph/DefaultWorkflowGraphFactory.d.ts
|
|
1307
|
-
declare class DefaultWorkflowGraphFactory implements WorkflowGraphFactory {
|
|
1308
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
1309
|
-
}
|
|
1310
|
-
//#endregion
|
|
1311
|
-
//#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
|
|
1312
|
-
declare class WorkflowSnapshotCodec {
|
|
1313
|
-
private readonly tokenRegistry;
|
|
1314
|
-
constructor(tokenRegistry: PersistedWorkflowTokenRegistryLike);
|
|
1315
|
-
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
1316
|
-
hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
|
|
1317
|
-
private serializeConfig;
|
|
1318
|
-
private injectTokenIds;
|
|
1319
|
-
private mergeValue;
|
|
1320
|
-
private mergeNestedValue;
|
|
1321
|
-
private restoreNonSerializableProperties;
|
|
1322
|
-
private restoreTypeProperty;
|
|
1323
|
-
private resolveTokenId;
|
|
1324
|
-
private resolveTokenName;
|
|
1325
|
-
private asTypeToken;
|
|
1326
|
-
private asRecord;
|
|
1327
|
-
}
|
|
1328
|
-
//#endregion
|
|
1329
|
-
//#region src/runtime/InMemoryLiveWorkflowRepository.d.ts
|
|
1330
|
-
declare class InMemoryLiveWorkflowRepository implements LiveWorkflowRepository {
|
|
1331
|
-
private readonly workflowsById;
|
|
1332
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
1333
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
1334
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
1335
|
-
}
|
|
1336
|
-
//#endregion
|
|
1337
|
-
export { JsonArray as $, CurrentStateExecutionRequest as $n, RunEventSubscription as $r, BinaryBody as $t, CredentialJsonRecord as A, TriggerRuntimeDiagnostics as An, Container as Ar, TriggerNodeOutputJson as At, CredentialTypeId as B, WorkflowSnapshotResolver as Bn, injectAll as Br, WorkflowNodeConnection as Bt, CredentialBindingKey as C, NodeExecutionStatePublisher as Cn, RunStatus as Cr, RunDataSnapshot as Ct, CredentialHealthTester as D, TestableTriggerNode as Dn, WorkflowExecutionListingRepository as Dr, RunnableNodeInputJson as Dt, CredentialHealthStatus as E, PersistedTriggerSetupState as En, WebhookRunResult as Er, RunnableNodeConfig as Et, CredentialSessionFactoryArgs as F, WorkflowNodeInstanceFactory as Fn, RegistrationOptions as Fr, WorkflowErrorHandler as Ft, BinaryAttachment as G, WebhookTriggerMatcher as Gn, registry as Gr, WorkflowStoragePolicyResolver as Gt, CredentialUnboundError as H, TriggerInstanceId as Hn, instanceCachingFactory as Hr, WorkflowPrunePolicySpec as Ht, CredentialSessionService as I, WorkflowRepository as In, TypeToken as Ir, WorkflowErrorHandlerSpec as It, ExecutionMode as J, AllWorkflowsActiveWorkflowActivationPolicy as Jn, ENGINE_EXECUTION_LIMITS_DEFAULTS as Jr, runnableNodeInputType as Jt, BinaryPreviewKind as K, WebhookTriggerResolution as Kn, singleton as Kr, WorkflowStoragePolicySpec as Kt, CredentialSetupStatus as L, WorkflowRunnerResolver as Ln, container as Lr, WorkflowGraph as Lt, CredentialOAuth2AuthDefinition as M, TriggerSetupStateFor as Mn, Disposable as Mr, UpstreamRefPlaceholder as Mt, CredentialRequirement as N, TriggerSetupStateRepository as Nn, InjectionToken as Nr, WorkflowDefinition as Nt, CredentialInstanceId as O, TriggerCleanupHandle as On, WorkflowExecutionPruneRepository as Or, RunnableNodeOutputJson as Ot, CredentialSessionFactory as P, TriggerTestItemsContext as Pn, Lifecycle as Pr, WorkflowErrorContext as Pt, Items as Q, ConnectionInvocationRecord as Qn, RunEventBus as Qr, BinaryAttachmentCreateRequest as Qt, CredentialType as R, WorkflowRunnerService as Rn, delay as Rr, WorkflowGraphFactory as Rt, CredentialBinding as S, NodeExecutionScheduler as Sn, RunStateResetRequest as Sr, RunDataFactory as St, CredentialHealth as T, NodeResolver as Tn, RunSummary as Tr, RunIdFactory as Tt, OAuth2ProviderFromPublicConfig as U, WebhookControlSignal as Un, instancePerContainerCachingFactory as Ur, WorkflowStoragePolicyDecisionArgs as Ut, CredentialTypeRegistry as V, HttpMethod as Vn, injectable as Vr, WorkflowPolicyRuntimeDefaults as Vt, ActivationIdFactory as W, WebhookInvocationMatch as Wn, predicateAwareClassFactory as Wr, WorkflowStoragePolicyMode as Wt, Item as X, ConnectionInvocationAppendArgs as Xn, EngineExecutionLimitsPolicyConfig as Xr, triggerNodeOutputType as Xt, InputPortKey as Y, WorkflowActivationPolicy as Yn, EngineExecutionLimitsPolicy as Yr, runnableNodeOutputType as Yt, ItemBinary as Z, ConnectionInvocationId as Zn, RunEvent as Zr, triggerNodeSetupStateType as Zt, StepSequenceOutput as _, NodeActivationRequestBase as _n, RunEventPublisherDeps as _r, OutputPortKey as _t, WorkflowExecutableNodeClassifier as a, NoneRetryPolicySpec as ai, EngineDeps as an, NodeInputsByPort as ar, NodeConfigBase as at, AnyCredentialType as b, NodeExecutionContext as bn, RunQueueEntry as br, PersistedRunPolicySnapshot as bt, WorkflowBuilder as c, ExecutionBinaryService as cn, PersistedMutableRunState as cr, NodeErrorHandler as ct, AnyRunnableNodeConfig as d, LiveWorkflowRepository as dn, PersistedWorkflowSnapshot as dr, NodeId as dt, ExpRetryPolicy as ei, BinaryStorage as en, EngineRunCounters as er, JsonObject as et, AnyTriggerNodeConfig as f, MultiInputNode as fn, PersistedWorkflowSnapshotNode as fr, NodeKind as ft, BranchStepsArg as g, NodeActivationRequest as gn, RunCurrentState as gr, NodeSchedulerDecision as gt, BranchOutputGuard as h, NodeActivationReceipt as hn, RunCompletionNotifier as hr, NodeRef as ht, createWorkflowExecutableNodeClassifier as i, FixedRetryPolicySpec as ii, BinaryStorageWriteResult as in, NodeExecutionStatus as ir, NodeActivationId as it, CredentialMaterialSourceKind as j, TriggerSetupContext as jn, DependencyContainer as jr, TriggerNodeSetupState as jt, CredentialInstanceRecord as k, TriggerNode as kn, WorkflowExecutionRepository as kr, TriggerNodeConfig as kt, ChainCursor as l, ExecutionContext as ln, PersistedRunControlState as lr, NodeErrorHandlerArgs as lt, BranchMoreArgs as m, NodeActivationContinuation as mn, PinnedNodeOutputsByPort as mr, NodeOutputs as mt, WorkflowSnapshotCodec as n, NoRetryPolicy as ni, BinaryStorageStatResult as nn, NodeExecutionError as nr, JsonValue as nt, ConnectionNodeIdFactory as o, RetryPolicySpec as oi, EngineHost as on, PendingNodeExecution as or, NodeConnectionName as ot, BooleanWhenOverloads as p, Node as pn, PersistedWorkflowTokenRegistryLike as pr, NodeOffloadPolicy as pt, Edge as q, WebhookTriggerRoutingDiagnostics as qn, CoreTokens as qr, branchRef as qt, DefaultWorkflowGraphFactory as r, ExponentialRetryPolicySpec as ri, BinaryStorageWriteRequest as rn, NodeExecutionSnapshot as rr, MutableRunData as rt, ConnectionInvocationIdFactory as s, ExecutableTriggerNode as sn, PersistedMutableNodeState as sr, NodeDefinition as st, InMemoryLiveWorkflowRepository as t, RetryPolicy as ti, BinaryStorageReadResult as tn, ExecutionFrontierPlan as tr, JsonPrimitive as tt, WhenBuilder as u, ExecutionContextFactory as un, PersistedRunState as ur, NodeErrorHandlerSpec as ut, ValidStepSequence as v, NodeActivationScheduler as vn, RunExecutionOptions as vr, PairedItemRef as vt, CredentialFieldSchema as w, NodeExecutor as wn, RunStopCondition as wr, RunId as wt, CredentialAuthDefinition as x, NodeExecutionRequest as xn, RunResult as xr, PersistedTokenId as xt, RunFinishedAtFactory as y, NodeBinaryAttachmentService as yn, RunPruneCandidate as yr, ParentExecutionRef as yt, CredentialTypeDefinition as z, WorkflowSnapshotFactory as zn, inject as zr, WorkflowId as zt };
|
|
1338
|
-
//# sourceMappingURL=InMemoryLiveWorkflowRepository-xr7b4kvi.d.ts.map
|