reevesagents 1.6.1 → 1.7.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ # [1.7.0](https://github.com/mertkayacs/reevesagents/compare/v1.6.2...v1.7.0) (2026-07-26)
4
+
5
+
6
+ ### Features
7
+
8
+ * **mcp:** one-command setup with OpenCode auto-attach and accurate status ([#16](https://github.com/mertkayacs/reevesagents/issues/16)) ([3998259](https://github.com/mertkayacs/reevesagents/commit/3998259178b9d5c837740da2c14e228aeddafdba)), closes [#15](https://github.com/mertkayacs/reevesagents/issues/15)
9
+
10
+ ## [1.6.2](https://github.com/mertkayacs/reevesagents/compare/v1.6.1...v1.6.2) (2026-07-25)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **skills:** make SKILL.md frontmatter valid YAML ([3096541](https://github.com/mertkayacs/reevesagents/commit/309654120a5841077a68faef73ed0b7c54370185))
16
+
3
17
  ## [1.6.1](https://github.com/mertkayacs/reevesagents/compare/v1.6.0...v1.6.1) (2026-07-25)
4
18
 
5
19
 
package/README.md CHANGED
@@ -291,7 +291,7 @@ Discovery, approvals, agent control, config, and cleanup:
291
291
  - `approve <approval-id> [note]`: Resolve an approval request as approved.
292
292
  - `deny <approval-id> [note]`: Resolve an approval request as denied.
293
293
  - `hosts`: List the agent CLIs on this machine and show which ones ReevesAgents is connected to.
294
- - `attach [cli]`: Connect ReevesAgents to one agent CLI, or to every installed one when no name is given. Runs that CLI's own `mcp add`.
294
+ - `attach [cli]`: Connect ReevesAgents to one agent CLI, or to every installed one when no name is given. Runs that CLI's own `mcp add` (or edits `opencode.json` for OpenCode). For a one-shot "set everything up" (attach every host and install the skill), use `reevesagents setup --attach`.
295
295
  - `detach <cli>`: Disconnect ReevesAgents from one agent CLI. Runs that CLI's own `mcp remove`.
296
296
  - `skills [action]`: Install the ReevesAgents skill (a `SKILL.md`) so skill-aware CLIs (Claude Code, Codex, Kimi, OpenCode) learn to drive ReevesAgents on their own. Actions: `status` (default), `install`, `remove`. Key flags: `--json`.
297
297
  - `mcp`: Start the Agent control MCP server over stdio. Not run by hand; the CLI you connect it to runs it.
@@ -324,8 +324,15 @@ codex, kimi, qwen, opencode, hermes) and lets you attach, detach, or attach all.
324
324
  Attaching runs that CLI's own `mcp add` command (for example
325
325
  `claude mcp add reevesagents -- reevesagents mcp`); detaching runs the matching
326
326
  remove. ReevesAgents only calls each CLI's own command and never edits provider
327
- config files by hand. OpenCode is the exception: its `mcp add` is interactive
328
- and has no remove, so the screen marks it attach-by-hand.
327
+ config files by hand. OpenCode is the exception: it has no scriptable `mcp add`
328
+ for a local server, so ReevesAgents attaches it by writing the `reevesagents`
329
+ entry into its `~/.config/opencode/opencode.json` directly (and removes just that
330
+ entry on detach).
331
+
332
+ Codex sandboxes MCP tool calls by default, which blocks reevesagents from
333
+ launching agents in tmux. Run Codex with full access when driving agents, for
334
+ example `codex --sandbox danger-full-access`, or add a profile that sets
335
+ `sandbox_mode = "danger-full-access"` and run `codex --profile <name>`.
329
336
 
330
337
  Once a CLI is attached, it has the Agent Control tools whenever it starts.
331
338
  Installing it is your explicit choice, and that choice is the consent. One run
@@ -6,7 +6,7 @@ import {
6
6
  redactSecrets,
7
7
  runDir,
8
8
  withRunsLock
9
- } from "./chunk-S2NWTREO.js";
9
+ } from "./chunk-YDBE6CMQ.js";
10
10
 
11
11
  // src/core/approvals.ts
12
12
  import {
@@ -168,4 +168,4 @@ export {
168
168
  resolveRunApproval,
169
169
  REEVESAGENTS_VERSION
170
170
  };
171
- //# sourceMappingURL=chunk-23XREWJP.js.map
171
+ //# sourceMappingURL=chunk-AKAFR25Q.js.map
@@ -1,4 +1,52 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ defaultTmuxAvailable,
4
+ defaultTmuxTargetExists,
5
+ killAgent,
6
+ listAgents,
7
+ loadConfig,
8
+ nowMs
9
+ } from "./chunk-YDBE6CMQ.js";
10
+
11
+ // src/core/reaper.ts
12
+ function sweepAgents(options = {}) {
13
+ const haveTmux = options.targetExists ? true : (options.tmuxAvailable ?? defaultTmuxAvailable)();
14
+ if (!haveTmux) return { reaped: [] };
15
+ const targetExists = options.targetExists ?? defaultTmuxTargetExists;
16
+ const now = options.now ?? nowMs;
17
+ const maxLifetimeMs = options.maxLifetimeMs ?? loadConfig().global.max_lifetime_ms;
18
+ const reaped = [];
19
+ for (const agent of listAgents()) {
20
+ if (agent.ended_at || agent.headless) continue;
21
+ const ageMs = now() - new Date(agent.started_at).getTime();
22
+ let reason = null;
23
+ if (agent.tmux_window_id && !targetExists(agent.tmux_window_id)) {
24
+ reason = "window-gone";
25
+ } else if (maxLifetimeMs > 0 && ageMs > maxLifetimeMs) {
26
+ reason = "lifetime-exceeded";
27
+ }
28
+ if (!reason) continue;
29
+ try {
30
+ killAgent(agent.id, options.driver ? { driver: options.driver } : {});
31
+ reaped.push({
32
+ agent_id: agent.id,
33
+ run_id: agent.run_id,
34
+ nickname: agent.nickname,
35
+ reason,
36
+ age_ms: Math.max(0, Math.round(ageMs))
37
+ });
38
+ } catch {
39
+ }
40
+ }
41
+ return { reaped };
42
+ }
43
+ var lastSweepAt = 0;
44
+ function sweepAgentsThrottled(minIntervalMs = 15e3, options = {}) {
45
+ const now = (options.now ?? nowMs)();
46
+ if (lastSweepAt !== 0 && now - lastSweepAt < minIntervalMs) return { reaped: [], swept: false };
47
+ lastSweepAt = now;
48
+ return { ...sweepAgents(options), swept: true };
49
+ }
2
50
 
