reevesagents 1.2.0 → 1.3.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/CHANGELOG.md +41 -0
- package/README.ar.md +397 -0
- package/README.de.md +406 -0
- package/README.es.md +418 -0
- package/README.fr.md +340 -0
- package/README.it.md +400 -0
- package/README.md +290 -171
- package/README.pt.md +417 -0
- package/README.ru.md +401 -0
- package/README.tr.md +415 -0
- package/README.zh-Hans.md +340 -0
- package/dist/chunk-4LWTEYRI.js +4878 -0
- package/dist/chunk-4W6MVOPK.js +29 -0
- package/dist/{chunk-4Q3JF22J.js → chunk-5DOCQLT7.js} +2 -2
- package/dist/{chunk-MVMGFG4W.js → chunk-65LHCGPC.js} +836 -263
- package/dist/chunk-D24DQQ6V.js +0 -0
- package/dist/chunk-HS6TOISU.js +30 -0
- package/dist/chunk-Z2JHNE7V.js +317 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +374 -45
- package/dist/extras-25AF6TAR.js +0 -0
- package/dist/index.d.ts +13 -37
- package/dist/index.js +13 -19
- package/dist/open-browser-DRSIJQ37.js +0 -0
- package/dist/{router-WCFLHJV7.js → router-I4WDR7CD.js} +1478 -764
- package/dist/server-H2XEJQYT.js +622 -0
- package/dist/{server-Z2YTGWSX.js → server-ZJKAIRL5.js} +261 -135
- package/dist/{tui-launch-7RGFE5KY.js → tui-launch-VHLX6JOW.js} +2 -2
- package/dist/web/app.css +321 -13
- package/dist/web/app.js +626 -51
- package/dist/web/index.html +115 -10
- package/package.json +22 -18
- package/dist/chunk-3IXII4H5.js +0 -129
- package/dist/chunk-DHAW6OY3.js +0 -40
- package/dist/chunk-G6FN75ZW.js +0 -2393
- package/dist/chunk-JY4ZTTRK.js +0 -172
- package/dist/chunk-LUW6GCPO.js +0 -108
package/dist/cli.js
CHANGED
|
@@ -1,31 +1,61 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
REEVESAGENTS_VERSION,
|
|
4
3
|
writeTuiOpenToken
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4W6MVOPK.js";
|
|
6
5
|
import {
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-D24DQQ6V.js";
|
|
6
|
+
MODEL_CATALOG
|
|
7
|
+
} from "./chunk-HS6TOISU.js";
|
|
10
8
|
import {
|
|
9
|
+
REEVESAGENTS_VERSION,
|
|
10
|
+
attach,
|
|
11
|
+
attachAll,
|
|
12
|
+
detach,
|
|
13
|
+
hostStatus,
|
|
14
|
+
listRunApprovals,
|
|
15
|
+
resolveRunApproval
|
|
16
|
+
} from "./chunk-Z2JHNE7V.js";
|
|
17
|
+
import {
|
|
18
|
+
ALLOWED_KEYS,
|
|
19
|
+
CONFIG_FIELDS,
|
|
11
20
|
PROVIDERS,
|
|
21
|
+
archiveAndRemoveRun,
|
|
12
22
|
autoCleanupRuns,
|
|
13
23
|
computeRunStatus,
|
|
24
|
+
deleteAgent,
|
|
25
|
+
deletePreset,
|
|
26
|
+
deleteRunHistory,
|
|
27
|
+
detectAvailable,
|
|
28
|
+
interrupt,
|
|
14
29
|
killAgent,
|
|
15
30
|
listAgents,
|
|
31
|
+
listPresets,
|
|
32
|
+
listRunHistory,
|
|
16
33
|
listRuns,
|
|
34
|
+
loadConfig,
|
|
17
35
|
normalizeProvider,
|
|
36
|
+
parseConfigValue,
|
|
18
37
|
peekAgent,
|
|
38
|
+
providerColor,
|
|
19
39
|
providerDisplayName,
|
|
20
40
|
readRun,
|
|
41
|
+
runDoctor,
|
|
21
42
|
runHasLiveTmuxTarget,
|
|
43
|
+
savePresetFromRun,
|
|
44
|
+
sendKey,
|
|
45
|
+
sendText,
|
|
46
|
+
setConfigValues,
|
|
47
|
+
spawnWorker,
|
|
22
48
|
startRun,
|
|
49
|
+
startRunFromPreset,
|
|
23
50
|
stopRun
|
|
24
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-65LHCGPC.js";
|
|
52
|
+
import "./chunk-D24DQQ6V.js";
|
|
25
53
|
|
|
26
54
|
// src/cli.ts
|
|
27
55
|
import { Command } from "commander";
|
|
28
56
|
import { execFileSync } from "child_process";
|
|
57
|
+
import { realpathSync } from "fs";
|
|
58
|
+
import { fileURLToPath } from "url";
|
|
29
59
|
|
|
30
60
|
// src/utils/color-env.ts
|
|
31
61
|
function prepareTuiColorEnv() {
|
|
@@ -44,11 +74,6 @@ function prepareTuiColorEnv() {
|
|
|
44
74
|
}
|
|
45
75
|
|
|
46
76
|
// src/cli.ts
|
|
47
|
-
process.on("uncaughtException", (err) => {
|
|
48
|
-
process.stderr.write(`[FATAL] ${err.message}
|
|
49
|
-
`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
});
|
|
52
77
|
var program = new Command();
|
|
53
78
|
program.name("reevesagents").description("local tmux-first workspace manager for AI CLI agents").version(REEVESAGENTS_VERSION);
|
|
54
79
|
function age(startedAt) {
|
|
@@ -195,25 +220,60 @@ function parseAgentSpec(spec) {
|
|
|
195
220
|
}
|
|
196
221
|
return { provider, nickname: nickname || void 0, model };
|
|
197
222
|
}
|
|
198
|
-
|
|
223
|
+
var EFFORT_LEVELS = ["default", "low", "medium", "high", "xhigh", "max"];
|
|
224
|
+
function parseAuthModeOpt(value) {
|
|
225
|
+
if (value === void 0) return void 0;
|
|
226
|
+
if (value === "default" || value === "api-key") return value;
|
|
227
|
+
throw new Error("--auth-mode must be default or api-key");
|
|
228
|
+
}
|
|
229
|
+
function parseEffortOpt(value) {
|
|
230
|
+
if (value === void 0) return void 0;
|
|
231
|
+
if (EFFORT_LEVELS.includes(value)) return value;
|
|
232
|
+
throw new Error(`--effort must be one of ${EFFORT_LEVELS.join(", ")}`);
|
|
233
|
+
}
|
|
234
|
+
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", "").option("--skip", "skip permission prompts for every agent (sets permissions to skip)").option("--run <run-id>", "add the agents to an existing run instead of starting a new one").option("--auth-mode <mode>", "auth mode for every agent: default or api-key").option("--effort <level>", "reasoning effort for every agent: default, low, medium, high, xhigh, max").action((agentSpecs, opts) => {
|
|
199
235
|
try {
|
|
200
236
|
const specs = agentSpecs.length > 0 ? agentSpecs : ["codex"];
|
|
201
|
-
const
|
|
237
|
+
const parsed = specs.map(parseAgentSpec);
|
|
238
|
+
const permissions = opts.skip ? "skip" : void 0;
|
|
239
|
+
const auth_mode = parseAuthModeOpt(opts.authMode);
|
|
240
|
+
const effort = parseEffortOpt(opts.effort);
|
|
241
|
+
if (opts.run) {
|
|
242
|
+
const run = resolveRun(opts.run);
|
|
243
|
+
const agents = parsed.map((spec) => spawnWorker({
|
|
244
|
+
run_id: run.id,
|
|
245
|
+
provider: spec.provider,
|
|
246
|
+
nickname: spec.nickname,
|
|
247
|
+
model: spec.model,
|
|
248
|
+
task: opts.prompt,
|
|
249
|
+
permissions,
|
|
250
|
+
auth_mode,
|
|
251
|
+
effort
|
|
252
|
+
}));
|
|
253
|
+
console.log(`added ${agents.length} agents to ${run.id.slice(0, 8)} ${run.name}`);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const [first, ...rest] = parsed;
|
|
202
257
|
const result = startRun({
|
|
203
|
-
mode: "spawner",
|
|
204
258
|
name: opts.name,
|
|
205
259
|
working_dir: opts.cwd,
|
|
206
260
|
root: {
|
|
207
261
|
provider: first.provider,
|
|
208
262
|
nickname: first.nickname,
|
|
209
263
|
model: first.model,
|
|
210
|
-
task: opts.prompt
|
|
264
|
+
task: opts.prompt,
|
|
265
|
+
permissions,
|
|
266
|
+
auth_mode,
|
|
267
|
+
effort
|
|
211
268
|
},
|
|
212
269
|
workers: rest.map((spec) => ({
|
|
213
270
|
provider: spec.provider,
|
|
214
271
|
nickname: spec.nickname,
|
|
215
272
|
model: spec.model,
|
|
216
|
-
task: opts.prompt
|
|
273
|
+
task: opts.prompt,
|
|
274
|
+
permissions,
|
|
275
|
+
auth_mode,
|
|
276
|
+
effort
|
|
217
277
|
}))
|
|
218
278
|
});
|
|
219
279
|
console.log(`started ${result.run.id.slice(0, 8)} ${result.run.name} ${result.agents.length} agents`);
|
|
@@ -270,6 +330,160 @@ program.command("kill <agent-id>").description("stop one agent").option("-y, --y
|
|
|
270
330
|
const killed = killAgent(agent.id);
|
|
271
331
|
console.log(`stopped ${killed.id.slice(0, 8)} ${killed.nickname}`);
|
|
272
332
|
});
|
|
333
|
+
program.command("send <agent-id> <text...>").description("paste text into an agent").action((id, textParts) => {
|
|
334
|
+
try {
|
|
335
|
+
const agent = resolveAgent(id);
|
|
336
|
+
sendText(agent.id, textParts.join(" "));
|
|
337
|
+
console.log(`sent to ${agent.id.slice(0, 8)} ${agent.nickname}`);
|
|
338
|
+
} catch (err) {
|
|
339
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
340
|
+
process.exit(1);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
program.command("key <agent-id> <key>").description(`send a single keypress to an agent (${ALLOWED_KEYS.join(", ")})`).action((id, key) => {
|
|
344
|
+
try {
|
|
345
|
+
const agent = resolveAgent(id);
|
|
346
|
+
if (!ALLOWED_KEYS.includes(key)) {
|
|
347
|
+
throw new Error(`unsupported key: ${key} (allowed: ${ALLOWED_KEYS.join(", ")})`);
|
|
348
|
+
}
|
|
349
|
+
sendKey(agent.id, key);
|
|
350
|
+
console.log(`sent ${key} to ${agent.id.slice(0, 8)} ${agent.nickname}`);
|
|
351
|
+
} catch (err) {
|
|
352
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
353
|
+
process.exit(1);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
program.command("interrupt <agent-id>").description("send an interrupt (ctrl-c) to an agent").action((id) => {
|
|
357
|
+
try {
|
|
358
|
+
const agent = resolveAgent(id);
|
|
359
|
+
interrupt(agent.id);
|
|
360
|
+
console.log(`interrupted ${agent.id.slice(0, 8)} ${agent.nickname}`);
|
|
361
|
+
} catch (err) {
|
|
362
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
363
|
+
process.exit(1);
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
program.command("delete <agent-id>").description("delete an ended agent").option("-y, --yes", "confirm delete").action((id, opts) => {
|
|
367
|
+
requireDestructiveConfirmation(opts, "delete agent");
|
|
368
|
+
const agent = resolveAgent(id);
|
|
369
|
+
const deleted = deleteAgent(agent.id);
|
|
370
|
+
console.log(`deleted ${deleted.id.slice(0, 8)} ${deleted.nickname}`);
|
|
371
|
+
});
|
|
372
|
+
program.command("delete-run <run-id>").description("delete an ended run").option("-y, --yes", "confirm delete").action((id, opts) => {
|
|
373
|
+
requireDestructiveConfirmation(opts, "delete run");
|
|
374
|
+
const run = readRun(id);
|
|
375
|
+
if (run.status !== "ended" && run.ended_at === null) throw new Error("Stop run before deleting it");
|
|
376
|
+
archiveAndRemoveRun(run.id, "ended");
|
|
377
|
+
console.log(`deleted ${run.id.slice(0, 8)} ${run.name}`);
|
|
378
|
+
});
|
|
379
|
+
program.command("history").description("list archived run history").option("--json", "output JSON array").action((opts) => {
|
|
380
|
+
const records = listRunHistory();
|
|
381
|
+
if (opts.json) {
|
|
382
|
+
console.log(JSON.stringify(records, null, 2));
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
if (records.length === 0) {
|
|
386
|
+
console.log("no history");
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
for (const record of records) {
|
|
390
|
+
const provider = record.root_provider ? providerDisplayName(record.root_provider) : "-";
|
|
391
|
+
console.log(`${record.id.slice(0, 8)} ${record.status.padEnd(5)} ${provider.padEnd(14)} ${String(record.agent_count).padStart(2)} agents ${record.name} ${record.working_dir}`);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
program.command("delete-history <id>").description("delete one run history record").option("-y, --yes", "confirm delete").action((id, opts) => {
|
|
395
|
+
requireDestructiveConfirmation(opts, "delete history record");
|
|
396
|
+
if (!listRunHistory().some((record) => record.id === id)) throw new Error(`history record not found: ${id}`);
|
|
397
|
+
deleteRunHistory(id);
|
|
398
|
+
console.log(`deleted history ${id.slice(0, 8)}`);
|
|
399
|
+
});
|
|
400
|
+
program.command("providers").description("list providers with availability and known models").option("--json", "output JSON array").option("--models", "also print each provider's known models").action((opts) => {
|
|
401
|
+
const available = detectAvailable();
|
|
402
|
+
const providers = PROVIDERS.map((id) => ({
|
|
403
|
+
id,
|
|
404
|
+
name: providerDisplayName(id),
|
|
405
|
+
available: available[id],
|
|
406
|
+
color: providerColor(id),
|
|
407
|
+
models: [...MODEL_CATALOG[id].models]
|
|
408
|
+
}));
|
|
409
|
+
if (opts.json) {
|
|
410
|
+
console.log(JSON.stringify(providers, null, 2));
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
for (const provider of providers) {
|
|
414
|
+
console.log(`${(provider.available ? "ok" : "--").padEnd(3)} ${provider.id.padEnd(10)} ${provider.name}`);
|
|
415
|
+
if (opts.models) {
|
|
416
|
+
for (const model of provider.models) console.log(` ${model}`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
program.command("approvals").description("list pending approvals").option("--json", "output JSON array").action((opts) => {
|
|
421
|
+
const approvals = listRunApprovals(void 0, "pending");
|
|
422
|
+
if (opts.json) {
|
|
423
|
+
console.log(JSON.stringify(approvals, null, 2));
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (approvals.length === 0) {
|
|
427
|
+
console.log("no pending approvals");
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
for (const approval of approvals) {
|
|
431
|
+
console.log(`${approval.id.slice(0, 8)} ${approval.risk.padEnd(6)} ${approval.action.padEnd(16)} ${approval.summary}`);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
program.command("approve <approval-id> [note]").description("approve a pending approval").action((id, note) => {
|
|
435
|
+
try {
|
|
436
|
+
const resolved = resolveRunApproval(id, "approved", note ?? "");
|
|
437
|
+
console.log(`${resolved.status} ${resolved.id.slice(0, 8)} ${resolved.action}`);
|
|
438
|
+
} catch (err) {
|
|
439
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
440
|
+
process.exit(1);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
program.command("deny <approval-id> [note]").description("deny a pending approval").action((id, note) => {
|
|
444
|
+
try {
|
|
445
|
+
const resolved = resolveRunApproval(id, "denied", note ?? "");
|
|
446
|
+
console.log(`${resolved.status} ${resolved.id.slice(0, 8)} ${resolved.action}`);
|
|
447
|
+
} catch (err) {
|
|
448
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
449
|
+
process.exit(1);
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
program.command("hosts").description("list MCP host CLIs and whether reevesagents is attached").option("--json", "output JSON array").action((opts) => {
|
|
453
|
+
const hosts = hostStatus();
|
|
454
|
+
if (opts.json) {
|
|
455
|
+
console.log(JSON.stringify(hosts, null, 2));
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
for (const host of hosts) {
|
|
459
|
+
const state = !host.installed ? "absent" : host.attached ? "attached" : host.manual ? "manual" : "detached";
|
|
460
|
+
console.log(`${host.key.padEnd(10)} ${state.padEnd(9)} ${host.label}`);
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
program.command("attach [cli]").description("attach the reevesagents MCP to one CLI, or all installed when omitted").action((cli) => {
|
|
464
|
+
try {
|
|
465
|
+
const results = cli ? [attach(cli)] : attachAll();
|
|
466
|
+
if (results.length === 0) {
|
|
467
|
+
console.log("no installed CLIs to attach");
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
for (const result of results) {
|
|
471
|
+
console.log(`${(result.ok ? "ok" : "--").padEnd(3)} ${result.key.padEnd(10)} ${result.message}`);
|
|
472
|
+
}
|
|
473
|
+
} catch (err) {
|
|
474
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
475
|
+
process.exit(1);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
program.command("detach <cli>").description("detach the reevesagents MCP from one CLI").action((cli) => {
|
|
479
|
+
try {
|
|
480
|
+
const result = detach(cli);
|
|
481
|
+
console.log(`${(result.ok ? "ok" : "--").padEnd(3)} ${result.key.padEnd(10)} ${result.message}`);
|
|
482
|
+
} catch (err) {
|
|
483
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
484
|
+
process.exit(1);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
273
487
|
program.command("doctor").description("run setup and environment health checks").option("--json", "output JSON").action((opts) => {
|
|
274
488
|
const result = runDoctor();
|
|
275
489
|
const anyFail = result.checks.some((check) => check.status === "fail");
|
|
@@ -282,12 +496,109 @@ program.command("doctor").description("run setup and environment health checks")
|
|
|
282
496
|
}
|
|
283
497
|
process.exit(anyFail ? 1 : 0);
|
|
284
498
|
});
|
|
285
|
-
program.command("
|
|
499
|
+
program.command("agents [run-id]").description("list agents, optionally only those in one run").option("--json", "output JSON array").action((runId, opts) => {
|
|
500
|
+
try {
|
|
501
|
+
const run = runId ? resolveRun(runId) : void 0;
|
|
502
|
+
const agents = listAgents(run?.id);
|
|
503
|
+
if (opts.json) {
|
|
504
|
+
console.log(JSON.stringify(agents, null, 2));
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (agents.length === 0) {
|
|
508
|
+
console.log("no agents");
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
for (const agent of agents) {
|
|
512
|
+
const note = agent.task_note.trim();
|
|
513
|
+
console.log(`${agent.id.slice(0, 8)} ${agent.run_id.slice(0, 8)} ${agent.role.padEnd(6)} ${agent.task_status.padEnd(7)} ${providerDisplayName(agent.provider).padEnd(14)} ${(agent.model || "default").padEnd(16)} ${agent.nickname}${note ? ` ${note}` : ""}`);
|
|
514
|
+
}
|
|
515
|
+
} catch (err) {
|
|
516
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
517
|
+
process.exit(1);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
program.command("config [key] [value]").description(`show config, get one value, or set one (keys: ${CONFIG_FIELDS.map((field) => field.key).join(", ")})`).option("--json", "output JSON for show or get").action((key, value, opts) => {
|
|
521
|
+
try {
|
|
522
|
+
if (key !== void 0 && value !== void 0) {
|
|
523
|
+
const cfg2 = setConfigValues({ [key]: parseConfigValue(key, value) });
|
|
524
|
+
const saved = cfg2.global;
|
|
525
|
+
console.log(`${key} = ${String(saved[key])}`);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const cfg = loadConfig();
|
|
529
|
+
const global = cfg.global;
|
|
530
|
+
if (key !== void 0) {
|
|
531
|
+
if (!CONFIG_FIELDS.some((field) => field.key === key)) throw new Error(`unknown config field: ${key}`);
|
|
532
|
+
console.log(opts.json ? JSON.stringify(global[key]) : String(global[key]));
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (opts.json) {
|
|
536
|
+
console.log(JSON.stringify(cfg.global, null, 2));
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
for (const field of CONFIG_FIELDS) {
|
|
540
|
+
console.log(`${field.key.padEnd(20)} ${String(global[field.key])}`);
|
|
541
|
+
}
|
|
542
|
+
} catch (err) {
|
|
543
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
544
|
+
process.exit(1);
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
program.command("presets").description("list saved presets").option("--json", "output JSON array").action((opts) => {
|
|
548
|
+
const presets = listPresets();
|
|
549
|
+
if (opts.json) {
|
|
550
|
+
console.log(JSON.stringify(presets, null, 2));
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
if (presets.length === 0) {
|
|
554
|
+
console.log("no presets");
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
for (const preset of presets) {
|
|
558
|
+
console.log(`${preset.name.padEnd(24)} ${String(1 + preset.workers.length).padStart(2)} agents ${preset.description}`);
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
program.command("save-preset <run-id> <name> [description...]").description("save a run as a reusable preset").action((runId, name, description) => {
|
|
562
|
+
try {
|
|
563
|
+
const run = resolveRun(runId);
|
|
564
|
+
const tree = savePresetFromRun(run.id, name, description.join(" "));
|
|
565
|
+
console.log(`saved preset ${tree.name} ${1 + tree.workers.length} agents`);
|
|
566
|
+
} catch (err) {
|
|
567
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
568
|
+
process.exit(1);
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
program.command("delete-preset <name>").description("delete a saved preset").option("-y, --yes", "confirm delete").action((name, opts) => {
|
|
572
|
+
requireDestructiveConfirmation(opts, "delete preset");
|
|
573
|
+
if (!listPresets().some((preset) => preset.name === name)) throw new Error(`preset not found: ${name}`);
|
|
574
|
+
deletePreset(name);
|
|
575
|
+
console.log(`deleted preset ${name}`);
|
|
576
|
+
});
|
|
577
|
+
program.command("start-preset <name>").description("start a run from a saved preset").option("--name <name>", "override the run name").option("--cwd <dir>", "working directory", process.cwd()).action((name, opts) => {
|
|
578
|
+
try {
|
|
579
|
+
if (!listPresets().some((preset) => preset.name === name)) throw new Error(`preset not found: ${name}`);
|
|
580
|
+
const result = startRunFromPreset(name, { name: opts.name, working_dir: opts.cwd });
|
|
581
|
+
console.log(`started ${result.run.id.slice(0, 8)} ${result.run.name} ${result.agents.length} agents`);
|
|
582
|
+
} catch (err) {
|
|
583
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
584
|
+
process.exit(1);
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
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").action((opts) => {
|
|
286
588
|
runWeb(opts).catch((err) => {
|
|
287
589
|
console.error(err instanceof Error ? err.message : String(err));
|
|
288
590
|
process.exit(1);
|
|
289
591
|
});
|
|
290
592
|
});
|
|
593
|
+
program.command("mcp").description("start the agent control MCP server over stdio (for CLIs that have it attached)").action(async () => {
|
|
594
|
+
try {
|
|
595
|
+
const { startAgentMcpServer } = await import("./server-H2XEJQYT.js");
|
|
596
|
+
await startAgentMcpServer();
|
|
597
|
+
} catch (err) {
|
|
598
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
599
|
+
process.exit(1);
|
|
600
|
+
}
|
|
601
|
+
});
|
|
291
602
|
async function runWeb(opts) {
|
|
292
603
|
const { checkWebExtras, webExtrasMessage } = await import("./extras-25AF6TAR.js");
|
|
293
604
|
const extras = await checkWebExtras();
|
|
@@ -295,15 +606,13 @@ async function runWeb(opts) {
|
|
|
295
606
|
console.error(webExtrasMessage(extras.missing));
|
|
296
607
|
process.exit(1);
|
|
297
608
|
}
|
|
298
|
-
const { startWebServer } = await import("./server-
|
|
609
|
+
const { startWebServer } = await import("./server-ZJKAIRL5.js");
|
|
299
610
|
const parsed = opts.port ? Number.parseInt(opts.port, 10) : void 0;
|
|
300
611
|
const handle = await startWebServer({
|
|
301
612
|
port: parsed !== void 0 && Number.isFinite(parsed) ? parsed : void 0,
|
|
302
|
-
open: opts.open !== false
|
|
303
|
-
prebetaOrchestrator: opts.prebetaOrchestrator === true
|
|
613
|
+
open: opts.open !== false
|
|
304
614
|
});
|
|
305
615
|
console.log(`reevesagents web running at ${handle.url}`);
|
|
306
|
-
if (opts.prebetaOrchestrator) console.log("PRE-BETA orchestrator/MCP controls enabled.");
|
|
307
616
|
console.log("press Ctrl+C to stop. agents keep running.");
|
|
308
617
|
const shutdown = () => {
|
|
309
618
|
handle.close().finally(() => process.exit(0));
|
|
@@ -311,45 +620,65 @@ async function runWeb(opts) {
|
|
|
311
620
|
process.on("SIGINT", shutdown);
|
|
312
621
|
process.on("SIGTERM", shutdown);
|
|
313
622
|
}
|
|
314
|
-
var knownSubcommands = new Set(program.commands.map((command) => command.name()));
|
|
315
|
-
var firstArg = process.argv[2];
|
|
316
623
|
async function renderTui() {
|
|
317
624
|
prepareTuiColorEnv();
|
|
318
625
|
const [{ default: React }, { render }, { Router }] = await Promise.all([
|
|
319
626
|
import("react"),
|
|
320
627
|
import("ink"),
|
|
321
|
-
import("./router-
|
|
628
|
+
import("./router-I4WDR7CD.js")
|
|
322
629
|
]);
|
|
323
630
|
try {
|
|
324
631
|
await render(React.createElement(Router), { alternateScreen: false }).waitUntilExit();
|
|
325
632
|
} finally {
|
|
326
|
-
const { closeTuiWebServer } = await import("./tui-launch-
|
|
633
|
+
const { closeTuiWebServer } = await import("./tui-launch-VHLX6JOW.js");
|
|
327
634
|
await closeTuiWebServer();
|
|
328
635
|
}
|
|
329
636
|
process.exit(0);
|
|
330
637
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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)}
|
|
638
|
+
function runCli() {
|
|
639
|
+
process.on("uncaughtException", (err) => {
|
|
640
|
+
process.stderr.write(`[FATAL] ${err.message}
|
|
349
641
|
`);
|
|
350
642
|
process.exit(1);
|
|
351
643
|
});
|
|
352
|
-
|
|
353
|
-
|
|
644
|
+
const knownSubcommands = new Set(program.commands.map((command) => command.name()));
|
|
645
|
+
const firstArg = process.argv[2];
|
|
646
|
+
if (!firstArg || !knownSubcommands.has(firstArg) && !firstArg.startsWith("--")) {
|
|
647
|
+
if (!process.env.TMUX && process.stdout.isTTY && !process.env.REEVES_NO_TMUX_WRAPPER) {
|
|
648
|
+
const wrapperCmd = [process.argv[0], process.argv[1]].filter((arg) => typeof arg === "string").map((arg) => `'${arg.replace(/'/g, "'\\''")}'`).join(" ");
|
|
649
|
+
try {
|
|
650
|
+
writeTuiOpenToken();
|
|
651
|
+
openTuiSession(wrapperCmd);
|
|
652
|
+
process.exit(0);
|
|
653
|
+
} catch (err) {
|
|
654
|
+
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");
|
|
655
|
+
process.stderr.write(`tmux launch error: ${err instanceof Error ? err.message : String(err)}
|
|
656
|
+
`);
|
|
657
|
+
process.exit(1);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
process.on("SIGTERM", () => process.exit(0));
|
|
661
|
+
if (process.stdout.isTTY) process.stdout.write("\x1B[2J\x1B[H");
|
|
662
|
+
renderTui().catch((err) => {
|
|
663
|
+
process.stderr.write(`[FATAL] ${err instanceof Error ? err.message : String(err)}
|
|
664
|
+
`);
|
|
665
|
+
process.exit(1);
|
|
666
|
+
});
|
|
667
|
+
} else {
|
|
668
|
+
program.parse();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
function isEntrypoint() {
|
|
672
|
+
const entry = process.argv[1];
|
|
673
|
+
if (!entry) return false;
|
|
674
|
+
try {
|
|
675
|
+
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(entry);
|
|
676
|
+
} catch {
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
354
679
|
}
|
|
680
|
+
if (isEntrypoint()) runCli();
|
|
681
|
+
export {
|
|
682
|
+
program
|
|
683
|
+
};
|
|
355
684
|
//# sourceMappingURL=cli.js.map
|
package/dist/extras-25AF6TAR.js
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
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
1
|
type Provider = 'cc' | 'codex' | 'opencode' | 'hermes' | 'kimi' | 'deepseek' | 'pi' | 'qwen' | 'aider';
|
|
18
|
-
type LanguageCode = 'en' | 'de' | 'fr' | 'es' | 'pt' | 'it' | 'tr' | 'zh-Hans' | 'ar';
|
|
2
|
+
type LanguageCode = 'en' | 'de' | 'fr' | 'es' | 'pt' | 'it' | 'tr' | 'ru' | 'zh-Hans' | 'ar';
|
|
19
3
|
type Permissions = 'skip' | 'ask';
|
|
20
4
|
type TaskStatus = 'queued' | 'working' | 'done' | 'failed' | 'blocked';
|
|
21
5
|
type AuthMode = 'default' | 'api-key';
|
|
@@ -23,9 +7,8 @@ type Effort = 'default' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
|
23
7
|
type AgentRole = 'root' | 'worker';
|
|
24
8
|
type RunStatus = 'running' | 'ended';
|
|
25
9
|
type RunViewStatus = RunStatus | 'stale';
|
|
26
|
-
type RunMode = 'spawner' | 'orchestrator';
|
|
27
10
|
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';
|
|
11
|
+
type ScreenName = 'Welcome' | 'LanguageSelect' | 'Runs' | 'RunHistory' | 'Run' | 'RunAgents' | 'RunOutput' | 'RunStop' | 'AgentDetail' | 'AgentOutput' | 'AgentTask' | 'AgentKill' | 'NewRun' | 'NewRunBasics' | 'NewRunRoot' | 'NewRunWorkers' | 'NewRunWorker' | 'NewRunReview' | 'NewRunStarting' | 'AddWorker' | 'Settings' | 'AgentControl' | 'Reference' | 'Credits' | 'Doctor' | 'DoctorCheck' | 'Approvals' | 'Config' | 'Presets';
|
|
29
12
|
interface Message {
|
|
30
13
|
id: string;
|
|
31
14
|
from_id: string;
|
|
@@ -35,7 +18,6 @@ interface Message {
|
|
|
35
18
|
}
|
|
36
19
|
interface RunRecord {
|
|
37
20
|
id: string;
|
|
38
|
-
mode?: string;
|
|
39
21
|
name: string;
|
|
40
22
|
status: RunStatus;
|
|
41
23
|
tmux_session: string;
|
|
@@ -51,7 +33,6 @@ interface RunRecord {
|
|
|
51
33
|
interface RunHistoryRecord {
|
|
52
34
|
id: string;
|
|
53
35
|
name: string;
|
|
54
|
-
mode: RunMode;
|
|
55
36
|
status: RunHistoryStatus;
|
|
56
37
|
working_dir: string;
|
|
57
38
|
started_at: string;
|
|
@@ -82,7 +63,7 @@ interface AgentRecord {
|
|
|
82
63
|
started_at: string;
|
|
83
64
|
ended_at: string | null;
|
|
84
65
|
}
|
|
85
|
-
interface
|
|
66
|
+
interface PresetSlot {
|
|
86
67
|
nickname_template: string;
|
|
87
68
|
provider: Provider;
|
|
88
69
|
model: string;
|
|
@@ -93,11 +74,11 @@ interface SavedTreeSlot {
|
|
|
93
74
|
permissions: Permissions;
|
|
94
75
|
rc_enabled: boolean;
|
|
95
76
|
}
|
|
96
|
-
interface
|
|
77
|
+
interface Preset {
|
|
97
78
|
name: string;
|
|
98
79
|
description: string;
|
|
99
|
-
root:
|
|
100
|
-
workers:
|
|
80
|
+
root: PresetSlot;
|
|
81
|
+
workers: PresetSlot[];
|
|
101
82
|
working_dir_pattern?: string;
|
|
102
83
|
created_at: string;
|
|
103
84
|
updated_at: string;
|
|
@@ -151,7 +132,6 @@ interface AgentLaunchConfig {
|
|
|
151
132
|
rc_enabled?: boolean;
|
|
152
133
|
}
|
|
153
134
|
interface StartRunRequest {
|
|
154
|
-
mode?: 'spawner';
|
|
155
135
|
name: string;
|
|
156
136
|
working_dir: string;
|
|
157
137
|
root: AgentLaunchConfig;
|
|
@@ -214,10 +194,7 @@ declare function runsDir(): string;
|
|
|
214
194
|
declare function nowIso(): string;
|
|
215
195
|
declare function readRun(runId: string): RunRecord;
|
|
216
196
|
declare function listRuns(): RunRecord[];
|
|
217
|
-
|
|
218
|
-
includeAllModes?: boolean;
|
|
219
|
-
}
|
|
220
|
-
declare function listRunHistory(options?: RunHistoryOptions): RunHistoryRecord[];
|
|
197
|
+
declare function listRunHistory(): RunHistoryRecord[];
|
|
221
198
|
declare function computeRunStatus(run: RunRecord, tmuxSessionExists?: boolean): RunViewStatus;
|
|
222
199
|
declare function readAgent(runId: string, agentId: string): AgentRecord;
|
|
223
200
|
declare function listAgents(runId?: string): AgentRecord[];
|
|
@@ -226,11 +203,10 @@ declare function defaultConfig(): Config;
|
|
|
226
203
|
declare function loadConfig(): Config;
|
|
227
204
|
declare function saveConfig(cfg: Config): string;
|
|
228
205
|
|
|
229
|
-
declare function
|
|
230
|
-
declare
|
|
231
|
-
declare function
|
|
232
|
-
declare function
|
|
233
|
-
declare function
|
|
234
|
-
declare function deleteSavedTree(name: string): void;
|
|
206
|
+
declare function presetsDir(): string;
|
|
207
|
+
declare function listPresets(): Preset[];
|
|
208
|
+
declare function loadPreset(name: string): Preset | null;
|
|
209
|
+
declare function savePreset(tree: Preset): void;
|
|
210
|
+
declare function deletePreset(name: string): void;
|
|
235
211
|
|
|
236
|
-
export { type AgentRecord, type AuthMode, BIN, type CheckResult, type Config, type Effort,
|
|
212
|
+
export { type AgentRecord, type AuthMode, BIN, type CheckResult, type Config, type Effort, 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, deletePreset, detectAvailable, isProvider, killAgent, listAgents, listPresets, listRunHistory, listRuns, loadConfig, loadPreset, modelDisplayName, modelSourceForProvider, modelValuesForProvider, normalizeProvider, nowIso, openAgent, openReeves, openRunTabs, peekAgent, presetsDir, readAgent, readRun, runDoctor, runsDir, saveConfig, savePreset, startRun, stateRoot, stopRun };
|