@codemation/core 0.10.2 → 0.11.0
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/CHANGELOG.md +173 -0
- package/dist/{EngineRuntimeRegistration.types-ClLuY1FG.d.ts → EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts} +2 -2
- package/dist/{EngineRuntimeRegistration.types-BryWi2mA.d.cts → EngineRuntimeRegistration.types-MPYWsEM0.d.cts} +7 -2
- package/dist/{InMemoryRunDataFactory-DeXNJt1O.d.cts → InMemoryRunDataFactory-hmkh0lzR.d.cts} +8 -3
- package/dist/{RunIntentService-CI-F8qQ7.d.ts → RunIntentService-BrEq6Jm6.d.ts} +1536 -1358
- package/dist/{RunIntentService-BqNjrksF.d.cts → RunIntentService-MUHJ1bhO.d.cts} +1713 -1603
- package/dist/bootstrap/index.cjs +2 -2
- package/dist/bootstrap/index.d.cts +6 -3
- package/dist/bootstrap/index.d.ts +4 -3
- package/dist/bootstrap/index.js +2 -2
- package/dist/{bootstrap-BfFKGzyj.js → bootstrap-Dgzsjoj7.js} +7 -2
- package/dist/bootstrap-Dgzsjoj7.js.map +1 -0
- package/dist/{bootstrap-DtjQtuvi.cjs → bootstrap-dVmpU1ju.cjs} +7 -2
- package/dist/bootstrap-dVmpU1ju.cjs.map +1 -0
- package/dist/{index-CJQtTY_M.d.ts → index-Bes88mxT.d.ts} +113 -6
- package/dist/index.cjs +71 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +69 -4
- package/dist/index.js.map +1 -1
- package/dist/{runtime-DbMjpb5d.js → runtime-Duf3ClPw.js} +184 -50
- package/dist/runtime-Duf3ClPw.js.map +1 -0
- package/dist/{runtime-_ywksLa6.cjs → runtime-vH0EeZzH.cjs} +190 -50
- package/dist/runtime-vH0EeZzH.cjs.map +1 -0
- package/dist/testing.cjs +2 -2
- package/dist/testing.d.cts +3 -3
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -2
- package/package.json +4 -13
- package/src/ai/AgentConnectionNodeCollector.ts +47 -5
- package/src/authoring/defineNode.types.ts +21 -1
- package/src/authoring/definePollingTrigger.types.ts +20 -0
- package/src/binaries/UnavailableBinaryStorage.ts +6 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +9 -0
- package/src/browser.ts +1 -0
- package/src/contracts/AgentBindError.ts +11 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +4 -0
- package/src/contracts/NoOpAgentMcpIntegration.ts +13 -0
- package/src/contracts/agentMcpTypes.ts +64 -0
- package/src/contracts/index.ts +4 -0
- package/src/contracts/mcpTypes.ts +29 -0
- package/src/contracts/runTypes.ts +8 -0
- package/src/contracts/runtimeTypes.ts +4 -0
- package/src/contracts/workflowTypes.ts +21 -0
- package/src/contracts.ts +3 -0
- package/src/credentials/OAuthFlowExecutor.types.ts +45 -0
- package/src/di/CoreTokens.ts +7 -0
- package/src/execution/InProcessRetryRunner.ts +31 -5
- package/src/execution/NodeExecutor.ts +27 -7
- package/src/execution/NodeRunStateWriter.ts +2 -0
- package/src/index.ts +10 -0
- package/src/orchestration/RunContinuationService.ts +6 -2
- package/src/runStorage/InMemoryBinaryStorageRegistry.ts +10 -0
- package/src/scheduler/InlineDrivingScheduler.ts +26 -22
- package/src/types/index.ts +1 -0
- package/src/validation/WorkflowEdgePortError.types.ts +16 -0
- package/src/validation/WorkflowEdgePortValidator.ts +52 -0
- package/src/workflow/definition/ConnectionInvocationIdFactory.ts +4 -3
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +25 -0
- package/src/workflow/definition/NodeIterationIdFactory.ts +5 -3
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +42 -10
- package/dist/bootstrap-BfFKGzyj.js.map +0 -1
- package/dist/bootstrap-DtjQtuvi.cjs.map +0 -1
- package/dist/runtime-DbMjpb5d.js.map +0 -1
- package/dist/runtime-_ywksLa6.cjs.map +0 -1
|
@@ -16,789 +16,227 @@ type InputPortKey = string;
|
|
|
16
16
|
type PersistedTokenId = string;
|
|
17
17
|
type NodeConnectionName = string;
|
|
18
18
|
//#endregion
|
|
19
|
-
//#region src/
|
|
19
|
+
//#region src/triggers/polling/PollingTriggerDedupWindow.d.ts
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Merges processed-ID windows for polling triggers, capping the total to avoid unbounded growth.
|
|
22
|
+
* Plugin code receives an instance of this class via {@link PollingTriggerHandle.dedup}.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
declare class PollingTriggerDedupWindow {
|
|
25
|
+
static readonly defaultCapN = 2000;
|
|
26
|
+
merge(previous: ReadonlyArray<string>, incoming: ReadonlyArray<string>, capN?: number): ReadonlyArray<string>;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/triggers/polling/PollingTriggerLogger.d.ts
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
27
|
-
* {@link
|
|
28
|
-
*
|
|
29
|
-
* the orchestrator pulls from the iterable they return and dispatches one run per item.
|
|
31
|
+
* Minimal logger surface for the polling-trigger runtime.
|
|
32
|
+
* Hosts supply this via {@link EngineDeps.pollingTriggerLogger};
|
|
33
|
+
* when absent the runtime is silent.
|
|
30
34
|
*/
|
|
31
|
-
interface
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
interface PollingTriggerLogger {
|
|
36
|
+
info(message: string): void;
|
|
37
|
+
warn(message: string): void;
|
|
38
|
+
error(message: string, exception?: Error): void;
|
|
39
|
+
debug(message: string): void;
|
|
40
|
+
}
|
|
41
|
+
declare class NoOpPollingTriggerLogger implements PollingTriggerLogger {
|
|
42
|
+
info(): void;
|
|
43
|
+
warn(): void;
|
|
44
|
+
error(): void;
|
|
45
|
+
debug(): void;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/contracts/credentialTypes.d.ts
|
|
49
|
+
type CredentialTypeId = string;
|
|
50
|
+
type CredentialInstanceId = string;
|
|
51
|
+
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
52
|
+
type CredentialSetupStatus = "draft" | "ready";
|
|
53
|
+
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
54
|
+
type CredentialFieldSchema = Readonly<{
|
|
55
|
+
key: string;
|
|
56
|
+
label: string;
|
|
57
|
+
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
58
|
+
required?: true;
|
|
59
|
+
order?: number;
|
|
36
60
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
61
|
+
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
62
|
+
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
63
|
+
* Defaults to `"default"` when omitted.
|
|
40
64
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
|
|
47
|
-
* becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
|
|
48
|
-
* → 10 runs marked under the same TestSuiteRun.
|
|
49
|
-
*
|
|
50
|
-
* The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
|
|
51
|
-
* any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
|
|
52
|
-
*/
|
|
53
|
-
interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConfig<TOutputJson$1, undefined> {
|
|
54
|
-
readonly triggerKind: "test";
|
|
65
|
+
visibility?: "default" | "advanced";
|
|
66
|
+
placeholder?: string;
|
|
67
|
+
helpText?: string;
|
|
68
|
+
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
69
|
+
envVarName?: string;
|
|
55
70
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
|
|
71
|
+
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
72
|
+
* pattern or documentation URL). Do not use for secret values.
|
|
59
73
|
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
|
|
74
|
+
copyValue?: string;
|
|
75
|
+
/** Accessible label for the copy control (default: Copy). */
|
|
76
|
+
copyButtonLabel?: string;
|
|
77
|
+
}>;
|
|
78
|
+
type CredentialRequirement = Readonly<{
|
|
79
|
+
slotKey: string;
|
|
80
|
+
label: string;
|
|
81
|
+
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
82
|
+
optional?: true;
|
|
83
|
+
helpText?: string;
|
|
84
|
+
helpUrl?: string;
|
|
85
|
+
}>;
|
|
86
|
+
type CredentialBindingKey = Readonly<{
|
|
87
|
+
workflowId: WorkflowId;
|
|
88
|
+
nodeId: NodeId;
|
|
89
|
+
slotKey: string;
|
|
90
|
+
}>;
|
|
91
|
+
type CredentialBinding = Readonly<{
|
|
92
|
+
key: CredentialBindingKey;
|
|
93
|
+
instanceId: CredentialInstanceId;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
}>;
|
|
96
|
+
type CredentialHealth = Readonly<{
|
|
97
|
+
status: CredentialHealthStatus;
|
|
98
|
+
message?: string;
|
|
99
|
+
testedAt?: string;
|
|
100
|
+
expiresAt?: string;
|
|
101
|
+
details?: Readonly<Record<string, unknown>>;
|
|
102
|
+
}>;
|
|
103
|
+
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
104
|
+
authorizeUrlFieldKey: string;
|
|
105
|
+
tokenUrlFieldKey: string;
|
|
106
|
+
userInfoUrlFieldKey?: string;
|
|
107
|
+
}>;
|
|
108
|
+
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
109
|
+
presetFieldKey: string;
|
|
110
|
+
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
111
|
+
customPresetKey?: string;
|
|
112
|
+
customScopesFieldKey?: string;
|
|
113
|
+
}>;
|
|
114
|
+
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
115
|
+
kind: "oauth2";
|
|
116
|
+
providerId: string;
|
|
117
|
+
scopes: ReadonlyArray<string>;
|
|
118
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
119
|
+
clientIdFieldKey?: string;
|
|
120
|
+
clientSecretFieldKey?: string;
|
|
121
|
+
} | {
|
|
122
|
+
kind: "oauth2";
|
|
123
|
+
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
124
|
+
scopes: ReadonlyArray<string>;
|
|
125
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
126
|
+
clientIdFieldKey?: string;
|
|
127
|
+
clientSecretFieldKey?: string;
|
|
128
|
+
} | {
|
|
129
|
+
kind: "oauth2";
|
|
63
130
|
/**
|
|
64
|
-
* Free-form
|
|
65
|
-
*
|
|
66
|
-
* remember which mailbox / folder / fixture file the cases originate from.
|
|
67
|
-
*
|
|
68
|
-
* Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
|
|
131
|
+
* Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
|
|
132
|
+
* Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
|
|
69
133
|
*/
|
|
70
|
-
|
|
134
|
+
providerId: string;
|
|
71
135
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* `undefined` to fall back to "Case #N".
|
|
136
|
+
* Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
|
|
137
|
+
* substitutes from the credential's resolved public config (URL-encoded).
|
|
138
|
+
* Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
|
|
76
139
|
*/
|
|
77
|
-
|
|
140
|
+
authorizeUrl: string;
|
|
141
|
+
/** Token endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
142
|
+
tokenUrl: string;
|
|
143
|
+
/** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
144
|
+
userInfoUrl?: string;
|
|
145
|
+
scopes: ReadonlyArray<string>;
|
|
146
|
+
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
147
|
+
clientIdFieldKey?: string;
|
|
148
|
+
clientSecretFieldKey?: string;
|
|
149
|
+
}>;
|
|
150
|
+
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
151
|
+
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
152
|
+
/** Collapsible section title (default: "Advanced"). */
|
|
153
|
+
title?: string;
|
|
154
|
+
/** Optional short helper text shown inside the section (above the fields). */
|
|
155
|
+
description?: string;
|
|
156
|
+
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
157
|
+
defaultOpen?: boolean;
|
|
158
|
+
}>;
|
|
159
|
+
type CredentialTypeDefinition = Readonly<{
|
|
160
|
+
typeId: CredentialTypeId;
|
|
161
|
+
displayName: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
164
|
+
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
165
|
+
/**
|
|
166
|
+
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
167
|
+
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
168
|
+
*/
|
|
169
|
+
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
170
|
+
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
171
|
+
auth?: CredentialAuthDefinition;
|
|
172
|
+
}>;
|
|
173
|
+
/**
|
|
174
|
+
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
175
|
+
*/
|
|
176
|
+
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
177
|
+
/**
|
|
178
|
+
* Persisted credential instance with typed `publicConfig`.
|
|
179
|
+
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
180
|
+
* assignable here for session/test callbacks.
|
|
181
|
+
*/
|
|
182
|
+
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
183
|
+
instanceId: CredentialInstanceId;
|
|
184
|
+
typeId: CredentialTypeId;
|
|
185
|
+
displayName: string;
|
|
186
|
+
sourceKind: CredentialMaterialSourceKind;
|
|
187
|
+
publicConfig: TPublicConfig;
|
|
188
|
+
secretRef: CredentialJsonRecord;
|
|
189
|
+
tags: ReadonlyArray<string>;
|
|
190
|
+
setupStatus: CredentialSetupStatus;
|
|
191
|
+
createdAt: string;
|
|
192
|
+
updatedAt: string;
|
|
193
|
+
}>;
|
|
194
|
+
/**
|
|
195
|
+
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
196
|
+
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
197
|
+
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
198
|
+
*/
|
|
199
|
+
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
200
|
+
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
201
|
+
material: TMaterial;
|
|
202
|
+
publicConfig: TPublicConfig;
|
|
203
|
+
}>;
|
|
204
|
+
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
205
|
+
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
206
|
+
/**
|
|
207
|
+
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
208
|
+
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
209
|
+
*/
|
|
210
|
+
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
211
|
+
definition: CredentialTypeDefinition;
|
|
212
|
+
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
213
|
+
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
217
|
+
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
218
|
+
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
219
|
+
*/
|
|
220
|
+
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
221
|
+
interface CredentialSessionService {
|
|
222
|
+
getSession<TSession = unknown>(args: Readonly<{
|
|
223
|
+
workflowId: WorkflowId;
|
|
224
|
+
nodeId: NodeId;
|
|
225
|
+
slotKey: string;
|
|
226
|
+
}>): Promise<TSession>;
|
|
227
|
+
}
|
|
228
|
+
interface CredentialTypeRegistry {
|
|
229
|
+
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
230
|
+
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
231
|
+
}
|
|
232
|
+
declare class CredentialUnboundError extends Error {
|
|
233
|
+
readonly bindingKey: CredentialBindingKey;
|
|
234
|
+
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
235
|
+
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
236
|
+
private static createMessage;
|
|
78
237
|
}
|
|
79
238
|
//#endregion
|
|
80
|
-
//#region src/
|
|
81
|
-
/**
|
|
82
|
-
* Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
|
|
83
|
-
* - `running`: workflow still in flight
|
|
84
|
-
* - `succeeded`: workflow completed AND all assertions passed (or no assertions)
|
|
85
|
-
* - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
|
|
86
|
-
* - `errored` / `cancelled`: workflow itself errored or was cancelled
|
|
87
|
-
*/
|
|
88
|
-
type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
|
|
89
|
-
/** Aggregate outcome of a TestSuiteRun. */
|
|
90
|
-
type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
|
|
91
|
-
type RunEvent = Readonly<{
|
|
92
|
-
kind: "runCreated";
|
|
93
|
-
runId: RunId;
|
|
94
|
-
workflowId: WorkflowId;
|
|
95
|
-
parent?: ParentExecutionRef;
|
|
96
|
-
at: string;
|
|
97
|
-
}> | Readonly<{
|
|
98
|
-
kind: "runSaved";
|
|
99
|
-
runId: RunId;
|
|
100
|
-
workflowId: WorkflowId;
|
|
101
|
-
parent?: ParentExecutionRef;
|
|
102
|
-
at: string;
|
|
103
|
-
state: PersistedRunState;
|
|
104
|
-
}> | Readonly<{
|
|
105
|
-
kind: "nodeQueued";
|
|
106
|
-
runId: RunId;
|
|
107
|
-
workflowId: WorkflowId;
|
|
108
|
-
parent?: ParentExecutionRef;
|
|
109
|
-
at: string;
|
|
110
|
-
snapshot: NodeExecutionSnapshot;
|
|
111
|
-
}> | Readonly<{
|
|
112
|
-
kind: "nodeStarted";
|
|
113
|
-
runId: RunId;
|
|
114
|
-
workflowId: WorkflowId;
|
|
115
|
-
parent?: ParentExecutionRef;
|
|
116
|
-
at: string;
|
|
117
|
-
snapshot: NodeExecutionSnapshot;
|
|
118
|
-
}> | Readonly<{
|
|
119
|
-
kind: "nodeCompleted";
|
|
120
|
-
runId: RunId;
|
|
121
|
-
workflowId: WorkflowId;
|
|
122
|
-
parent?: ParentExecutionRef;
|
|
123
|
-
at: string;
|
|
124
|
-
snapshot: NodeExecutionSnapshot;
|
|
125
|
-
}> | Readonly<{
|
|
126
|
-
kind: "nodeFailed";
|
|
127
|
-
runId: RunId;
|
|
128
|
-
workflowId: WorkflowId;
|
|
129
|
-
parent?: ParentExecutionRef;
|
|
130
|
-
at: string;
|
|
131
|
-
snapshot: NodeExecutionSnapshot;
|
|
132
|
-
}> | Readonly<{
|
|
133
|
-
kind: "connectionInvocationStarted";
|
|
134
|
-
runId: RunId;
|
|
135
|
-
workflowId: WorkflowId;
|
|
136
|
-
parent?: ParentExecutionRef;
|
|
137
|
-
at: string;
|
|
138
|
-
record: ConnectionInvocationRecord;
|
|
139
|
-
}> | Readonly<{
|
|
140
|
-
kind: "connectionInvocationCompleted";
|
|
141
|
-
runId: RunId;
|
|
142
|
-
workflowId: WorkflowId;
|
|
143
|
-
parent?: ParentExecutionRef;
|
|
144
|
-
at: string;
|
|
145
|
-
record: ConnectionInvocationRecord;
|
|
146
|
-
}> | Readonly<{
|
|
147
|
-
kind: "connectionInvocationFailed";
|
|
148
|
-
runId: RunId;
|
|
149
|
-
workflowId: WorkflowId;
|
|
150
|
-
parent?: ParentExecutionRef;
|
|
151
|
-
at: string;
|
|
152
|
-
record: ConnectionInvocationRecord;
|
|
153
|
-
}> | Readonly<{
|
|
154
|
-
kind: "testSuiteStarted";
|
|
155
|
-
testSuiteRunId: TestSuiteRunId;
|
|
156
|
-
workflowId: WorkflowId;
|
|
157
|
-
triggerNodeId: string;
|
|
158
|
-
triggerNodeName?: string;
|
|
159
|
-
concurrency: number;
|
|
160
|
-
at: string;
|
|
161
|
-
}> | Readonly<{
|
|
162
|
-
kind: "testSuiteFinished";
|
|
163
|
-
testSuiteRunId: TestSuiteRunId;
|
|
164
|
-
workflowId: WorkflowId;
|
|
165
|
-
status: TestSuiteRunStatus;
|
|
166
|
-
totalCases: number;
|
|
167
|
-
passedCases: number;
|
|
168
|
-
failedCases: number;
|
|
169
|
-
at: string;
|
|
170
|
-
}> | Readonly<{
|
|
171
|
-
kind: "testCaseStarted";
|
|
172
|
-
testSuiteRunId: TestSuiteRunId;
|
|
173
|
-
testCaseIndex: number;
|
|
174
|
-
runId: RunId;
|
|
175
|
-
workflowId: WorkflowId;
|
|
176
|
-
testCaseLabel?: string;
|
|
177
|
-
at: string;
|
|
178
|
-
}> | Readonly<{
|
|
179
|
-
kind: "testCaseCompleted";
|
|
180
|
-
testSuiteRunId: TestSuiteRunId;
|
|
181
|
-
testCaseIndex: number;
|
|
182
|
-
runId: RunId;
|
|
183
|
-
workflowId: WorkflowId;
|
|
184
|
-
status: TestCaseRunStatus;
|
|
185
|
-
at: string;
|
|
186
|
-
}>;
|
|
187
|
-
interface RunEventSubscription {
|
|
188
|
-
close(): Promise<void>;
|
|
189
|
-
}
|
|
190
|
-
interface RunEventBus {
|
|
191
|
-
publish(event: RunEvent): Promise<void>;
|
|
192
|
-
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
193
|
-
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
194
|
-
}
|
|
195
|
-
//#endregion
|
|
196
|
-
//#region src/policies/executionLimits/EngineExecutionLimitsPolicy.d.ts
|
|
197
|
-
interface EngineExecutionLimitsPolicyConfig {
|
|
198
|
-
readonly defaultMaxNodeActivations: number;
|
|
199
|
-
readonly hardMaxNodeActivations: number;
|
|
200
|
-
readonly defaultMaxSubworkflowDepth: number;
|
|
201
|
-
readonly hardMaxSubworkflowDepth: number;
|
|
202
|
-
}
|
|
203
|
-
/** Framework defaults for {@link EngineExecutionLimitsPolicy} (merged with host `runtime.engineExecutionLimits`). */
|
|
204
|
-
declare const ENGINE_EXECUTION_LIMITS_DEFAULTS: EngineExecutionLimitsPolicyConfig;
|
|
205
|
-
/**
|
|
206
|
-
* Resolves per-run execution limits: defaults, hard ceilings, and subworkflow depth for new runs.
|
|
207
|
-
*/
|
|
208
|
-
declare class EngineExecutionLimitsPolicy {
|
|
209
|
-
private readonly config;
|
|
210
|
-
constructor(config?: EngineExecutionLimitsPolicyConfig);
|
|
211
|
-
/**
|
|
212
|
-
* Effective options for a new root run (depth 0): defaults merged with engine ceilings.
|
|
213
|
-
* Replaces a separate one-method factory for root-run bootstrap.
|
|
214
|
-
*/
|
|
215
|
-
createRootExecutionOptions(): RunExecutionOptions;
|
|
216
|
-
mergeExecutionOptionsForNewRun(parent: ParentExecutionRef | undefined, user: RunExecutionOptions | undefined): RunExecutionOptions;
|
|
217
|
-
private capNumber;
|
|
218
|
-
}
|
|
219
|
-
//#endregion
|
|
220
|
-
//#region src/di/CoreTokens.d.ts
|
|
221
|
-
declare const CoreTokens: {
|
|
222
|
-
readonly PersistedWorkflowTokenRegistry: TypeToken<PersistedWorkflowTokenRegistryLike>;
|
|
223
|
-
readonly CredentialSessionService: TypeToken<CredentialSessionService>;
|
|
224
|
-
readonly CredentialTypeRegistry: TypeToken<CredentialTypeRegistry>;
|
|
225
|
-
readonly WorkflowRunnerService: TypeToken<WorkflowRunnerService>;
|
|
226
|
-
readonly LiveWorkflowRepository: TypeToken<LiveWorkflowRepository>;
|
|
227
|
-
readonly WorkflowRepository: TypeToken<WorkflowRepository>;
|
|
228
|
-
readonly NodeResolver: TypeToken<NodeResolver>;
|
|
229
|
-
readonly WorkflowNodeInstanceFactory: TypeToken<WorkflowNodeInstanceFactory>;
|
|
230
|
-
readonly RunIdFactory: TypeToken<RunIdFactory>;
|
|
231
|
-
readonly ActivationIdFactory: TypeToken<ActivationIdFactory>;
|
|
232
|
-
readonly WorkflowExecutionRepository: TypeToken<WorkflowExecutionRepository>;
|
|
233
|
-
readonly TriggerSetupStateRepository: TypeToken<TriggerSetupStateRepository>;
|
|
234
|
-
readonly NodeActivationScheduler: TypeToken<NodeActivationScheduler>;
|
|
235
|
-
readonly RunDataFactory: TypeToken<RunDataFactory>;
|
|
236
|
-
readonly ExecutionContextFactory: TypeToken<ExecutionContextFactory>;
|
|
237
|
-
readonly RunEventBus: TypeToken<RunEventBus>;
|
|
238
|
-
readonly BinaryStorage: TypeToken<BinaryStorage>;
|
|
239
|
-
readonly WebhookBasePath: TypeToken<string>;
|
|
240
|
-
/** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */
|
|
241
|
-
readonly EngineExecutionLimitsPolicy: TypeToken<EngineExecutionLimitsPolicy>;
|
|
242
|
-
readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
|
|
243
|
-
};
|
|
244
|
-
//#endregion
|
|
245
|
-
//#region src/contracts/runTypes.d.ts
|
|
246
|
-
/**
|
|
247
|
-
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
248
|
-
* as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
|
|
249
|
-
* off the presence of this field. Subworkflow runs inherit it from their parent run.
|
|
250
|
-
*/
|
|
251
|
-
interface RunTestContext {
|
|
252
|
-
readonly testSuiteRunId: string;
|
|
253
|
-
readonly testCaseIndex: number;
|
|
254
|
-
/**
|
|
255
|
-
* Optional human-friendly label for this test case (e.g. an email subject when fixtures
|
|
256
|
-
* are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
|
|
257
|
-
* persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
|
|
258
|
-
* instead of "run_1777755971399_bbb86beac1396".
|
|
259
|
-
*/
|
|
260
|
-
readonly testCaseLabel?: string;
|
|
261
|
-
}
|
|
262
|
-
interface RunExecutionOptions {
|
|
263
|
-
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
264
|
-
localOnly?: boolean;
|
|
265
|
-
/** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
|
|
266
|
-
webhook?: boolean;
|
|
267
|
-
mode?: "manual" | "debug";
|
|
268
|
-
sourceWorkflowId?: WorkflowId;
|
|
269
|
-
sourceRunId?: RunId;
|
|
270
|
-
derivedFromRunId?: RunId;
|
|
271
|
-
isMutable?: boolean;
|
|
272
|
-
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
273
|
-
subworkflowDepth?: number;
|
|
274
|
-
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
275
|
-
maxNodeActivations?: number;
|
|
276
|
-
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
277
|
-
maxSubworkflowDepth?: number;
|
|
278
|
-
/** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
|
|
279
|
-
testContext?: RunTestContext;
|
|
280
|
-
}
|
|
281
|
-
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
282
|
-
interface EngineRunCounters {
|
|
283
|
-
completedNodeActivations: number;
|
|
284
|
-
}
|
|
285
|
-
type RunStopCondition = Readonly<{
|
|
286
|
-
kind: "workflowCompleted";
|
|
287
|
-
}> | Readonly<{
|
|
288
|
-
kind: "nodeCompleted";
|
|
289
|
-
nodeId: NodeId;
|
|
290
|
-
}>;
|
|
291
|
-
interface RunStateResetRequest {
|
|
292
|
-
clearFromNodeId: NodeId;
|
|
293
|
-
}
|
|
294
|
-
interface PersistedRunControlState {
|
|
295
|
-
stopCondition?: RunStopCondition;
|
|
296
|
-
}
|
|
297
|
-
interface PersistedWorkflowSnapshotNode {
|
|
298
|
-
id: NodeId;
|
|
299
|
-
kind: NodeKind;
|
|
300
|
-
name?: string;
|
|
301
|
-
nodeTokenId: PersistedTokenId;
|
|
302
|
-
configTokenId: PersistedTokenId;
|
|
303
|
-
tokenName?: string;
|
|
304
|
-
configTokenName?: string;
|
|
305
|
-
config: unknown;
|
|
306
|
-
}
|
|
307
|
-
interface PersistedWorkflowSnapshot {
|
|
308
|
-
id: WorkflowId;
|
|
309
|
-
name: string;
|
|
310
|
-
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
311
|
-
edges: ReadonlyArray<Edge>;
|
|
312
|
-
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
313
|
-
workflowErrorHandlerConfigured?: boolean;
|
|
314
|
-
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
315
|
-
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
316
|
-
}
|
|
317
|
-
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
318
|
-
interface PersistedMutableNodeState {
|
|
319
|
-
pinnedOutputsByPort?: PinnedNodeOutputsByPort;
|
|
320
|
-
lastDebugInput?: Items;
|
|
321
|
-
}
|
|
322
|
-
interface PersistedMutableRunState {
|
|
323
|
-
nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
|
|
324
|
-
}
|
|
325
|
-
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
326
|
-
interface RunQueueEntry {
|
|
327
|
-
nodeId: NodeId;
|
|
328
|
-
input: Items;
|
|
329
|
-
toInput?: InputPortKey;
|
|
330
|
-
batchId?: string;
|
|
331
|
-
from?: Readonly<{
|
|
332
|
-
nodeId: NodeId;
|
|
333
|
-
output: OutputPortKey;
|
|
334
|
-
}>;
|
|
335
|
-
collect?: Readonly<{
|
|
336
|
-
expectedInputs: ReadonlyArray<InputPortKey>;
|
|
337
|
-
received: Readonly<Record<InputPortKey, Items>>;
|
|
338
|
-
}>;
|
|
339
|
-
}
|
|
340
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
341
|
-
interface NodeExecutionError {
|
|
342
|
-
message: string;
|
|
343
|
-
name?: string;
|
|
344
|
-
stack?: string;
|
|
345
|
-
details?: JsonValue;
|
|
346
|
-
}
|
|
347
|
-
interface NodeExecutionSnapshot {
|
|
348
|
-
runId: RunId;
|
|
349
|
-
workflowId: WorkflowId;
|
|
350
|
-
nodeId: NodeId;
|
|
351
|
-
activationId?: NodeActivationId;
|
|
352
|
-
parent?: ParentExecutionRef;
|
|
353
|
-
status: NodeExecutionStatus;
|
|
354
|
-
usedPinnedOutput?: boolean;
|
|
355
|
-
queuedAt?: string;
|
|
356
|
-
startedAt?: string;
|
|
357
|
-
finishedAt?: string;
|
|
358
|
-
updatedAt: string;
|
|
359
|
-
inputsByPort?: NodeInputsByPort;
|
|
360
|
-
outputs?: NodeOutputs;
|
|
361
|
-
error?: NodeExecutionError;
|
|
362
|
-
/**
|
|
363
|
-
* When the node is a SubWorkflow invocation, the run id of the child run it spawned.
|
|
364
|
-
* Populated after the child run completes so the UI can deep-link to that specific execution.
|
|
365
|
-
*/
|
|
366
|
-
childRunId?: RunId;
|
|
367
|
-
}
|
|
368
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
369
|
-
type ConnectionInvocationId = string;
|
|
370
|
-
/**
|
|
371
|
-
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
372
|
-
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
373
|
-
*/
|
|
374
|
-
interface ConnectionInvocationRecord {
|
|
375
|
-
readonly invocationId: ConnectionInvocationId;
|
|
376
|
-
readonly runId: RunId;
|
|
377
|
-
readonly workflowId: WorkflowId;
|
|
378
|
-
readonly connectionNodeId: NodeId;
|
|
379
|
-
readonly parentAgentNodeId: NodeId;
|
|
380
|
-
readonly parentAgentActivationId: NodeActivationId;
|
|
381
|
-
readonly status: NodeExecutionStatus;
|
|
382
|
-
readonly managedInput?: JsonValue;
|
|
383
|
-
readonly managedOutput?: JsonValue;
|
|
384
|
-
readonly error?: NodeExecutionError;
|
|
385
|
-
readonly queuedAt?: string;
|
|
386
|
-
readonly startedAt?: string;
|
|
387
|
-
readonly finishedAt?: string;
|
|
388
|
-
readonly updatedAt: string;
|
|
389
|
-
/** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
|
|
390
|
-
readonly iterationId?: NodeIterationId;
|
|
391
|
-
/** Item index (0-based) of the iteration that produced this invocation. */
|
|
392
|
-
readonly itemIndex?: number;
|
|
393
|
-
/** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
|
|
394
|
-
readonly parentInvocationId?: ConnectionInvocationId;
|
|
395
|
-
}
|
|
396
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
397
|
-
type ConnectionInvocationAppendArgs = Readonly<{
|
|
398
|
-
invocationId: ConnectionInvocationId;
|
|
399
|
-
connectionNodeId: NodeId;
|
|
400
|
-
parentAgentNodeId: NodeId;
|
|
401
|
-
parentAgentActivationId: NodeActivationId;
|
|
402
|
-
status: NodeExecutionStatus;
|
|
403
|
-
managedInput?: JsonValue;
|
|
404
|
-
managedOutput?: JsonValue;
|
|
405
|
-
error?: NodeExecutionError;
|
|
406
|
-
queuedAt?: string;
|
|
407
|
-
startedAt?: string;
|
|
408
|
-
finishedAt?: string;
|
|
409
|
-
iterationId?: NodeIterationId;
|
|
410
|
-
itemIndex?: number;
|
|
411
|
-
parentInvocationId?: ConnectionInvocationId;
|
|
412
|
-
}>;
|
|
413
|
-
interface RunCurrentState {
|
|
414
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
415
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
416
|
-
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
417
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
418
|
-
mutableState?: PersistedMutableRunState;
|
|
419
|
-
}
|
|
420
|
-
interface CurrentStateExecutionRequest {
|
|
421
|
-
workflow: WorkflowDefinition;
|
|
422
|
-
items?: Items;
|
|
423
|
-
parent?: ParentExecutionRef;
|
|
424
|
-
executionOptions?: RunExecutionOptions;
|
|
425
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
426
|
-
mutableState?: PersistedMutableRunState;
|
|
427
|
-
currentState?: RunCurrentState;
|
|
428
|
-
stopCondition?: RunStopCondition;
|
|
429
|
-
reset?: RunStateResetRequest;
|
|
430
|
-
}
|
|
431
|
-
interface ExecutionFrontierPlan {
|
|
432
|
-
rootNodeId?: NodeId;
|
|
433
|
-
rootNodeInput?: Items;
|
|
434
|
-
queue: RunQueueEntry[];
|
|
435
|
-
currentState: RunCurrentState;
|
|
436
|
-
stopCondition: RunStopCondition;
|
|
437
|
-
satisfiedNodeIds: ReadonlyArray<NodeId>;
|
|
438
|
-
skippedNodeIds: ReadonlyArray<NodeId>;
|
|
439
|
-
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
440
|
-
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
441
|
-
}
|
|
442
|
-
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
443
|
-
interface RunSummary {
|
|
444
|
-
runId: RunId;
|
|
445
|
-
workflowId: WorkflowId;
|
|
446
|
-
startedAt: string;
|
|
447
|
-
status: RunStatus;
|
|
448
|
-
/**
|
|
449
|
-
* Test-case status for runs dispatched as part of a TestSuiteRun. Carries the
|
|
450
|
-
* assertion-rollup-corrected outcome the test orchestrator persists onto the row, so the
|
|
451
|
-
* executions list can show "failed" for a run whose workflow completed cleanly but whose
|
|
452
|
-
* assertions caught regressions. Absent for non-test runs and legacy rows.
|
|
453
|
-
*/
|
|
454
|
-
testCaseStatus?: TestCaseRunStatus;
|
|
455
|
-
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
456
|
-
finishedAt?: string;
|
|
457
|
-
parent?: ParentExecutionRef;
|
|
458
|
-
executionOptions?: RunExecutionOptions;
|
|
459
|
-
}
|
|
460
|
-
interface PendingNodeExecution {
|
|
461
|
-
runId: RunId;
|
|
462
|
-
activationId: NodeActivationId;
|
|
463
|
-
workflowId: WorkflowId;
|
|
464
|
-
nodeId: NodeId;
|
|
465
|
-
itemsIn: number;
|
|
466
|
-
inputsByPort: NodeInputsByPort;
|
|
467
|
-
receiptId: string;
|
|
468
|
-
queue?: string;
|
|
469
|
-
batchId?: string;
|
|
470
|
-
enqueuedAt: string;
|
|
471
|
-
}
|
|
472
|
-
interface PersistedRunSchedulingState {
|
|
473
|
-
pending?: PendingNodeExecution;
|
|
474
|
-
queue: RunQueueEntry[];
|
|
475
|
-
}
|
|
476
|
-
interface PersistedRunState {
|
|
477
|
-
runId: RunId;
|
|
478
|
-
workflowId: WorkflowId;
|
|
479
|
-
startedAt: string;
|
|
480
|
-
/** Canonical terminal time for listings and retention when persisted on the run root. */
|
|
481
|
-
finishedAt?: string;
|
|
482
|
-
/** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
|
|
483
|
-
revision?: number;
|
|
484
|
-
parent?: ParentExecutionRef;
|
|
485
|
-
executionOptions?: RunExecutionOptions;
|
|
486
|
-
control?: PersistedRunControlState;
|
|
487
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
488
|
-
mutableState?: PersistedMutableRunState;
|
|
489
|
-
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
490
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
491
|
-
/** Successful node completions so far (for activation budget). */
|
|
492
|
-
engineCounters?: EngineRunCounters;
|
|
493
|
-
status: RunStatus;
|
|
494
|
-
pending?: PendingNodeExecution;
|
|
495
|
-
queue: RunQueueEntry[];
|
|
496
|
-
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
497
|
-
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
498
|
-
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
499
|
-
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
500
|
-
}
|
|
501
|
-
interface WorkflowExecutionRepository {
|
|
502
|
-
createRun(args: {
|
|
503
|
-
runId: RunId;
|
|
504
|
-
workflowId: WorkflowId;
|
|
505
|
-
startedAt: string;
|
|
506
|
-
parent?: ParentExecutionRef;
|
|
507
|
-
executionOptions?: RunExecutionOptions;
|
|
508
|
-
control?: PersistedRunControlState;
|
|
509
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
510
|
-
mutableState?: PersistedMutableRunState;
|
|
511
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
512
|
-
engineCounters?: EngineRunCounters;
|
|
513
|
-
}): Promise<void>;
|
|
514
|
-
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
515
|
-
loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
|
|
516
|
-
save(state: PersistedRunState): Promise<void>;
|
|
517
|
-
deleteRun?(runId: RunId): Promise<void>;
|
|
518
|
-
}
|
|
519
|
-
interface WorkflowExecutionListingRepository {
|
|
520
|
-
listRuns(args?: Readonly<{
|
|
521
|
-
workflowId?: WorkflowId;
|
|
522
|
-
limit?: number;
|
|
523
|
-
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
524
|
-
}
|
|
525
|
-
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
526
|
-
interface RunPruneCandidate {
|
|
527
|
-
readonly runId: RunId;
|
|
528
|
-
readonly workflowId: WorkflowId;
|
|
529
|
-
readonly startedAt: string;
|
|
530
|
-
readonly finishedAt: string;
|
|
531
|
-
}
|
|
532
|
-
interface WorkflowExecutionPruneRepository {
|
|
533
|
-
listRunsOlderThan(args: Readonly<{
|
|
534
|
-
nowIso: string;
|
|
535
|
-
defaultRetentionSeconds: number;
|
|
536
|
-
limit?: number;
|
|
537
|
-
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
538
|
-
}
|
|
539
|
-
type RunResult = {
|
|
540
|
-
runId: RunId;
|
|
541
|
-
workflowId: WorkflowId;
|
|
542
|
-
startedAt: string;
|
|
543
|
-
status: "completed";
|
|
544
|
-
outputs: Items;
|
|
545
|
-
} | {
|
|
546
|
-
runId: RunId;
|
|
547
|
-
workflowId: WorkflowId;
|
|
548
|
-
startedAt: string;
|
|
549
|
-
status: "pending";
|
|
550
|
-
pending: PendingNodeExecution;
|
|
551
|
-
} | {
|
|
552
|
-
runId: RunId;
|
|
553
|
-
workflowId: WorkflowId;
|
|
554
|
-
startedAt: string;
|
|
555
|
-
status: "failed";
|
|
556
|
-
error: {
|
|
557
|
-
message: string;
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
type WebhookRunResult = Readonly<{
|
|
561
|
-
runId: RunId;
|
|
562
|
-
workflowId: WorkflowId;
|
|
563
|
-
startedAt: string;
|
|
564
|
-
runStatus: "pending" | "completed";
|
|
565
|
-
response: Items;
|
|
566
|
-
}>;
|
|
567
|
-
interface PersistedWorkflowTokenRegistryLike {
|
|
568
|
-
register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
|
|
569
|
-
getTokenId(type: TypeToken<unknown>): string | undefined;
|
|
570
|
-
resolve(tokenId: string): TypeToken<unknown> | undefined;
|
|
571
|
-
registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
572
|
-
}
|
|
573
|
-
interface RunCompletionNotifier {
|
|
574
|
-
resolveRunCompletion(result: RunResult): void;
|
|
575
|
-
resolveWebhookResponse(result: WebhookRunResult): void;
|
|
576
|
-
}
|
|
577
|
-
interface RunEventPublisherDeps {
|
|
578
|
-
eventBus?: RunEventBus;
|
|
579
|
-
}
|
|
580
|
-
//#endregion
|
|
581
|
-
//#region src/triggers/polling/PollingTriggerDedupWindow.d.ts
|
|
582
|
-
/**
|
|
583
|
-
* Merges processed-ID windows for polling triggers, capping the total to avoid unbounded growth.
|
|
584
|
-
* Plugin code receives an instance of this class via {@link PollingTriggerHandle.dedup}.
|
|
585
|
-
*/
|
|
586
|
-
declare class PollingTriggerDedupWindow {
|
|
587
|
-
static readonly defaultCapN = 2000;
|
|
588
|
-
merge(previous: ReadonlyArray<string>, incoming: ReadonlyArray<string>, capN?: number): ReadonlyArray<string>;
|
|
589
|
-
}
|
|
590
|
-
//#endregion
|
|
591
|
-
//#region src/triggers/polling/PollingTriggerLogger.d.ts
|
|
592
|
-
/**
|
|
593
|
-
* Minimal logger surface for the polling-trigger runtime.
|
|
594
|
-
* Hosts supply this via {@link EngineDeps.pollingTriggerLogger};
|
|
595
|
-
* when absent the runtime is silent.
|
|
596
|
-
*/
|
|
597
|
-
interface PollingTriggerLogger {
|
|
598
|
-
info(message: string): void;
|
|
599
|
-
warn(message: string): void;
|
|
600
|
-
error(message: string, exception?: Error): void;
|
|
601
|
-
debug(message: string): void;
|
|
602
|
-
}
|
|
603
|
-
declare class NoOpPollingTriggerLogger implements PollingTriggerLogger {
|
|
604
|
-
info(): void;
|
|
605
|
-
warn(): void;
|
|
606
|
-
error(): void;
|
|
607
|
-
debug(): void;
|
|
608
|
-
}
|
|
609
|
-
//#endregion
|
|
610
|
-
//#region src/contracts/credentialTypes.d.ts
|
|
611
|
-
type CredentialTypeId = string;
|
|
612
|
-
type CredentialInstanceId = string;
|
|
613
|
-
type CredentialMaterialSourceKind = "db" | "env" | "code";
|
|
614
|
-
type CredentialSetupStatus = "draft" | "ready";
|
|
615
|
-
type CredentialHealthStatus = "unknown" | "healthy" | "failing";
|
|
616
|
-
type CredentialFieldSchema = Readonly<{
|
|
617
|
-
key: string;
|
|
618
|
-
label: string;
|
|
619
|
-
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
620
|
-
required?: true;
|
|
621
|
-
order?: number;
|
|
622
|
-
/**
|
|
623
|
-
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
624
|
-
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
625
|
-
* Defaults to `"default"` when omitted.
|
|
626
|
-
*/
|
|
627
|
-
visibility?: "default" | "advanced";
|
|
628
|
-
placeholder?: string;
|
|
629
|
-
helpText?: string;
|
|
630
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
631
|
-
envVarName?: string;
|
|
632
|
-
/**
|
|
633
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
634
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
635
|
-
*/
|
|
636
|
-
copyValue?: string;
|
|
637
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
638
|
-
copyButtonLabel?: string;
|
|
639
|
-
}>;
|
|
640
|
-
type CredentialRequirement = Readonly<{
|
|
641
|
-
slotKey: string;
|
|
642
|
-
label: string;
|
|
643
|
-
acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
644
|
-
optional?: true;
|
|
645
|
-
helpText?: string;
|
|
646
|
-
helpUrl?: string;
|
|
647
|
-
}>;
|
|
648
|
-
type CredentialBindingKey = Readonly<{
|
|
649
|
-
workflowId: WorkflowId;
|
|
650
|
-
nodeId: NodeId;
|
|
651
|
-
slotKey: string;
|
|
652
|
-
}>;
|
|
653
|
-
type CredentialBinding = Readonly<{
|
|
654
|
-
key: CredentialBindingKey;
|
|
655
|
-
instanceId: CredentialInstanceId;
|
|
656
|
-
updatedAt: string;
|
|
657
|
-
}>;
|
|
658
|
-
type CredentialHealth = Readonly<{
|
|
659
|
-
status: CredentialHealthStatus;
|
|
660
|
-
message?: string;
|
|
661
|
-
testedAt?: string;
|
|
662
|
-
expiresAt?: string;
|
|
663
|
-
details?: Readonly<Record<string, unknown>>;
|
|
664
|
-
}>;
|
|
665
|
-
type OAuth2ProviderFromPublicConfig = Readonly<{
|
|
666
|
-
authorizeUrlFieldKey: string;
|
|
667
|
-
tokenUrlFieldKey: string;
|
|
668
|
-
userInfoUrlFieldKey?: string;
|
|
669
|
-
}>;
|
|
670
|
-
type CredentialOAuth2ScopesFromPublicConfig = Readonly<{
|
|
671
|
-
presetFieldKey: string;
|
|
672
|
-
presetScopes: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
673
|
-
customPresetKey?: string;
|
|
674
|
-
customScopesFieldKey?: string;
|
|
675
|
-
}>;
|
|
676
|
-
type CredentialOAuth2AuthDefinition = Readonly<{
|
|
677
|
-
kind: "oauth2";
|
|
678
|
-
providerId: string;
|
|
679
|
-
scopes: ReadonlyArray<string>;
|
|
680
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
681
|
-
clientIdFieldKey?: string;
|
|
682
|
-
clientSecretFieldKey?: string;
|
|
683
|
-
} | {
|
|
684
|
-
kind: "oauth2";
|
|
685
|
-
providerFromPublicConfig: OAuth2ProviderFromPublicConfig;
|
|
686
|
-
scopes: ReadonlyArray<string>;
|
|
687
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
688
|
-
clientIdFieldKey?: string;
|
|
689
|
-
clientSecretFieldKey?: string;
|
|
690
|
-
} | {
|
|
691
|
-
kind: "oauth2";
|
|
692
|
-
/**
|
|
693
|
-
* Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
|
|
694
|
-
* Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
|
|
695
|
-
*/
|
|
696
|
-
providerId: string;
|
|
697
|
-
/**
|
|
698
|
-
* Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
|
|
699
|
-
* substitutes from the credential's resolved public config (URL-encoded).
|
|
700
|
-
* Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
|
|
701
|
-
*/
|
|
702
|
-
authorizeUrl: string;
|
|
703
|
-
/** Token endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
704
|
-
tokenUrl: string;
|
|
705
|
-
/** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
706
|
-
userInfoUrl?: string;
|
|
707
|
-
scopes: ReadonlyArray<string>;
|
|
708
|
-
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
709
|
-
clientIdFieldKey?: string;
|
|
710
|
-
clientSecretFieldKey?: string;
|
|
711
|
-
}>;
|
|
712
|
-
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
713
|
-
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
714
|
-
/** Collapsible section title (default: "Advanced"). */
|
|
715
|
-
title?: string;
|
|
716
|
-
/** Optional short helper text shown inside the section (above the fields). */
|
|
717
|
-
description?: string;
|
|
718
|
-
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
719
|
-
defaultOpen?: boolean;
|
|
720
|
-
}>;
|
|
721
|
-
type CredentialTypeDefinition = Readonly<{
|
|
722
|
-
typeId: CredentialTypeId;
|
|
723
|
-
displayName: string;
|
|
724
|
-
description?: string;
|
|
725
|
-
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
726
|
-
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
727
|
-
/**
|
|
728
|
-
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
729
|
-
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
730
|
-
*/
|
|
731
|
-
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
732
|
-
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
733
|
-
auth?: CredentialAuthDefinition;
|
|
734
|
-
}>;
|
|
735
|
-
/**
|
|
736
|
-
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
737
|
-
*/
|
|
738
|
-
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
739
|
-
/**
|
|
740
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
741
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
742
|
-
* assignable here for session/test callbacks.
|
|
743
|
-
*/
|
|
744
|
-
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
745
|
-
instanceId: CredentialInstanceId;
|
|
746
|
-
typeId: CredentialTypeId;
|
|
747
|
-
displayName: string;
|
|
748
|
-
sourceKind: CredentialMaterialSourceKind;
|
|
749
|
-
publicConfig: TPublicConfig;
|
|
750
|
-
secretRef: CredentialJsonRecord;
|
|
751
|
-
tags: ReadonlyArray<string>;
|
|
752
|
-
setupStatus: CredentialSetupStatus;
|
|
753
|
-
createdAt: string;
|
|
754
|
-
updatedAt: string;
|
|
755
|
-
}>;
|
|
756
|
-
/**
|
|
757
|
-
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
758
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
759
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
760
|
-
*/
|
|
761
|
-
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
762
|
-
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
763
|
-
material: TMaterial;
|
|
764
|
-
publicConfig: TPublicConfig;
|
|
765
|
-
}>;
|
|
766
|
-
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
767
|
-
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
768
|
-
/**
|
|
769
|
-
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
770
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
771
|
-
*/
|
|
772
|
-
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
773
|
-
definition: CredentialTypeDefinition;
|
|
774
|
-
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
775
|
-
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
776
|
-
}>;
|
|
777
|
-
/**
|
|
778
|
-
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
779
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
780
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
781
|
-
*/
|
|
782
|
-
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
783
|
-
interface CredentialSessionService {
|
|
784
|
-
getSession<TSession = unknown>(args: Readonly<{
|
|
785
|
-
workflowId: WorkflowId;
|
|
786
|
-
nodeId: NodeId;
|
|
787
|
-
slotKey: string;
|
|
788
|
-
}>): Promise<TSession>;
|
|
789
|
-
}
|
|
790
|
-
interface CredentialTypeRegistry {
|
|
791
|
-
listTypes(): ReadonlyArray<CredentialTypeDefinition>;
|
|
792
|
-
getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined;
|
|
793
|
-
}
|
|
794
|
-
declare class CredentialUnboundError extends Error {
|
|
795
|
-
readonly bindingKey: CredentialBindingKey;
|
|
796
|
-
readonly acceptedTypes: ReadonlyArray<CredentialTypeId>;
|
|
797
|
-
constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray<CredentialTypeId>);
|
|
798
|
-
private static createMessage;
|
|
799
|
-
}
|
|
800
|
-
//#endregion
|
|
801
|
-
//#region src/contracts/collectionTypes.d.ts
|
|
239
|
+
//#region src/contracts/collectionTypes.d.ts
|
|
802
240
|
/**
|
|
803
241
|
* Represents a typed store for a single collection.
|
|
804
242
|
* All rows include auto-managed id, created_at, and updated_at fields.
|
|
@@ -955,6 +393,10 @@ declare class CodemationTelemetryAttributeNames {
|
|
|
955
393
|
static readonly iterationIndex = "codemation.iteration.index";
|
|
956
394
|
/** Set when this span/metric was recorded under a sub-agent triggered by an outer LLM/tool call. */
|
|
957
395
|
static readonly parentInvocationId = "codemation.parent.invocation_id";
|
|
396
|
+
/** MCP server id on spans created for callTool invocations. */
|
|
397
|
+
static readonly mcpServerId = "mcp.server_id";
|
|
398
|
+
/** MCP tool name on spans created for callTool invocations. */
|
|
399
|
+
static readonly mcpToolName = "mcp.tool_name";
|
|
958
400
|
}
|
|
959
401
|
//#endregion
|
|
960
402
|
//#region src/contracts/GenAiTelemetryAttributeNames.d.ts
|
|
@@ -1139,702 +581,1391 @@ interface WorkflowRunnerService {
|
|
|
1139
581
|
parent?: ParentExecutionRef;
|
|
1140
582
|
}): Promise<RunResult>;
|
|
1141
583
|
}
|
|
1142
|
-
interface WorkflowRunnerResolver {
|
|
1143
|
-
resolve(): WorkflowRunnerService | undefined;
|
|
584
|
+
interface WorkflowRunnerResolver {
|
|
585
|
+
resolve(): WorkflowRunnerService | undefined;
|
|
586
|
+
}
|
|
587
|
+
interface WorkflowRepository {
|
|
588
|
+
list(): ReadonlyArray<WorkflowDefinition>;
|
|
589
|
+
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
590
|
+
}
|
|
591
|
+
interface LiveWorkflowRepository extends WorkflowRepository {
|
|
592
|
+
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
593
|
+
}
|
|
594
|
+
interface NodeResolver {
|
|
595
|
+
resolve<T>(token: TypeToken<T>): T;
|
|
596
|
+
}
|
|
597
|
+
interface NodeExecutionStatePublisher {
|
|
598
|
+
markQueued(args: {
|
|
599
|
+
nodeId: NodeId;
|
|
600
|
+
activationId?: NodeActivationId;
|
|
601
|
+
inputsByPort?: NodeInputsByPort;
|
|
602
|
+
}): Promise<void>;
|
|
603
|
+
markRunning(args: {
|
|
604
|
+
nodeId: NodeId;
|
|
605
|
+
activationId?: NodeActivationId;
|
|
606
|
+
inputsByPort?: NodeInputsByPort;
|
|
607
|
+
}): Promise<void>;
|
|
608
|
+
markCompleted(args: {
|
|
609
|
+
nodeId: NodeId;
|
|
610
|
+
activationId?: NodeActivationId;
|
|
611
|
+
inputsByPort?: NodeInputsByPort;
|
|
612
|
+
outputs?: NodeOutputs;
|
|
613
|
+
}): Promise<void>;
|
|
614
|
+
markFailed(args: {
|
|
615
|
+
nodeId: NodeId;
|
|
616
|
+
activationId?: NodeActivationId;
|
|
617
|
+
inputsByPort?: NodeInputsByPort;
|
|
618
|
+
error: Error;
|
|
619
|
+
}): Promise<void>;
|
|
620
|
+
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
621
|
+
/**
|
|
622
|
+
* Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
|
|
623
|
+
* SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
|
|
624
|
+
* The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
|
|
625
|
+
*/
|
|
626
|
+
setChildRunId?(args: {
|
|
627
|
+
nodeId: NodeId;
|
|
628
|
+
childRunId: RunId;
|
|
629
|
+
}): Promise<void>;
|
|
630
|
+
}
|
|
631
|
+
type BinaryBody = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array> | Uint8Array | ArrayBuffer;
|
|
632
|
+
interface BinaryStorageWriteRequest {
|
|
633
|
+
storageKey: string;
|
|
634
|
+
body: BinaryBody;
|
|
635
|
+
}
|
|
636
|
+
interface BinaryStorageWriteResult {
|
|
637
|
+
storageKey: string;
|
|
638
|
+
size: number;
|
|
639
|
+
sha256?: string;
|
|
640
|
+
}
|
|
641
|
+
interface BinaryStorageReadResult {
|
|
642
|
+
body: ReadableStream<Uint8Array>;
|
|
643
|
+
size?: number;
|
|
644
|
+
}
|
|
645
|
+
interface BinaryStorageStatResult {
|
|
646
|
+
exists: boolean;
|
|
647
|
+
size?: number;
|
|
648
|
+
}
|
|
649
|
+
interface BinaryStorage {
|
|
650
|
+
readonly driverName: string;
|
|
651
|
+
write(args: BinaryStorageWriteRequest): Promise<BinaryStorageWriteResult>;
|
|
652
|
+
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
653
|
+
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
654
|
+
delete(storageKey: string): Promise<void>;
|
|
655
|
+
/** Deletes multiple objects in bulk. Keys are batched internally. */
|
|
656
|
+
deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;
|
|
657
|
+
/** Lists all keys sharing a common prefix. Returns keys in arbitrary order. */
|
|
658
|
+
listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;
|
|
659
|
+
}
|
|
660
|
+
interface BinaryAttachmentCreateRequest {
|
|
661
|
+
name: string;
|
|
662
|
+
body: BinaryBody;
|
|
663
|
+
mimeType: string;
|
|
664
|
+
filename?: string;
|
|
665
|
+
previewKind?: BinaryAttachment["previewKind"];
|
|
666
|
+
}
|
|
667
|
+
interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
668
|
+
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
669
|
+
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
670
|
+
}
|
|
671
|
+
interface ExecutionBinaryService {
|
|
672
|
+
forNode(args: {
|
|
673
|
+
nodeId: NodeId;
|
|
674
|
+
activationId: NodeActivationId;
|
|
675
|
+
}): NodeBinaryAttachmentService;
|
|
676
|
+
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
677
|
+
}
|
|
678
|
+
interface ExecutionContext {
|
|
679
|
+
runId: RunId;
|
|
680
|
+
workflowId: WorkflowId;
|
|
681
|
+
parent?: ParentExecutionRef;
|
|
682
|
+
/** This run's subworkflow depth (0 = root). */
|
|
683
|
+
subworkflowDepth: number;
|
|
684
|
+
/** Effective activation budget cap for this run (after policy merge). */
|
|
685
|
+
engineMaxNodeActivations: number;
|
|
686
|
+
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
687
|
+
engineMaxSubworkflowDepth: number;
|
|
688
|
+
now: () => Date;
|
|
689
|
+
data: RunDataSnapshot;
|
|
690
|
+
nodeState?: NodeExecutionStatePublisher;
|
|
691
|
+
telemetry: ExecutionTelemetry;
|
|
692
|
+
binary: ExecutionBinaryService;
|
|
693
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
694
|
+
/** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
|
|
695
|
+
iterationId?: NodeIterationId;
|
|
696
|
+
/** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
|
|
697
|
+
itemIndex?: number;
|
|
698
|
+
/** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
|
|
699
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
700
|
+
/**
|
|
701
|
+
* Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
|
|
702
|
+
* branches on this; assertion-emitting nodes use it to decide whether to record results.
|
|
703
|
+
*/
|
|
704
|
+
testContext?: RunTestContext;
|
|
705
|
+
/**
|
|
706
|
+
* Collections registered in the codemation config, keyed by collection name.
|
|
707
|
+
*/
|
|
708
|
+
readonly collections?: CollectionsContext;
|
|
709
|
+
}
|
|
710
|
+
interface ExecutionContextFactory {
|
|
711
|
+
create(args: {
|
|
712
|
+
runId: RunId;
|
|
713
|
+
workflowId: WorkflowId;
|
|
714
|
+
parent?: ParentExecutionRef;
|
|
715
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
716
|
+
subworkflowDepth: number;
|
|
717
|
+
engineMaxNodeActivations: number;
|
|
718
|
+
engineMaxSubworkflowDepth: number;
|
|
719
|
+
data: RunDataSnapshot;
|
|
720
|
+
nodeState?: NodeExecutionStatePublisher;
|
|
721
|
+
telemetry?: ExecutionTelemetry;
|
|
722
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
723
|
+
testContext?: RunTestContext;
|
|
724
|
+
}): ExecutionContext;
|
|
725
|
+
}
|
|
726
|
+
interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase> extends ExecutionContext {
|
|
727
|
+
nodeId: NodeId;
|
|
728
|
+
activationId: NodeActivationId;
|
|
729
|
+
config: TConfig;
|
|
730
|
+
telemetry: NodeExecutionTelemetry;
|
|
731
|
+
binary: NodeBinaryAttachmentService;
|
|
732
|
+
}
|
|
733
|
+
interface PollingTriggerHandle {
|
|
734
|
+
/**
|
|
735
|
+
* Start the polling loop. The runtime registers its own cleanup handle so callers do not need to
|
|
736
|
+
* call {@link TriggerSetupContext.registerCleanup} for the loop.
|
|
737
|
+
* @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).
|
|
738
|
+
*/
|
|
739
|
+
start<TState, TItem>(args: {
|
|
740
|
+
intervalMs: number;
|
|
741
|
+
seedState?: TState;
|
|
742
|
+
runCycle: (cycleCtx: {
|
|
743
|
+
previousState: TState | undefined;
|
|
744
|
+
signal: AbortSignal;
|
|
745
|
+
}) => Promise<{
|
|
746
|
+
items: Items<TItem>;
|
|
747
|
+
nextState: TState;
|
|
748
|
+
}>;
|
|
749
|
+
}): Promise<TState | undefined>;
|
|
750
|
+
/** Convenience dedup-window helper. */
|
|
751
|
+
readonly dedup: PollingTriggerDedupWindow;
|
|
752
|
+
}
|
|
753
|
+
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
754
|
+
trigger: TriggerInstanceId;
|
|
755
|
+
config: TConfig;
|
|
756
|
+
previousState: TSetupState$1;
|
|
757
|
+
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
758
|
+
emit(items: Items): Promise<void>;
|
|
759
|
+
/** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */
|
|
760
|
+
readonly polling: PollingTriggerHandle;
|
|
761
|
+
}
|
|
762
|
+
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
763
|
+
trigger: TriggerInstanceId;
|
|
764
|
+
nodeId: NodeId;
|
|
765
|
+
config: TConfig;
|
|
766
|
+
previousState: TSetupState$1;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
770
|
+
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
771
|
+
* package-level setup code.
|
|
772
|
+
*/
|
|
773
|
+
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
774
|
+
trigger: TriggerInstanceId;
|
|
775
|
+
updatedAt: string;
|
|
776
|
+
state: TState;
|
|
777
|
+
}
|
|
778
|
+
interface TriggerSetupStateRepository {
|
|
779
|
+
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
780
|
+
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
781
|
+
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
782
|
+
}
|
|
783
|
+
interface TriggerCleanupHandle {
|
|
784
|
+
stop(): Promise<void> | void;
|
|
785
|
+
}
|
|
786
|
+
interface EngineHost {
|
|
787
|
+
credentialSessions: CredentialSessionService;
|
|
788
|
+
workflows?: WorkflowRunnerService;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
|
|
792
|
+
* for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
793
|
+
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
794
|
+
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
795
|
+
*/
|
|
796
|
+
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
797
|
+
readonly input: TInputJson$1;
|
|
798
|
+
readonly item: Item;
|
|
799
|
+
readonly itemIndex: number;
|
|
800
|
+
readonly items: Items;
|
|
801
|
+
readonly ctx: NodeExecutionContext<TConfig>;
|
|
802
|
+
}
|
|
803
|
+
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
804
|
+
readonly kind: "node";
|
|
805
|
+
/**
|
|
806
|
+
* Declared output ports (e.g. `["main"]`).
|
|
807
|
+
*
|
|
808
|
+
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
809
|
+
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
810
|
+
*/
|
|
811
|
+
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
812
|
+
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
813
|
+
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
814
|
+
execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
|
|
815
|
+
}
|
|
816
|
+
/** @deprecated Use {@link RunnableNode} */
|
|
817
|
+
type ItemNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode<TConfig, TInputJson$1, TOutputJson$1>;
|
|
818
|
+
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
819
|
+
kind: "node";
|
|
820
|
+
/**
|
|
821
|
+
* Declared output ports (typically `["main"]`).
|
|
822
|
+
*
|
|
823
|
+
* Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
|
|
824
|
+
* Engine defaults to `["main"]` when omitted.
|
|
825
|
+
*/
|
|
826
|
+
outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
827
|
+
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
828
|
+
}
|
|
829
|
+
type TriggerSetupStateFor<TConfig extends TriggerNodeConfig<any, any>> = TriggerNodeSetupState<TConfig>;
|
|
830
|
+
interface TriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> {
|
|
831
|
+
kind: "trigger";
|
|
832
|
+
outputPorts: readonly ["main"];
|
|
833
|
+
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
834
|
+
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
835
|
+
}
|
|
836
|
+
interface TestableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> extends TriggerNode<TConfig> {
|
|
837
|
+
getTestItems(ctx: TriggerTestItemsContext<TConfig>): Promise<Items>;
|
|
1144
838
|
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
839
|
+
type ExecutableTriggerNode<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>> = TriggerNode<TConfig>;
|
|
840
|
+
interface NodeExecutionRequest {
|
|
841
|
+
runId: RunId;
|
|
842
|
+
activationId: NodeActivationId;
|
|
843
|
+
workflowId: WorkflowId;
|
|
844
|
+
nodeId: NodeId;
|
|
845
|
+
input: Items;
|
|
846
|
+
parent?: ParentExecutionRef;
|
|
847
|
+
queue?: string;
|
|
848
|
+
executionOptions?: RunExecutionOptions;
|
|
1148
849
|
}
|
|
1149
|
-
interface
|
|
1150
|
-
|
|
850
|
+
interface NodeExecutionScheduler {
|
|
851
|
+
enqueue(request: NodeExecutionRequest): Promise<{
|
|
852
|
+
receiptId: string;
|
|
853
|
+
}>;
|
|
854
|
+
cancel?(receiptId: string): Promise<void>;
|
|
1151
855
|
}
|
|
1152
|
-
interface
|
|
1153
|
-
|
|
856
|
+
interface NodeExecutionRequestHandler {
|
|
857
|
+
handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
|
|
1154
858
|
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
859
|
+
type NodeActivationRequestBase = Readonly<{
|
|
860
|
+
runId: RunId;
|
|
861
|
+
activationId: NodeActivationId;
|
|
862
|
+
workflowId: WorkflowId;
|
|
863
|
+
nodeId: NodeId;
|
|
864
|
+
parent?: ParentExecutionRef;
|
|
865
|
+
executionOptions?: RunExecutionOptions;
|
|
866
|
+
batchId?: string;
|
|
867
|
+
ctx: NodeExecutionContext;
|
|
868
|
+
}>;
|
|
869
|
+
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
870
|
+
kind: "single";
|
|
871
|
+
input: Items;
|
|
872
|
+
}>) | (NodeActivationRequestBase & Readonly<{
|
|
873
|
+
kind: "multi";
|
|
874
|
+
inputsByPort: NodeInputsByPort;
|
|
875
|
+
}>);
|
|
876
|
+
interface NodeActivationReceipt {
|
|
877
|
+
receiptId: string;
|
|
878
|
+
mode?: "local" | "worker";
|
|
879
|
+
queue?: string;
|
|
880
|
+
}
|
|
881
|
+
interface PreparedNodeActivationDispatch {
|
|
882
|
+
readonly receipt: NodeActivationReceipt;
|
|
883
|
+
dispatch(): Promise<void>;
|
|
884
|
+
}
|
|
885
|
+
interface NodeActivationContinuation {
|
|
886
|
+
markNodeRunning(args: {
|
|
887
|
+
runId: RunId;
|
|
888
|
+
activationId: NodeActivationId;
|
|
1162
889
|
nodeId: NodeId;
|
|
1163
|
-
|
|
1164
|
-
inputsByPort?: NodeInputsByPort;
|
|
890
|
+
inputsByPort: NodeInputsByPort;
|
|
1165
891
|
}): Promise<void>;
|
|
1166
|
-
|
|
892
|
+
resumeFromNodeResult(args: {
|
|
893
|
+
runId: RunId;
|
|
894
|
+
activationId: NodeActivationId;
|
|
1167
895
|
nodeId: NodeId;
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
896
|
+
outputs: NodeOutputs;
|
|
897
|
+
}): Promise<RunResult>;
|
|
898
|
+
resumeFromNodeError(args: {
|
|
899
|
+
runId: RunId;
|
|
900
|
+
activationId: NodeActivationId;
|
|
1173
901
|
nodeId: NodeId;
|
|
1174
|
-
activationId?: NodeActivationId;
|
|
1175
|
-
inputsByPort?: NodeInputsByPort;
|
|
1176
902
|
error: Error;
|
|
1177
|
-
}): Promise<
|
|
1178
|
-
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
1179
|
-
/**
|
|
1180
|
-
* Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
|
|
1181
|
-
* SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
|
|
1182
|
-
* The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
|
|
1183
|
-
*/
|
|
1184
|
-
setChildRunId?(args: {
|
|
1185
|
-
nodeId: NodeId;
|
|
1186
|
-
childRunId: RunId;
|
|
1187
|
-
}): Promise<void>;
|
|
903
|
+
}): Promise<RunResult>;
|
|
1188
904
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
905
|
+
interface NodeActivationScheduler {
|
|
906
|
+
setContinuation?(continuation: NodeActivationContinuation): void;
|
|
907
|
+
prepareDispatch(request: NodeActivationRequest): Promise<PreparedNodeActivationDispatch>;
|
|
908
|
+
cancel?(receiptId: string): Promise<void>;
|
|
1193
909
|
}
|
|
1194
|
-
interface
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
sha256?: string;
|
|
910
|
+
interface WorkflowNodeInstanceFactory {
|
|
911
|
+
createNodes(workflow: WorkflowDefinition): ReadonlyMap<NodeId, unknown>;
|
|
912
|
+
createByType(type: TypeToken<unknown>): unknown;
|
|
1198
913
|
}
|
|
1199
|
-
interface
|
|
1200
|
-
|
|
1201
|
-
size?: number;
|
|
914
|
+
interface NodeExecutor {
|
|
915
|
+
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
1202
916
|
}
|
|
1203
|
-
interface
|
|
1204
|
-
|
|
1205
|
-
size?: number;
|
|
917
|
+
interface WorkflowSnapshotFactory {
|
|
918
|
+
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
1206
919
|
}
|
|
1207
|
-
interface
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
delete(storageKey: string): Promise<void>;
|
|
920
|
+
interface WorkflowSnapshotResolver {
|
|
921
|
+
resolve(args: {
|
|
922
|
+
workflowId: WorkflowId;
|
|
923
|
+
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
924
|
+
}): WorkflowDefinition | undefined;
|
|
1213
925
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
filename?: string;
|
|
1219
|
-
previewKind?: BinaryAttachment["previewKind"];
|
|
926
|
+
/** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */
|
|
927
|
+
interface TriggerRuntimeDiagnostics {
|
|
928
|
+
info(message: string): void;
|
|
929
|
+
warn(message: string): void;
|
|
1220
930
|
}
|
|
1221
|
-
interface
|
|
1222
|
-
|
|
1223
|
-
|
|
931
|
+
interface EngineDeps {
|
|
932
|
+
credentialSessions: CredentialSessionService;
|
|
933
|
+
liveWorkflowRepository: LiveWorkflowRepository;
|
|
934
|
+
workflowRepository: WorkflowRepository;
|
|
935
|
+
/** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
|
|
936
|
+
workflowActivationPolicy: WorkflowActivationPolicy;
|
|
937
|
+
nodeResolver: NodeResolver;
|
|
938
|
+
triggerSetupStateRepository: TriggerSetupStateRepository;
|
|
939
|
+
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
940
|
+
runIdFactory: RunIdFactory;
|
|
941
|
+
activationIdFactory: ActivationIdFactory;
|
|
942
|
+
workflowExecutionRepository: WorkflowExecutionRepository;
|
|
943
|
+
activationScheduler: NodeActivationScheduler;
|
|
944
|
+
runDataFactory: RunDataFactory;
|
|
945
|
+
executionContextFactory: ExecutionContextFactory;
|
|
946
|
+
executionTelemetryFactory?: ExecutionTelemetryFactory;
|
|
947
|
+
nodeExecutor: NodeExecutor;
|
|
948
|
+
eventBus?: RunEventBus;
|
|
949
|
+
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
950
|
+
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
951
|
+
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
952
|
+
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
953
|
+
/** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
|
|
954
|
+
triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
|
|
955
|
+
/** When set, the polling-trigger runtime uses this logger for cycle info/debug/error. */
|
|
956
|
+
pollingTriggerLogger?: PollingTriggerLogger;
|
|
1224
957
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
960
|
+
/**
|
|
961
|
+
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
962
|
+
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
963
|
+
*
|
|
964
|
+
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
965
|
+
*/
|
|
966
|
+
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
967
|
+
interface NoneRetryPolicySpec {
|
|
968
|
+
readonly kind: "none";
|
|
969
|
+
}
|
|
970
|
+
interface FixedRetryPolicySpec {
|
|
971
|
+
readonly kind: "fixed";
|
|
972
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
973
|
+
readonly maxAttempts: number;
|
|
974
|
+
readonly delayMs: number;
|
|
975
|
+
}
|
|
976
|
+
interface ExponentialRetryPolicySpec {
|
|
977
|
+
readonly kind: "exponential";
|
|
978
|
+
/** Total attempts including the first execution. Must be >= 1. */
|
|
979
|
+
readonly maxAttempts: number;
|
|
980
|
+
readonly initialDelayMs: number;
|
|
981
|
+
readonly multiplier: number;
|
|
982
|
+
readonly maxDelayMs?: number;
|
|
983
|
+
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
984
|
+
readonly jitter?: boolean;
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
987
|
+
//#region src/contracts/workflowTypes.d.ts
|
|
988
|
+
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
989
|
+
__codemationNodeJson?: TJson;
|
|
990
|
+
}>;
|
|
991
|
+
type NodeKind = "trigger" | "node";
|
|
992
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
993
|
+
interface JsonObject {
|
|
994
|
+
readonly [key: string]: JsonValue;
|
|
995
|
+
}
|
|
996
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
997
|
+
type JsonArray = ReadonlyArray<JsonValue>;
|
|
998
|
+
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
999
|
+
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
1000
|
+
interface Edge {
|
|
1001
|
+
from: {
|
|
1227
1002
|
nodeId: NodeId;
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1003
|
+
output: OutputPortKey;
|
|
1004
|
+
};
|
|
1005
|
+
to: {
|
|
1006
|
+
nodeId: NodeId;
|
|
1007
|
+
input: InputPortKey;
|
|
1008
|
+
};
|
|
1231
1009
|
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
1248
|
-
/** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
|
|
1249
|
-
iterationId?: NodeIterationId;
|
|
1250
|
-
/** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
|
|
1251
|
-
itemIndex?: number;
|
|
1252
|
-
/** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
|
|
1253
|
-
parentInvocationId?: ConnectionInvocationId;
|
|
1254
|
-
/**
|
|
1255
|
-
* Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
|
|
1256
|
-
* branches on this; assertion-emitting nodes use it to decide whether to record results.
|
|
1257
|
-
*/
|
|
1258
|
-
testContext?: RunTestContext;
|
|
1010
|
+
/**
|
|
1011
|
+
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
1012
|
+
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
1013
|
+
* also be connection-owned nodes for recursive agent attachments.
|
|
1014
|
+
*/
|
|
1015
|
+
interface WorkflowNodeConnection {
|
|
1016
|
+
readonly parentNodeId: NodeId;
|
|
1017
|
+
readonly connectionName: NodeConnectionName;
|
|
1018
|
+
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
1019
|
+
}
|
|
1020
|
+
interface WorkflowDefinition {
|
|
1021
|
+
id: WorkflowId;
|
|
1022
|
+
name: string;
|
|
1023
|
+
nodes: NodeDefinition[];
|
|
1024
|
+
edges: Edge[];
|
|
1259
1025
|
/**
|
|
1260
|
-
*
|
|
1026
|
+
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
1027
|
+
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
1261
1028
|
*/
|
|
1262
|
-
readonly
|
|
1029
|
+
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
1030
|
+
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
1031
|
+
discoveryPathSegments?: readonly string[];
|
|
1032
|
+
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
1033
|
+
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
1034
|
+
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
1035
|
+
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
1036
|
+
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
1037
|
+
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
1263
1038
|
}
|
|
1264
|
-
interface
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
1270
|
-
subworkflowDepth: number;
|
|
1271
|
-
engineMaxNodeActivations: number;
|
|
1272
|
-
engineMaxSubworkflowDepth: number;
|
|
1273
|
-
data: RunDataSnapshot;
|
|
1274
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
1275
|
-
telemetry?: ExecutionTelemetry;
|
|
1276
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
1277
|
-
testContext?: RunTestContext;
|
|
1278
|
-
}): ExecutionContext;
|
|
1039
|
+
interface WorkflowGraph {
|
|
1040
|
+
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
1041
|
+
nodeId: NodeId;
|
|
1042
|
+
input: InputPortKey;
|
|
1043
|
+
}>>;
|
|
1279
1044
|
}
|
|
1280
|
-
interface
|
|
1281
|
-
|
|
1282
|
-
activationId: NodeActivationId;
|
|
1283
|
-
config: TConfig;
|
|
1284
|
-
telemetry: NodeExecutionTelemetry;
|
|
1285
|
-
binary: NodeBinaryAttachmentService;
|
|
1045
|
+
interface WorkflowGraphFactory {
|
|
1046
|
+
create(def: WorkflowDefinition): WorkflowGraph;
|
|
1286
1047
|
}
|
|
1287
|
-
interface
|
|
1048
|
+
interface NodeConfigBase {
|
|
1049
|
+
readonly kind: NodeKind;
|
|
1050
|
+
readonly type: TypeToken<unknown>;
|
|
1051
|
+
readonly name?: string;
|
|
1052
|
+
readonly id?: NodeId;
|
|
1053
|
+
readonly icon?: string;
|
|
1054
|
+
readonly execution?: Readonly<{
|
|
1055
|
+
hint?: "local" | "worker";
|
|
1056
|
+
queue?: string;
|
|
1057
|
+
}>;
|
|
1058
|
+
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
1059
|
+
readonly retryPolicy?: RetryPolicySpec;
|
|
1060
|
+
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
1061
|
+
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
1288
1062
|
/**
|
|
1289
|
-
*
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1063
|
+
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
1064
|
+
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
1065
|
+
* main batches skip downstream execution and propagate the empty path.
|
|
1292
1066
|
*/
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1067
|
+
readonly continueWhenEmptyOutput?: boolean;
|
|
1068
|
+
/**
|
|
1069
|
+
* Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
|
|
1070
|
+
* Use for dynamic routers (Switch) and future error ports.
|
|
1071
|
+
*/
|
|
1072
|
+
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1073
|
+
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
1074
|
+
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
|
|
1077
|
+
* `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
|
|
1078
|
+
* `nodeCompleted` events from nodes with this flag set, and persist their output items as
|
|
1079
|
+
* TestAssertion records (only when the run carries a `testContext`). Set on assertion node
|
|
1080
|
+
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
1081
|
+
*/
|
|
1082
|
+
readonly emitsAssertions?: true;
|
|
1083
|
+
/**
|
|
1084
|
+
* Static configuration summary surfaced in the workflow inspector — the design-time
|
|
1085
|
+
* "what does this node do" panel that renders before any run telemetry exists.
|
|
1086
|
+
*
|
|
1087
|
+
* Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
|
|
1088
|
+
* call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
|
|
1089
|
+
* Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
|
|
1090
|
+
* — the inspector hides the section when no rows are produced.
|
|
1091
|
+
*
|
|
1092
|
+
* Implement on the config class instance so the function can read sibling config fields.
|
|
1093
|
+
* `defineNode({ inspectorSummary })` plumbs through to this.
|
|
1094
|
+
*/
|
|
1095
|
+
inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
1321
1096
|
}
|
|
1322
1097
|
/**
|
|
1323
|
-
*
|
|
1324
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
1325
|
-
* package-level setup code.
|
|
1098
|
+
* One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
|
|
1326
1099
|
*/
|
|
1327
|
-
interface
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
state: TState;
|
|
1331
|
-
}
|
|
1332
|
-
interface TriggerSetupStateRepository {
|
|
1333
|
-
load(trigger: TriggerInstanceId): Promise<PersistedTriggerSetupState | undefined>;
|
|
1334
|
-
save(state: PersistedTriggerSetupState): Promise<void>;
|
|
1335
|
-
delete(trigger: TriggerInstanceId): Promise<void>;
|
|
1336
|
-
}
|
|
1337
|
-
interface TriggerCleanupHandle {
|
|
1338
|
-
stop(): Promise<void> | void;
|
|
1339
|
-
}
|
|
1340
|
-
interface EngineHost {
|
|
1341
|
-
credentialSessions: CredentialSessionService;
|
|
1342
|
-
workflows?: WorkflowRunnerService;
|
|
1100
|
+
interface NodeInspectorSummaryRow {
|
|
1101
|
+
readonly label: string;
|
|
1102
|
+
readonly value: string;
|
|
1343
1103
|
}
|
|
1104
|
+
declare const runnableNodeInputType: unique symbol;
|
|
1105
|
+
declare const runnableNodeOutputType: unique symbol;
|
|
1106
|
+
declare const triggerNodeOutputType: unique symbol;
|
|
1344
1107
|
/**
|
|
1345
|
-
*
|
|
1346
|
-
*
|
|
1347
|
-
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
1348
|
-
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
1108
|
+
* Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
|
|
1109
|
+
* **`TOutputJson`** is emitted `item.json` on outputs.
|
|
1349
1110
|
*/
|
|
1350
|
-
interface
|
|
1351
|
-
readonly input: TInputJson$1;
|
|
1352
|
-
readonly item: Item;
|
|
1353
|
-
readonly itemIndex: number;
|
|
1354
|
-
readonly items: Items;
|
|
1355
|
-
readonly ctx: NodeExecutionContext<TConfig>;
|
|
1356
|
-
}
|
|
1357
|
-
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
1111
|
+
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
1358
1112
|
readonly kind: "node";
|
|
1113
|
+
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
1114
|
+
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
1359
1115
|
/**
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
1363
|
-
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
1116
|
+
* Optional Zod input contract for {@link RunnableNode} when not set on the node class.
|
|
1117
|
+
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
1364
1118
|
*/
|
|
1365
|
-
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1366
|
-
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
1367
1119
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1368
|
-
|
|
1120
|
+
/**
|
|
1121
|
+
* When an activation receives **zero** input items, the engine normally runs `execute` zero times.
|
|
1122
|
+
* Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
|
|
1123
|
+
* Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
|
|
1124
|
+
*/
|
|
1125
|
+
readonly emptyBatchExecution?: "skip" | "runOnce";
|
|
1369
1126
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1127
|
+
declare const triggerNodeSetupStateType: unique symbol;
|
|
1128
|
+
interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonValue | undefined = undefined> extends NodeConfigBase {
|
|
1129
|
+
readonly kind: "trigger";
|
|
1130
|
+
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
1131
|
+
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
1132
|
+
/**
|
|
1133
|
+
* Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from
|
|
1134
|
+
* triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips
|
|
1135
|
+
* `"test"` triggers; the orchestrator skips `"live"` triggers. Defaults to `"live"` when omitted.
|
|
1136
|
+
*/
|
|
1137
|
+
readonly triggerKind?: "live" | "test";
|
|
1138
|
+
}
|
|
1139
|
+
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
1140
|
+
type RunnableNodeOutputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<any, infer TOutputJson> ? TOutputJson : never;
|
|
1141
|
+
type TriggerNodeOutputJson<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<infer TOutputJson, any> ? TOutputJson : never;
|
|
1142
|
+
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
1143
|
+
interface NodeDefinition {
|
|
1144
|
+
id: NodeId;
|
|
1145
|
+
kind: NodeKind;
|
|
1146
|
+
type: TypeToken<unknown>;
|
|
1147
|
+
name?: string;
|
|
1148
|
+
config: NodeConfigBase;
|
|
1149
|
+
}
|
|
1150
|
+
interface NodeRef {
|
|
1151
|
+
id: NodeId;
|
|
1152
|
+
kind: NodeKind;
|
|
1153
|
+
name?: string;
|
|
1154
|
+
}
|
|
1155
|
+
declare function nodeRef<TJson>(nodeId: NodeId): NodeIdRef<TJson>;
|
|
1156
|
+
type PairedItemRef = Readonly<{
|
|
1157
|
+
nodeId: NodeId;
|
|
1158
|
+
output: OutputPortKey;
|
|
1159
|
+
itemIndex: number;
|
|
1160
|
+
}>;
|
|
1161
|
+
type BinaryPreviewKind = "image" | "audio" | "video" | "download";
|
|
1162
|
+
type BinaryAttachment = Readonly<{
|
|
1163
|
+
id: string;
|
|
1164
|
+
storageKey: string;
|
|
1165
|
+
mimeType: string;
|
|
1166
|
+
size: number;
|
|
1167
|
+
storageDriver: string;
|
|
1168
|
+
previewKind: BinaryPreviewKind;
|
|
1169
|
+
createdAt: string;
|
|
1170
|
+
runId: RunId;
|
|
1171
|
+
workflowId: WorkflowId;
|
|
1172
|
+
nodeId: NodeId;
|
|
1173
|
+
activationId: NodeActivationId;
|
|
1174
|
+
filename?: string;
|
|
1175
|
+
sha256?: string;
|
|
1176
|
+
}>;
|
|
1177
|
+
type ItemBinary = Readonly<Record<string, BinaryAttachment>>;
|
|
1178
|
+
type Item<TJson = unknown> = Readonly<{
|
|
1179
|
+
json: TJson;
|
|
1180
|
+
binary?: ItemBinary;
|
|
1181
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
1182
|
+
paired?: ReadonlyArray<PairedItemRef>;
|
|
1183
|
+
}>;
|
|
1184
|
+
type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
1185
|
+
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
1186
|
+
type RunId = string;
|
|
1187
|
+
type NodeActivationId = string;
|
|
1188
|
+
/**
|
|
1189
|
+
* One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
|
|
1190
|
+
* per-item connection invocations and telemetry. Undefined when the executing node is a batch
|
|
1191
|
+
* node or trigger that does not iterate items.
|
|
1192
|
+
*/
|
|
1193
|
+
type NodeIterationId = string;
|
|
1194
|
+
interface ParentExecutionRef {
|
|
1195
|
+
runId: RunId;
|
|
1196
|
+
workflowId: WorkflowId;
|
|
1197
|
+
nodeId: NodeId;
|
|
1198
|
+
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
1199
|
+
subworkflowDepth?: number;
|
|
1200
|
+
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
1201
|
+
engineMaxNodeActivations?: number;
|
|
1202
|
+
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
1203
|
+
engineMaxSubworkflowDepth?: number;
|
|
1374
1204
|
/**
|
|
1375
|
-
*
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1378
|
-
* Engine defaults to `["main"]` when omitted.
|
|
1205
|
+
* Test-suite linkage inherited by the child subworkflow run. Set by whichever node
|
|
1206
|
+
* spawns the subworkflow when its own `ctx.testContext` is present, so assertions
|
|
1207
|
+
* emitted inside a subworkflow land under the correct parent test case.
|
|
1379
1208
|
*/
|
|
1380
|
-
|
|
1381
|
-
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
1209
|
+
testContext?: RunTestContext;
|
|
1382
1210
|
}
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
setup(ctx: TriggerSetupContext<TConfig>): Promise<TriggerSetupStateFor<TConfig>>;
|
|
1388
|
-
execute(items: Items, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
1211
|
+
interface RunDataSnapshot {
|
|
1212
|
+
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
1213
|
+
getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
|
|
1214
|
+
getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
|
|
1389
1215
|
}
|
|
1390
|
-
interface
|
|
1391
|
-
|
|
1216
|
+
interface MutableRunData extends RunDataSnapshot {
|
|
1217
|
+
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
1218
|
+
dump(): Record<NodeId, NodeOutputs>;
|
|
1392
1219
|
}
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
runId: RunId;
|
|
1396
|
-
activationId: NodeActivationId;
|
|
1397
|
-
workflowId: WorkflowId;
|
|
1398
|
-
nodeId: NodeId;
|
|
1399
|
-
input: Items;
|
|
1400
|
-
parent?: ParentExecutionRef;
|
|
1401
|
-
queue?: string;
|
|
1402
|
-
executionOptions?: RunExecutionOptions;
|
|
1220
|
+
interface RunDataFactory {
|
|
1221
|
+
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
1403
1222
|
}
|
|
1404
|
-
interface
|
|
1405
|
-
|
|
1406
|
-
receiptId: string;
|
|
1407
|
-
}>;
|
|
1408
|
-
cancel?(receiptId: string): Promise<void>;
|
|
1223
|
+
interface RunIdFactory {
|
|
1224
|
+
makeRunId(): RunId;
|
|
1409
1225
|
}
|
|
1410
|
-
interface
|
|
1411
|
-
|
|
1226
|
+
interface ActivationIdFactory {
|
|
1227
|
+
makeActivationId(): NodeActivationId;
|
|
1412
1228
|
}
|
|
1413
|
-
type
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
parent?: ParentExecutionRef;
|
|
1419
|
-
executionOptions?: RunExecutionOptions;
|
|
1420
|
-
batchId?: string;
|
|
1421
|
-
ctx: NodeExecutionContext;
|
|
1422
|
-
}>;
|
|
1423
|
-
type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{
|
|
1424
|
-
kind: "single";
|
|
1425
|
-
input: Items;
|
|
1426
|
-
}>) | (NodeActivationRequestBase & Readonly<{
|
|
1427
|
-
kind: "multi";
|
|
1428
|
-
inputsByPort: NodeInputsByPort;
|
|
1429
|
-
}>);
|
|
1430
|
-
interface NodeActivationReceipt {
|
|
1431
|
-
receiptId: string;
|
|
1432
|
-
mode?: "local" | "worker";
|
|
1229
|
+
type UpstreamRefPlaceholder = `$${number}`;
|
|
1230
|
+
declare const branchRef: (index: number) => UpstreamRefPlaceholder;
|
|
1231
|
+
type ExecutionMode = "local" | "worker";
|
|
1232
|
+
interface NodeSchedulerDecision {
|
|
1233
|
+
mode: ExecutionMode;
|
|
1433
1234
|
queue?: string;
|
|
1434
1235
|
}
|
|
1435
|
-
interface
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}
|
|
1439
|
-
interface NodeActivationContinuation {
|
|
1440
|
-
markNodeRunning(args: {
|
|
1441
|
-
runId: RunId;
|
|
1442
|
-
activationId: NodeActivationId;
|
|
1443
|
-
nodeId: NodeId;
|
|
1444
|
-
inputsByPort: NodeInputsByPort;
|
|
1445
|
-
}): Promise<void>;
|
|
1446
|
-
resumeFromNodeResult(args: {
|
|
1447
|
-
runId: RunId;
|
|
1448
|
-
activationId: NodeActivationId;
|
|
1449
|
-
nodeId: NodeId;
|
|
1450
|
-
outputs: NodeOutputs;
|
|
1451
|
-
}): Promise<RunResult>;
|
|
1452
|
-
resumeFromNodeError(args: {
|
|
1453
|
-
runId: RunId;
|
|
1454
|
-
activationId: NodeActivationId;
|
|
1236
|
+
interface NodeOffloadPolicy {
|
|
1237
|
+
decide(args: {
|
|
1238
|
+
workflowId: WorkflowId;
|
|
1455
1239
|
nodeId: NodeId;
|
|
1456
|
-
|
|
1457
|
-
}):
|
|
1240
|
+
config: NodeConfigBase;
|
|
1241
|
+
}): NodeSchedulerDecision;
|
|
1458
1242
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1243
|
+
/** Whether to persist run execution data after the workflow finishes. */
|
|
1244
|
+
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
1245
|
+
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
1246
|
+
interface WorkflowStoragePolicyResolver {
|
|
1247
|
+
shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise<boolean>;
|
|
1463
1248
|
}
|
|
1464
|
-
interface
|
|
1465
|
-
|
|
1466
|
-
|
|
1249
|
+
interface WorkflowStoragePolicyDecisionArgs {
|
|
1250
|
+
readonly runId: RunId;
|
|
1251
|
+
readonly workflowId: WorkflowId;
|
|
1252
|
+
readonly workflow: WorkflowDefinition;
|
|
1253
|
+
readonly finalStatus: "completed" | "failed";
|
|
1254
|
+
readonly startedAt: string;
|
|
1255
|
+
readonly finishedAt: string;
|
|
1467
1256
|
}
|
|
1468
|
-
interface
|
|
1469
|
-
|
|
1257
|
+
interface WorkflowPrunePolicySpec {
|
|
1258
|
+
readonly runDataRetentionSeconds?: number;
|
|
1259
|
+
readonly binaryRetentionSeconds?: number;
|
|
1260
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1261
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1262
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1470
1263
|
}
|
|
1471
|
-
interface
|
|
1472
|
-
|
|
1264
|
+
interface PersistedRunPolicySnapshot {
|
|
1265
|
+
readonly retentionSeconds?: number;
|
|
1266
|
+
readonly binaryRetentionSeconds?: number;
|
|
1267
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1268
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1269
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1270
|
+
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
1473
1271
|
}
|
|
1474
|
-
interface
|
|
1475
|
-
|
|
1476
|
-
workflowId: WorkflowId;
|
|
1477
|
-
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1478
|
-
}): WorkflowDefinition | undefined;
|
|
1272
|
+
interface WorkflowErrorHandler {
|
|
1273
|
+
onError(ctx: WorkflowErrorContext): void | Promise<void>;
|
|
1479
1274
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1275
|
+
interface WorkflowErrorContext {
|
|
1276
|
+
readonly runId: RunId;
|
|
1277
|
+
readonly workflowId: WorkflowId;
|
|
1278
|
+
readonly workflow: WorkflowDefinition;
|
|
1279
|
+
readonly failedNodeId: NodeId;
|
|
1280
|
+
readonly error: Error;
|
|
1281
|
+
readonly startedAt: string;
|
|
1282
|
+
readonly finishedAt: string;
|
|
1484
1283
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1284
|
+
type WorkflowErrorHandlerSpec = TypeToken<WorkflowErrorHandler> | WorkflowErrorHandler;
|
|
1285
|
+
interface NodeErrorHandlerArgs<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
1286
|
+
readonly kind: "single" | "multi";
|
|
1287
|
+
readonly items: Items;
|
|
1288
|
+
readonly inputsByPort: Readonly<Record<InputPortKey, Items>> | undefined;
|
|
1289
|
+
readonly ctx: NodeExecutionContext<TConfig>;
|
|
1290
|
+
readonly error: Error;
|
|
1291
|
+
}
|
|
1292
|
+
interface NodeErrorHandler {
|
|
1293
|
+
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
1294
|
+
}
|
|
1295
|
+
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
1296
|
+
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
1297
|
+
interface WorkflowPolicyRuntimeDefaults {
|
|
1298
|
+
readonly retentionSeconds?: number;
|
|
1299
|
+
readonly binaryRetentionSeconds?: number;
|
|
1300
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1301
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1302
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1303
|
+
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
1304
|
+
}
|
|
1305
|
+
//#endregion
|
|
1306
|
+
//#region src/contracts/testTriggerTypes.d.ts
|
|
1307
|
+
/**
|
|
1308
|
+
* Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
|
|
1309
|
+
* One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
|
|
1310
|
+
*/
|
|
1311
|
+
type TestSuiteRunId = string;
|
|
1312
|
+
/**
|
|
1313
|
+
* Setup context passed to a {@link TestTriggerNodeConfig.generateItems} callback. Distinct from
|
|
1314
|
+
* {@link import("./runtimeTypes").TriggerSetupContext} on purpose: test triggers are not
|
|
1315
|
+
* activated by the live trigger lifecycle (webhooks, cron, polling) and never call `emit` —
|
|
1316
|
+
* the orchestrator pulls from the iterable they return and dispatches one run per item.
|
|
1317
|
+
*/
|
|
1318
|
+
interface TestTriggerSetupContext<TConfig extends TestTriggerNodeConfig<unknown> = TestTriggerNodeConfig<unknown>> {
|
|
1319
|
+
readonly workflowId: WorkflowId;
|
|
1320
|
+
readonly nodeId: NodeId;
|
|
1321
|
+
readonly config: TConfig;
|
|
1322
|
+
readonly testSuiteRunId: TestSuiteRunId;
|
|
1323
|
+
/**
|
|
1324
|
+
* Resolves a credential session for a slot declared on this trigger's
|
|
1325
|
+
* {@link import("./workflowTypes").NodeConfigBase.getCredentialRequirements}. Same contract as
|
|
1326
|
+
* {@link import("./runtimeTypes").ExecutionContext.getCredential}.
|
|
1327
|
+
*/
|
|
1328
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
1329
|
+
/** AbortSignal raised when the suite is cancelled — long-running pulls should bail out. */
|
|
1330
|
+
readonly signal: AbortSignal;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
|
|
1334
|
+
* becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
|
|
1335
|
+
* → 10 runs marked under the same TestSuiteRun.
|
|
1336
|
+
*
|
|
1337
|
+
* The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
|
|
1338
|
+
* any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
|
|
1339
|
+
*/
|
|
1340
|
+
interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConfig<TOutputJson$1, undefined> {
|
|
1341
|
+
readonly triggerKind: "test";
|
|
1342
|
+
/**
|
|
1343
|
+
* Author-supplied async iterable of items, evaluated lazily. Implementations may fetch from
|
|
1344
|
+
* credentialed APIs, read fixture files, or yield hard-coded items. The orchestrator iterates
|
|
1345
|
+
* and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
|
|
1346
|
+
*/
|
|
1347
|
+
generateItems(ctx: TestTriggerSetupContext<TestTriggerNodeConfig<TOutputJson$1>>): AsyncIterable<Item<TOutputJson$1>>;
|
|
1348
|
+
/** Per-suite-run cap on simultaneously-executing test cases. Default: 4. */
|
|
1349
|
+
readonly concurrency?: number;
|
|
1350
|
+
/**
|
|
1351
|
+
* Free-form description of where the test cases come from — surfaced in the node properties
|
|
1352
|
+
* panel and the suite-detail header so authors revisiting the workflow six months later
|
|
1353
|
+
* remember which mailbox / folder / fixture file the cases originate from.
|
|
1354
|
+
*
|
|
1355
|
+
* Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
|
|
1356
|
+
*/
|
|
1357
|
+
readonly description?: string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Resolves a human-readable label for one yielded test case (e.g. email subject). The
|
|
1360
|
+
* orchestrator calls this once per yielded item, persists the result on the run, and the
|
|
1361
|
+
* Tests-tab UI uses it to render the case row instead of the opaque runId. Return
|
|
1362
|
+
* `undefined` to fall back to "Case #N".
|
|
1363
|
+
*/
|
|
1364
|
+
caseLabel?(item: Item<TOutputJson$1>): string | undefined;
|
|
1511
1365
|
}
|
|
1512
1366
|
//#endregion
|
|
1513
|
-
//#region src/
|
|
1367
|
+
//#region src/events/runEvents.d.ts
|
|
1514
1368
|
/**
|
|
1515
|
-
*
|
|
1516
|
-
* `
|
|
1517
|
-
*
|
|
1518
|
-
* `
|
|
1369
|
+
* Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
|
|
1370
|
+
* - `running`: workflow still in flight
|
|
1371
|
+
* - `succeeded`: workflow completed AND all assertions passed (or no assertions)
|
|
1372
|
+
* - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
|
|
1373
|
+
* - `errored` / `cancelled`: workflow itself errored or was cancelled
|
|
1519
1374
|
*/
|
|
1520
|
-
type
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1375
|
+
type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
|
|
1376
|
+
/** Aggregate outcome of a TestSuiteRun. */
|
|
1377
|
+
type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
|
|
1378
|
+
type RunEvent = Readonly<{
|
|
1379
|
+
kind: "runCreated";
|
|
1380
|
+
runId: RunId;
|
|
1381
|
+
workflowId: WorkflowId;
|
|
1382
|
+
parent?: ParentExecutionRef;
|
|
1383
|
+
at: string;
|
|
1384
|
+
}> | Readonly<{
|
|
1385
|
+
kind: "runSaved";
|
|
1386
|
+
runId: RunId;
|
|
1387
|
+
workflowId: WorkflowId;
|
|
1388
|
+
parent?: ParentExecutionRef;
|
|
1389
|
+
at: string;
|
|
1390
|
+
state: PersistedRunState;
|
|
1391
|
+
}> | Readonly<{
|
|
1392
|
+
kind: "nodeQueued";
|
|
1393
|
+
runId: RunId;
|
|
1394
|
+
workflowId: WorkflowId;
|
|
1395
|
+
parent?: ParentExecutionRef;
|
|
1396
|
+
at: string;
|
|
1397
|
+
snapshot: NodeExecutionSnapshot;
|
|
1398
|
+
}> | Readonly<{
|
|
1399
|
+
kind: "nodeStarted";
|
|
1400
|
+
runId: RunId;
|
|
1401
|
+
workflowId: WorkflowId;
|
|
1402
|
+
parent?: ParentExecutionRef;
|
|
1403
|
+
at: string;
|
|
1404
|
+
snapshot: NodeExecutionSnapshot;
|
|
1405
|
+
}> | Readonly<{
|
|
1406
|
+
kind: "nodeCompleted";
|
|
1407
|
+
runId: RunId;
|
|
1408
|
+
workflowId: WorkflowId;
|
|
1409
|
+
parent?: ParentExecutionRef;
|
|
1410
|
+
at: string;
|
|
1411
|
+
snapshot: NodeExecutionSnapshot;
|
|
1412
|
+
}> | Readonly<{
|
|
1413
|
+
kind: "nodeFailed";
|
|
1414
|
+
runId: RunId;
|
|
1415
|
+
workflowId: WorkflowId;
|
|
1416
|
+
parent?: ParentExecutionRef;
|
|
1417
|
+
at: string;
|
|
1418
|
+
snapshot: NodeExecutionSnapshot;
|
|
1419
|
+
}> | Readonly<{
|
|
1420
|
+
kind: "connectionInvocationStarted";
|
|
1421
|
+
runId: RunId;
|
|
1422
|
+
workflowId: WorkflowId;
|
|
1423
|
+
parent?: ParentExecutionRef;
|
|
1424
|
+
at: string;
|
|
1425
|
+
record: ConnectionInvocationRecord;
|
|
1426
|
+
}> | Readonly<{
|
|
1427
|
+
kind: "connectionInvocationCompleted";
|
|
1428
|
+
runId: RunId;
|
|
1429
|
+
workflowId: WorkflowId;
|
|
1430
|
+
parent?: ParentExecutionRef;
|
|
1431
|
+
at: string;
|
|
1432
|
+
record: ConnectionInvocationRecord;
|
|
1433
|
+
}> | Readonly<{
|
|
1434
|
+
kind: "connectionInvocationFailed";
|
|
1435
|
+
runId: RunId;
|
|
1436
|
+
workflowId: WorkflowId;
|
|
1437
|
+
parent?: ParentExecutionRef;
|
|
1438
|
+
at: string;
|
|
1439
|
+
record: ConnectionInvocationRecord;
|
|
1440
|
+
}> | Readonly<{
|
|
1441
|
+
kind: "testSuiteStarted";
|
|
1442
|
+
testSuiteRunId: TestSuiteRunId;
|
|
1443
|
+
workflowId: WorkflowId;
|
|
1444
|
+
triggerNodeId: string;
|
|
1445
|
+
triggerNodeName?: string;
|
|
1446
|
+
concurrency: number;
|
|
1447
|
+
at: string;
|
|
1448
|
+
}> | Readonly<{
|
|
1449
|
+
kind: "testSuiteFinished";
|
|
1450
|
+
testSuiteRunId: TestSuiteRunId;
|
|
1451
|
+
workflowId: WorkflowId;
|
|
1452
|
+
status: TestSuiteRunStatus;
|
|
1453
|
+
totalCases: number;
|
|
1454
|
+
passedCases: number;
|
|
1455
|
+
failedCases: number;
|
|
1456
|
+
at: string;
|
|
1457
|
+
}> | Readonly<{
|
|
1458
|
+
kind: "testCaseStarted";
|
|
1459
|
+
testSuiteRunId: TestSuiteRunId;
|
|
1460
|
+
testCaseIndex: number;
|
|
1461
|
+
runId: RunId;
|
|
1462
|
+
workflowId: WorkflowId;
|
|
1463
|
+
testCaseLabel?: string;
|
|
1464
|
+
at: string;
|
|
1465
|
+
}> | Readonly<{
|
|
1466
|
+
kind: "testCaseCompleted";
|
|
1467
|
+
testSuiteRunId: TestSuiteRunId;
|
|
1468
|
+
testCaseIndex: number;
|
|
1469
|
+
runId: RunId;
|
|
1470
|
+
workflowId: WorkflowId;
|
|
1471
|
+
status: TestCaseRunStatus;
|
|
1472
|
+
at: string;
|
|
1473
|
+
}>;
|
|
1474
|
+
interface RunEventSubscription {
|
|
1475
|
+
close(): Promise<void>;
|
|
1529
1476
|
}
|
|
1530
|
-
interface
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
readonly initialDelayMs: number;
|
|
1535
|
-
readonly multiplier: number;
|
|
1536
|
-
readonly maxDelayMs?: number;
|
|
1537
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
1538
|
-
readonly jitter?: boolean;
|
|
1477
|
+
interface RunEventBus {
|
|
1478
|
+
publish(event: RunEvent): Promise<void>;
|
|
1479
|
+
subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
1480
|
+
subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
|
|
1539
1481
|
}
|
|
1540
1482
|
//#endregion
|
|
1541
|
-
//#region src/
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
interface JsonObject {
|
|
1548
|
-
readonly [key: string]: JsonValue;
|
|
1549
|
-
}
|
|
1550
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
1551
|
-
type JsonArray = ReadonlyArray<JsonValue>;
|
|
1552
|
-
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
1553
|
-
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
1554
|
-
interface Edge {
|
|
1555
|
-
from: {
|
|
1556
|
-
nodeId: NodeId;
|
|
1557
|
-
output: OutputPortKey;
|
|
1558
|
-
};
|
|
1559
|
-
to: {
|
|
1560
|
-
nodeId: NodeId;
|
|
1561
|
-
input: InputPortKey;
|
|
1562
|
-
};
|
|
1483
|
+
//#region src/policies/executionLimits/EngineExecutionLimitsPolicy.d.ts
|
|
1484
|
+
interface EngineExecutionLimitsPolicyConfig {
|
|
1485
|
+
readonly defaultMaxNodeActivations: number;
|
|
1486
|
+
readonly hardMaxNodeActivations: number;
|
|
1487
|
+
readonly defaultMaxSubworkflowDepth: number;
|
|
1488
|
+
readonly hardMaxSubworkflowDepth: number;
|
|
1563
1489
|
}
|
|
1490
|
+
/** Framework defaults for {@link EngineExecutionLimitsPolicy} (merged with host `runtime.engineExecutionLimits`). */
|
|
1491
|
+
declare const ENGINE_EXECUTION_LIMITS_DEFAULTS: EngineExecutionLimitsPolicyConfig;
|
|
1564
1492
|
/**
|
|
1565
|
-
*
|
|
1566
|
-
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
1567
|
-
* also be connection-owned nodes for recursive agent attachments.
|
|
1493
|
+
* Resolves per-run execution limits: defaults, hard ceilings, and subworkflow depth for new runs.
|
|
1568
1494
|
*/
|
|
1569
|
-
|
|
1570
|
-
readonly
|
|
1571
|
-
|
|
1572
|
-
readonly childNodeIds: ReadonlyArray<NodeId>;
|
|
1573
|
-
}
|
|
1574
|
-
interface WorkflowDefinition {
|
|
1575
|
-
id: WorkflowId;
|
|
1576
|
-
name: string;
|
|
1577
|
-
nodes: NodeDefinition[];
|
|
1578
|
-
edges: Edge[];
|
|
1495
|
+
declare class EngineExecutionLimitsPolicy {
|
|
1496
|
+
private readonly config;
|
|
1497
|
+
constructor(config?: EngineExecutionLimitsPolicyConfig);
|
|
1579
1498
|
/**
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1499
|
+
* Effective options for a new root run (depth 0): defaults merged with engine ceilings.
|
|
1500
|
+
* Replaces a separate one-method factory for root-run bootstrap.
|
|
1582
1501
|
*/
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
1587
|
-
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
1588
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
1589
|
-
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
1590
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
1591
|
-
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
1592
|
-
}
|
|
1593
|
-
interface WorkflowGraph {
|
|
1594
|
-
next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray<Readonly<{
|
|
1595
|
-
nodeId: NodeId;
|
|
1596
|
-
input: InputPortKey;
|
|
1597
|
-
}>>;
|
|
1598
|
-
}
|
|
1599
|
-
interface WorkflowGraphFactory {
|
|
1600
|
-
create(def: WorkflowDefinition): WorkflowGraph;
|
|
1502
|
+
createRootExecutionOptions(): RunExecutionOptions;
|
|
1503
|
+
mergeExecutionOptionsForNewRun(parent: ParentExecutionRef | undefined, user: RunExecutionOptions | undefined): RunExecutionOptions;
|
|
1504
|
+
private capNumber;
|
|
1601
1505
|
}
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
readonly
|
|
1606
|
-
readonly
|
|
1607
|
-
readonly
|
|
1608
|
-
readonly
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
readonly
|
|
1614
|
-
|
|
1615
|
-
readonly
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
readonly
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1627
|
-
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
1628
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region src/di/CoreTokens.d.ts
|
|
1508
|
+
declare const CoreTokens: {
|
|
1509
|
+
readonly PersistedWorkflowTokenRegistry: TypeToken<PersistedWorkflowTokenRegistryLike>;
|
|
1510
|
+
readonly CredentialSessionService: TypeToken<CredentialSessionService>;
|
|
1511
|
+
readonly CredentialTypeRegistry: TypeToken<CredentialTypeRegistry>;
|
|
1512
|
+
readonly WorkflowRunnerService: TypeToken<WorkflowRunnerService>;
|
|
1513
|
+
readonly LiveWorkflowRepository: TypeToken<LiveWorkflowRepository>;
|
|
1514
|
+
readonly WorkflowRepository: TypeToken<WorkflowRepository>;
|
|
1515
|
+
readonly NodeResolver: TypeToken<NodeResolver>;
|
|
1516
|
+
readonly WorkflowNodeInstanceFactory: TypeToken<WorkflowNodeInstanceFactory>;
|
|
1517
|
+
readonly RunIdFactory: TypeToken<RunIdFactory>;
|
|
1518
|
+
readonly ActivationIdFactory: TypeToken<ActivationIdFactory>;
|
|
1519
|
+
readonly WorkflowExecutionRepository: TypeToken<WorkflowExecutionRepository>;
|
|
1520
|
+
readonly TriggerSetupStateRepository: TypeToken<TriggerSetupStateRepository>;
|
|
1521
|
+
readonly NodeActivationScheduler: TypeToken<NodeActivationScheduler>;
|
|
1522
|
+
readonly RunDataFactory: TypeToken<RunDataFactory>;
|
|
1523
|
+
readonly ExecutionContextFactory: TypeToken<ExecutionContextFactory>;
|
|
1524
|
+
readonly RunEventBus: TypeToken<RunEventBus>;
|
|
1525
|
+
readonly BinaryStorage: TypeToken<BinaryStorage>;
|
|
1526
|
+
readonly WebhookBasePath: TypeToken<string>;
|
|
1527
|
+
/** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */
|
|
1528
|
+
readonly EngineExecutionLimitsPolicy: TypeToken<EngineExecutionLimitsPolicy>;
|
|
1529
|
+
readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
|
|
1629
1530
|
/**
|
|
1630
|
-
*
|
|
1631
|
-
*
|
|
1632
|
-
*
|
|
1633
|
-
* TestAssertion records (only when the run carries a `testContext`). Set on assertion node
|
|
1634
|
-
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
1531
|
+
* Optional. When registered, AIAgentNode uses it to resolve mcpServers bindings,
|
|
1532
|
+
* validate scopes, open pool connections, and prepare the MCP ToolSet map.
|
|
1533
|
+
* Not registered in the default core bootstrap — the host provides the implementation.
|
|
1635
1534
|
*/
|
|
1636
|
-
readonly
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
declare const triggerNodeOutputType: unique symbol;
|
|
1535
|
+
readonly AgentMcpIntegration: TypeToken<AgentMcpIntegration>;
|
|
1536
|
+
};
|
|
1537
|
+
//#endregion
|
|
1538
|
+
//#region src/contracts/runTypes.d.ts
|
|
1641
1539
|
/**
|
|
1642
|
-
*
|
|
1643
|
-
*
|
|
1540
|
+
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
1541
|
+
* as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
|
|
1542
|
+
* off the presence of this field. Subworkflow runs inherit it from their parent run.
|
|
1644
1543
|
*/
|
|
1645
|
-
interface
|
|
1646
|
-
readonly
|
|
1647
|
-
readonly
|
|
1648
|
-
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
1649
|
-
/**
|
|
1650
|
-
* Optional Zod input contract for {@link RunnableNode} when not set on the node class.
|
|
1651
|
-
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
1652
|
-
*/
|
|
1653
|
-
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1544
|
+
interface RunTestContext {
|
|
1545
|
+
readonly testSuiteRunId: string;
|
|
1546
|
+
readonly testCaseIndex: number;
|
|
1654
1547
|
/**
|
|
1655
|
-
*
|
|
1656
|
-
*
|
|
1657
|
-
*
|
|
1548
|
+
* Optional human-friendly label for this test case (e.g. an email subject when fixtures
|
|
1549
|
+
* are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
|
|
1550
|
+
* persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
|
|
1551
|
+
* instead of "run_1777755971399_bbb86beac1396".
|
|
1658
1552
|
*/
|
|
1659
|
-
readonly
|
|
1553
|
+
readonly testCaseLabel?: string;
|
|
1660
1554
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1555
|
+
interface RunExecutionOptions {
|
|
1556
|
+
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
1557
|
+
localOnly?: boolean;
|
|
1558
|
+
/** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
|
|
1559
|
+
webhook?: boolean;
|
|
1560
|
+
mode?: "manual" | "debug";
|
|
1561
|
+
sourceWorkflowId?: WorkflowId;
|
|
1562
|
+
sourceRunId?: RunId;
|
|
1563
|
+
derivedFromRunId?: RunId;
|
|
1564
|
+
isMutable?: boolean;
|
|
1565
|
+
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
1566
|
+
subworkflowDepth?: number;
|
|
1567
|
+
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
1568
|
+
maxNodeActivations?: number;
|
|
1569
|
+
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
1570
|
+
maxSubworkflowDepth?: number;
|
|
1571
|
+
/** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
|
|
1572
|
+
testContext?: RunTestContext;
|
|
1672
1573
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
type TriggerNodeSetupState<TConfig extends TriggerNodeConfig<any, any>> = TConfig extends TriggerNodeConfig<any, infer TSetupState> ? TSetupState : never;
|
|
1677
|
-
interface NodeDefinition {
|
|
1678
|
-
id: NodeId;
|
|
1679
|
-
kind: NodeKind;
|
|
1680
|
-
type: TypeToken<unknown>;
|
|
1681
|
-
name?: string;
|
|
1682
|
-
config: NodeConfigBase;
|
|
1574
|
+
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
1575
|
+
interface EngineRunCounters {
|
|
1576
|
+
completedNodeActivations: number;
|
|
1683
1577
|
}
|
|
1684
|
-
|
|
1578
|
+
type RunStopCondition = Readonly<{
|
|
1579
|
+
kind: "workflowCompleted";
|
|
1580
|
+
}> | Readonly<{
|
|
1581
|
+
kind: "nodeCompleted";
|
|
1582
|
+
nodeId: NodeId;
|
|
1583
|
+
}>;
|
|
1584
|
+
interface RunStateResetRequest {
|
|
1585
|
+
clearFromNodeId: NodeId;
|
|
1586
|
+
}
|
|
1587
|
+
interface PersistedRunControlState {
|
|
1588
|
+
stopCondition?: RunStopCondition;
|
|
1589
|
+
}
|
|
1590
|
+
interface PersistedWorkflowSnapshotNode {
|
|
1685
1591
|
id: NodeId;
|
|
1686
1592
|
kind: NodeKind;
|
|
1687
1593
|
name?: string;
|
|
1594
|
+
nodeTokenId: PersistedTokenId;
|
|
1595
|
+
configTokenId: PersistedTokenId;
|
|
1596
|
+
tokenName?: string;
|
|
1597
|
+
configTokenName?: string;
|
|
1598
|
+
config: unknown;
|
|
1599
|
+
/** Pre-computed static configuration summary; populated by WorkflowSnapshotCodec. */
|
|
1600
|
+
inspectorSummary?: ReadonlyArray<Readonly<{
|
|
1601
|
+
label: string;
|
|
1602
|
+
value: string;
|
|
1603
|
+
}>>;
|
|
1688
1604
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1605
|
+
interface PersistedWorkflowSnapshot {
|
|
1606
|
+
id: WorkflowId;
|
|
1607
|
+
name: string;
|
|
1608
|
+
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
1609
|
+
edges: ReadonlyArray<Edge>;
|
|
1610
|
+
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
1611
|
+
workflowErrorHandlerConfigured?: boolean;
|
|
1612
|
+
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
1613
|
+
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
1614
|
+
}
|
|
1615
|
+
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
1616
|
+
interface PersistedMutableNodeState {
|
|
1617
|
+
pinnedOutputsByPort?: PinnedNodeOutputsByPort;
|
|
1618
|
+
lastDebugInput?: Items;
|
|
1619
|
+
}
|
|
1620
|
+
interface PersistedMutableRunState {
|
|
1621
|
+
nodesById: Readonly<Record<NodeId, PersistedMutableNodeState>>;
|
|
1622
|
+
}
|
|
1623
|
+
type NodeInputsByPort = Readonly<Record<InputPortKey, Items>>;
|
|
1624
|
+
interface RunQueueEntry {
|
|
1691
1625
|
nodeId: NodeId;
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1626
|
+
input: Items;
|
|
1627
|
+
toInput?: InputPortKey;
|
|
1628
|
+
batchId?: string;
|
|
1629
|
+
from?: Readonly<{
|
|
1630
|
+
nodeId: NodeId;
|
|
1631
|
+
output: OutputPortKey;
|
|
1632
|
+
}>;
|
|
1633
|
+
collect?: Readonly<{
|
|
1634
|
+
expectedInputs: ReadonlyArray<InputPortKey>;
|
|
1635
|
+
received: Readonly<Record<InputPortKey, Items>>;
|
|
1636
|
+
}>;
|
|
1637
|
+
}
|
|
1638
|
+
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
1639
|
+
interface NodeExecutionError {
|
|
1640
|
+
message: string;
|
|
1641
|
+
name?: string;
|
|
1642
|
+
stack?: string;
|
|
1643
|
+
details?: JsonValue;
|
|
1644
|
+
}
|
|
1645
|
+
interface NodeExecutionSnapshot {
|
|
1704
1646
|
runId: RunId;
|
|
1705
1647
|
workflowId: WorkflowId;
|
|
1706
1648
|
nodeId: NodeId;
|
|
1707
|
-
activationId
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1649
|
+
activationId?: NodeActivationId;
|
|
1650
|
+
parent?: ParentExecutionRef;
|
|
1651
|
+
status: NodeExecutionStatus;
|
|
1652
|
+
usedPinnedOutput?: boolean;
|
|
1653
|
+
queuedAt?: string;
|
|
1654
|
+
startedAt?: string;
|
|
1655
|
+
finishedAt?: string;
|
|
1656
|
+
updatedAt: string;
|
|
1657
|
+
inputsByPort?: NodeInputsByPort;
|
|
1658
|
+
outputs?: NodeOutputs;
|
|
1659
|
+
error?: NodeExecutionError;
|
|
1660
|
+
/**
|
|
1661
|
+
* When the node is a SubWorkflow invocation, the run id of the child run it spawned.
|
|
1662
|
+
* Populated after the child run completes so the UI can deep-link to that specific execution.
|
|
1663
|
+
*/
|
|
1664
|
+
childRunId?: RunId;
|
|
1665
|
+
}
|
|
1666
|
+
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
1667
|
+
type ConnectionInvocationId = string;
|
|
1722
1668
|
/**
|
|
1723
|
-
* One
|
|
1724
|
-
*
|
|
1725
|
-
* node or trigger that does not iterate items.
|
|
1669
|
+
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
1670
|
+
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
1726
1671
|
*/
|
|
1727
|
-
|
|
1728
|
-
|
|
1672
|
+
interface ConnectionInvocationRecord {
|
|
1673
|
+
readonly invocationId: ConnectionInvocationId;
|
|
1674
|
+
readonly runId: RunId;
|
|
1675
|
+
readonly workflowId: WorkflowId;
|
|
1676
|
+
readonly connectionNodeId: NodeId;
|
|
1677
|
+
readonly parentAgentNodeId: NodeId;
|
|
1678
|
+
readonly parentAgentActivationId: NodeActivationId;
|
|
1679
|
+
readonly status: NodeExecutionStatus;
|
|
1680
|
+
readonly managedInput?: JsonValue;
|
|
1681
|
+
readonly managedOutput?: JsonValue;
|
|
1682
|
+
/** Short human-readable description of what this invocation is doing right now (e.g. `"calling search_messages"`). Rendered as a sub-line on the canvas node card. */
|
|
1683
|
+
readonly statusLabel?: string;
|
|
1684
|
+
/** Stable identifier for the thing this invocation acts on (e.g. an MCP tool name like `"search_messages"`). Persists across status transitions so the inspector can show it on completed/failed entries too. Connection nodes that ARE the tool (e.g. node-backed agent tools) leave this unset — the parent node id already identifies the subject. */
|
|
1685
|
+
readonly subjectName?: string;
|
|
1686
|
+
readonly error?: NodeExecutionError;
|
|
1687
|
+
readonly queuedAt?: string;
|
|
1688
|
+
readonly startedAt?: string;
|
|
1689
|
+
readonly finishedAt?: string;
|
|
1690
|
+
readonly updatedAt: string;
|
|
1691
|
+
/** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
|
|
1692
|
+
readonly iterationId?: NodeIterationId;
|
|
1693
|
+
/** Item index (0-based) of the iteration that produced this invocation. */
|
|
1694
|
+
readonly itemIndex?: number;
|
|
1695
|
+
/** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
|
|
1696
|
+
readonly parentInvocationId?: ConnectionInvocationId;
|
|
1697
|
+
}
|
|
1698
|
+
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
1699
|
+
type ConnectionInvocationAppendArgs = Readonly<{
|
|
1700
|
+
invocationId: ConnectionInvocationId;
|
|
1701
|
+
connectionNodeId: NodeId;
|
|
1702
|
+
parentAgentNodeId: NodeId;
|
|
1703
|
+
parentAgentActivationId: NodeActivationId;
|
|
1704
|
+
status: NodeExecutionStatus;
|
|
1705
|
+
managedInput?: JsonValue;
|
|
1706
|
+
managedOutput?: JsonValue;
|
|
1707
|
+
statusLabel?: string;
|
|
1708
|
+
subjectName?: string;
|
|
1709
|
+
error?: NodeExecutionError;
|
|
1710
|
+
queuedAt?: string;
|
|
1711
|
+
startedAt?: string;
|
|
1712
|
+
finishedAt?: string;
|
|
1713
|
+
iterationId?: NodeIterationId;
|
|
1714
|
+
itemIndex?: number;
|
|
1715
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
1716
|
+
}>;
|
|
1717
|
+
interface RunCurrentState {
|
|
1718
|
+
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
1719
|
+
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
1720
|
+
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
1721
|
+
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
1722
|
+
mutableState?: PersistedMutableRunState;
|
|
1723
|
+
}
|
|
1724
|
+
interface CurrentStateExecutionRequest {
|
|
1725
|
+
workflow: WorkflowDefinition;
|
|
1726
|
+
items?: Items;
|
|
1727
|
+
parent?: ParentExecutionRef;
|
|
1728
|
+
executionOptions?: RunExecutionOptions;
|
|
1729
|
+
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1730
|
+
mutableState?: PersistedMutableRunState;
|
|
1731
|
+
currentState?: RunCurrentState;
|
|
1732
|
+
stopCondition?: RunStopCondition;
|
|
1733
|
+
reset?: RunStateResetRequest;
|
|
1734
|
+
}
|
|
1735
|
+
interface ExecutionFrontierPlan {
|
|
1736
|
+
rootNodeId?: NodeId;
|
|
1737
|
+
rootNodeInput?: Items;
|
|
1738
|
+
queue: RunQueueEntry[];
|
|
1739
|
+
currentState: RunCurrentState;
|
|
1740
|
+
stopCondition: RunStopCondition;
|
|
1741
|
+
satisfiedNodeIds: ReadonlyArray<NodeId>;
|
|
1742
|
+
skippedNodeIds: ReadonlyArray<NodeId>;
|
|
1743
|
+
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
1744
|
+
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
1745
|
+
}
|
|
1746
|
+
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
1747
|
+
interface RunSummary {
|
|
1729
1748
|
runId: RunId;
|
|
1730
1749
|
workflowId: WorkflowId;
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
subworkflowDepth?: number;
|
|
1734
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
1735
|
-
engineMaxNodeActivations?: number;
|
|
1736
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
1737
|
-
engineMaxSubworkflowDepth?: number;
|
|
1750
|
+
startedAt: string;
|
|
1751
|
+
status: RunStatus;
|
|
1738
1752
|
/**
|
|
1739
|
-
* Test-
|
|
1740
|
-
*
|
|
1741
|
-
*
|
|
1753
|
+
* Test-case status for runs dispatched as part of a TestSuiteRun. Carries the
|
|
1754
|
+
* assertion-rollup-corrected outcome the test orchestrator persists onto the row, so the
|
|
1755
|
+
* executions list can show "failed" for a run whose workflow completed cleanly but whose
|
|
1756
|
+
* assertions caught regressions. Absent for non-test runs and legacy rows.
|
|
1742
1757
|
*/
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
|
|
1749
|
-
}
|
|
1750
|
-
interface MutableRunData extends RunDataSnapshot {
|
|
1751
|
-
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
1752
|
-
dump(): Record<NodeId, NodeOutputs>;
|
|
1753
|
-
}
|
|
1754
|
-
interface RunDataFactory {
|
|
1755
|
-
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
1758
|
+
testCaseStatus?: TestCaseRunStatus;
|
|
1759
|
+
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
1760
|
+
finishedAt?: string;
|
|
1761
|
+
parent?: ParentExecutionRef;
|
|
1762
|
+
executionOptions?: RunExecutionOptions;
|
|
1756
1763
|
}
|
|
1757
|
-
interface
|
|
1758
|
-
|
|
1764
|
+
interface PendingNodeExecution {
|
|
1765
|
+
runId: RunId;
|
|
1766
|
+
activationId: NodeActivationId;
|
|
1767
|
+
workflowId: WorkflowId;
|
|
1768
|
+
nodeId: NodeId;
|
|
1769
|
+
itemsIn: number;
|
|
1770
|
+
inputsByPort: NodeInputsByPort;
|
|
1771
|
+
receiptId: string;
|
|
1772
|
+
queue?: string;
|
|
1773
|
+
batchId?: string;
|
|
1774
|
+
enqueuedAt: string;
|
|
1759
1775
|
}
|
|
1760
|
-
interface
|
|
1761
|
-
|
|
1776
|
+
interface PersistedRunSchedulingState {
|
|
1777
|
+
pending?: PendingNodeExecution;
|
|
1778
|
+
queue: RunQueueEntry[];
|
|
1762
1779
|
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1780
|
+
interface PersistedRunState {
|
|
1781
|
+
runId: RunId;
|
|
1782
|
+
workflowId: WorkflowId;
|
|
1783
|
+
startedAt: string;
|
|
1784
|
+
/** Canonical terminal time for listings and retention when persisted on the run root. */
|
|
1785
|
+
finishedAt?: string;
|
|
1786
|
+
/** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
|
|
1787
|
+
revision?: number;
|
|
1788
|
+
parent?: ParentExecutionRef;
|
|
1789
|
+
executionOptions?: RunExecutionOptions;
|
|
1790
|
+
control?: PersistedRunControlState;
|
|
1791
|
+
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1792
|
+
mutableState?: PersistedMutableRunState;
|
|
1793
|
+
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
1794
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
1795
|
+
/** Successful node completions so far (for activation budget). */
|
|
1796
|
+
engineCounters?: EngineRunCounters;
|
|
1797
|
+
status: RunStatus;
|
|
1798
|
+
pending?: PendingNodeExecution;
|
|
1799
|
+
queue: RunQueueEntry[];
|
|
1800
|
+
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
1801
|
+
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
1802
|
+
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
1803
|
+
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
1769
1804
|
}
|
|
1770
|
-
interface
|
|
1771
|
-
|
|
1805
|
+
interface WorkflowExecutionRepository {
|
|
1806
|
+
createRun(args: {
|
|
1807
|
+
runId: RunId;
|
|
1772
1808
|
workflowId: WorkflowId;
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1809
|
+
startedAt: string;
|
|
1810
|
+
parent?: ParentExecutionRef;
|
|
1811
|
+
executionOptions?: RunExecutionOptions;
|
|
1812
|
+
control?: PersistedRunControlState;
|
|
1813
|
+
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1814
|
+
mutableState?: PersistedMutableRunState;
|
|
1815
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
1816
|
+
engineCounters?: EngineRunCounters;
|
|
1817
|
+
}): Promise<void>;
|
|
1818
|
+
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
1819
|
+
loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
|
|
1820
|
+
save(state: PersistedRunState): Promise<void>;
|
|
1821
|
+
deleteRun?(runId: RunId): Promise<void>;
|
|
1776
1822
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1823
|
+
interface WorkflowExecutionListingRepository {
|
|
1824
|
+
listRuns(args?: Readonly<{
|
|
1825
|
+
workflowId?: WorkflowId;
|
|
1826
|
+
limit?: number;
|
|
1827
|
+
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
1782
1828
|
}
|
|
1783
|
-
|
|
1829
|
+
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
1830
|
+
interface RunPruneCandidate {
|
|
1784
1831
|
readonly runId: RunId;
|
|
1785
1832
|
readonly workflowId: WorkflowId;
|
|
1786
|
-
readonly workflow: WorkflowDefinition;
|
|
1787
|
-
readonly finalStatus: "completed" | "failed";
|
|
1788
1833
|
readonly startedAt: string;
|
|
1789
1834
|
readonly finishedAt: string;
|
|
1790
1835
|
}
|
|
1791
|
-
interface
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1836
|
+
interface WorkflowExecutionPruneRepository {
|
|
1837
|
+
listRunsOlderThan(args: Readonly<{
|
|
1838
|
+
nowIso: string;
|
|
1839
|
+
defaultRetentionSeconds: number;
|
|
1840
|
+
limit?: number;
|
|
1841
|
+
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
1797
1842
|
}
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1843
|
+
type RunResult = {
|
|
1844
|
+
runId: RunId;
|
|
1845
|
+
workflowId: WorkflowId;
|
|
1846
|
+
startedAt: string;
|
|
1847
|
+
status: "completed";
|
|
1848
|
+
outputs: Items;
|
|
1849
|
+
} | {
|
|
1850
|
+
runId: RunId;
|
|
1851
|
+
workflowId: WorkflowId;
|
|
1852
|
+
startedAt: string;
|
|
1853
|
+
status: "pending";
|
|
1854
|
+
pending: PendingNodeExecution;
|
|
1855
|
+
} | {
|
|
1856
|
+
runId: RunId;
|
|
1857
|
+
workflowId: WorkflowId;
|
|
1858
|
+
startedAt: string;
|
|
1859
|
+
status: "failed";
|
|
1860
|
+
error: {
|
|
1861
|
+
message: string;
|
|
1862
|
+
};
|
|
1863
|
+
};
|
|
1864
|
+
type WebhookRunResult = Readonly<{
|
|
1865
|
+
runId: RunId;
|
|
1866
|
+
workflowId: WorkflowId;
|
|
1867
|
+
startedAt: string;
|
|
1868
|
+
runStatus: "pending" | "completed";
|
|
1869
|
+
response: Items;
|
|
1870
|
+
}>;
|
|
1871
|
+
interface PersistedWorkflowTokenRegistryLike {
|
|
1872
|
+
register(type: TypeToken<unknown>, packageId: string, persistedNameOverride?: string): string;
|
|
1873
|
+
getTokenId(type: TypeToken<unknown>): string | undefined;
|
|
1874
|
+
resolve(tokenId: string): TypeToken<unknown> | undefined;
|
|
1875
|
+
registerFromWorkflows?(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
1805
1876
|
}
|
|
1806
|
-
interface
|
|
1807
|
-
|
|
1877
|
+
interface RunCompletionNotifier {
|
|
1878
|
+
resolveRunCompletion(result: RunResult): void;
|
|
1879
|
+
resolveWebhookResponse(result: WebhookRunResult): void;
|
|
1808
1880
|
}
|
|
1809
|
-
interface
|
|
1810
|
-
|
|
1811
|
-
readonly workflowId: WorkflowId;
|
|
1812
|
-
readonly workflow: WorkflowDefinition;
|
|
1813
|
-
readonly failedNodeId: NodeId;
|
|
1814
|
-
readonly error: Error;
|
|
1815
|
-
readonly startedAt: string;
|
|
1816
|
-
readonly finishedAt: string;
|
|
1881
|
+
interface RunEventPublisherDeps {
|
|
1882
|
+
eventBus?: RunEventBus;
|
|
1817
1883
|
}
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region src/contracts/agentMcpTypes.d.ts
|
|
1886
|
+
/**
|
|
1887
|
+
* Emitted as a span event when a credential is missing required scopes
|
|
1888
|
+
* (bind-time) or when callTool returns a permission error (runtime).
|
|
1889
|
+
* The credential type id can be looked up from the credential instance when needed.
|
|
1890
|
+
*/
|
|
1891
|
+
interface NeedsReconsentEvent {
|
|
1892
|
+
readonly serverId: string;
|
|
1893
|
+
readonly credentialInstanceId: string;
|
|
1894
|
+
readonly missingScopesHint?: readonly string[];
|
|
1825
1895
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1896
|
+
/**
|
|
1897
|
+
* An opaque MCP tool map: keyed by serverId → (toolName → tool definition).
|
|
1898
|
+
* Typed as unknown so core does not depend on the AI SDK's ToolSet type.
|
|
1899
|
+
* AIAgentNode (in core-nodes, which does depend on ai) casts this to
|
|
1900
|
+
* ReadonlyMap<string, ToolSet> before passing to DeferredMetaToolStrategyFactory.
|
|
1901
|
+
*/
|
|
1902
|
+
type AgentMcpToolMap = ReadonlyMap<string, Readonly<Record<string, unknown>>>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Contract implemented by the host. Resolves MCP server bindings for an agent run
|
|
1905
|
+
* via the standard credential-binding table (one slot per declared server, keyed
|
|
1906
|
+
* by `(workflowId, mcpConnectionNodeId, "credential")`), and returns a ready-to-use
|
|
1907
|
+
* tool map with wrapped execute callbacks for telemetry and 403 detection.
|
|
1908
|
+
* Core-nodes imports this interface so AIAgentNode can inject it without
|
|
1909
|
+
* depending on the host.
|
|
1910
|
+
*/
|
|
1911
|
+
interface AgentMcpIntegration {
|
|
1912
|
+
/**
|
|
1913
|
+
* Look up the credential binding per server, validate scopes, open pool
|
|
1914
|
+
* connections, and return a tool map keyed by serverId. Each tool's
|
|
1915
|
+
* execute callback includes:
|
|
1916
|
+
* - Telemetry child span (mcp.server_id, mcp.tool_name attributes)
|
|
1917
|
+
* - 403/permission error detection → emits a NeedsReconsentEvent span event
|
|
1918
|
+
*
|
|
1919
|
+
* Throws `AgentBindError` on validation failures (missing server, unbound
|
|
1920
|
+
* credential slot, missing credential instance, insufficient scopes).
|
|
1921
|
+
*/
|
|
1922
|
+
prepareMcpTools(args: {
|
|
1923
|
+
readonly workflowId: WorkflowId;
|
|
1924
|
+
readonly agentNodeId: NodeId;
|
|
1925
|
+
readonly serverIds: ReadonlyArray<string>;
|
|
1926
|
+
readonly pinnedMcpTools: readonly string[];
|
|
1927
|
+
readonly emitSpanEvent: (event: TelemetrySpanEventRecord) => void;
|
|
1928
|
+
readonly startChildSpan: (args: {
|
|
1929
|
+
readonly name: string;
|
|
1930
|
+
readonly attributes?: Record<string, string>;
|
|
1931
|
+
}) => {
|
|
1932
|
+
readonly end: (args?: {
|
|
1933
|
+
status?: "ok" | "error";
|
|
1934
|
+
statusMessage?: string;
|
|
1935
|
+
}) => void;
|
|
1936
|
+
};
|
|
1937
|
+
/** Per-MCP-tool-call invocation appender. Optional; when omitted the wrapper emits only telemetry spans. */
|
|
1938
|
+
readonly appendMcpInvocation?: (args: ConnectionInvocationAppendArgs) => Promise<void>;
|
|
1939
|
+
/** Agent activation id to attach to each invocation record (used by canvas + inspector grouping). */
|
|
1940
|
+
readonly parentAgentActivationId?: NodeActivationId;
|
|
1941
|
+
/** Per-item iteration id when the agent runs inside a per-item loop. */
|
|
1942
|
+
readonly iterationId?: NodeIterationId;
|
|
1943
|
+
/** Item index (0-based) of the iteration that owns these tool calls. */
|
|
1944
|
+
readonly itemIndex?: number;
|
|
1945
|
+
/** Parent invocation id when this agent is itself executing as a sub-agent. */
|
|
1946
|
+
readonly parentInvocationId?: ConnectionInvocationId;
|
|
1947
|
+
}): Promise<AgentMcpToolMap>;
|
|
1828
1948
|
}
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1949
|
+
//#endregion
|
|
1950
|
+
//#region src/contracts/AgentBindError.d.ts
|
|
1951
|
+
/**
|
|
1952
|
+
* Thrown at agent bind time when mcpServers declarations cannot be resolved.
|
|
1953
|
+
* Causes include: unknown server id, missing credential instance, insufficient scopes,
|
|
1954
|
+
* and ambiguous shorthand binding (multiple credential instances match).
|
|
1955
|
+
*/
|
|
1956
|
+
declare class AgentBindError extends Error {
|
|
1957
|
+
constructor(message: string);
|
|
1958
|
+
}
|
|
1959
|
+
//#endregion
|
|
1960
|
+
//#region src/contracts/NoOpAgentMcpIntegration.d.ts
|
|
1961
|
+
/**
|
|
1962
|
+
* No-op implementation of AgentMcpIntegration.
|
|
1963
|
+
* Registered by the core engine runtime as a fallback when the host does not
|
|
1964
|
+
* supply a real implementation (e.g. in unit tests or headless engine setups).
|
|
1965
|
+
* Always returns an empty tool map so the agent runs with node-backed tools only.
|
|
1966
|
+
*/
|
|
1967
|
+
declare class NoOpAgentMcpIntegration implements AgentMcpIntegration {
|
|
1968
|
+
prepareMcpTools(): Promise<AgentMcpToolMap>;
|
|
1838
1969
|
}
|
|
1839
1970
|
//#endregion
|
|
1840
1971
|
//#region src/contracts/assertionTypes.d.ts
|
|
@@ -2141,6 +2272,35 @@ interface WorkflowDetailSelectionState {
|
|
|
2141
2272
|
readonly selectedInstanceId: ExecutionInstanceId | null;
|
|
2142
2273
|
}
|
|
2143
2274
|
//#endregion
|
|
2275
|
+
//#region src/contracts/mcpTypes.d.ts
|
|
2276
|
+
type McpServerTransport = "http";
|
|
2277
|
+
interface McpServerDeclaration {
|
|
2278
|
+
/** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
|
|
2279
|
+
id: string;
|
|
2280
|
+
displayName: string;
|
|
2281
|
+
description: string;
|
|
2282
|
+
transport: McpServerTransport;
|
|
2283
|
+
url: string;
|
|
2284
|
+
/**
|
|
2285
|
+
* Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
|
|
2286
|
+
* Absent or empty means no credential is required.
|
|
2287
|
+
*/
|
|
2288
|
+
acceptedCredentialTypes?: ReadonlyArray<string>;
|
|
2289
|
+
/**
|
|
2290
|
+
* Documentation only in MVP. The bind-time validator checks
|
|
2291
|
+
* requiredScopes ⊆ CredentialInstance.scopesGranted.
|
|
2292
|
+
*/
|
|
2293
|
+
requiredScopes?: string[];
|
|
2294
|
+
/** Non-secret static headers merged onto every MCP request. */
|
|
2295
|
+
staticHeaders?: Record<string, string>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Overrides for tool descriptions advertised by the MCP server.
|
|
2298
|
+
* Applied by the connection pool after tools/list.
|
|
2299
|
+
* Key: exact tool name as returned by the server.
|
|
2300
|
+
*/
|
|
2301
|
+
toolDescriptionOverrides?: Record<string, string>;
|
|
2302
|
+
}
|
|
2303
|
+
//#endregion
|
|
2144
2304
|
//#region src/contracts/emitPorts.d.ts
|
|
2145
2305
|
declare const EMIT_PORTS_BRAND: unique symbol;
|
|
2146
2306
|
type PortsEmission = Readonly<{
|
|
@@ -2305,6 +2465,9 @@ declare const NodeIdSlugifier: {
|
|
|
2305
2465
|
//#region src/workflow/definition/ConnectionInvocationIdFactory.d.ts
|
|
2306
2466
|
/**
|
|
2307
2467
|
* Unique ids for persisted connection invocation history rows (LLM/tool calls under an owning node).
|
|
2468
|
+
*
|
|
2469
|
+
* Uses Web Crypto's `randomUUID` so this module is safe in browser-bundle contexts —
|
|
2470
|
+
* paired with `NodeIterationIdFactory` which had the same `node:crypto` regression.
|
|
2308
2471
|
*/
|
|
2309
2472
|
declare class ConnectionInvocationIdFactory {
|
|
2310
2473
|
static create(): string;
|
|
@@ -2321,6 +2484,12 @@ declare class ConnectionNodeIdFactory {
|
|
|
2321
2484
|
static readonly connectionSegment: "__conn__";
|
|
2322
2485
|
static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId;
|
|
2323
2486
|
static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId;
|
|
2487
|
+
static mcpConnectionNodeId(parentNodeId: NodeId, serverId: string): NodeId;
|
|
2488
|
+
static isMcpConnectionNodeId(nodeId: NodeId): boolean;
|
|
2489
|
+
static parseMcpConnectionNodeId(nodeId: NodeId): Readonly<{
|
|
2490
|
+
parentNodeId: NodeId;
|
|
2491
|
+
serverId: string;
|
|
2492
|
+
}> | undefined;
|
|
2324
2493
|
static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean;
|
|
2325
2494
|
static isToolConnectionNodeId(nodeId: NodeId): boolean;
|
|
2326
2495
|
static parseLanguageModelConnectionNodeId(nodeId: NodeId): Readonly<{
|
|
@@ -2343,6 +2512,10 @@ declare class ConnectionNodeIdFactory {
|
|
|
2343
2512
|
* Activations are per-batch (one scheduled execution of a node, possibly with N items).
|
|
2344
2513
|
* Iterations refine that to one identifier per item-index inside the batch loop, so per-item
|
|
2345
2514
|
* connection invocations and telemetry can be grouped without time-window heuristics.
|
|
2515
|
+
*
|
|
2516
|
+
* Uses Web Crypto's `randomUUID` (Node 19+ and all modern browsers) so this module is safe
|
|
2517
|
+
* to include in the browser entry. Importing `node:crypto` here previously leaked into the
|
|
2518
|
+
* canvas client bundle through `browser.ts` and OOM'd consumers' Turbopack builds.
|
|
2346
2519
|
*/
|
|
2347
2520
|
declare class NodeIterationIdFactory {
|
|
2348
2521
|
static create(): string;
|
|
@@ -2564,6 +2737,11 @@ declare class WorkflowSnapshotCodec {
|
|
|
2564
2737
|
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
2565
2738
|
hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
|
|
2566
2739
|
private serializeConfig;
|
|
2740
|
+
/**
|
|
2741
|
+
* Safely call `config.inspectorSummary()` and return a plain JSON-safe array, or undefined.
|
|
2742
|
+
* Returns undefined if the method is absent, throws, or produces no valid rows.
|
|
2743
|
+
*/
|
|
2744
|
+
private safeInspectorSummary;
|
|
2567
2745
|
private injectTokenIds;
|
|
2568
2746
|
private mergeValue;
|
|
2569
2747
|
private mergeNestedValue;
|
|
@@ -2657,5 +2835,5 @@ declare class RunIntentService {
|
|
|
2657
2835
|
private createWebhookExecutionOptions;
|
|
2658
2836
|
}
|
|
2659
2837
|
//#endregion
|
|
2660
|
-
export {
|
|
2661
|
-
//# sourceMappingURL=RunIntentService-
|
|
2838
|
+
export { PersistedRunWorkItemRecord as $, CredentialTypeDefinition as $a, WebhookTriggerRoutingDiagnostics as $i, JsonPrimitive as $n, BinaryAttachmentCreateRequest as $r, RunEventPublisherDeps as $t, RunFinishedAtFactory as A, CollectionStore as Aa, PreparedNodeActivationDispatch as Ai, CoreTokens as An, WorkflowDefinition as Ar, NeedsReconsentEvent as At, isUnbrandedPortsEmissionShape as B, CredentialHealthTester as Ba, TriggerTestItemsContext as Bi, TestTriggerNodeConfig as Bn, WorkflowStoragePolicyMode as Br, NodeInputsByPort as Bt, AnyTriggerNodeConfig as C, CostTrackingComponent as Ca, NodeExecutionRequestHandler as Ci, injectAll as Cn, RunnableNodeConfig as Cr, AssertionResultProvenance as Ct, BranchStepsArg as D, CostTrackingTelemetryFactory as Da, NodeResolver as Di, predicateAwareClassFactory as Dn, TriggerNodeOutputJson as Dr, AgentBindError as Dt, BranchOutputGuard as E, CostTrackingTelemetryAttributeNames as Ea, NodeExecutor as Ei, instancePerContainerCachingFactory as En, TriggerNodeConfig as Er, NoOpAgentMcpIntegration as Et, NoRetryPolicy as F, CredentialBinding as Fa, TriggerNode as Fi, RunEventBus as Fn, WorkflowGraphFactory as Fr, EngineRunCounters as Ft, ExecutionInstanceDto as G, CredentialOAuth2AuthDefinition as Ga, WorkflowSnapshotFactory as Gi, Edge as Gn, runnableNodeInputType as Gr, PersistedRunSchedulingState as Gt, McpServerTransport as H, CredentialInstanceRecord as Ha, WorkflowRepository as Hi, ActivationIdFactory as Hn, WorkflowStoragePolicySpec as Hr, PersistedMutableNodeState as Ht, getOriginIndexFromItem as I, CredentialBindingKey as Ia, TriggerRuntimeDiagnostics as Ii, RunEventSubscription as In, WorkflowNodeConnection as Ir, ExecutionFrontierPlan as It, PayloadStorageKind as J, CredentialSessionFactory as Ja, TriggerInstanceId as Ji, ItemBinary as Jn, triggerNodeSetupStateType as Jr, PersistedWorkflowSnapshotNode as Jt, ExecutionInstanceId as K, CredentialOAuth2ScopesFromPublicConfig as Ka, WorkflowSnapshotResolver as Ki, ExecutionMode as Kn, runnableNodeOutputType as Kr, PersistedRunState as Kt, PortsEmission as L, CredentialFieldSchema as La, TriggerSetupContext as Li, TestCaseRunStatus as Ln, WorkflowPolicyRuntimeDefaults as Lr, NodeExecutionError as Lt, NoOpCostTrackingTelemetry as M, AnyCredentialType as Ma, RunnableNodeExecuteArgs as Mi, EngineExecutionLimitsPolicy as Mn, WorkflowErrorHandler as Mr, ConnectionInvocationId as Mt, ExpRetryPolicy as N, CredentialAdvancedSectionPresentation as Na, TestableTriggerNode as Ni, EngineExecutionLimitsPolicyConfig as Nn, WorkflowErrorHandlerSpec as Nr, ConnectionInvocationRecord as Nt, StepSequenceOutput as O, CostTrackingTelemetryMetricNames as Oa, PersistedTriggerSetupState as Oi, registry as On, TriggerNodeSetupState as Or, AgentMcpIntegration as Ot, RetryPolicy as P, CredentialAuthDefinition as Pa, TriggerCleanupHandle as Pi, RunEvent as Pn, WorkflowGraph as Pr, CurrentStateExecutionRequest as Pt, PersistedRunWorkItemKind as Q, CredentialType as Qa, WebhookTriggerResolution as Qi, JsonObject as Qn, RetryPolicySpec as Qr, RunCurrentState as Qt, emitPorts as R, CredentialHealth as Ra, TriggerSetupStateFor as Ri, TestSuiteRunStatus as Rn, WorkflowPrunePolicySpec as Rr, NodeExecutionSnapshot as Rt, AnyRunnableNodeConfig as S, NoOpTelemetryArtifactReference as Sa, NodeExecutionRequest as Si, inject as Sn, RunIdFactory as Sr, AssertionResult as St, BranchMoreArgs as T, CostTrackingTelemetry as Ta, NodeExecutionStatePublisher as Ti, instanceCachingFactory as Tn, RunnableNodeOutputJson as Tr, deriveAssertionPassed as Tt, BatchId as U, CredentialJsonRecord as Ua, WorkflowRunnerResolver as Ui, BinaryAttachment as Un, branchRef as Ur, PersistedMutableRunState as Ut, McpServerDeclaration as V, CredentialInstanceId as Va, WorkflowNodeInstanceFactory as Vi, TestTriggerSetupContext as Vn, WorkflowStoragePolicyResolver as Vr, PendingNodeExecution as Vt, ConnectionInvocationKind as W, CredentialMaterialSourceKind as Wa, WorkflowRunnerService as Wi, BinaryPreviewKind as Wn, nodeRef as Wr, PersistedRunControlState as Wt, PersistedExecutionInstanceRecord as X, CredentialSessionService as Xa, WebhookInvocationMatch as Xi, JsonArray as Xn, FixedRetryPolicySpec as Xr, PinnedNodeOutputsByPort as Xt, PersistedExecutionInstanceKind as Y, CredentialSessionFactoryArgs as Ya, WebhookControlSignal as Yi, Items as Yn, ExponentialRetryPolicySpec as Yr, PersistedWorkflowTokenRegistryLike as Yt, PersistedRunSlotProjectionRecord as Z, CredentialSetupStatus as Za, WebhookTriggerMatcher as Zi, JsonNonArray as Zn, NoneRetryPolicySpec as Zr, RunCompletionNotifier as Zt, NodeIdSlugifier as _, CodemationTelemetryAttributeNames as _a, NodeActivationRequest as _i, Lifecycle as _n, ParentExecutionRef as _r, ItemExprResolvedContext as _t, RunPolicySnapshotFactory as a, TelemetryArtifactAttachment as aa, BinaryStorageWriteResult as ai, RunStatus as an, PollingTriggerLogger as ao, NodeErrorHandler as ar, WorkItemStatus as at, ChainCursor as b, NoOpNodeExecutionTelemetry as ba, NodeBinaryAttachmentService as bi, container$1 as bn, RunDataSnapshot as br, resolveItemExprsForExecution as bt, RunTerminalPersistenceCoordinator as c, TelemetryAttributes as ca, ExecutableTriggerNode as ci, RunTestContext as cn, NodeConnectionName as co, NodeIdRef as cr, CostCatalog as ct, DefaultWorkflowGraphFactory as d, TelemetryScope as da, ExecutionContextFactory as di, WorkflowExecutionPruneRepository as dn, PersistedTokenId as do, NodeKind as dr, Param as dt, AllWorkflowsActiveWorkflowActivationPolicy as ea, BinaryBody as ei, RunExecutionOptions as en, CredentialTypeId as eo, JsonValue as er, RunIterationDto as et, WorkflowExecutableNodeClassifierFactory as f, TelemetrySpanEnd as fa, ItemNode as fi, WorkflowExecutionRepository as fn, WorkflowId as fo, NodeOffloadPolicy as fr, ParamDeep as ft, ConnectionInvocationIdFactory as g, GenAiTelemetryAttributeNames as ga, NodeActivationReceipt as gi, InjectionToken$1 as gn, PairedItemRef as gr, ItemExprContext as gt, ConnectionNodeIdFactory as h, CodemationTelemetryMetricNames as ha, NodeActivationContinuation as hi, Disposable as hn, NodeSchedulerDecision as hr, ItemExprCallback as ht, WorkflowSnapshotCodec as i, NodeExecutionTelemetry as ia, BinaryStorageWriteRequest as ii, RunStateResetRequest as in, NoOpPollingTriggerLogger as io, NodeDefinition as ir, WorkItemId as it, NoOpCostTrackingTelemetryFactory as j, CollectionsContext as ja, RunnableNode as ji, ENGINE_EXECUTION_LIMITS_DEFAULTS as jn, WorkflowErrorContext as jr, ConnectionInvocationAppendArgs as jt, ValidStepSequence as k, CostTrackingUsageRecord as ka, PollingTriggerHandle as ki, singleton as kn, UpstreamRefPlaceholder as kr, AgentMcpToolMap as kt, WorkflowStoragePolicyEvaluator as l, TelemetryChildSpanStart as la, ExecutionBinaryService as li, WebhookRunResult as ln, NodeId as lo, NodeInspectorSummaryRow as lr, CostCatalogEntry as lt, NodeIterationIdFactory as m, TelemetrySpanScope as ma, MultiInputNode as mi, DependencyContainer$1 as mn, NodeRef as mr, ItemExprArgs as mt, InMemoryLiveWorkflowRepository as n, ExecutionTelemetry as na, BinaryStorageReadResult as ni, RunQueueEntry as nn, CredentialUnboundError as no, NodeActivationId as nr, RunSlotProjectionState as nt, EngineExecutionLimitsPolicyFactory as o, TelemetryArtifactReference as oa, EngineDeps as oi, RunStopCondition as on, PollingTriggerDedupWindow as oo, NodeErrorHandlerArgs as or, WorkflowDetailSelectionState as ot, WorkflowExecutableNodeClassifier as p, TelemetrySpanEventRecord as pa, LiveWorkflowRepository as pi, Container as pn, NodeOutputs as pr, ItemExpr as pt, ExecutionPayloadPolicyFields as q, CredentialRequirement as qa, HttpMethod as qi, Item as qn, triggerNodeOutputType as qr, PersistedWorkflowSnapshot as qt, EngineWorkflowRunnerService as r, ExecutionTelemetryFactory as ra, BinaryStorageStatResult as ri, RunResult as rn, OAuth2ProviderFromPublicConfig as ro, NodeConfigBase as rr, SlotExecutionStateDto as rt, WorkflowPolicyErrorServices as s, TelemetryAttributePrimitive as sa, EngineHost as si, RunSummary as sn, InputPortKey as so, NodeErrorHandlerSpec as sr, WorkflowRunDetailDto as st, RunIntentService as t, WorkflowActivationPolicy as ta, BinaryStorage as ti, RunPruneCandidate as tn, CredentialTypeRegistry as to, MutableRunData as tr, RunRevision as tt, Engine as u, TelemetryMetricRecord as ua, ExecutionContext as ui, WorkflowExecutionListingRepository as un, OutputPortKey as uo, NodeIterationId as ur, Expr as ut, WorkflowDefinitionError as v, NoOpExecutionTelemetryFactory as va, NodeActivationRequestBase as vi, RegistrationOptions as vn, PersistedRunPolicySnapshot as vr, isItemExpr as vt, BooleanWhenOverloads as w, CostTrackingPriceQuote as wa, NodeExecutionScheduler as wi, injectable as wn, RunnableNodeInputJson as wr, DEFAULT_ASSERTION_PASS_THRESHOLD as wt, WhenBuilder as x, NoOpTelemetrySpanScope as xa, NodeExecutionContext as xi, delay as xn, RunId as xr, resolveItemExprsInUnknown as xt, WorkflowBuilder as y, NoOpExecutionTelemetry as ya, NodeActivationScheduler as yi, TypeToken as yn, RunDataFactory as yr, itemExpr as yt, isPortsEmission as z, CredentialHealthStatus as za, TriggerSetupStateRepository as zi, TestSuiteRunId as zn, WorkflowStoragePolicyDecisionArgs as zr, NodeExecutionStatus as zt };
|
|
2839
|
+
//# sourceMappingURL=RunIntentService-BrEq6Jm6.d.ts.map
|