3
51
  // src/core/skills.ts
4
52
  import { mkdirSync, writeFileSync, readFileSync, rmSync, existsSync } from "fs";
@@ -7,7 +55,7 @@ import { join } from "path";
7
55
  var SKILL_NAME = "reevesagents";
8
56
  var REEVESAGENTS_SKILL = `---
9
57
  name: reevesagents
10
- description: Drive a team of other AI coding CLIs from the current session through the reevesagents MCP server. Use when the user asks to delegate work to another model, run several agents in parallel, or orchestrate a multi-agent team: spawn Claude Code, Codex, Kimi, Qwen, OpenCode and other installed CLIs each in its own tmux window, send them prompts, read their output, and stop or reap them. Assumes the reevesagents MCP server is attached to this CLI (run: reevesagents attach).
58
+ description: Drive a team of other AI coding CLIs from the current session through the reevesagents MCP server. Use when the user asks to delegate work to another model, run several agents in parallel, or orchestrate a multi-agent team. It can spawn Claude Code, Codex, Kimi, Qwen, OpenCode and other installed CLIs each in its own tmux window, send them prompts, read their output, and stop or reap them. Assumes the reevesagents MCP server is attached to this CLI (run reevesagents attach).
11
59
  ---
12
60
 
13
61
  # reevesagents: drive a team of AI CLIs
@@ -129,8 +177,10 @@ function removeSkills() {
129
177
  }
130
178
 
131
179
  export {
180
+ sweepAgents,
181
+ sweepAgentsThrottled,
132
182
  installSkills,
133
183
  skillsStatus,
134
184
  removeSkills
135
185
  };
136
- //# sourceMappingURL=chunk-JDJW3WST.js.map
186
+ //# sourceMappingURL=chunk-DA4YL4DE.js.map
@@ -28,7 +28,7 @@ async function startTuiWebServer() {
28
28
  const { checkWebExtras, webExtrasMessage } = await import("./extras-25AF6TAR.js");
29
29
  const extras = await checkWebExtras();
30
30
  if (!extras.ok) throw new Error(webExtrasMessage(extras.missing));
31
- const { startWebServer } = await import("./server-RXQBOR5F.js");
31
+ const { startWebServer } = await import("./server-7UHJTQRL.js");
32
32
  return startWebServer({ open: true });
33
33
  }
34
34
  async function closeTuiWebServer() {
@@ -48,4 +48,4 @@ export {
48
48
  startWebFromTui,
49
49
  closeTuiWebServer
50
50
  };
51
- //# sourceMappingURL=chunk-S5J4E3QZ.js.map
51
+ //# sourceMappingURL=chunk-IIQU2TK6.js.map
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ installSkills
4
+ } from "./chunk-DA4YL4DE.js";
2
5
  import {
3
6
  attachAll,
4
7
  checkTmux,
@@ -8,7 +11,7 @@ import {
8
11
  resolveLaunchCmd,
9
12
  stateRoot,
10
13
  verifyServerLaunch
11
- } from "./chunk-S2NWTREO.js";
14
+ } from "./chunk-YDBE6CMQ.js";
12
15
 
13
16
  // src/core/onboard.ts
14
17
  function buildOnboardingState() {
@@ -28,9 +31,10 @@ function buildOnboardingState() {
28
31
  };
29
32
  }
30
33
  async function runOnboarding() {
34
+ const skills = installSkills();
31
35
  const attached = attachAll();
32
36
  const verify = attached.some((result) => result.ok) ? await verifyServerLaunch() : null;
33
- return { attached, verify };
37
+ return { attached, verify, skills };
34
38
  }
35
39
  function suggestedAgentPrompt(installedProviders) {
36
40
  const provider = installedProviders[0] ?? "codex";
@@ -63,4 +67,4 @@ export {
63
67
  readTuiOpenToken,
64
68
  writeTuiOpenToken
65
69
  };
66
- //# sourceMappingURL=chunk-JZYM3JJE.js.map
70
+ //# sourceMappingURL=chunk-QWZH352G.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  PROVIDER_DEFS
4
- } from "./chunk-S2NWTREO.js";
4
+ } from "./chunk-YDBE6CMQ.js";
5
5
 
6
6
  // src/core/model-catalog.ts
7
7
  var PROVIDER_DEFAULT_MODEL = "";
@@ -27,4 +27,4 @@ export {
27
27
  modelDisplayName,
28
28
  modelSourceForProvider
29
29
  };
30
- //# sourceMappingURL=chunk-KHBI6CRH.js.map
30
+ //# sourceMappingURL=chunk-STFC6PVR.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  DEFAULT_LANGUAGE
4
- } from "./chunk-S2NWTREO.js";
4
+ } from "./chunk-YDBE6CMQ.js";
5
5
 
6
6
  // src/i18n/locales/en.ts
7
7
  var en = {
@@ -5712,4 +5712,4 @@ export {
5712
5712
  localeCatalog,
5713
5713
  translatePhrase
5714
5714
  };
5715
- //# sourceMappingURL=chunk-2JHA6YK3.js.map
5715
+ //# sourceMappingURL=chunk-XBNUWMMW.js.map
@@ -1003,13 +1003,64 @@ function autoCleanupRuns(options = {}) {
1003
1003
 
1004
1004
  // src/mcp/installer.ts
1005
1005
  import { execFileSync as execFileSync2 } from "child_process";
1006
- import { realpathSync } from "fs";
1006
+ import { realpathSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
1007
+ import { homedir as homedir2 } from "os";
1008
+ import { join as join2, dirname as dirname2 } from "path";
1007
1009
  var SERVER_NAME = "reevesagents";
1008
1010
  var SERVER_BIN = "reevesagents";
1009
1011
  var SERVER_ARG = "mcp";
1010
1012
  var MGMT_TIMEOUT_MS = 15e3;
1011
- var STATUS_TIMEOUT_MS = 5e3;
1013
+ var STATUS_TIMEOUT_MS = 2e4;
1012
1014
  var VERIFY_TIMEOUT_MS = 2e4;
1015
+ function opencodeConfigPath() {
1016
+ const base = process.env.REEVES_HOME || homedir2();
1017
+ const dir = join2(base, ".config", "opencode");
1018
+ const jsonc = join2(dir, "opencode.jsonc");
1019
+ const json = join2(dir, "opencode.json");
1020
+ if (existsSync2(json)) return json;
1021
+ if (existsSync2(jsonc)) return jsonc;
1022
+ return json;
1023
+ }
1024
+ function readOpencodeConfig(path) {
1025
+ if (!existsSync2(path)) return {};
1026
+ const raw = readFileSync2(path, "utf-8").trim();
1027
+ if (!raw) return {};
1028
+ return JSON.parse(raw);
1029
+ }
1030
+ function opencodeMcpEntry(cmd) {
1031
+ return { type: "local", command: [cmd.command, ...cmd.args], enabled: true };
1032
+ }
1033
+ function opencodeAttached() {
1034
+ try {
1035
+ const cfg = readOpencodeConfig(opencodeConfigPath());
1036
+ const mcp = cfg.mcp;
1037
+ return !!mcp && typeof mcp === "object" && SERVER_NAME in mcp;
1038
+ } catch {
1039
+ return false;
1040
+ }
1041
+ }
1042
+ function opencodeAttach(cmd) {
1043
+ const path = opencodeConfigPath();
1044
+ const cfg = readOpencodeConfig(path);
1045
+ if (!cfg.$schema) cfg.$schema = "https://opencode.ai/config.json";
1046
+ const mcp = typeof cfg.mcp === "object" && cfg.mcp !== null ? cfg.mcp : {};
1047
+ mcp[SERVER_NAME] = opencodeMcpEntry(cmd);
1048
+ cfg.mcp = mcp;
1049
+ mkdirSync2(dirname2(path), { recursive: true });
1050
+ writeFileSync2(path, `${JSON.stringify(cfg, null, 2)}
1051
+ `, "utf-8");
1052
+ }
1053
+ function opencodeDetach() {
1054
+ const path = opencodeConfigPath();
1055
+ if (!existsSync2(path)) return;
1056
+ const cfg = readOpencodeConfig(path);
1057
+ const mcp = cfg.mcp;
1058
+ if (mcp && SERVER_NAME in mcp) {
1059
+ delete mcp[SERVER_NAME];
1060
+ writeFileSync2(path, `${JSON.stringify(cfg, null, 2)}
1061
+ `, "utf-8");
1062
+ }
1063
+ }
1013
1064
  function resolveLaunchCmd(entry = process.argv[1]) {
1014
1065
  if (entry) {
1015
1066
  try {
@@ -1063,10 +1114,11 @@ var HOSTS = [
1063
1114
  list: ["mcp", "list"]
1064
1115
  },
1065
1116
  {
1066
- // opencode's `mcp add` prompts interactively and has no remove subcommand,
1067
- // so we cannot attach or detach it without a prompt. Report it as manual.
1117
+ // opencode's `mcp add` prompts interactively for a local server's command, so
1118
+ // we attach it by writing its config JSON directly instead.
1068
1119
  provider: "opencode",
1069
- list: ["mcp", "list"]
1120
+ list: ["mcp", "list"],
1121
+ file: { attach: opencodeAttach, detach: opencodeDetach, attached: opencodeAttached }
1070
1122
  }
1071
1123
  ];
1072
1124
  function hostBin(host) {
@@ -1120,25 +1172,33 @@ function hostStatus() {
1120
1172
  bin: hostBin(host),
1121
1173
  label: hostLabel(host),
1122
1174
  installed,
1123
- attached: installed && isAttached(host),
1124
- manual: host.add === void 0
1175
+ attached: installed && (host.file ? host.file.attached() : isAttached(host)),
1176
+ manual: host.add === void 0 && host.file === void 0
1125
1177
  };
1126
1178
  });
1127
1179
  }
1128
1180
  function attach(key, force = false) {
1129
1181
  const host = findHost(key);
1130
1182
  const label = hostLabel(host);
1131
- if (!host.add) {
1183
+ if (!host.add && !host.file) {
1132
1184
  return {
1133
1185
  key,
1134
1186
  label,
1135
1187
  ok: false,
1136
- message: `${label} must be added manually: in OpenCode, add a stdio MCP server named "${SERVER_NAME}" that runs reevesagents mcp`
1188
+ message: `${label} must be added manually: add a stdio MCP server named "${SERVER_NAME}" that runs reevesagents mcp`
1137
1189
  };
1138
1190
  }
1139
1191
  if (!isInstalled(hostBin(host))) {
1140
1192
  return { key, label, ok: false, message: `${hostBin(host)} is not installed` };
1141
1193
  }
1194
+ if (host.file) {
1195
+ try {
1196
+ host.file.attach(resolveLaunchCmd());
1197
+ return { key, label, ok: true, message: force ? "reattached" : "attached" };
1198
+ } catch (err) {
1199
+ return { key, label, ok: false, message: `could not edit config (add it manually): ${cliError(err)}` };
1200
+ }
1201
+ }
1142
1202
  try {
1143
1203
  if (force && host.remove) {
1144
1204
  try {
@@ -1155,12 +1215,20 @@ function attach(key, force = false) {
1155
1215
  function detach(key) {
1156
1216
  const host = findHost(key);
1157
1217
  const label = hostLabel(host);
1158
- if (!host.remove) {
1218
+ if (!host.remove && !host.file) {
1159
1219
  return { key, label, ok: false, message: `${label} must be removed manually` };
1160
1220
  }
1161
1221
  if (!isInstalled(hostBin(host))) {
1162
1222
  return { key, label, ok: false, message: `${hostBin(host)} is not installed` };
1163
1223
  }
1224
+ if (host.file) {
1225
+ try {
1226
+ host.file.detach();
1227
+ return { key, label, ok: true, message: "detached" };
1228
+ } catch (err) {
1229
+ return { key, label, ok: false, message: cliError(err) };
1230
+ }
1231
+ }
1164
1232
  try {
1165
1233
  runHostCommand(host, host.remove);
1166
1234
  return { key, label, ok: true, message: "detached" };
@@ -1169,8 +1237,9 @@ function detach(key) {
1169
1237
  }
1170
1238
  }
1171
1239
  function attachAll(force = false) {
1172
- return HOSTS.filter((host) => host.add && isInstalled(hostBin(host))).map((host) => {
1173
- if (!force && isAttached(host)) {
1240
+ return HOSTS.filter((host) => (host.add || host.file) && isInstalled(hostBin(host))).map((host) => {
1241
+ const attached = host.file ? host.file.attached() : isAttached(host);
1242
+ if (!force && attached) {
1174
1243
  return { key: host.provider, label: hostLabel(host), ok: true, message: "already attached" };
1175
1244
  }
1176
1245
  return attach(host.provider, force);
@@ -1204,9 +1273,9 @@ async function verifyServerLaunch(cmd = resolveLaunchCmd()) {
1204
1273
 
1205
1274
  // src/core/doctor.ts
1206
1275
  import { execFileSync as execFileSync3 } from "child_process";
1207
- import { accessSync, constants, existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
1276
+ import { accessSync, constants, existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
1208
1277
  import { createRequire } from "module";
1209
- import { join as join2 } from "path";
1278
+ import { join as join3 } from "path";
1210
1279
  var MIN_NODE_VERSION = [20, 19, 0];
1211
1280
  function parseNodeVersion(version) {
1212
1281
  const clean = version.startsWith("v") ? version.slice(1) : version;
@@ -1232,7 +1301,7 @@ function nodeVersionCheck(rawVersion = process.version) {
1232
1301
  }
1233
1302
  function readProcVersion() {
1234
1303
  try {
1235
- return readFileSync2("/proc/version", "utf-8");
1304
+ return readFileSync3("/proc/version", "utf-8");
1236
1305
  } catch {
1237
1306
  return "";
1238
1307
  }
@@ -1305,7 +1374,7 @@ function checkProviderCompatibility() {
1305
1374
  };
1306
1375
  }
1307
1376
  function checkPathAccess(name, path) {
1308
- if (!existsSync2(path)) return { name, status: "warn", detail: `${path} (will be created on first use)` };
1377
+ if (!existsSync3(path)) return { name, status: "warn", detail: `${path} (will be created on first use)` };
1309
1378
  try {
1310
1379
  accessSync(path, constants.R_OK | constants.W_OK);
1311
1380
  return { name, status: "ok", detail: path };
@@ -1370,7 +1439,7 @@ function runDoctor() {
1370
1439
  checkProviderCompatibility(),
1371
1440
  checkPathAccess("state dir", stateRoot()),
1372
1441
  checkPathAccess("runs dir", runsDir()),
1373
- checkPathAccess("presets dir", join2(stateRoot(), "presets")),
1442
+ checkPathAccess("presets dir", join3(stateRoot(), "presets")),
1374
1443
  checkRunsState(),
1375
1444
  checkWebExtras(),
1376
1445
  checkMcpServerCommand()
@@ -1401,9 +1470,9 @@ function languageOption(code) {
1401
1470
  }
1402
1471
 
1403
1472
  // src/core/config.ts
1404
- import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, renameSync as renameSync2 } from "fs";
1405
- import { homedir as homedir2 } from "os";
1406
- import { join as join3, dirname as dirname2 } from "path";
1473
+ import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, renameSync as renameSync2 } from "fs";
1474
+ import { homedir as homedir3 } from "os";
1475
+ import { join as join4, dirname as dirname3 } from "path";
1407
1476
  var SCHEMA_VERSION = 2;
1408
1477
  var DEFAULT_GLOBAL = {
1409
1478
  peek_interval_ms: 5e3,
@@ -1418,11 +1487,11 @@ var DEFAULT_GLOBAL = {
1418
1487
  function configPath() {
1419
1488
  const base = process.env.REEVES_CONFIG;
1420
1489
  if (base) return base;
1421
- return join3(homedir2(), ".reeves", "config.json");
1490
+ return join4(homedir3(), ".reeves", "config.json");
1422
1491
  }
1423
1492
  function configExists() {
1424
1493
  try {
1425
- readFileSync3(configPath(), "utf-8");
1494
+ readFileSync4(configPath(), "utf-8");
1426
1495
  return true;
1427
1496
  } catch {
1428
1497
  return false;
@@ -1456,7 +1525,7 @@ function mergeDefaults(raw) {
1456
1525
  }
1457
1526
  function loadConfig() {
1458
1527
  try {
1459
- const content = readFileSync3(configPath(), "utf-8");
1528
+ const content = readFileSync4(configPath(), "utf-8");
1460
1529
  return mergeDefaults(JSON.parse(content));
1461
1530
  } catch {
1462
1531
  return defaultConfig();
@@ -1464,14 +1533,14 @@ function loadConfig() {
1464
1533
  }
1465
1534
  function saveConfig(cfg) {
1466
1535
  const path = configPath();
1467
- const dir = dirname2(path);
1468
- mkdirSync2(dir, { recursive: true });
1536
+ const dir = dirname3(path);
1537
+ mkdirSync3(dir, { recursive: true });
1469
1538
  const tmp = `${path}.tmp`;
1470
- writeFileSync2(tmp, JSON.stringify(cfg, null, 2), "utf-8");
1539
+ writeFileSync3(tmp, JSON.stringify(cfg, null, 2), "utf-8");
1471
1540
  try {
1472
1541
  renameSync2(tmp, path);
1473
1542
  } catch {
1474
- writeFileSync2(path, JSON.stringify(cfg, null, 2), "utf-8");
1543
+ writeFileSync3(path, JSON.stringify(cfg, null, 2), "utf-8");
1475
1544
  }
1476
1545
  return path;
1477
1546
  }
@@ -1526,23 +1595,23 @@ function setConfigValues(patch) {
1526
1595
  }
1527
1596
 
1528
1597
  // src/core/store.ts
1529
- import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, readdirSync as readdirSync2, unlinkSync as unlinkSync2, renameSync as renameSync3, existsSync as existsSync3, chmodSync as chmodSync2 } from "fs";
1530
- import { join as join4, dirname as dirname3 } from "path";
1598
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, readdirSync as readdirSync2, unlinkSync as unlinkSync2, renameSync as renameSync3, existsSync as existsSync4, chmodSync as chmodSync2 } from "fs";
1599
+ import { join as join5, dirname as dirname4 } from "path";
1531
1600
  function stateDir() {
1532
1601
  return stateRoot();
1533
1602
  }
1534
1603
  function presetsDir() {
1535
- return join4(stateDir(), "presets");
1604
+ return join5(stateDir(), "presets");
1536
1605
  }
1537
1606
  function atomicWrite(path, data) {
1538
- mkdirSync3(dirname3(path), { recursive: true });
1607
+ mkdirSync4(dirname4(path), { recursive: true });
1539
1608
  const tmp = `${path}.tmp`;
1540
- writeFileSync3(tmp, JSON.stringify(data, null, 2), "utf-8");
1609
+ writeFileSync4(tmp, JSON.stringify(data, null, 2), "utf-8");
1541
1610
  chmodSync2(tmp, 384);
1542
1611
  try {
1543
1612
  renameSync3(tmp, path);
1544
1613
  } catch {
1545
- writeFileSync3(path, JSON.stringify(data, null, 2), "utf-8");
1614
+ writeFileSync4(path, JSON.stringify(data, null, 2), "utf-8");
1546
1615
  }
1547
1616
  }
1548
1617
  function isEffort(value) {
@@ -1580,11 +1649,11 @@ function normalizePreset(raw) {
1580
1649
  }
1581
1650
  function listPresets() {
1582
1651
  const dir = presetsDir();
1583
- if (!existsSync3(dir)) return [];
1652
+ if (!existsSync4(dir)) return [];
1584
1653
  try {
1585
1654
  return readdirSync2(dir).filter((f) => f.endsWith(".json")).map((f) => {
1586
1655
  try {
1587
- return normalizePreset(JSON.parse(readFileSync4(join4(dir, f), "utf-8")));
1656
+ return normalizePreset(JSON.parse(readFileSync5(join5(dir, f), "utf-8")));
1588
1657
  } catch {
1589
1658
  return null;
1590
1659
  }
@@ -1595,17 +1664,17 @@ function listPresets() {
1595
1664
  }
1596
1665
  function loadPreset(name) {
1597
1666
  try {
1598
- return normalizePreset(JSON.parse(readFileSync4(join4(presetsDir(), `${name}.json`), "utf-8")));
1667
+ return normalizePreset(JSON.parse(readFileSync5(join5(presetsDir(), `${name}.json`), "utf-8")));
1599
1668
  } catch {
1600
1669
  return null;
1601
1670
  }
1602
1671
  }
1603
1672
  function savePreset(tree) {
1604
- atomicWrite(join4(presetsDir(), `${tree.name}.json`), tree);
1673
+ atomicWrite(join5(presetsDir(), `${tree.name}.json`), tree);
1605
1674
  }
1606
1675
  function deletePreset(name) {
1607
1676
  try {
1608
- unlinkSync2(join4(presetsDir(), `${name}.json`));
1677
+ unlinkSync2(join5(presetsDir(), `${name}.json`));
1609
1678
  } catch {
1610
1679
  }
1611
1680
  }
@@ -1653,19 +1722,19 @@ import { randomUUID as randomUUID2 } from "crypto";
1653
1722
  import stripAnsi from "strip-ansi";
1654
1723
 
1655
1724
  // src/core/provider-launch.ts
1656
- import { existsSync as existsSync4, statSync as statSync2 } from "fs";
1657
- import { homedir as homedir3 } from "os";
1658
- import { join as join5 } from "path";
1725
+ import { existsSync as existsSync5, statSync as statSync2 } from "fs";
1726
+ import { homedir as homedir4 } from "os";
1727
+ import { join as join6 } from "path";
1659
1728
  function expandHome(p) {
1660
- if (p === "~") return homedir3();
1661
- if (p.startsWith("~/")) return join5(homedir3(), p.slice(2));
1729
+ if (p === "~") return homedir4();
1730
+ if (p.startsWith("~/")) return join6(homedir4(), p.slice(2));
1662
1731
  return p;
1663
1732
  }
1664
1733
  function resolveWorkingDir(requested, fallback) {
1665
1734
  if (!requested) return fallback;
1666
1735
  const expanded = expandHome(requested.trim());
1667
1736
  if (!expanded) return fallback;
1668
- if (existsSync4(expanded) && statSync2(expanded).isDirectory()) return expanded;
1737
+ if (existsSync5(expanded) && statSync2(expanded).isDirectory()) return expanded;
1669
1738
  throw new Error(`Working directory does not exist: ${expanded}`);
1670
1739
  }
1671
1740
  function shellQuote(s) {
@@ -2308,4 +2377,4 @@ export {
2308
2377
  stopRun,
2309
2378
  openTmuxTarget
2310
2379
  };
2311
- //# sourceMappingURL=chunk-S2NWTREO.js.map
2380
+ //# sourceMappingURL=chunk-YDBE6CMQ.js.map
package/dist/cli.js CHANGED
@@ -1,26 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- installSkills,
4
- removeSkills,
5
- skillsStatus
6
- } from "./chunk-JDJW3WST.js";
7
2
  import {
8
3
  buildOnboardingState,
9
4
  runOnboarding,
10
5
  suggestedAgentPrompt,
11
6
  writeTuiOpenToken
12
- } from "./chunk-JZYM3JJE.js";
7
+ } from "./chunk-QWZH352G.js";
13
8
  import {
9
+ installSkills,
10
+ removeSkills,
11
+ skillsStatus,
14
12
  sweepAgents
15
- } from "./chunk-36AVBLVK.js";
13
+ } from "./chunk-DA4YL4DE.js";
16
14
  import {
17
15
  MODEL_CATALOG
18
- } from "./chunk-KHBI6CRH.js";
16
+ } from "./chunk-STFC6PVR.js";
19
17
  import {
20
18
  REEVESAGENTS_VERSION,
21
19
  listRunApprovals,
22
20
  resolveRunApproval
23
- } from "./chunk-23XREWJP.js";
21
+ } from "./chunk-AKAFR25Q.js";
24
22
  import {
25
23
  ALLOWED_KEYS,
26
24
  CONFIG_FIELDS,
@@ -62,7 +60,7 @@ import {
62
60
  startRunFromPreset,
63
61
  stopRun,
64
62
  verifyServerLaunch
65
- } from "./chunk-S2NWTREO.js";
63
+ } from "./chunk-YDBE6CMQ.js";
66
64
  import "./chunk-D24DQQ6V.js";
67
65
 
68
66
  // src/cli.ts
@@ -612,8 +610,11 @@ To connect ${state.attachable.join(", ")}, run: reevesagents setup --attach`);
612
610
  }
