reevesagents 1.7.3 → 1.7.5

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.
@@ -2,15 +2,17 @@
2
2
  import {
3
3
  localeCatalog,
4
4
  translatePhrase
5
- } from "./chunk-OVNVE2TJ.js";
5
+ } from "./chunk-BITRLLG5.js";
6
6
  import {
7
7
  modelValuesForProvider
8
- } from "./chunk-GNS5ULTD.js";
8
+ } from "./chunk-EZJQYBYP.js";
9
9
  import {
10
10
  REEVESAGENTS_VERSION,
11
11
  listRunApprovals,
12
- resolveRunApproval
13
- } from "./chunk-EXUYSBTC.js";
12
+ resolveRunApproval,
13
+ sweepAgentsThrottled,
14
+ sweepOrphanSessionsThrottled
15
+ } from "./chunk-4ARHWX5G.js";
14
16
  import {
15
17
  CONFIG_FIELDS,
16
18
  LANGUAGE_OPTIONS,
@@ -52,16 +54,16 @@ import {
52
54
  targetExists,
53
55
  tmuxAvailable,
54
56
  verifyServerLaunch
55
- } from "./chunk-GSWMKYSU.js";
56
- import "./chunk-D24DQQ6V.js";
57
+ } from "./chunk-HHNMES47.js";
58
+ import "./chunk-Q3WWQP2R.js";
57
59
 
58
- // src/web/server.ts
60
+ // src/surfaces/webui/server.ts
59
61
  import { createServer } from "http";
60
62
  import { readFileSync } from "fs";
61
63
  import { join, dirname } from "path";
62
64
  import { fileURLToPath } from "url";
63
65
 
64
- // src/web/guards.ts
66
+ // src/surfaces/webui/guards.ts
65
67
  import { URL } from "url";
66
68
  var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "::1"]);
67
69
  function stripBrackets(host) {
@@ -97,7 +99,7 @@ function isAllowedOrigin(originHeader, port) {
97
99
  return url.port === String(port);
98
100
  }
99
101
 
100
- // src/web/state.ts
102
+ // src/surfaces/webui/state.ts
101
103
  function monogram(nickname, provider) {
102
104
  const base = (nickname || provider).trim();
103
105
  const alnum = base.replace(/[^A-Za-z0-9]/g, "");
@@ -190,7 +192,7 @@ function listWebProviders() {
190
192
  }));
191
193
  }
192
194
 
