@os-eco/overstory-cli 0.7.0 → 0.7.2
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 +6 -5
- package/agents/builder.md +1 -1
- package/agents/coordinator.md +12 -11
- package/agents/lead.md +6 -6
- package/agents/monitor.md +4 -4
- package/agents/reviewer.md +1 -1
- package/agents/scout.md +5 -5
- package/agents/supervisor.md +36 -32
- package/package.json +1 -1
- package/src/agents/guard-rules.ts +97 -0
- package/src/agents/hooks-deployer.ts +7 -90
- package/src/agents/overlay.test.ts +7 -7
- package/src/agents/overlay.ts +5 -5
- package/src/commands/agents.test.ts +5 -0
- package/src/commands/clean.test.ts +3 -0
- package/src/commands/completions.ts +1 -1
- package/src/commands/coordinator.test.ts +1 -0
- package/src/commands/coordinator.ts +15 -11
- package/src/commands/costs.test.ts +5 -0
- package/src/commands/init.test.ts +1 -2
- package/src/commands/init.ts +1 -8
- package/src/commands/inspect.test.ts +14 -0
- package/src/commands/log.test.ts +14 -0
- package/src/commands/log.ts +39 -0
- package/src/commands/mail.test.ts +5 -0
- package/src/commands/monitor.ts +15 -11
- package/src/commands/nudge.test.ts +1 -0
- package/src/commands/prime.test.ts +2 -0
- package/src/commands/prime.ts +6 -2
- package/src/commands/run.test.ts +1 -0
- package/src/commands/sling.test.ts +15 -1
- package/src/commands/sling.ts +44 -21
- package/src/commands/status.test.ts +1 -0
- package/src/commands/stop.test.ts +1 -0
- package/src/commands/supervisor.ts +19 -12
- package/src/commands/trace.test.ts +1 -0
- package/src/commands/worktree.test.ts +9 -0
- package/src/config.ts +29 -0
- package/src/doctor/consistency.test.ts +14 -0
- package/src/e2e/init-sling-lifecycle.test.ts +3 -5
- package/src/index.ts +1 -1
- package/src/mail/broadcast.test.ts +1 -0
- package/src/merge/resolver.ts +23 -4
- package/src/runtimes/claude.test.ts +1 -1
- package/src/runtimes/pi-guards.test.ts +433 -0
- package/src/runtimes/pi-guards.ts +349 -0
- package/src/runtimes/pi.test.ts +620 -0
- package/src/runtimes/pi.ts +244 -0
- package/src/runtimes/registry.test.ts +33 -0
- package/src/runtimes/registry.ts +15 -2
- package/src/runtimes/types.ts +63 -0
- package/src/schema-consistency.test.ts +1 -0
- package/src/sessions/compat.ts +1 -0
- package/src/sessions/store.test.ts +31 -0
- package/src/sessions/store.ts +37 -4
- package/src/types.ts +17 -0
- package/src/watchdog/daemon.test.ts +7 -4
- package/src/watchdog/daemon.ts +1 -1
- package/src/watchdog/health.test.ts +1 -0
- package/src/watchdog/triage.ts +14 -4
package/src/watchdog/triage.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
import { readdir } from "node:fs/promises";
|
|
10
10
|
import { join } from "node:path";
|
|
11
11
|
import { AgentError } from "../errors.ts";
|
|
12
|
+
import { getRuntime } from "../runtimes/registry.ts";
|
|
13
|
+
import type { OverstoryConfig } from "../types.ts";
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Triage a stalled agent by analyzing its recent log output with Claude.
|
|
@@ -30,8 +32,10 @@ export async function triageAgent(options: {
|
|
|
30
32
|
lastActivity: string;
|
|
31
33
|
/** Timeout in ms for the Claude subprocess. Defaults to 30_000 (30s). */
|
|
32
34
|
timeoutMs?: number;
|
|
35
|
+
/** Overstory config for runtime resolution. */
|
|
36
|
+
config?: OverstoryConfig;
|
|
33
37
|
}): Promise<"retry" | "terminate" | "extend"> {
|
|
34
|
-
const { agentName, root, lastActivity, timeoutMs } = options;
|
|
38
|
+
const { agentName, root, lastActivity, timeoutMs, config } = options;
|
|
35
39
|
const logsDir = join(root, ".overstory", "logs", agentName);
|
|
36
40
|
|
|
37
41
|
let logContent: string;
|
|
@@ -45,7 +49,7 @@ export async function triageAgent(options: {
|
|
|
45
49
|
const prompt = buildTriagePrompt(agentName, lastActivity, logContent);
|
|
46
50
|
|
|
47
51
|
try {
|
|
48
|
-
const response = await spawnClaude(prompt, timeoutMs);
|
|
52
|
+
const response = await spawnClaude(prompt, timeoutMs, config);
|
|
49
53
|
return classifyResponse(response);
|
|
50
54
|
} catch {
|
|
51
55
|
// Claude not available — default to extend (safe fallback)
|
|
@@ -130,10 +134,16 @@ const DEFAULT_TRIAGE_TIMEOUT_MS = 30_000;
|
|
|
130
134
|
* @returns Claude's response text
|
|
131
135
|
* @throws Error if claude is not installed, the process fails, or the timeout is reached
|
|
132
136
|
*/
|
|
133
|
-
async function spawnClaude(
|
|
137
|
+
async function spawnClaude(
|
|
138
|
+
prompt: string,
|
|
139
|
+
timeoutMs?: number,
|
|
140
|
+
config?: OverstoryConfig,
|
|
141
|
+
): Promise<string> {
|
|
134
142
|
const timeout = timeoutMs ?? DEFAULT_TRIAGE_TIMEOUT_MS;
|
|
135
143
|
|
|
136
|
-
const
|
|
144
|
+
const runtime = getRuntime(config?.runtime?.printCommand ?? config?.runtime?.default, config);
|
|
145
|
+
const argv = runtime.buildPrintCommand(prompt);
|
|
146
|
+
const proc = Bun.spawn(argv, {
|
|
137
147
|
stdout: "pipe",
|
|
138
148
|
stderr: "pipe",
|
|
139
149
|
});
|