613
611
  return;
614
612
  }
615
- console.log("\nConnecting...");
613
+ console.log("\nSetting up...");
616
614
  const result = await runOnboarding();
615
+ if (result.skills.some((skill) => skill.ok)) {
616
+ console.log(" ok skill installed for skill-aware CLIs (Claude, Codex, Kimi, OpenCode)");
617
+ }
617
618
  for (const attached of result.attached) {
618
619
  console.log(` ${(attached.ok ? "ok" : "--").padEnd(3)} ${attached.key.padEnd(10)} ${attached.message}`);
619
620
  }
@@ -840,7 +841,7 @@ program.command("web").description("start the on-demand loopback web UI for agen
840
841
  });
841
842
  program.command("mcp").description("start the agent control MCP server over stdio (for CLIs that have it attached)").action(async () => {
842
843
  try {
843
- const { startAgentMcpServer } = await import("./server-IJXZCKR2.js");
844
+ const { startAgentMcpServer } = await import("./server-AAEBEKUH.js");
844
845
  await startAgentMcpServer();
845
846
  } catch (err) {
846
847
  console.error(err instanceof Error ? err.message : String(err));
@@ -854,7 +855,7 @@ async function runWeb(opts) {
854
855
  console.error(webExtrasMessage(extras.missing));
855
856
  process.exit(1);
856
857
  }
857
- const { startWebServer } = await import("./server-RXQBOR5F.js");
858
+ const { startWebServer } = await import("./server-7UHJTQRL.js");
858
859
  const parsed = opts.port ? Number.parseInt(opts.port, 10) : void 0;
859
860
  const handle = await startWebServer({
860
861
  port: parsed !== void 0 && Number.isFinite(parsed) ? parsed : void 0,
@@ -873,12 +874,12 @@ async function renderTui() {
873
874
  const [{ default: React }, { render }, { Router }] = await Promise.all([
874
875
  import("react"),
875
876
  import("ink"),
876
- import("./router-LLZ2L6WM.js")
877
+ import("./router-WHLEGC73.js")
877
878
  ]);
878
879
  try {
879
880
  await render(React.createElement(Router), { alternateScreen: false }).waitUntilExit();
880
881
  } finally {
881
- const { closeTuiWebServer } = await import("./tui-launch-Z6RYMGNH.js");
882
+ const { closeTuiWebServer } = await import("./tui-launch-5VWXIMN6.js");
882
883
  await closeTuiWebServer();
883
884
  }
884
885
  process.exit(0);
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  modelDisplayName,
7
7
  modelSourceForProvider,
8
8
  modelValuesForProvider
9
- } from "./chunk-KHBI6CRH.js";
9
+ } from "./chunk-STFC6PVR.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-S2NWTREO.js";
42
+ } from "./chunk-YDBE6CMQ.js";
43
43
  import "./chunk-D24DQQ6V.js";
44
44
  export {
45
45
  BIN,
@@ -2,23 +2,23 @@
2
2
  import {
3
3
  buildOnboardingState,
4
4
  readTuiOpenToken
5
- } from "./chunk-JZYM3JJE.js";
5
+ } from "./chunk-QWZH352G.js";
6
6
  import {
7
7
  sweepAgentsThrottled
8
- } from "./chunk-36AVBLVK.js";
8
+ } from "./chunk-DA4YL4DE.js";
9
9
  import {
10
10
  translate,
11
11
  translatePhrase
12
- } from "./chunk-2JHA6YK3.js";
12
+ } from "./chunk-XBNUWMMW.js";
13
13
  import {
14
14
  modelDisplayName,
15
15
  modelValuesForProvider
16
- } from "./chunk-KHBI6CRH.js";
16
+ } from "./chunk-STFC6PVR.js";
17
17
  import {
18
18
  REEVESAGENTS_VERSION,
19
19
  listRunApprovals,
20
20
  resolveRunApproval
21
- } from "./chunk-23XREWJP.js";
21
+ } from "./chunk-AKAFR25Q.js";
22
22
  import {
23
23
  CONFIG_FIELDS,
24
24
  DEFAULT_LANGUAGE,
@@ -73,11 +73,11 @@ import {
73
73
  startRunFromPreset,
74
74
  stateRoot,
75
75
  stopRun
76
- } from "./chunk-S2NWTREO.js";
76
+ } from "./chunk-YDBE6CMQ.js";
77
77
  import "./chunk-D24DQQ6V.js";
