@codemation/core 0.11.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{CostCatalogContract-DZgcUBE4.d.cts → CostCatalogContract-Dxq1BTyi.d.cts} +2 -2
  3. package/dist/{EngineRuntimeRegistration.types-Cggm5GVY.d.cts → EngineRuntimeRegistration.types-CqcTWexS.d.cts} +3 -3
  4. package/dist/{EngineRuntimeRegistration.types-BQbS9_gs.d.ts → EngineRuntimeRegistration.types-Cr75cSfL.d.ts} +2 -2
  5. package/dist/InMemoryRunDataFactory-Csy2evr_.d.cts +205 -0
  6. package/dist/{ItemsInputNormalizer-CwdOhSAK.cjs → ItemsInputNormalizer-57EdA1ad.cjs} +2 -2
  7. package/dist/{ItemsInputNormalizer-CwdOhSAK.cjs.map → ItemsInputNormalizer-57EdA1ad.cjs.map} +1 -1
  8. package/dist/{ItemsInputNormalizer-_Mfcd3YU.d.ts → ItemsInputNormalizer-BWtlwdVI.d.ts} +2 -2
  9. package/dist/{ItemsInputNormalizer-D-MH8MBs.js → ItemsInputNormalizer-BkSvmfAW.js} +2 -2
  10. package/dist/{ItemsInputNormalizer-D-MH8MBs.js.map → ItemsInputNormalizer-BkSvmfAW.js.map} +1 -1
  11. package/dist/{ItemsInputNormalizer-C_dpn76M.d.cts → ItemsInputNormalizer-pLrWwUAP.d.cts} +3 -3
  12. package/dist/{RunIntentService-CEF-sFfI.d.cts → RunIntentService-BitgkKaT.d.cts} +18 -4
  13. package/dist/{RunIntentService-BVur7x9n.d.ts → RunIntentService-DYpqfu6D.d.ts} +18 -4
  14. package/dist/{agentMcpTypes-ZiNbNsEi.d.cts → agentMcpTypes-DGIwk6Ue.d.cts} +201 -4
  15. package/dist/bootstrap/index.cjs +3 -3
  16. package/dist/bootstrap/index.d.cts +63 -7
  17. package/dist/bootstrap/index.d.ts +5 -5
  18. package/dist/bootstrap/index.js +3 -3
  19. package/dist/{bootstrap-BxuTFTLB.cjs → bootstrap-BEu1fJBM.cjs} +175 -4
  20. package/dist/bootstrap-BEu1fJBM.cjs.map +1 -0
  21. package/dist/{bootstrap-D_Yyi0wL.js → bootstrap-CSeInbj1.js} +173 -4
  22. package/dist/bootstrap-CSeInbj1.js.map +1 -0
  23. package/dist/browser.cjs +4 -2
  24. package/dist/browser.d.cts +4 -4
  25. package/dist/browser.d.ts +3 -3
  26. package/dist/browser.js +3 -3
  27. package/dist/contracts.d.cts +5 -5
  28. package/dist/contracts.d.ts +2 -2
  29. package/dist/{di-BlEKdoZS.cjs → di-C-2ep8NZ.cjs} +44 -1
  30. package/dist/di-C-2ep8NZ.cjs.map +1 -0
  31. package/dist/{di-0Wop7z1y.js → di-D9Mv3kF3.js} +33 -2
  32. package/dist/di-D9Mv3kF3.js.map +1 -0
  33. package/dist/{executionPersistenceContracts-BgZMRsTa.d.cts → executionPersistenceContracts-CN9d7AnL.d.cts} +2 -2
  34. package/dist/{index-62Ba9f7D.d.ts → index-CqZeNGAp.d.ts} +343 -101
  35. package/dist/{index-zWGtEhrf.d.ts → index-rllWL4r-.d.ts} +459 -5
  36. package/dist/index.cjs +91 -161
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +458 -97
  39. package/dist/index.d.ts +5 -5
  40. package/dist/index.js +74 -159
  41. package/dist/index.js.map +1 -1
  42. package/dist/{params-B5SENSzZ.d.cts → params-DRUr0F5v.d.cts} +2 -2
  43. package/dist/{runtime-cxmUkk0l.js → runtime-6-U2Cou5.js} +690 -18
  44. package/dist/runtime-6-U2Cou5.js.map +1 -0
  45. package/dist/{runtime-DBzq5YBi.cjs → runtime-DjYXgOo0.cjs} +749 -17
  46. package/dist/runtime-DjYXgOo0.cjs.map +1 -0
  47. package/dist/testing.cjs +3 -3
  48. package/dist/testing.d.cts +3 -3
  49. package/dist/testing.d.ts +3 -3
  50. package/dist/testing.js +3 -3
  51. package/package.json +1 -1
  52. package/src/authoring/defineHumanApprovalNode.types.ts +379 -0
  53. package/src/authoring/index.ts +6 -0
  54. package/src/binaries/DefaultExecutionBinaryServiceFactory.ts +27 -2
  55. package/src/binaries/DefaultNodeBinaryAttachmentServiceFactory.ts +14 -0
  56. package/src/binaries/boundedReadBinary.types.ts +90 -0
  57. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
  58. package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
  59. package/src/contracts/credentialTypes.ts +10 -0
  60. package/src/contracts/hitlSeamTypes.ts +34 -0
  61. package/src/contracts/humanTaskStoreTypes.ts +48 -0
  62. package/src/contracts/inboxChannelTypes.ts +58 -0
  63. package/src/contracts/index.ts +3 -0
  64. package/src/contracts/runTypes.ts +61 -3
  65. package/src/contracts/runtimeTypes.ts +131 -0
  66. package/src/contracts/workspaceFileTypes.ts +73 -0
  67. package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
  68. package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
  69. package/src/credentials/ManagedMaterialFetchError.ts +16 -0
  70. package/src/execution/ActivationEnqueueService.ts +16 -0
  71. package/src/execution/DefaultExecutionContextFactory.ts +11 -0
  72. package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
  73. package/src/execution/NodeExecutor.ts +60 -1
  74. package/src/execution/NodeExecutorFactory.ts +12 -2
  75. package/src/execution/NodeSuspensionHandler.ts +220 -0
  76. package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
  77. package/src/execution/RunStateSemantics.ts +5 -0
  78. package/src/execution/RunSuspendedError.ts +21 -0
  79. package/src/index.ts +42 -0
  80. package/src/orchestration/Engine.ts +12 -2
  81. package/src/orchestration/EngineWaiters.ts +1 -1
  82. package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
  83. package/src/orchestration/RunContinuationService.ts +226 -2
  84. package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
  85. package/src/runtime/RunIntentService.ts +3 -0
  86. package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
  87. package/dist/InMemoryRunDataFactory-C7YItvHG.d.cts +0 -123
  88. package/dist/bootstrap-BxuTFTLB.cjs.map +0 -1
  89. package/dist/bootstrap-D_Yyi0wL.js.map +0 -1
  90. package/dist/di-0Wop7z1y.js.map +0 -1
  91. package/dist/di-BlEKdoZS.cjs.map +0 -1
  92. package/dist/runtime-DBzq5YBi.cjs.map +0 -1
  93. package/dist/runtime-cxmUkk0l.js.map +0 -1
@@ -189,6 +189,19 @@ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = Crede
189
189
  setupStatus: CredentialSetupStatus;
190
190
  createdAt: string;
191
191
  updatedAt: string;
