@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,694 @@
1
+ import { $r as RunEventBus, $t as BinaryBody, Ar as WorkflowExecutionRepository, Cn as NodeExecutionScheduler, Ct as RunDataSnapshot, Dr as WebhookRunResult, En as NodeResolver, Er as RunSummary, Et as RunnableNodeConfig, Ft as WorkflowErrorHandler, G as BinaryAttachment, Gn as WebhookInvocationMatch, Hn as HttpMethod, I as CredentialSessionService, In as WorkflowNodeInstanceFactory, It as WorkflowErrorHandlerSpec, J as ExecutionMode, Jn as WebhookTriggerRoutingDiagnostics, Kn as WebhookTriggerMatcher, Ln as WorkflowRepository, Lr as TypeToken, N as CredentialRequirement, Nt as WorkflowDefinition, Or as WorkflowExecutionListingRepository, Q as Items, Qr as RunEvent, Sn as NodeExecutionRequestHandler, Sr as RunResult, St as RunDataFactory, Tr as RunStopCondition, Ut as WorkflowStoragePolicyDecisionArgs, Vn as WorkflowSnapshotResolver, Vt as WorkflowPolicyRuntimeDefaults, X as Item, Xn as WorkflowActivationPolicy, Xr as EngineExecutionLimitsPolicy, Zr as EngineExecutionLimitsPolicyConfig, _r as RunCurrentState, an as EngineDeps, at as NodeConfigBase, bn as NodeExecutionContext, br as RunPruneCandidate, bt as PersistedRunPolicySnapshot, cn as ExecutionBinaryService, ct as NodeErrorHandler, dn as LiveWorkflowRepository, dr as PersistedRunState, dt as NodeId, ei as RunEventSubscription, en as BinaryStorage, er as CurrentStateExecutionRequest, gn as NodeActivationRequest, gt as NodeSchedulerDecision, hn as NodeActivationReceipt, in as BinaryStorageWriteResult, ir as NodeExecutionSnapshot, it as NodeActivationId, kr as WorkflowExecutionPruneRepository, ln as ExecutionContext, mn as NodeActivationContinuation, mr as PersistedWorkflowTokenRegistryLike, mt as NodeOutputs, n as WorkflowSnapshotCodec, nn as BinaryStorageStatResult, or as NodeInputsByPort, pr as PersistedWorkflowSnapshotNode, pt as NodeOffloadPolicy, qn as WebhookTriggerResolution, rt as MutableRunData, si as RetryPolicySpec, st as NodeDefinition, tn as BinaryStorageReadResult, tr as EngineRunCounters, un as ExecutionContextFactory, ut as NodeErrorHandlerSpec, vn as NodeActivationScheduler, wn as NodeExecutionStatePublisher, wt as RunId, xn as NodeExecutionRequest, yn as NodeBinaryAttachmentService, yr as RunExecutionOptions, yt as ParentExecutionRef, zt as WorkflowId } from "./InMemoryLiveWorkflowRepository-DxoualoC.js";
2
+ import { ZodType, input, output } from "zod";
3
+
4
+ //#region src/orchestration/Engine.d.ts
5
+ interface EngineTriggerRuntime {
6
+ startTriggers(): Promise<void>;
7
+ stop(): Promise<void>;
8
+ syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
9
+ createTriggerTestItems(args: {
10
+ workflow: WorkflowDefinition;
11
+ nodeId: NodeId;
12
+ }): Promise<Items | undefined>;
13
+ }
14
+ interface EngineRunStartService {
15
+ runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
16
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
17
+ mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
18
+ }>): Promise<RunResult>;
19
+ runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
20
+ }
21
+ interface EngineRunContinuationService {
22
+ markNodeRunning(args: {
23
+ runId: RunId;
24
+ activationId: NodeActivationId;
25
+ nodeId: NodeId;
26
+ inputsByPort: NodeInputsByPort;
27
+ }): Promise<void>;
28
+ resumeFromNodeResult(args: {
29
+ runId: RunId;
30
+ activationId: NodeActivationId;
31
+ nodeId: NodeId;
32
+ outputs: NodeOutputs;
33
+ }): Promise<RunResult>;
34
+ resumeFromNodeError(args: {
35
+ runId: RunId;
36
+ activationId: NodeActivationId;
37
+ nodeId: NodeId;
38
+ error: Error;
39
+ }): Promise<RunResult>;
40
+ resumeFromStepResult(args: {
41
+ runId: RunId;
42
+ activationId: NodeActivationId;
43
+ nodeId: NodeId;
44
+ outputs: NodeOutputs;
45
+ }): Promise<RunResult>;
46
+ resumeFromStepError(args: {
47
+ runId: RunId;
48
+ activationId: NodeActivationId;
49
+ nodeId: NodeId;
50
+ error: Error;
51
+ }): Promise<RunResult>;
52
+ waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
53
+ status: "completed" | "failed";
54
+ }>>;
55
+ waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
56
+ }
57
+ interface EngineNodeExecutionRequestHandler {
58
+ handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
59
+ }
60
+ interface EngineFacadeDeps {
61
+ liveWorkflowRepository: LiveWorkflowRepository;
62
+ tokenRegistry: PersistedWorkflowTokenRegistryLike;
63
+ webhookTriggerMatcher: WebhookTriggerMatcher;
64
+ workflowSnapshotResolver: WorkflowSnapshotResolver;
65
+ triggerRuntime: EngineTriggerRuntime;
66
+ runStartService: EngineRunStartService;
67
+ runContinuationService: EngineRunContinuationService;
68
+ nodeExecutionRequestHandler: EngineNodeExecutionRequestHandler;
69
+ }
70
+ /**
71
+ * Runtime facade for orchestration, continuation, triggers, and webhook routing.
72
+ * Prefer {@link import("../intents/RunIntentService").RunIntentService} for host/HTTP invocation boundaries.
73
+ * The class token is exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
74
+ */
75
+ declare class Engine implements NodeActivationContinuation, NodeExecutionRequestHandler {
76
+ private readonly deps;
77
+ constructor(deps: EngineFacadeDeps);
78
+ loadWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
79
+ getTokenRegistry(): EngineFacadeDeps["tokenRegistry"];
80
+ resolveWorkflowSnapshot(args: {
81
+ workflowId: WorkflowId;
82
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
83
+ }): WorkflowDefinition | undefined;
84
+ startTriggers(): Promise<void>;
85
+ syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
86
+ start(workflows: WorkflowDefinition[]): Promise<void>;
87
+ stop(): Promise<void>;
88
+ resolveWebhookTrigger(args: {
89
+ endpointPath: string;
90
+ method: HttpMethod;
91
+ }): WebhookTriggerResolution;
92
+ createTriggerTestItems(args: {
93
+ workflow: WorkflowDefinition;
94
+ nodeId: NodeId;
95
+ }): Promise<Items | undefined>;
96
+ runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
97
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
98
+ mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
99
+ }>): Promise<RunResult>;
100
+ runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
101
+ markNodeRunning(args: {
102
+ runId: RunId;
103
+ activationId: NodeActivationId;
104
+ nodeId: NodeId;
105
+ inputsByPort: NodeInputsByPort;
106
+ }): Promise<void>;
107
+ resumeFromNodeResult(args: {
108
+ runId: RunId;
109
+ activationId: NodeActivationId;
110
+ nodeId: NodeId;
111
+ outputs: NodeOutputs;
112
+ }): Promise<RunResult>;
113
+ resumeFromNodeError(args: {
114
+ runId: RunId;
115
+ activationId: NodeActivationId;
116
+ nodeId: NodeId;
117
+ error: Error;
118
+ }): Promise<RunResult>;
119
+ resumeFromStepResult(args: {
120
+ runId: RunId;
121
+ activationId: NodeActivationId;
122
+ nodeId: NodeId;
123
+ outputs: NodeOutputs;
124
+ }): Promise<RunResult>;
125
+ resumeFromStepError(args: {
126
+ runId: RunId;
127
+ activationId: NodeActivationId;
128
+ nodeId: NodeId;
129
+ error: Error;
130
+ }): Promise<RunResult>;
131
+ waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
132
+ status: "completed" | "failed";
133
+ }>>;
134
+ waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
135
+ handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
136
+ }
137
+ //#endregion
138
+ //#region src/workflowSnapshots/MissingRuntimeFallbacksFactory.d.ts
139
+ declare class MissingRuntimeFallbacks {
140
+ createDefinition(snapshotNode: PersistedWorkflowSnapshotNode): NodeDefinition;
141
+ }
142
+ //#endregion
143
+ //#region src/runtime/EngineFactory.d.ts
144
+ /**
145
+ * {@link EngineDeps} plus optional overrides for workflow-snapshot materialization.
146
+ * Overrides keep default construction in this factory while allowing tests or advanced wiring to inject instances.
147
+ */
148
+ type EngineCompositionDeps = EngineDeps & {
149
+ workflowSnapshotCodec?: WorkflowSnapshotCodec;
150
+ missingRuntimeFallbacks?: MissingRuntimeFallbacks;
151
+ /** When set, used for run-start, trigger, and continuation limit defaults. */
152
+ executionLimitsPolicy?: EngineExecutionLimitsPolicy;
153
+ };
154
+ /**
155
+ * Composes the {@link Engine} graph from {@link EngineCompositionDeps}. Production wiring usually goes through
156
+ * {@link import("../bootstrap/runtime/EngineRuntimeRegistrar").EngineRuntimeRegistrar}; this factory remains for tests and custom composition.
157
+ * Exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
158
+ */
159
+ declare class EngineFactory {
160
+ create(deps: EngineCompositionDeps): Engine;
161
+ }
162
+ //#endregion
163
+ //#region src/events/NodeEventPublisher.d.ts
164
+ /** Publishes node lifecycle snapshots onto the run {@link RunEventBus}. */
165
+ declare class NodeEventPublisher {
166
+ private readonly eventBus;
167
+ constructor(eventBus: RunEventBus | undefined);
168
+ publish(kind: "nodeQueued" | "nodeStarted" | "nodeCompleted" | "nodeFailed", snapshot: NodeExecutionSnapshot): Promise<void>;
169
+ }
170
+ //#endregion
171
+ //#region src/execution/CredentialResolverFactory.d.ts
172
+ declare class CredentialResolverFactory {
173
+ private readonly credentialSessions;
174
+ constructor(credentialSessions: CredentialSessionService);
175
+ create(workflowId: WorkflowId, nodeId: NodeId, config?: NodeExecutionContext["config"]): NodeExecutionContext["getCredential"];
176
+ }
177
+ //#endregion
178
+ //#region src/execution/asyncSleeper.types.d.ts
179
+ interface AsyncSleeper {
180
+ sleep(ms: number): Promise<void>;
181
+ }
182
+ //#endregion
183
+ //#region src/execution/DefaultAsyncSleeper.d.ts
184
+ declare class DefaultAsyncSleeper implements AsyncSleeper {
185
+ sleep(ms: number): Promise<void>;
186
+ }
187
+ //#endregion
188
+ //#region src/execution/DefaultExecutionContextFactory.d.ts
189
+ declare class DefaultExecutionContextFactory implements ExecutionContextFactory {
190
+ private readonly binaryStorage;
191
+ private readonly currentDate;
192
+ constructor(binaryStorage?: BinaryStorage, currentDate?: () => Date);
193
+ create(args: {
194
+ runId: RunId;
195
+ workflowId: WorkflowId;
196
+ parent?: ParentExecutionRef;
197
+ subworkflowDepth: number;
198
+ engineMaxNodeActivations: number;
199
+ engineMaxSubworkflowDepth: number;
200
+ data: RunDataSnapshot;
201
+ nodeState?: NodeExecutionStatePublisher;
202
+ getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
203
+ }): ExecutionContext;
204
+ }
205
+ //#endregion
206
+ //#region src/execution/InProcessRetryRunner.d.ts
207
+ declare class InProcessRetryRunner {
208
+ private readonly sleeper;
209
+ constructor(sleeper: AsyncSleeper);
210
+ run<T>(policy: RetryPolicySpec | undefined, work: () => Promise<T>): Promise<T>;
211
+ private static delayAfterFailureMs;
212
+ private static normalizePolicy;
213
+ private static assertPositiveInt;
214
+ private static assertNonNegativeFinite;
215
+ private static assertMultiplier;
216
+ }
217
+ //#endregion
218
+ //#region src/execution/NodeExecutor.d.ts
219
+ declare class NodeExecutor {
220
+ private readonly nodeInstanceFactory;
221
+ private readonly retryRunner;
222
+ constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner);
223
+ execute(request: NodeActivationRequest): Promise<NodeOutputs>;
224
+ private executeMultiInputNode;
225
+ private executeSingleInputNode;
226
+ }
227
+ //#endregion
228
+ //#region src/execution/NodeInstanceFactory.d.ts
229
+ declare class NodeInstanceFactory implements WorkflowNodeInstanceFactory {
230
+ private readonly nodeResolver;
231
+ constructor(nodeResolver: NodeResolver);
232
+ createNodes(workflow: WorkflowDefinition): Map<NodeId, unknown>;
233
+ createNode(definition: WorkflowDefinition["nodes"][number]): unknown;
234
+ createByType(type: TypeToken<unknown>): unknown;
235
+ }
236
+ //#endregion
237
+ //#region src/contracts/Clock.d.ts
238
+ /** Port for time; inject `SystemClock` in production and a fake/test clock in tests. */
239
+ interface Clock {
240
+ now(): Date;
241
+ }
242
+ declare class SystemClock implements Clock {
243
+ now(): Date;
244
+ }
245
+ //#endregion
246
+ //#region src/ai/AiHost.d.ts
247
+ interface AgentCanvasPresentation<TIcon extends string = string> {
248
+ readonly label?: string;
249
+ readonly icon?: TIcon;
250
+ }
251
+ type ZodSchemaAny = ZodType<any, any, any>;
252
+ interface ToolConfig {
253
+ readonly type: TypeToken<Tool<ToolConfig, ZodSchemaAny, ZodSchemaAny>>;
254
+ readonly name: string;
255
+ readonly description?: string;
256
+ readonly presentation?: AgentCanvasPresentation;
257
+ getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
258
+ }
259
+ type ToolExecuteArgs<TConfig extends ToolConfig = ToolConfig, TInput = unknown> = Readonly<{
260
+ config: TConfig;
261
+ input: TInput;
262
+ ctx: NodeExecutionContext<any>;
263
+ item: Item;
264
+ itemIndex: number;
265
+ items: Items;
266
+ }>;
267
+ interface Tool<TConfig extends ToolConfig = ToolConfig, TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> {
268
+ readonly defaultDescription: string;
269
+ readonly inputSchema: TInputSchema;
270
+ readonly outputSchema: TOutputSchema;
271
+ execute(args: ToolExecuteArgs<TConfig, input<TInputSchema>>): Promise<output<TOutputSchema>> | output<TOutputSchema>;
272
+ }
273
+ type AgentTool<TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> = Tool<ToolConfig, TInputSchema, TOutputSchema>;
274
+ type AgentToolExecuteArgs<TInput = unknown> = ToolExecuteArgs<ToolConfig, TInput>;
275
+ type AgentToolToken = TypeToken<Tool<ToolConfig, ZodSchemaAny, ZodSchemaAny>>;
276
+ interface AgentToolDefinition {
277
+ readonly name: string;
278
+ readonly description: string;
279
+ readonly inputSchema: ZodSchemaAny;
280
+ }
281
+ type AgentToolCall = Readonly<{
282
+ id?: string;
283
+ name: string;
284
+ input: unknown;
285
+ }>;
286
+ type AgentToolCallPlanner<_TNodeConfig = unknown> = (item: Item, index: number, items: Items, ctx: NodeExecutionContext<any>) => ReadonlyArray<AgentToolCall>;
287
+ interface ChatModelConfig {
288
+ readonly type: TypeToken<ChatModelFactory<ChatModelConfig>>;
289
+ readonly name: string;
290
+ readonly presentation?: AgentCanvasPresentation;
291
+ getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
292
+ }
293
+ interface LangChainChatModelLike {
294
+ invoke(input: unknown, options?: unknown): Promise<unknown>;
295
+ bindTools?(tools: ReadonlyArray<unknown>): LangChainChatModelLike;
296
+ }
297
+ interface ChatModelFactory<TConfig extends ChatModelConfig = ChatModelConfig> {
298
+ create(args: Readonly<{
299
+ config: TConfig;
300
+ ctx: NodeExecutionContext<any>;
301
+ }>): Promise<LangChainChatModelLike> | LangChainChatModelLike;
302
+ }
303
+ interface AgentNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends RunnableNodeConfig<TInputJson, TOutputJson> {
304
+ readonly systemMessage: string;
305
+ readonly userMessageFormatter: (item: Item<TInputJson>, index: number, items: Items<TInputJson>, ctx: NodeExecutionContext<any>) => string;
306
+ readonly chatModel: ChatModelConfig;
307
+ readonly tools?: ReadonlyArray<ToolConfig>;
308
+ }
309
+ declare class AgentConfigInspector {
310
+ static isAgentNodeConfig(config: NodeConfigBase | undefined): config is AgentNodeConfig<any, any>;
311
+ }
312
+ type AgentAttachmentRole = "languageModel" | "tool";
313
+ //#endregion
314
+ //#region src/events/InMemoryRunEventBusRegistry.d.ts
315
+ declare class InMemoryRunEventBus implements RunEventBus {
316
+ private readonly globalListeners;
317
+ private readonly listenersByWorkflowId;
318
+ publish(event: RunEvent): Promise<void>;
319
+ subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
320
+ subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription>;
321
+ }
322
+ //#endregion
323
+ //#region src/events/EventPublishingWorkflowExecutionRepository.d.ts
324
+ declare class EventPublishingWorkflowExecutionRepository implements WorkflowExecutionRepository, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository {
325
+ private readonly inner;
326
+ private readonly eventBus;
327
+ private readonly now;
328
+ constructor(inner: WorkflowExecutionRepository, eventBus: RunEventBus, now?: () => Date);
329
+ createRun(args: Parameters<WorkflowExecutionRepository["createRun"]>[0]): Promise<void>;
330
+ load(runId: RunId): Promise<PersistedRunState | undefined>;
331
+ save(state: PersistedRunState): Promise<void>;
332
+ deleteRun(runId: RunId): Promise<void>;
333
+ listRuns(args?: Readonly<{
334
+ workflowId?: WorkflowId;
335
+ limit?: number;
336
+ }>): Promise<ReadonlyArray<RunSummary>>;
337
+ listRunsOlderThan(args: Readonly<{
338
+ beforeIso: string;
339
+ limit?: number;
340
+ }>): Promise<ReadonlyArray<RunPruneCandidate>>;
341
+ }
342
+ //#endregion
343
+ //#region src/runtime-types/persistedRuntimeTypeModelRegistry.d.ts
344
+ type DecoratedRuntimeType = Readonly<{
345
+ name?: string;
346
+ }> & object;
347
+ /** Categories of runtime classes that can be discovered and rehydrated from persisted snapshots. */
348
+ type PersistedRuntimeTypeKind = "node" | "tool" | "chatModel";
349
+ interface PersistedRuntimeTypeDecoratorOptions {
350
+ readonly name?: string;
351
+ readonly packageName?: string;
352
+ readonly moduleUrl?: string;
353
+ }
354
+ /** Serialized metadata attached to a decorated runtime type. */
355
+ interface PersistedRuntimeTypeMetadata {
356
+ readonly persistedName: string;
357
+ readonly kind: PersistedRuntimeTypeKind;
358
+ readonly packageName: string;
359
+ readonly sourceHint?: string;
360
+ }
361
+ //#endregion
362
+ //#region src/runtime-types/InjectableRuntimeDecoratorComposerRegistry.d.ts
363
+ /**
364
+ * Applies both tsyringe injectability and persisted runtime metadata in one decorator.
365
+ * This keeps runtime-type decorators thin while still recording enough data for snapshot hydration.
366
+ */
367
+ declare class InjectableRuntimeDecoratorComposer {
368
+ static compose(kind: PersistedRuntimeTypeKind, options: PersistedRuntimeTypeDecoratorOptions, decoratorFileUrl: string): ClassDecorator;
369
+ }
370
+ //#endregion
371
+ //#region src/runtime-types/PersistedRuntimeTypeMetadataStoreRegistry.d.ts
372
+ /**
373
+ * Defines and retrieves persisted runtime metadata on decorated classes.
374
+ * The metadata is attached as a non-enumerable property so runtime objects stay serializable.
375
+ */
376
+ declare class PersistedRuntimeTypeMetadataStore {
377
+ static define(target: DecoratedRuntimeType, kind: PersistedRuntimeTypeKind, options: PersistedRuntimeTypeDecoratorOptions, decoratorFileUrl: string): void;
378
+ static get(target: unknown): PersistedRuntimeTypeMetadata | undefined;
379
+ }
380
+ //#endregion
381
+ //#region src/runtime-types/PersistedRuntimeTypeNameResolver.d.ts
382
+ /** Resolves the persisted type name from either an explicit override or the class name itself. */
383
+ declare class PersistedRuntimeTypeNameResolver {
384
+ static resolve(target: DecoratedRuntimeType, override: string | undefined): string;
385
+ }
386
+ //#endregion
387
+ //#region src/runtime-types/StackTraceCallSitePathResolver.d.ts
388
+ declare class StackTraceCallSitePathResolver {
389
+ static resolve(decoratorFileUrl: string): string | undefined;
390
+ private static extractPath;
391
+ }
392
+ //#endregion
393
+ //#region src/runtime-types/runtimeTypeDecorators.types.d.ts
394
+ /** Reads persisted runtime metadata from a decorated class or object. */
395
+ declare function getPersistedRuntimeTypeMetadata(target: unknown): PersistedRuntimeTypeMetadata | undefined;
396
+ /** Marks a class as a persisted node runtime type and an injectable tsyringe service. */
397
+ declare function node(options?: PersistedRuntimeTypeDecoratorOptions): ClassDecorator;
398
+ /** Marks a class as a persisted tool runtime type and an injectable tsyringe service. */
399
+ declare function tool(options?: PersistedRuntimeTypeDecoratorOptions): ClassDecorator;
400
+ /** Marks a class as a persisted chat-model runtime type and an injectable tsyringe service. */
401
+ declare function chatModel(options?: PersistedRuntimeTypeDecoratorOptions): ClassDecorator;
402
+ //#endregion
403
+ //#region src/serialization/ItemsInputNormalizer.d.ts
404
+ /**
405
+ * Normalizes external inputs into the engine's canonical `Items` shape.
406
+ * Used at host and builder boundaries where callers may provide either a raw value,
407
+ * a single item-like object, or an array of item-like values.
408
+ */
409
+ declare class ItemsInputNormalizer {
410
+ normalize(raw: unknown): Items;
411
+ private normalizeItem;
412
+ private isItem;
413
+ }
414
+ //#endregion
415
+ //#region src/binaries/UnavailableBinaryStorage.d.ts
416
+ declare class UnavailableBinaryStorage implements BinaryStorage {
417
+ readonly driverName = "unavailable";
418
+ write(): Promise<never>;
419
+ openReadStream(): Promise<undefined>;
420
+ stat(): Promise<{
421
+ exists: false;
422
+ }>;
423
+ delete(): Promise<void>;
424
+ }
425
+ //#endregion
426
+ //#region src/binaries/DefaultExecutionBinaryServiceFactory.d.ts
427
+ declare class DefaultExecutionBinaryService implements ExecutionBinaryService {
428
+ private readonly storage;
429
+ private readonly workflowId;
430
+ private readonly runId;
431
+ private readonly now;
432
+ constructor(storage: BinaryStorage, workflowId: WorkflowId, runId: RunId, now: () => Date);
433
+ forNode(args: {
434
+ nodeId: NodeId;
435
+ activationId: NodeActivationId;
436
+ }): NodeBinaryAttachmentService;
437
+ openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
438
+ }
439
+ //#endregion
440
+ //#region src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.d.ts
441
+ /**
442
+ * Builds {@link EngineExecutionLimitsPolicy} by merging {@link ENGINE_EXECUTION_LIMITS_DEFAULTS} with optional `overrides` (e.g. host `runtime.engineExecutionLimits`).
443
+ */
444
+ declare class EngineExecutionLimitsPolicyFactory {
445
+ create(overrides?: Partial<EngineExecutionLimitsPolicyConfig>): EngineExecutionLimitsPolicy;
446
+ }
447
+ //#endregion
448
+ //#region src/policies/storage/RunPolicySnapshotFactory.d.ts
449
+ declare class RunPolicySnapshotFactory {
450
+ static create(workflow: WorkflowDefinition, defaults?: WorkflowPolicyRuntimeDefaults): PersistedRunPolicySnapshot;
451
+ }
452
+ //#endregion
453
+ //#region src/policies/storage/WorkflowStoragePolicyEvaluator.d.ts
454
+ declare class WorkflowStoragePolicyEvaluator {
455
+ private readonly nodeResolver;
456
+ constructor(nodeResolver: NodeResolver);
457
+ shouldPersist(workflow: WorkflowDefinition, snapshot: PersistedRunPolicySnapshot | undefined, args: WorkflowStoragePolicyDecisionArgs): Promise<boolean>;
458
+ private modeMatches;
459
+ }
460
+ //#endregion
461
+ //#region src/policies/storage/RunTerminalPersistenceCoordinator.d.ts
462
+ declare class RunTerminalPersistenceCoordinator {
463
+ private readonly runRepository;
464
+ private readonly storageEvaluator;
465
+ constructor(runRepository: WorkflowExecutionRepository, storageEvaluator: WorkflowStoragePolicyEvaluator);
466
+ maybeDeleteAfterTerminalState(args: {
467
+ workflow: WorkflowDefinition;
468
+ state: PersistedRunState;
469
+ finalStatus: "completed" | "failed";
470
+ finishedAt: string;
471
+ }): Promise<void>;
472
+ }
473
+ //#endregion
474
+ //#region src/policies/WorkflowPolicyErrorServices.d.ts
475
+ declare class WorkflowPolicyErrorServices {
476
+ private readonly nodeResolver;
477
+ constructor(nodeResolver: NodeResolver);
478
+ resolveNodeErrorHandler(spec: NodeErrorHandlerSpec | undefined): NodeErrorHandler | undefined;
479
+ resolveWorkflowErrorHandler(spec: WorkflowErrorHandlerSpec | undefined): WorkflowErrorHandler | undefined;
480
+ }
481
+ //#endregion
482
+ //#region src/runStorage/InMemoryBinaryStorageRegistry.d.ts
483
+ declare class InMemoryBinaryStorage implements BinaryStorage {
484
+ readonly driverName = "memory";
485
+ private readonly values;
486
+ write(args: {
487
+ storageKey: string;
488
+ body: BinaryBody;
489
+ }): Promise<BinaryStorageWriteResult>;
490
+ openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
491
+ stat(storageKey: string): Promise<BinaryStorageStatResult>;
492
+ delete(storageKey: string): Promise<void>;
493
+ }
494
+ //#endregion
495
+ //#region src/runStorage/InMemoryRunDataFactory.d.ts
496
+ declare class InMemoryRunDataFactory implements RunDataFactory {
497
+ create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
498
+ }
499
+ //#endregion
500
+ //#region src/runStorage/InMemoryWorkflowExecutionRepository.d.ts
501
+ declare class InMemoryWorkflowExecutionRepository implements WorkflowExecutionRepository, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository {
502
+ private readonly runs;
503
+ createRun(args: {
504
+ runId: RunId;
505
+ workflowId: WorkflowId;
506
+ startedAt: string;
507
+ parent?: ParentExecutionRef;
508
+ executionOptions?: PersistedRunState["executionOptions"];
509
+ control?: PersistedRunState["control"];
510
+ workflowSnapshot?: PersistedRunState["workflowSnapshot"];
511
+ mutableState?: PersistedRunState["mutableState"];
512
+ policySnapshot?: PersistedRunState["policySnapshot"];
513
+ engineCounters?: EngineRunCounters;
514
+ }): Promise<void>;
515
+ load(runId: RunId): Promise<PersistedRunState | undefined>;
516
+ save(state: PersistedRunState): Promise<void>;
517
+ deleteRun(runId: RunId): Promise<void>;
518
+ listRuns(args?: Readonly<{
519
+ workflowId?: WorkflowId;
520
+ limit?: number;
521
+ }>): Promise<ReadonlyArray<RunSummary>>;
522
+ listRunsOlderThan(args: Readonly<{
523
+ beforeIso: string;
524
+ limit?: number;
525
+ }>): Promise<ReadonlyArray<RunPruneCandidate>>;
526
+ }
527
+ //#endregion
528
+ //#region src/runStorage/RunSummaryMapper.d.ts
529
+ /** Maps persisted run state to API run summaries for listings. */
530
+ declare class RunSummaryMapper {
531
+ static fromPersistedState(state: PersistedRunState): RunSummary;
532
+ }
533
+ //#endregion
534
+ //#region src/runtime/EngineWorkflowRunnerService.d.ts
535
+ declare class EngineWorkflowRunnerService {
536
+ private readonly engine;
537
+ private readonly workflowRepository;
538
+ constructor(engine: Engine, workflowRepository: WorkflowRepository);
539
+ runById(args: {
540
+ workflowId: WorkflowId;
541
+ startAt?: NodeId;
542
+ items: Items;
543
+ parent?: ParentExecutionRef;
544
+ }): Promise<RunResult>;
545
+ private findDefaultStartNodeId;
546
+ }
547
+ //#endregion
548
+ //#region src/runtime/RunIntentService.d.ts
549
+ type StartWorkflowIntent = {
550
+ workflow: WorkflowDefinition;
551
+ startAt?: string;
552
+ items: Items;
553
+ parent?: CurrentStateExecutionRequest["parent"];
554
+ executionOptions?: RunExecutionOptions;
555
+ workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
556
+ mutableState?: CurrentStateExecutionRequest["mutableState"];
557
+ currentState?: RunCurrentState;
558
+ stopCondition?: RunStopCondition;
559
+ reset?: CurrentStateExecutionRequest["reset"];
560
+ };
561
+ type RerunFromNodeIntent = {
562
+ workflow: WorkflowDefinition;
563
+ nodeId: NodeId;
564
+ currentState: RunCurrentState;
565
+ items?: Items;
566
+ parent?: CurrentStateExecutionRequest["parent"];
567
+ executionOptions?: RunExecutionOptions;
568
+ workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
569
+ mutableState?: CurrentStateExecutionRequest["mutableState"];
570
+ };
571
+ type MatchedWebhookRunIntent = {
572
+ endpointPath: string;
573
+ method: HttpMethod;
574
+ requestItem: Items[number];
575
+ };
576
+ type WebhookMatchRunIntent = {
577
+ match: WebhookInvocationMatch;
578
+ requestItem: Items[number];
579
+ };
580
+ declare class RunIntentService {
581
+ private readonly engine;
582
+ private readonly workflowRepository;
583
+ constructor(engine: Engine, workflowRepository: WorkflowRepository);
584
+ startWorkflow(args: StartWorkflowIntent): Promise<RunResult>;
585
+ rerunFromNode(args: RerunFromNodeIntent): Promise<RunResult>;
586
+ resolveWebhookTrigger(args: {
587
+ endpointPath: string;
588
+ method: HttpMethod;
589
+ }): WebhookTriggerResolution;
590
+ runMatchedWebhook(args: MatchedWebhookRunIntent): Promise<WebhookRunResult>;
591
+ runWebhookMatch(args: WebhookMatchRunIntent): Promise<WebhookRunResult>;
592
+ /**
593
+ * Webhook-triggered runs always force inline execution first.
594
+ * This is the highest-precedence scheduler override: it wins over node hints and container defaults.
595
+ */
596
+ private createWebhookExecutionOptions;
597
+ }
598
+ //#endregion
599
+ //#region src/runtime/WorkflowRepositoryWebhookTriggerMatcher.d.ts
600
+ /**
601
+ * Resolves webhook HTTP routes from the live workflow repository (no trigger setup / registration).
602
+ * Maintains an in-memory index keyed by user-defined endpoint path for O(1) lookups after reload.
603
+ */
604
+ declare class WorkflowRepositoryWebhookTriggerMatcher implements WebhookTriggerMatcher {
605
+ private readonly workflowRepository;
606
+ private readonly workflowActivationPolicy;
607
+ private readonly diagnostics?;
608
+ private readonly routeByPath;
609
+ private engineRoutesActive;
610
+ constructor(workflowRepository: WorkflowRepository, workflowActivationPolicy: WorkflowActivationPolicy, diagnostics?: WebhookTriggerRoutingDiagnostics | undefined);
611
+ onEngineWorkflowsLoaded(): void;
612
+ onEngineStopped(): void;
613
+ reloadWebhookRoutes(): void;
614
+ lookup(endpointPath: string): WebhookInvocationMatch | undefined;
615
+ match(args: {
616
+ endpointPath: string;
617
+ method: HttpMethod;
618
+ }): WebhookInvocationMatch | undefined;
619
+ private rebuildRouteIndex;
620
+ private collectWebhookEndpointPaths;
621
+ private tryMatchFromTriggerNode;
622
+ private normalizeEndpointPath;
623
+ }
624
+ //#endregion
625
+ //#region src/scheduler/ConfigDrivenOffloadPolicy.d.ts
626
+ declare class ConfigDrivenOffloadPolicy implements NodeOffloadPolicy {
627
+ private readonly defaultMode;
628
+ constructor(defaultMode?: ExecutionMode);
629
+ decide(args: {
630
+ workflowId: WorkflowId;
631
+ nodeId: NodeId;
632
+ config: NodeConfigBase;
633
+ }): NodeSchedulerDecision;
634
+ }
635
+ //#endregion
636
+ //#region src/scheduler/InlineDrivingScheduler.d.ts
637
+ declare class InlineDrivingScheduler implements NodeActivationScheduler {
638
+ private readonly nodeExecutor;
639
+ private continuation;
640
+ private readonly drainingRuns;
641
+ private readonly queuesByRunId;
642
+ private readonly scheduledRuns;
643
+ private seq;
644
+ constructor(nodeExecutor: NodeExecutor);
645
+ setContinuation(continuation: NodeActivationContinuation): void;
646
+ enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
647
+ notifyPendingStatePersisted(runId: RunId): void;
648
+ private drainRun;
649
+ private scheduleDrain;
650
+ private resumeAfterExecutionResult;
651
+ private resumeAfterExecutionError;
652
+ private asError;
653
+ private rethrowUnlessIgnorableContinuationError;
654
+ private isIgnorableContinuationError;
655
+ }
656
+ //#endregion
657
+ //#region src/scheduler/DefaultDrivingScheduler.d.ts
658
+ declare class DefaultDrivingScheduler implements NodeActivationScheduler {
659
+ private readonly offloadPolicy;
660
+ private readonly workerScheduler;
661
+ private readonly inline;
662
+ constructor(offloadPolicy: NodeOffloadPolicy, workerScheduler: NodeExecutionScheduler, inline: InlineDrivingScheduler);
663
+ setContinuation(continuation: NodeActivationContinuation): void;
664
+ enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
665
+ notifyPendingStatePersisted(runId: string): void;
666
+ /**
667
+ * Scheduler precedence is explicit:
668
+ * 1. run-intent override (`executionOptions.localOnly`)
669
+ * 2. node-level execution hint / queue policy
670
+ * 3. container-default scheduler policy fallback
671
+ */
672
+ private selectScheduler;
673
+ private hasNodeSchedulingPreference;
674
+ private enqueueInline;
675
+ }
676
+ //#endregion
677
+ //#region src/scheduler/HintOnlyOffloadPolicy.d.ts
678
+ declare class HintOnlyOffloadPolicy implements NodeOffloadPolicy {
679
+ decide(args: {
680
+ workflowId: WorkflowId;
681
+ nodeId: NodeId;
682
+ config: NodeConfigBase;
683
+ }): NodeSchedulerDecision;
684
+ }
685
+ //#endregion
686
+ //#region src/scheduler/LocalOnlyScheduler.d.ts
687
+ declare class LocalOnlyScheduler implements NodeExecutionScheduler {
688
+ enqueue(_request: NodeExecutionRequest): Promise<{
689
+ receiptId: string;
690
+ }>;
691
+ }
692
+ //#endregion
693
+ export { NodeInstanceFactory as $, PersistedRuntimeTypeKind as A, AgentToolCallPlanner as B, node as C, PersistedRuntimeTypeMetadataStore as D, PersistedRuntimeTypeNameResolver as E, AgentCanvasPresentation as F, ChatModelFactory as G, AgentToolExecuteArgs as H, AgentConfigInspector as I, ToolConfig as J, LangChainChatModelLike as K, AgentNodeConfig as L, EventPublishingWorkflowExecutionRepository as M, InMemoryRunEventBus as N, InjectableRuntimeDecoratorComposer as O, AgentAttachmentRole as P, SystemClock as Q, AgentTool as R, getPersistedRuntimeTypeMetadata as S, StackTraceCallSitePathResolver as T, AgentToolToken as U, AgentToolDefinition as V, ChatModelConfig as W, ZodSchemaAny as X, ToolExecuteArgs as Y, Clock as Z, EngineExecutionLimitsPolicyFactory as _, ConfigDrivenOffloadPolicy as a, CredentialResolverFactory as at, ItemsInputNormalizer as b, EngineWorkflowRunnerService as c, EngineFactory as ct, InMemoryRunDataFactory as d, NodeExecutor as et, InMemoryBinaryStorage as f, RunPolicySnapshotFactory as g, WorkflowStoragePolicyEvaluator as h, InlineDrivingScheduler as i, AsyncSleeper as it, PersistedRuntimeTypeMetadata as j, PersistedRuntimeTypeDecoratorOptions as k, RunSummaryMapper as l, Engine as lt, RunTerminalPersistenceCoordinator as m, HintOnlyOffloadPolicy as n, DefaultExecutionContextFactory as nt, WorkflowRepositoryWebhookTriggerMatcher as o, NodeEventPublisher as ot, WorkflowPolicyErrorServices as p, Tool as q, DefaultDrivingScheduler as r, DefaultAsyncSleeper as rt, RunIntentService as s, EngineCompositionDeps as st, LocalOnlyScheduler as t, InProcessRetryRunner as tt, InMemoryWorkflowExecutionRepository as u, DefaultExecutionBinaryService as v, tool as w, chatModel as x, UnavailableBinaryStorage as y, AgentToolCall as z };
694
+ //# sourceMappingURL=index-CTjfVHJh.d.ts.map