78
78
  import {
79
79
  startWebFromTui
80
- } from "./chunk-S5J4E3QZ.js";
80
+ } from "./chunk-IIQU2TK6.js";
81
81
 
82
82
  // src/tui/router.tsx
83
83
  import { createContext as createContext6, useContext as useContext6, useState as useState37, useCallback as useCallback5, useEffect as useEffect17, useRef as useRef4 } from "react";
@@ -6572,4 +6572,4 @@ export {
6572
6572
  nextHistoryOnReset,
6573
6573
  useRouter
6574
6574
  };
6575
- //# sourceMappingURL=router-LLZ2L6WM.js.map
6575
+ //# sourceMappingURL=router-WHLEGC73.js.map
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  localeCatalog,
4
4
  translatePhrase
5
- } from "./chunk-2JHA6YK3.js";
5
+ } from "./chunk-XBNUWMMW.js";
6
6
  import {
7
7
  modelValuesForProvider
8
- } from "./chunk-KHBI6CRH.js";
8
+ } from "./chunk-STFC6PVR.js";
9
9
  import {
10
10
  REEVESAGENTS_VERSION,
11
11
  listRunApprovals,
12
12
  resolveRunApproval
13
- } from "./chunk-23XREWJP.js";
13
+ } from "./chunk-AKAFR25Q.js";
14
14
  import {
15
15
  CONFIG_FIELDS,
16
16
  LANGUAGE_OPTIONS,
@@ -50,7 +50,7 @@ import {
50
50
  startRunFromPreset,
51
51
  stopRun,
52
52
  verifyServerLaunch
53
- } from "./chunk-S2NWTREO.js";
53
+ } from "./chunk-YDBE6CMQ.js";
54
54
  import "./chunk-D24DQQ6V.js";