193
- // src/web/client-shell.ts
195
+ // src/surfaces/webui/client-shell.ts
194
196
  var PALETTE = {
195
197
  bg: "#15191f",
196
198
  panel: "#1b2129",
@@ -288,7 +290,7 @@ function placeholderPage() {
288
290
  </html>`;
289
291
  }
290
292
 
291
- // src/web/bridge.ts
293
+ // src/surfaces/webui/bridge.ts
292
294
  import { execFileSync } from "child_process";
293
295
  import { randomBytes } from "crypto";
294
296
  import { URL as URL2 } from "url";
@@ -332,7 +334,7 @@ function disposeBridge(bridge) {
332
334
  } catch {
333
335
  }
334
336
  try {
335
- execFileSync("tmux", ["kill-session", "-t", bridge.viewer], { stdio: "ignore" });
337
+ execFileSync("tmux", ["kill-session", "-t", `=${bridge.viewer}`], { stdio: "ignore" });
336
338
  } catch {
337
339
  }
338
340
  try {
@@ -365,7 +367,7 @@ function openBridge(ws, id, bridges) {
365
367
  execFileSync("tmux", ["select-window", "-t", `${viewer}:${target.windowId}`], { stdio: "ignore" });
366
368
  } catch {
367
369
  try {
368
- execFileSync("tmux", ["kill-session", "-t", viewer], { stdio: "ignore" });
370
+ execFileSync("tmux", ["kill-session", "-t", `=${viewer}`], { stdio: "ignore" });
369
371
  } catch {
370
372
  }
371
373
  send(ws, { t: "e", m: "could not open a tmux view for this agent" });
@@ -441,7 +443,7 @@ function attachTerminalBridge(server, getPort) {
441
443
  };
442
444
  }
443
445
 
444
- // src/web/server.ts
446
+ // src/surfaces/webui/server.ts
445
447
  var HOST = "127.0.0.1";
446
448
  var DEFAULT_PORT = 8080;
447
449
  var DEFAULT_RANGE = 10;
@@ -509,7 +511,9 @@ function createSseHub() {
509
511
  let timer = null;
510
512
  let last = "";
511
513
  const snapshot = () => {
512
- autoCleanupRuns({ cleanStale: false });
514
+ sweepAgentsThrottled();
515
+ sweepOrphanSessionsThrottled();
516
+ autoCleanupRuns();
513
517
  return JSON.stringify(buildWebState());
514
518
  };
515
519
  const write = (res, payload) => {
@@ -742,7 +746,9 @@ async function handleRequest(req, res, ctx) {
742
746
  return;
743
747
  }
744
748
  if (method === "GET" && path === "/api/state") {
745
- autoCleanupRuns({ cleanStale: false });
749
+ sweepAgentsThrottled();
750
+ sweepOrphanSessionsThrottled();
751
+ autoCleanupRuns();
746
752
  sendJson(res, 200, {
747
753
  ...buildWebState(),
748
754
  providers: listWebProviders(),
@@ -984,7 +990,7 @@ async function startWebServer(options = {}) {
984
990
  const server = createServer((req, res) => {
985
991
  handleRequest(req, res, ctx).catch(() => {
986
992
  try {
987
- send2(res, 500, "internal error", "text/plain; charset=utf-8");
993
+ send2(res, 500, "server error", "text/plain; charset=utf-8");
988
994
  } catch {
989
995
  }
990
996
  });
@@ -997,7 +1003,7 @@ async function startWebServer(options = {}) {
997
1003
  boundPort = await listenWithFallback(server, basePort, range);
998
1004
  const url = `http://${HOST}:${boundPort}`;
999
1005
  if (options.open !== false) {
1000
- const { openBrowser } = await import("./open-browser-DRSIJQ37.js");
1006
+ const { openBrowser } = await import("./open-browser-IQ5MTCWZ.js");
1001
1007
  openBrowser(url);
1002
1008
  }
1003
1009
  return {
@@ -1016,4 +1022,4 @@ async function startWebServer(options = {}) {
1016
1022
  export {
1017
1023
  startWebServer
1018
1024
  };
1019
- //# sourceMappingURL=server-WLXS227K.js.map
1025
+ //# sourceMappingURL=server-GJTDNSX7.js.map
@@ -1,17 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  installSkills,
4
- skillsStatus,
5
- sweepAgents,
6
- sweepAgentsThrottled
7
- } from "./chunk-JX6SHZKB.js";
4
+ skillsStatus
5
+ } from "./chunk-YAR57K3U.js";
8
6
  import {
9
7
  REEVESAGENTS_VERSION,
10
8
  createRunApproval,
11
9
  listRunApprovals,
12
10
  readRunApproval,
13
- resolveRunApproval
14
- } from "./chunk-EXUYSBTC.js";
11
+ resolveRunApproval,
12
+ sweepAgents,
13
+ sweepAgentsThrottled,
14
+ sweepOrphanSessions,
15
+ sweepOrphanSessionsThrottled
16
+ } from "./chunk-4ARHWX5G.js";
15
17
  import {
16
18
  ALLOWED_KEYS,
17
19
  BIN,
@@ -49,10 +51,10 @@ import {
49
51
  startRunFromPreset,
50
52
  startRunWithHead,
51
53
  stopRun
52
- } from "./chunk-GSWMKYSU.js";
53
- import "./chunk-D24DQQ6V.js";
54
+ } from "./chunk-HHNMES47.js";
55
+ import "./chunk-Q3WWQP2R.js";
54
56
 
55
- // src/mcp/server.ts
57
+ // src/surfaces/mcp/server.ts
56
58
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
57
59
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
58
60
  import {
@@ -62,7 +64,7 @@ import {
62
64
  ReadResourceRequestSchema
63
65
  } from "@modelcontextprotocol/sdk/types.js";
64
66
 
65
- // src/mcp/host.ts
67
+ // src/surfaces/mcp/host.ts
66
68
  import { execFileSync } from "child_process";
67
69
  import { readFileSync } from "fs";
68
70
  import { basename } from "path";
@@ -105,7 +107,7 @@ function detectHostProvider() {
105
107
  }
106
108
  }
107
109
 
108
- // src/mcp/server.ts
110
+ // src/surfaces/mcp/server.ts
109
111
  var hostProvider = detectHostProvider();
110
112
  var sessionRunId = null;
111
113
  function ok(data) {
@@ -319,6 +321,7 @@ var TOOLS = [
319
321
  inputSchema: { type: "object", properties: {} },
320
322
  handler: () => {
321
323
  sweepAgentsThrottled();
324
+ sweepOrphanSessionsThrottled();
322
325
  return ok(listRuns().map((run) => ({ ...run, agents: listAgents(run.id) })));
323
326
  }
324
327
  },
@@ -469,9 +472,9 @@ var TOOLS = [
469
472
  },
470
473
  {
471
474
  name: "reap",
472
- description: "Sweep for zombie agents and end them: any whose tmux window has died, plus any older than max_lifetime_ms when that is set above 0 (see get_config). Returns each reaped agent with the reason (window-gone or lifetime-exceeded) and its age. This runs on its own in the background; call it to force an immediate sweep, e.g. after a crash or before relying on list.",
475
+ description: "Sweep for zombie agents and orphan tmux sessions: ends any agent whose tmux window has died or that is older than max_lifetime_ms when that is set above 0 (see get_config), and kills reeves-*/reevesweb_* sessions no live record owns. Returns each reaped agent with the reason (window-gone or lifetime-exceeded) and its age, plus the killed orphan session names. This runs on its own in the background; call it to force an immediate sweep, e.g. after a crash or before relying on list.",
473
476
  inputSchema: { type: "object", properties: {} },
474
- handler: () => ok(sweepAgents())
477
+ handler: () => ok({ ...sweepAgents(), killed_sessions: sweepOrphanSessions({ ignoreGrace: true }).killed })
475
478
  },
476
479
  {
477
480
  name: "get_config",
@@ -686,6 +689,10 @@ async function startAgentMcpServer() {
686
689
  sweepAgents();
687
690
  } catch {
688
691
  }
692
+ try {
693
+ sweepOrphanSessions();
694
+ } catch {
695
+ }
689
696
  }, BACKGROUND_REAP_INTERVAL_MS);
690
697
  reapTimer.unref();
691
698
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: MCP_TOOLS }));
@@ -701,7 +708,6 @@ async function startAgentMcpServer() {
701
708
  await server.connect(transport);
702
709
  }