192
+ /**
193
+ * Pointer to where the credential material bytes live. For OSS / standalone
194
+ * rows this is `{source: "local", ref: instanceId}` and the bytes co-locate
195
+ * with the row in the workspace DB. For managed-mode rows this is
196
+ * `{source: "control-plane", ref: <cp_id>}` and the bytes live at CP.
197
+ *
198
+ * The seam is read through `CredentialMaterialProvider`. See
199
+ * `docs/design/credentials-oauth-unification.md` ("Material provider seam").
200
+ */
201
+ material: Readonly<{
202
+ source: "local" | "control-plane";
203
+ ref: string;
204
+ }>;
192
205
  }>;
193
206
  /**
194
207
  * Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
@@ -396,6 +409,16 @@ declare class CodemationTelemetryAttributeNames {
396
409
  static readonly mcpServerId = "mcp.server_id";
397
410
  /** MCP tool name on spans created for callTool invocations. */
398
411
  static readonly mcpToolName = "mcp.tool_name";
412
+ /** Terminal node-execution status (e.g. `"hitl-approved"`, `"hitl-rejected"`) on HITL outcome spans. */
413
+ static readonly nodeExecutionStatus = "codemation.node.execution_status";
414
+ /** Populated on run-halted spans; discriminates the halt reason (e.g. `"hitl-rejected"`). */
415
+ static readonly runHaltReason = "codemation.run.halt_reason";
416
+ /** Human task ID on `hitl.task.*` span events. */
417
+ static readonly hitlTaskId = "codemation.hitl.task_id";
418
+ /** HITL channel name (e.g. `"inbox"`, `"control-plane-inbox"`) on `hitl.task.*` span events. */
419
+ static readonly hitlChannel = "codemation.hitl.channel";
420
+ /** Decision outcome (e.g. `"approved"`, `"rejected"`) on `hitl.task.decided` span events. */
421
+ static readonly hitlDecisionStatus = "codemation.hitl.decision_status";
399
422
  }
400
423
  //#endregion
401
424
  //#region src/contracts/GenAiTelemetryAttributeNames.d.ts
@@ -572,6 +595,100 @@ interface WebhookTriggerMatcher {
572
595
  }
573
596
  //#endregion
574
597
  //#region src/contracts/runtimeTypes.d.ts