55
55
 
56
56
  // src/web/server.ts
@@ -1016,4 +1016,4 @@ async function startWebServer(options = {}) {
1016
1016
  export {
1017
1017
  startWebServer
1018
1018
  };
1019
- //# sourceMappingURL=server-RXQBOR5F.js.map
1019
+ //# sourceMappingURL=server-7UHJTQRL.js.map
@@ -1,19 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  installSkills,
4
- skillsStatus
5
- } from "./chunk-JDJW3WST.js";
6
- import {
4
+ skillsStatus,
7
5
  sweepAgents,
8
6
  sweepAgentsThrottled
9
- } from "./chunk-36AVBLVK.js";
7
+ } from "./chunk-DA4YL4DE.js";
10
8
  import {
11
9
  REEVESAGENTS_VERSION,
12
10
  createRunApproval,
13
11
  listRunApprovals,
14
12
  readRunApproval,
15
13
  resolveRunApproval
16
- } from "./chunk-23XREWJP.js";
14
+ } from "./chunk-AKAFR25Q.js";
17
15
  import {
18
16
  ALLOWED_KEYS,
19
17
  BIN,
@@ -51,7 +49,7 @@ import {
51
49
  startRunFromPreset,
52
50
  startRunWithHead,
53
51
  stopRun
54
- } from "./chunk-S2NWTREO.js";
52
+ } from "./chunk-YDBE6CMQ.js";
55
53
  import "./chunk-D24DQQ6V.js";
