@acpus/runtime 0.8.0 → 0.9.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -0
- package/dist/admission/input.d.ts +5 -0
- package/dist/admission/input.d.ts.map +1 -0
- package/dist/admission/input.js +17 -0
- package/dist/admission/input.js.map +1 -0
- package/dist/artifacts/rewrite.d.ts +7 -0
- package/dist/artifacts/rewrite.d.ts.map +1 -0
- package/dist/artifacts/rewrite.js +28 -0
- package/dist/artifacts/rewrite.js.map +1 -0
- package/dist/control/agent-overrides.d.ts +4 -0
- package/dist/control/agent-overrides.d.ts.map +1 -0
- package/dist/control/agent-overrides.js +40 -0
- package/dist/control/agent-overrides.js.map +1 -0
- package/dist/daemon/loop.d.ts +16 -0
- package/dist/daemon/loop.d.ts.map +1 -0
- package/dist/daemon/loop.js +191 -0
- package/dist/daemon/loop.js.map +1 -0
- package/dist/daemon/sessions.d.ts +23 -0
- package/dist/daemon/sessions.d.ts.map +1 -0
- package/dist/daemon/sessions.js +190 -0
- package/dist/daemon/sessions.js.map +1 -0
- package/dist/daemon/socket.d.ts +82 -0
- package/dist/daemon/socket.d.ts.map +1 -0
- package/dist/daemon/socket.js +341 -0
- package/dist/daemon/socket.js.map +1 -0
- package/dist/daemon/tick.d.ts +9 -0
- package/dist/daemon/tick.d.ts.map +1 -0
- package/dist/daemon/tick.js +18 -0
- package/dist/daemon/tick.js.map +1 -0
- package/dist/evaluation/admissible.d.ts +2 -0
- package/dist/evaluation/admissible.d.ts.map +1 -0
- package/dist/evaluation/admissible.js +50 -0
- package/dist/evaluation/admissible.js.map +1 -0
- package/dist/evaluation/evaluator.d.ts +14 -0
- package/dist/evaluation/evaluator.d.ts.map +1 -0
- package/dist/evaluation/evaluator.js +34 -0
- package/dist/evaluation/evaluator.js.map +1 -0
- package/dist/evaluation/loop-limit.d.ts +4 -0
- package/dist/evaluation/loop-limit.d.ts.map +1 -0
- package/dist/evaluation/loop-limit.js +9 -0
- package/dist/evaluation/loop-limit.js.map +1 -0
- package/dist/evaluation/schema.d.ts +4 -0
- package/dist/evaluation/schema.d.ts.map +1 -0
- package/dist/evaluation/schema.js +92 -0
- package/dist/evaluation/schema.js.map +1 -0
- package/dist/execution/advance.d.ts +18 -0
- package/dist/execution/advance.d.ts.map +1 -0
- package/dist/execution/advance.js +57 -0
- package/dist/execution/advance.js.map +1 -0
- package/dist/execution/agent-node.d.ts +23 -0
- package/dist/execution/agent-node.d.ts.map +1 -0
- package/dist/execution/agent-node.js +512 -0
- package/dist/execution/agent-node.js.map +1 -0
- package/dist/execution/duration.d.ts +2 -0
- package/dist/execution/duration.d.ts.map +1 -0
- package/dist/execution/duration.js +15 -0
- package/dist/execution/duration.js.map +1 -0
- package/dist/execution/ir.d.ts +3 -0
- package/dist/execution/ir.d.ts.map +1 -0
- package/dist/execution/ir.js +46 -0
- package/dist/execution/ir.js.map +1 -0
- package/dist/execution/scheduler.d.ts +59 -0
- package/dist/execution/scheduler.d.ts.map +1 -0
- package/dist/execution/scheduler.js +306 -0
- package/dist/execution/scheduler.js.map +1 -0
- package/dist/execution/task-executor.d.ts +14 -0
- package/dist/execution/task-executor.d.ts.map +1 -0
- package/dist/execution/task-executor.js +186 -0
- package/dist/execution/task-executor.js.map +1 -0
- package/dist/hooks/config.d.ts +32 -0
- package/dist/hooks/config.d.ts.map +1 -0
- package/dist/hooks/config.js +112 -0
- package/dist/hooks/config.js.map +1 -0
- package/dist/hooks/context.d.ts +50 -0
- package/dist/hooks/context.d.ts.map +1 -0
- package/dist/hooks/context.js +116 -0
- package/dist/hooks/context.js.map +1 -0
- package/dist/hooks/events.d.ts +22 -0
- package/dist/hooks/events.d.ts.map +1 -0
- package/dist/hooks/events.js +41 -0
- package/dist/hooks/events.js.map +1 -0
- package/dist/hooks/journal.d.ts +21 -19
- package/dist/hooks/journal.d.ts.map +1 -1
- package/dist/hooks/journal.js +1 -48
- package/dist/hooks/journal.js.map +1 -1
- package/dist/hooks/loader.d.ts +33 -39
- package/dist/hooks/loader.d.ts.map +1 -1
- package/dist/hooks/loader.js +79 -95
- package/dist/hooks/loader.js.map +1 -1
- package/dist/hooks/runner.d.ts +14 -41
- package/dist/hooks/runner.d.ts.map +1 -1
- package/dist/hooks/runner.js +177 -145
- package/dist/hooks/runner.js.map +1 -1
- package/dist/index.d.ts +13 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -33
- package/dist/index.js.map +1 -1
- package/dist/runs/advance-runtime.d.ts +50 -0
- package/dist/runs/advance-runtime.d.ts.map +1 -0
- package/dist/runs/advance-runtime.js +82 -0
- package/dist/runs/advance-runtime.js.map +1 -0
- package/dist/runs/use-cases.d.ts +111 -0
- package/dist/runs/use-cases.d.ts.map +1 -0
- package/dist/runs/use-cases.js +539 -0
- package/dist/runs/use-cases.js.map +1 -0
- package/dist/scheduler/advance.d.ts +65 -0
- package/dist/scheduler/advance.d.ts.map +1 -0
- package/dist/scheduler/advance.js +435 -0
- package/dist/scheduler/advance.js.map +1 -0
- package/dist/scheduler/control.d.ts +49 -0
- package/dist/scheduler/control.d.ts.map +1 -0
- package/dist/scheduler/control.js +212 -0
- package/dist/scheduler/control.js.map +1 -0
- package/dist/scheduler/event-codec.d.ts +4 -0
- package/dist/scheduler/event-codec.d.ts.map +1 -0
- package/dist/scheduler/event-codec.js +57 -0
- package/dist/scheduler/event-codec.js.map +1 -0
- package/dist/scheduler/events.d.ts +193 -0
- package/dist/scheduler/events.d.ts.map +1 -0
- package/dist/scheduler/events.js +13 -0
- package/dist/scheduler/events.js.map +1 -0
- package/dist/scheduler/fork-seed.d.ts +38 -0
- package/dist/scheduler/fork-seed.d.ts.map +1 -0
- package/dist/scheduler/fork-seed.js +590 -0
- package/dist/scheduler/fork-seed.js.map +1 -0
- package/dist/scheduler/identity.d.ts +8 -0
- package/dist/scheduler/identity.d.ts.map +1 -0
- package/dist/scheduler/identity.js +49 -0
- package/dist/scheduler/identity.js.map +1 -0
- package/dist/scheduler/ir-walk.d.ts +3 -0
- package/dist/scheduler/ir-walk.d.ts.map +1 -0
- package/dist/scheduler/ir-walk.js +25 -0
- package/dist/scheduler/ir-walk.js.map +1 -0
- package/dist/scheduler/limiter.d.ts +7 -0
- package/dist/scheduler/limiter.d.ts.map +1 -0
- package/dist/scheduler/limiter.js +10 -0
- package/dist/scheduler/limiter.js.map +1 -0
- package/dist/scheduler/materialize.d.ts +7 -0
- package/dist/scheduler/materialize.d.ts.map +1 -0
- package/dist/scheduler/materialize.js +756 -0
- package/dist/scheduler/materialize.js.map +1 -0
- package/dist/scheduler/membership.d.ts +12 -0
- package/dist/scheduler/membership.d.ts.map +1 -0
- package/dist/scheduler/membership.js +74 -0
- package/dist/scheduler/membership.js.map +1 -0
- package/dist/scheduler/node-executor.d.ts +15 -0
- package/dist/scheduler/node-executor.d.ts.map +1 -0
- package/dist/scheduler/node-executor.js +69 -0
- package/dist/scheduler/node-executor.js.map +1 -0
- package/dist/scheduler/runtime-runner.d.ts +44 -0
- package/dist/scheduler/runtime-runner.d.ts.map +1 -0
- package/dist/scheduler/runtime-runner.js +155 -0
- package/dist/scheduler/runtime-runner.js.map +1 -0
- package/dist/scheduler/scope.d.ts +6 -0
- package/dist/scheduler/scope.d.ts.map +1 -0
- package/dist/scheduler/scope.js +56 -0
- package/dist/scheduler/scope.js.map +1 -0
- package/dist/scheduler/store-port.d.ts +211 -0
- package/dist/scheduler/store-port.d.ts.map +1 -0
- package/dist/scheduler/store-port.js +28 -0
- package/dist/scheduler/store-port.js.map +1 -0
- package/dist/scheduler/transitions.d.ts +89 -0
- package/dist/scheduler/transitions.d.ts.map +1 -0
- package/dist/scheduler/transitions.js +967 -0
- package/dist/scheduler/transitions.js.map +1 -0
- package/dist/scheduler/types.d.ts +146 -0
- package/dist/scheduler/types.d.ts.map +1 -0
- package/dist/{executors → scheduler}/types.js.map +1 -1
- package/dist/store/store.d.ts +390 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +3053 -0
- package/dist/store/store.js.map +1 -0
- package/dist/visualization/overlay.d.ts +86 -0
- package/dist/visualization/overlay.d.ts.map +1 -0
- package/dist/visualization/overlay.js +161 -0
- package/dist/visualization/overlay.js.map +1 -0
- package/package.json +19 -37
- package/README.md +0 -7
- package/dist/agent-telemetry.d.ts +0 -56
- package/dist/agent-telemetry.d.ts.map +0 -1
- package/dist/agent-telemetry.js +0 -304
- package/dist/agent-telemetry.js.map +0 -1
- package/dist/artifacts.d.ts +0 -45
- package/dist/artifacts.d.ts.map +0 -1
- package/dist/artifacts.js +0 -163
- package/dist/artifacts.js.map +0 -1
- package/dist/attempt-artifacts.d.ts +0 -35
- package/dist/attempt-artifacts.d.ts.map +0 -1
- package/dist/attempt-artifacts.js +0 -90
- package/dist/attempt-artifacts.js.map +0 -1
- package/dist/client.d.ts +0 -82
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -200
- package/dist/client.js.map +0 -1
- package/dist/evaluator.d.ts +0 -36
- package/dist/evaluator.d.ts.map +0 -1
- package/dist/evaluator.js +0 -101
- package/dist/evaluator.js.map +0 -1
- package/dist/executors/agent.d.ts +0 -103
- package/dist/executors/agent.d.ts.map +0 -1
- package/dist/executors/agent.js +0 -516
- package/dist/executors/agent.js.map +0 -1
- package/dist/executors/mock-program.d.ts +0 -26
- package/dist/executors/mock-program.d.ts.map +0 -1
- package/dist/executors/mock-program.js +0 -100
- package/dist/executors/mock-program.js.map +0 -1
- package/dist/executors/output-preview.d.ts +0 -2
- package/dist/executors/output-preview.d.ts.map +0 -1
- package/dist/executors/output-preview.js +0 -20
- package/dist/executors/output-preview.js.map +0 -1
- package/dist/executors/program.d.ts +0 -30
- package/dist/executors/program.d.ts.map +0 -1
- package/dist/executors/program.js +0 -230
- package/dist/executors/program.js.map +0 -1
- package/dist/executors/types.d.ts +0 -32
- package/dist/executors/types.d.ts.map +0 -1
- package/dist/fork.d.ts +0 -74
- package/dist/fork.d.ts.map +0 -1
- package/dist/fork.js +0 -278
- package/dist/fork.js.map +0 -1
- package/dist/hooks/payload.d.ts +0 -17
- package/dist/hooks/payload.d.ts.map +0 -1
- package/dist/hooks/payload.js +0 -45
- package/dist/hooks/payload.js.map +0 -1
- package/dist/interpreter.d.ts +0 -168
- package/dist/interpreter.d.ts.map +0 -1
- package/dist/interpreter.js +0 -1747
- package/dist/interpreter.js.map +0 -1
- package/dist/keys.d.ts +0 -77
- package/dist/keys.d.ts.map +0 -1
- package/dist/keys.js +0 -382
- package/dist/keys.js.map +0 -1
- package/dist/run-control.d.ts +0 -45
- package/dist/run-control.d.ts.map +0 -1
- package/dist/run-control.js +0 -255
- package/dist/run-control.js.map +0 -1
- package/dist/run-id.d.ts +0 -3
- package/dist/run-id.d.ts.map +0 -1
- package/dist/run-id.js +0 -10
- package/dist/run-id.js.map +0 -1
- package/dist/state-machine.d.ts +0 -31
- package/dist/state-machine.d.ts.map +0 -1
- package/dist/state-machine.js +0 -102
- package/dist/state-machine.js.map +0 -1
- package/dist/store.d.ts +0 -92
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -420
- package/dist/store.js.map +0 -1
- package/dist/supervisor-app.d.ts +0 -27
- package/dist/supervisor-app.d.ts.map +0 -1
- package/dist/supervisor-app.js +0 -694
- package/dist/supervisor-app.js.map +0 -1
- package/dist/supervisor-discovery.d.ts +0 -18
- package/dist/supervisor-discovery.d.ts.map +0 -1
- package/dist/supervisor-discovery.js +0 -180
- package/dist/supervisor-discovery.js.map +0 -1
- package/dist/supervisor-entry.d.ts +0 -11
- package/dist/supervisor-entry.d.ts.map +0 -1
- package/dist/supervisor-entry.js +0 -50
- package/dist/supervisor-entry.js.map +0 -1
- package/dist/supervisor-lock.d.ts +0 -26
- package/dist/supervisor-lock.d.ts.map +0 -1
- package/dist/supervisor-lock.js +0 -49
- package/dist/supervisor-lock.js.map +0 -1
- package/dist/supervisor-runner.d.ts +0 -11
- package/dist/supervisor-runner.d.ts.map +0 -1
- package/dist/supervisor-runner.js +0 -128
- package/dist/supervisor-runner.js.map +0 -1
- package/dist/types.d.ts +0 -375
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
- package/dist/validate-input.d.ts +0 -27
- package/dist/validate-input.d.ts.map +0 -1
- package/dist/validate-input.js +0 -56
- package/dist/validate-input.js.map +0 -1
- package/dist/validate-signal.d.ts +0 -14
- package/dist/validate-signal.d.ts.map +0 -1
- package/dist/validate-signal.js +0 -31
- package/dist/validate-signal.js.map +0 -1
- package/dist/workflow-context.d.ts +0 -4
- package/dist/workflow-context.d.ts.map +0 -1
- package/dist/workflow-context.js +0 -11
- package/dist/workflow-context.js.map +0 -1
- package/dist/workflow-outputs.d.ts +0 -9
- package/dist/workflow-outputs.d.ts.map +0 -1
- package/dist/workflow-outputs.js +0 -60
- package/dist/workflow-outputs.js.map +0 -1
- /package/dist/{executors → scheduler}/types.js +0 -0
package/dist/types.d.ts
DELETED
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import type { AgentOverrideWarning, AgentOverrides, IrNodeKind } from "@acpus/core";
|
|
2
|
-
/** The 7 states in the unified node state machine. */
|
|
3
|
-
export type NodeState = "pending" | "running" | "awaiting" | "completed" | "failed" | "paused" | "cancelled";
|
|
4
|
-
/** Run-level status (mirrors terminal node states + "running"). */
|
|
5
|
-
export type RunStatus = "running" | "completed" | "failed" | "paused" | "cancelled";
|
|
6
|
-
/** Terminal Run statuses — a Run in any of these states will not transition further. */
|
|
7
|
-
export declare const RUN_TERMINAL_STATUSES: ReadonlySet<RunStatus>;
|
|
8
|
-
/** Returns true when the Run status is terminal (completed, failed, or cancelled). */
|
|
9
|
-
export declare function isRunTerminal(status: RunStatus): boolean;
|
|
10
|
-
/** Dynamic dimensions that make a node key unique at runtime. */
|
|
11
|
-
export interface NodeKeyDynamic {
|
|
12
|
-
loopRound?: number;
|
|
13
|
-
fanoutItemId?: string;
|
|
14
|
-
laneId?: string;
|
|
15
|
-
parallelBranchId?: string;
|
|
16
|
-
frames?: NodeKeyDynamicFrame[];
|
|
17
|
-
}
|
|
18
|
-
export interface NodeKeyDynamicFrame {
|
|
19
|
-
loopRound?: number;
|
|
20
|
-
fanoutItemId?: string;
|
|
21
|
-
laneId?: string;
|
|
22
|
-
parallelBranchId?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface NodeExecutionState {
|
|
25
|
-
/** Resolved key string (e.g. "workflow/mapped/item:file-a/lane:0") */
|
|
26
|
-
nodeKey: string;
|
|
27
|
-
/** Original IR node id (not globally unique for generated internal pipelines). */
|
|
28
|
-
nodeId: string;
|
|
29
|
-
/** Node kind from IR */
|
|
30
|
-
kind: IrNodeKind;
|
|
31
|
-
/** Node Definition Hash (canonical hash of the IR Node + subtree). */
|
|
32
|
-
definitionHash?: string;
|
|
33
|
-
/** Current state in the state machine */
|
|
34
|
-
state: NodeState;
|
|
35
|
-
/** How many times this node has been attempted */
|
|
36
|
-
attempt: number;
|
|
37
|
-
/** ISO timestamp when node entered running state */
|
|
38
|
-
startedAt?: string;
|
|
39
|
-
/** ISO timestamp when node entered a terminal state */
|
|
40
|
-
completedAt?: string;
|
|
41
|
-
/** Error message if state is "failed" */
|
|
42
|
-
error?: string;
|
|
43
|
-
/** Evaluated runtime input boundary for nodes that enter a child workflow. */
|
|
44
|
-
input?: Record<string, unknown>;
|
|
45
|
-
/** Node output (validated against schema for agents) */
|
|
46
|
-
output?: unknown;
|
|
47
|
-
/** References to artifacts stored for this node */
|
|
48
|
-
artifactRefs?: string[];
|
|
49
|
-
/** Runtime-rendered prompt (Agent or Signal Node), retained for display when compact telemetry is unavailable. */
|
|
50
|
-
renderedPrompt?: string;
|
|
51
|
-
/** Runtime-rendered explicit Agent session_key, when declared by the Workflow Spec. */
|
|
52
|
-
renderedSessionKey?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Snapshot of the parent dynamic value-context this node executed under
|
|
55
|
-
* (fanout item / loop round). Persisted so retry/continuation can rebuild the
|
|
56
|
-
* expression context for command/prompt re-rendering. Only value context is
|
|
57
|
-
* stored — never large artifact payloads.
|
|
58
|
-
*/
|
|
59
|
-
dynamicContext?: NodeDynamicContext;
|
|
60
|
-
/** Compact live Agent telemetry for context, tool use, and bounded IO previews. */
|
|
61
|
-
agentTelemetry?: AgentTelemetry;
|
|
62
|
-
}
|
|
63
|
-
/** Persisted parent value-context for a leaf node (fanout item / loop round). */
|
|
64
|
-
export interface NodeDynamicContext {
|
|
65
|
-
item?: unknown;
|
|
66
|
-
item_id?: string;
|
|
67
|
-
item_index?: number;
|
|
68
|
-
loop?: {
|
|
69
|
-
iter: number;
|
|
70
|
-
last?: unknown;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* An ordered, persisted record of one Node's terminal outcome within a Run.
|
|
75
|
-
*
|
|
76
|
-
* Run Checkpoints are the inheritance source consulted when a Forked Run
|
|
77
|
-
* decides which Nodes to reuse: the Forked Run scans checkpoints in `sequence`
|
|
78
|
-
* order, requires `state === "completed"`, and matches `definitionHash` against
|
|
79
|
-
* the new Workflow Spec's compiled IR Node.
|
|
80
|
-
*/
|
|
81
|
-
export interface RunCheckpoint {
|
|
82
|
-
/** Monotonically-increasing append order within this Run. */
|
|
83
|
-
sequence: number;
|
|
84
|
-
nodeKey: string;
|
|
85
|
-
state: NodeState;
|
|
86
|
-
/** Node Definition Hash from the IR at the time the Node ran. */
|
|
87
|
-
definitionHash: string;
|
|
88
|
-
/** ISO timestamp the Node entered terminal state. */
|
|
89
|
-
completedAt?: string;
|
|
90
|
-
}
|
|
91
|
-
export interface RunLineage {
|
|
92
|
-
/** Run ID of the immediate prior Run this Forked Run derived from. */
|
|
93
|
-
sourceRunId: string;
|
|
94
|
-
/** Node Key chosen as Fork Origin (default boundary or operator override). */
|
|
95
|
-
forkOriginNodeKey: string;
|
|
96
|
-
/** Number of Nodes inherited from the prior Run. */
|
|
97
|
-
inheritedNodeCount: number;
|
|
98
|
-
}
|
|
99
|
-
export interface RunState {
|
|
100
|
-
runId: string;
|
|
101
|
-
workflowName: string;
|
|
102
|
-
/** Catalog ref used to start this Run, when started from the Workflow Catalog. */
|
|
103
|
-
workflowRef?: string;
|
|
104
|
-
/** Absolute Workflow Spec path used to compile this Run. */
|
|
105
|
-
workflowSourcePath?: string;
|
|
106
|
-
status: RunStatus;
|
|
107
|
-
/** SHA-256 digest of the frozen IR JSON */
|
|
108
|
-
irDigest: string;
|
|
109
|
-
/** SHA-256 digest of the input JSON */
|
|
110
|
-
inputDigest: string;
|
|
111
|
-
createdAt: string;
|
|
112
|
-
updatedAt: string;
|
|
113
|
-
/** Run generation: starts at 1 and increments on each Run-level retry. */
|
|
114
|
-
runAttempt: number;
|
|
115
|
-
/** Evaluated top-level Workflow outputs, persisted when the Run completes. */
|
|
116
|
-
output?: Record<string, unknown>;
|
|
117
|
-
/** Run-level error message, set when the Run fails outside a single leaf output. */
|
|
118
|
-
error?: string;
|
|
119
|
-
/** Lineage to the prior Run this Run was forked from (set on Forked Runs). */
|
|
120
|
-
lineage?: RunLineage;
|
|
121
|
-
/** Effective submit-time Agent Overrides applied before this Run's IR was frozen. */
|
|
122
|
-
agentOverrides?: AgentOverrides;
|
|
123
|
-
/** Non-fatal warnings produced while resolving submit-time metadata. */
|
|
124
|
-
submissionWarnings?: AgentOverrideWarning[];
|
|
125
|
-
/** Hash of the frozen merged hook configuration; absent when no hooks apply. */
|
|
126
|
-
hookConfigHash?: string;
|
|
127
|
-
/** True when this Run was submitted with hooks intentionally disabled. */
|
|
128
|
-
skipHooks?: boolean;
|
|
129
|
-
/** Node states included when inspecting a specific run (GET /runs/:runId) */
|
|
130
|
-
nodes?: NodeExecutionState[];
|
|
131
|
-
}
|
|
132
|
-
export interface ExpressionContext {
|
|
133
|
-
input: Record<string, unknown>;
|
|
134
|
-
/** Step outputs keyed by step id */
|
|
135
|
-
steps: Record<string, unknown>;
|
|
136
|
-
/** Frozen Workflow Spec metadata exposed to CEL/template expressions. */
|
|
137
|
-
workflow: WorkflowExpressionContext;
|
|
138
|
-
loop?: {
|
|
139
|
-
iter: number;
|
|
140
|
-
last?: unknown;
|
|
141
|
-
};
|
|
142
|
-
item?: unknown;
|
|
143
|
-
item_id?: string;
|
|
144
|
-
item_index?: number;
|
|
145
|
-
run_id: string;
|
|
146
|
-
}
|
|
147
|
-
export interface WorkflowExpressionContext {
|
|
148
|
-
name: string;
|
|
149
|
-
description: string;
|
|
150
|
-
source_path: string;
|
|
151
|
-
source_dir: string;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Classification of an executor failure. Used by the interpreter to decide
|
|
155
|
-
* whether a node is non-recoverable (→ failed) and whether an agent response
|
|
156
|
-
* failure is retryable (parse/schema).
|
|
157
|
-
*/
|
|
158
|
-
export type FailureKind = "parse" | "schema" | "spawn" | "timeout" | "killed" | "capture" | "exit" | "config" | "hook_failure";
|
|
159
|
-
export interface ExecutorResult {
|
|
160
|
-
output?: unknown;
|
|
161
|
-
exitCode?: number;
|
|
162
|
-
artifactRefs?: string[];
|
|
163
|
-
error?: string;
|
|
164
|
-
/** Fully rendered prompt/request text prepared for this executor call. */
|
|
165
|
-
prompt?: string;
|
|
166
|
-
/** Human-readable response text reconstructed from the executor protocol/output. */
|
|
167
|
-
responseText?: string;
|
|
168
|
-
/** Raw process stdout, captured as an artifact by the interpreter. */
|
|
169
|
-
stdout?: string;
|
|
170
|
-
/** Raw process stderr, captured as an artifact by the interpreter. */
|
|
171
|
-
stderr?: string;
|
|
172
|
-
/** Rendered Program command, surfaced for hook onNodeComplete/Error events. */
|
|
173
|
-
command?: string;
|
|
174
|
-
/** Whether the Program command ran with shell semantics. */
|
|
175
|
-
shell?: boolean;
|
|
176
|
-
/** Effective Program subprocess environment, surfaced for hook events. */
|
|
177
|
-
subprocessEnv?: Record<string, string>;
|
|
178
|
-
/** Failure classification when execution did not succeed. */
|
|
179
|
-
failureKind?: FailureKind;
|
|
180
|
-
/** True if the executor was aborted mid-execution */
|
|
181
|
-
partial?: boolean;
|
|
182
|
-
/** Raw acpx session record ID. Use to locate the original transcript at
|
|
183
|
-
* ~/.acpx/sessions/<acpxRecordId>.json. Absent when acpx is not used. */
|
|
184
|
-
acpxRecordId?: string;
|
|
185
|
-
/** Absolute working directory passed to acpx via --cwd. Always present;
|
|
186
|
-
* defaults to process.cwd() when no agent cwd is configured. */
|
|
187
|
-
cwd?: string;
|
|
188
|
-
}
|
|
189
|
-
export interface AgentContextUsage {
|
|
190
|
-
used: number;
|
|
191
|
-
size: number;
|
|
192
|
-
updatedAt: string;
|
|
193
|
-
}
|
|
194
|
-
export interface AgentTokenUsage {
|
|
195
|
-
source: "prompt_response";
|
|
196
|
-
inputTokens?: number;
|
|
197
|
-
outputTokens?: number;
|
|
198
|
-
cachedReadTokens?: number;
|
|
199
|
-
cachedWriteTokens?: number;
|
|
200
|
-
thoughtTokens?: number;
|
|
201
|
-
totalTokens?: number;
|
|
202
|
-
}
|
|
203
|
-
export type AgentAttemptTelemetryState = "running" | "completed" | "failed" | "paused" | "cancelled";
|
|
204
|
-
export interface AgentIoPreview {
|
|
205
|
-
preview: string;
|
|
206
|
-
truncated: boolean;
|
|
207
|
-
originalBytes: number;
|
|
208
|
-
headBytes: number;
|
|
209
|
-
tailBytes?: number;
|
|
210
|
-
artifactRef?: string;
|
|
211
|
-
}
|
|
212
|
-
export interface AgentToolCallTelemetry {
|
|
213
|
-
toolCallId: string;
|
|
214
|
-
title?: string;
|
|
215
|
-
status?: string;
|
|
216
|
-
kind?: string;
|
|
217
|
-
toolName?: string;
|
|
218
|
-
startedAt: string;
|
|
219
|
-
updatedAt: string;
|
|
220
|
-
completedAt?: string;
|
|
221
|
-
}
|
|
222
|
-
export interface AgentToolsTelemetry {
|
|
223
|
-
totalToolCallCount: number;
|
|
224
|
-
droppedToolCallCount: number;
|
|
225
|
-
recentCalls: AgentToolCallTelemetry[];
|
|
226
|
-
}
|
|
227
|
-
export interface AgentAttemptTelemetry {
|
|
228
|
-
attempt: number;
|
|
229
|
-
state: AgentAttemptTelemetryState;
|
|
230
|
-
startedAt: string;
|
|
231
|
-
updatedAt: string;
|
|
232
|
-
completedAt?: string;
|
|
233
|
-
context?: AgentContextUsage;
|
|
234
|
-
tokenUsage?: AgentTokenUsage;
|
|
235
|
-
input?: AgentIoPreview;
|
|
236
|
-
output?: AgentIoPreview;
|
|
237
|
-
tools: AgentToolsTelemetry;
|
|
238
|
-
/** Raw acpx session record ID. Use to locate the original transcript at
|
|
239
|
-
* ~/.acpx/sessions/<acpxRecordId>.json. Absent on historical data or when
|
|
240
|
-
* acpx is not used. */
|
|
241
|
-
acpxRecordId?: string;
|
|
242
|
-
/** Absolute working directory passed to acpx via --cwd. Absent on historical
|
|
243
|
-
* data; always present in new artifacts. */
|
|
244
|
-
cwd?: string;
|
|
245
|
-
}
|
|
246
|
-
export interface AgentTelemetry {
|
|
247
|
-
currentAttempt: number;
|
|
248
|
-
attempts: AgentAttemptTelemetry[];
|
|
249
|
-
}
|
|
250
|
-
export interface ArtifactRef {
|
|
251
|
-
/** Full URI: artifact://runs/<runId>/nodes/<nodeKey>/<filename> */
|
|
252
|
-
uri: string;
|
|
253
|
-
runId: string;
|
|
254
|
-
nodeKey: string;
|
|
255
|
-
filename: string;
|
|
256
|
-
}
|
|
257
|
-
export interface InterpreterOptions {
|
|
258
|
-
/** Maximum concurrent node executions across the interpreter */
|
|
259
|
-
maxConcurrency?: number;
|
|
260
|
-
/** Deterministic timestamp for now() in expressions (ISO string) */
|
|
261
|
-
nowTimestamp?: string;
|
|
262
|
-
/** Injectable sleep used for retry backoff (default: real setTimeout). */
|
|
263
|
-
sleep?: (ms: number) => Promise<void>;
|
|
264
|
-
/** Frozen hook runner for this Run; absent disables all hook machinery. */
|
|
265
|
-
hookRunner?: import("./hooks/runner.js").HookRunner;
|
|
266
|
-
}
|
|
267
|
-
export interface RunOptions {
|
|
268
|
-
/** Resolved input values */
|
|
269
|
-
input: Record<string, unknown>;
|
|
270
|
-
/** Unique run identifier (generated if not provided) */
|
|
271
|
-
runId?: string;
|
|
272
|
-
/** Catalog ref used to start this Run, when applicable. */
|
|
273
|
-
workflowRef?: string;
|
|
274
|
-
/** Absolute Workflow Spec path used to compile this Run. */
|
|
275
|
-
workflowSourcePath?: string;
|
|
276
|
-
/** Effective submit-time Agent Overrides applied before this Run's IR was frozen. */
|
|
277
|
-
agentOverrides?: AgentOverrides;
|
|
278
|
-
/** Non-fatal warnings produced while resolving submit-time metadata. */
|
|
279
|
-
submissionWarnings?: AgentOverrideWarning[];
|
|
280
|
-
/** True when hook loading/freezing/execution is disabled for this new Run. */
|
|
281
|
-
skipHooks?: boolean;
|
|
282
|
-
}
|
|
283
|
-
export interface SupervisorConfig {
|
|
284
|
-
/** Port to listen on (0 = random) */
|
|
285
|
-
port?: number;
|
|
286
|
-
/** Host to bind (default "127.0.0.1") */
|
|
287
|
-
host?: string;
|
|
288
|
-
/** Base directory for .acpus/ state (default cwd) */
|
|
289
|
-
stateDir?: string;
|
|
290
|
-
/** Workspace root for Run execution and source-path validation. */
|
|
291
|
-
workspace?: string;
|
|
292
|
-
/** Idle shutdown timeout in milliseconds (default 5 min) */
|
|
293
|
-
idleTimeoutMs?: number;
|
|
294
|
-
}
|
|
295
|
-
export interface SupervisorMetadata {
|
|
296
|
-
schemaVersion: number;
|
|
297
|
-
workspace: string;
|
|
298
|
-
pid: number;
|
|
299
|
-
endpoint: string;
|
|
300
|
-
startedAt: string;
|
|
301
|
-
version: string;
|
|
302
|
-
}
|
|
303
|
-
export interface SupervisorHealth extends SupervisorMetadata {
|
|
304
|
-
ok: true;
|
|
305
|
-
runningCount: number;
|
|
306
|
-
activeClients: number;
|
|
307
|
-
}
|
|
308
|
-
export interface StartRunRequest {
|
|
309
|
-
/** YAML source of the workflow spec */
|
|
310
|
-
spec: string;
|
|
311
|
-
/** Resolved input values */
|
|
312
|
-
input?: Record<string, unknown>;
|
|
313
|
-
/** Absolute path to the spec file (for $include/subworkflow resolution) */
|
|
314
|
-
sourcePath?: string;
|
|
315
|
-
/** Catalog ref used to start this Run, when applicable. */
|
|
316
|
-
workflowRef?: string;
|
|
317
|
-
}
|
|
318
|
-
export interface RunSummary {
|
|
319
|
-
runId: string;
|
|
320
|
-
workflowName: string;
|
|
321
|
-
workflowRef?: string;
|
|
322
|
-
workflowSourcePath?: string;
|
|
323
|
-
status: RunStatus;
|
|
324
|
-
createdAt: string;
|
|
325
|
-
updatedAt: string;
|
|
326
|
-
lineage?: RunLineage;
|
|
327
|
-
}
|
|
328
|
-
export interface RunCleanItem {
|
|
329
|
-
runId: string;
|
|
330
|
-
status?: RunStatus;
|
|
331
|
-
bytes: number;
|
|
332
|
-
reason?: string;
|
|
333
|
-
}
|
|
334
|
-
export interface RunCleanResult {
|
|
335
|
-
dryRun: boolean;
|
|
336
|
-
deletedCount: number;
|
|
337
|
-
skippedCount: number;
|
|
338
|
-
bytesReclaimed: number;
|
|
339
|
-
deleted: RunCleanItem[];
|
|
340
|
-
skipped: RunCleanItem[];
|
|
341
|
-
}
|
|
342
|
-
export interface InputValidationError {
|
|
343
|
-
/** JSON pointer path, e.g. "/region" or "/tags/0" */
|
|
344
|
-
path: string;
|
|
345
|
-
/** Ajv keyword that triggered the error, e.g. "required", "type" */
|
|
346
|
-
keyword: string;
|
|
347
|
-
/** Human-readable error message */
|
|
348
|
-
message: string;
|
|
349
|
-
/** Expected type or value (when applicable) */
|
|
350
|
-
expected?: string;
|
|
351
|
-
/** Actual type or value (when applicable) */
|
|
352
|
-
actual?: string;
|
|
353
|
-
}
|
|
354
|
-
/** A single discrepancy found while replaying a persisted Run. */
|
|
355
|
-
export interface ReplayMismatch {
|
|
356
|
-
nodeKey: string;
|
|
357
|
-
/** What kind of discrepancy: a node reached in only one walk, or differing state. */
|
|
358
|
-
kind: "state" | "missing-in-replay" | "unexpected-in-replay";
|
|
359
|
-
/** Persisted (recorded) value. */
|
|
360
|
-
expected?: NodeState;
|
|
361
|
-
/** Value derived by the deterministic replay walk. */
|
|
362
|
-
actual?: NodeState;
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Result of a deterministic replay: re-walking the frozen IR against recorded
|
|
366
|
-
* node outputs and verifying the reconstructed node topology (the set of reached
|
|
367
|
-
* node keys) matches what was persisted. No agents/programs are executed and no
|
|
368
|
-
* disk writes occur.
|
|
369
|
-
*/
|
|
370
|
-
export interface ReplayResult {
|
|
371
|
-
runId: string;
|
|
372
|
-
ok: boolean;
|
|
373
|
-
mismatches: ReplayMismatch[];
|
|
374
|
-
}
|
|
375
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIpF,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE7G,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpF,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,SAAS,CAAiD,CAAC;AAE3G,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAExD;AAID,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACn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EAAE,OAAO,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;IAC7D,kCAAkC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sDAAsD;IACtD,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B"}
|
package/dist/types.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Terminal Run statuses — a Run in any of these states will not transition further. */
|
|
2
|
-
export const RUN_TERMINAL_STATUSES = new Set(["completed", "failed", "cancelled"]);
|
|
3
|
-
/** Returns true when the Run status is terminal (completed, failed, or cancelled). */
|
|
4
|
-
export function isRunTerminal(status) {
|
|
5
|
-
return RUN_TERMINAL_STATUSES.has(status);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAA2B,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAE3G,sFAAsF;AACtF,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/validate-input.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface InputValidationError {
|
|
2
|
-
/** JSON pointer path, e.g. "/region" or "/tags/0" */
|
|
3
|
-
path: string;
|
|
4
|
-
/** Ajv keyword that triggered the error, e.g. "required", "type" */
|
|
5
|
-
keyword: string;
|
|
6
|
-
/** Human-readable error message */
|
|
7
|
-
message: string;
|
|
8
|
-
/** Expected type or value (when applicable) */
|
|
9
|
-
expected?: string;
|
|
10
|
-
/** Actual type or value (when applicable) */
|
|
11
|
-
actual?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class InputValidationFailure extends Error {
|
|
14
|
-
readonly errors: InputValidationError[];
|
|
15
|
-
constructor(errors: InputValidationError[]);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Validate `input` against a compiled JSON Schema (from the IR's `input` field).
|
|
19
|
-
* When the schema declares defaults for missing optional properties, Ajv
|
|
20
|
-
* fills them in by mutating `input` in-place. On validation failure, throws
|
|
21
|
-
* {@link InputValidationFailure} with structured error details.
|
|
22
|
-
*
|
|
23
|
-
* An empty schema (`{}` or no `properties`) is treated as "no validation
|
|
24
|
-
* required" — the input passes through unchanged.
|
|
25
|
-
*/
|
|
26
|
-
export declare function validateInput(schema: Record<string, unknown>, input: Record<string, unknown>): Record<string, unknown>;
|
|
27
|
-
//# sourceMappingURL=validate-input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-input.d.ts","sourceRoot":"","sources":["../src/validate-input.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,sBAAuB,SAAQ,KAAK;aACnB,MAAM,EAAE,oBAAoB,EAAE;IAA1D,YAA4B,MAAM,EAAE,oBAAoB,EAAE,EAIzD;CACF;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqCzB"}
|
package/dist/validate-input.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Ajv } from "ajv";
|
|
2
|
-
/**
|
|
3
|
-
* Module-level Ajv singleton for input validation.
|
|
4
|
-
* `useDefaults: true` auto-fills missing optional properties with their
|
|
5
|
-
* declared `default` values (mutating the input object in-place).
|
|
6
|
-
* `strict: false` matches the compiler's Ajv configuration.
|
|
7
|
-
*/
|
|
8
|
-
const ajv = new Ajv({ allErrors: true, strict: false, useDefaults: true });
|
|
9
|
-
export class InputValidationFailure extends Error {
|
|
10
|
-
errors;
|
|
11
|
-
constructor(errors) {
|
|
12
|
-
const summary = errors.map((e) => `${e.path}: ${e.message}`).join("; ");
|
|
13
|
-
super(`Input validation failed: ${summary}`);
|
|
14
|
-
this.errors = errors;
|
|
15
|
-
this.name = "InputValidationFailure";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Validate `input` against a compiled JSON Schema (from the IR's `input` field).
|
|
20
|
-
* When the schema declares defaults for missing optional properties, Ajv
|
|
21
|
-
* fills them in by mutating `input` in-place. On validation failure, throws
|
|
22
|
-
* {@link InputValidationFailure} with structured error details.
|
|
23
|
-
*
|
|
24
|
-
* An empty schema (`{}` or no `properties`) is treated as "no validation
|
|
25
|
-
* required" — the input passes through unchanged.
|
|
26
|
-
*/
|
|
27
|
-
export function validateInput(schema, input) {
|
|
28
|
-
// No schema or empty schema → nothing to validate.
|
|
29
|
-
if (!schema ||
|
|
30
|
-
Object.keys(schema).length === 0 ||
|
|
31
|
-
(!schema.properties && !schema.required && !schema.$schema)) {
|
|
32
|
-
return input;
|
|
33
|
-
}
|
|
34
|
-
const validate = ajv.compile(schema);
|
|
35
|
-
const valid = validate(input);
|
|
36
|
-
if (valid) {
|
|
37
|
-
return input; // Ajv has already filled defaults in-place.
|
|
38
|
-
}
|
|
39
|
-
const errors = (validate.errors ?? []).map((err) => {
|
|
40
|
-
const mapped = {
|
|
41
|
-
path: err.instancePath || "/",
|
|
42
|
-
keyword: err.keyword,
|
|
43
|
-
message: err.message ?? "validation error",
|
|
44
|
-
};
|
|
45
|
-
if (err.keyword === "type" && err.params) {
|
|
46
|
-
mapped.expected = err.params.type;
|
|
47
|
-
mapped.actual = typeof input[err.instancePath.slice(1).split("/")[0] ?? ""];
|
|
48
|
-
}
|
|
49
|
-
if (err.keyword === "required" && err.params) {
|
|
50
|
-
mapped.expected = err.params.missingProperty;
|
|
51
|
-
}
|
|
52
|
-
return mapped;
|
|
53
|
-
});
|
|
54
|
-
throw new InputValidationFailure(errors);
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=validate-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-input.js","sourceRoot":"","sources":["../src/validate-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AAe3E,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACnB,MAAM;IAAlC,YAA4B,MAA8B;QACxD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxE,KAAK,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;sBAFnB,MAAM;QAGhC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,MAA+B,EAC/B,KAA8B;IAE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OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class SignalPayloadValidationError extends Error {
|
|
2
|
-
constructor(message: string);
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Validate a Signal Node payload against the node's compiled output schema.
|
|
6
|
-
*
|
|
7
|
-
* The compiler sets `metadata.output` to a compiled JSON Schema only when the
|
|
8
|
-
* Signal Node declared an `output`; otherwise it is `undefined`. A missing
|
|
9
|
-
* schema means "accept any object payload" (mirroring Agent and Program steps).
|
|
10
|
-
* On a schema mismatch, throws {@link SignalPayloadValidationError} carrying the
|
|
11
|
-
* Ajv error text so the supervisor can surface it as a 422.
|
|
12
|
-
*/
|
|
13
|
-
export declare function validateSignalPayload(schema: Record<string, unknown> | undefined, payload: unknown): void;
|
|
14
|
-
//# sourceMappingURL=validate-signal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-signal.d.ts","sourceRoot":"","sources":["../src/validate-signal.ts"],"names":[],"mappings":"AAQA,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAQzG"}
|
package/dist/validate-signal.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Ajv } from "ajv";
|
|
2
|
-
/**
|
|
3
|
-
* Module-level Ajv singleton for Signal Node payload validation.
|
|
4
|
-
* `strict: false` matches the compiler's Ajv configuration.
|
|
5
|
-
*/
|
|
6
|
-
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
7
|
-
export class SignalPayloadValidationError extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = "SignalPayloadValidationError";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Validate a Signal Node payload against the node's compiled output schema.
|
|
15
|
-
*
|
|
16
|
-
* The compiler sets `metadata.output` to a compiled JSON Schema only when the
|
|
17
|
-
* Signal Node declared an `output`; otherwise it is `undefined`. A missing
|
|
18
|
-
* schema means "accept any object payload" (mirroring Agent and Program steps).
|
|
19
|
-
* On a schema mismatch, throws {@link SignalPayloadValidationError} carrying the
|
|
20
|
-
* Ajv error text so the supervisor can surface it as a 422.
|
|
21
|
-
*/
|
|
22
|
-
export function validateSignalPayload(schema, payload) {
|
|
23
|
-
if (!schema) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const validate = ajv.compile(schema);
|
|
27
|
-
if (!validate(payload)) {
|
|
28
|
-
throw new SignalPayloadValidationError(`Signal payload validation failed: ${ajv.errorsText(validate.errors)}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=validate-signal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-signal.js","sourceRoot":"","sources":["../src/validate-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;GAGG;AACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAExD,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC7C,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA2C,EAAE,OAAgB;IACjG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,4BAA4B,CAAC,qCAAqC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-context.d.ts","sourceRoot":"","sources":["../src/workflow-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,OAAO,GAAG,yBAAyB,CAQrF"}
|
package/dist/workflow-context.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { dirname } from "node:path";
|
|
2
|
-
export function buildWorkflowExpressionContext(ir) {
|
|
3
|
-
const sourcePath = ir.source.path ?? "";
|
|
4
|
-
return {
|
|
5
|
-
name: ir.name,
|
|
6
|
-
description: ir.description ?? "",
|
|
7
|
-
source_path: sourcePath,
|
|
8
|
-
source_dir: sourcePath ? dirname(sourcePath) : ""
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=workflow-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-context.js","sourceRoot":"","sources":["../src/workflow-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,UAAU,8BAA8B,CAAC,EAAW;IACxD,MAAM,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;IACxC,OAAO;QACL,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,WAAW,EAAE,EAAE,CAAC,WAAW,IAAI,EAAE;QACjC,WAAW,EAAE,UAAU;QACvB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;KAClD,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AcpusIr } from "@acpus/core";
|
|
2
|
-
import { ExpressionEvaluator } from "./evaluator.js";
|
|
3
|
-
import type { ExpressionContext, NodeExecutionState } from "./types.js";
|
|
4
|
-
export declare function buildCompletedStepContext(ir: AcpusIr, input: Record<string, unknown>, runId: string, nodes: NodeExecutionState[]): ExpressionContext;
|
|
5
|
-
export declare function evaluateWorkflowOutputs(ir: AcpusIr, ctx: ExpressionContext, evaluator: ExpressionEvaluator): Record<string, unknown>;
|
|
6
|
-
export declare function evaluateOutputObject(values: Record<string, unknown>, ctx: ExpressionContext, evaluator: ExpressionEvaluator, path?: string[]): Record<string, unknown>;
|
|
7
|
-
export declare function evaluateTemplatedValue(value: unknown, ctx: ExpressionContext, evaluator: ExpressionEvaluator, path?: string[]): unknown;
|
|
8
|
-
export declare function normalizeOutputValue(value: unknown): unknown;
|
|
9
|
-
//# sourceMappingURL=workflow-outputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-outputs.d.ts","sourceRoot":"","sources":["../src/workflow-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGxE,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,kBAAkB,EAAE,GAC1B,iBAAiB,CAQnB;AAED,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,mBAAmB,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzB;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,mBAAmB,EAC9B,IAAI,GAAE,MAAM,EAAO,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE,mBAAmB,EAC9B,IAAI,GAAE,MAAM,EAAO,GAClB,OAAO,CAaT;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAO5D"}
|
package/dist/workflow-outputs.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { buildWorkflowExpressionContext } from "./workflow-context.js";
|
|
2
|
-
export function buildCompletedStepContext(ir, input, runId, nodes) {
|
|
3
|
-
const ctx = { input, steps: {}, workflow: buildWorkflowExpressionContext(ir), run_id: runId };
|
|
4
|
-
const root = nodes.find((node) => node.nodeKey === "workflow" && node.state === "completed");
|
|
5
|
-
const rootOutput = root?.output;
|
|
6
|
-
if (isRecord(rootOutput) && isRecord(rootOutput.output)) {
|
|
7
|
-
ctx.steps = rootOutput.output;
|
|
8
|
-
}
|
|
9
|
-
return ctx;
|
|
10
|
-
}
|
|
11
|
-
export function evaluateWorkflowOutputs(ir, ctx, evaluator) {
|
|
12
|
-
return evaluateOutputObject(ir.outputs, ctx, evaluator);
|
|
13
|
-
}
|
|
14
|
-
export function evaluateOutputObject(values, ctx, evaluator, path = []) {
|
|
15
|
-
const output = {};
|
|
16
|
-
for (const [key, value] of Object.entries(values)) {
|
|
17
|
-
const nextPath = [...path, key];
|
|
18
|
-
try {
|
|
19
|
-
output[key] = normalizeOutputValue(evaluateTemplatedValue(value, ctx, evaluator, nextPath));
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
if (error instanceof Error && error.message.startsWith("Workflow output '"))
|
|
23
|
-
throw error;
|
|
24
|
-
throw new Error(`Workflow output '${nextPath.join(".")}' failed to evaluate: ${errorMessage(error)}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return output;
|
|
28
|
-
}
|
|
29
|
-
export function evaluateTemplatedValue(value, ctx, evaluator, path = []) {
|
|
30
|
-
if (typeof value === "string") {
|
|
31
|
-
const single = value.match(/^\s*\$\{\{(.+)\}\}\s*$/s);
|
|
32
|
-
if (single)
|
|
33
|
-
return evaluator.evaluateExpression(single[1].trim(), ctx);
|
|
34
|
-
return evaluator.evaluateTemplate(value, ctx);
|
|
35
|
-
}
|
|
36
|
-
if (Array.isArray(value)) {
|
|
37
|
-
return value.map((item, index) => evaluateTemplatedValue(item, ctx, evaluator, [...path, String(index)]));
|
|
38
|
-
}
|
|
39
|
-
if (isRecord(value)) {
|
|
40
|
-
return evaluateOutputObject(value, ctx, evaluator, path);
|
|
41
|
-
}
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
export function normalizeOutputValue(value) {
|
|
45
|
-
if (typeof value === "bigint")
|
|
46
|
-
return Number(value);
|
|
47
|
-
if (Array.isArray(value))
|
|
48
|
-
return value.map((item) => normalizeOutputValue(item));
|
|
49
|
-
if (isRecord(value)) {
|
|
50
|
-
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, normalizeOutputValue(child)]));
|
|
51
|
-
}
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
function isRecord(value) {
|
|
55
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
56
|
-
}
|
|
57
|
-
function errorMessage(error) {
|
|
58
|
-
return error instanceof Error ? error.message : String(error);
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=workflow-outputs.js.map
|