@codemation/core 0.0.5 → 0.0.7

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