@automatalabs/workflows 0.40.6 → 0.42.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/README.md +31 -15
- package/dist/agent-event-source.d.ts +13 -0
- package/dist/agent-event-source.d.ts.map +1 -0
- package/dist/agent-event-source.js +150 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -43
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -117,21 +117,21 @@ Every script **must** begin with `export const meta = { name, description, phase
|
|
|
117
117
|
statement, and must be **deterministic** — `Date.now()`, `Math.random()`, and `new Date()` are
|
|
118
118
|
unavailable inside the realm (they would break journal replay on resume).
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
Completed reader/worktree calls both use ordinary journal replay:
|
|
121
121
|
|
|
122
122
|
```js
|
|
123
123
|
const [audit, experiment] = await parallel([
|
|
124
124
|
() => agent("Audit src/api without changing files.", {
|
|
125
|
-
label: "audit:api",
|
|
125
|
+
label: "audit:api",
|
|
126
126
|
}),
|
|
127
127
|
() => agent("Try the worker fix in isolation; return a unified diff.", {
|
|
128
|
-
label: "try:worker", isolation: "worktree",
|
|
128
|
+
label: "try:worker", isolation: "worktree",
|
|
129
129
|
}),
|
|
130
130
|
]);
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
The worktree and edits are discarded; return the diff as data.
|
|
134
|
-
|
|
133
|
+
The worktree and edits are discarded; return the diff as data. Replay requires matching journal
|
|
134
|
+
identity/input facts, not a filesystem-safety declaration. See the
|
|
135
135
|
[incremental resume API](../../docs/api.md#content-addressed-incremental-resume).
|
|
136
136
|
|
|
137
137
|
### Substitution testing (isolation mode)
|
|
@@ -303,7 +303,7 @@ boolean).
|
|
|
303
303
|
|
|
304
304
|
Resume guarantees journal/script replay integrity and checkpoint-reply targeting only. It never
|
|
305
305
|
assumes or guarantees that the filesystem, external systems, agent output semantics, or any other
|
|
306
|
-
part of the world stayed fresh between runs. If
|
|
306
|
+
part of the world stayed fresh between runs. If a prior correspondence miss runs live, a supplied reply is
|
|
307
307
|
injected only when execution reaches the exact recorded checkpoint call site with the same
|
|
308
308
|
checkpoint identity and inputs; content-only matching is insufficient after that live prefix. A
|
|
309
309
|
reply that is not applied is reported in `resumeReport` and terminal summaries. Authors who want a
|
|
@@ -352,15 +352,15 @@ Run results expose `effectiveLimits`; inspect status exposes the same values as
|
|
|
352
352
|
agent rows carry their resolved `timeoutMs` plus `errorCode`.
|
|
353
353
|
|
|
354
354
|
`exec.resumeFromRunId` asks the manager to admit a terminal source, persist a self-contained seed
|
|
355
|
-
under a new run ID, and match
|
|
355
|
+
under a new run ID, and match completed calls by exact path/hash or unique hash+input fingerprint.
|
|
356
356
|
Every allocated call receives a terminal manifest row even when the run halts around it. A
|
|
357
357
|
non-result occurrence remains live on resume and stays in the identity seed as an ambiguity
|
|
358
|
-
blocker until reached, so completed siblings on either side can replay
|
|
359
|
-
ambiguous, or
|
|
358
|
+
blocker until reached, so completed siblings on either side can replay. Uncertain,
|
|
359
|
+
ambiguous, or mismatched calls run live. Filesystem/current-environment and Node/V8 differences are
|
|
360
360
|
reported as provenance without changing admission or matching. Identity hits preserve
|
|
361
361
|
script-visible logical budget debit while adding zero current provider usage; replayed session
|
|
362
362
|
records are rebound to the current call index/label/phase. `resumePolicy: "positional"` requests
|
|
363
|
-
index/prefix matching but cannot bypass new-format format/metadata/manifest/input
|
|
363
|
+
index/prefix matching but cannot bypass new-format format/metadata/manifest/input checks. The distinct
|
|
364
364
|
same-ID `resume()` and low-level `resumeJournal` paths remain permanently legacy positional and
|
|
365
365
|
emit no `resumeReport`. See the [full contract](../../docs/api.md#content-addressed-incremental-resume).
|
|
366
366
|
Operational limits are resolved from the new execution's `exec` options and manager defaults, not
|
|
@@ -369,9 +369,8 @@ copied from the source run; pass the desired timeout/retry/concurrency values ag
|
|
|
369
369
|
neither replay identity nor the execution-input fingerprint and may change without invalidating
|
|
370
370
|
completed calls or interrupted-turn continuation.
|
|
371
371
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
sources with an input-fingerprint format below 2 use the
|
|
372
|
+
Current-format crash snapshots reconciled to `paused` / `interrupted` use identity correspondence
|
|
373
|
+
even without terminal-environment capture. Sources with an input-fingerprint format below 2 use the
|
|
375
374
|
`inputs-format-legacy` positional bridge. That bridge also accepts ancestor-scoped rows carried by a
|
|
376
375
|
≤0.23 resume hop when the ancestor run still exists in the same persistence directory; nested and deleted-run scopes stay live. Engine
|
|
377
376
|
package versions are persisted and surfaced as diagnostics but never gate replay. Every new-run
|
|
@@ -399,6 +398,7 @@ and compacts previews, and enforces the shared 24,576-byte structured cap. Non-c
|
|
|
399
398
|
execution results carry an immediate redacted final-20 `logTail`; completed results omit it.
|
|
400
399
|
|
|
401
400
|
Manager events are Node `EventEmitter` notifications: `agentStart`, `agentEnd`, `agentHistory`,
|
|
401
|
+
`agentProgress`, `agentTranscript`,
|
|
402
402
|
`journal`, `tokenUsage`, `log`, `phase`, `complete`, `paused`, `resumed`, `stopped`, `error`,
|
|
403
403
|
and `agentEvent`. Their overloads infer exact payloads from `EngineRunEventPayloadMap` and
|
|
404
404
|
`WorkflowAgentEventPayloadMap`; `WorkflowRunEvent` is the exhaustive union when a host wants one
|
|
@@ -406,6 +406,22 @@ dispatcher. Every engine event carries the owning root `runId` and originating e
|
|
|
406
406
|
`journal` emits `{ runId, scope, entry }` for each live journal append, even when file journaling is
|
|
407
407
|
disabled via `journaling: false`.
|
|
408
408
|
|
|
409
|
+
For journaling ACP runs, `agentProgress` provides redacted content while a call is still running
|
|
410
|
+
(immediate first sample, one-second activity sampling, and content-bearing heartbeats), and
|
|
411
|
+
`agentTranscript` provides execution-partitioned assistant/tool upserts before settlement. Both use
|
|
412
|
+
the same durable JSONL cursor as lifecycle events; terminal run JSON and `agentHistory` keep their
|
|
413
|
+
existing finalization semantics. The facade also exports `workflowAgentEventSource(runner)` so an
|
|
414
|
+
eval or telemetry sink can share the one raw ACP subscription without reparsing provider traffic.
|
|
415
|
+
|
|
416
|
+
An MCP client tails the same stream without holding the originating tool request:
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
const uri = `workflow://runs/${runId}/events`;
|
|
420
|
+
await client.subscribeResource({ uri });
|
|
421
|
+
const tail = JSON.parse(resourceText(await client.readResource({ uri })));
|
|
422
|
+
const catchUp = `${uri}?after=${tail.cursor}&limit=1000&streamId=${tail.streamId}`;
|
|
423
|
+
```
|
|
424
|
+
|
|
409
425
|
```ts
|
|
410
426
|
import {
|
|
411
427
|
WorkflowManager,
|
|
@@ -527,7 +543,7 @@ Semantics worth knowing:
|
|
|
527
543
|
is always treated as a verbatim script, never a name.
|
|
528
544
|
- **Versioning is git's job.** Same-ID `resume()` reloads the exact persisted script. A new
|
|
529
545
|
`resumeFromRunId` execution can use an edited script: changed calls run live, while uniquely
|
|
530
|
-
matching
|
|
546
|
+
matching completed calls may move and replay after admission.
|
|
531
547
|
- **`resolve()` validates name shape strictly** (one flat path segment) — inline nested scripts
|
|
532
548
|
fall through to verbatim parsing, and path traversal out of the configured dirs is impossible.
|
|
533
549
|
|
|
@@ -604,7 +620,7 @@ ships no runtime code).
|
|
|
604
620
|
|
|
605
621
|
| global | what it does |
|
|
606
622
|
|--------|--------------|
|
|
607
|
-
| `agent(prompt, options?)` | Run ONE subagent to completion; returns its result (text, or the validated object with `options.schema`). `options.resume
|
|
623
|
+
| `agent(prompt, options?)` | Run ONE subagent to completion; returns its result (text, or the validated object with `options.schema`). The legacy `options.resume` annotation is accepted but replay-neutral. |
|
|
608
624
|
| `parallel(thunks)` | Run an array of **thunks** (`() => Promise`) concurrently; resolves in input order. |
|
|
609
625
|
| `pipeline(items, ...stages)` | Map `items` through sequential async stages, concurrently across items. |
|
|
610
626
|
| `workflow(nameOrScript, args?)` | Run a saved (or inline) workflow nested in this run, sharing its limiter/budget. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkflowAgentActivity } from "@automatalabs/workflow-engine";
|
|
2
|
+
import type { AgentRunner } from "@automatalabs/shared-types";
|
|
3
|
+
import type { WorkflowAgentEventPayload } from "./index.js";
|
|
4
|
+
export interface WorkflowAgentEventSink {
|
|
5
|
+
observe(event: WorkflowAgentEventPayload): void;
|
|
6
|
+
}
|
|
7
|
+
export interface WorkflowAgentEventSource {
|
|
8
|
+
attach(sink: WorkflowAgentEventSink): () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function workflowAgentEventSource(runner: AgentRunner): WorkflowAgentEventSource;
|
|
11
|
+
/** Pure ACP-to-engine adapter. Unknown or unsafe activity stays on the raw event bus only. */
|
|
12
|
+
export declare function projectWorkflowAgentActivity(event: WorkflowAgentEventPayload): WorkflowAgentActivity | undefined;
|
|
13
|
+
//# sourceMappingURL=agent-event-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-event-source.d.ts","sourceRoot":"","sources":["../src/agent-event-source.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;CAClD;AA8CD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,wBAAwB,CAUtF;AAuDD,8FAA8F;AAC9F,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,yBAAyB,GAC/B,qBAAqB,GAAG,SAAS,CA+CnC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { ACP_CROSS_CUTTING_EVENT_NAMES, } from "@automatalabs/acp-agents";
|
|
2
|
+
class RunnerEventSource {
|
|
3
|
+
runner;
|
|
4
|
+
sinks = new Map();
|
|
5
|
+
unsubscribers = [];
|
|
6
|
+
constructor(runner) {
|
|
7
|
+
this.runner = runner;
|
|
8
|
+
}
|
|
9
|
+
attach(sink) {
|
|
10
|
+
const wasEmpty = this.sinks.size === 0;
|
|
11
|
+
this.sinks.set(sink, (this.sinks.get(sink) ?? 0) + 1);
|
|
12
|
+
if (wasEmpty)
|
|
13
|
+
this.subscribe();
|
|
14
|
+
let attached = true;
|
|
15
|
+
return () => {
|
|
16
|
+
if (!attached)
|
|
17
|
+
return;
|
|
18
|
+
attached = false;
|
|
19
|
+
const refs = this.sinks.get(sink) ?? 0;
|
|
20
|
+
if (refs <= 1)
|
|
21
|
+
this.sinks.delete(sink);
|
|
22
|
+
else
|
|
23
|
+
this.sinks.set(sink, refs - 1);
|
|
24
|
+
if (this.sinks.size !== 0)
|
|
25
|
+
return;
|
|
26
|
+
for (const unsubscribe of this.unsubscribers.splice(0))
|
|
27
|
+
unsubscribe();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
subscribe() {
|
|
31
|
+
this.unsubscribers = [
|
|
32
|
+
this.runner.on("session_update", (event) => this.dispatch(toSessionUpdatePayload(event))),
|
|
33
|
+
...ACP_CROSS_CUTTING_EVENT_NAMES.map((name) => this.runner.on(name, (event) => this.dispatch(toAgentEventPayload(name, event)))),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
dispatch(event) {
|
|
37
|
+
for (const sink of [...this.sinks.keys()]) {
|
|
38
|
+
try {
|
|
39
|
+
sink.observe(event);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Raw event observers are isolated from the runner and each other.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const SOURCES = new WeakMap();
|
|
48
|
+
export function workflowAgentEventSource(runner) {
|
|
49
|
+
if (!isAcpEventBusRunner(runner)) {
|
|
50
|
+
return { attach: () => () => { } };
|
|
51
|
+
}
|
|
52
|
+
let source = SOURCES.get(runner);
|
|
53
|
+
if (source === undefined) {
|
|
54
|
+
source = new RunnerEventSource(runner);
|
|
55
|
+
SOURCES.set(runner, source);
|
|
56
|
+
}
|
|
57
|
+
return source;
|
|
58
|
+
}
|
|
59
|
+
function isAcpEventBusRunner(runner) {
|
|
60
|
+
return typeof runner.on === "function";
|
|
61
|
+
}
|
|
62
|
+
function toSessionUpdatePayload(event) {
|
|
63
|
+
const name = event.update.sessionUpdate;
|
|
64
|
+
return toAgentEventPayload(name, {
|
|
65
|
+
...event.update,
|
|
66
|
+
sessionId: event.sessionId,
|
|
67
|
+
backendId: event.backendId,
|
|
68
|
+
label: event.label,
|
|
69
|
+
runId: event.runId,
|
|
70
|
+
callIndex: event.callIndex,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function toAgentEventPayload(name, event) {
|
|
74
|
+
const context = event;
|
|
75
|
+
return {
|
|
76
|
+
name,
|
|
77
|
+
event,
|
|
78
|
+
backendId: context.backendId,
|
|
79
|
+
...(context.sessionId === undefined ? {} : { sessionId: context.sessionId }),
|
|
80
|
+
...(context.label === undefined ? {} : { label: context.label }),
|
|
81
|
+
...(context.runId === undefined ? {} : { runId: context.runId, scope: context.runId }),
|
|
82
|
+
...(context.callIndex === undefined ? {} : { callIndex: context.callIndex }),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function isObject(value) {
|
|
86
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
87
|
+
}
|
|
88
|
+
function nestedToolName(meta) {
|
|
89
|
+
if (!isObject(meta))
|
|
90
|
+
return undefined;
|
|
91
|
+
for (const value of Object.values(meta)) {
|
|
92
|
+
if (!isObject(value) || typeof value.toolName !== "string" || value.toolName.trim().length === 0)
|
|
93
|
+
continue;
|
|
94
|
+
return value.toolName;
|
|
95
|
+
}
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
/** Pure ACP-to-engine adapter. Unknown or unsafe activity stays on the raw event bus only. */
|
|
99
|
+
export function projectWorkflowAgentActivity(event) {
|
|
100
|
+
const scope = event.scope ?? event.runId;
|
|
101
|
+
if (typeof scope !== "string" || scope.length === 0 || typeof event.sessionId !== "string" ||
|
|
102
|
+
event.sessionId.length === 0 || !Number.isSafeInteger(event.callIndex) || event.callIndex < 0)
|
|
103
|
+
return undefined;
|
|
104
|
+
const base = {
|
|
105
|
+
scope,
|
|
106
|
+
callIndex: event.callIndex,
|
|
107
|
+
...(event.label === undefined ? {} : { label: event.label }),
|
|
108
|
+
sessionId: event.sessionId,
|
|
109
|
+
};
|
|
110
|
+
if (event.name === "session_open")
|
|
111
|
+
return { ...base, kind: "session-open" };
|
|
112
|
+
if (event.name === "session_close")
|
|
113
|
+
return { ...base, kind: "session-close" };
|
|
114
|
+
const update = event.event;
|
|
115
|
+
if (event.name === "agent_message_chunk") {
|
|
116
|
+
const content = update.content;
|
|
117
|
+
if (!isObject(content) || content.type !== "text" || typeof content.text !== "string" || content.text.length === 0) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
const messageId = typeof update.messageId === "string" && update.messageId.length > 0
|
|
121
|
+
? update.messageId
|
|
122
|
+
: undefined;
|
|
123
|
+
return { ...base, kind: "assistant-text", text: content.text, ...(messageId === undefined ? {} : { messageId }) };
|
|
124
|
+
}
|
|
125
|
+
if (event.name === "tool_call") {
|
|
126
|
+
if (typeof update.title !== "string" || update.title.trim().length === 0)
|
|
127
|
+
return undefined;
|
|
128
|
+
const name = nestedToolName(update._meta) ??
|
|
129
|
+
(typeof update.kind === "string" && update.kind.trim().length > 0 ? update.kind : update.title);
|
|
130
|
+
return {
|
|
131
|
+
...base,
|
|
132
|
+
kind: "tool-call",
|
|
133
|
+
title: update.title,
|
|
134
|
+
toolName: name,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (event.name === "usage_update") {
|
|
138
|
+
const used = update.used;
|
|
139
|
+
return {
|
|
140
|
+
...base,
|
|
141
|
+
kind: "usage",
|
|
142
|
+
...(Number.isSafeInteger(used) && used >= 0 ? { tokensObserved: used } : {}),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
if (event.name === "user_message_chunk" || event.name === "agent_thought_chunk" ||
|
|
146
|
+
event.name === "tool_call_update" || event.name === "plan" || event.name === "plan_update" ||
|
|
147
|
+
event.name === "plan_removed")
|
|
148
|
+
return { ...base, kind: "content-boundary" };
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { AcpEventName, AcpRunnerEventMap } from "@automatalabs/acp-agents";
|
|
|
3
3
|
import type { ExecOptions, WorkflowDir, WorkflowManagerOptions } from "@automatalabs/workflow-engine";
|
|
4
4
|
import type { AgentRunner, RunEvent, WorkflowRunResult } from "@automatalabs/shared-types";
|
|
5
5
|
import { type ScriptBackendApproval } from "./script-backends.js";
|
|
6
|
-
export {
|
|
6
|
+
export { projectWorkflowAgentActivity, workflowAgentEventSource, type WorkflowAgentEventSink, type WorkflowAgentEventSource, } from "./agent-event-source.js";
|
|
7
|
+
export { runWorkflow, parseWorkflowScript, hashCheckpointInputs, resolveAgentTimeoutMs, resolveWorkflowRunLimits, redactText, truncateUtf8, AGENT_PROGRESS_HEARTBEAT_MS, AGENT_PROGRESS_MIN_INTERVAL_MS, CALL_PATH_FORMAT, CALL_INPUTS_FORMAT, CHECKPOINT_INPUTS_FORMAT, RESUME_FALLBACK_REASONS, RESUME_DISABLED_REASONS, RESUME_CALL_LIVE_REASONS, RESUME_CALL_FAILED_REASONS, } from "@automatalabs/workflow-engine";
|
|
7
8
|
export { runIsolation, createReplayRunner, type RunIsolationSdkOptions } from "./isolation.js";
|
|
8
9
|
export type { RunIsolationOptions, IsolationRunResult, ReplayRunnerOptions, ResolvedIsolationTarget, IsolationTarget, ReplayRunner, ReplayObservation, ReplayReport, ReplayCallReport, ReplayDivergenceEvent, CheckpointCallContext, WorkflowCallRecord, WorkflowRecordedError, } from "./isolation.js";
|
|
9
10
|
export { openWorkflowDir, type WorkflowDir, type WorkflowDirEntry, type OpenWorkflowDirOptions, } from "@automatalabs/workflow-engine";
|
|
@@ -11,7 +12,7 @@ export { validateWorkflowScript, fabricateFromSchema, formatValidateReport, MOCK
|
|
|
11
12
|
export type { MockAnswerJson, MockAnswerRule, MockAnswers, MockAnswerSequence, UnusedMockAnswer, ValidateWorkflowOptions, ValidateWorkflowReport, ValidateHarnessOptions, ValidatedAgentCall, ValidatedCheckpoint, ValidatedMockAnswerRule, ValidatedMockAnswers, ValidatedMockAnswerUse, } from "./validate.js";
|
|
12
13
|
export { probeHarnessConfig, formatHarnessConfigReport } from "./config.js";
|
|
13
14
|
export type { ProbeHarnessConfigOptions, HarnessConfigReport } from "./config.js";
|
|
14
|
-
export type { WorkflowRunOptions, WorkflowRunLimitOptions, WorkflowAgentAttemptControl, WorkflowAgentCallCancellation, AgentOptions, ExecOptions, WorkflowManagerOptions, CheckpointOptions, WorkflowRunResult, WorkflowSnapshot, WorkflowPathOptions, RunPersistence, RunPersistenceOptions, PersistedRunState, PersistedAgentState, PersistedResumeFormat, PersistedResumeCandidate, PersistedResumeCallBlocker, PersistedCheckpointInjection, PersistedResumeSeed, PersistedRunLineageTombstone, PreparedResume, WorkflowLogTail, WorkflowRunCallStatus, WorkflowRunInspectionOptions, WorkflowRunLimits, WorkflowRunStatus, WorkflowRunStatusTruncation, WorkflowRunFallback, WorkflowCheckpointSource, WorkflowCheckpointTaken, ResumePolicy, WorkflowResumeStrategy, WorkflowResumeMatch, WorkflowResumeFallbackReason, WorkflowResumeDisabledReason, WorkflowResumeCallLiveReason, WorkflowResumeCallFailedReason, WorkflowResumeSafety, WorkflowCallReplayProvenance, WorkflowResumeCallDecision, WorkflowResumeReport, WorkflowReplayOperationalOption, WorkflowReplayOperationalChange, WorkflowReplayProvenanceField, WorkflowReplayProvenanceChange, WorkflowReplayFirstNonReplay, WorkflowReplayEligibility, } from "@automatalabs/workflow-engine";
|
|
15
|
+
export type { WorkflowRunOptions, WorkflowRunLimitOptions, WorkflowAgentAttemptControl, WorkflowAgentCallCancellation, AgentOptions, ExecOptions, WorkflowManagerOptions, CheckpointOptions, WorkflowRunResult, WorkflowSnapshot, WorkflowPathOptions, RunPersistence, RunPersistenceOptions, PersistedRunState, PersistedAgentState, PersistedResumeFormat, PersistedResumeCandidate, PersistedResumeCallBlocker, PersistedCheckpointInjection, PersistedResumeSeed, PersistedRunLineageTombstone, PreparedResume, WorkflowLogTail, WorkflowRunCallStatus, WorkflowRunInspectionOptions, WorkflowRunLimits, WorkflowRunStatus, WorkflowRunStatusTruncation, WorkflowRunFallback, WorkflowCheckpointSource, WorkflowCheckpointTaken, ResumePolicy, WorkflowResumeStrategy, WorkflowResumeMatch, WorkflowResumeFallbackReason, WorkflowResumeDisabledReason, WorkflowResumeCallLiveReason, WorkflowResumeCallFailedReason, WorkflowResumeSafety, WorkflowCallReplayProvenance, WorkflowResumeCallDecision, WorkflowResumeReport, WorkflowReplayOperationalOption, WorkflowReplayOperationalChange, WorkflowReplayProvenanceField, WorkflowReplayProvenanceChange, WorkflowReplayFirstNonReplay, WorkflowReplayEligibility, WorkflowAgentActivity, WorkflowAgentActivityBase, } from "@automatalabs/workflow-engine";
|
|
15
16
|
export { AGENTPRISM_PERSISTENCE_ROOT_ENV, WorkflowError, WorkflowErrorCode, isWorkflowError, isProviderUsageLimit, isAuthRequired, } from "@automatalabs/workflow-engine";
|
|
16
17
|
export { withRunEvents, RunEventLogError, RUN_EVENT_READ_LIMIT_DEFAULT, RUN_EVENT_READ_LIMIT_MAX, RUN_EVENT_MAX_RECORD_BYTES, } from "@automatalabs/workflow-engine";
|
|
17
18
|
export type { RunEventPersistence, RunEventStream, AppendRunEventInput, ReadRunEventsOptions, ReadRunEventsResult, WatchRunEventsOptions, RunEventLogErrorCode, } from "@automatalabs/workflow-engine";
|
|
@@ -24,7 +25,7 @@ export type { AcpRunnerEventMap, AcpEventName, AcpEventListener, AcpEventContext
|
|
|
24
25
|
export type { AgentRunner, McpAcpServerConfig, McpServerConfig, RunOptions, AgentResult, AgentUsage, } from "@automatalabs/shared-types";
|
|
25
26
|
export type { AgentSessionRecord, AgentSessionRef, JournalCallMetadata, JournalEntry, WorkflowBackendConfig, WorkflowMeta, } from "@automatalabs/shared-types";
|
|
26
27
|
export { RUN_EVENT_LOG_VERSION } from "@automatalabs/shared-types";
|
|
27
|
-
export type { RunEvent, EngineRunEvent, EngineRunEventName, EngineRunEventPayloadMap, PersistableEngineRunEvent, PersistedRunEvent, RunEventLogRecord, RunEventValueProjection, RunEventErrorProjection, RunEventCheckpointProjection, PersistedRunAgentEndPayload, } from "@automatalabs/shared-types";
|
|
28
|
+
export type { RunEvent, EngineRunEvent, EngineRunEventName, EngineRunEventPayloadMap, PersistableEngineRunEvent, PersistedRunEvent, RunEventLogRecord, RunEventValueProjection, RunEventErrorProjection, RunEventCheckpointProjection, PersistedRunAgentEndPayload, RunAgentProgressEvent, RunAgentProgressPayload, RunAgentTranscriptEvent, RunAgentTranscriptPayload, } from "@automatalabs/shared-types";
|
|
28
29
|
type ContextProperty<T, Key extends PropertyKey> = Key extends keyof T ? T[Key] : never;
|
|
29
30
|
type OptionalContextProperty<T, Key extends PropertyKey> = Key extends keyof T ? T[Key] : undefined;
|
|
30
31
|
/** The manager unwraps the runner catch-all into its concrete sessionUpdate discriminant. */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAKL,eAAe,IAAI,qBAAqB,EACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAKL,eAAe,IAAI,qBAAqB,EACzC,MAAM,+BAA+B,CAAC;AACvC,OA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AM,EAAE,GAAG,WAAW,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAsC5B"}
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
// The DSL globals available INSIDE a workflow script (agent, parallel, pipeline, …) are
|
|
10
10
|
// vm-realm globals, NOT importable symbols; they are documented for author IntelliSense
|
|
11
11
|
// in ./dsl.d.ts (referenced above), not exported here.
|
|
12
|
-
import {
|
|
12
|
+
import { createAcpRunner } from "@automatalabs/acp-agents";
|
|
13
13
|
import { openWorkflowDir, parseWorkflowScript, WorkflowManager as EngineWorkflowManager, } from "@automatalabs/workflow-engine";
|
|
14
14
|
import { approveScriptBackends } from "./script-backends.js";
|
|
15
|
+
import { projectWorkflowAgentActivity, workflowAgentEventSource, } from "./agent-event-source.js";
|
|
16
|
+
export { projectWorkflowAgentActivity, workflowAgentEventSource, } from "./agent-event-source.js";
|
|
15
17
|
// ── Engine: run entry, script parsing, the managed-run lifecycle, and the
|
|
16
18
|
// option/result + error types the host composes against. ──
|
|
17
|
-
export { runWorkflow, parseWorkflowScript, hashCheckpointInputs, resolveAgentTimeoutMs, resolveWorkflowRunLimits, redactText, truncateUtf8, CALL_PATH_FORMAT, CALL_INPUTS_FORMAT, CHECKPOINT_INPUTS_FORMAT, RESUME_FALLBACK_REASONS, RESUME_DISABLED_REASONS, RESUME_CALL_LIVE_REASONS, RESUME_CALL_FAILED_REASONS, } from "@automatalabs/workflow-engine";
|
|
19
|
+
export { runWorkflow, parseWorkflowScript, hashCheckpointInputs, resolveAgentTimeoutMs, resolveWorkflowRunLimits, redactText, truncateUtf8, AGENT_PROGRESS_HEARTBEAT_MS, AGENT_PROGRESS_MIN_INTERVAL_MS, CALL_PATH_FORMAT, CALL_INPUTS_FORMAT, CHECKPOINT_INPUTS_FORMAT, RESUME_FALLBACK_REASONS, RESUME_DISABLED_REASONS, RESUME_CALL_LIVE_REASONS, RESUME_CALL_FAILED_REASONS, } from "@automatalabs/workflow-engine";
|
|
18
20
|
// ── Isolation mode: deterministic substitution testing over a recorded run. The SDK
|
|
19
21
|
// wrapper defaults the live target runner to ACP and owns that runner's disposal. ──
|
|
20
22
|
export { runIsolation, createReplayRunner } from "./isolation.js";
|
|
@@ -54,7 +56,6 @@ export { TypedEventEmitter } from "@automatalabs/acp-agents";
|
|
|
54
56
|
// through the facade so SDK consumers type a durable-log reader without reaching past the SDK
|
|
55
57
|
// (the ACP-specialized agentEvent branch is bound below as WorkflowAgentEvent/WorkflowRunEvent). ──
|
|
56
58
|
export { RUN_EVENT_LOG_VERSION } from "@automatalabs/shared-types";
|
|
57
|
-
const MANAGER_ACP_CROSS_CUTTING_EVENT_NAMES = ACP_CROSS_CUTTING_EVENT_NAMES;
|
|
58
59
|
/**
|
|
59
60
|
* Stateful workflow manager exported by the SDK facade. It is the workflow-engine manager plus
|
|
60
61
|
* ONE composition-root bridge for ACP-capable runners: when the injected AgentRunner also exposes
|
|
@@ -116,8 +117,7 @@ export class WorkflowManager extends EngineWorkflowManager {
|
|
|
116
117
|
* caller may share one runner across managers or own its process lifetime explicitly. */
|
|
117
118
|
dispose() {
|
|
118
119
|
for (const bridge of this.acpBridges.values()) {
|
|
119
|
-
|
|
120
|
-
unsubscribe();
|
|
120
|
+
bridge.detach();
|
|
121
121
|
}
|
|
122
122
|
this.acpBridges.clear();
|
|
123
123
|
}
|
|
@@ -126,20 +126,24 @@ export class WorkflowManager extends EngineWorkflowManager {
|
|
|
126
126
|
this.dispose();
|
|
127
127
|
}
|
|
128
128
|
acquireAcpRunnerBridge(agent) {
|
|
129
|
-
if (!
|
|
129
|
+
if (!agent)
|
|
130
130
|
return () => { };
|
|
131
131
|
let bridge = this.acpBridges.get(agent);
|
|
132
132
|
if (!bridge) {
|
|
133
133
|
bridge = {
|
|
134
134
|
refs: 0,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
detach: workflowAgentEventSource(agent).attach({
|
|
136
|
+
observe: (event) => {
|
|
137
|
+
try {
|
|
138
|
+
const activity = projectWorkflowAgentActivity(event);
|
|
139
|
+
if (activity !== undefined)
|
|
140
|
+
this.observeAgentActivity(activity);
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
this.emit("agentEvent", event);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
}),
|
|
143
147
|
};
|
|
144
148
|
this.acpBridges.set(agent, bridge);
|
|
145
149
|
}
|
|
@@ -155,39 +159,11 @@ export class WorkflowManager extends EngineWorkflowManager {
|
|
|
155
159
|
current.refs--;
|
|
156
160
|
if (current.refs > 0)
|
|
157
161
|
return;
|
|
158
|
-
|
|
159
|
-
unsubscribe();
|
|
162
|
+
current.detach();
|
|
160
163
|
this.acpBridges.delete(agent);
|
|
161
164
|
};
|
|
162
165
|
}
|
|
163
166
|
}
|
|
164
|
-
function isAcpEventBusRunner(agent) {
|
|
165
|
-
return typeof agent?.on === "function";
|
|
166
|
-
}
|
|
167
|
-
function toSessionUpdateAgentEventPayload(event) {
|
|
168
|
-
const name = event.update.sessionUpdate;
|
|
169
|
-
return toAgentEventPayload(name, {
|
|
170
|
-
...event.update,
|
|
171
|
-
sessionId: event.sessionId,
|
|
172
|
-
backendId: event.backendId,
|
|
173
|
-
label: event.label,
|
|
174
|
-
runId: event.runId,
|
|
175
|
-
callIndex: event.callIndex,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function toAgentEventPayload(name, event) {
|
|
179
|
-
const context = event;
|
|
180
|
-
return {
|
|
181
|
-
name,
|
|
182
|
-
event,
|
|
183
|
-
backendId: context.backendId,
|
|
184
|
-
...(context.sessionId !== undefined ? { sessionId: context.sessionId } : {}),
|
|
185
|
-
...(context.label !== undefined ? { label: context.label } : {}),
|
|
186
|
-
...(context.runId !== undefined ? { runId: context.runId } : {}),
|
|
187
|
-
...(context.runId !== undefined ? { scope: context.runId } : {}),
|
|
188
|
-
...(context.callIndex !== undefined ? { callIndex: context.callIndex } : {}),
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
167
|
/**
|
|
192
168
|
* Run a dynamic workflow script to a TERMINAL result, with the AgentRunner seam
|
|
193
169
|
* defaulted to the ACP backend.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automatalabs/workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"typebox": "1.3.2",
|
|
34
|
-
"@automatalabs/shared-types": "0.
|
|
35
|
-
"@automatalabs/workflow-engine": "0.
|
|
36
|
-
"@automatalabs/acp-agents": "0.34.
|
|
34
|
+
"@automatalabs/shared-types": "0.27.1",
|
|
35
|
+
"@automatalabs/workflow-engine": "0.31.0",
|
|
36
|
+
"@automatalabs/acp-agents": "0.34.8"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsc -b",
|