reevesagents 1.3.2 → 1.5.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.js CHANGED
@@ -1,32 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ buildOnboardingState,
4
+ runOnboarding,
3
5
  writeTuiOpenToken
4
- } from "./chunk-5Q5XP5QI.js";
6
+ } from "./chunk-OHEIERAD.js";
5
7
  import {
6
8
  MODEL_CATALOG
7
- } from "./chunk-TO32PH23.js";
9
+ } from "./chunk-LZMMFJYG.js";
8
10
  import {
9
11
  REEVESAGENTS_VERSION,
10
- attach,
11
- attachAll,
12
- detach,
13
- hostStatus,
14
12
  listRunApprovals,
15
13
  resolveRunApproval
16
- } from "./chunk-VTLLF2Z4.js";
14
+ } from "./chunk-6RPG22BH.js";
17
15
  import {
18
16
  ALLOWED_KEYS,
19
17
  CONFIG_FIELDS,
20
18
  PROVIDERS,
21
19
  archiveAndRemoveRun,
20
+ attach,
21
+ attachAll,
22
22
  autoCleanupRuns,
23
+ coerceExtraArgs,
23
24
  computeRunStatus,
24
25
  deleteAgent,
25
26
  deletePreset,
26
27
  deleteRunHistory,
28
+ detach,
27
29
  detectAvailable,
30
+ hostStatus,
28
31
  interrupt,
29
32
  killAgent,
33
+ latestActiveRun,
30
34
  listAgents,
31
35
  listPresets,
32
36
  listRunHistory,
@@ -47,8 +51,9 @@ import {
47
51
  spawnWorker,
48
52
  startRun,
49
53
  startRunFromPreset,
50
- stopRun
51
- } from "./chunk-36SYE7IU.js";
54
+ stopRun,
55
+ verifyServerLaunch
56
+ } from "./chunk-LKJSQLX2.js";
52
57
  import "./chunk-D24DQQ6V.js";
53
58
 
54
59
  // src/cli.ts
@@ -271,7 +276,31 @@ function printSpawnJson(run, agents) {
271
276
  agents: agents.map((agent) => ({ id: agent.id, nickname: agent.nickname, provider: agent.provider, role: agent.role }))
272
277
  }, null, 2));
273
278
  }
