reevesagents 1.2.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/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/cli.js ADDED
@@ -0,0 +1,355 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ REEVESAGENTS_VERSION,
4
+ writeTuiOpenToken
5
+ } from "./chunk-DHAW6OY3.js";
6
+ import {
7
+ runDoctor
8
+ } from "./chunk-JY4ZTTRK.js";
9
+ import "./chunk-D24DQQ6V.js";
10
+ import {
11
+ PROVIDERS,
12
+ autoCleanupRuns,
13
+ computeRunStatus,
14
+ killAgent,
15
+ listAgents,
16
+ listRuns,
17
+ normalizeProvider,
18
+ peekAgent,
19
+ providerDisplayName,
20
+ readRun,
21
+ runHasLiveTmuxTarget,
22
+ startRun,
23
+ stopRun
24
+ } from "./chunk-MVMGFG4W.js";
25
+
26
+ // src/cli.ts
27
+ import { Command } from "commander";
28
+ import { execFileSync } from "child_process";
29
+
30
+ // src/utils/color-env.ts
31
+ function prepareTuiColorEnv() {
32
+ if (process.env.REEVES_NO_COLOR === "1") {
33
+ delete process.env.FORCE_COLOR;
34
+ process.env.NO_COLOR = "1";
35
+ return;
36
+ }
37
+ if (!process.env.TERM || process.env.TERM === "dumb") {
38
+ process.env.TERM = "xterm-256color";
39
+ }
40
+ if (process.env.FORCE_COLOR === void 0) {
41
+ delete process.env.NO_COLOR;
42
+ process.env.FORCE_COLOR = "3";
43
+ }
44
+ }
45
+
46
+ // src/cli.ts
47
+ process.on("uncaughtException", (err) => {
48
+ process.stderr.write(`[FATAL] ${err.message}
49
+ `);
50
+ process.exit(1);
51
+ });
52
+ var program = new Command();
53
+ program.name("reevesagents").description("local tmux-first workspace manager for AI CLI agents").version(REEVESAGENTS_VERSION);
54
+ function age(startedAt) {
55
+ const seconds = Math.max(0, Math.floor((Date.now() - new Date(startedAt).getTime()) / 1e3));
56
+ if (seconds < 60) return `${seconds}s`;
57
+ if (seconds < 3600) return `${Math.floor(seconds / 60)}m`;
58
+ return `${Math.floor(seconds / 3600)}h`;
59
+ }
60
+ function resolveRun(id) {
61
+ const runs = listRuns();
62
+ const exact = runs.find((run) => run.id === id || run.name === id);
63
+ if (exact) return exact;
64
+ const matches = runs.filter((run) => run.id.startsWith(id) || run.name.startsWith(id));
65
+ if (matches.length === 1) return matches[0];
66
+ if (matches.length > 1) throw new Error(`ambiguous run id: ${matches.map((run) => run.id).join(", ")}`);
67
+ throw new Error(`run not found: ${id}`);
68
+ }
69
+ function resolveAgent(id) {
70
+ const agents = listAgents();
71
+ const exact = agents.find((agent) => agent.id === id || agent.nickname === id);
72
+ if (exact) return exact;
73
+ const matches = agents.filter((agent) => agent.id.startsWith(id) || agent.nickname.startsWith(id));
74
+ if (matches.length === 1) return matches[0];
75
+ if (matches.length > 1) throw new Error(`ambiguous agent id: ${matches.map((agent) => agent.id).join(", ")}`);
76
+ throw new Error(`agent not found: ${id}`);
77
+ }
78
+ function resolveOpenTarget(id) {
79
+ try {
80
+ const run = resolveRun(id);
81
+ return { run, session: run.tmux_session, windowId: "reeves", label: run.name };
82
+ } catch {
83
+ const agent = resolveAgent(id);
84
+ return { run: readRun(agent.run_id), session: agent.tmux_session, windowId: agent.tmux_window_id, label: agent.nickname };
85
+ }
86
+ }
87
+ function quoteShell(s) {
88
+ if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(s)) return s;
89
+ return `'${s.replace(/'/g, "'\\''")}'`;
90
+ }
91
+ function tmuxAttachCommand(session, windowId) {
92
+ return `tmux select-window -t ${quoteShell(`${session}:${windowId}`)} && tmux attach -t ${quoteShell(session)}`;
93
+ }
94
+ function tmuxSessionExists(session) {
95
+ try {
96
+ execFileSync("tmux", ["has-session", "-t", session], { stdio: "ignore" });
97
+ return true;
98
+ } catch {
99
+ return false;
100
+ }
101
+ }
102
+ function tmuxWindowIds(session) {
103
+ try {
104
+ return execFileSync("tmux", ["list-windows", "-t", session, "-F", "#{window_id}"], { encoding: "utf8" }).split("\n").map((line) => line.trim()).filter(Boolean);
105
+ } catch {
106
+ return [];
107
+ }
108
+ }
109
+ function tmuxWindowByName(session, name) {
110
+ try {
111
+ const rows = execFileSync("tmux", ["list-windows", "-t", session, "-F", "#{window_id} #{window_name} #{pane_current_command}"], { encoding: "utf8" }).split("\n").map((line) => line.trim()).filter(Boolean);
112
+ for (const row of rows) {
113
+ const [windowId, windowName, command = ""] = row.split(" ");
114
+ if (windowId && windowName === name) return { id: windowId, command };
115
+ }
116
+ } catch {
117
+ }
118
+ return null;
119
+ }
120
+ function isTuiCommand(command) {
121
+ return command === "node" || command === "reevesagents";
122
+ }
123
+ function clearTuiSessionExcept(session, keepWindowId) {
124
+ for (const windowId of tmuxWindowIds(session)) {
125
+ if (windowId === keepWindowId) continue;
126
+ try {
127
+ execFileSync("tmux", ["kill-window", "-t", windowId], { stdio: "ignore" });
128
+ } catch {
129
+ }
130
+ }
131
+ }
132
+ function createTuiWindow(session, window, command) {
133
+ return execFileSync("tmux", [
134
+ "new-window",
135
+ "-d",
136
+ "-P",
137
+ "-F",
138
+ "#{window_id}",
139
+ "-t",
140
+ session,
141
+ "-n",
142
+ window,
143
+ command
144
+ ], { encoding: "utf8" }).trim();
145
+ }
146
+ function openTuiSession(command) {
147
+ const session = "reeves";
148
+ const window = "reeves";
149
+ if (!tmuxSessionExists(session)) {
150
+ execFileSync("tmux", ["new-session", "-s", session, "-n", window, command], { stdio: "inherit" });
151
+ return;
152
+ }
153
+ const existing = tmuxWindowByName(session, window);
154
+ if (existing && !isTuiCommand(existing.command)) {
155
+ try {
156
+ execFileSync("tmux", ["kill-window", "-t", existing.id], { stdio: "ignore" });
157
+ } catch {
158
+ }
159
+ }
160
+ const windowId = existing && isTuiCommand(existing.command) ? existing.id : createTuiWindow(session, window, command);
161
+ execFileSync("tmux", ["select-window", "-t", windowId], { stdio: "ignore" });
162
+ clearTuiSessionExcept(session, windowId);
163
+ execFileSync("tmux", ["attach", "-t", session], { stdio: "inherit" });
164
+ }
165
+ function openTarget(id) {
166
+ const target = resolveOpenTarget(id);
167
+ const tmuxTarget = `${target.session}:${target.windowId}`;
168
+ if (process.env.TMUX) {
169
+ execFileSync("tmux", ["switch-client", "-t", tmuxTarget], { stdio: "ignore" });
170
+ execFileSync("tmux", ["select-window", "-t", tmuxTarget], { stdio: "ignore" });
171
+ return;
172
+ }
173
+ try {
174
+ execFileSync("tmux", ["select-window", "-t", tmuxTarget], { stdio: "ignore" });
175
+ } catch {
176
+ }
177
+ if (process.stdin.isTTY && process.stdout.isTTY) {
178
+ execFileSync("tmux", ["attach", "-t", target.session], { stdio: "inherit" });
179
+ return;
180
+ }
181
+ console.log(tmuxAttachCommand(target.session, target.windowId));
182
+ }
183
+ function destructiveAllowed(opts) {
184
+ return opts.yes === true || process.env.ALLOW_DESTRUCTIVE === "1";
185
+ }
186
+ function requireDestructiveConfirmation(opts, command) {
187
+ if (destructiveAllowed(opts)) return;
188
+ throw new Error(`refusing to ${command} without --yes or ALLOW_DESTRUCTIVE=1`);
189
+ }
190
+ function parseAgentSpec(spec) {
191
+ const [providerRaw = "", nickname, model = ""] = spec.split(":");
192
+ const provider = normalizeProvider(providerRaw);
193
+ if (!provider) {
194
+ throw new Error(`agent spec must start with a supported provider name: ${PROVIDERS.map(providerDisplayName).join(", ")}: ${spec}`);
195
+ }
196
+ return { provider, nickname: nickname || void 0, model };
197
+ }
198
+ program.command("spawn [agent...]").description("start a run with one or more provider agents").option("--name <name>", "run name", "run").option("--cwd <dir>", "working directory", process.cwd()).option("--prompt <text>", "initial prompt pasted into each agent", "").action((agentSpecs, opts) => {
199
+ try {
200
+ const specs = agentSpecs.length > 0 ? agentSpecs : ["codex"];
201
+ const [first, ...rest] = specs.map(parseAgentSpec);
202
+ const result = startRun({
203
+ mode: "spawner",
204
+ name: opts.name,
205
+ working_dir: opts.cwd,
206
+ root: {
207
+ provider: first.provider,
208
+ nickname: first.nickname,
209
+ model: first.model,
210
+ task: opts.prompt
211
+ },
212
+ workers: rest.map((spec) => ({
213
+ provider: spec.provider,
214
+ nickname: spec.nickname,
215
+ model: spec.model,
216
+ task: opts.prompt
217
+ }))
218
+ });
219
+ console.log(`started ${result.run.id.slice(0, 8)} ${result.run.name} ${result.agents.length} agents`);
220
+ } catch (err) {
221
+ console.error(err instanceof Error ? err.message : String(err));
222
+ process.exit(1);
223
+ }
224
+ });
225
+ program.command("runs").description("list runs").option("--json", "output JSON array").action((opts) => {
226
+ autoCleanupRuns();
227
+ const runs = listRuns().map((run) => ({ ...run, view_status: computeRunStatus(run, runHasLiveTmuxTarget(run)) }));
228
+ if (opts.json) {
229
+ console.log(JSON.stringify(runs, null, 2));
230
+ return;
231
+ }
232
+ if (runs.length === 0) {
233
+ console.log("no runs");
234
+ return;
235
+ }
236
+ for (const run of runs) {
237
+ const agents = listAgents(run.id);
238
+ const root = agents.find((agent) => agent.role === "root");
239
+ const note = agents.find((agent) => agent.task_note.trim())?.task_note ?? "";
240
+ const rootProvider = root ? providerDisplayName(root.provider) : "-";
241
+ console.log(`${run.id.slice(0, 8)} ${run.view_status.padEnd(7)} ${"agent run".padEnd(9)} ${rootProvider.padEnd(14)} ${String(agents.length).padStart(2)} ${"agents".padEnd(9)} ${age(run.started_at).padEnd(4)} ${run.name} ${run.working_dir}${note ? ` ${note}` : ""}`);
242
+ }
243
+ });
244
+ program.command("open <id>").description("open a run tmux tab set or an agent window").action((id) => {
245
+ openTarget(id);
246
+ });
247
+ program.command("peek <agent-id>").description("show recent output from one agent").option("-n, --lines <n>", "number of lines", "20").option("--json", "output JSON with lines array").action((id, opts) => {
248
+ const agent = resolveAgent(id);
249
+ const lines = Number.parseInt(opts.lines, 10);
250
+ const output = peekAgent(agent.id, Number.isFinite(lines) ? lines : 20);
251
+ if (opts.json) {
252
+ console.log(JSON.stringify({ agent_id: agent.id, lines: output ? output.split("\n") : [] }, null, 2));
253
+ return;
254
+ }
255
+ if (!output) {
256
+ console.error(`no output for agent ${agent.id}`);
257
+ process.exit(1);
258
+ }
259
+ console.log(output);
260
+ });
261
+ program.command("stop <run-id>").description("stop one run").option("-y, --yes", "confirm stop").action((id, opts) => {
262
+ requireDestructiveConfirmation(opts, "stop run");
263
+ const run = resolveRun(id);
264
+ const stopped = stopRun(run.id);
265
+ console.log(`stopped ${stopped.id.slice(0, 8)} ${stopped.name}`);
266
+ });
267
+ program.command("kill <agent-id>").description("stop one agent").option("-y, --yes", "confirm stop").action((id, opts) => {
268
+ requireDestructiveConfirmation(opts, "stop agent");
269
+ const agent = resolveAgent(id);
270
+ const killed = killAgent(agent.id);
271
+ console.log(`stopped ${killed.id.slice(0, 8)} ${killed.nickname}`);
272
+ });
273
+ program.command("doctor").description("run setup and environment health checks").option("--json", "output JSON").action((opts) => {
274
+ const result = runDoctor();
275
+ const anyFail = result.checks.some((check) => check.status === "fail");
276
+ if (opts.json) {
277
+ console.log(JSON.stringify({ ok: !anyFail, checks: result.checks }, null, 2));
278
+ } else {
279
+ for (const check of result.checks) {
280
+ console.log(`${check.status.toUpperCase().padEnd(4)} ${check.name.padEnd(14)} ${check.detail}`);
281
+ }
282
+ }
283
+ process.exit(anyFail ? 1 : 0);
284
+ });
285
+ program.command("web").description("start the on-demand loopback web UI for agents").option("--port <n>", "preferred port; falls back to the next free port").option("--no-open", "do not open the browser").option("--prebeta-orchestrator", "enable PRE-BETA orchestrator/MCP run controls when the separate package is installed").action((opts) => {
286
+ runWeb(opts).catch((err) => {
287
+ console.error(err instanceof Error ? err.message : String(err));
288
+ process.exit(1);
289
+ });
290
+ });
291
+ async function runWeb(opts) {
292
+ const { checkWebExtras, webExtrasMessage } = await import("./extras-25AF6TAR.js");
293
+ const extras = await checkWebExtras();
294
+ if (!extras.ok) {
295
+ console.error(webExtrasMessage(extras.missing));
296
+ process.exit(1);
297
+ }
298
+ const { startWebServer } = await import("./server-Z2YTGWSX.js");
299
+ const parsed = opts.port ? Number.parseInt(opts.port, 10) : void 0;
300
+ const handle = await startWebServer({
301
+ port: parsed !== void 0 && Number.isFinite(parsed) ? parsed : void 0,
302
+ open: opts.open !== false,
303
+ prebetaOrchestrator: opts.prebetaOrchestrator === true
304
+ });
305
+ console.log(`reevesagents web running at ${handle.url}`);
306
+ if (opts.prebetaOrchestrator) console.log("PRE-BETA orchestrator/MCP controls enabled.");
307
+ console.log("press Ctrl+C to stop. agents keep running.");
308
+ const shutdown = () => {
309
+ handle.close().finally(() => process.exit(0));
310
+ };
311
+ process.on("SIGINT", shutdown);
312
+ process.on("SIGTERM", shutdown);
313
+ }
314
+ var knownSubcommands = new Set(program.commands.map((command) => command.name()));
315
+ var firstArg = process.argv[2];
316
+ async function renderTui() {
317
+ prepareTuiColorEnv();
318
+ const [{ default: React }, { render }, { Router }] = await Promise.all([
319
+ import("react"),
320
+ import("ink"),
321
+ import("./router-WCFLHJV7.js")
322
+ ]);
323
+ try {
324
+ await render(React.createElement(Router), { alternateScreen: false }).waitUntilExit();
325
+ } finally {
326
+ const { closeTuiWebServer } = await import("./tui-launch-7RGFE5KY.js");
327
+ await closeTuiWebServer();
328
+ }
329
+ process.exit(0);
330
+ }
331
+ if (!firstArg || !knownSubcommands.has(firstArg) && !firstArg.startsWith("--")) {
332
+ if (!process.env.TMUX && process.stdout.isTTY && !process.env.REEVES_NO_TMUX_WRAPPER) {
333
+ const wrapperCmd = [process.argv[0], process.argv[1]].filter((arg) => typeof arg === "string").map((arg) => `'${arg.replace(/'/g, "'\\''")}'`).join(" ");
334
+ try {
335
+ writeTuiOpenToken();
336
+ openTuiSession(wrapperCmd);
337
+ process.exit(0);
338
+ } catch (err) {
339
+ process.stderr.write("reevesagents requires tmux. Install tmux (brew install tmux / apt install tmux) or set REEVES_NO_TMUX_WRAPPER=1 to run without it.\n");
340
+ process.stderr.write(`tmux launch error: ${err instanceof Error ? err.message : String(err)}
341
+ `);
342
+ process.exit(1);
343
+ }
344
+ }
345
+ process.on("SIGTERM", () => process.exit(0));
346
+ if (process.stdout.isTTY) process.stdout.write("\x1B[2J\x1B[H");
347
+ renderTui().catch((err) => {
348
+ process.stderr.write(`[FATAL] ${err instanceof Error ? err.message : String(err)}
349
+ `);
350
+ process.exit(1);
351
+ });
352
+ } else {
353
+ program.parse();
354
+ }
355
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ WEB_EXTRA_MODULES,
4
+ checkWebExtras,
5
+ webExtrasMessage
6
+ } from "./chunk-D24DQQ6V.js";
7
+ export {
8
+ WEB_EXTRA_MODULES,
9
+ checkWebExtras,
10
+ webExtrasMessage
11
+ };
12
+ //# sourceMappingURL=extras-25AF6TAR.js.map
@@ -0,0 +1,236 @@
1
+ import { Component, ReactNode } from 'react';
2
+
3
+ interface Props {
4
+ children: ReactNode;
5
+ }
6
+ interface State {
7
+ hasError: boolean;
8
+ error: Error | null;
9
+ }
10
+ declare class ErrorBoundary extends Component<Props, State> {
11
+ constructor(props: Props);
12
+ static getDerivedStateFromError(error: Error): State;
13
+ componentDidCatch(error: Error): void;
14
+ render(): ReactNode;
15
+ }
16
+
17
+ type Provider = 'cc' | 'codex' | 'opencode' | 'hermes' | 'kimi' | 'deepseek' | 'pi' | 'qwen' | 'aider';
18
+ type LanguageCode = 'en' | 'de' | 'fr' | 'es' | 'pt' | 'it' | 'tr' | 'zh-Hans' | 'ar';
19
+ type Permissions = 'skip' | 'ask';
20
+ type TaskStatus = 'queued' | 'working' | 'done' | 'failed' | 'blocked';
21
+ type AuthMode = 'default' | 'api-key';
22
+ type Effort = 'default' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
23
+ type AgentRole = 'root' | 'worker';
24
+ type RunStatus = 'running' | 'ended';
25
+ type RunViewStatus = RunStatus | 'stale';
26
+ type RunMode = 'spawner' | 'orchestrator';
27
+ type RunHistoryStatus = 'ended' | 'stale';
28
+ type ScreenName = 'Welcome' | 'LanguageSelect' | 'Runs' | 'RunHistory' | 'Run' | 'RunAgents' | 'RunOutput' | 'RunStop' | 'AgentDetail' | 'AgentOutput' | 'AgentTask' | 'AgentKill' | 'NewRun' | 'NewRunBasics' | 'NewRunRoot' | 'NewRunWorkers' | 'NewRunWorker' | 'NewRunReview' | 'NewRunStarting' | 'AddWorker' | 'Settings' | 'Reference' | 'Credits' | 'Doctor' | 'DoctorCheck';
29
+ interface Message {
30
+ id: string;
31
+ from_id: string;
32
+ text: string;
33
+ sent_at: string;
34
+ read: boolean;
35
+ }
36
+ interface RunRecord {
37
+ id: string;
38
+ mode?: string;
39
+ name: string;
40
+ status: RunStatus;
41
+ tmux_session: string;
42
+ reeves_session?: string;
43
+ reeves_window_id: string;
44
+ reeves_pane_id: string;
45
+ root_agent_id: string;
46
+ working_dir: string;
47
+ preset_name: string | null;
48
+ started_at: string;
49
+ ended_at: string | null;
50
+ }
51
+ interface RunHistoryRecord {
52
+ id: string;
53
+ name: string;
54
+ mode: RunMode;
55
+ status: RunHistoryStatus;
56
+ working_dir: string;
57
+ started_at: string;
58
+ ended_at: string | null;
59
+ archived_at: string;
60
+ agent_count: number;
61
+ root_provider: Provider | null;
62
+ }
63
+ interface AgentRecord {
64
+ id: string;
65
+ run_id: string;
66
+ nickname: string;
67
+ provider: Provider;
68
+ model: string;
69
+ role: AgentRole;
70
+ working_dir: string;
71
+ task: string;
72
+ task_status: TaskStatus;
73
+ task_note: string;
74
+ tmux_session: string;
75
+ tmux_window_id: string;
76
+ tmux_pane_id: string;
77
+ rc_enabled: boolean;
78
+ permissions: Permissions;
79
+ headless?: boolean;
80
+ inbox: Message[];
81
+ last_seen: number;
82
+ started_at: string;
83
+ ended_at: string | null;
84
+ }
85
+ interface SavedTreeSlot {
86
+ nickname_template: string;
87
+ provider: Provider;
88
+ model: string;
89
+ auth_mode: AuthMode;
90
+ effort: Effort;
91
+ initial_prompt: string;
92
+ working_dir: string;
93
+ permissions: Permissions;
94
+ rc_enabled: boolean;
95
+ }
96
+ interface SavedTree {
97
+ name: string;
98
+ description: string;
99
+ root: SavedTreeSlot;
100
+ workers: SavedTreeSlot[];
101
+ working_dir_pattern?: string;
102
+ created_at: string;
103
+ updated_at: string;
104
+ }
105
+ interface CheckResult {
106
+ name: string;
107
+ status: 'ok' | 'warn' | 'fail';
108
+ detail: string;
109
+ }
110
+ interface RouterContextValue {
111
+ screen: ScreenName;
112
+ push: (_screen: ScreenName) => void;
113
+ pop: () => void;
114
+ forward: () => void;
115
+ replace: (_screen: ScreenName) => void;
116
+ resetStack: (_screen: ScreenName, _base?: ScreenName[]) => void;
117
+ selectedRunId: string | null;
118
+ setSelectedRunId: (_runId: string | null) => void;
119
+ selectedAgentId: string | null;
120
+ setSelectedAgentId: (_agentId: string | null) => void;
121
+ selectedCheckName: string | null;
122
+ setSelectedCheckName: (_name: string | null) => void;
123
+ selectedWorkerIdx: number | null;
124
+ setSelectedWorkerIdx: (_idx: number | null) => void;
125
+ canBack: boolean;
126
+ canForward: boolean;
127
+ }
128
+ interface GlobalConfig {
129
+ peek_interval_ms: number;
130
+ peek_lines: number;
131
+ max_depth: number;
132
+ max_agents: number;
133
+ ready_delay_ms: number;
134
+ default_permissions: Permissions;
135
+ language: LanguageCode;
136
+ }
137
+ interface Config {
138
+ version: number;
139
+ global: GlobalConfig;
140
+ }
141
+
142
+ interface AgentLaunchConfig {
143
+ nickname?: string;
144
+ provider: Provider;
145
+ model: string;
146
+ auth_mode?: AuthMode;
147
+ effort?: Effort;
148
+ task: string;
149
+ working_dir?: string;
150
+ permissions?: Permissions;
151
+ rc_enabled?: boolean;
152
+ }
153
+ interface StartRunRequest {
154
+ mode?: 'spawner';
155
+ name: string;
156
+ working_dir: string;
157
+ root: AgentLaunchConfig;
158
+ workers?: AgentLaunchConfig[];
159
+ preset_name?: string | null;
160
+ ready_delay_ms?: number;
161
+ }
162
+ interface RuntimeDriver {
163
+ tmux(_args: string[], _input?: string): string;
164
+ delay(_fn: () => void, _ms: number): void;
165
+ }
166
+ interface RuntimeOptions {
167
+ driver?: RuntimeDriver;
168
+ available?: Record<Provider, boolean>;
169
+ }
170
+ declare function startRun(request: StartRunRequest, options?: RuntimeOptions): {
171
+ run: RunRecord;
172
+ agents: AgentRecord[];
173
+ };
174
+ declare function openReeves(runId: string, options?: RuntimeOptions): void;
175
+ declare function openRunTabs(runId: string, options?: RuntimeOptions): void;
176
+ declare function openAgent(agentId: string, options?: RuntimeOptions): void;
177
+ declare function peekAgent(agentId: string, lines?: number, options?: RuntimeOptions): string;
178
+ declare function killAgent(agentId: string, options?: RuntimeOptions): AgentRecord;
179
+ declare function stopRun(runId: string, options?: RuntimeOptions): RunRecord;
180
+
181
+ interface DoctorResult {
182
+ checks: CheckResult[];
183
+ }
184
+ declare function runDoctor(): DoctorResult;
185
+
186
+ interface BuildCommandOptions {
187
+ provider: Provider;
188
+ permissions: Permissions;
189
+ model: string;
190
+ auth_mode?: AuthMode;
191
+ effort?: Effort;
192
+ rc_enabled?: boolean;
193
+ }
194
+ declare const BIN: Record<Provider, string>;
195
+ declare const PROVIDERS: Provider[];
196
+ declare function isProvider(value: unknown): value is Provider;
197
+ declare function normalizeProvider(value: unknown): Provider | null;
198
+ declare function buildCommand(opts: BuildCommandOptions): string[];
199
+ declare function detectAvailable(): Record<Provider, boolean>;
200
+
201
+ interface ProviderModelCatalog {
202
+ source: string;
203
+ models: readonly string[];
204
+ }
205
+ declare const PROVIDER_DEFAULT_MODEL = "";
206
+ declare const PROVIDER_DEFAULT_MODEL_LABEL = "provider default";
207
+ declare const MODEL_CATALOG: Record<Provider, ProviderModelCatalog>;
208
+ declare function modelValuesForProvider(provider: Provider): readonly string[];
209
+ declare function modelDisplayName(model: string): string;
210
+ declare function modelSourceForProvider(provider: Provider): string;
211
+
212
+ declare function stateRoot(): string;
213
+ declare function runsDir(): string;
214
+ declare function nowIso(): string;
215
+ declare function readRun(runId: string): RunRecord;
216
+ declare function listRuns(): RunRecord[];
217
+ interface RunHistoryOptions {
218
+ includeAllModes?: boolean;
219
+ }
220
+ declare function listRunHistory(options?: RunHistoryOptions): RunHistoryRecord[];
221
+ declare function computeRunStatus(run: RunRecord, tmuxSessionExists?: boolean): RunViewStatus;
222
+ declare function readAgent(runId: string, agentId: string): AgentRecord;
223
+ declare function listAgents(runId?: string): AgentRecord[];
224
+
225
+ declare function defaultConfig(): Config;
226
+ declare function loadConfig(): Config;
227
+ declare function saveConfig(cfg: Config): string;
228
+
229
+ declare function savedTreesDir(): string;
230
+ declare const presetsDir: typeof savedTreesDir;
231
+ declare function listSavedTrees(): SavedTree[];
232
+ declare function loadSavedTree(name: string): SavedTree | null;
233
+ declare function saveSavedTree(tree: SavedTree): void;
234
+ declare function deleteSavedTree(name: string): void;
235
+
236
+ export { type AgentRecord, type AuthMode, BIN, type CheckResult, type Config, type Effort, ErrorBoundary, type GlobalConfig, MODEL_CATALOG, type Message, PROVIDERS, PROVIDER_DEFAULT_MODEL, PROVIDER_DEFAULT_MODEL_LABEL, type Permissions, type Provider, type RouterContextValue, type RunHistoryRecord, type RunHistoryStatus, type RunRecord, type ScreenName, type TaskStatus, buildCommand, computeRunStatus, defaultConfig, deleteSavedTree, detectAvailable, isProvider, killAgent, listAgents, listRunHistory, listRuns, listSavedTrees, loadConfig, loadSavedTree, modelDisplayName, modelSourceForProvider, modelValuesForProvider, normalizeProvider, nowIso, openAgent, openReeves, openRunTabs, peekAgent, presetsDir, readAgent, readRun, runDoctor, runsDir, saveConfig, saveSavedTree, startRun, stateRoot, stopRun };
package/dist/index.js ADDED
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ ErrorBoundary,
4
+ deleteSavedTree,
5
+ listSavedTrees,
6
+ loadSavedTree,
7
+ presetsDir,
8
+ saveSavedTree
9
+ } from "./chunk-3IXII4H5.js";
10
+ import {
11
+ runDoctor
12
+ } from "./chunk-JY4ZTTRK.js";
13
+ import "./chunk-D24DQQ6V.js";
14
+ import {
15
+ MODEL_CATALOG,
16
+ PROVIDER_DEFAULT_MODEL,
17
+ PROVIDER_DEFAULT_MODEL_LABEL,
18
+ modelDisplayName,
19
+ modelSourceForProvider,
20
+ modelValuesForProvider
21
+ } from "./chunk-LUW6GCPO.js";
22
+ import {
23
+ BIN,
24
+ PROVIDERS,
25
+ buildCommand,
26
+ computeRunStatus,
27
+ defaultConfig,
28
+ detectAvailable,
29
+ isProvider,
30
+ killAgent,
31
+ listAgents,
32
+ listRunHistory,
33
+ listRuns,
34
+ loadConfig,
35
+ normalizeProvider,
36
+ nowIso,
37
+ openAgent,
38
+ openReeves,
39
+ openRunTabs,
40
+ peekAgent,
41
+ readAgent,
42
+ readRun,
43
+ runsDir,
44
+ saveConfig,
45
+ startRun,
46
+ stateRoot,
47
+ stopRun
48
+ } from "./chunk-MVMGFG4W.js";
49
+ export {
50
+ BIN,
51
+ ErrorBoundary,
52
+ MODEL_CATALOG,
53
+ PROVIDERS,
54
+ PROVIDER_DEFAULT_MODEL,
55
+ PROVIDER_DEFAULT_MODEL_LABEL,
56
+ buildCommand,
57
+ computeRunStatus,
58
+ defaultConfig,
59
+ deleteSavedTree,
60
+ detectAvailable,
61
+ isProvider,
62
+ killAgent,
63
+ listAgents,
64
+ listRunHistory,
65
+ listRuns,
66
+ listSavedTrees,
67
+ loadConfig,
68
+ loadSavedTree,
69
+ modelDisplayName,
70
+ modelSourceForProvider,
71
+ modelValuesForProvider,
72
+ normalizeProvider,
73
+ nowIso,
74
+ openAgent,
75
+ openReeves,
76
+ openRunTabs,
77
+ peekAgent,
78
+ presetsDir,
79
+ readAgent,
80
+ readRun,
81
+ runDoctor,
82
+ runsDir,
83
+ saveConfig,
84
+ saveSavedTree,
85
+ startRun,
86
+ stateRoot,
87
+ stopRun
88
+ };
89
+ //# sourceMappingURL=index.js.map