@codemation/core 0.0.19 → 0.2.1

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/EngineRuntimeRegistration.types-0sgV2XL2.d.ts +42 -0
  3. package/dist/EngineWorkflowRunnerService-Dx7bJsJR.d.cts +73 -0
  4. package/dist/InMemoryRunDataFactory-qIYQEar7.d.cts +94 -0
  5. package/dist/{InMemoryLiveWorkflowRepository-DxoualoC.d.ts → RunIntentService-BCvGdOSY.d.ts} +438 -9
  6. package/dist/{RunIntentService-C1nu_YwM.js → RunIntentService-BFA48UpH.js} +252 -67
  7. package/dist/RunIntentService-BFA48UpH.js.map +1 -0
  8. package/dist/{InMemoryLiveWorkflowRepository-orY1VsWG.d.cts → RunIntentService-CV8izV8t.d.cts} +214 -7
  9. package/dist/{RunIntentService-ZkjpY7MS.cjs → RunIntentService-DcxXf_AM.cjs} +262 -65
  10. package/dist/RunIntentService-DcxXf_AM.cjs.map +1 -0
  11. package/dist/bootstrap/index.cjs +14 -1135
  12. package/dist/bootstrap/index.d.cts +7 -60
  13. package/dist/bootstrap/index.d.ts +4 -40
  14. package/dist/bootstrap/index.js +3 -1122
  15. package/dist/bootstrap-D67Sf2BF.js +1136 -0
  16. package/dist/bootstrap-D67Sf2BF.js.map +1 -0
  17. package/dist/bootstrap-DoQHAEQJ.cjs +1203 -0
  18. package/dist/bootstrap-DoQHAEQJ.cjs.map +1 -0
  19. package/dist/{index-BIewO9-9.d.ts → index-CueSzHsf.d.ts} +37 -260
  20. package/dist/index.cjs +99 -223
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +201 -6
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +93 -218
  25. package/dist/index.js.map +1 -1
  26. package/dist/testing.cjs +329 -3
  27. package/dist/testing.cjs.map +1 -1
  28. package/dist/testing.d.cts +181 -4
  29. package/dist/testing.d.ts +181 -3
  30. package/dist/testing.js +319 -2
  31. package/dist/testing.js.map +1 -1
  32. package/dist/workflowActivationPolicy-B8HzTk3o.js +201 -0
  33. package/dist/workflowActivationPolicy-B8HzTk3o.js.map +1 -0
  34. package/dist/workflowActivationPolicy-BzyzXLa_.cjs +231 -0
  35. package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +1 -0
  36. package/package.json +1 -1
  37. package/src/ai/AgentConnectionNodeCollector.ts +99 -0
  38. package/src/ai/AgentToolFactory.ts +38 -2
  39. package/src/ai/AiHost.ts +1 -1
  40. package/src/authoring/defineNode.types.ts +6 -0
  41. package/src/browser.ts +11 -0
  42. package/src/contracts/executionPersistenceContracts.ts +186 -0
  43. package/src/contracts/index.ts +1 -0
  44. package/src/contracts/runFinishedAtFactory.ts +5 -2
  45. package/src/contracts/runTypes.ts +10 -0
  46. package/src/contracts/runtimeTypes.ts +6 -2
  47. package/src/contracts/workflowTypes.ts +3 -2
  48. package/src/events/EventPublishingWorkflowExecutionRepository.ts +5 -0
  49. package/src/execution/ActivationEnqueueService.ts +8 -8
  50. package/src/execution/PersistedRunStateTerminalBuilder.ts +3 -0
  51. package/src/index.ts +6 -0
  52. package/src/orchestration/NodeExecutionRequestHandlerService.ts +11 -6
  53. package/src/orchestration/RunContinuationService.ts +94 -24
  54. package/src/runStorage/InMemoryWorkflowExecutionRepository.ts +14 -1
  55. package/src/scheduler/DefaultDrivingScheduler.ts +21 -11
  56. package/src/scheduler/InlineDrivingScheduler.ts +17 -21
  57. package/src/testing/CapturingScheduler.ts +15 -0
  58. package/src/testing/EngineTestKitRunIdFactory.ts +24 -0
  59. package/src/testing/InMemoryTriggerSetupStateRepository.ts +21 -0
  60. package/src/testing/PrefixedSequentialIdGenerator.ts +17 -0
  61. package/src/testing/RegistrarEngineTestKit.types.ts +76 -0
  62. package/src/testing/RegistrarEngineTestKitFactory.ts +154 -0
  63. package/src/testing/SubWorkflowRunnerTestNode.ts +83 -0
  64. package/src/testing/WorkflowTestHarnessManualTrigger.ts +39 -0
  65. package/src/testing/WorkflowTestKit.types.ts +9 -0
  66. package/src/testing/WorkflowTestKitBuilder.ts +77 -0
  67. package/src/testing/WorkflowTestKitNodeRegistrationContextFactory.ts +17 -0
  68. package/src/testing/WorkflowTestKitRunNodeWorkflowFactory.ts +26 -0
  69. package/src/testing.ts +19 -0
  70. package/src/types/index.ts +1 -0
  71. package/src/workflow/definition/ConnectionNodeIdFactory.ts +28 -0
  72. package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs +0 -151
  73. package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs.map +0 -1
  74. package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js +0 -139
  75. package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js.map +0 -1
  76. package/dist/RunIntentService-C1nu_YwM.js.map +0 -1
  77. package/dist/RunIntentService-DjbxzBBP.d.cts +0 -288
  78. package/dist/RunIntentService-ZkjpY7MS.cjs.map +0 -1
  79. package/dist/WorkflowSnapshotCodec-DSEzKyt3.d.cts +0 -22
  80. package/dist/bootstrap/index.cjs.map +0 -1
  81. package/dist/bootstrap/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { ReadableStream } from "node:stream/web";
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";
2
+ import { DependencyContainer as Container, DependencyContainer as DependencyContainer$1, Disposable, InjectionToken as InjectionToken$1, InjectionToken as TypeToken, Lifecycle, RegistrationOptions, container, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe";
3
3
 
4
4
  //#region src/contracts/retryPolicySpec.types.d.ts
5
5
 
@@ -318,10 +318,18 @@ interface PendingNodeExecution {
318
318
  batchId?: string;
319
319
  enqueuedAt: string;
320
320
  }
321
+ interface PersistedRunSchedulingState {
322
+ pending?: PendingNodeExecution;
323
+ queue: RunQueueEntry[];
324
+ }
321
325
  interface PersistedRunState {
322
326
  runId: RunId;
323
327
  workflowId: WorkflowId;
324
328
  startedAt: string;
329
+ /** Canonical terminal time for listings and retention when persisted on the run root. */
330
+ finishedAt?: string;
331
+ /** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
332
+ revision?: number;
325
333
  parent?: ParentExecutionRef;
326
334
  executionOptions?: RunExecutionOptions;
327
335
  control?: PersistedRunControlState;
@@ -353,6 +361,7 @@ interface WorkflowExecutionRepository {
353
361
  engineCounters?: EngineRunCounters;
354
362
  }): Promise<void>;
355
363
  load(runId: RunId): Promise<PersistedRunState | undefined>;
364
+ loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
356
365
  save(state: PersistedRunState): Promise<void>;
357
366
  deleteRun?(runId: RunId): Promise<void>;
358
367
  }
@@ -703,6 +712,10 @@ interface NodeActivationReceipt {
703
712
  mode?: "local" | "worker";
704
713
  queue?: string;
705
714
  }
715
+ interface PreparedNodeActivationDispatch {
716
+ readonly receipt: NodeActivationReceipt;
717
+ dispatch(): Promise<void>;
718
+ }
706
719
  interface NodeActivationContinuation {
707
720
  markNodeRunning(args: {
708
721
  runId: RunId;
@@ -725,8 +738,7 @@ interface NodeActivationContinuation {
725
738
  }
726
739
  interface NodeActivationScheduler {
727
740
  setContinuation?(continuation: NodeActivationContinuation): void;
728
- enqueue(request: NodeActivationRequest): Promise<NodeActivationReceipt>;
729
- notifyPendingStatePersisted?(runId: RunId): void;
741
+ prepareDispatch(request: NodeActivationRequest): Promise<PreparedNodeActivationDispatch>;
730
742
  cancel?(receiptId: string): Promise<void>;
731
743
  }
732
744
  interface WorkflowNodeInstanceFactory {
@@ -800,8 +812,9 @@ interface Edge {
800
812
  }
801
813
  type NodeConnectionName = string;
802
814
  /**
803
- * Named connection from an executable parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
804
- * but are not traversed by the main execution graph.
815
+ * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
816
+ * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
817
+ * also be connection-owned nodes for recursive agent attachments.
805
818
  */
806
819
  interface WorkflowNodeConnection {
807
820
  readonly parentNodeId: NodeId;
@@ -1160,6 +1173,140 @@ declare class CredentialUnboundError extends Error {
1160
1173
  private static createMessage;
1161
1174
  }
1162
1175
  //#endregion
1176
+ //#region src/orchestration/Engine.d.ts
1177
+ interface EngineTriggerRuntime {
1178
+ startTriggers(): Promise<void>;
1179
+ stop(): Promise<void>;
1180
+ syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
1181
+ createTriggerTestItems(args: {
1182
+ workflow: WorkflowDefinition;
1183
+ nodeId: NodeId;
1184
+ }): Promise<Items | undefined>;
1185
+ }
1186
+ interface EngineRunStartService {
1187
+ runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
1188
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
1189
+ mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
1190
+ }>): Promise<RunResult>;
1191
+ runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
1192
+ }
1193
+ interface EngineRunContinuationService {
1194
+ markNodeRunning(args: {
1195
+ runId: RunId;
1196
+ activationId: NodeActivationId;
1197
+ nodeId: NodeId;
1198
+ inputsByPort: NodeInputsByPort;
1199
+ }): Promise<void>;
1200
+ resumeFromNodeResult(args: {
1201
+ runId: RunId;
1202
+ activationId: NodeActivationId;
1203
+ nodeId: NodeId;
1204
+ outputs: NodeOutputs;
1205
+ }): Promise<RunResult>;
1206
+ resumeFromNodeError(args: {
1207
+ runId: RunId;
1208
+ activationId: NodeActivationId;
1209
+ nodeId: NodeId;
1210
+ error: Error;
1211
+ }): Promise<RunResult>;
1212
+ resumeFromStepResult(args: {
1213
+ runId: RunId;
1214
+ activationId: NodeActivationId;
1215
+ nodeId: NodeId;
1216
+ outputs: NodeOutputs;
1217
+ }): Promise<RunResult>;
1218
+ resumeFromStepError(args: {
1219
+ runId: RunId;
1220
+ activationId: NodeActivationId;
1221
+ nodeId: NodeId;
1222
+ error: Error;
1223
+ }): Promise<RunResult>;
1224
+ waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
1225
+ status: "completed" | "failed";
1226
+ }>>;
1227
+ waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
1228
+ }
1229
+ interface EngineNodeExecutionRequestHandler {
1230
+ handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
1231
+ }
1232
+ interface EngineFacadeDeps {
1233
+ liveWorkflowRepository: LiveWorkflowRepository;
1234
+ tokenRegistry: PersistedWorkflowTokenRegistryLike;
1235
+ webhookTriggerMatcher: WebhookTriggerMatcher;
1236
+ workflowSnapshotResolver: WorkflowSnapshotResolver;
1237
+ triggerRuntime: EngineTriggerRuntime;
1238
+ runStartService: EngineRunStartService;
1239
+ runContinuationService: EngineRunContinuationService;
1240
+ nodeExecutionRequestHandler: EngineNodeExecutionRequestHandler;
1241
+ }
1242
+ /**
1243
+ * Runtime facade for orchestration, continuation, triggers, and webhook routing.
1244
+ * Prefer {@link import("../intents/RunIntentService").RunIntentService} for host/HTTP invocation boundaries.
1245
+ * The class token is exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
1246
+ */
1247
+ declare class Engine implements NodeActivationContinuation, NodeExecutionRequestHandler {
1248
+ private readonly deps;
1249
+ constructor(deps: EngineFacadeDeps);
1250
+ loadWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
1251
+ getTokenRegistry(): EngineFacadeDeps["tokenRegistry"];
1252
+ resolveWorkflowSnapshot(args: {
1253
+ workflowId: WorkflowId;
1254
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
1255
+ }): WorkflowDefinition | undefined;
1256
+ startTriggers(): Promise<void>;
1257
+ syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
1258
+ start(workflows: WorkflowDefinition[]): Promise<void>;
1259
+ stop(): Promise<void>;
1260
+ resolveWebhookTrigger(args: {
1261
+ endpointPath: string;
1262
+ method: HttpMethod;
1263
+ }): WebhookTriggerResolution;
1264
+ createTriggerTestItems(args: {
1265
+ workflow: WorkflowDefinition;
1266
+ nodeId: NodeId;
1267
+ }): Promise<Items | undefined>;
1268
+ runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
1269
+ workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
1270
+ mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
1271
+ }>): Promise<RunResult>;
1272
+ runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
1273
+ markNodeRunning(args: {
1274
+ runId: RunId;
1275
+ activationId: NodeActivationId;
1276
+ nodeId: NodeId;
1277
+ inputsByPort: NodeInputsByPort;
1278
+ }): Promise<void>;
1279
+ resumeFromNodeResult(args: {
1280
+ runId: RunId;
1281
+ activationId: NodeActivationId;
1282
+ nodeId: NodeId;
1283
+ outputs: NodeOutputs;
1284
+ }): Promise<RunResult>;
1285
+ resumeFromNodeError(args: {
1286
+ runId: RunId;
1287
+ activationId: NodeActivationId;
1288
+ nodeId: NodeId;
1289
+ error: Error;
1290
+ }): Promise<RunResult>;
1291
+ resumeFromStepResult(args: {
1292
+ runId: RunId;
1293
+ activationId: NodeActivationId;
1294
+ nodeId: NodeId;
1295
+ outputs: NodeOutputs;
1296
+ }): Promise<RunResult>;
1297
+ resumeFromStepError(args: {
1298
+ runId: RunId;
1299
+ activationId: NodeActivationId;
1300
+ nodeId: NodeId;
1301
+ error: Error;
1302
+ }): Promise<RunResult>;
1303
+ waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
1304
+ status: "completed" | "failed";
1305
+ }>>;
1306
+ waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
1307
+ handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
1308
+ }
1309
+ //#endregion
1163
1310
  //#region src/runtime/InMemoryLiveWorkflowRepository.d.ts