598
+ /** Opaque unique identifier for a single HumanTask instance. */
599
+ type HumanTaskId = string;
600
+ /**
601
+ * Duration string — ISO 8601 duration ("PT24H") or shorthand ("24h").
602
+ * Parsed by the timeout job; stored as-is in the suspension record.
603
+ */
604
+ type Duration = string;
605
+ /**
606
+ * Minimal handle handed to the `deliver` callback so it can route to the correct
607
+ * inbox channel.
608
+ */
609
+ interface HumanTaskHandle {
610
+ readonly taskId: HumanTaskId;
611
+ readonly runId: string;
612
+ readonly nodeId: string;
613
+ readonly expiresAt: Date;
614
+ /** TODO: real signed URL; placeholder empty string for now. */
615
+ readonly resumeUrl: string;
616
+ /**
617
+ * Arbitrary JSON metadata copied from `SuspensionRequest.request.metadata` at suspension time.
618
+ * Used by the agent runtime to round-trip the `agentCheckpoint` back to the
619
+ * resumed node via `ctx.resumeContext.task.metadata`.
620
+ */
621
+ readonly metadata?: Readonly<Record<string, JsonValue>>;
622
+ }
623
+ /** Human-readable description surface shown to the reviewer. */
624
+ interface HumanTaskSubject {
625
+ readonly title: string;
626
+ readonly summary: string;
627
+ readonly attributes?: JsonValue;
628
+ }
629
+ /** Identity of the person who made a decision on the task. */
630
+ interface HumanTaskActor {
631
+ readonly actorId: string;
632
+ readonly displayName?: string;
633
+ }
634
+ /**
635
+ * Resume context injected into `NodeExecutionContext` when the engine re-activates
636
+ * a previously suspended node. `defineHumanApprovalNode` wraps this with parsed
637
+ * `TDecision`; at the engine layer `decision.value` is `unknown`.
638
+ */
639
+ interface ResumeContext {
640
+ readonly decision: Readonly<{
641
+ kind: "decided";
642
+ value: unknown;
643
+ actor: HumanTaskActor;
644
+ decidedAt: Date;
645
+ }> | Readonly<{
646
+ kind: "timed_out";
647
+ at: Date;
648
+ }> | Readonly<{
649
+ kind: "auto_accepted";
650
+ at: Date;
651
+ }>;
652
+ readonly delivery: JsonValue;
653
+ readonly task: HumanTaskHandle;
654
+ }
655
+ /**
656
+ * Thrown by a node's `execute()` to request durable suspension of the current item.
657
+ * The engine catches this, persists the suspension entry, calls `deliver`, and
658
+ * continues to the next item (per-item semantics).
659
+ *
660
+ * @example
661
+ * ```ts
662
+ * throw new SuspensionRequest({
663
+ * decisionSchema: z.object({ approved: z.boolean() }),
664
+ * timeout: "PT24H",
665
+ * onTimeout: "halt",
666
+ * subject: { title: "Approve invoice", summary: "Invoice #1234 needs approval" },
667
+ * deliver: async (handle) => {
668
+ * await notifySlack(handle);
669
+ * return { channel: "slack", ts: "..." };
670
+ * },
671
+ * });
672
+ * ```
673
+ */
674
+ declare class SuspensionRequest<TDecision = unknown, TDelivery extends JsonValue = JsonValue> extends Error {
675
+ readonly request: Readonly<{
676
+ decisionSchema: ZodType<TDecision>;
677
+ timeout: Duration;
678
+ onTimeout: "halt" | "auto-accept";
679
+ subject: HumanTaskSubject;
680
+ metadata?: Readonly<Record<string, JsonValue>>;
681
+ deliver: (handle: HumanTaskHandle) => Promise<TDelivery>;
682
+ }>;
683
+ constructor(request: Readonly<{
684
+ decisionSchema: ZodType<TDecision>;
685
+ timeout: Duration;
686
+ onTimeout: "halt" | "auto-accept";
687
+ subject: HumanTaskSubject;
688
+ metadata?: Readonly<Record<string, JsonValue>>;
689
+ deliver: (handle: HumanTaskHandle) => Promise<TDelivery>;
690
+ }>);
691
+ }
575
692
  interface WorkflowRunnerService {
576
693
  runById(args: {
577
694
  workflowId: WorkflowId;
@@ -667,12 +784,30 @@ interface NodeBinaryAttachmentService extends ExecutionBinaryService {
667
784
  attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
668
785
  withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
669
786
  }
787
+ /** Default maximum bytes read into memory by the bounded helpers (50 MiB). */
788
+ declare const BINARY_DEFAULT_MAX_BYTES: number;
670
789
  interface ExecutionBinaryService {
671
790
  forNode(args: {
672
791
  nodeId: NodeId;
673
792
  activationId: NodeActivationId;
674
793
  }): NodeBinaryAttachmentService;
675
794
  openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
795
+ /**
796
+ * Reads all bytes from the attachment into a contiguous `Uint8Array`.
797
+ * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
798
+ * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
799
+ */
800
+ getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
801
+ /**
802
+ * Reads the attachment and decodes the bytes as UTF-8 text.
803
+ * Subject to the same bounded-read safety as `getBytes`.
804
+ */
805
+ getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
806
+ /**
807
+ * Reads the attachment, decodes as UTF-8 text, and parses as JSON.
808
+ * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
809
+ */
810
+ getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
676
811
  }
677
812
  interface ExecutionContext {
678
813
  runId: RunId;
@@ -705,6 +840,14 @@ interface ExecutionContext {
705
840
  * Collections registered in the codemation config, keyed by collection name.
706
841
  */
707
842
  readonly collections?: CollectionsContext;
843
+ /**
844
+ * Resolve a DI token from the host container.
845
+ * Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
846
+ * without importing host code. Wired by `DefaultExecutionContextFactory`; throws
847
+ * a clear error when no resolver is configured (e.g. in unit tests that don't
848
+ * set up the full container).
849
+ */
850
+ resolve<T>(token: TypeToken<T>): T;
708
851
  }
709
852
  interface ExecutionContextFactory {
710
853
  create(args: {
@@ -728,6 +871,11 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
728
871
  config: TConfig;
729
872
  telemetry: NodeExecutionTelemetry;
730
873
  binary: NodeBinaryAttachmentService;
874
+ /**
875
+ * Present when this node activation is a HITL resume.
876
+ * The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
877
+ */
878
+ resumeContext?: ResumeContext;
731
879
  }
732
880
  interface PollingTriggerHandle {
733
881
  /**
@@ -1634,7 +1782,7 @@ interface RunQueueEntry {
1634
1782
  received: Readonly<Record<InputPortKey, Items>>;
1635
1783
  }>;
1636
1784
  }
1637
- type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
1785
+ type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped" | "hitl-approved" | "hitl-rejected" | "hitl-timeout" | "hitl-auto-accepted" | "hitl-cancelled";
1638
1786
  interface NodeExecutionError {
1639
1787
  message: string;
1640
1788
  name?: string;
@@ -1742,7 +1890,9 @@ interface ExecutionFrontierPlan {
1742
1890
  clearedNodeIds: ReadonlyArray<NodeId>;
1743
1891
  preservedPinnedNodeIds: ReadonlyArray<NodeId>;
1744
1892
  }
1745
- type RunStatus = "running" | "pending" | "completed" | "failed";
1893
+ type RunStatus = "running" | "pending" | "completed" | "failed" | "suspended" | "halted";
1894
+ /** Reason a run transitioned to {@link RunStatus} `"halted"`. */
1895
+ type RunHaltReason = "hitl-rejected" | "hitl-timeout" | "hitl-cancelled";
1746
1896
  interface RunSummary {
1747
1897
  runId: RunId;
1748
1898
  workflowId: WorkflowId;
@@ -1776,6 +1926,35 @@ interface PersistedRunSchedulingState {
1776
1926
  pending?: PendingNodeExecution;
1777
1927
  queue: RunQueueEntry[];
1778
1928
  }
1929
+ /** One persisted suspension entry per suspended item. */
1930
+ interface PersistedSuspensionEntry {
1931
+ /** Opaque task identifier (UUID v4). */
1932
+ readonly taskId: string;
1933
+ readonly nodeId: NodeId;
1934
+ readonly activationId: NodeActivationId;
1935
+ readonly itemIndex: number;
1936
+ /** SHA-256 hex digest of the decision schema JSON (for schema-drift detection). */
1937
+ readonly decisionSchemaHash: string;
1938
+ /** Serialized return value from `SuspensionRequest.deliver` (stored on the HumanTask row). */
1939
+ readonly deliveryRef: JsonValue;
1940
+ /** ISO timestamp when the task expires. */
1941
+ readonly timeoutAt: string;
1942
+ readonly onTimeout: "halt" | "auto-accept";
1943
+ }
1944
+ /**
1945
+ * When a node is re-activated after suspension, the engine writes the resume context here
1946
+ * so `NodeExecutionRequestHandlerService` can splice `resumeContext` into ctx.
1947
+ * Cleared once the re-activation is consumed.
1948
+ */
1949
+ interface PendingResumeEntry {
1950
+ readonly activationId: NodeActivationId;
1951
+ readonly nodeId: NodeId;
1952
+ /**
1953
+ * Typed as `unknown` here to avoid a circular import between runTypes ↔ runtimeTypes.
1954
+ * `NodeExecutionRequestHandlerService` casts this to `ResumeContext` from runtimeTypes.
1955
+ */
1956
+ readonly resumeContext: unknown;
1957
+ }
1779
1958
  interface PersistedRunState {
1780
1959
  runId: RunId;
1781
1960
  workflowId: WorkflowId;
@@ -1794,12 +1973,24 @@ interface PersistedRunState {
1794
1973
  /** Successful node completions so far (for activation budget). */
1795
1974
  engineCounters?: EngineRunCounters;
1796
1975
  status: RunStatus;
1976
+ /** Populated when `status === "halted"` to discriminate why the run was halted. */
1977
+ reason?: RunHaltReason;
1797
1978
  pending?: PendingNodeExecution;
1798
1979
  queue: RunQueueEntry[];
1799
1980
  outputsByNode: Record<NodeId, NodeOutputs>;
1800
1981
  nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
1801
1982
  /** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
1802
1983
  connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
1984
+ /**
1985
+ * One entry per outstanding HITL suspension (per-item).
1986
+ * Present and non-empty iff `status === "suspended"`.
1987
+ */
1988
+ suspension?: ReadonlyArray<PersistedSuspensionEntry>;
1989
+ /**
1990
+ * Written by `resumeRun()` so `NodeExecutionRequestHandlerService` can splice `resumeContext`
1991
+ * into the ctx when re-executing the suspended node. Cleared once consumed.
1992
+ */
1993
+ pendingResume?: PendingResumeEntry;
1803
1994
  }
1804
1995
  interface WorkflowExecutionRepository {
1805
1996
  createRun(args: {
@@ -1859,6 +2050,12 @@ type RunResult = {
1859
2050
  error: {
1860
2051
  message: string;
1861
2052
  };
2053
+ } | {
2054
+ runId: RunId;
2055
+ workflowId: WorkflowId;
2056
+ startedAt: string;
2057
+ status: "halted";
2058
+ reason: RunHaltReason;
1862
2059
  };
1863
2060
  type WebhookRunResult = Readonly<{
1864
2061
  runId: RunId;
@@ -1946,5 +2143,5 @@ interface AgentMcpIntegration {
1946
2143
  }): Promise<AgentMcpToolMap>;
1947
2144
  }
1948
2145
  //#endregion
1949
- export { instancePerContainerCachingFactory as $, NodeExecutor as $n, CostTrackingTelemetryAttributeNames as $r, TriggerNodeConfig as $t, RunResult as A, OAuth2ProviderFromPublicConfig as Ai, BinaryStorageStatResult as An, ExecutionTelemetryFactory as Ar, NodeConfigBase as At, Container as B, LiveWorkflowRepository as Bn, TelemetrySpanEventRecord as Br, NodeOutputs as Bt, PinnedNodeOutputsByPort as C, CredentialSessionService as Ci, FixedRetryPolicySpec as Cn, WebhookInvocationMatch as Cr, JsonArray as Ct, RunExecutionOptions as D, CredentialTypeId as Di, BinaryBody as Dn, AllWorkflowsActiveWorkflowActivationPolicy as Dr, JsonValue as Dt, RunEventPublisherDeps as E, CredentialTypeDefinition as Ei, BinaryAttachmentCreateRequest as En, WebhookTriggerRoutingDiagnostics as Er, JsonPrimitive as Et, RunTestContext as F, NodeConnectionName as Fi, ExecutableTriggerNode as Fn, TelemetryAttributes as Fr, NodeIdRef as Ft, RegistrationOptions as G, NodeActivationRequestBase as Gn, NoOpExecutionTelemetryFactory as Gr, PersistedRunPolicySnapshot as Gt, Disposable as H, NodeActivationContinuation as Hn, CodemationTelemetryMetricNames as Hr, NodeSchedulerDecision as Ht, WebhookRunResult as I, NodeId as Ii, ExecutionBinaryService as In, TelemetryChildSpanStart as Ir, NodeInspectorSummaryRow as It, delay as J, NodeExecutionContext as Jn, NoOpTelemetrySpanScope as Jr, RunId as Jt, TypeToken as K, NodeActivationScheduler as Kn, NoOpExecutionTelemetry as Kr, RunDataFactory as Kt, WorkflowExecutionListingRepository as L, OutputPortKey as Li, ExecutionContext as Ln, TelemetryMetricRecord as Lr, NodeIterationId as Lt, RunStatus as M, PollingTriggerLogger as Mi, BinaryStorageWriteResult as Mn, TelemetryArtifactAttachment as Mr, NodeErrorHandler as Mt, RunStopCondition as N, PollingTriggerDedupWindow as Ni, EngineDeps as Nn, TelemetryArtifactReference as Nr, NodeErrorHandlerArgs as Nt, RunPruneCandidate as O, CredentialTypeRegistry as Oi, BinaryStorage as On, WorkflowActivationPolicy as Or, MutableRunData as Ot, RunSummary as P, InputPortKey as Pi, EngineHost as Pn, TelemetryAttributePrimitive as Pr, NodeErrorHandlerSpec as Pt, instanceCachingFactory as Q, NodeExecutionStatePublisher as Qn, CostTrackingTelemetry as Qr, RunnableNodeOutputJson as Qt, WorkflowExecutionPruneRepository as R, PersistedTokenId as Ri, ExecutionContextFactory as Rn, TelemetryScope as Rr, NodeKind as Rt, PersistedWorkflowTokenRegistryLike as S, CredentialSessionFactoryArgs as Si, ExponentialRetryPolicySpec as Sn, WebhookControlSignal as Sr, Items as St, RunCurrentState as T, CredentialType as Ti, RetryPolicySpec as Tn, WebhookTriggerResolution as Tr, JsonObject as Tt, InjectionToken$1 as U, NodeActivationReceipt as Un, GenAiTelemetryAttributeNames as Ur, PairedItemRef as Ut, DependencyContainer$1 as V, MultiInputNode as Vn, TelemetrySpanScope as Vr, NodeRef as Vt, Lifecycle as W, NodeActivationRequest as Wn, CodemationTelemetryAttributeNames as Wr, ParentExecutionRef as Wt, injectAll as X, NodeExecutionRequestHandler as Xn, CostTrackingComponent as Xr, RunnableNodeConfig as Xt, inject as Y, NodeExecutionRequest as Yn, NoOpTelemetryArtifactReference as Yr, RunIdFactory as Yt, injectable as Z, NodeExecutionScheduler as Zn, CostTrackingPriceQuote as Zr, RunnableNodeInputJson as Zt, PersistedRunControlState as _, CredentialMaterialSourceKind as _i, nodeRef as _n, WorkflowRunnerService as _r, BinaryPreviewKind as _t, ConnectionInvocationId as a, AnyCredentialType as ai, WorkflowErrorHandler as an, RunnableNodeExecuteArgs as ar, EngineExecutionLimitsPolicy as at, PersistedWorkflowSnapshot as b, CredentialRequirement as bi, triggerNodeOutputType as bn, HttpMethod as br, Item as bt, EngineRunCounters as c, CredentialBinding as ci, WorkflowGraphFactory as cn, TriggerNode as cr, RunEventBus as ct, NodeExecutionSnapshot as d, CredentialHealth as di, WorkflowPrunePolicySpec as dn, TriggerSetupStateFor as dr, TestSuiteRunStatus as dt, CostTrackingTelemetryFactory as ei, TriggerNodeOutputJson as en, NodeResolver as er, predicateAwareClassFactory as et, NodeExecutionStatus as f, CredentialHealthStatus as fi, WorkflowStoragePolicyDecisionArgs as fn, TriggerSetupStateRepository as fr, TestSuiteRunId as ft, PersistedMutableRunState as g, CredentialJsonRecord as gi, branchRef as gn, WorkflowRunnerResolver as gr, BinaryAttachment as gt, PersistedMutableNodeState as h, CredentialInstanceRecord as hi, WorkflowStoragePolicySpec as hn, WorkflowRepository as hr, ActivationIdFactory as ht, ConnectionInvocationAppendArgs as i, CollectionsContext as ii, WorkflowErrorContext as in, RunnableNode as ir, ENGINE_EXECUTION_LIMITS_DEFAULTS as it, RunStateResetRequest as j, NoOpPollingTriggerLogger as ji, BinaryStorageWriteRequest as jn, NodeExecutionTelemetry as jr, NodeDefinition as jt, RunQueueEntry as k, CredentialUnboundError as ki, BinaryStorageReadResult as kn, ExecutionTelemetry as kr, NodeActivationId as kt, ExecutionFrontierPlan as l, CredentialBindingKey as li, WorkflowNodeConnection as ln, TriggerRuntimeDiagnostics as lr, RunEventSubscription as lt, PendingNodeExecution as m, CredentialInstanceId as mi, WorkflowStoragePolicyResolver as mn, WorkflowNodeInstanceFactory as mr, TestTriggerSetupContext as mt, AgentMcpToolMap as n, CostTrackingUsageRecord as ni, UpstreamRefPlaceholder as nn, PollingTriggerHandle as nr, singleton as nt, ConnectionInvocationRecord as o, CredentialAdvancedSectionPresentation as oi, WorkflowErrorHandlerSpec as on, TestableTriggerNode as or, EngineExecutionLimitsPolicyConfig as ot, NodeInputsByPort as p, CredentialHealthTester as pi, WorkflowStoragePolicyMode as pn, TriggerTestItemsContext as pr, TestTriggerNodeConfig as pt, container as q, NodeBinaryAttachmentService as qn, NoOpNodeExecutionTelemetry as qr, RunDataSnapshot as qt, NeedsReconsentEvent as r, CollectionStore as ri, WorkflowDefinition as rn, PreparedNodeActivationDispatch as rr, CoreTokens as rt, CurrentStateExecutionRequest as s, CredentialAuthDefinition as si, WorkflowGraph as sn, TriggerCleanupHandle as sr, RunEvent as st, AgentMcpIntegration as t, CostTrackingTelemetryMetricNames as ti, TriggerNodeSetupState as tn, PersistedTriggerSetupState as tr, registry as tt, NodeExecutionError as u, CredentialFieldSchema as ui, WorkflowPolicyRuntimeDefaults as un, TriggerSetupContext as ur, TestCaseRunStatus as ut, PersistedRunSchedulingState as v, CredentialOAuth2AuthDefinition as vi, runnableNodeInputType as vn, WorkflowSnapshotFactory as vr, Edge as vt, RunCompletionNotifier as w, CredentialSetupStatus as wi, NoneRetryPolicySpec as wn, WebhookTriggerMatcher as wr, JsonNonArray as wt, PersistedWorkflowSnapshotNode as x, CredentialSessionFactory as xi, triggerNodeSetupStateType as xn, TriggerInstanceId as xr, ItemBinary as xt, PersistedRunState as y, CredentialOAuth2ScopesFromPublicConfig as yi, runnableNodeOutputType as yn, WorkflowSnapshotResolver as yr, ExecutionMode as yt, WorkflowExecutionRepository as z, WorkflowId as zi, ItemNode as zn, TelemetrySpanEnd as zr, NodeOffloadPolicy as zt };
1950
- //# sourceMappingURL=agentMcpTypes-ZiNbNsEi.d.cts.map
2146
+ export { injectAll as $, NodeActivationRequest as $n, CodemationTelemetryMetricNames as $r, RunnableNodeConfig as $t, RunHaltReason as A, CredentialOAuth2ScopesFromPublicConfig as Ai, BinaryAttachmentCreateRequest as An, WorkflowSnapshotResolver as Ar, JsonValue as At, WorkflowExecutionListingRepository as B, CredentialUnboundError as Bi, ExecutableTriggerNode as Bn, ExecutionTelemetry as Br, NodeIterationId as Bt, PersistedWorkflowSnapshotNode as C, CredentialHealthStatus as Ci, triggerNodeOutputType as Cn, TriggerSetupStateRepository as Cr, Item as Ct, RunCurrentState as D, CredentialJsonRecord as Di, NoneRetryPolicySpec as Dn, WorkflowRunnerResolver as Dr, JsonNonArray as Dt, RunCompletionNotifier as E, CredentialInstanceRecord as Ei, FixedRetryPolicySpec as En, WorkflowRepository as Er, JsonArray as Et, RunStatus as F, CredentialSetupStatus as Fi, BinaryStorageWriteRequest as Fn, WebhookTriggerMatcher as Fr, NodeErrorHandler as Ft, Disposable as G, InputPortKey as Gi, HumanTaskHandle as Gn, TelemetryAttributePrimitive as Gr, NodeSchedulerDecision as Gt, WorkflowExecutionRepository as H, NoOpPollingTriggerLogger as Hi, ExecutionContext as Hn, NodeExecutionTelemetry as Hr, NodeOffloadPolicy as Ht, RunStopCondition as I, CredentialType as Ii, BinaryStorageWriteResult as In, WebhookTriggerResolution as Ir, NodeErrorHandlerArgs as It, RegistrationOptions as J, OutputPortKey as Ji, ItemNode as Jn, TelemetryMetricRecord as Jr, PersistedRunPolicySnapshot as Jt, InjectionToken$1 as K, NodeConnectionName as Ki, HumanTaskId as Kn, TelemetryAttributes as Kr, PairedItemRef as Kt, RunSummary as L, CredentialTypeDefinition as Li, Duration as Ln, WebhookTriggerRoutingDiagnostics as Lr, NodeErrorHandlerSpec as Lt, RunQueueEntry as M, CredentialSessionFactory as Mi, BinaryStorage as Mn, TriggerInstanceId as Mr, NodeActivationId as Mt, RunResult as N, CredentialSessionFactoryArgs as Ni, BinaryStorageReadResult as Nn, WebhookControlSignal as Nr, NodeConfigBase as Nt, RunEventPublisherDeps as O, CredentialMaterialSourceKind as Oi, RetryPolicySpec as On, WorkflowRunnerService as Or, JsonObject as Ot, RunStateResetRequest as P, CredentialSessionService as Pi, BinaryStorageStatResult as Pn, WebhookInvocationMatch as Pr, NodeDefinition as Pt, inject as Q, NodeActivationReceipt as Qn, TelemetrySpanScope as Qr, RunIdFactory as Qt, RunTestContext as R, CredentialTypeId as Ri, EngineDeps as Rn, AllWorkflowsActiveWorkflowActivationPolicy as Rr, NodeIdRef as Rt, PersistedWorkflowSnapshot as S, CredentialHealth as Si, runnableNodeOutputType as Sn, TriggerSetupStateFor as Sr, ExecutionMode as St, PinnedNodeOutputsByPort as T, CredentialInstanceId as Ti, ExponentialRetryPolicySpec as Tn, WorkflowNodeInstanceFactory as Tr, Items as Tt, Container as U, PollingTriggerLogger as Ui, ExecutionContextFactory as Un, TelemetryArtifactAttachment as Ur, NodeOutputs as Ut, WorkflowExecutionPruneRepository as V, OAuth2ProviderFromPublicConfig as Vi, ExecutionBinaryService as Vn, ExecutionTelemetryFactory as Vr, NodeKind as Vt, DependencyContainer$1 as W, PollingTriggerDedupWindow as Wi, HumanTaskActor as Wn, TelemetryArtifactReference as Wr, NodeRef as Wt, container as X, WorkflowId as Xi, MultiInputNode as Xn, TelemetrySpanEnd as Xr, RunDataSnapshot as Xt, TypeToken as Y, PersistedTokenId as Yi, LiveWorkflowRepository as Yn, TelemetryScope as Yr, RunDataFactory as Yt, delay as Z, NodeActivationContinuation as Zn, TelemetrySpanEventRecord as Zr, RunId as Zt, PersistedMutableRunState as _, CredentialAdvancedSectionPresentation as _i, WorkflowStoragePolicyResolver as _n, TestableTriggerNode as _r, TestTriggerSetupContext as _t, ConnectionInvocationId as a, NoOpTelemetrySpanScope as ai, UpstreamRefPlaceholder as an, NodeExecutionRequestHandler as ar, singleton as at, PersistedRunState as b, CredentialBindingKey as bi, nodeRef as bn, TriggerRuntimeDiagnostics as br, BinaryPreviewKind as bt, EngineRunCounters as c, CostTrackingPriceQuote as ci, WorkflowErrorHandler as cn, NodeExecutor as cr, EngineExecutionLimitsPolicy as ct, NodeExecutionSnapshot as d, CostTrackingTelemetryFactory as di, WorkflowGraphFactory as dn, PollingTriggerHandle as dr, RunEventBus as dt, GenAiTelemetryAttributeNames as ei, RunnableNodeInputJson as en, NodeActivationRequestBase as er, injectable as et, NodeExecutionStatus as f, CostTrackingTelemetryMetricNames as fi, WorkflowNodeConnection as fn, PreparedNodeActivationDispatch as fr, RunEventSubscription as ft, PersistedMutableNodeState as g, AnyCredentialType as gi, WorkflowStoragePolicyMode as gn, SuspensionRequest as gr, TestTriggerNodeConfig as gt, PendingResumeEntry as h, CollectionsContext as hi, WorkflowStoragePolicyDecisionArgs as hn, RunnableNodeExecuteArgs as hr, TestSuiteRunId as ht, ConnectionInvocationAppendArgs as i, NoOpNodeExecutionTelemetry as ii, TriggerNodeSetupState as in, NodeExecutionRequest as ir, registry as it, RunPruneCandidate as j, CredentialRequirement as ji, BinaryBody as jn, HttpMethod as jr, MutableRunData as jt, RunExecutionOptions as k, CredentialOAuth2AuthDefinition as ki, BINARY_DEFAULT_MAX_BYTES as kn, WorkflowSnapshotFactory as kr, JsonPrimitive as kt, ExecutionFrontierPlan as l, CostTrackingTelemetry as li, WorkflowErrorHandlerSpec as ln, NodeResolver as lr, EngineExecutionLimitsPolicyConfig as lt, PendingNodeExecution as m, CollectionStore as mi, WorkflowPrunePolicySpec as mn, RunnableNode as mr, TestSuiteRunStatus as mt, AgentMcpToolMap as n, NoOpExecutionTelemetryFactory as ni, TriggerNodeConfig as nn, NodeBinaryAttachmentService as nr, instancePerContainerCachingFactory as nt, ConnectionInvocationRecord as o, NoOpTelemetryArtifactReference as oi, WorkflowDefinition as on, NodeExecutionScheduler as or, CoreTokens as ot, NodeInputsByPort as p, CostTrackingUsageRecord as pi, WorkflowPolicyRuntimeDefaults as pn, ResumeContext as pr, TestCaseRunStatus as pt, Lifecycle as q, NodeId as qi, HumanTaskSubject as qn, TelemetryChildSpanStart as qr, ParentExecutionRef as qt, NeedsReconsentEvent as r, NoOpExecutionTelemetry as ri, TriggerNodeOutputJson as rn, NodeExecutionContext as rr, predicateAwareClassFactory as rt, CurrentStateExecutionRequest as s, CostTrackingComponent as si, WorkflowErrorContext as sn, NodeExecutionStatePublisher as sr, ENGINE_EXECUTION_LIMITS_DEFAULTS as st, AgentMcpIntegration as t, CodemationTelemetryAttributeNames as ti, RunnableNodeOutputJson as tn, NodeActivationScheduler as tr, instanceCachingFactory as tt, NodeExecutionError as u, CostTrackingTelemetryAttributeNames as ui, WorkflowGraph as un, PersistedTriggerSetupState as ur, RunEvent as ut, PersistedRunControlState as v, CredentialAuthDefinition as vi, WorkflowStoragePolicySpec as vn, TriggerCleanupHandle as vr, ActivationIdFactory as vt, PersistedWorkflowTokenRegistryLike as w, CredentialHealthTester as wi, triggerNodeSetupStateType as wn, TriggerTestItemsContext as wr, ItemBinary as wt, PersistedSuspensionEntry as x, CredentialFieldSchema as xi, runnableNodeInputType as xn, TriggerSetupContext as xr, Edge as xt, PersistedRunSchedulingState as y, CredentialBinding as yi, branchRef as yn, TriggerNode as yr, BinaryAttachment as yt, WebhookRunResult as z, CredentialTypeRegistry as zi, EngineHost as zn, WorkflowActivationPolicy as zr, NodeInspectorSummaryRow as zt };
2147
+ //# sourceMappingURL=agentMcpTypes-DGIwk6Ue.d.cts.map
@@ -1,7 +1,7 @@
1
- require('../di-BlEKdoZS.cjs');
1
+ require('../di-C-2ep8NZ.cjs');
2
2
  require('../contracts-CK0x6w_G.cjs');
3
- const require_runtime = require('../runtime-DBzq5YBi.cjs');
4
- const require_bootstrap = require('../bootstrap-BxuTFTLB.cjs');
3
+ const require_runtime = require('../runtime-DjYXgOo0.cjs');
4
+ const require_bootstrap = require('../bootstrap-BEu1fJBM.cjs');
5
5
 
6
6
  exports.AbortControllerFactory = require_bootstrap.AbortControllerFactory;
7
7
  exports.CatalogBackedCostTrackingTelemetryFactory = require_runtime.CatalogBackedCostTrackingTelemetryFactory;
@@ -1,8 +1,8 @@
1
- import { A as RunResult, At as NodeConfigBase, Bt as NodeOutputs, Cr as WebhookInvocationMatch, D as RunExecutionOptions, Er as WebhookTriggerRoutingDiagnostics, Gt as PersistedRunPolicySnapshot, Hn as NodeActivationContinuation, Ht as NodeSchedulerDecision, Ii as NodeId, Jt as RunId, K as TypeToken, Kn as NodeActivationScheduler, L as WorkflowExecutionListingRepository, Mt as NodeErrorHandler, Nn as EngineDeps, O as RunPruneCandidate, Or as WorkflowActivationPolicy, P as RunSummary, Pt as NodeErrorHandlerSpec, Qr as CostTrackingTelemetry, R as WorkflowExecutionPruneRepository, Ri as PersistedTokenId, St as Items, V as DependencyContainer, Wn as NodeActivationRequest, Wt as ParentExecutionRef, Yn as NodeExecutionRequest, Zn as NodeExecutionScheduler, an as WorkflowErrorHandler, at as EngineExecutionLimitsPolicy, br as HttpMethod, c as EngineRunCounters, ct as RunEventBus, dt as TestSuiteRunStatus, ei as CostTrackingTelemetryFactory, er as NodeResolver, fn as WorkflowStoragePolicyDecisionArgs, ft as TestSuiteRunId, hr as WorkflowRepository, it as ENGINE_EXECUTION_LIMITS_DEFAULTS, jt as NodeDefinition, kr as ExecutionTelemetry, mr as WorkflowNodeInstanceFactory, ni as CostTrackingUsageRecord, on as WorkflowErrorHandlerSpec, ot as EngineExecutionLimitsPolicyConfig, rn as WorkflowDefinition, rr as PreparedNodeActivationDispatch, un as WorkflowPolicyRuntimeDefaults, ut as TestCaseRunStatus, v as PersistedRunSchedulingState, wr as WebhookTriggerMatcher, x as PersistedWorkflowSnapshotNode, y as PersistedRunState, yt as ExecutionMode, z as WorkflowExecutionRepository, zi as WorkflowId, zt as NodeOffloadPolicy } from "../agentMcpTypes-ZiNbNsEi.cjs";
2
- import { n as CostCatalogEntry, t as CostCatalog } from "../CostCatalogContract-DZgcUBE4.cjs";
3
- import { n as InMemoryLiveWorkflowRepository, r as Engine, t as RunIntentService } from "../RunIntentService-CEF-sFfI.cjs";
4
- import { a as ItemExprResolver, c as DefaultAsyncSleeper, d as UnavailableBinaryStorage, f as CredentialResolverFactory, i as RunnableOutputBehaviorResolver, l as AsyncSleeper, n as InMemoryBinaryStorage, o as InProcessRetryRunner, s as DefaultExecutionContextFactory, t as InMemoryRunDataFactory, u as DefaultExecutionBinaryService } from "../InMemoryRunDataFactory-C7YItvHG.cjs";
5
- import { a as WorkflowSnapshotCodec, i as EngineWorkflowRunnerService, n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-Cggm5GVY.cjs";
1
+ import { $n as NodeActivationRequest, B as WorkflowExecutionListingRepository, Br as ExecutionTelemetry, C as PersistedWorkflowSnapshotNode, Er as WorkflowRepository, Fr as WebhookTriggerMatcher, Ft as NodeErrorHandler, Gt as NodeSchedulerDecision, H as WorkflowExecutionRepository, Ht as NodeOffloadPolicy, Jt as PersistedRunPolicySnapshot, L as RunSummary, Lr as WebhookTriggerRoutingDiagnostics, Lt as NodeErrorHandlerSpec, Mt as NodeActivationId, N as RunResult, Nt as NodeConfigBase, Pr as WebhookInvocationMatch, Pt as NodeDefinition, Rn as EngineDeps, St as ExecutionMode, Tr as WorkflowNodeInstanceFactory, Tt as Items, Ut as NodeOutputs, V as WorkflowExecutionPruneRepository, W as DependencyContainer, Xi as WorkflowId, Y as TypeToken, Yi as PersistedTokenId, Yr as TelemetryScope, Zn as NodeActivationContinuation, Zt as RunId, b as PersistedRunState, c as EngineRunCounters, cn as WorkflowErrorHandler, ct as EngineExecutionLimitsPolicy, di as CostTrackingTelemetryFactory, dt as RunEventBus, fr as PreparedNodeActivationDispatch, gr as SuspensionRequest, hn as WorkflowStoragePolicyDecisionArgs, ht as TestSuiteRunId, ir as NodeExecutionRequest, j as RunPruneCandidate, jr as HttpMethod, k as RunExecutionOptions, li as CostTrackingTelemetry, ln as WorkflowErrorHandlerSpec, lr as NodeResolver, lt as EngineExecutionLimitsPolicyConfig, mt as TestSuiteRunStatus, on as WorkflowDefinition, or as NodeExecutionScheduler, pi as CostTrackingUsageRecord, pn as WorkflowPolicyRuntimeDefaults, pt as TestCaseRunStatus, qi as NodeId, qt as ParentExecutionRef, st as ENGINE_EXECUTION_LIMITS_DEFAULTS, tr as NodeActivationScheduler, y as PersistedRunSchedulingState, zr as WorkflowActivationPolicy } from "../agentMcpTypes-DGIwk6Ue.cjs";
2
+ import { n as CostCatalogEntry, t as CostCatalog } from "../CostCatalogContract-Dxq1BTyi.cjs";
3
+ import { n as InMemoryLiveWorkflowRepository, r as Engine, t as RunIntentService } from "../RunIntentService-BitgkKaT.cjs";
4
+ import { a as ItemExprResolver, c as DefaultAsyncSleeper, d as UnavailableBinaryStorage, f as HitlResumeTokenSignerSeam, i as RunnableOutputBehaviorResolver, l as AsyncSleeper, m as HitlTimeoutJobSchedulerSeam, n as InMemoryBinaryStorage, o as InProcessRetryRunner, s as DefaultExecutionContextFactory, t as InMemoryRunDataFactory, u as DefaultExecutionBinaryService, x as CredentialResolverFactory, y as HumanTaskStore } from "../InMemoryRunDataFactory-Csy2evr_.cjs";
5
+ import { a as WorkflowSnapshotCodec, i as EngineWorkflowRunnerService, n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-CqcTWexS.cjs";
6
6
 
7
7
  //#region src/orchestration/AbortControllerFactory.d.ts
8
8
  /**
@@ -51,15 +51,71 @@ declare class CatalogBackedCostTrackingTelemetryFactory implements CostTrackingT
51
51
  }>): CostTrackingTelemetry;
52
52
  }
53
53
  //#endregion
54
+ //#region src/execution/NodeSuspensionHandler.d.ts
55
+ /**
56
+ * Handles per-item `SuspensionRequest` catches in the engine's item execution loop.
57
+ *
58
+ * Responsibilities:
59
+ * 1. Generate a `taskId` (UUID v4).
60
+ * 2. Persist a `HumanTask` row via `HumanTaskStore.create`.
61
+ * 3. Sign a resume URL via `HitlResumeTokenSigner.sign`.
62
+ * 4. Enqueue a delayed BullMQ timeout job via `HitlTimeoutJobScheduler.enqueue`.
63
+ * 5. Build a `HumanTaskHandle` and call `deliver`.
64
+ * 6. Append a `PersistedSuspensionEntry` to the run state and flip status to `"suspended"`.
65
+ * 7. Persist via `WorkflowExecutionRepository.save`.
66
+ * 8. Throw `RunSuspendedError` so the caller can exit cleanly.
67
+ *
68
+ * If `deliver` throws, the error propagates up to `NodeExecutionRequestHandlerService`
69
+ * which routes it through `resumeFromNodeError` → run status becomes `"failed"`.
70
+ *
71
+ * `humanTaskStore`, `tokenSigner`, and `timeoutScheduler` are optional —
72
+ * when not registered (e.g. in unit tests), the handler still suspends the run but
73
+ * skips persistence, token signing, and job scheduling.
74
+ */
75
+ declare class NodeSuspensionHandler {
76
+ private readonly workflowExecutionRepository;
77
+ private readonly humanTaskStore?;
78
+ private readonly tokenSigner?;
79
+ private readonly timeoutScheduler?;
80
+ /** Workspace ID to stamp on HumanTaskRecord in managed mode (T7 security fix). Null in non-managed mode. */
81
+ private readonly workspaceId?;
82
+ constructor(workflowExecutionRepository: WorkflowExecutionRepository, humanTaskStore?: HumanTaskStore | undefined, tokenSigner?: HitlResumeTokenSignerSeam | undefined, timeoutScheduler?: HitlTimeoutJobSchedulerSeam | undefined, /** Workspace ID to stamp on HumanTaskRecord in managed mode (T7 security fix). Null in non-managed mode. */
83
+ workspaceId?: string | undefined);
84
+ handle(args: {
85
+ runId: RunId;
86
+ nodeId: NodeId;
87
+ activationId: NodeActivationId;
88
+ itemIndex: number;
89
+ suspensionRequest: SuspensionRequest;
90
+ state: PersistedRunState;
91
+ /** Telemetry scope of the node's per-item span. Used to emit `hitl.task.*` span events. */
92
+ telemetry?: TelemetryScope;
93
+ }): Promise<never>;
94
+ /**
95
+ * Parse a duration string into milliseconds.
96
+ * Accepts ISO 8601 durations ("PT24H", "PT30M") and shorthand ("24h", "30m", "1d").
97
+ * Throws for unrecognised formats.
98
+ */
99
+ private parseDurationMs;
100
+ private hashSchema;
101
+ private schemaToJson;
102
+ }
103
+ //#endregion
54
104
  //#region src/execution/NodeExecutor.d.ts
55
105
  declare class NodeExecutor {
56
106
  private readonly nodeInstanceFactory;
57
107
  private readonly retryRunner;
108
+ /** Required for HITL suspension support. When omitted, `SuspensionRequest` throws upward. */
109
+ private readonly suspensionHandler?;
110
+ /** Required alongside `suspensionHandler`. */
111
+ private readonly loadRunState?;
58
112
  private readonly fanInMerger;
59
113
  private readonly outputNormalizer;
60
114
  private readonly itemExprResolver;
61
115
  private readonly outputBehaviorResolver;
62
- constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner, itemExprResolver?: ItemExprResolver, outputBehaviorResolver?: RunnableOutputBehaviorResolver);
116
+ constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner, itemExprResolver?: ItemExprResolver, outputBehaviorResolver?: RunnableOutputBehaviorResolver, /** Required for HITL suspension support. When omitted, `SuspensionRequest` throws upward. */
117
+ suspensionHandler?: NodeSuspensionHandler | undefined, /** Required alongside `suspensionHandler`. */
118
+ loadRunState?: ((runId: RunId) => Promise<PersistedRunState | undefined>) | undefined);
63
119
  execute(request: NodeActivationRequest): Promise<NodeOutputs>;
64
120
  private assertRequiredCredentialsBound;
65
121
  private isCredentialError;
@@ -277,7 +333,7 @@ declare class TestSuiteRunIdFactory {
277
333
  interface TestSuiteOrchestratorEngine {
278
334
  runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions): Promise<RunResult>;
279
335
  waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
280
- status: "completed" | "failed";
336
+ status: "completed" | "failed" | "halted";
281
337
  }>>;
282
338
  }
283
339
  interface TestSuiteCaseOutcome {
@@ -1,8 +1,8 @@
1
- import { Cn as EngineExecutionLimitsPolicyConfig, Sn as EngineExecutionLimitsPolicy, br as WorkflowDefinition, in as DependencyContainer, ln as TypeToken, to as PersistedTokenId, xn as ENGINE_EXECUTION_LIMITS_DEFAULTS } from "../index-zWGtEhrf.js";
2
- import { a as RunPolicySnapshotFactory, c as RunTerminalPersistenceCoordinator, l as WorkflowStoragePolicyEvaluator, n as InMemoryLiveWorkflowRepository, o as EngineExecutionLimitsPolicyFactory, r as EngineWorkflowRunnerService, s as WorkflowPolicyErrorServices, t as RunIntentService, u as Engine } from "../RunIntentService-BVur7x9n.js";
3
- import { A as ConfigDrivenOffloadPolicy, B as DefaultAsyncSleeper, Bt as CredentialResolverFactory, C as InMemoryWorkflowExecutionRepository, D as HintOnlyOffloadPolicy, E as LocalOnlyScheduler, L as InProcessRetryRunner, M as NodeInstanceFactory, N as NodeExecutor, O as DefaultDrivingScheduler, R as CatalogBackedCostTrackingTelemetryFactory, S as RunSummaryMapper, T as InMemoryBinaryStorage, U as DefaultExecutionBinaryService, V as AsyncSleeper, Vt as AbortControllerFactory, W as UnavailableBinaryStorage, a as TestSuiteRunResult, b as EngineCompositionDeps, i as TestSuiteOrchestratorEngine, j as StaticCostCatalog, k as InlineDrivingScheduler, n as TestSuiteCaseOutcome, o as TestSuiteRunIdFactory, r as TestSuiteOrchestrator, t as RunTestSuiteArgs, w as InMemoryRunDataFactory, x as EngineFactory, y as WorkflowRepositoryWebhookTriggerMatcher, z as DefaultExecutionContextFactory } from "../index-62Ba9f7D.js";
4
- import "../ItemsInputNormalizer-_Mfcd3YU.js";
5
- import { n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-BQbS9_gs.js";
1
+ import { Bn as ENGINE_EXECUTION_LIMITS_DEFAULTS, Cn as DependencyContainer, Hn as EngineExecutionLimitsPolicyConfig, On as TypeToken, Oo as PersistedTokenId, Vn as EngineExecutionLimitsPolicy, zr as WorkflowDefinition } from "../index-rllWL4r-.js";
2
+ import { a as RunPolicySnapshotFactory, c as RunTerminalPersistenceCoordinator, l as WorkflowStoragePolicyEvaluator, n as InMemoryLiveWorkflowRepository, o as EngineExecutionLimitsPolicyFactory, r as EngineWorkflowRunnerService, s as WorkflowPolicyErrorServices, t as RunIntentService, u as Engine } from "../RunIntentService-DYpqfu6D.js";
3
+ import { A as WorkflowRepositoryWebhookTriggerMatcher, B as InlineDrivingScheduler, F as InMemoryRunDataFactory, H as StaticCostCatalog, I as InMemoryBinaryStorage, J as InProcessRetryRunner, L as LocalOnlyScheduler, M as EngineFactory, N as RunSummaryMapper, P as InMemoryWorkflowExecutionRepository, Q as AsyncSleeper, R as HintOnlyOffloadPolicy, U as NodeInstanceFactory, V as ConfigDrivenOffloadPolicy, W as NodeExecutor, X as DefaultExecutionContextFactory, Y as CatalogBackedCostTrackingTelemetryFactory, Z as DefaultAsyncSleeper, a as TestSuiteRunResult, an as AbortControllerFactory, et as DefaultExecutionBinaryService, i as TestSuiteOrchestratorEngine, in as CredentialResolverFactory, j as EngineCompositionDeps, n as TestSuiteCaseOutcome, o as TestSuiteRunIdFactory, r as TestSuiteOrchestrator, t as RunTestSuiteArgs, tt as UnavailableBinaryStorage, z as DefaultDrivingScheduler } from "../index-CqZeNGAp.js";
4
+ import "../ItemsInputNormalizer-BWtlwdVI.js";
5
+ import { n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-Cr75cSfL.js";
6
6
 
7
7
  //#region src/bootstrap/runtime/EngineRuntimeRegistrar.d.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
- import "../di-0Wop7z1y.js";
1
+ import "../di-D9Mv3kF3.js";
2
2
  import "../contracts-DXdfTdpW.js";
3
- import { A as PersistedWorkflowTokenRegistry, B as DefaultExecutionContextFactory, C as DefaultDrivingScheduler, E as StaticCostCatalog, N as NodeExecutor, O as NodeInstanceFactory, R as InProcessRetryRunner, S as HintOnlyOffloadPolicy, T as RunPolicySnapshotFactory, _ as RunTerminalPersistenceCoordinator, a as InMemoryLiveWorkflowRepository, b as LocalOnlyScheduler, c as EngineFactory, dt as UnavailableBinaryStorage, g as WorkflowPolicyErrorServices, h as WorkflowStoragePolicyEvaluator, i as RunIntentService, j as MissingRuntimeTriggerToken, l as Engine, m as InMemoryBinaryStorage, n as WorkflowRepositoryWebhookTriggerMatcher, ot as DefaultAsyncSleeper, p as InMemoryRunDataFactory, s as EngineWorkflowRunnerService, st as CredentialResolverFactory, ut as DefaultExecutionBinaryService, v as ENGINE_EXECUTION_LIMITS_DEFAULTS, w as ConfigDrivenOffloadPolicy, x as InlineDrivingScheduler, y as EngineExecutionLimitsPolicy, z as CatalogBackedCostTrackingTelemetryFactory } from "../runtime-cxmUkk0l.js";
4
- import { a as InMemoryWorkflowExecutionRepository, i as AbortControllerFactory, n as TestSuiteRunIdFactory, o as RunSummaryMapper, r as TestSuiteOrchestrator, s as EngineExecutionLimitsPolicyFactory, t as EngineRuntimeRegistrar } from "../bootstrap-D_Yyi0wL.js";
3
+ import { A as PersistedWorkflowTokenRegistry, B as CatalogBackedCostTrackingTelemetryFactory, C as DefaultDrivingScheduler, E as StaticCostCatalog, N as NodeExecutor, O as NodeInstanceFactory, S as HintOnlyOffloadPolicy, T as RunPolicySnapshotFactory, V as DefaultExecutionContextFactory, _ as RunTerminalPersistenceCoordinator, a as InMemoryLiveWorkflowRepository, b as LocalOnlyScheduler, c as EngineFactory, ct as CredentialResolverFactory, dt as DefaultExecutionBinaryService, ft as UnavailableBinaryStorage, g as WorkflowPolicyErrorServices, h as WorkflowStoragePolicyEvaluator, i as RunIntentService, j as MissingRuntimeTriggerToken, l as Engine, m as InMemoryBinaryStorage, n as WorkflowRepositoryWebhookTriggerMatcher, p as InMemoryRunDataFactory, s as EngineWorkflowRunnerService, st as DefaultAsyncSleeper, v as ENGINE_EXECUTION_LIMITS_DEFAULTS, w as ConfigDrivenOffloadPolicy, x as InlineDrivingScheduler, y as EngineExecutionLimitsPolicy, z as InProcessRetryRunner } from "../runtime-6-U2Cou5.js";
4
+ import { a as InMemoryWorkflowExecutionRepository, i as AbortControllerFactory, n as TestSuiteRunIdFactory, o as RunSummaryMapper, r as TestSuiteOrchestrator, s as EngineExecutionLimitsPolicyFactory, t as EngineRuntimeRegistrar } from "../bootstrap-CSeInbj1.js";
5
5
 
6
6
  export { AbortControllerFactory, CatalogBackedCostTrackingTelemetryFactory, ConfigDrivenOffloadPolicy, CredentialResolverFactory, DefaultAsyncSleeper, DefaultDrivingScheduler, DefaultExecutionBinaryService, DefaultExecutionContextFactory, ENGINE_EXECUTION_LIMITS_DEFAULTS, Engine, EngineExecutionLimitsPolicy, EngineExecutionLimitsPolicyFactory, EngineFactory, EngineRuntimeRegistrar, EngineWorkflowRunnerService, HintOnlyOffloadPolicy, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryWorkflowExecutionRepository, InProcessRetryRunner, InlineDrivingScheduler, LocalOnlyScheduler, MissingRuntimeTriggerToken, NodeExecutor, NodeInstanceFactory, PersistedWorkflowTokenRegistry, RunIntentService, RunPolicySnapshotFactory, RunSummaryMapper, RunTerminalPersistenceCoordinator, StaticCostCatalog, TestSuiteOrchestrator, TestSuiteRunIdFactory, UnavailableBinaryStorage, WorkflowPolicyErrorServices, WorkflowRepositoryWebhookTriggerMatcher, WorkflowStoragePolicyEvaluator };