703
710
  export {
704
- GUIDE_TEXT,
705
711
  MCP_INSTRUCTIONS,
706
712
  MCP_TOOLS,
707
713
  buildProviderCatalog,
@@ -711,4 +717,4 @@ export {
711
717
  sessionRunIsLive,
712
718
  startAgentMcpServer
713
719
  };
714
- //# sourceMappingURL=server-R2A7E5WC.js.map
720
+ //# sourceMappingURL=server-KHCFIUJH.js.map
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  closeTuiWebServer,
4
4
  startWebFromTui
5
- } from "./chunk-7K3XRI7L.js";
5
+ } from "./chunk-5K4BBZMS.js";
6
6
  export {
7
7
  closeTuiWebServer,
8
8
  startWebFromTui
9
9
  };
10
- //# sourceMappingURL=tui-launch-6V756ZBI.js.map
10
+ //# sourceMappingURL=tui-launch-XYYH3XEY.js.map
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "reevesagents",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "Local tmux-first workspace manager for AI CLI agents",
5
5
  "type": "module",
6
- "packageManager": "pnpm@10.34.1",
6
+ "packageManager": "pnpm@10.34.5",
7
7
  "bin": {
8
8
  "reevesagents": "dist/cli.js"
9
9
  },
@@ -32,12 +32,10 @@
32
32
  "render-mascot": "node scripts/render-mascot.mjs",
33
33
  "verify": "pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm smoke:cli && pnpm check:package",
34
34
  "verify:release": "pnpm verify && pnpm check:install-matrix",
35
- "release": "release-it",
36
- "postinstall": "node -e \"try{process.env.npm_config_global==='true'&&process.stdout.isTTY&&!process.env.CI&&process.stdout.write('\\nReevesAgents installed. Run: reevesagents attach to connect your AI CLIs, then restart them.\\n\\n')}catch(e){}\""
35
+ "postinstall": "node -e \"try{process.env.npm_config_global==='true'&&process.stdout.isTTY&&!process.env.CI&&process.stdout.write('\\nReevesAgents installed. Run: reevesagents attach to connect your AI CLIs, then restart them.\\n\\n')}catch(e){}\""
37
36
  },
38
37
  "dependencies": {
39
- "@modelcontextprotocol/sdk": "^1.29.0",
40
- "chalk": "^5.6.2",
38
+ "@modelcontextprotocol/sdk": "^1.30.0",
41
39
  "commander": "^14.0.3",
42
40
  "ink": "^7.0.2",
43
41
  "react": "^19.2.6",
@@ -48,21 +46,29 @@
48
46
  "@lydell/node-pty": "1.2.0-beta.12",
49
47
  "ws": "^8.21.0"
50
48
  },
49
+ "pnpm": {
50
+ "overrides": {
51
+ "@hono/node-server": "2.0.12",
52
+ "body-parser": "2.3.0",
53
+ "brace-expansion": "5.0.9",
54
+ "esbuild": "0.28.1",
55
+ "fast-uri": "3.1.5",
56
+ "hono": "4.12.34"
57
+ }
58
+ },
51
59
  "devDependencies": {
52
60
  "@eslint/js": "^10.0.1",
53
- "@release-it/conventional-changelog": "^11.0.1",
54
61
  "@types/node": "^25.7.0",
55
- "@types/react": "^19.2.14",
62
+ "@types/react": "19.2.18",
56
63
  "@types/ws": "^8.18.1",
57
- "@typescript-eslint/parser": "^8.59.3",
64
+ "@typescript-eslint/parser": "^8.65.0",
58
65
  "@xterm/addon-fit": "^0.11.0",
59
66
  "@xterm/xterm": "^6.0.0",
60
- "eslint": "10.3.0",
67
+ "eslint": "10.8.0",
61
68
  "ink-testing-library": "^4.0.0",
62
- "release-it": "^20.2.0",
63
69
  "tsup": "^8.5.1",
64
70
  "typescript": "^6.0.3",
65
- "vite": "^8.0.16",
71
+ "vite": "^8.1.0",
66
72
  "vitest": "^4.1.6"
67
73
  },
68
74
  "engines": {