1164
1311
  declare class InMemoryLiveWorkflowRepository implements LiveWorkflowRepository {
1165
1312
  private readonly workflowsById;
@@ -1168,5 +1315,65 @@ declare class InMemoryLiveWorkflowRepository implements LiveWorkflowRepository {
1168
1315
  get(workflowId: WorkflowId): WorkflowDefinition | undefined;
1169
1316
  }
1170
1317
  //#endregion
1171
- export { OutputPortKey as $, RunCurrentState as $n, NodeActivationRequestBase as $t, ExecutionMode as A, WebhookTriggerRoutingDiagnostics as An, CoreTokens as Ar, runnableNodeInputType as At, NodeActivationId as B, NodeExecutionSnapshot as Bn, RetryPolicySpec as Br, BinaryStorageWriteResult as Bt, CredentialTypeRegistry as C, WorkflowSnapshotResolver as Cn, injectAll as Cr, WorkflowPolicyRuntimeDefaults as Ct, BinaryAttachment as D, WebhookInvocationMatch as Dn, predicateAwareClassFactory as Dr, WorkflowStoragePolicyResolver as Dt, ActivationIdFactory as E, WebhookControlSignal as En, instancePerContainerCachingFactory as Er, WorkflowStoragePolicyMode as Et, JsonArray as F, ConnectionInvocationRecord as Fn, RunEventBus as Fr, BinaryBody as Ft, NodeErrorHandlerArgs as G, PersistedMutableRunState as Gn, ExecutionContext as Gt, NodeConnectionName as H, NodeInputsByPort as Hn, EngineHost as Ht, JsonObject as I, CurrentStateExecutionRequest as In, RunEventSubscription as Ir, BinaryStorage as It, NodeKind as J, PersistedWorkflowSnapshot as Jn, MultiInputNode as Jt, NodeErrorHandlerSpec as K, PersistedRunControlState as Kn, ExecutionContextFactory as Kt, JsonPrimitive as L, EngineRunCounters as Ln, ExponentialRetryPolicySpec as Lr, BinaryStorageReadResult as Lt, Item as M, WorkflowActivationPolicy as Mn, EngineExecutionLimitsPolicy as Mr, triggerNodeOutputType as Mt, ItemBinary as N, ConnectionInvocationAppendArgs as Nn, EngineExecutionLimitsPolicyConfig as Nr, triggerNodeSetupStateType as Nt, BinaryPreviewKind as O, WebhookTriggerMatcher as On, registry as Or, WorkflowStoragePolicySpec as Ot, Items as P, ConnectionInvocationId as Pn, RunEvent as Pr, BinaryAttachmentCreateRequest as Pt, NodeSchedulerDecision as Q, RunCompletionNotifier as Qn, NodeActivationRequest as Qt, JsonValue as R, ExecutionFrontierPlan as Rn, FixedRetryPolicySpec as Rr, BinaryStorageStatResult as Rt, CredentialTypeId as S, WorkflowSnapshotFactory as Sn, inject as Sr, WorkflowNodeConnection as St, OAuth2ProviderFromPublicConfig as T, TriggerInstanceId as Tn, instanceCachingFactory as Tr, WorkflowStoragePolicyDecisionArgs as Tt, NodeDefinition as U, PendingNodeExecution as Un, ExecutableTriggerNode as Ut, NodeConfigBase as V, NodeExecutionStatus as Vn, EngineDeps as Vt, NodeErrorHandler as W, PersistedMutableNodeState as Wn, ExecutionBinaryService as Wt, NodeOutputs as X, PersistedWorkflowTokenRegistryLike as Xn, NodeActivationContinuation as Xt, NodeOffloadPolicy as Y, PersistedWorkflowSnapshotNode as Yn, Node as Yt, NodeRef as Z, PinnedNodeOutputsByPort as Zn, NodeActivationReceipt as Zt, CredentialSessionFactoryArgs as _, TriggerTestItemsContext as _n, Lifecycle as _r, WorkflowErrorHandler as _t, CredentialBindingKey as a, NodeExecutionScheduler as an, RunStateResetRequest as ar, RunDataSnapshot as at, CredentialType as b, WorkflowRunnerResolver as bn, container as br, WorkflowGraphFactory as bt, CredentialHealthStatus as c, NodeResolver as cn, RunSummary as cr, RunnableNodeConfig as ct, CredentialInstanceRecord as d, TriggerCleanupHandle as dn, WorkflowExecutionPruneRepository as dr, TriggerNodeConfig as dt, NodeActivationScheduler as en, RunEventPublisherDeps as er, PairedItemRef as et, CredentialJsonRecord as f, TriggerNode as fn, WorkflowExecutionRepository as fr, TriggerNodeOutputJson as ft, CredentialSessionFactory as g, TriggerSetupStateRepository as gn, InjectionToken as gr, WorkflowErrorContext as gt, CredentialRequirement as h, TriggerSetupStateFor as hn, Disposable as hr, WorkflowDefinition as ht, CredentialBinding as i, NodeExecutionRequestHandler as in, RunResult as ir, RunDataFactory as it, InputPortKey as j, AllWorkflowsActiveWorkflowActivationPolicy as jn, ENGINE_EXECUTION_LIMITS_DEFAULTS as jr, runnableNodeOutputType as jt, Edge as k, WebhookTriggerResolution as kn, singleton as kr, branchRef as kt, CredentialHealthTester as l, PersistedTriggerSetupState as ln, WebhookRunResult as lr, RunnableNodeInputJson as lt, CredentialOAuth2AuthDefinition as m, TriggerSetupContext as mn, DependencyContainer as mr, UpstreamRefPlaceholder as mt, AnyCredentialType as n, NodeExecutionContext as nn, RunPruneCandidate as nr, PersistedRunPolicySnapshot as nt, CredentialFieldSchema as o, NodeExecutionStatePublisher as on, RunStatus as or, RunId as ot, CredentialMaterialSourceKind as p, TriggerRuntimeDiagnostics as pn, Container as pr, TriggerNodeSetupState as pt, NodeId as q, PersistedRunState as qn, LiveWorkflowRepository as qt, CredentialAuthDefinition as r, NodeExecutionRequest as rn, RunQueueEntry as rr, PersistedTokenId as rt, CredentialHealth as s, NodeExecutor as sn, RunStopCondition as sr, RunIdFactory as st, InMemoryLiveWorkflowRepository as t, NodeBinaryAttachmentService as tn, RunExecutionOptions as tr, ParentExecutionRef as tt, CredentialInstanceId as u, TestableTriggerNode as un, WorkflowExecutionListingRepository as ur, RunnableNodeOutputJson as ut, CredentialSessionService as v, WorkflowNodeInstanceFactory as vn, RegistrationOptions as vr, WorkflowErrorHandlerSpec as vt, CredentialUnboundError as w, HttpMethod as wn, injectable as wr, WorkflowPrunePolicySpec as wt, CredentialTypeDefinition as x, WorkflowRunnerService as xn, delay as xr, WorkflowId as xt, CredentialSetupStatus as y, WorkflowRepository as yn, TypeToken as yr, WorkflowGraph as yt, MutableRunData as z, NodeExecutionError as zn, NoneRetryPolicySpec as zr, BinaryStorageWriteRequest as zt };
1172
- //# sourceMappingURL=InMemoryLiveWorkflowRepository-orY1VsWG.d.cts.map
1318
+ //#region src/runtime/RunIntentService.d.ts
1319
+ type StartWorkflowIntent = {
1320
+ workflow: WorkflowDefinition;
1321
+ startAt?: string;
1322
+ items: Items;
1323
+ synthesizeTriggerItems?: boolean;
1324
+ parent?: CurrentStateExecutionRequest["parent"];
1325
+ executionOptions?: RunExecutionOptions;
1326
+ workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
1327
+ mutableState?: CurrentStateExecutionRequest["mutableState"];
1328
+ currentState?: RunCurrentState;
1329
+ stopCondition?: RunStopCondition;
1330
+ reset?: CurrentStateExecutionRequest["reset"];
1331
+ };
1332
+ type RerunFromNodeIntent = {
1333
+ workflow: WorkflowDefinition;
1334
+ nodeId: NodeId;
1335
+ currentState: RunCurrentState;
1336
+ items?: Items;
1337
+ synthesizeTriggerItems?: boolean;
1338
+ parent?: CurrentStateExecutionRequest["parent"];
1339
+ executionOptions?: RunExecutionOptions;
1340
+ workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
1341
+ mutableState?: CurrentStateExecutionRequest["mutableState"];
1342
+ };
1343
+ type MatchedWebhookRunIntent = {
1344
+ endpointPath: string;
1345
+ method: HttpMethod;
1346
+ requestItem: Items[number];
1347
+ };
1348
+ type WebhookMatchRunIntent = {
1349
+ match: WebhookInvocationMatch;
1350
+ requestItem: Items[number];
1351
+ };
1352
+ declare class RunIntentService {
1353
+ private readonly engine;
1354
+ private readonly workflowRepository;
1355
+ constructor(engine: Engine, workflowRepository: WorkflowRepository);
1356
+ startWorkflow(args: StartWorkflowIntent): Promise<RunResult>;
1357
+ rerunFromNode(args: RerunFromNodeIntent): Promise<RunResult>;
1358
+ private resolveStartWorkflowItems;
1359
+ private resolveRerunItems;
1360
+ private resolveStartWorkflowTriggerNodeId;
1361
+ private resolveRerunTriggerNodeId;
1362
+ private firstTriggerNodeId;
1363
+ private isTriggerNode;
1364
+ private hasNonEmptyItems;
1365
+ resolveWebhookTrigger(args: {
1366
+ endpointPath: string;
1367
+ method: HttpMethod;
1368
+ }): WebhookTriggerResolution;
1369
+ runMatchedWebhook(args: MatchedWebhookRunIntent): Promise<WebhookRunResult>;
1370
+ runWebhookMatch(args: WebhookMatchRunIntent): Promise<WebhookRunResult>;
1371
+ /**
1372
+ * Webhook-triggered runs always force inline execution first.
1373
+ * This is the highest-precedence scheduler override: it wins over node hints and container defaults.
1374
+ */
1375
+ private createWebhookExecutionOptions;
1376
+ }
1377
+ //#endregion
1378
+ export { NodeRef as $, PersistedWorkflowSnapshotNode as $n, NodeActivationReceipt as $t, BinaryPreviewKind as A, WebhookInvocationMatch as An, instancePerContainerCachingFactory as Ar, WorkflowStoragePolicySpec as At, JsonValue as B, EngineRunCounters as Bn, RunEventSubscription as Br, BinaryStorageStatResult as Bt, CredentialTypeDefinition as C, WorkflowRunnerResolver as Cn, TypeToken as Cr, WorkflowId as Ct, OAuth2ProviderFromPublicConfig as D, HttpMethod as Dn, injectAll as Dr, WorkflowStoragePolicyDecisionArgs as Dt, CredentialUnboundError as E, WorkflowSnapshotResolver as En, inject as Er, WorkflowPrunePolicySpec as Et, ItemBinary as F, WorkflowActivationPolicy as Fn, ENGINE_EXECUTION_LIMITS_DEFAULTS as Fr, triggerNodeSetupStateType as Ft, NodeDefinition as G, NodeInputsByPort as Gn, ExecutableTriggerNode as Gt, NodeActivationId as H, NodeExecutionError as Hn, FixedRetryPolicySpec as Hr, BinaryStorageWriteResult as Ht, Items as I, ConnectionInvocationAppendArgs as In, EngineExecutionLimitsPolicy as Ir, BinaryAttachmentCreateRequest as It, NodeErrorHandlerSpec as J, PersistedMutableRunState as Jn, ExecutionContextFactory as Jt, NodeErrorHandler as K, PendingNodeExecution as Kn, ExecutionBinaryService as Kt, JsonArray as L, ConnectionInvocationId as Ln, EngineExecutionLimitsPolicyConfig as Lr, BinaryBody as Lt, ExecutionMode as M, WebhookTriggerResolution as Mn, registry as Mr, runnableNodeInputType as Mt, InputPortKey as N, WebhookTriggerRoutingDiagnostics as Nn, singleton as Nr, runnableNodeOutputType as Nt, ActivationIdFactory as O, TriggerInstanceId as On, injectable as Or, WorkflowStoragePolicyMode as Ot, Item as P, AllWorkflowsActiveWorkflowActivationPolicy as Pn, CoreTokens as Pr, triggerNodeOutputType as Pt, NodeOutputs as Q, PersistedWorkflowSnapshot as Qn, NodeActivationContinuation as Qt, JsonObject as R, ConnectionInvocationRecord as Rn, RunEvent as Rr, BinaryStorage as Rt, CredentialType as S, WorkflowRepository as Sn, RegistrationOptions as Sr, WorkflowGraphFactory as St, CredentialTypeRegistry as T, WorkflowSnapshotFactory as Tn, delay as Tr, WorkflowPolicyRuntimeDefaults as Tt, NodeConfigBase as U, NodeExecutionSnapshot as Un, NoneRetryPolicySpec as Ur, EngineDeps as Ut, MutableRunData as V, ExecutionFrontierPlan as Vn, ExponentialRetryPolicySpec as Vr, BinaryStorageWriteRequest as Vt, NodeConnectionName as W, NodeExecutionStatus as Wn, RetryPolicySpec as Wr, EngineHost as Wt, NodeKind as X, PersistedRunSchedulingState as Xn, MultiInputNode as Xt, NodeId as Y, PersistedRunControlState as Yn, LiveWorkflowRepository as Yt, NodeOffloadPolicy as Z, PersistedRunState as Zn, Node as Zt, CredentialRequirement as _, TriggerSetupContext as _n, Container as _r, WorkflowDefinition as _t, CredentialAuthDefinition as a, NodeExecutionRequest as an, RunExecutionOptions as ar, PersistedTokenId as at, CredentialSessionService as b, TriggerTestItemsContext as bn, InjectionToken$1 as br, WorkflowErrorHandlerSpec as bt, CredentialFieldSchema as c, NodeExecutionStatePublisher as cn, RunResult as cr, RunId as ct, CredentialHealthTester as d, PersistedTriggerSetupState as dn, RunStopCondition as dr, RunnableNodeInputJson as dt, NodeActivationRequest as en, PersistedWorkflowTokenRegistryLike as er, NodeSchedulerDecision as et, CredentialInstanceId as f, PreparedNodeActivationDispatch as fn, RunSummary as fr, RunnableNodeOutputJson as ft, CredentialOAuth2AuthDefinition as g, TriggerRuntimeDiagnostics as gn, WorkflowExecutionRepository as gr, UpstreamRefPlaceholder as gt, CredentialMaterialSourceKind as h, TriggerNode as hn, WorkflowExecutionPruneRepository as hr, TriggerNodeSetupState as ht, AnyCredentialType as i, NodeExecutionContext as in, RunEventPublisherDeps as ir, PersistedRunPolicySnapshot as it, Edge as j, WebhookTriggerMatcher as jn, predicateAwareClassFactory as jr, branchRef as jt, BinaryAttachment as k, WebhookControlSignal as kn, instanceCachingFactory as kr, WorkflowStoragePolicyResolver as kt, CredentialHealth as l, NodeExecutor as ln, RunStateResetRequest as lr, RunIdFactory as lt, CredentialJsonRecord as m, TriggerCleanupHandle as mn, WorkflowExecutionListingRepository as mr, TriggerNodeOutputJson as mt, InMemoryLiveWorkflowRepository as n, NodeActivationScheduler as nn, RunCompletionNotifier as nr, PairedItemRef as nt, CredentialBinding as o, NodeExecutionRequestHandler as on, RunPruneCandidate as or, RunDataFactory as ot, CredentialInstanceRecord as p, TestableTriggerNode as pn, WebhookRunResult as pr, TriggerNodeConfig as pt, NodeErrorHandlerArgs as q, PersistedMutableNodeState as qn, ExecutionContext as qt, Engine as r, NodeBinaryAttachmentService as rn, RunCurrentState as rr, ParentExecutionRef as rt, CredentialBindingKey as s, NodeExecutionScheduler as sn, RunQueueEntry as sr, RunDataSnapshot as st, RunIntentService as t, NodeActivationRequestBase as tn, PinnedNodeOutputsByPort as tr, OutputPortKey as tt, CredentialHealthStatus as u, NodeResolver as un, RunStatus as ur, RunnableNodeConfig as ut, CredentialSessionFactory as v, TriggerSetupStateFor as vn, DependencyContainer$1 as vr, WorkflowErrorContext as vt, CredentialTypeId as w, WorkflowRunnerService as wn, container as wr, WorkflowNodeConnection as wt, CredentialSetupStatus as x, WorkflowNodeInstanceFactory as xn, Lifecycle as xr, WorkflowGraph as xt, CredentialSessionFactoryArgs as y, TriggerSetupStateRepository as yn, Disposable as yr, WorkflowErrorHandler as yt, JsonPrimitive as z, CurrentStateExecutionRequest as zn, RunEventBus as zr, BinaryStorageReadResult as zt };
1379
+ //# sourceMappingURL=RunIntentService-CV8izV8t.d.cts.map