@codemation/core 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/CostCatalogContract-DD7fQ4FF.d.cts +19 -0
- package/dist/{EngineRuntimeRegistration.types-MPYWsEM0.d.cts → EngineRuntimeRegistration.types-DTV5_7Jw.d.cts} +3 -2
- package/dist/{EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts → EngineRuntimeRegistration.types-Dl92Hdoi.d.ts} +2 -2
- package/dist/InMemoryRunDataFactory-qMiYjhCK.d.cts +202 -0
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
- package/dist/ItemsInputNormalizer-BhuxvZh5.js +36 -0
- package/dist/ItemsInputNormalizer-BhuxvZh5.js.map +1 -0
- package/dist/ItemsInputNormalizer-C09a7iFP.d.ts +321 -0
- package/dist/ItemsInputNormalizer-DLaD6rTl.d.cts +407 -0
- package/dist/ItemsInputNormalizer-Div-fb6a.cjs +43 -0
- package/dist/ItemsInputNormalizer-Div-fb6a.cjs.map +1 -0
- package/dist/RunIntentService-BOSGwmqn.d.ts +299 -0
- package/dist/RunIntentService-CWMMrAP4.d.cts +220 -0
- package/dist/{RunIntentService-MUHJ1bhO.d.cts → agentMcpTypes-DUmniLOY.d.cts} +183 -206
- package/dist/bootstrap/index.cjs +4 -2
- package/dist/bootstrap/index.d.cts +63 -5
- package/dist/bootstrap/index.d.ts +5 -4
- package/dist/bootstrap/index.js +4 -2
- package/dist/{bootstrap-Dgzsjoj7.js → bootstrap-CKTMMNmL.js} +174 -3
- package/dist/bootstrap-CKTMMNmL.js.map +1 -0
- package/dist/{bootstrap-dVmpU1ju.cjs → bootstrap-D460dCgS.cjs} +209 -36
- package/dist/bootstrap-D460dCgS.cjs.map +1 -0
- package/dist/browser.cjs +17 -0
- package/dist/browser.d.cts +4 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +4 -0
- package/dist/contracts-CK0x6w_G.cjs +74 -0
- package/dist/contracts-CK0x6w_G.cjs.map +1 -0
- package/dist/contracts-DXdfTdpW.js +50 -0
- package/dist/contracts-DXdfTdpW.js.map +1 -0
- package/dist/contracts.cjs +6 -0
- package/dist/contracts.d.cts +5 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js +3 -0
- package/dist/di-DdsgWfVy.js +405 -0
- package/dist/di-DdsgWfVy.js.map +1 -0
- package/dist/di-tO6R7VJV.cjs +524 -0
- package/dist/di-tO6R7VJV.cjs.map +1 -0
- package/dist/executionPersistenceContracts-DenJJK2T.d.cts +275 -0
- package/dist/{index-Bes88mxT.d.ts → index-BZDhEQ6W.d.ts} +278 -415
- package/dist/{RunIntentService-BrEq6Jm6.d.ts → index-CSKKuK60.d.ts} +441 -286
- package/dist/index.cjs +97 -250
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +395 -803
- package/dist/index.d.ts +5 -3
- package/dist/index.js +58 -224
- package/dist/index.js.map +1 -1
- package/dist/params-DqRvku2h.d.cts +44 -0
- package/dist/{runtime-Duf3ClPw.js → runtime-BPZgnZ9G.js} +591 -382
- package/dist/runtime-BPZgnZ9G.js.map +1 -0
- package/dist/{runtime-vH0EeZzH.cjs → runtime-CyW9c9XM.cjs} +651 -500
- package/dist/runtime-CyW9c9XM.cjs.map +1 -0
- package/dist/testing.cjs +23 -21
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +3 -2
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +5 -3
- package/dist/testing.js.map +1 -1
- package/package.json +9 -5
- package/src/ai/AgentConnectionNodeCollector.ts +1 -1
- package/src/authoring/defineHumanApprovalNode.types.ts +379 -0
- package/src/authoring/index.ts +6 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
- package/src/contracts/credentialTypes.ts +10 -0
- package/src/contracts/hitlSeamTypes.ts +34 -0
- package/src/contracts/humanTaskStoreTypes.ts +48 -0
- package/src/contracts/inboxChannelTypes.ts +58 -0
- package/src/contracts/index.ts +3 -0
- package/src/contracts/runTypes.ts +61 -3
- package/src/contracts/runtimeTypes.ts +112 -0
- package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
- package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
- package/src/credentials/ManagedMaterialFetchError.ts +16 -0
- package/src/execution/ActivationEnqueueService.ts +16 -0
- package/src/execution/DefaultExecutionContextFactory.ts +11 -0
- package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
- package/src/execution/NodeExecutor.ts +60 -1
- package/src/execution/NodeExecutorFactory.ts +12 -2
- package/src/execution/NodeSuspensionHandler.ts +220 -0
- package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
- package/src/execution/RunStateSemantics.ts +5 -0
- package/src/execution/RunSuspendedError.ts +21 -0
- package/src/index.ts +40 -0
- package/src/orchestration/Engine.ts +12 -2
- package/src/orchestration/EngineWaiters.ts +1 -1
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
- package/src/orchestration/RunContinuationService.ts +226 -2
- package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
- package/src/runtime/RunIntentService.ts +3 -0
- package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
- package/tsdown.config.ts +1 -1
- package/dist/InMemoryRunDataFactory-hmkh0lzR.d.cts +0 -138
- package/dist/bootstrap-Dgzsjoj7.js.map +0 -1
- package/dist/bootstrap-dVmpU1ju.cjs.map +0 -1
- package/dist/runtime-Duf3ClPw.js.map +0 -1
- package/dist/runtime-vH0EeZzH.cjs.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;
|
|
@@ -705,6 +822,14 @@ interface ExecutionContext {
|
|
|
705
822
|
* Collections registered in the codemation config, keyed by collection name.
|
|
706
823
|
*/
|
|
707
824
|
readonly collections?: CollectionsContext;
|
|
825
|
+
/**
|
|
826
|
+
* Resolve a DI token from the host container.
|
|
827
|
+
* Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
|
|
828
|
+
* without importing host code. Wired by `DefaultExecutionContextFactory`; throws
|
|
829
|
+
* a clear error when no resolver is configured (e.g. in unit tests that don't
|
|
830
|
+
* set up the full container).
|
|
831
|
+
*/
|
|
832
|
+
resolve<T>(token: TypeToken<T>): T;
|
|
708
833
|
}
|
|
709
834
|
interface ExecutionContextFactory {
|
|
710
835
|
create(args: {
|
|
@@ -728,6 +853,11 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
|
|
|
728
853
|
config: TConfig;
|
|
729
854
|
telemetry: NodeExecutionTelemetry;
|
|
730
855
|
binary: NodeBinaryAttachmentService;
|
|
856
|
+
/**
|
|
857
|
+
* Present when this node activation is a HITL resume.
|
|
858
|
+
* The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
|
|
859
|
+
*/
|
|
860
|
+
resumeContext?: ResumeContext;
|
|
731
861
|
}
|
|
732
862
|
interface PollingTriggerHandle {
|
|
733
863
|
/**
|
|
@@ -1634,7 +1764,7 @@ interface RunQueueEntry {
|
|
|
1634
1764
|
received: Readonly<Record<InputPortKey, Items>>;
|
|
1635
1765
|
}>;
|
|
1636
1766
|
}
|
|
1637
|
-
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped";
|
|
1767
|
+
type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped" | "hitl-approved" | "hitl-rejected" | "hitl-timeout" | "hitl-auto-accepted" | "hitl-cancelled";
|
|
1638
1768
|
interface NodeExecutionError {
|
|
1639
1769
|
message: string;
|
|
1640
1770
|
name?: string;
|
|
@@ -1742,7 +1872,9 @@ interface ExecutionFrontierPlan {
|
|
|
1742
1872
|
clearedNodeIds: ReadonlyArray<NodeId>;
|
|
1743
1873
|
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
1744
1874
|
}
|
|
1745
|
-
type RunStatus = "running" | "pending" | "completed" | "failed";
|
|
1875
|
+
type RunStatus = "running" | "pending" | "completed" | "failed" | "suspended" | "halted";
|
|
1876
|
+
/** Reason a run transitioned to {@link RunStatus} `"halted"`. */
|
|
1877
|
+
type RunHaltReason = "hitl-rejected" | "hitl-timeout" | "hitl-cancelled";
|
|
1746
1878
|
interface RunSummary {
|
|
1747
1879
|
runId: RunId;
|
|
1748
1880
|
workflowId: WorkflowId;
|
|
@@ -1776,6 +1908,35 @@ interface PersistedRunSchedulingState {
|
|
|
1776
1908
|
pending?: PendingNodeExecution;
|
|
1777
1909
|
queue: RunQueueEntry[];
|
|
1778
1910
|
}
|
|
1911
|
+
/** One persisted suspension entry per suspended item. */
|
|
1912
|
+
interface PersistedSuspensionEntry {
|
|
1913
|
+
/** Opaque task identifier (UUID v4). */
|
|
1914
|
+
readonly taskId: string;
|
|
1915
|
+
readonly nodeId: NodeId;
|
|
1916
|
+
readonly activationId: NodeActivationId;
|
|
1917
|
+
readonly itemIndex: number;
|
|
1918
|
+
/** SHA-256 hex digest of the decision schema JSON (for schema-drift detection). */
|
|
1919
|
+
readonly decisionSchemaHash: string;
|
|
1920
|
+
/** Serialized return value from `SuspensionRequest.deliver` (stored on the HumanTask row). */
|
|
1921
|
+
readonly deliveryRef: JsonValue;
|
|
1922
|
+
/** ISO timestamp when the task expires. */
|
|
1923
|
+
readonly timeoutAt: string;
|
|
1924
|
+
readonly onTimeout: "halt" | "auto-accept";
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* When a node is re-activated after suspension, the engine writes the resume context here
|
|
1928
|
+
* so `NodeExecutionRequestHandlerService` can splice `resumeContext` into ctx.
|
|
1929
|
+
* Cleared once the re-activation is consumed.
|
|
1930
|
+
*/
|
|
1931
|
+
interface PendingResumeEntry {
|
|
1932
|
+
readonly activationId: NodeActivationId;
|
|
1933
|
+
readonly nodeId: NodeId;
|
|
1934
|
+
/**
|
|
1935
|
+
* Typed as `unknown` here to avoid a circular import between runTypes ↔ runtimeTypes.
|
|
1936
|
+
* `NodeExecutionRequestHandlerService` casts this to `ResumeContext` from runtimeTypes.
|
|
1937
|
+
*/
|
|
1938
|
+
readonly resumeContext: unknown;
|
|
1939
|
+
}
|
|
1779
1940
|
interface PersistedRunState {
|
|
1780
1941
|
runId: RunId;
|
|
1781
1942
|
workflowId: WorkflowId;
|
|
@@ -1794,12 +1955,24 @@ interface PersistedRunState {
|
|
|
1794
1955
|
/** Successful node completions so far (for activation budget). */
|
|
1795
1956
|
engineCounters?: EngineRunCounters;
|
|
1796
1957
|
status: RunStatus;
|
|
1958
|
+
/** Populated when `status === "halted"` to discriminate why the run was halted. */
|
|
1959
|
+
reason?: RunHaltReason;
|
|
1797
1960
|
pending?: PendingNodeExecution;
|
|
1798
1961
|
queue: RunQueueEntry[];
|
|
1799
1962
|
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
1800
1963
|
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
1801
1964
|
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
1802
1965
|
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
1966
|
+
/**
|
|
1967
|
+
* One entry per outstanding HITL suspension (per-item).
|
|
1968
|
+
* Present and non-empty iff `status === "suspended"`.
|
|
1969
|
+
*/
|
|
1970
|
+
suspension?: ReadonlyArray<PersistedSuspensionEntry>;
|
|
1971
|
+
/**
|
|
1972
|
+
* Written by `resumeRun()` so `NodeExecutionRequestHandlerService` can splice `resumeContext`
|
|
1973
|
+
* into the ctx when re-executing the suspended node. Cleared once consumed.
|
|
1974
|
+
*/
|
|
1975
|
+
pendingResume?: PendingResumeEntry;
|
|
1803
1976
|
}
|
|
1804
1977
|
interface WorkflowExecutionRepository {
|
|
1805
1978
|
createRun(args: {
|
|
@@ -1859,6 +2032,12 @@ type RunResult = {
|
|
|
1859
2032
|
error: {
|
|
1860
2033
|
message: string;
|
|
1861
2034
|
};
|
|
2035
|
+
} | {
|
|
2036
|
+
runId: RunId;
|
|
2037
|
+
workflowId: WorkflowId;
|
|
2038
|
+
startedAt: string;
|
|
2039
|
+
status: "halted";
|
|
2040
|
+
reason: RunHaltReason;
|
|
1862
2041
|
};
|
|
1863
2042
|
type WebhookRunResult = Readonly<{
|
|
1864
2043
|
runId: RunId;
|
|
@@ -1946,207 +2125,5 @@ interface AgentMcpIntegration {
|
|
|
1946
2125
|
}): Promise<AgentMcpToolMap>;
|
|
1947
2126
|
}
|
|
1948
2127
|
//#endregion
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
startTriggers(): Promise<void>;
|
|
1952
|
-
stop(): Promise<void>;
|
|
1953
|
-
syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
|
|
1954
|
-
createTriggerTestItems(args: {
|
|
1955
|
-
workflow: WorkflowDefinition;
|
|
1956
|
-
nodeId: NodeId;
|
|
1957
|
-
}): Promise<Items | undefined>;
|
|
1958
|
-
}
|
|
1959
|
-
interface EngineRunStartService {
|
|
1960
|
-
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
|
|
1961
|
-
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
1962
|
-
mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
|
|
1963
|
-
}>): Promise<RunResult>;
|
|
1964
|
-
runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
|
|
1965
|
-
}
|
|
1966
|
-
interface EngineRunContinuationService {
|
|
1967
|
-
markNodeRunning(args: {
|
|
1968
|
-
runId: RunId;
|
|
1969
|
-
activationId: NodeActivationId;
|
|
1970
|
-
nodeId: NodeId;
|
|
1971
|
-
inputsByPort: NodeInputsByPort;
|
|
1972
|
-
}): Promise<void>;
|
|
1973
|
-
resumeFromNodeResult(args: {
|
|
1974
|
-
runId: RunId;
|
|
1975
|
-
activationId: NodeActivationId;
|
|
1976
|
-
nodeId: NodeId;
|
|
1977
|
-
outputs: NodeOutputs;
|
|
1978
|
-
}): Promise<RunResult>;
|
|
1979
|
-
resumeFromNodeError(args: {
|
|
1980
|
-
runId: RunId;
|
|
1981
|
-
activationId: NodeActivationId;
|
|
1982
|
-
nodeId: NodeId;
|
|
1983
|
-
error: Error;
|
|
1984
|
-
}): Promise<RunResult>;
|
|
1985
|
-
resumeFromStepResult(args: {
|
|
1986
|
-
runId: RunId;
|
|
1987
|
-
activationId: NodeActivationId;
|
|
1988
|
-
nodeId: NodeId;
|
|
1989
|
-
outputs: NodeOutputs;
|
|
1990
|
-
}): Promise<RunResult>;
|
|
1991
|
-
resumeFromStepError(args: {
|
|
1992
|
-
runId: RunId;
|
|
1993
|
-
activationId: NodeActivationId;
|
|
1994
|
-
nodeId: NodeId;
|
|
1995
|
-
error: Error;
|
|
1996
|
-
}): Promise<RunResult>;
|
|
1997
|
-
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
1998
|
-
status: "completed" | "failed";
|
|
1999
|
-
}>>;
|
|
2000
|
-
waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
|
|
2001
|
-
}
|
|
2002
|
-
interface EngineNodeExecutionRequestHandler {
|
|
2003
|
-
handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
|
|
2004
|
-
}
|
|
2005
|
-
interface EngineFacadeDeps {
|
|
2006
|
-
liveWorkflowRepository: LiveWorkflowRepository;
|
|
2007
|
-
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
2008
|
-
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
2009
|
-
workflowSnapshotResolver: WorkflowSnapshotResolver;
|
|
2010
|
-
triggerRuntime: EngineTriggerRuntime;
|
|
2011
|
-
runStartService: EngineRunStartService;
|
|
2012
|
-
runContinuationService: EngineRunContinuationService;
|
|
2013
|
-
nodeExecutionRequestHandler: EngineNodeExecutionRequestHandler;
|
|
2014
|
-
}
|
|
2015
|
-
/**
|
|
2016
|
-
* Runtime facade for orchestration, continuation, triggers, and webhook routing.
|
|
2017
|
-
* Prefer {@link import("../intents/RunIntentService").RunIntentService} for host/HTTP invocation boundaries.
|
|
2018
|
-
* The class token is exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
|
|
2019
|
-
*/
|
|
2020
|
-
declare class Engine implements NodeActivationContinuation, NodeExecutionRequestHandler {
|
|
2021
|
-
private readonly deps;
|
|
2022
|
-
constructor(deps: EngineFacadeDeps);
|
|
2023
|
-
loadWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
2024
|
-
getTokenRegistry(): EngineFacadeDeps["tokenRegistry"];
|
|
2025
|
-
resolveWorkflowSnapshot(args: {
|
|
2026
|
-
workflowId: WorkflowId;
|
|
2027
|
-
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
2028
|
-
}): WorkflowDefinition | undefined;
|
|
2029
|
-
startTriggers(): Promise<void>;
|
|
2030
|
-
syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
|
|
2031
|
-
start(workflows: WorkflowDefinition[]): Promise<void>;
|
|
2032
|
-
stop(): Promise<void>;
|
|
2033
|
-
resolveWebhookTrigger(args: {
|
|
2034
|
-
endpointPath: string;
|
|
2035
|
-
method: HttpMethod;
|
|
2036
|
-
}): WebhookTriggerResolution;
|
|
2037
|
-
createTriggerTestItems(args: {
|
|
2038
|
-
workflow: WorkflowDefinition;
|
|
2039
|
-
nodeId: NodeId;
|
|
2040
|
-
}): Promise<Items | undefined>;
|
|
2041
|
-
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
|
|
2042
|
-
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
2043
|
-
mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
|
|
2044
|
-
}>): Promise<RunResult>;
|
|
2045
|
-
runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
|
|
2046
|
-
markNodeRunning(args: {
|
|
2047
|
-
runId: RunId;
|
|
2048
|
-
activationId: NodeActivationId;
|
|
2049
|
-
nodeId: NodeId;
|
|
2050
|
-
inputsByPort: NodeInputsByPort;
|
|
2051
|
-
}): Promise<void>;
|
|
2052
|
-
resumeFromNodeResult(args: {
|
|
2053
|
-
runId: RunId;
|
|
2054
|
-
activationId: NodeActivationId;
|
|
2055
|
-
nodeId: NodeId;
|
|
2056
|
-
outputs: NodeOutputs;
|
|
2057
|
-
}): Promise<RunResult>;
|
|
2058
|
-
resumeFromNodeError(args: {
|
|
2059
|
-
runId: RunId;
|
|
2060
|
-
activationId: NodeActivationId;
|
|
2061
|
-
nodeId: NodeId;
|
|
2062
|
-
error: Error;
|
|
2063
|
-
}): Promise<RunResult>;
|
|
2064
|
-
resumeFromStepResult(args: {
|
|
2065
|
-
runId: RunId;
|
|
2066
|
-
activationId: NodeActivationId;
|
|
2067
|
-
nodeId: NodeId;
|
|
2068
|
-
outputs: NodeOutputs;
|
|
2069
|
-
}): Promise<RunResult>;
|
|
2070
|
-
resumeFromStepError(args: {
|
|
2071
|
-
runId: RunId;
|
|
2072
|
-
activationId: NodeActivationId;
|
|
2073
|
-
nodeId: NodeId;
|
|
2074
|
-
error: Error;
|
|
2075
|
-
}): Promise<RunResult>;
|
|
2076
|
-
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
2077
|
-
status: "completed" | "failed";
|
|
2078
|
-
}>>;
|
|
2079
|
-
waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
|
|
2080
|
-
handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
|
|
2081
|
-
}
|
|
2082
|
-
//#endregion
|
|
2083
|
-
//#region src/runtime/InMemoryLiveWorkflowRepository.d.ts
|
|
2084
|
-
declare class InMemoryLiveWorkflowRepository implements LiveWorkflowRepository {
|
|
2085
|
-
private readonly workflowsById;
|
|
2086
|
-
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
2087
|
-
list(): ReadonlyArray<WorkflowDefinition>;
|
|
2088
|
-
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
2089
|
-
}
|
|
2090
|
-
//#endregion
|
|
2091
|
-
//#region src/runtime/RunIntentService.d.ts
|
|
2092
|
-
type StartWorkflowIntent = {
|
|
2093
|
-
workflow: WorkflowDefinition;
|
|
2094
|
-
startAt?: string;
|
|
2095
|
-
items: Items;
|
|
2096
|
-
synthesizeTriggerItems?: boolean;
|
|
2097
|
-
parent?: CurrentStateExecutionRequest["parent"];
|
|
2098
|
-
executionOptions?: RunExecutionOptions;
|
|
2099
|
-
workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
|
|
2100
|
-
mutableState?: CurrentStateExecutionRequest["mutableState"];
|
|
2101
|
-
currentState?: RunCurrentState;
|
|
2102
|
-
stopCondition?: RunStopCondition;
|
|
2103
|
-
reset?: CurrentStateExecutionRequest["reset"];
|
|
2104
|
-
};
|
|
2105
|
-
type RerunFromNodeIntent = {
|
|
2106
|
-
workflow: WorkflowDefinition;
|
|
2107
|
-
nodeId: NodeId;
|
|
2108
|
-
currentState: RunCurrentState;
|
|
2109
|
-
items?: Items;
|
|
2110
|
-
synthesizeTriggerItems?: boolean;
|
|
2111
|
-
parent?: CurrentStateExecutionRequest["parent"];
|
|
2112
|
-
executionOptions?: RunExecutionOptions;
|
|
2113
|
-
workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
|
|
2114
|
-
mutableState?: CurrentStateExecutionRequest["mutableState"];
|
|
2115
|
-
};
|
|
2116
|
-
type MatchedWebhookRunIntent = {
|
|
2117
|
-
endpointPath: string;
|
|
2118
|
-
method: HttpMethod;
|
|
2119
|
-
requestItem: Items[number];
|
|
2120
|
-
};
|
|
2121
|
-
type WebhookMatchRunIntent = {
|
|
2122
|
-
match: WebhookInvocationMatch;
|
|
2123
|
-
requestItem: Items[number];
|
|
2124
|
-
};
|
|
2125
|
-
declare class RunIntentService {
|
|
2126
|
-
private readonly engine;
|
|
2127
|
-
private readonly workflowRepository;
|
|
2128
|
-
constructor(engine: Engine, workflowRepository: WorkflowRepository);
|
|
2129
|
-
startWorkflow(args: StartWorkflowIntent): Promise<RunResult>;
|
|
2130
|
-
rerunFromNode(args: RerunFromNodeIntent): Promise<RunResult>;
|
|
2131
|
-
private resolveStartWorkflowItems;
|
|
2132
|
-
private resolveRerunItems;
|
|
2133
|
-
private resolveStartWorkflowTriggerNodeId;
|
|
2134
|
-
private resolveRerunTriggerNodeId;
|
|
2135
|
-
private firstTriggerNodeId;
|
|
2136
|
-
private isTriggerNode;
|
|
2137
|
-
private hasNonEmptyItems;
|
|
2138
|
-
resolveWebhookTrigger(args: {
|
|
2139
|
-
endpointPath: string;
|
|
2140
|
-
method: HttpMethod;
|
|
2141
|
-
}): WebhookTriggerResolution;
|
|
2142
|
-
runMatchedWebhook(args: MatchedWebhookRunIntent): Promise<WebhookRunResult>;
|
|
2143
|
-
runWebhookMatch(args: WebhookMatchRunIntent): Promise<WebhookRunResult>;
|
|
2144
|
-
/**
|
|
2145
|
-
* Webhook-triggered runs always force inline execution first.
|
|
2146
|
-
* This is the highest-precedence scheduler override: it wins over node hints and container defaults.
|
|
2147
|
-
*/
|
|
2148
|
-
private createWebhookExecutionOptions;
|
|
2149
|
-
}
|
|
2150
|
-
//#endregion
|
|
2151
|
-
export { injectAll as $, NodeExecutionRequestHandler as $n, CostTrackingComponent as $r, RunnableNodeConfig as $t, RunExecutionOptions as A, CredentialTypeId as Ai, BinaryBody as An, AllWorkflowsActiveWorkflowActivationPolicy as Ar, JsonValue as At, WorkflowExecutionListingRepository as B, OutputPortKey as Bi, ExecutionContext as Bn, TelemetryMetricRecord as Br, NodeIterationId as Bt, PersistedWorkflowSnapshot as C, CredentialRequirement as Ci, triggerNodeOutputType as Cn, HttpMethod as Cr, Item as Ct, RunCompletionNotifier as D, CredentialSetupStatus as Di, NoneRetryPolicySpec as Dn, WebhookTriggerMatcher as Dr, JsonNonArray as Dt, PinnedNodeOutputsByPort as E, CredentialSessionService as Ei, FixedRetryPolicySpec as En, WebhookInvocationMatch as Er, JsonArray as Et, RunStatus as F, PollingTriggerLogger as Fi, BinaryStorageWriteResult as Fn, TelemetryArtifactAttachment as Fr, NodeErrorHandler as Ft, Disposable as G, NodeActivationContinuation as Gn, CodemationTelemetryMetricNames as Gr, NodeSchedulerDecision as Gt, WorkflowExecutionRepository as H, WorkflowId as Hi, ItemNode as Hn, TelemetrySpanEnd as Hr, NodeOffloadPolicy as Ht, RunStopCondition as I, PollingTriggerDedupWindow as Ii, EngineDeps as In, TelemetryArtifactReference as Ir, NodeErrorHandlerArgs as It, RegistrationOptions as J, NodeActivationRequestBase as Jn, NoOpExecutionTelemetryFactory as Jr, PersistedRunPolicySnapshot as Jt, InjectionToken$1 as K, NodeActivationReceipt as Kn, GenAiTelemetryAttributeNames as Kr, PairedItemRef as Kt, RunSummary as L, InputPortKey as Li, EngineHost as Ln, TelemetryAttributePrimitive as Lr, NodeErrorHandlerSpec as Lt, RunQueueEntry as M, CredentialUnboundError as Mi, BinaryStorageReadResult as Mn, ExecutionTelemetry as Mr, NodeActivationId as Mt, RunResult as N, OAuth2ProviderFromPublicConfig as Ni, BinaryStorageStatResult as Nn, ExecutionTelemetryFactory as Nr, NodeConfigBase as Nt, RunCurrentState as O, CredentialType as Oi, RetryPolicySpec as On, WebhookTriggerResolution as Or, JsonObject as Ot, RunStateResetRequest as P, NoOpPollingTriggerLogger as Pi, BinaryStorageWriteRequest as Pn, NodeExecutionTelemetry as Pr, NodeDefinition as Pt, inject as Q, NodeExecutionRequest as Qn, NoOpTelemetryArtifactReference as Qr, RunIdFactory as Qt, RunTestContext as R, NodeConnectionName as Ri, ExecutableTriggerNode as Rn, TelemetryAttributes as Rr, NodeIdRef as Rt, PersistedRunState as S, CredentialOAuth2ScopesFromPublicConfig as Si, runnableNodeOutputType as Sn, WorkflowSnapshotResolver as Sr, ExecutionMode as St, PersistedWorkflowTokenRegistryLike as T, CredentialSessionFactoryArgs as Ti, ExponentialRetryPolicySpec as Tn, WebhookControlSignal as Tr, Items as Tt, Container as U, LiveWorkflowRepository as Un, TelemetrySpanEventRecord as Ur, NodeOutputs as Ut, WorkflowExecutionPruneRepository as V, PersistedTokenId as Vi, ExecutionContextFactory as Vn, TelemetryScope as Vr, NodeKind as Vt, DependencyContainer$1 as W, MultiInputNode as Wn, TelemetrySpanScope as Wr, NodeRef as Wt, container as X, NodeBinaryAttachmentService as Xn, NoOpNodeExecutionTelemetry as Xr, RunDataSnapshot as Xt, TypeToken as Y, NodeActivationScheduler as Yn, NoOpExecutionTelemetry as Yr, RunDataFactory as Yt, delay as Z, NodeExecutionContext as Zn, NoOpTelemetrySpanScope as Zr, RunId as Zt, PendingNodeExecution as _, CredentialInstanceId as _i, WorkflowStoragePolicyResolver as _n, WorkflowNodeInstanceFactory as _r, TestTriggerSetupContext as _t, AgentMcpToolMap as a, CostTrackingUsageRecord as ai, UpstreamRefPlaceholder as an, PollingTriggerHandle as ar, singleton as at, PersistedRunControlState as b, CredentialMaterialSourceKind as bi, nodeRef as bn, WorkflowRunnerService as br, BinaryPreviewKind as bt, ConnectionInvocationId as c, AnyCredentialType as ci, WorkflowErrorHandler as cn, RunnableNodeExecuteArgs as cr, EngineExecutionLimitsPolicy as ct, EngineRunCounters as d, CredentialBinding as di, WorkflowGraphFactory as dn, TriggerNode as dr, RunEventBus as dt, CostTrackingPriceQuote as ei, RunnableNodeInputJson as en, NodeExecutionScheduler as er, injectable as et, ExecutionFrontierPlan as f, CredentialBindingKey as fi, WorkflowNodeConnection as fn, TriggerRuntimeDiagnostics as fr, RunEventSubscription as ft, NodeInputsByPort as g, CredentialHealthTester as gi, WorkflowStoragePolicyMode as gn, TriggerTestItemsContext as gr, TestTriggerNodeConfig as gt, NodeExecutionStatus as h, CredentialHealthStatus as hi, WorkflowStoragePolicyDecisionArgs as hn, TriggerSetupStateRepository as hr, TestSuiteRunId as ht, AgentMcpIntegration as i, CostTrackingTelemetryMetricNames as ii, TriggerNodeSetupState as in, PersistedTriggerSetupState as ir, registry as it, RunPruneCandidate as j, CredentialTypeRegistry as ji, BinaryStorage as jn, WorkflowActivationPolicy as jr, MutableRunData as jt, RunEventPublisherDeps as k, CredentialTypeDefinition as ki, BinaryAttachmentCreateRequest as kn, WebhookTriggerRoutingDiagnostics as kr, JsonPrimitive as kt, ConnectionInvocationRecord as l, CredentialAdvancedSectionPresentation as li, WorkflowErrorHandlerSpec as ln, TestableTriggerNode as lr, EngineExecutionLimitsPolicyConfig as lt, NodeExecutionSnapshot as m, CredentialHealth as mi, WorkflowPrunePolicySpec as mn, TriggerSetupStateFor as mr, TestSuiteRunStatus as mt, InMemoryLiveWorkflowRepository as n, CostTrackingTelemetryAttributeNames as ni, TriggerNodeConfig as nn, NodeExecutor as nr, instancePerContainerCachingFactory as nt, NeedsReconsentEvent as o, CollectionStore as oi, WorkflowDefinition as on, PreparedNodeActivationDispatch as or, CoreTokens as ot, NodeExecutionError as p, CredentialFieldSchema as pi, WorkflowPolicyRuntimeDefaults as pn, TriggerSetupContext as pr, TestCaseRunStatus as pt, Lifecycle as q, NodeActivationRequest as qn, CodemationTelemetryAttributeNames as qr, ParentExecutionRef as qt, Engine as r, CostTrackingTelemetryFactory as ri, TriggerNodeOutputJson as rn, NodeResolver as rr, predicateAwareClassFactory as rt, ConnectionInvocationAppendArgs as s, CollectionsContext as si, WorkflowErrorContext as sn, RunnableNode as sr, ENGINE_EXECUTION_LIMITS_DEFAULTS as st, RunIntentService as t, CostTrackingTelemetry as ti, RunnableNodeOutputJson as tn, NodeExecutionStatePublisher as tr, instanceCachingFactory as tt, CurrentStateExecutionRequest as u, CredentialAuthDefinition as ui, WorkflowGraph as un, TriggerCleanupHandle as ur, RunEvent as ut, PersistedMutableNodeState as v, CredentialInstanceRecord as vi, WorkflowStoragePolicySpec as vn, WorkflowRepository as vr, ActivationIdFactory as vt, PersistedWorkflowSnapshotNode as w, CredentialSessionFactory as wi, triggerNodeSetupStateType as wn, TriggerInstanceId as wr, ItemBinary as wt, PersistedRunSchedulingState as x, CredentialOAuth2AuthDefinition as xi, runnableNodeInputType as xn, WorkflowSnapshotFactory as xr, Edge as xt, PersistedMutableRunState as y, CredentialJsonRecord as yi, branchRef as yn, WorkflowRunnerResolver as yr, BinaryAttachment as yt, WebhookRunResult as z, NodeId as zi, ExecutionBinaryService as zn, TelemetryChildSpanStart as zr, NodeInspectorSummaryRow as zt };
|
|
2152
|
-
//# sourceMappingURL=RunIntentService-MUHJ1bhO.d.cts.map
|
|
2128
|
+
export { injectAll as $, NodeActivationRequestBase as $n, GenAiTelemetryAttributeNames as $r, RunnableNodeConfig as $t, RunHaltReason as A, CredentialRequirement as Ai, BinaryBody as An, HttpMethod as Ar, JsonValue as At, WorkflowExecutionListingRepository as B, OAuth2ProviderFromPublicConfig as Bi, ExecutionBinaryService as Bn, ExecutionTelemetryFactory as Br, NodeIterationId as Bt, PersistedWorkflowSnapshotNode as C, CredentialHealthTester as Ci, triggerNodeOutputType as Cn, TriggerTestItemsContext as Cr, Item as Ct, RunCurrentState as D, CredentialMaterialSourceKind as Di, NoneRetryPolicySpec as Dn, WorkflowRunnerService as Dr, JsonNonArray as Dt, RunCompletionNotifier as E, CredentialJsonRecord as Ei, FixedRetryPolicySpec as En, WorkflowRunnerResolver as Er, JsonArray as Et, RunStatus as F, CredentialType as Fi, BinaryStorageWriteResult as Fn, WebhookTriggerResolution as Fr, NodeErrorHandler as Ft, Disposable as G, NodeConnectionName as Gi, HumanTaskId as Gn, TelemetryAttributes as Gr, NodeSchedulerDecision as Gt, WorkflowExecutionRepository as H, PollingTriggerLogger as Hi, ExecutionContextFactory as Hn, TelemetryArtifactAttachment as Hr, NodeOffloadPolicy as Ht, RunStopCondition as I, CredentialTypeDefinition as Ii, Duration as In, WebhookTriggerRoutingDiagnostics as Ir, NodeErrorHandlerArgs as It, RegistrationOptions as J, PersistedTokenId as Ji, LiveWorkflowRepository as Jn, TelemetryScope as Jr, PersistedRunPolicySnapshot as Jt, InjectionToken$1 as K, NodeId as Ki, HumanTaskSubject as Kn, TelemetryChildSpanStart as Kr, PairedItemRef as Kt, RunSummary as L, CredentialTypeId as Li, EngineDeps as Ln, AllWorkflowsActiveWorkflowActivationPolicy as Lr, NodeErrorHandlerSpec as Lt, RunQueueEntry as M, CredentialSessionFactoryArgs as Mi, BinaryStorageReadResult as Mn, WebhookControlSignal as Mr, NodeActivationId as Mt, RunResult as N, CredentialSessionService as Ni, BinaryStorageStatResult as Nn, WebhookInvocationMatch as Nr, NodeConfigBase as Nt, RunEventPublisherDeps as O, CredentialOAuth2AuthDefinition as Oi, RetryPolicySpec as On, WorkflowSnapshotFactory as Or, JsonObject as Ot, RunStateResetRequest as P, CredentialSetupStatus as Pi, BinaryStorageWriteRequest as Pn, WebhookTriggerMatcher as Pr, NodeDefinition as Pt, inject as Q, NodeActivationRequest as Qn, CodemationTelemetryMetricNames as Qr, RunIdFactory as Qt, RunTestContext as R, CredentialTypeRegistry as Ri, EngineHost as Rn, WorkflowActivationPolicy as Rr, NodeIdRef as Rt, PersistedWorkflowSnapshot as S, CredentialHealthStatus as Si, runnableNodeOutputType as Sn, TriggerSetupStateRepository as Sr, ExecutionMode as St, PinnedNodeOutputsByPort as T, CredentialInstanceRecord as Ti, ExponentialRetryPolicySpec as Tn, WorkflowRepository as Tr, Items as Tt, Container as U, PollingTriggerDedupWindow as Ui, HumanTaskActor as Un, TelemetryArtifactReference as Ur, NodeOutputs as Ut, WorkflowExecutionPruneRepository as V, NoOpPollingTriggerLogger as Vi, ExecutionContext as Vn, NodeExecutionTelemetry as Vr, NodeKind as Vt, DependencyContainer$1 as W, InputPortKey as Wi, HumanTaskHandle as Wn, TelemetryAttributePrimitive as Wr, NodeRef as Wt, container as X, NodeActivationContinuation as Xn, TelemetrySpanEventRecord as Xr, RunDataSnapshot as Xt, TypeToken as Y, WorkflowId as Yi, MultiInputNode as Yn, TelemetrySpanEnd as Yr, RunDataFactory as Yt, delay as Z, NodeActivationReceipt as Zn, TelemetrySpanScope as Zr, RunId as Zt, PersistedMutableRunState as _, CredentialAuthDefinition as _i, WorkflowStoragePolicyResolver as _n, TriggerCleanupHandle as _r, TestTriggerSetupContext as _t, ConnectionInvocationId as a, NoOpTelemetryArtifactReference as ai, UpstreamRefPlaceholder as an, NodeExecutionScheduler as ar, singleton as at, PersistedRunState as b, CredentialFieldSchema as bi, nodeRef as bn, TriggerSetupContext as br, BinaryPreviewKind as bt, EngineRunCounters as c, CostTrackingTelemetry as ci, WorkflowErrorHandler as cn, NodeResolver as cr, EngineExecutionLimitsPolicy as ct, NodeExecutionSnapshot as d, CostTrackingTelemetryMetricNames as di, WorkflowGraphFactory as dn, PreparedNodeActivationDispatch as dr, RunEventBus as dt, CodemationTelemetryAttributeNames as ei, RunnableNodeInputJson as en, NodeActivationScheduler as er, injectable as et, NodeExecutionStatus as f, CostTrackingUsageRecord as fi, WorkflowNodeConnection as fn, ResumeContext as fr, RunEventSubscription as ft, PersistedMutableNodeState as g, CredentialAdvancedSectionPresentation as gi, WorkflowStoragePolicyMode as gn, TestableTriggerNode as gr, TestTriggerNodeConfig as gt, PendingResumeEntry as h, AnyCredentialType as hi, WorkflowStoragePolicyDecisionArgs as hn, SuspensionRequest as hr, TestSuiteRunId as ht, ConnectionInvocationAppendArgs as i, NoOpTelemetrySpanScope as ii, TriggerNodeSetupState as in, NodeExecutionRequestHandler as ir, registry as it, RunPruneCandidate as j, CredentialSessionFactory as ji, BinaryStorage as jn, TriggerInstanceId as jr, MutableRunData as jt, RunExecutionOptions as k, CredentialOAuth2ScopesFromPublicConfig as ki, BinaryAttachmentCreateRequest as kn, WorkflowSnapshotResolver as kr, JsonPrimitive as kt, ExecutionFrontierPlan as l, CostTrackingTelemetryAttributeNames as li, WorkflowErrorHandlerSpec as ln, PersistedTriggerSetupState as lr, EngineExecutionLimitsPolicyConfig as lt, PendingNodeExecution as m, CollectionsContext as mi, WorkflowPrunePolicySpec as mn, RunnableNodeExecuteArgs as mr, TestSuiteRunStatus as mt, AgentMcpToolMap as n, NoOpExecutionTelemetry as ni, TriggerNodeConfig as nn, NodeExecutionContext as nr, instancePerContainerCachingFactory as nt, ConnectionInvocationRecord as o, CostTrackingComponent as oi, WorkflowDefinition as on, NodeExecutionStatePublisher as or, CoreTokens as ot, NodeInputsByPort as p, CollectionStore as pi, WorkflowPolicyRuntimeDefaults as pn, RunnableNode as pr, TestCaseRunStatus as pt, Lifecycle as q, OutputPortKey as qi, ItemNode as qn, TelemetryMetricRecord as qr, ParentExecutionRef as qt, NeedsReconsentEvent as r, NoOpNodeExecutionTelemetry as ri, TriggerNodeOutputJson as rn, NodeExecutionRequest as rr, predicateAwareClassFactory as rt, CurrentStateExecutionRequest as s, CostTrackingPriceQuote as si, WorkflowErrorContext as sn, NodeExecutor as sr, ENGINE_EXECUTION_LIMITS_DEFAULTS as st, AgentMcpIntegration as t, NoOpExecutionTelemetryFactory as ti, RunnableNodeOutputJson as tn, NodeBinaryAttachmentService as tr, instanceCachingFactory as tt, NodeExecutionError as u, CostTrackingTelemetryFactory as ui, WorkflowGraph as un, PollingTriggerHandle as ur, RunEvent as ut, PersistedRunControlState as v, CredentialBinding as vi, WorkflowStoragePolicySpec as vn, TriggerNode as vr, ActivationIdFactory as vt, PersistedWorkflowTokenRegistryLike as w, CredentialInstanceId as wi, triggerNodeSetupStateType as wn, WorkflowNodeInstanceFactory as wr, ItemBinary as wt, PersistedSuspensionEntry as x, CredentialHealth as xi, runnableNodeInputType as xn, TriggerSetupStateFor as xr, Edge as xt, PersistedRunSchedulingState as y, CredentialBindingKey as yi, branchRef as yn, TriggerRuntimeDiagnostics as yr, BinaryAttachment as yt, WebhookRunResult as z, CredentialUnboundError as zi, ExecutableTriggerNode as zn, ExecutionTelemetry as zr, NodeInspectorSummaryRow as zt };
|
|
2129
|
+
//# sourceMappingURL=agentMcpTypes-DUmniLOY.d.cts.map
|
package/dist/bootstrap/index.cjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
require('../di-tO6R7VJV.cjs');
|
|
2
|
+
require('../contracts-CK0x6w_G.cjs');
|
|
3
|
+
const require_runtime = require('../runtime-CyW9c9XM.cjs');
|
|
4
|
+
const require_bootstrap = require('../bootstrap-D460dCgS.cjs');
|
|
3
5
|
|
|
4
6
|
exports.AbortControllerFactory = require_bootstrap.AbortControllerFactory;
|
|
5
7
|
exports.CatalogBackedCostTrackingTelemetryFactory = require_runtime.CatalogBackedCostTrackingTelemetryFactory;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Ar as HttpMethod, B as WorkflowExecutionListingRepository, C as PersistedWorkflowSnapshotNode, Ft as NodeErrorHandler, Gt as NodeSchedulerDecision, H as WorkflowExecutionRepository, Ht as NodeOffloadPolicy, Ir as WebhookTriggerRoutingDiagnostics, Ji as PersistedTokenId, Jr as TelemetryScope, Jt as PersistedRunPolicySnapshot, Ki as NodeId, L as RunSummary, Ln as EngineDeps, Lt as NodeErrorHandlerSpec, Mt as NodeActivationId, N as RunResult, Nr as WebhookInvocationMatch, Nt as NodeConfigBase, Pr as WebhookTriggerMatcher, Pt as NodeDefinition, Qn as NodeActivationRequest, Rr as WorkflowActivationPolicy, St as ExecutionMode, Tr as WorkflowRepository, Tt as Items, Ut as NodeOutputs, V as WorkflowExecutionPruneRepository, W as DependencyContainer, Xn as NodeActivationContinuation, Y as TypeToken, Yi as WorkflowId, Zt as RunId, ar as NodeExecutionScheduler, b as PersistedRunState, c as EngineRunCounters, ci as CostTrackingTelemetry, cn as WorkflowErrorHandler, cr as NodeResolver, ct as EngineExecutionLimitsPolicy, dr as PreparedNodeActivationDispatch, dt as RunEventBus, er as NodeActivationScheduler, fi as CostTrackingUsageRecord, hn as WorkflowStoragePolicyDecisionArgs, hr as SuspensionRequest, ht as TestSuiteRunId, j as RunPruneCandidate, k as RunExecutionOptions, ln as WorkflowErrorHandlerSpec, lt as EngineExecutionLimitsPolicyConfig, mt as TestSuiteRunStatus, on as WorkflowDefinition, pn as WorkflowPolicyRuntimeDefaults, pt as TestCaseRunStatus, qt as ParentExecutionRef, rr as NodeExecutionRequest, st as ENGINE_EXECUTION_LIMITS_DEFAULTS, ui as CostTrackingTelemetryFactory, wr as WorkflowNodeInstanceFactory, y as PersistedRunSchedulingState, zr as ExecutionTelemetry } from "../agentMcpTypes-DUmniLOY.cjs";
|
|
2
|
+
import { n as CostCatalogEntry, t as CostCatalog } from "../CostCatalogContract-DD7fQ4FF.cjs";
|
|
3
|
+
import { n as InMemoryLiveWorkflowRepository, r as Engine, t as RunIntentService } from "../RunIntentService-CWMMrAP4.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-qMiYjhCK.cjs";
|
|
5
|
+
import { a as WorkflowSnapshotCodec, i as EngineWorkflowRunnerService, n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-DTV5_7Jw.cjs";
|
|
4
6
|
|
|
5
7
|
//#region src/orchestration/AbortControllerFactory.d.ts
|
|
6
8
|
/**
|
|
@@ -49,15 +51,71 @@ declare class CatalogBackedCostTrackingTelemetryFactory implements CostTrackingT
|
|
|
49
51
|
}>): CostTrackingTelemetry;
|
|
50
52
|
}
|
|
51
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
|
|
52
104
|
//#region src/execution/NodeExecutor.d.ts
|
|
53
105
|
declare class NodeExecutor {
|
|
54
106
|
private readonly nodeInstanceFactory;
|
|
55
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?;
|
|
56
112
|
private readonly fanInMerger;
|
|
57
113
|
private readonly outputNormalizer;
|
|
58
114
|
private readonly itemExprResolver;
|
|
59
115
|
private readonly outputBehaviorResolver;
|
|
60
|
-
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);
|
|
61
119
|
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
62
120
|
private assertRequiredCredentialsBound;
|
|
63
121
|
private isCredentialError;
|
|
@@ -275,7 +333,7 @@ declare class TestSuiteRunIdFactory {
|
|
|
275
333
|
interface TestSuiteOrchestratorEngine {
|
|
276
334
|
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions): Promise<RunResult>;
|
|
277
335
|
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
278
|
-
status: "completed" | "failed";
|
|
336
|
+
status: "completed" | "failed" | "halted";
|
|
279
337
|
}>>;
|
|
280
338
|
}
|
|
281
339
|
interface TestSuiteCaseOutcome {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { Bn as ENGINE_EXECUTION_LIMITS_DEFAULTS, Cn as DependencyContainer, Do as PersistedTokenId, Hn as EngineExecutionLimitsPolicyConfig, On as TypeToken, Vn as EngineExecutionLimitsPolicy, zr as WorkflowDefinition } from "../index-CSKKuK60.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-BOSGwmqn.js";
|
|
3
|
+
import { A as InMemoryWorkflowExecutionRepository, B as NodeExecutor, D as EngineCompositionDeps, E as WorkflowRepositoryWebhookTriggerMatcher, F as DefaultDrivingScheduler, G as CatalogBackedCostTrackingTelemetryFactory, I as InlineDrivingScheduler, J as AsyncSleeper, K as DefaultExecutionContextFactory, L as ConfigDrivenOffloadPolicy, M as InMemoryBinaryStorage, N as LocalOnlyScheduler, O as EngineFactory, P as HintOnlyOffloadPolicy, R as StaticCostCatalog, W as InProcessRetryRunner, X as DefaultExecutionBinaryService, Z as UnavailableBinaryStorage, a as TestSuiteRunResult, en as CredentialResolverFactory, i as TestSuiteOrchestratorEngine, j as InMemoryRunDataFactory, k as RunSummaryMapper, n as TestSuiteCaseOutcome, o as TestSuiteRunIdFactory, q as DefaultAsyncSleeper, r as TestSuiteOrchestrator, t as RunTestSuiteArgs, tn as AbortControllerFactory, z as NodeInstanceFactory } from "../index-BZDhEQ6W.js";
|
|
4
|
+
import "../ItemsInputNormalizer-C09a7iFP.js";
|
|
5
|
+
import { n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-Dl92Hdoi.js";
|
|
4
6
|
|
|
5
7
|
//#region src/bootstrap/runtime/EngineRuntimeRegistrar.d.ts
|
|
6
|
-
|
|
7
8
|
/**
|
|
8
9
|
* Container-first entry: call on a host/test container **after** workflow, run, node, and credential
|
|
9
10
|
* ports are registered. The registrar owns the default inline scheduler, engine binding,
|
package/dist/bootstrap/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import "../di-DdsgWfVy.js";
|
|
2
|
+
import "../contracts-DXdfTdpW.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-BPZgnZ9G.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-CKTMMNmL.js";
|
|
3
5
|
|
|
4
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 };
|