@agent-relay/sdk 2.3.14 → 2.4.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/README.md +68 -838
- package/bin/agent-relay-broker +0 -0
- package/dist/__tests__/contract-fixtures.test.d.ts +2 -0
- package/dist/__tests__/contract-fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/contract-fixtures.test.js +85 -0
- package/dist/__tests__/contract-fixtures.test.js.map +1 -0
- package/dist/__tests__/facade.test.d.ts +2 -0
- package/dist/__tests__/facade.test.d.ts.map +1 -0
- package/dist/__tests__/facade.test.js +305 -0
- package/dist/__tests__/facade.test.js.map +1 -0
- package/dist/__tests__/integration.test.d.ts +2 -0
- package/dist/__tests__/integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration.test.js +169 -0
- package/dist/__tests__/integration.test.js.map +1 -0
- package/dist/__tests__/pty.test.d.ts +2 -0
- package/dist/__tests__/pty.test.d.ts.map +1 -0
- package/dist/__tests__/pty.test.js +20 -0
- package/dist/__tests__/pty.test.js.map +1 -0
- package/dist/__tests__/quickstart.test.d.ts +2 -0
- package/dist/__tests__/quickstart.test.d.ts.map +1 -0
- package/dist/__tests__/quickstart.test.js +176 -0
- package/dist/__tests__/quickstart.test.js.map +1 -0
- package/dist/__tests__/spawn-from-env.test.d.ts +2 -0
- package/dist/__tests__/spawn-from-env.test.d.ts.map +1 -0
- package/dist/__tests__/spawn-from-env.test.js +206 -0
- package/dist/__tests__/spawn-from-env.test.js.map +1 -0
- package/dist/__tests__/unit.test.d.ts +2 -0
- package/dist/__tests__/unit.test.d.ts.map +1 -0
- package/dist/__tests__/unit.test.js +347 -0
- package/dist/__tests__/unit.test.js.map +1 -0
- package/dist/browser.d.ts +16 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +19 -0
- package/dist/browser.js.map +1 -0
- package/dist/client.d.ts +140 -526
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +416 -1509
- package/dist/client.js.map +1 -1
- package/dist/consensus-helpers.d.ts +103 -0
- package/dist/consensus-helpers.d.ts.map +1 -0
- package/dist/consensus-helpers.js +147 -0
- package/dist/consensus-helpers.js.map +1 -0
- package/dist/consensus.d.ts +72 -0
- package/dist/consensus.d.ts.map +1 -0
- package/dist/consensus.js +378 -0
- package/dist/consensus.js.map +1 -0
- package/dist/examples/demo.d.ts +2 -0
- package/dist/examples/demo.d.ts.map +1 -0
- package/dist/examples/demo.js +63 -0
- package/dist/examples/demo.js.map +1 -0
- package/dist/examples/example.d.ts +2 -0
- package/dist/examples/example.d.ts.map +1 -0
- package/dist/examples/example.js +80 -0
- package/dist/examples/example.js.map +1 -0
- package/dist/examples/quickstart.d.ts +2 -0
- package/dist/examples/quickstart.d.ts.map +1 -0
- package/dist/examples/quickstart.js +56 -0
- package/dist/examples/quickstart.js.map +1 -0
- package/dist/examples/ralph-loop.d.ts +2 -0
- package/dist/examples/ralph-loop.d.ts.map +1 -0
- package/dist/examples/ralph-loop.js +281 -0
- package/dist/examples/ralph-loop.js.map +1 -0
- package/dist/examples/workflow-superiority.d.ts +32 -0
- package/dist/examples/workflow-superiority.d.ts.map +1 -0
- package/dist/examples/workflow-superiority.js +1421 -0
- package/dist/examples/workflow-superiority.js.map +1 -0
- package/dist/index.d.ts +13 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -26
- package/dist/index.js.map +1 -1
- package/dist/logs.d.ts +70 -25
- package/dist/logs.d.ts.map +1 -1
- package/dist/logs.js +238 -42
- package/dist/logs.js.map +1 -1
- package/dist/models.d.ts +9 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +17 -0
- package/dist/models.js.map +1 -0
- package/dist/protocol.d.ts +366 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +2 -0
- package/dist/protocol.js.map +1 -0
- package/dist/pty.d.ts +8 -0
- package/dist/pty.d.ts.map +1 -0
- package/dist/pty.js +26 -0
- package/dist/pty.js.map +1 -0
- package/dist/relay-adapter.d.ts +139 -0
- package/dist/relay-adapter.d.ts.map +1 -0
- package/dist/relay-adapter.js +210 -0
- package/dist/relay-adapter.js.map +1 -0
- package/dist/relay.d.ts +304 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +910 -0
- package/dist/relay.js.map +1 -0
- package/dist/shadow.d.ts +101 -0
- package/dist/shadow.d.ts.map +1 -0
- package/dist/shadow.js +174 -0
- package/dist/shadow.js.map +1 -0
- package/dist/spawn-from-env.d.ts +77 -0
- package/dist/spawn-from-env.d.ts.map +1 -0
- package/dist/spawn-from-env.js +172 -0
- package/dist/spawn-from-env.js.map +1 -0
- package/dist/workflows/barrier.d.ts +72 -0
- package/dist/workflows/barrier.d.ts.map +1 -0
- package/dist/workflows/barrier.js +162 -0
- package/dist/workflows/barrier.js.map +1 -0
- package/dist/workflows/builder.d.ts +114 -0
- package/dist/workflows/builder.d.ts.map +1 -0
- package/dist/workflows/builder.js +201 -0
- package/dist/workflows/builder.js.map +1 -0
- package/dist/workflows/cli.d.ts +11 -0
- package/dist/workflows/cli.d.ts.map +1 -0
- package/dist/workflows/cli.js +144 -0
- package/dist/workflows/cli.js.map +1 -0
- package/dist/workflows/coordinator.d.ts +73 -0
- package/dist/workflows/coordinator.d.ts.map +1 -0
- package/dist/workflows/coordinator.js +647 -0
- package/dist/workflows/coordinator.js.map +1 -0
- package/dist/workflows/custom-steps.d.ts +73 -0
- package/dist/workflows/custom-steps.d.ts.map +1 -0
- package/dist/workflows/custom-steps.js +321 -0
- package/dist/workflows/custom-steps.js.map +1 -0
- package/dist/workflows/dry-run-format.d.ts +6 -0
- package/dist/workflows/dry-run-format.d.ts.map +1 -0
- package/dist/workflows/dry-run-format.js +68 -0
- package/dist/workflows/dry-run-format.js.map +1 -0
- package/dist/workflows/file-db.d.ts +33 -0
- package/dist/workflows/file-db.d.ts.map +1 -0
- package/dist/workflows/file-db.js +108 -0
- package/dist/workflows/file-db.js.map +1 -0
- package/dist/workflows/index.d.ts +15 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +15 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/memory-db.d.ts +17 -0
- package/dist/workflows/memory-db.d.ts.map +1 -0
- package/dist/workflows/memory-db.js +33 -0
- package/dist/workflows/memory-db.js.map +1 -0
- package/dist/workflows/run.d.ts +38 -0
- package/dist/workflows/run.d.ts.map +1 -0
- package/dist/workflows/run.js +25 -0
- package/dist/workflows/run.js.map +1 -0
- package/dist/workflows/runner.d.ts +320 -0
- package/dist/workflows/runner.d.ts.map +1 -0
- package/dist/workflows/runner.js +2821 -0
- package/dist/workflows/runner.js.map +1 -0
- package/dist/workflows/state.d.ts +77 -0
- package/dist/workflows/state.d.ts.map +1 -0
- package/dist/workflows/state.js +140 -0
- package/dist/workflows/state.js.map +1 -0
- package/dist/workflows/templates.d.ts +47 -0
- package/dist/workflows/templates.d.ts.map +1 -0
- package/dist/workflows/templates.js +405 -0
- package/dist/workflows/templates.js.map +1 -0
- package/dist/workflows/trajectory.d.ts +87 -0
- package/dist/workflows/trajectory.d.ts.map +1 -0
- package/dist/workflows/trajectory.js +441 -0
- package/dist/workflows/trajectory.js.map +1 -0
- package/dist/workflows/types.d.ts +306 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +23 -0
- package/dist/workflows/types.js.map +1 -0
- package/dist/workflows/validator.d.ts +11 -0
- package/dist/workflows/validator.d.ts.map +1 -0
- package/dist/workflows/validator.js +128 -0
- package/dist/workflows/validator.js.map +1 -0
- package/package.json +59 -53
- package/dist/discovery.d.ts +0 -10
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js +0 -22
- package/dist/discovery.js.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -9
- package/dist/errors.js.map +0 -1
- package/dist/protocol/index.d.ts +0 -8
- package/dist/protocol/index.d.ts.map +0 -1
- package/dist/protocol/index.js +0 -8
- package/dist/protocol/index.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { appendFileSync, mkdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* JSONL-backed WorkflowDb for the CLI.
|
|
5
|
+
*
|
|
6
|
+
* Each insert/update appends a line to the file. On read, we scan from the
|
|
7
|
+
* bottom and take the last record for each ID — so updates naturally shadow
|
|
8
|
+
* earlier inserts without rewriting the file.
|
|
9
|
+
*
|
|
10
|
+
* This makes writes O(1) and reads O(n) where n = number of lines (small for
|
|
11
|
+
* typical workflows). Resume only reads once at startup, so the read cost is
|
|
12
|
+
* paid once per CLI invocation.
|
|
13
|
+
*
|
|
14
|
+
* File: .agent-relay/workflow-runs.jsonl in the workflow cwd.
|
|
15
|
+
*/
|
|
16
|
+
export class JsonFileWorkflowDb {
|
|
17
|
+
filePath;
|
|
18
|
+
/** Whether the storage directory is writable. False = silent no-op mode. */
|
|
19
|
+
writable;
|
|
20
|
+
constructor(filePath) {
|
|
21
|
+
this.filePath = filePath;
|
|
22
|
+
let writable = false;
|
|
23
|
+
try {
|
|
24
|
+
mkdirSync(path.dirname(filePath), { recursive: true });
|
|
25
|
+
writable = true;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// Permission denied or read-only fs — run in memory-only mode.
|
|
29
|
+
// The workflow executes normally; resume won't be available for this run.
|
|
30
|
+
}
|
|
31
|
+
this.writable = writable;
|
|
32
|
+
}
|
|
33
|
+
/** Returns false if the storage directory could not be created (permission error). */
|
|
34
|
+
isWritable() {
|
|
35
|
+
return this.writable;
|
|
36
|
+
}
|
|
37
|
+
// ── Private helpers ─────────────────────────────────────────────────────
|
|
38
|
+
append(entry) {
|
|
39
|
+
if (!this.writable)
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
appendFileSync(this.filePath, JSON.stringify(entry) + '\n', 'utf8');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// Non-critical — workflow execution continues; resume won't be available.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Read all lines and build the latest snapshot for each ID. */
|
|
49
|
+
snapshot() {
|
|
50
|
+
const runs = new Map();
|
|
51
|
+
const steps = new Map();
|
|
52
|
+
let raw = '';
|
|
53
|
+
try {
|
|
54
|
+
raw = readFileSync(this.filePath, 'utf8');
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return { runs, steps };
|
|
58
|
+
}
|
|
59
|
+
for (const line of raw.split('\n')) {
|
|
60
|
+
const trimmed = line.trim();
|
|
61
|
+
if (!trimmed)
|
|
62
|
+
continue;
|
|
63
|
+
try {
|
|
64
|
+
const entry = JSON.parse(trimmed);
|
|
65
|
+
if (entry.kind === 'run') {
|
|
66
|
+
runs.set(entry.row.id, entry.row);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
steps.set(entry.row.id, entry.row);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Skip malformed lines
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { runs, steps };
|
|
77
|
+
}
|
|
78
|
+
// ── WorkflowDb interface ─────────────────────────────────────────────────
|
|
79
|
+
async insertRun(run) {
|
|
80
|
+
this.append({ kind: 'run', row: run });
|
|
81
|
+
}
|
|
82
|
+
async updateRun(id, patch) {
|
|
83
|
+
const { runs } = this.snapshot();
|
|
84
|
+
const existing = runs.get(id);
|
|
85
|
+
if (!existing)
|
|
86
|
+
return;
|
|
87
|
+
this.append({ kind: 'run', row: { ...existing, ...patch, updatedAt: new Date().toISOString() } });
|
|
88
|
+
}
|
|
89
|
+
async getRun(id) {
|
|
90
|
+
const { runs } = this.snapshot();
|
|
91
|
+
return runs.get(id) ?? null;
|
|
92
|
+
}
|
|
93
|
+
async insertStep(step) {
|
|
94
|
+
this.append({ kind: 'step', row: step });
|
|
95
|
+
}
|
|
96
|
+
async updateStep(id, patch) {
|
|
97
|
+
const { steps } = this.snapshot();
|
|
98
|
+
const existing = steps.get(id);
|
|
99
|
+
if (!existing)
|
|
100
|
+
return;
|
|
101
|
+
this.append({ kind: 'step', row: { ...existing, ...patch, updatedAt: new Date().toISOString() } });
|
|
102
|
+
}
|
|
103
|
+
async getStepsByRunId(runId) {
|
|
104
|
+
const { steps } = this.snapshot();
|
|
105
|
+
return Array.from(steps.values()).filter((s) => s.runId === runId);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=file-db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-db.js","sourceRoot":"","sources":["../../src/workflows/file-db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,kBAAkB;IACZ,QAAQ,CAAS;IAElC,4EAA4E;IAC3D,QAAQ,CAAU;IAEnC,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC;YACH,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,+DAA+D;YAC/D,0EAA0E;QAC5E,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,sFAAsF;IACtF,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,2EAA2E;IAEnE,MAAM,CAAC,KAAc;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC3B,IAAI,CAAC;YACH,cAAc,CAAC,IAAI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EAAE,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,KAAa;QACjC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './runner.js';
|
|
3
|
+
export * from './custom-steps.js';
|
|
4
|
+
export { Models, ClaudeModels, CodexModels, GeminiModels, CursorModels, CLIs, CLIVersions, CLIRegistry, SwarmPatterns, } from '../models.js';
|
|
5
|
+
export * from './memory-db.js';
|
|
6
|
+
export * from './file-db.js';
|
|
7
|
+
export * from './run.js';
|
|
8
|
+
export * from './builder.js';
|
|
9
|
+
export * from './coordinator.js';
|
|
10
|
+
export * from './barrier.js';
|
|
11
|
+
export * from './state.js';
|
|
12
|
+
export * from './templates.js';
|
|
13
|
+
export { WorkflowTrajectory, type StepOutcome } from './trajectory.js';
|
|
14
|
+
export { formatDryRunReport } from './dry-run-format.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './runner.js';
|
|
3
|
+
export * from './custom-steps.js';
|
|
4
|
+
export { Models, ClaudeModels, CodexModels, GeminiModels, CursorModels, CLIs, CLIVersions, CLIRegistry, SwarmPatterns, } from '../models.js';
|
|
5
|
+
export * from './memory-db.js';
|
|
6
|
+
export * from './file-db.js';
|
|
7
|
+
export * from './run.js';
|
|
8
|
+
export * from './builder.js';
|
|
9
|
+
export * from './coordinator.js';
|
|
10
|
+
export * from './barrier.js';
|
|
11
|
+
export * from './state.js';
|
|
12
|
+
export * from './templates.js';
|
|
13
|
+
export { WorkflowTrajectory } from './trajectory.js';
|
|
14
|
+
export { formatDryRunReport } from './dry-run-format.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WorkflowRunRow, WorkflowStepRow } from './types.js';
|
|
2
|
+
import type { WorkflowDb } from './runner.js';
|
|
3
|
+
/**
|
|
4
|
+
* In-memory implementation of WorkflowDb for local workflow runs.
|
|
5
|
+
* No persistence — state lives only for the duration of the process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class InMemoryWorkflowDb implements WorkflowDb {
|
|
8
|
+
private runs;
|
|
9
|
+
private steps;
|
|
10
|
+
insertRun(run: WorkflowRunRow): Promise<void>;
|
|
11
|
+
updateRun(id: string, patch: Partial<WorkflowRunRow>): Promise<void>;
|
|
12
|
+
getRun(id: string): Promise<WorkflowRunRow | null>;
|
|
13
|
+
insertStep(step: WorkflowStepRow): Promise<void>;
|
|
14
|
+
updateStep(id: string, patch: Partial<WorkflowStepRow>): Promise<void>;
|
|
15
|
+
getStepsByRunId(runId: string): Promise<WorkflowStepRow[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=memory-db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-db.d.ts","sourceRoot":"","sources":["../../src/workflows/memory-db.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,IAAI,CAAqC;IACjD,OAAO,CAAC,KAAK,CAAsC;IAE7C,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAIlD,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMtE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGjE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory implementation of WorkflowDb for local workflow runs.
|
|
3
|
+
* No persistence — state lives only for the duration of the process.
|
|
4
|
+
*/
|
|
5
|
+
export class InMemoryWorkflowDb {
|
|
6
|
+
runs = new Map();
|
|
7
|
+
steps = new Map();
|
|
8
|
+
async insertRun(run) {
|
|
9
|
+
this.runs.set(run.id, { ...run });
|
|
10
|
+
}
|
|
11
|
+
async updateRun(id, patch) {
|
|
12
|
+
const existing = this.runs.get(id);
|
|
13
|
+
if (!existing)
|
|
14
|
+
return;
|
|
15
|
+
this.runs.set(id, { ...existing, ...patch, updatedAt: new Date().toISOString() });
|
|
16
|
+
}
|
|
17
|
+
async getRun(id) {
|
|
18
|
+
return this.runs.get(id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
async insertStep(step) {
|
|
21
|
+
this.steps.set(step.id, { ...step });
|
|
22
|
+
}
|
|
23
|
+
async updateStep(id, patch) {
|
|
24
|
+
const existing = this.steps.get(id);
|
|
25
|
+
if (!existing)
|
|
26
|
+
return;
|
|
27
|
+
this.steps.set(id, { ...existing, ...patch, updatedAt: new Date().toISOString() });
|
|
28
|
+
}
|
|
29
|
+
async getStepsByRunId(runId) {
|
|
30
|
+
return Array.from(this.steps.values()).filter((s) => s.runId === runId);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=memory-db.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-db.js","sourceRoot":"","sources":["../../src/workflows/memory-db.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACrB,IAAI,GAAG,IAAI,GAAG,EAA0B,CAAC;IACzC,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEnD,KAAK,CAAC,SAAS,CAAC,GAAmB;QACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,EAAU,EAAE,KAA8B;QACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAqB;QACpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU,EAAE,KAA+B;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,KAAa;QACjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentRelayOptions } from '../relay.js';
|
|
2
|
+
import type { DryRunReport, TrajectoryConfig, WorkflowRunRow } from './types.js';
|
|
3
|
+
import { type WorkflowEventListener, type VariableContext } from './runner.js';
|
|
4
|
+
/**
|
|
5
|
+
* Options for the `runWorkflow` convenience function.
|
|
6
|
+
*/
|
|
7
|
+
export interface RunWorkflowOptions {
|
|
8
|
+
/** Workflow name within the YAML file. Defaults to the first workflow. */
|
|
9
|
+
workflow?: string;
|
|
10
|
+
/** Template variable substitutions for {{variable}} placeholders. */
|
|
11
|
+
vars?: VariableContext;
|
|
12
|
+
/** Working directory. Defaults to process.cwd(). */
|
|
13
|
+
cwd?: string;
|
|
14
|
+
/** AgentRelay options (all optional — broker starts automatically). */
|
|
15
|
+
relay?: AgentRelayOptions;
|
|
16
|
+
/** Progress callback for workflow events. */
|
|
17
|
+
onEvent?: WorkflowEventListener;
|
|
18
|
+
/** Override trajectory config. Set to false to disable trajectory recording. */
|
|
19
|
+
trajectories?: TrajectoryConfig | false;
|
|
20
|
+
/** Validate and show execution plan without running. */
|
|
21
|
+
dryRun?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run a workflow from a relay.yaml file with zero configuration.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { runWorkflow } from "@agent-relay/sdk/workflows";
|
|
29
|
+
*
|
|
30
|
+
* const result = await runWorkflow("workflows/daytona-migration.yaml");
|
|
31
|
+
* console.log(result.status); // "completed" | "failed"
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function runWorkflow(yamlPath: string, options: RunWorkflowOptions & {
|
|
35
|
+
dryRun: true;
|
|
36
|
+
}): Promise<DryRunReport>;
|
|
37
|
+
export declare function runWorkflow(yamlPath: string, options?: RunWorkflowOptions): Promise<WorkflowRunRow>;
|
|
38
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/workflows/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAkB,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG/F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,6CAA6C;IAC7C,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,gFAAgF;IAChF,YAAY,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAC;IACxC,wDAAwD;IACxD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,kBAAkB,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAC7C,OAAO,CAAC,YAAY,CAAC,CAAC;AACzB,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WorkflowRunner } from './runner.js';
|
|
2
|
+
import { formatDryRunReport } from './dry-run-format.js';
|
|
3
|
+
export async function runWorkflow(yamlPath, options = {}) {
|
|
4
|
+
const runner = new WorkflowRunner({
|
|
5
|
+
cwd: options.cwd,
|
|
6
|
+
relay: options.relay,
|
|
7
|
+
});
|
|
8
|
+
const config = await runner.parseYamlFile(yamlPath);
|
|
9
|
+
// Allow programmatic trajectory override
|
|
10
|
+
if (options.trajectories !== undefined) {
|
|
11
|
+
config.trajectories = options.trajectories;
|
|
12
|
+
}
|
|
13
|
+
// Auto-detect DRY_RUN env var so existing scripts get dry-run for free
|
|
14
|
+
const isDryRun = options.dryRun ?? !!process.env.DRY_RUN;
|
|
15
|
+
if (isDryRun) {
|
|
16
|
+
const report = runner.dryRun(config, options.workflow, options.vars);
|
|
17
|
+
console.log(formatDryRunReport(report));
|
|
18
|
+
return report;
|
|
19
|
+
}
|
|
20
|
+
if (options.onEvent) {
|
|
21
|
+
runner.on(options.onEvent);
|
|
22
|
+
}
|
|
23
|
+
return runner.execute(config, options.workflow, options.vars);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/workflows/run.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAoD,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsCzD,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAgB,EAChB,UAA8B,EAAE;IAEhC,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;QAChC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAEpD,yCAAyC;IACzC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC7C,CAAC;IAED,uEAAuE;IACvE,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAEzD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowRunner — parses relay.yaml, validates config, resolves templates,
|
|
3
|
+
* executes steps (sequential/parallel/DAG), runs verification checks,
|
|
4
|
+
* persists state to DB, and supports pause/resume/abort with retries.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentCli, DryRunReport, RelayYamlConfig, WorkflowRunRow, WorkflowStepRow } from './types.js';
|
|
7
|
+
import { AgentRelay } from '../relay.js';
|
|
8
|
+
import type { AgentRelayOptions } from '../relay.js';
|
|
9
|
+
/** Minimal DB adapter so the runner is not coupled to a specific driver. */
|
|
10
|
+
export interface WorkflowDb {
|
|
11
|
+
insertRun(run: WorkflowRunRow): Promise<void>;
|
|
12
|
+
updateRun(id: string, patch: Partial<WorkflowRunRow>): Promise<void>;
|
|
13
|
+
getRun(id: string): Promise<WorkflowRunRow | null>;
|
|
14
|
+
insertStep(step: WorkflowStepRow): Promise<void>;
|
|
15
|
+
updateStep(id: string, patch: Partial<WorkflowStepRow>): Promise<void>;
|
|
16
|
+
getStepsByRunId(runId: string): Promise<WorkflowStepRow[]>;
|
|
17
|
+
}
|
|
18
|
+
export type WorkflowEvent = {
|
|
19
|
+
type: 'run:started';
|
|
20
|
+
runId: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'run:completed';
|
|
23
|
+
runId: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: 'run:failed';
|
|
26
|
+
runId: string;
|
|
27
|
+
error: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'run:cancelled';
|
|
30
|
+
runId: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'step:started';
|
|
33
|
+
runId: string;
|
|
34
|
+
stepName: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'step:completed';
|
|
37
|
+
runId: string;
|
|
38
|
+
stepName: string;
|
|
39
|
+
output?: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'step:failed';
|
|
42
|
+
runId: string;
|
|
43
|
+
stepName: string;
|
|
44
|
+
error: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'step:skipped';
|
|
47
|
+
runId: string;
|
|
48
|
+
stepName: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'step:retrying';
|
|
51
|
+
runId: string;
|
|
52
|
+
stepName: string;
|
|
53
|
+
attempt: number;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'step:nudged';
|
|
56
|
+
runId: string;
|
|
57
|
+
stepName: string;
|
|
58
|
+
nudgeCount: number;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'step:force-released';
|
|
61
|
+
runId: string;
|
|
62
|
+
stepName: string;
|
|
63
|
+
};
|
|
64
|
+
export type WorkflowEventListener = (event: WorkflowEvent) => void;
|
|
65
|
+
export interface WorkflowRunnerOptions {
|
|
66
|
+
db?: WorkflowDb;
|
|
67
|
+
workspaceId?: string;
|
|
68
|
+
relay?: AgentRelayOptions;
|
|
69
|
+
cwd?: string;
|
|
70
|
+
summaryDir?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface VariableContext {
|
|
73
|
+
[key: string]: string | number | boolean | undefined;
|
|
74
|
+
}
|
|
75
|
+
export declare class WorkflowRunner {
|
|
76
|
+
private readonly db;
|
|
77
|
+
private readonly workspaceId;
|
|
78
|
+
private readonly relayOptions;
|
|
79
|
+
private readonly cwd;
|
|
80
|
+
private readonly summaryDir;
|
|
81
|
+
/** @internal exposed for CLI signal-handler shutdown only */
|
|
82
|
+
relay?: AgentRelay;
|
|
83
|
+
private relaycast?;
|
|
84
|
+
private relaycastAgent?;
|
|
85
|
+
private relayApiKey?;
|
|
86
|
+
private relayApiKeyAutoCreated;
|
|
87
|
+
private channel?;
|
|
88
|
+
private trajectory?;
|
|
89
|
+
private abortController?;
|
|
90
|
+
private paused;
|
|
91
|
+
private pauseResolver?;
|
|
92
|
+
private listeners;
|
|
93
|
+
/** Current config for the active run, so spawnAndWait can access swarm config. */
|
|
94
|
+
private currentConfig?;
|
|
95
|
+
/** Current run ID for event emission from spawnAndWait context. */
|
|
96
|
+
private currentRunId?;
|
|
97
|
+
/** Live Agent handles keyed by name, for hub-mediated nudging. */
|
|
98
|
+
private readonly activeAgentHandles;
|
|
99
|
+
private readonly ptyOutputBuffers;
|
|
100
|
+
private readonly ptyListeners;
|
|
101
|
+
private readonly ptyLogStreams;
|
|
102
|
+
/** Path to workers.json so `agents:kill` can find workflow-spawned agents */
|
|
103
|
+
private readonly workersPath;
|
|
104
|
+
/** In-memory tracking of active workers to avoid race conditions on workers.json */
|
|
105
|
+
private readonly activeWorkers;
|
|
106
|
+
/** Mutex for serializing workers.json file access */
|
|
107
|
+
private workersFileLock;
|
|
108
|
+
/** Timestamp when the current workflow run started, for elapsed-time logging. */
|
|
109
|
+
private runStartTime?;
|
|
110
|
+
/** Unsubscribe handle for broker stderr listener wired during a run. */
|
|
111
|
+
private unsubBrokerStderr?;
|
|
112
|
+
/** Tracks last idle log time per agent to debounce idle warnings (30s multiples). */
|
|
113
|
+
private readonly lastIdleLog;
|
|
114
|
+
/** Tracks last logged activity type per agent to avoid duplicate status lines. */
|
|
115
|
+
private readonly lastActivity;
|
|
116
|
+
constructor(options?: WorkflowRunnerOptions);
|
|
117
|
+
/** Log a progress message with elapsed time since run start. */
|
|
118
|
+
private log;
|
|
119
|
+
/**
|
|
120
|
+
* Ensure a Relaycast workspace API key is available for the broker.
|
|
121
|
+
* Resolution order:
|
|
122
|
+
* 1. RELAY_API_KEY environment variable (explicit override)
|
|
123
|
+
* 2. Auto-create a fresh workspace via the Relaycast API
|
|
124
|
+
*
|
|
125
|
+
* Each workflow run gets its own isolated workspace — no caching, no sharing.
|
|
126
|
+
*/
|
|
127
|
+
private ensureRelaycastApiKey;
|
|
128
|
+
private getRelayEnv;
|
|
129
|
+
private getRelaycastBaseUrl;
|
|
130
|
+
private getRelaycastClient;
|
|
131
|
+
private ensureRelaycastRunnerAgent;
|
|
132
|
+
private createAndJoinRelaycastChannel;
|
|
133
|
+
private registerRelaycastExternalAgent;
|
|
134
|
+
private startRelaycastHeartbeat;
|
|
135
|
+
on(listener: WorkflowEventListener): () => void;
|
|
136
|
+
private emit;
|
|
137
|
+
/** Parse a relay.yaml file from disk. */
|
|
138
|
+
parseYamlFile(filePath: string): Promise<RelayYamlConfig>;
|
|
139
|
+
/** Parse a relay.yaml string. */
|
|
140
|
+
parseYamlString(raw: string, source?: string): RelayYamlConfig;
|
|
141
|
+
/** Validate a config object against the RelayYamlConfig shape. */
|
|
142
|
+
validateConfig(config: unknown, source?: string): asserts config is RelayYamlConfig;
|
|
143
|
+
/**
|
|
144
|
+
* Validate a workflow config and simulate execution waves without spawning agents.
|
|
145
|
+
* Returns a DryRunReport with DAG analysis, agent summary, and wave breakdown.
|
|
146
|
+
*/
|
|
147
|
+
dryRun(config: RelayYamlConfig, workflowName?: string, vars?: VariableContext): DryRunReport;
|
|
148
|
+
private validateWorkflow;
|
|
149
|
+
private detectCycles;
|
|
150
|
+
private detectLeadWorkerDeadlock;
|
|
151
|
+
/** Resolve {{variable}} placeholders in all task strings. */
|
|
152
|
+
resolveVariables(config: RelayYamlConfig, vars: VariableContext): RelayYamlConfig;
|
|
153
|
+
private interpolate;
|
|
154
|
+
private resolveDotPath;
|
|
155
|
+
/** Build a nested context from completed step outputs for {{steps.X.output}} resolution. */
|
|
156
|
+
private buildStepOutputContext;
|
|
157
|
+
/** Interpolate step-output variables, silently skipping unresolved ones (they may be user vars). */
|
|
158
|
+
private interpolateStepTask;
|
|
159
|
+
/** Execute a named workflow from a validated config. */
|
|
160
|
+
execute(config: RelayYamlConfig, workflowName?: string, vars?: VariableContext): Promise<WorkflowRunRow>;
|
|
161
|
+
/** Resume a previously paused or partially completed run. */
|
|
162
|
+
resume(runId: string, vars?: VariableContext): Promise<WorkflowRunRow>;
|
|
163
|
+
private runWorkflowCore;
|
|
164
|
+
/** Pause execution. Currently-running steps will finish but no new steps start. */
|
|
165
|
+
pause(): void;
|
|
166
|
+
/** Resume after a pause(). */
|
|
167
|
+
unpause(): void;
|
|
168
|
+
/** Abort the current run. Running agents are released. */
|
|
169
|
+
abort(): void;
|
|
170
|
+
private executeSteps;
|
|
171
|
+
private findReadySteps;
|
|
172
|
+
/**
|
|
173
|
+
* Execute preflight checks before any workflow steps.
|
|
174
|
+
* All checks must pass or the workflow fails immediately.
|
|
175
|
+
*/
|
|
176
|
+
private runPreflightChecks;
|
|
177
|
+
/** Check if a step is deterministic (shell command) vs agent (LLM-powered). */
|
|
178
|
+
private isDeterministicStep;
|
|
179
|
+
/** Check if a step is a worktree (git worktree setup) step. */
|
|
180
|
+
private isWorktreeStep;
|
|
181
|
+
private executeStep;
|
|
182
|
+
/**
|
|
183
|
+
* Execute a deterministic step (shell command).
|
|
184
|
+
* Fast, reliable, $0 LLM cost.
|
|
185
|
+
*/
|
|
186
|
+
private executeDeterministicStep;
|
|
187
|
+
/**
|
|
188
|
+
* Execute a worktree step (git worktree setup).
|
|
189
|
+
* Fast, reliable, $0 LLM cost.
|
|
190
|
+
* Outputs the worktree path for downstream steps to use.
|
|
191
|
+
*/
|
|
192
|
+
private executeWorktreeStep;
|
|
193
|
+
/**
|
|
194
|
+
* Execute an agent step (LLM-powered).
|
|
195
|
+
*/
|
|
196
|
+
private executeAgentStep;
|
|
197
|
+
/**
|
|
198
|
+
* Build the CLI command and arguments for a non-interactive agent execution.
|
|
199
|
+
* Each CLI has a specific flag for one-shot prompt mode.
|
|
200
|
+
*/
|
|
201
|
+
static buildNonInteractiveCommand(cli: AgentCli, task: string, extraArgs?: string[]): {
|
|
202
|
+
cmd: string;
|
|
203
|
+
args: string[];
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Apply preset defaults to an agent definition.
|
|
207
|
+
* Explicit fields on the definition always win over preset-inferred defaults.
|
|
208
|
+
*/
|
|
209
|
+
private static resolveAgentDef;
|
|
210
|
+
/**
|
|
211
|
+
* Returns a preset-specific prefix that is prepended to the non-interactive
|
|
212
|
+
* enforcement block in execNonInteractive.
|
|
213
|
+
*/
|
|
214
|
+
/**
|
|
215
|
+
* Returns a prefix injected into the task prompt for non-interactive agents.
|
|
216
|
+
* Lead agents are always interactive (PTY), so they never reach execNonInteractive
|
|
217
|
+
* and there is no 'lead' case here.
|
|
218
|
+
*/
|
|
219
|
+
private buildPresetInjection;
|
|
220
|
+
/**
|
|
221
|
+
* Execute an agent as a non-interactive subprocess.
|
|
222
|
+
* No PTY, no relay messaging, no /exit injection. The process receives its task
|
|
223
|
+
* as a CLI argument and stdout is captured as the step output.
|
|
224
|
+
*/
|
|
225
|
+
private execNonInteractive;
|
|
226
|
+
private spawnAndWait;
|
|
227
|
+
/** Patterns where a hub agent coordinates spoke agents. */
|
|
228
|
+
private static readonly HUB_PATTERNS;
|
|
229
|
+
/** Roles that indicate a coordinator/lead agent (eligible for delegation guidance). */
|
|
230
|
+
private static readonly HUB_ROLES;
|
|
231
|
+
/**
|
|
232
|
+
* Wait for agent exit with idle detection and nudging.
|
|
233
|
+
* If no idle nudge config is set, falls through to simple waitForExit.
|
|
234
|
+
*/
|
|
235
|
+
private waitForExitWithIdleNudging;
|
|
236
|
+
/**
|
|
237
|
+
* Send a nudge to an idle agent. Uses hub-mediated nudge for hub patterns,
|
|
238
|
+
* or direct system injection otherwise.
|
|
239
|
+
*/
|
|
240
|
+
private nudgeIdleAgent;
|
|
241
|
+
/**
|
|
242
|
+
* Find the hub agent for hub-mediated nudging.
|
|
243
|
+
* Returns the hub's live Agent handle if this is a hub pattern and the idle agent is not the hub.
|
|
244
|
+
*/
|
|
245
|
+
private resolveHubForNudge;
|
|
246
|
+
private runVerification;
|
|
247
|
+
private updateRunStatus;
|
|
248
|
+
private markStepFailed;
|
|
249
|
+
private markDownstreamSkipped;
|
|
250
|
+
private checkAborted;
|
|
251
|
+
private waitIfPaused;
|
|
252
|
+
private delay;
|
|
253
|
+
/**
|
|
254
|
+
* Build a metadata note about non-interactive workers for inclusion in interactive agent tasks.
|
|
255
|
+
* Returns undefined if there are no non-interactive agents.
|
|
256
|
+
*/
|
|
257
|
+
private buildNonInteractiveAwareness;
|
|
258
|
+
/**
|
|
259
|
+
* Build guidance that encourages agents to autonomously delegate subtasks
|
|
260
|
+
* to helper agents when work is too complex for a single pass.
|
|
261
|
+
*/
|
|
262
|
+
/**
|
|
263
|
+
* Returns a relay registration preamble for CLIs that don't auto-call
|
|
264
|
+
* `register` via the MCP system prompt (everyone except claude).
|
|
265
|
+
*
|
|
266
|
+
* Claude reads the Relaycast system prompt and registers on its own.
|
|
267
|
+
* Codex, gemini, etc. have the MCP server configured with the workspace
|
|
268
|
+
* key, but they won't call `register` unless explicitly told to.
|
|
269
|
+
*/
|
|
270
|
+
private buildRelayRegistrationNote;
|
|
271
|
+
private buildDelegationGuidance;
|
|
272
|
+
/** Post a message to the workflow channel. Fire-and-forget — never throws or blocks. */
|
|
273
|
+
private postToChannel;
|
|
274
|
+
/** Post a rich completion report to the channel. */
|
|
275
|
+
private postCompletionReport;
|
|
276
|
+
/** Post a failure report to the channel. */
|
|
277
|
+
private postFailureReport;
|
|
278
|
+
/**
|
|
279
|
+
* Log a human-readable run summary to the console after completion or failure.
|
|
280
|
+
* Extracts the last meaningful lines from each step's raw PTY output.
|
|
281
|
+
*/
|
|
282
|
+
private logRunSummary;
|
|
283
|
+
/**
|
|
284
|
+
* Extract a useful excerpt from raw PTY output.
|
|
285
|
+
* Looks for the agent's final text output (ignoring ANSI, system prompts, tool calls).
|
|
286
|
+
*/
|
|
287
|
+
private extractOutputExcerpt;
|
|
288
|
+
/** Analyze DAG structure for trajectory context. */
|
|
289
|
+
private analyzeDAG;
|
|
290
|
+
/** Collect step outcomes for trajectory synthesis. */
|
|
291
|
+
private collectOutcomes;
|
|
292
|
+
private generateId;
|
|
293
|
+
private generateShortId;
|
|
294
|
+
/** Strip ANSI escape codes from terminal output — delegates to pty.ts canonical regex. */
|
|
295
|
+
private static stripAnsi;
|
|
296
|
+
/**
|
|
297
|
+
* Strip TUI chrome from PTY-captured output before posting to a channel.
|
|
298
|
+
* Removes: ANSI codes, unicode spinner/thinking characters, cursor-movement
|
|
299
|
+
* artifacts, and collapses runs of blank lines to a single blank line.
|
|
300
|
+
* The raw (ANSI-stripped) output is still written to disk for step chaining.
|
|
301
|
+
*/
|
|
302
|
+
private static scrubForChannel;
|
|
303
|
+
/** Sanitize a workflow name into a valid channel name. */
|
|
304
|
+
private sanitizeChannelName;
|
|
305
|
+
/** Directory for persisted step outputs: .agent-relay/step-outputs/{runId}/ */
|
|
306
|
+
private getStepOutputDir;
|
|
307
|
+
/** Persist step output to disk and post full output as a channel message. */
|
|
308
|
+
private persistStepOutput;
|
|
309
|
+
/** Load persisted step output from disk. */
|
|
310
|
+
private loadStepOutput;
|
|
311
|
+
/** Get or create the worker logs directory (.agent-relay/team/worker-logs) */
|
|
312
|
+
private getWorkerLogsDir;
|
|
313
|
+
/** Register a spawned agent in workers.json so `agents:kill` can find it. */
|
|
314
|
+
private registerWorker;
|
|
315
|
+
/** Remove a spawned agent from workers.json after it exits. */
|
|
316
|
+
private unregisterWorker;
|
|
317
|
+
private readWorkers;
|
|
318
|
+
private writeWorkers;
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/workflows/runner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,OAAO,KAAK,EACV,QAAQ,EAGR,YAAY,EAKZ,eAAe,EAIf,cAAc,EAGd,eAAe,EAEhB,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAS,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAK5D,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAEnD,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAA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