274
- 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").option("--json", "output JSON: the run id and the spawned agent ids").action((agentSpecs, opts) => {
279
+ function spawnIntoRun(run, parsed, opts, available) {
280
+ const permissions = opts.skip ? "skip" : void 0;
281
+ const auth_mode = parseAuthModeOpt(opts.authMode);
282
+ const effort = parseEffortOpt(opts.effort);
283
+ const extra_args = coerceExtraArgs(opts.extraArgs);
284
+ const agents = parsed.map((spec) => spawnWorker({
285
+ run_id: run.id,
286
+ provider: spec.provider,
287
+ nickname: spec.nickname,
288
+ model: spec.model,
289
+ task: opts.prompt,
290
+ permissions,
291
+ auth_mode,
292
+ effort,
293
+ extra_args
294
+ }, { available }));
295
+ if (opts.json) {
296
+ printSpawnJson(run, agents);
297
+ return;
298
+ }
299
+ console.log(`added ${agents.length} agents to ${run.id.slice(0, 8)} ${run.name}`);
300
+ for (const agent of agents) printSpawnAgentLine(agent);
301
+ printSpawnHints(run, !!opts.skip);
302
+ }
303
+ 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").option("--extra-args <args>", 'extra flags appended to every agent launch, e.g. "--remote-control"').option("--json", "output JSON: the run id and the spawned agent ids").action((agentSpecs, opts) => {
275
304
  try {
276
305
  const specs = agentSpecs.length > 0 ? agentSpecs : ["codex"];
277
306
  const parsed = specs.map(parseAgentSpec);
@@ -279,25 +308,9 @@ program.command("spawn [agent...]").description("start a run with one or more pr
279
308
  const permissions = opts.skip ? "skip" : void 0;
280
309
  const auth_mode = parseAuthModeOpt(opts.authMode);
281
310
  const effort = parseEffortOpt(opts.effort);
311
+ const extra_args = coerceExtraArgs(opts.extraArgs);
282
312
  if (opts.run) {
283
- const run = resolveRun(opts.run);
284
- const agents = parsed.map((spec) => spawnWorker({
285
- run_id: run.id,
286
- provider: spec.provider,
287
- nickname: spec.nickname,
288
- model: spec.model,
289
- task: opts.prompt,
290
- permissions,
291
- auth_mode,
292
- effort
293
- }, { available }));
294
- if (opts.json) {
295
- printSpawnJson(run, agents);
296
- return;
297
- }
298
- console.log(`added ${agents.length} agents to ${run.id.slice(0, 8)} ${run.name}`);
299
- for (const agent of agents) printSpawnAgentLine(agent);
300
- printSpawnHints(run, !!opts.skip);
313
+ spawnIntoRun(resolveRun(opts.run), parsed, opts, available);
301
314
  return;
302
315
  }
303
316
  const [first, ...rest] = parsed;
@@ -311,7 +324,8 @@ program.command("spawn [agent...]").description("start a run with one or more pr
311
324
  task: opts.prompt,
312
325
  permissions,
313
326
  auth_mode,
314
- effort
327
+ effort,
328
+ extra_args
315
329
  },
316
330
  workers: rest.map((spec) => ({
317
331
  provider: spec.provider,
@@ -320,7 +334,8 @@ program.command("spawn [agent...]").description("start a run with one or more pr
320
334
  task: opts.prompt,
321
335
  permissions,
322
336
  auth_mode,
323
- effort
337
+ effort,
338
+ extra_args
324
339
  }))
325
340
  }, { available });
326
341
  if (opts.json) {
@@ -346,6 +361,33 @@ Example: a Claude Code lead with two Codex and one Kimi worker
346
361
 
347
362
  Run "reevesagents doctor" first: it reports tmux, Node, and which provider
348
363
  CLIs are installed and logged in, so a spawn does not fail on a missing CLI.`);
364
+ program.command("add [agent...]").description("add agents to the current workspace (the most recent active run)").option("--run <run-id>", "target a specific run instead of the most recent active one").option("--prompt <text>", "initial prompt pasted into each agent", "").option("--skip", "skip permission prompts for every agent (sets permissions to skip)").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").option("--extra-args <args>", 'extra flags appended to every agent launch, e.g. "--remote-control"').option("--json", "output JSON: the run id and the spawned agent ids").action((agentSpecs, opts) => {
365
+ try {
366
+ if (agentSpecs.length === 0) {
367
+ throw new Error('add needs at least one agent, e.g. "reevesagents add codex"');
368
+ }
369
+ const parsed = agentSpecs.map(parseAgentSpec);
370
+ const available = preflightAvailability(parsed.map((spec) => spec.provider));
371
+ const run = opts.run ? resolveRun(opts.run) : latestActiveRun();
372
+ if (!run) {
373
+ throw new Error('no active workspace to add to. Start one with "reevesagents spawn"');
374
+ }
375
+ spawnIntoRun(run, parsed, opts, available);
376
+ } catch (err) {
377
+ console.error(err instanceof Error ? err.message : String(err));
378
+ process.exit(1);
379
+ }
380
+ }).addHelpText("after", `
381
+ Adds agents to a workspace you already have, so you can grow it one at a time
382
+ without passing a run id. With no --run it targets your most recent active run.
383
+
384
+ Example: start a workspace, then keep adding to it
385
+ reevesagents spawn cc
386
+ reevesagents add codex
387
+ reevesagents add kimi:docs
388
+
389
+ Agents added this way just run side by side; none controls the others unless
390
+ you attach the Agent control MCP.`);
349
391
  program.command("runs").description("list runs").option("--json", "output JSON array").action((opts) => {
350
392
  autoCleanupRuns();
351
393
  const runs = listRuns().map((run) => ({ ...run, view_status: computeRunStatus(run, runHasLiveTmuxTarget(run)) }));
@@ -513,6 +555,61 @@ program.command("deny <approval-id> [note]").description("deny a pending approva
513
555
  process.exit(1);
514
556
  }
515
557
  });
558
+ program.command("setup").description("check your setup and connect installed CLIs (the first-run wizard)").option("--attach", "connect reevesagents to every installed host CLI (default only reports)").option("--json", "print the onboarding state as JSON").action(async (opts) => {
559
+ try {
560
+ const state = buildOnboardingState();
561
+ if (opts.json) {
562
+ console.log(JSON.stringify(state, null, 2));
563
+ return;
564
+ }
565
+ console.log(`tmux ${state.tmuxOk ? "ok" : "missing (required; install tmux 3.0+)"}`);
566
+ console.log(`node ${state.nodeOk ? "ok" : "too old (need >=20.19)"}`);
567
+ console.log(`providers ${state.installedProviders.length > 0 ? state.installedProviders.map(providerDisplayName).join(", ") : "none installed"}`);
568
+ if (state.installedProviders.length === 0) {
569
+ console.log("\nInstall a provider CLI (for example Claude Code or Codex) and sign in, then run setup again.");
570
+ return;
571
+ }
572
+ console.log("\nTwo ways to use reevesagents:");
573
+ console.log(` 1. Run agents yourself reevesagents spawn ${state.installedProviders[0]}`);
574
+ console.log(" 2. Let one CLI drive others connect the Agent control MCP (below)");
575
+ const installedHosts = state.hosts.filter((host) => host.installed);
576
+ if (installedHosts.length > 0) {
577
+ console.log("\nHost CLIs (can drive the others once connected):");
578
+ for (const host of installedHosts) {
579
+ const status = host.attached ? "connected" : host.manual ? "add manually" : "not connected";
580
+ console.log(` ${host.key.padEnd(10)} ${status}`);
581
+ }
582
+ }
583
+ if (!opts.attach) {
584
+ if (state.attachable.length > 0) {
585
+ console.log(`
586
+ To connect ${state.attachable.join(", ")}, run: reevesagents setup --attach`);
587
+ } else if (state.attachedHosts.length > 0) {
588
+ console.log("\nAll installed host CLIs are already connected. Restart them to load the tools.");
589
+ }
590
+ return;
591
+ }
592
+ console.log("\nConnecting...");
593
+ const result = await runOnboarding();
594
+ for (const attached of result.attached) {
595
+ console.log(` ${(attached.ok ? "ok" : "--").padEnd(3)} ${attached.key.padEnd(10)} ${attached.message}`);
596
+ }
597
+ if (result.verify?.ok) {
598
+ console.log(`
599
+ verified: ${result.verify.detail}.`);
600
+ const keys = result.attached.filter((attached) => attached.ok).map((attached) => attached.key);
601
+ console.log(`Restart ${keys.join(", ")} (start a new session), then ask it: "use reevesagents to spawn a codex and summarize the README".`);
602
+ } else if (result.verify) {
603
+ console.log(`
604
+ warning: the server did not start here: ${result.verify.detail}`);
605
+ console.log("a host CLI will hit the same error. check that reevesagents is installed and re-run setup --attach.");
606
+ }
607
+ if (!result.attached.some((attached) => attached.ok) || result.verify?.ok === false) process.exitCode = 1;
608
+ } catch (err) {
609
+ console.error(err instanceof Error ? err.message : String(err));
610
+ process.exit(1);
611
+ }
612
+ });
516
613
  program.command("hosts").description("list MCP host CLIs and whether reevesagents is attached").option("--json", "output JSON array").action((opts) => {
517
614
  const hosts = hostStatus();
518
615
  if (opts.json) {
@@ -524,9 +621,9 @@ program.command("hosts").description("list MCP host CLIs and whether reevesagent
524
621
  console.log(`${host.key.padEnd(10)} ${state.padEnd(9)} ${host.label}`);
525
622
  }
526
623
  });
527
- program.command("attach [cli]").description("attach the reevesagents MCP to one CLI, or all installed when omitted").action((cli) => {
624
+ program.command("attach [cli]").description("attach the reevesagents MCP to one CLI, or all installed when omitted").option("--force", "rewrite the registration even if already attached (upgrades an old launcher)").action(async (cli, opts) => {
528
625
  try {
529
- const results = cli ? [attach(cli)] : attachAll();
626
+ const results = cli ? [attach(cli, opts.force)] : attachAll(opts.force);
530
627
  if (results.length === 0) {
531
628
  console.log("no installed CLIs to attach");
532
629
  return;
@@ -534,6 +631,22 @@ program.command("attach [cli]").description("attach the reevesagents MCP to one
534
631
  for (const result of results) {
535
632
  console.log(`${(result.ok ? "ok" : "--").padEnd(3)} ${result.key.padEnd(10)} ${result.message}`);
536
633
  }
634
+ const attached = results.filter((result) => result.ok);
635
+ if (attached.length > 0) {
636
+ const verify = await verifyServerLaunch();
637
+ if (verify.ok) {
638
+ console.log(`
639
+ verified: ${verify.detail}.`);
640
+ console.log(`restart ${attached.map((result) => result.key).join(", ")} (start a new session) to load the tools.`);
641
+ } else {
642
+ console.log(`
643
+ warning: the entry was written, but the server did not start here: ${verify.detail}`);
644
+ console.log("a host CLI will hit the same error. check that reevesagents is installed and re-run attach.");
645
+ process.exitCode = 1;
646
+ }
647
+ } else {
648
+ process.exitCode = 1;
649
+ }
537
650
  } catch (err) {
538
651
  console.error(err instanceof Error ? err.message : String(err));
539
652
  process.exit(1);
@@ -543,6 +656,7 @@ program.command("detach <cli>").description("detach the reevesagents MCP from on
543
656
  try {
544
657
  const result = detach(cli);
545
658
  console.log(`${(result.ok ? "ok" : "--").padEnd(3)} ${result.key.padEnd(10)} ${result.message}`);
659
+ if (!result.ok) process.exitCode = 1;
546
660
  } catch (err) {
547
661
  console.error(err instanceof Error ? err.message : String(err));
548
662
  process.exit(1);
@@ -656,7 +770,7 @@ program.command("web").description("start the on-demand loopback web UI for agen
656
770
  });
657
771
  program.command("mcp").description("start the agent control MCP server over stdio (for CLIs that have it attached)").action(async () => {
658
772
  try {
659
- const { startAgentMcpServer } = await import("./server-I2ROVLSH.js");
773
+ const { startAgentMcpServer } = await import("./server-TUKVM6PW.js");
660
774
  await startAgentMcpServer();
661
775
  } catch (err) {
662
776
  console.error(err instanceof Error ? err.message : String(err));
@@ -670,7 +784,7 @@ async function runWeb(opts) {
670
784
  console.error(webExtrasMessage(extras.missing));
671
785
  process.exit(1);
672
786
  }
673
- const { startWebServer } = await import("./server-Y4HMP3OI.js");
787
+ const { startWebServer } = await import("./server-BNCUJ4YU.js");
674
788
  const parsed = opts.port ? Number.parseInt(opts.port, 10) : void 0;
675
789
  const handle = await startWebServer({
676
790
  port: parsed !== void 0 && Number.isFinite(parsed) ? parsed : void 0,
@@ -689,12 +803,12 @@ async function renderTui() {
689
803
  const [{ default: React }, { render }, { Router }] = await Promise.all([
690
804
  import("react"),
691
805
  import("ink"),
692
- import("./router-AOJOUKAY.js")
806
+ import("./router-7MRY24Y5.js")
693
807
  ]);
694
808
  try {
695
809
  await render(React.createElement(Router), { alternateScreen: false }).waitUntilExit();
696
810
  } finally {
697
- const { closeTuiWebServer } = await import("./tui-launch-SJNFGH42.js");
811
+ const { closeTuiWebServer } = await import("./tui-launch-Y5YXPUHS.js");
698
812
  await closeTuiWebServer();
699
813
  }
700
814
  process.exit(0);
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ type AgentRole = 'root' | 'worker';
8
8
  type RunStatus = 'running' | 'ended';
9
9
  type RunViewStatus = RunStatus | 'stale';
10
10
  type RunHistoryStatus = 'ended' | 'stale';
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';
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' | 'Setup' | 'Reference' | 'Credits' | 'Doctor' | 'DoctorCheck' | 'Approvals' | 'Config' | 'Presets';
12
12
  interface Message {
13
13
  id: string;
14
14
  from_id: string;
@@ -130,6 +130,7 @@ interface AgentLaunchConfig {
130
130
  working_dir?: string;
131
131
  permissions?: Permissions;
132
132
  rc_enabled?: boolean;
133
+ extra_args?: string[];
133
134
  }
134
135
  interface StartRunRequest {
135
136
  name: string;
@@ -170,6 +171,7 @@ interface BuildCommandOptions {
170
171
  auth_mode?: AuthMode;
171
172
  effort?: Effort;
172
173
  rc_enabled?: boolean;
174
+ extra_args?: string[];
173
175
  }
174
176
  declare const BIN: Record<Provider, string>;
175
177
  declare const PROVIDERS: Provider[];
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  modelDisplayName,
7
7
  modelSourceForProvider,
8
8
  modelValuesForProvider
9
- } from "./chunk-TO32PH23.js";
9
+ } from "./chunk-LZMMFJYG.js";
10
10
  import {
11
11
  BIN,
12
12
  PROVIDERS,
@@ -39,7 +39,7 @@ import {
39
39
  startRun,
40
40
  stateRoot,
41
41
  stopRun
42
- } from "./chunk-36SYE7IU.js";
42
+ } from "./chunk-LKJSQLX2.js";
43
43
  import "./chunk-D24DQQ6V.js";
44
44
  export {
45
45
  BIN,