56
54
 
57
55
  // src/mcp/server.ts
@@ -713,4 +711,4 @@ export {
713
711
  sessionRunIsLive,
714
712
  startAgentMcpServer
715
713
  };
716
- //# sourceMappingURL=server-IJXZCKR2.js.map
714
+ //# sourceMappingURL=server-AAEBEKUH.js.map
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  closeTuiWebServer,
4
4
  startWebFromTui
5
- } from "./chunk-S5J4E3QZ.js";
5
+ } from "./chunk-IIQU2TK6.js";
6
6
  export {
7
7
  closeTuiWebServer,
8
8
  startWebFromTui
9
9
  };
10
- //# sourceMappingURL=tui-launch-Z6RYMGNH.js.map
10
+ //# sourceMappingURL=tui-launch-5VWXIMN6.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reevesagents",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "Local tmux-first workspace manager for AI CLI agents",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.34.1",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: reevesagents
3
- description: Drive a team of other AI coding CLIs from the current session through the reevesagents MCP server. Use when the user asks to delegate work to another model, run several agents in parallel, or orchestrate a multi-agent team: spawn Claude Code, Codex, Kimi, Qwen, OpenCode and other installed CLIs each in its own tmux window, send them prompts, read their output, and stop or reap them. Assumes the reevesagents MCP server is attached to this CLI (run: reevesagents attach).
3
+ description: Drive a team of other AI coding CLIs from the current session through the reevesagents MCP server. Use when the user asks to delegate work to another model, run several agents in parallel, or orchestrate a multi-agent team. It can spawn Claude Code, Codex, Kimi, Qwen, OpenCode and other installed CLIs each in its own tmux window, send them prompts, read their output, and stop or reap them. Assumes the reevesagents MCP server is attached to this CLI (run reevesagents attach).
4
4
  ---
