@acpus/runtime 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-telemetry.d.ts +49 -0
- package/dist/agent-telemetry.d.ts.map +1 -0
- package/dist/agent-telemetry.js +255 -0
- package/dist/agent-telemetry.js.map +1 -0
- package/dist/artifacts.d.ts +16 -1
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +92 -29
- package/dist/artifacts.js.map +1 -1
- package/dist/attempt-artifacts.d.ts +35 -0
- package/dist/attempt-artifacts.d.ts.map +1 -0
- package/dist/attempt-artifacts.js +90 -0
- package/dist/attempt-artifacts.js.map +1 -0
- package/dist/client.d.ts +32 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -2
- package/dist/client.js.map +1 -1
- package/dist/executors/agent.d.ts +7 -3
- package/dist/executors/agent.d.ts.map +1 -1
- package/dist/executors/agent.js +58 -61
- package/dist/executors/agent.js.map +1 -1
- package/dist/executors/mock-program.d.ts +2 -0
- package/dist/executors/mock-program.d.ts.map +1 -1
- package/dist/executors/mock-program.js +27 -6
- package/dist/executors/mock-program.js.map +1 -1
- package/dist/executors/output-preview.d.ts +2 -0
- package/dist/executors/output-preview.d.ts.map +1 -0
- package/dist/executors/output-preview.js +20 -0
- package/dist/executors/output-preview.js.map +1 -0
- package/dist/executors/program.d.ts +10 -3
- package/dist/executors/program.d.ts.map +1 -1
- package/dist/executors/program.js +39 -4
- package/dist/executors/program.js.map +1 -1
- package/dist/executors/types.d.ts +2 -0
- package/dist/executors/types.d.ts.map +1 -1
- package/dist/fork.d.ts +80 -0
- package/dist/fork.d.ts.map +1 -0
- package/dist/fork.js +203 -0
- package/dist/fork.js.map +1 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +7 -49
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +232 -461
- package/dist/interpreter.js.map +1 -1
- package/dist/keys.d.ts +50 -2
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +261 -1
- package/dist/keys.js.map +1 -1
- package/dist/run-control.d.ts +45 -0
- package/dist/run-control.d.ts.map +1 -0
- package/dist/run-control.js +255 -0
- package/dist/run-control.js.map +1 -0
- package/dist/state-machine.d.ts +5 -1
- package/dist/state-machine.d.ts.map +1 -1
- package/dist/state-machine.js +16 -1
- package/dist/state-machine.js.map +1 -1
- package/dist/store.d.ts +29 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +129 -28
- package/dist/store.js.map +1 -1
- package/dist/supervisor-app.d.ts.map +1 -1
- package/dist/supervisor-app.js +145 -42
- package/dist/supervisor-app.js.map +1 -1
- package/dist/supervisor-discovery.d.ts +1 -0
- package/dist/supervisor-discovery.d.ts.map +1 -1
- package/dist/supervisor-discovery.js +9 -15
- package/dist/supervisor-discovery.js.map +1 -1
- package/dist/types.d.ts +94 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow-outputs.d.ts +9 -0
- package/dist/workflow-outputs.d.ts.map +1 -0
- package/dist/workflow-outputs.js +59 -0
- package/dist/workflow-outputs.js.map +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// ─── Keys ────────────────────────────────────────────────────────
|
|
2
|
-
export { resolveNodeKey, encodeNodeKeyForFs, encodeNodeKeyForDir } from "./keys.js";
|
|
2
|
+
export { resolveNodeKey, parseNodeKey, staticNodePathFromKey, isNodeKeyAtOrBelow, isNodeKeyInDynamicScope, isNodeKeyBelowAnyAnchor, withNodeKeyPrefix, encodeNodeKeyForFs, encodeNodeKeyForDir } from "./keys.js";
|
|
3
3
|
// ─── Evaluator ───────────────────────────────────────────────────
|
|
4
4
|
export { ExpressionEvaluator } from "./evaluator.js";
|
|
5
|
+
export { buildCompletedStepContext, evaluateWorkflowOutputs, evaluateOutputObject, evaluateTemplatedValue } from "./workflow-outputs.js";
|
|
5
6
|
// ─── Store ───────────────────────────────────────────────────────
|
|
6
7
|
export { RunStore } from "./store.js";
|
|
7
8
|
// ─── State Machine ───────────────────────────────────────────────
|
|
8
9
|
export { canTransition, transition, isTerminal, createInitialNodeState, resetFailedForRetry, resetRunningForCrashRecovery, resetAwaitingForCrashRecovery } from "./state-machine.js";
|
|
9
10
|
// ─── Artifacts ───────────────────────────────────────────────────
|
|
10
|
-
export { ArtifactStore } from "./artifacts.js";
|
|
11
|
+
export { ArtifactStore, ArtifactReferences } from "./artifacts.js";
|
|
11
12
|
// ─── Interpreter ─────────────────────────────────────────────────
|
|
12
13
|
export { WorkflowInterpreter } from "./interpreter.js";
|
|
13
14
|
// ─── Input Validation ────────────────────────────────────────────
|
|
@@ -21,5 +22,7 @@ export { createSupervisorApp } from "./supervisor-app.js";
|
|
|
21
22
|
export { startRunSupervisor } from "./supervisor-runner.js";
|
|
22
23
|
export { ensureWorkspaceSupervisor } from "./supervisor-discovery.js";
|
|
23
24
|
// ─── Client ──────────────────────────────────────────────────────
|
|
24
|
-
export { RunSupervisorClient } from "./client.js";
|
|
25
|
+
export { RunSupervisorClient, ForkRejectedError } from "./client.js";
|
|
26
|
+
// ─── Fork ────────────────────────────────────────────────────────
|
|
27
|
+
export { planFork, applyFork, materializeFork, ForkError } from "./fork.js";
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoCA,oEAAoE;AACpE,OAAO,EACL,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,WAAW,CA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or;
|
|
14
14
|
private readonly programExecutor;
|
|
15
15
|
private readonly artifactStore;
|
|
16
|
+
private readonly attemptArtifacts;
|
|
17
|
+
private readonly runControl;
|
|
16
18
|
private readonly maxConcurrency;
|
|
17
19
|
private readonly allowedSourceRoots;
|
|
18
20
|
private readonly sleep;
|
|
19
|
-
/** Active abort controllers keyed by "runId:nodeKey" for pause/cancel support */
|
|
20
|
-
private readonly abortControllers;
|
|
21
|
-
/** Intent of an in-flight abort keyed by "runId:nodeKey" (pause vs cancel). */
|
|
22
|
-
private readonly abortIntents;
|
|
23
21
|
/** Pending human-decision resolvers for Approval Gates awaiting a signal,
|
|
24
22
|
* keyed by "runId:nodeKey". An entry exists only while a node is `awaiting`. */
|
|
25
23
|
private readonly approvalResolvers;
|
|
26
24
|
/** Absolute paths of subworkflow specs currently on the execution stack (cycle guard). */
|
|
27
25
|
private readonly subworkflowStack;
|
|
28
|
-
/** Scheduling guards for Run-level pause/cancel, keyed by runId.
|
|
29
|
-
* Per-runId to prevent leakage across runs sharing the same interpreter. */
|
|
30
|
-
private readonly schedulingPaused;
|
|
31
|
-
private readonly schedulingCancelled;
|
|
32
26
|
constructor(store: RunStore, agentExecutor: ExecutorAdapter, programExecutor: ExecutorAdapter, options?: InterpreterOptions);
|
|
33
27
|
/**
|
|
34
28
|
* Start a new workflow run to completion (init + execute). Convenience for
|
|
@@ -74,18 +68,6 @@ export declare class WorkflowInterpreter {
|
|
|
74
68
|
* actually recorded (racy joins do not run every branch).
|
|
75
69
|
*/
|
|
76
70
|
private replayNode;
|
|
77
|
-
/** Pause one running node as part of a Run-level pause operation. */
|
|
78
|
-
private pauseRunningNode;
|
|
79
|
-
/** Cancel one materialized node as part of Run-level cancel or fail-fast. */
|
|
80
|
-
private cancelMaterializedNode;
|
|
81
|
-
/** Resolve the operator intent for an in-flight abort; defaults to paused. */
|
|
82
|
-
private abortIntent;
|
|
83
|
-
/** True if the node has been persisted as terminal `cancelled` (e.g. by
|
|
84
|
-
* fail-fast). Used to avoid clobbering it when a still-running leaf later
|
|
85
|
-
* resolves/rejects. */
|
|
86
|
-
private readAbortedStateOnDisk;
|
|
87
|
-
private isStaleAttemptOnDisk;
|
|
88
|
-
private syncInFrameAttemptFromDisk;
|
|
89
71
|
/**
|
|
90
72
|
* Retry a failed executable Node. This is a local repair operation for the
|
|
91
73
|
* target executable only; Run-level retry remains the operation that restores
|
|
@@ -118,35 +100,12 @@ export declare class WorkflowInterpreter {
|
|
|
118
100
|
private executePipeline;
|
|
119
101
|
private executeAgent;
|
|
120
102
|
private executeProgram;
|
|
121
|
-
/** Write stdout.log/stderr.log artifacts; returns their URIs. */
|
|
122
|
-
private writeProgramArtifacts;
|
|
123
|
-
/** Write per-attempt agent response/protocol artifacts; returns their URIs. */
|
|
124
|
-
private writeAgentArtifacts;
|
|
125
|
-
/** Pre-create live Agent attempt artifacts and return their refs immediately. */
|
|
126
|
-
private startAgentAttemptArtifacts;
|
|
127
|
-
private appendAgentTranscript;
|
|
128
103
|
private publishRunningAgentAttempt;
|
|
129
|
-
private
|
|
104
|
+
private publishRenderedAgentSessionKey;
|
|
105
|
+
private publishRenderedAgentPrompt;
|
|
106
|
+
private publishAgentTelemetry;
|
|
107
|
+
private syncAgentTelemetryFromDisk;
|
|
130
108
|
private executeParallel;
|
|
131
|
-
/**
|
|
132
|
-
* Cancel still-running/pending/awaiting descendant nodes of a failed
|
|
133
|
-
* composite (parallel or fanout), scoped to the given dynamic context. A
|
|
134
|
-
* descendant must (a) be one of the composite's descendant IR node ids and
|
|
135
|
-
* (b) share every dynamic dimension (item/lane/round) the composite already
|
|
136
|
-
* carries — so concurrent sibling fanout lanes outside this scope are not
|
|
137
|
-
* affected.
|
|
138
|
-
*
|
|
139
|
-
* NOTE: pass the composite's OWN dynamic. For a parallel this scopes to the
|
|
140
|
-
* current lane (item/lane present). For a fanout, the dynamic does NOT yet
|
|
141
|
-
* carry this fanout's lane (lanes are introduced for its children), so the
|
|
142
|
-
* scope spans ALL of the fanout's lanes — exactly the fail-fast intent.
|
|
143
|
-
*/
|
|
144
|
-
private descendantsInScope;
|
|
145
|
-
/**
|
|
146
|
-
* Cancel still-running/pending descendant nodes of a failed composite
|
|
147
|
-
* (parallel `join: all`, or fanout `join: all` fail-fast).
|
|
148
|
-
*/
|
|
149
|
-
private cancelDescendantsInScope;
|
|
150
109
|
private executeFanout;
|
|
151
110
|
/**
|
|
152
111
|
* Resolve fanout lanes per the wait strategy. Lanes never reject on normal
|
|
@@ -154,6 +113,7 @@ export declare class WorkflowInterpreter {
|
|
|
154
113
|
* let propagate. Losing/excess lanes are silently consumed.
|
|
155
114
|
*/
|
|
156
115
|
private waitForFanout;
|
|
116
|
+
private materializePendingNode;
|
|
157
117
|
private executeSwitch;
|
|
158
118
|
private executeLoop;
|
|
159
119
|
private executeGuard;
|
|
@@ -167,8 +127,6 @@ export declare class WorkflowInterpreter {
|
|
|
167
127
|
submitApproval(runId: string, nodeKey: string, approved: boolean): void;
|
|
168
128
|
private executeSubworkflow;
|
|
169
129
|
private assertAllowedSourcePath;
|
|
170
|
-
/** Evaluate a subworkflow input value, preserving native type for single expressions. */
|
|
171
|
-
private evaluateInputValue;
|
|
172
130
|
private buildContext;
|
|
173
131
|
private populateStepOutputs;
|
|
174
132
|
/** Extract the parent dynamic value-context (fanout item / loop round) from a context, if any. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../src/interpreter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA2B,MAAM,aAAa,CAAC;AAIpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../src/interpreter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAA2B,MAAM,aAAa,CAAC;AAIpE,OAAO,KAAK,EAAwE,kBAAkB,EAAkB,UAAU,EAAE,MAAM,YAAY,CAAC;AACvJ,OAAO,EAAE,QAAQ,EA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