harnery 0.14.0 → 0.15.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 +1 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +2 -0
- package/dist/commands/supervisor.d.ts +4 -0
- package/dist/commands/supervisor.d.ts.map +1 -0
- package/dist/commands/supervisor.js +238 -0
- package/dist/core/supervisor/index.d.ts +3 -0
- package/dist/core/supervisor/index.d.ts.map +1 -0
- package/dist/core/supervisor/index.js +2 -0
- package/dist/core/supervisor/read.d.ts +2 -0
- package/dist/core/supervisor/read.d.ts.map +1 -0
- package/dist/core/supervisor/read.js +1 -0
- package/dist/core/supervisor/runner.d.ts +34 -0
- package/dist/core/supervisor/runner.d.ts.map +1 -0
- package/dist/core/supervisor/runner.js +198 -0
- package/dist/core/supervisor/state.d.ts +69 -0
- package/dist/core/supervisor/state.d.ts.map +1 -0
- package/dist/core/supervisor/state.js +413 -0
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +21 -8
- package/dist/core/workflow/index.d.ts +1 -1
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +1 -0
- package/dist/core/workflow/run-state.d.ts +2 -0
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +12 -0
- package/dist/core/workflow/specialists.d.ts +7 -0
- package/dist/core/workflow/specialists.d.ts.map +1 -0
- package/dist/core/workflow/specialists.js +78 -0
- package/dist/core/workflow/types.d.ts +17 -0
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/package.json +11 -1
- package/src/commander.ts +2 -0
- package/src/commands/supervisor.ts +315 -0
- package/src/core/supervisor/index.ts +24 -0
- package/src/core/supervisor/read.ts +14 -0
- package/src/core/supervisor/runner.ts +278 -0
- package/src/core/supervisor/state.ts +552 -0
- package/src/core/workflow/engine.ts +21 -8
- package/src/core/workflow/index.ts +1 -0
- package/src/core/workflow/proof.ts +1 -0
- package/src/core/workflow/run-state.ts +17 -0
- package/src/core/workflow/specialists.ts +97 -0
- package/src/core/workflow/types.ts +18 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const SPECIALIST_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
2
|
+
const MAX_SPECIALISTS = 32;
|
|
3
|
+
const MAX_INSTRUCTIONS = 4_000;
|
|
4
|
+
const MAX_OPTION = 200;
|
|
5
|
+
export function normalizeWorkflowSpecialists(input) {
|
|
6
|
+
if (input === undefined)
|
|
7
|
+
return {};
|
|
8
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
9
|
+
throw new Error("workflow specialists must be an object keyed by role id");
|
|
10
|
+
}
|
|
11
|
+
const entries = Object.entries(input);
|
|
12
|
+
if (entries.length > MAX_SPECIALISTS) {
|
|
13
|
+
throw new Error(`workflow specialists exceed ${MAX_SPECIALISTS} roles`);
|
|
14
|
+
}
|
|
15
|
+
const normalized = {};
|
|
16
|
+
for (const [id, profile] of entries.sort(([left], [right]) => left.localeCompare(right))) {
|
|
17
|
+
if (!SPECIALIST_ID.test(id))
|
|
18
|
+
throw new Error(`invalid workflow specialist id ${JSON.stringify(id)}`);
|
|
19
|
+
if (!profile || typeof profile !== "object" || Array.isArray(profile)) {
|
|
20
|
+
throw new Error(`workflow specialist ${id} must be an object`);
|
|
21
|
+
}
|
|
22
|
+
normalized[id] = {
|
|
23
|
+
instructions: bounded(profile.instructions, `workflow specialist ${id} instructions`, MAX_INSTRUCTIONS),
|
|
24
|
+
harness: optional(profile.harness, `workflow specialist ${id} harness`),
|
|
25
|
+
model: optional(profile.model, `workflow specialist ${id} model`),
|
|
26
|
+
effort: optional(profile.effort, `workflow specialist ${id} effort`),
|
|
27
|
+
maxAttempts: positiveOptional(profile.maxAttempts, `workflow specialist ${id} maxAttempts`, 10),
|
|
28
|
+
timeoutMs: positiveOptional(profile.timeoutMs, `workflow specialist ${id} timeoutMs`, 24 * 60 * 60 * 1_000),
|
|
29
|
+
maxTurns: positiveOptional(profile.maxTurns, `workflow specialist ${id} maxTurns`, 1_000),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return normalized;
|
|
33
|
+
}
|
|
34
|
+
export function resolveSpecialistAssignment(profiles, prompt, opts) {
|
|
35
|
+
if (!opts.specialist)
|
|
36
|
+
return { prompt, opts };
|
|
37
|
+
if (!SPECIALIST_ID.test(opts.specialist)) {
|
|
38
|
+
throw new Error(`invalid workflow specialist id ${JSON.stringify(opts.specialist)}`);
|
|
39
|
+
}
|
|
40
|
+
const profile = profiles[opts.specialist];
|
|
41
|
+
if (!profile)
|
|
42
|
+
throw new Error(`workflow specialist ${JSON.stringify(opts.specialist)} is not configured`);
|
|
43
|
+
return {
|
|
44
|
+
prompt: `${profile.instructions}\n\nAssignment:\n${prompt}`,
|
|
45
|
+
opts: {
|
|
46
|
+
specialist: opts.specialist,
|
|
47
|
+
harness: opts.harness ?? profile.harness,
|
|
48
|
+
model: opts.model ?? profile.model,
|
|
49
|
+
effort: opts.effort ?? profile.effort,
|
|
50
|
+
maxAttempts: opts.maxAttempts ?? profile.maxAttempts,
|
|
51
|
+
timeoutMs: opts.timeoutMs ?? profile.timeoutMs,
|
|
52
|
+
maxTurns: opts.maxTurns ?? profile.maxTurns,
|
|
53
|
+
label: opts.label,
|
|
54
|
+
schema: opts.schema,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function bounded(value, field, max) {
|
|
59
|
+
if (typeof value !== "string")
|
|
60
|
+
throw new Error(`${field} must be a string`);
|
|
61
|
+
const normalized = value.trim();
|
|
62
|
+
if (!normalized)
|
|
63
|
+
throw new Error(`${field} must not be empty`);
|
|
64
|
+
if (normalized.length > max)
|
|
65
|
+
throw new Error(`${field} exceeds ${max} characters`);
|
|
66
|
+
return normalized;
|
|
67
|
+
}
|
|
68
|
+
function optional(value, field) {
|
|
69
|
+
return value === undefined ? undefined : bounded(value, field, MAX_OPTION);
|
|
70
|
+
}
|
|
71
|
+
function positiveOptional(value, field, max) {
|
|
72
|
+
if (value === undefined)
|
|
73
|
+
return undefined;
|
|
74
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > max) {
|
|
75
|
+
throw new Error(`${field} must be an integer from 1 to ${max}`);
|
|
76
|
+
}
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
@@ -63,6 +63,7 @@ export interface WorkflowAgentProof {
|
|
|
63
63
|
id: string;
|
|
64
64
|
label: string;
|
|
65
65
|
stage?: string;
|
|
66
|
+
specialist?: string;
|
|
66
67
|
harness: HarnessName;
|
|
67
68
|
model?: string;
|
|
68
69
|
status: "succeeded" | "failed" | "cached";
|
|
@@ -177,6 +178,9 @@ export interface StageSchema {
|
|
|
177
178
|
enum?: Array<string | number | boolean>;
|
|
178
179
|
}
|
|
179
180
|
export interface AgentOpts {
|
|
181
|
+
/** Frozen specialist profile whose instructions and defaults wrap this
|
|
182
|
+
* assignment. The host supplies profiles through EngineOpts.specialists. */
|
|
183
|
+
specialist?: string;
|
|
180
184
|
/** Stage gate: when present, the agent's reply must strict-parse as JSON and
|
|
181
185
|
* validate; the engine retries with the validation error appended, up to
|
|
182
186
|
* `maxAttempts`. Without it, `agent()` resolves to the raw reply text. */
|
|
@@ -204,6 +208,17 @@ export interface AgentOpts {
|
|
|
204
208
|
* Codex, and Cursor; consumers may register another adapter without widening
|
|
205
209
|
* a package-owned union first. */
|
|
206
210
|
export type HarnessName = string;
|
|
211
|
+
/** Durable role defaults supplied by a goal supervisor or embedding host.
|
|
212
|
+
* Profiles are frozen into a workflow run manifest before the first spawn. */
|
|
213
|
+
export interface WorkflowSpecialistProfile {
|
|
214
|
+
instructions: string;
|
|
215
|
+
harness?: HarnessName;
|
|
216
|
+
model?: string;
|
|
217
|
+
effort?: string;
|
|
218
|
+
maxAttempts?: number;
|
|
219
|
+
timeoutMs?: number;
|
|
220
|
+
maxTurns?: number;
|
|
221
|
+
}
|
|
207
222
|
/** What a spawn adapter returns for one subagent run. */
|
|
208
223
|
export interface SpawnResult {
|
|
209
224
|
ok: boolean;
|
|
@@ -268,6 +283,8 @@ export interface EngineOpts {
|
|
|
268
283
|
spawners: Readonly<Record<HarnessName, Spawner | undefined>>;
|
|
269
284
|
/** Harness used when an agent() call doesn't name one (default "claude-code"). */
|
|
270
285
|
defaultHarness?: HarnessName;
|
|
286
|
+
/** Named specialist roles available to agent(..., { specialist }). */
|
|
287
|
+
specialists?: Readonly<Record<string, WorkflowSpecialistProfile>>;
|
|
271
288
|
/** Resume: run id of a prior run whose journal supplies cached results.
|
|
272
289
|
* agent() calls whose (stage, prompt, model, maxTurns, schema) key matches a
|
|
273
290
|
* completed prior agent return the journaled result without spawning. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/workflow/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,6BAA6B,EAAG,CAAU,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AACjG,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CA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xB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;gFAE4E;IAC5E,6BAA6B,EAAE,MAAM,CAAC;IACtC,6EAA6E;IAC7E,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC5D,6DAA6D;IAC7D,MAAM,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CACzC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harnery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Multi-agent coordination for AI coding agents - Claude Code, Cursor, and Codex.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ryan Kelly",
|
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
"types": "./dist/core/work/read.d.ts",
|
|
78
78
|
"import": "./dist/core/work/read.js"
|
|
79
79
|
},
|
|
80
|
+
"./core/supervisor": {
|
|
81
|
+
"bun": "./src/core/supervisor/index.ts",
|
|
82
|
+
"types": "./dist/core/supervisor/index.d.ts",
|
|
83
|
+
"import": "./dist/core/supervisor/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./core/supervisor/state": {
|
|
86
|
+
"bun": "./src/core/supervisor/read.ts",
|
|
87
|
+
"types": "./dist/core/supervisor/read.d.ts",
|
|
88
|
+
"import": "./dist/core/supervisor/read.js"
|
|
89
|
+
},
|
|
80
90
|
"./core/policy": {
|
|
81
91
|
"bun": "./src/core/policy/index.ts",
|
|
82
92
|
"types": "./dist/core/policy/index.d.ts",
|
package/src/commander.ts
CHANGED
|
@@ -48,6 +48,7 @@ import { registerReadCommand } from "./commands/read.ts";
|
|
|
48
48
|
import { registerRelayCommand } from "./commands/relay.ts";
|
|
49
49
|
import { registerScratchCommand } from "./commands/scratch.ts";
|
|
50
50
|
import { registerSessionCommand } from "./commands/session.ts";
|
|
51
|
+
import { registerSupervisorCommand } from "./commands/supervisor.ts";
|
|
51
52
|
import { registerSyncCommand } from "./commands/sync.ts";
|
|
52
53
|
import { registerSectionCommand, registerTocCommand } from "./commands/toc.ts";
|
|
53
54
|
import { registerTokensCommand } from "./commands/tokens.ts";
|
|
@@ -289,6 +290,7 @@ export function createHarneryProgram(opts: HarneryContextOpts = {}): Command {
|
|
|
289
290
|
registerSyncCommand(program, emit);
|
|
290
291
|
registerWorkflowCommand(program, emit);
|
|
291
292
|
registerWorkCommand(program, emit);
|
|
293
|
+
registerSupervisorCommand(program, emit);
|
|
292
294
|
if (include("web")) registerWebCommand(program, emit);
|
|
293
295
|
|
|
294
296
|
return program;
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import type { Command } from "commander";
|
|
4
|
+
import type { EmitContext } from "../commander.ts";
|
|
5
|
+
import { workflowSubscriptionOnly } from "../core/config.ts";
|
|
6
|
+
import { createBuiltinHarnessRegistry } from "../core/harnesses/index.ts";
|
|
7
|
+
import { findCoordRoot } from "../core/hooks/resolve/coord-root.ts";
|
|
8
|
+
import type { PolicyIsolation } from "../core/policy/index.ts";
|
|
9
|
+
import { loadPolicyFile } from "../core/policy/index.ts";
|
|
10
|
+
import {
|
|
11
|
+
createSupervisor,
|
|
12
|
+
listSupervisors,
|
|
13
|
+
readSupervisor,
|
|
14
|
+
runSupervisor,
|
|
15
|
+
type SupervisorRecord,
|
|
16
|
+
type SupervisorRunReport,
|
|
17
|
+
} from "../core/supervisor/index.ts";
|
|
18
|
+
import type { WorkflowSpecialistProfile } from "../core/workflow/index.ts";
|
|
19
|
+
|
|
20
|
+
interface CreateOpts {
|
|
21
|
+
team: string;
|
|
22
|
+
id?: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
maxCycles?: string;
|
|
25
|
+
maxRuntimeMs?: string;
|
|
26
|
+
maxParallelWork?: string;
|
|
27
|
+
maxTotalAttempts?: string;
|
|
28
|
+
maxAgentsPerWork?: string;
|
|
29
|
+
agentConcurrency?: string;
|
|
30
|
+
acceptPassingProof?: boolean;
|
|
31
|
+
resumeApproved?: boolean;
|
|
32
|
+
retryBlocked?: boolean;
|
|
33
|
+
json?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface RunOpts {
|
|
37
|
+
harness?: string;
|
|
38
|
+
cwd?: string;
|
|
39
|
+
subscriptionOnly?: boolean;
|
|
40
|
+
allowApiBilling?: boolean;
|
|
41
|
+
policy?: string;
|
|
42
|
+
isolation?: PolicyIsolation;
|
|
43
|
+
approvalTo?: string;
|
|
44
|
+
actor?: string;
|
|
45
|
+
json?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function registerSupervisorCommand(program: Command, emit: EmitContext): void {
|
|
49
|
+
const registry = createBuiltinHarnessRegistry();
|
|
50
|
+
const supervisor = program
|
|
51
|
+
.command("supervisor")
|
|
52
|
+
.description("Run a bounded specialist team over a durable-work dependency graph.");
|
|
53
|
+
|
|
54
|
+
supervisor
|
|
55
|
+
.command("create <root-work-id>")
|
|
56
|
+
.description("Freeze a goal, specialist team, automation policy, and execution limits.")
|
|
57
|
+
.requiredOption("--team <file>", "JSON object mapping specialist ids to profiles")
|
|
58
|
+
.option("--id <goal-id>", "Stable goal id (generated by default)")
|
|
59
|
+
.option("--title <text>", "Goal title (defaults to root work title)")
|
|
60
|
+
.option("--max-cycles <n>", "Foreground cycle ceiling (default 50)")
|
|
61
|
+
.option("--max-runtime-ms <n>", "Foreground wall-time ceiling (default 14400000)")
|
|
62
|
+
.option("--max-parallel-work <n>", "Concurrent work-item ceiling (default 1)")
|
|
63
|
+
.option("--max-total-attempts <n>", "Graph-wide attempt ceiling (default 100)")
|
|
64
|
+
.option("--max-agents-per-work <n>", "Child-agent ceiling per work item (default 20)")
|
|
65
|
+
.option("--agent-concurrency <n>", "Child concurrency per work item (default 4)")
|
|
66
|
+
.option("--accept-passing-proof", "Allow the supervisor to explicitly accept passing proof")
|
|
67
|
+
.option("--no-resume-approved", "Stop after an approval instead of resuming its parked run")
|
|
68
|
+
.option("--retry-blocked", "Allow bounded retry of blocked work")
|
|
69
|
+
.option("--json", "Emit the complete supervisor record as JSON")
|
|
70
|
+
.action((rootWorkId: string, opts: CreateOpts) => {
|
|
71
|
+
withSupervisorRoot(emit, (coordRoot) => {
|
|
72
|
+
const specialists = readTeamFile(opts.team);
|
|
73
|
+
for (const [id, profile] of Object.entries(specialists)) {
|
|
74
|
+
if (profile.harness && !registry.get(profile.harness)) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`specialist ${id} names unknown harness ${JSON.stringify(profile.harness)}`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
emitSupervisor(
|
|
81
|
+
createSupervisor({
|
|
82
|
+
coordRoot,
|
|
83
|
+
rootWorkId,
|
|
84
|
+
specialists,
|
|
85
|
+
id: opts.id,
|
|
86
|
+
title: opts.title,
|
|
87
|
+
limits: {
|
|
88
|
+
max_cycles: integer(opts.maxCycles),
|
|
89
|
+
max_runtime_ms: integer(opts.maxRuntimeMs),
|
|
90
|
+
max_parallel_work: integer(opts.maxParallelWork),
|
|
91
|
+
max_total_attempts: integer(opts.maxTotalAttempts),
|
|
92
|
+
max_agents_per_work: integer(opts.maxAgentsPerWork),
|
|
93
|
+
agent_concurrency: integer(opts.agentConcurrency),
|
|
94
|
+
},
|
|
95
|
+
automation: {
|
|
96
|
+
accept_passing_proof: opts.acceptPassingProof,
|
|
97
|
+
resume_approved: opts.resumeApproved,
|
|
98
|
+
retry_blocked: opts.retryBlocked,
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
opts.json,
|
|
102
|
+
emit,
|
|
103
|
+
true,
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
supervisor
|
|
109
|
+
.command("list")
|
|
110
|
+
.description("List durable goals and their derived next action.")
|
|
111
|
+
.option("--json", "Emit complete supervisor records as JSON")
|
|
112
|
+
.action((opts: { json?: boolean }) => {
|
|
113
|
+
withSupervisorRoot(emit, (coordRoot) => {
|
|
114
|
+
const records = listSupervisors(coordRoot);
|
|
115
|
+
if (opts.json) {
|
|
116
|
+
emit.config({ format: "json" });
|
|
117
|
+
emit.data(records);
|
|
118
|
+
} else if (records.length === 0) {
|
|
119
|
+
emit.text("no durable supervisors\n");
|
|
120
|
+
} else {
|
|
121
|
+
emit.text(`${records.map(renderSupervisorRow).join("\n")}\n`);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
supervisor
|
|
127
|
+
.command("show <goal-id>")
|
|
128
|
+
.description("Show one goal, frozen team, bounds, graph state, and next action.")
|
|
129
|
+
.option("--json", "Emit the complete supervisor record as JSON")
|
|
130
|
+
.action((goalId: string, opts: { json?: boolean }) => {
|
|
131
|
+
withSupervisorRoot(emit, (coordRoot) => {
|
|
132
|
+
emitSupervisor(readSupervisor(coordRoot, goalId), opts.json, emit, true);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
registerRunCommand(supervisor, "tick", registry, emit);
|
|
137
|
+
registerRunCommand(supervisor, "run", registry, emit);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function registerRunCommand(
|
|
141
|
+
supervisor: Command,
|
|
142
|
+
mode: "tick" | "run",
|
|
143
|
+
registry: ReturnType<typeof createBuiltinHarnessRegistry>,
|
|
144
|
+
emit: EmitContext,
|
|
145
|
+
): void {
|
|
146
|
+
supervisor
|
|
147
|
+
.command(`${mode} <goal-id>`)
|
|
148
|
+
.description(
|
|
149
|
+
mode === "tick"
|
|
150
|
+
? "Perform at most one bounded scheduling cycle."
|
|
151
|
+
: "Run bounded cycles until success, attention, no progress, or budget exhaustion.",
|
|
152
|
+
)
|
|
153
|
+
.option("--harness <name>", "Fallback harness for agent calls without a specialist")
|
|
154
|
+
.option("--cwd <dir>", "Working directory for child agents")
|
|
155
|
+
.option("--subscription-only", "Require stored harness-login billing")
|
|
156
|
+
.option("--allow-api-billing", "Permit API-key override billing")
|
|
157
|
+
.option("--policy <file>", "Host policy JSON/JSONC")
|
|
158
|
+
.option("--isolation <mode>", "shared | worktree | sandbox | remote")
|
|
159
|
+
.option("--approval-to <address>", "Address durable ASK requests")
|
|
160
|
+
.option("--actor <name>", "Actor recorded on supervisor work decisions")
|
|
161
|
+
.option("--json", "Emit the complete run report as JSON")
|
|
162
|
+
.action(async (goalId: string, opts: RunOpts) => {
|
|
163
|
+
await withSupervisorRootAsync(emit, async (coordRoot) => {
|
|
164
|
+
if (opts.harness && !registry.get(opts.harness)) {
|
|
165
|
+
throw new Error(`unknown harness ${JSON.stringify(opts.harness)}`);
|
|
166
|
+
}
|
|
167
|
+
const report = await runSupervisor({
|
|
168
|
+
coordRoot,
|
|
169
|
+
goalId,
|
|
170
|
+
mode,
|
|
171
|
+
actor: opts.actor,
|
|
172
|
+
onLog: opts.json ? undefined : (line) => emit.text(`${line}\n`),
|
|
173
|
+
engine: {
|
|
174
|
+
spawners: registry.spawners(),
|
|
175
|
+
defaultHarness: opts.harness,
|
|
176
|
+
cwd: opts.cwd,
|
|
177
|
+
subscriptionOnly:
|
|
178
|
+
opts.subscriptionOnly === true ? true : workflowSubscriptionOnly(coordRoot),
|
|
179
|
+
allowApiBilling: opts.allowApiBilling,
|
|
180
|
+
harnessEvidence: Object.fromEntries(
|
|
181
|
+
registry
|
|
182
|
+
.list()
|
|
183
|
+
.map((adapter) => [
|
|
184
|
+
adapter.profile.id,
|
|
185
|
+
{ toolEvidence: adapter.profile.capabilities.toolEvidence },
|
|
186
|
+
]),
|
|
187
|
+
),
|
|
188
|
+
policy: opts.policy ? loadPolicyFile(opts.policy) : undefined,
|
|
189
|
+
approvalMode: "park",
|
|
190
|
+
approvalAddressee: opts.approvalTo,
|
|
191
|
+
isolation: opts.isolation,
|
|
192
|
+
networkAccess: "enabled",
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
emitSupervisorReport(report, opts.json, emit);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function readTeamFile(path: string): Record<string, WorkflowSpecialistProfile> {
|
|
201
|
+
const absolute = resolve(path);
|
|
202
|
+
let value: unknown;
|
|
203
|
+
try {
|
|
204
|
+
value = JSON.parse(readFileSync(absolute, "utf8"));
|
|
205
|
+
} catch (error) {
|
|
206
|
+
throw new Error(`cannot read supervisor team at ${absolute}: ${(error as Error).message}`);
|
|
207
|
+
}
|
|
208
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
209
|
+
throw new Error("supervisor team must be a JSON object keyed by specialist id");
|
|
210
|
+
}
|
|
211
|
+
return value as Record<string, WorkflowSpecialistProfile>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function emitSupervisor(
|
|
215
|
+
record: SupervisorRecord,
|
|
216
|
+
json: boolean | undefined,
|
|
217
|
+
emit: EmitContext,
|
|
218
|
+
detail = false,
|
|
219
|
+
): void {
|
|
220
|
+
if (json) {
|
|
221
|
+
emit.config({ format: "json" });
|
|
222
|
+
emit.data(record);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!detail) {
|
|
226
|
+
emit.text(`${renderSupervisorRow(record)}\n`);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const projection = record.projection;
|
|
230
|
+
const lines = [
|
|
231
|
+
`${record.intent.id}: ${record.intent.title}`,
|
|
232
|
+
`state: ${projection.state}`,
|
|
233
|
+
`root: ${record.intent.root_work_id}`,
|
|
234
|
+
`reason: ${projection.reason}`,
|
|
235
|
+
`next: ${projection.next_action}`,
|
|
236
|
+
`work: ${projection.work_ids.length}`,
|
|
237
|
+
`attempts: ${projection.attempts_used}/${record.intent.limits.max_total_attempts}`,
|
|
238
|
+
`specialists: ${projection.specialists.join(", ") || "none"}`,
|
|
239
|
+
`automation: accept=${record.intent.automation.accept_passing_proof}, ` +
|
|
240
|
+
`resume=${record.intent.automation.resume_approved}, retry=${record.intent.automation.retry_blocked}`,
|
|
241
|
+
];
|
|
242
|
+
if (projection.attention_work.length) {
|
|
243
|
+
lines.push(`attention: ${projection.attention_work.join(", ")}`);
|
|
244
|
+
}
|
|
245
|
+
emit.text(`${lines.join("\n")}\n`);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function emitSupervisorReport(
|
|
249
|
+
report: SupervisorRunReport,
|
|
250
|
+
json: boolean | undefined,
|
|
251
|
+
emit: EmitContext,
|
|
252
|
+
): void {
|
|
253
|
+
if (json) {
|
|
254
|
+
emit.config({ format: "json" });
|
|
255
|
+
emit.data(report);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
emit.text(
|
|
259
|
+
`supervisor ${report.goal_id}: ${report.stop_reason}\n` +
|
|
260
|
+
`reason: ${report.reason}\n` +
|
|
261
|
+
`cycles: ${report.cycles}; dispatches: ${report.dispatches}; acceptances: ${report.acceptances}\n` +
|
|
262
|
+
`state: ${report.projection.state}; next: ${report.projection.next_action}\n`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function renderSupervisorRow(record: SupervisorRecord): string {
|
|
267
|
+
const projection = record.projection;
|
|
268
|
+
return `${record.intent.id} ${projection.state.padEnd(20)} ${projection.attempts_used}/${record.intent.limits.max_total_attempts} ${projection.next_action.padEnd(18)} ${record.intent.title}`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function integer(value: string | undefined): number | undefined {
|
|
272
|
+
if (value === undefined) return undefined;
|
|
273
|
+
if (!/^\d+$/.test(value))
|
|
274
|
+
throw new Error(`expected a positive integer, got ${JSON.stringify(value)}`);
|
|
275
|
+
return Number.parseInt(value, 10);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function withSupervisorRoot(emit: EmitContext, fn: (coordRoot: string) => void): void {
|
|
279
|
+
const coordRoot = findCoordRoot();
|
|
280
|
+
if (!coordRoot) {
|
|
281
|
+
emit.error({
|
|
282
|
+
code: "no_coord_root",
|
|
283
|
+
message: "no .harnery/ coordination root found; run `init` first",
|
|
284
|
+
});
|
|
285
|
+
emit.setExitCode(1);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
try {
|
|
289
|
+
fn(coordRoot);
|
|
290
|
+
} catch (error) {
|
|
291
|
+
emit.error({ code: "supervisor_failed", message: (error as Error).message });
|
|
292
|
+
emit.setExitCode(1);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
async function withSupervisorRootAsync(
|
|
297
|
+
emit: EmitContext,
|
|
298
|
+
fn: (coordRoot: string) => Promise<void>,
|
|
299
|
+
): Promise<void> {
|
|
300
|
+
const coordRoot = findCoordRoot();
|
|
301
|
+
if (!coordRoot) {
|
|
302
|
+
emit.error({
|
|
303
|
+
code: "no_coord_root",
|
|
304
|
+
message: "no .harnery/ coordination root found; run `init` first",
|
|
305
|
+
});
|
|
306
|
+
emit.setExitCode(1);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
try {
|
|
310
|
+
await fn(coordRoot);
|
|
311
|
+
} catch (error) {
|
|
312
|
+
emit.error({ code: "supervisor_failed", message: (error as Error).message });
|
|
313
|
+
emit.setExitCode(1);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type RunSupervisorInput,
|
|
3
|
+
runSupervisor,
|
|
4
|
+
type SupervisorDispatchOutcome,
|
|
5
|
+
type SupervisorRunReport,
|
|
6
|
+
type SupervisorStopReason,
|
|
7
|
+
} from "./runner.ts";
|
|
8
|
+
export {
|
|
9
|
+
assertSupervisorId,
|
|
10
|
+
type CreateSupervisorInput,
|
|
11
|
+
collectSupervisorWork,
|
|
12
|
+
createSupervisor,
|
|
13
|
+
listSupervisors,
|
|
14
|
+
newSupervisorId,
|
|
15
|
+
readSupervisor,
|
|
16
|
+
SUPERVISOR_INTENT_SCHEMA_VERSION,
|
|
17
|
+
type SupervisorAutomationPolicy,
|
|
18
|
+
type SupervisorIntent,
|
|
19
|
+
type SupervisorLimits,
|
|
20
|
+
type SupervisorNextAction,
|
|
21
|
+
type SupervisorProjection,
|
|
22
|
+
type SupervisorRecord,
|
|
23
|
+
type SupervisorState,
|
|
24
|
+
} from "./state.ts";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export {
|
|
2
|
+
assertSupervisorId,
|
|
3
|
+
collectSupervisorWork,
|
|
4
|
+
listSupervisors,
|
|
5
|
+
readSupervisor,
|
|
6
|
+
SUPERVISOR_INTENT_SCHEMA_VERSION,
|
|
7
|
+
type SupervisorAutomationPolicy,
|
|
8
|
+
type SupervisorIntent,
|
|
9
|
+
type SupervisorLimits,
|
|
10
|
+
type SupervisorNextAction,
|
|
11
|
+
type SupervisorProjection,
|
|
12
|
+
type SupervisorRecord,
|
|
13
|
+
type SupervisorState,
|
|
14
|
+
} from "./state.ts";
|