5
5
 
6
6
  # reevesagents: drive a team of AI CLIs
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- defaultTmuxAvailable,
4
- defaultTmuxTargetExists,
5
- killAgent,
6
- listAgents,
7
- loadConfig,
8
- nowMs
9
- } from "./chunk-S2NWTREO.js";
10
-
11
- // src/core/reaper.ts
12
- function sweepAgents(options = {}) {
13
- const haveTmux = options.targetExists ? true : (options.tmuxAvailable ?? defaultTmuxAvailable)();
14
- if (!haveTmux) return { reaped: [] };
15
- const targetExists = options.targetExists ?? defaultTmuxTargetExists;
16
- const now = options.now ?? nowMs;
17
- const maxLifetimeMs = options.maxLifetimeMs ?? loadConfig().global.max_lifetime_ms;
18
- const reaped = [];
19
- for (const agent of listAgents()) {
20
- if (agent.ended_at || agent.headless) continue;
21
- const ageMs = now() - new Date(agent.started_at).getTime();
22
- let reason = null;
23
- if (agent.tmux_window_id && !targetExists(agent.tmux_window_id)) {
24
- reason = "window-gone";
25
- } else if (maxLifetimeMs > 0 && ageMs > maxLifetimeMs) {
26
- reason = "lifetime-exceeded";
27
- }
28
- if (!reason) continue;
29
- try {
30
- killAgent(agent.id, options.driver ? { driver: options.driver } : {});
31
- reaped.push({
32
- agent_id: agent.id,
33
- run_id: agent.run_id,
34
- nickname: agent.nickname,
35
- reason,
36
- age_ms: Math.max(0, Math.round(ageMs))
37
- });
38
- } catch {
39
- }
40
- }
41
- return { reaped };
42
- }
43
- var lastSweepAt = 0;
44
- function sweepAgentsThrottled(minIntervalMs = 15e3, options = {}) {
45
- const now = (options.now ?? nowMs)();
46
- if (lastSweepAt !== 0 && now - lastSweepAt < minIntervalMs) return { reaped: [], swept: false };
47
- lastSweepAt = now;
48
- return { ...sweepAgents(options), swept: true };
49
- }
50
-
51
- export {
52
- sweepAgents,
53
- sweepAgentsThrottled
54
- };
55
- //# sourceMappingURL=chunk-36AVBLVK.js.map