reevesagents 2.2.1 → 2.4.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/AGENTS.md +1 -0
- package/CHANGELOG.md +20 -0
- package/README.md +16 -9
- package/dist/chunk-57DS2BWS.js +225 -0
- package/dist/{chunk-HTCENB3Q.js → chunk-BN4ATJYV.js} +2 -2
- package/dist/{chunk-XHP63Y64.js → chunk-E36TJDAX.js} +266 -20
- package/dist/{chunk-CJKEBBUI.js → chunk-FIMZIW2C.js} +132 -6
- package/dist/{chunk-QIHT27ZG.js → chunk-GUOOQHP5.js} +7 -1
- package/dist/{chunk-XEOWHTRQ.js → chunk-I3BSRNKV.js} +3 -2
- package/dist/{chunk-PVYM35RS.js → chunk-L3ZZEIJA.js} +3 -3
- package/dist/{chunk-DGLUP7Q7.js → chunk-MZVOPJIX.js} +2 -2
- package/dist/{chunk-PKMTELW4.js → chunk-QGPSMVWO.js} +3 -3
- package/dist/{chunk-QWUBYDUV.js → chunk-QXGJINKB.js} +3 -3
- package/dist/cli.js +13 -13
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2 -2
- package/dist/{router-S7KR2CIE.js → router-QTTTC7MF.js} +13 -8
- package/dist/{server-4OILK2LL.js → server-5IJOA2YM.js} +18 -11
- package/dist/{server-5U4NNV43.js → server-KAQMJCXB.js} +322 -11
- package/dist/{tui-launch-7WKLVYEH.js → tui-launch-LY6EIRN2.js} +2 -2
- package/dist/web/app.css +74 -0
- package/dist/web/app.js +230 -41
- package/dist/web/index.html +3 -1
- package/dist/web/insights-core.js +5 -3
- package/package.json +9 -8
package/AGENTS.md
CHANGED
|
@@ -89,6 +89,7 @@ provider in a spawn spec.
|
|
|
89
89
|
| `aider` | Aider | |
|
|
90
90
|
| `deepseek` | DeepSeek CLI | `deepseek-cli` |
|
|
91
91
|
| `gemini` | Gemini CLI | `gemini cli`, `gemini-cli` |
|
|
92
|
+
| `agy` | Antigravity CLI | `antigravity`, `antigravity cli`, `antigravity-cli`, `google antigravity` |
|
|
92
93
|
| `cline` | Cline CLI | `cline cli`, `cline-cli` |
|
|
93
94
|
| `crush` | Crush | `charm crush`, `charm-crush` |
|
|
94
95
|
| `goose` | Goose | |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.4.0](https://github.com/mertkayacs/reevesagents/compare/v2.3.0...v2.4.0) (2026-11-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **providers:** add Google Antigravity CLI (agy) provider and MCP host ([#217](https://github.com/mertkayacs/reevesagents/issues/217)) ([abeede6](https://github.com/mertkayacs/reevesagents/commit/abeede67a361a1feb83d66b17b3469063337c439))
|
|
9
|
+
|
|
10
|
+
## [2.3.0](https://github.com/mertkayacs/reevesagents/compare/v2.2.1...v2.3.0) (2026-11-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **flow:** show which task each agent is on, derived on read ([#200](https://github.com/mertkayacs/reevesagents/issues/200)) ([c9e7bb9](https://github.com/mertkayacs/reevesagents/commit/c9e7bb902d8cc820f4feba1936b09706589858bd))
|
|
16
|
+
* **web:** show agents waiting on a human in the Web UI ([#178](https://github.com/mertkayacs/reevesagents/issues/178)) ([97cb2cc](https://github.com/mertkayacs/reevesagents/commit/97cb2cc55966b71defd2e5944618d43ff9e9e326))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **i18n:** one term per language for the flow and its queue ([#201](https://github.com/mertkayacs/reevesagents/issues/201)) ([21ee11f](https://github.com/mertkayacs/reevesagents/commit/21ee11fd0fb5563a258b7dd7e2191e0155ee2b81))
|
|
22
|
+
|
|
3
23
|
## [2.2.1](https://github.com/mertkayacs/reevesagents/compare/v2.2.0...v2.2.1) (2026-11-15)
|
|
4
24
|
|
|
5
25
|
|
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
11
|
Open-source workspace that runs AI coding CLIs side by side on your machine.<br>
|
|
12
|
-
<b>
|
|
12
|
+
<b>26 CLIs, each in its own tmux window. One of them can drive the rest over MCP.</b>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<a href="https://www.npmjs.com/package/reevesagents"><img alt="npm version" src="https://img.shields.io/npm/v/reevesagents?style=flat-square&logo=npm&label=npm&color=006D77"></a>
|
|
17
17
|
<a href="LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-3b82f6?style=flat-square"></a>
|
|
18
18
|
<img alt="Node.js 22.12 or newer and tmux" src="https://img.shields.io/badge/Node.js%2022.12%2B%20and%20tmux-5FA04E?style=flat-square&logo=nodedotjs&logoColor=white">
|
|
19
|
-
<img alt="
|
|
19
|
+
<img alt="26 supported coding CLIs" src="https://img.shields.io/badge/CLIs-26%20supported-1A202C?style=flat-square">
|
|
20
20
|
<a href="https://github.com/mertkayacs/reevesagents"><img alt="GitHub stars" src="https://img.shields.io/github/stars/mertkayacs/reevesagents?style=flat-square&logo=github&color=8A6D3B"></a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</picture>
|
|
37
37
|
</p>
|
|
38
38
|
|
|
39
|
-
ReevesAgents is a free, open-source workspace for AI coding agents. It runs Claude Code, Codex, Kimi, OpenCode, Gemini CLI and 20 other coding CLIs side by side, each in its own tmux window, and gives you a terminal UI, a browser UI and a scriptable CLI over the same runs. Attach its MCP server to one CLI and that agent can spawn, read, steer and stop the others. Every CLI keeps its own login, and ReevesAgents keeps its state in a few JSON files under `~/.reeves`.
|
|
39
|
+
ReevesAgents is a free, open-source workspace for AI coding agents. It runs Claude Code, Codex, Kimi, OpenCode, Gemini CLI, Antigravity CLI and 20 other coding CLIs side by side, each in its own tmux window, and gives you a terminal UI, a browser UI and a scriptable CLI over the same runs. Attach its MCP server to one CLI and that agent can spawn, read, steer and stop the others. Every CLI keeps its own login, and ReevesAgents keeps its state in a few JSON files under `~/.reeves`.
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -46,8 +46,8 @@ You already use these CLIs, and you are already signed in to them. ReevesAgents
|
|
|
46
46
|
|
|
47
47
|
| | |
|
|
48
48
|
|---|---|
|
|
49
|
-
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/layers.svg" width="18" height="18" alt=""> **
|
|
50
|
-
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/network.svg" width="18" height="18" alt=""> **One agent drives the rest** | `reevesagents attach cc` gives Claude Code the MCP tools to spawn, read, steer and stop other agents. Codex, Kimi Code, Qwen Code, Hermes and
|
|
49
|
+
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/layers.svg" width="18" height="18" alt=""> **26 CLIs, one workspace** | Claude Code, Codex, Kimi, OpenCode, Hermes, Gemini CLI, Antigravity CLI and [19 more](#supported-clis) start from one command. Each runs as the real CLI in its own tmux window, so agents keep running after you close the UI. |
|
|
50
|
+
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/network.svg" width="18" height="18" alt=""> **One agent drives the rest** | `reevesagents attach cc` gives Claude Code the MCP tools to spawn, read, steer and stop other agents. Codex, Kimi Code, Qwen Code, Hermes, OpenCode and Antigravity CLI can host it too, and it stays off until you attach it ([details](docs/mcp.md)). |
|
|
51
51
|
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/key-round.svg" width="18" height="18" alt=""> **Your logins stay put** | Each CLI signs in the way it always does. ReevesAgents stores no API keys, adds no proxy, and redacts token-like text in tasks, notes and approvals before it writes state. |
|
|
52
52
|
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/app-window.svg" width="18" height="18" alt=""> **Four ways in** | A terminal UI, a Web UI with a live pane per agent, a CLI with `--json` output for scripts, and the MCP. All four read and write the same runs. |
|
|
53
53
|
| <img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/icons/folder-lock.svg" width="18" height="18" alt=""> **Plain local state** | A few JSON files under `~/.reeves`, with no database and no Docker. The Web UI answers on 127.0.0.1 only and rejects foreign Host and Origin headers ([guards](src/surfaces/webui/guards.ts)). |
|
|
@@ -75,7 +75,7 @@ You already use these CLIs, and you are already signed in to them. ReevesAgents
|
|
|
75
75
|
<img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/new-run-light.webp" alt="The New run dialog with a run name field and a grid of coding CLIs with their install state">
|
|
76
76
|
</picture>
|
|
77
77
|
<h3>Start a run from the browser</h3>
|
|
78
|
-
Choose one of the
|
|
78
|
+
Choose one of the 26 CLIs, a model and a permission mode. CLIs that are not installed are marked.
|
|
79
79
|
</td>
|
|
80
80
|
</tr>
|
|
81
81
|
<tr>
|
|
@@ -85,7 +85,7 @@ You already use these CLIs, and you are already signed in to them. ReevesAgents
|
|
|
85
85
|
<img src="https://raw.githubusercontent.com/mertkayacs/reevesagents/master/docs/assets/readme/agent-control-light.webp" alt="The Agent control dialog listing six host CLIs, with Claude Code, Codex and OpenCode attached">
|
|
86
86
|
</picture>
|
|
87
87
|
<h3>Let one agent drive the rest</h3>
|
|
88
|
-
Attach the MCP to Claude Code, Codex, Kimi Code, Qwen Code, Hermes or
|
|
88
|
+
Attach the MCP to Claude Code, Codex, Kimi Code, Qwen Code, Hermes, OpenCode or Antigravity CLI, then restart that CLI to load the tools.
|
|
89
89
|
</td>
|
|
90
90
|
<td width="50%" valign="top">
|
|
91
91
|
<picture>
|
|
@@ -98,7 +98,7 @@ You already use these CLIs, and you are already signed in to them. ReevesAgents
|
|
|
98
98
|
</tr>
|
|
99
99
|
</table>
|
|
100
100
|
|
|
101
|
-
<p align="center"><sub>The Web UI screenshots show a demo run of four Kilo Code agents on a sample repository. Any of the
|
|
101
|
+
<p align="center"><sub>The Web UI screenshots show a demo run of four Kilo Code agents on a sample repository. Any of the 26 CLIs works the same way.</sub></p>
|
|
102
102
|
|
|
103
103
|
## Features
|
|
104
104
|
|
|
@@ -121,7 +121,7 @@ You already use these CLIs, and you are already signed in to them. ReevesAgents
|
|
|
121
121
|
|
|
122
122
|
**Agent Control (MCP)**
|
|
123
123
|
|
|
124
|
-
- `reevesagents attach` connects every installed host CLI, or one by its id: `cc`, `codex`, `kimi`, `qwen`, `hermes` or `
|
|
124
|
+
- `reevesagents attach` connects every installed host CLI, or one by its id: `cc`, `codex`, `kimi`, `qwen`, `hermes`, `opencode` or `agy`. `hosts` shows the state and `detach <id>` removes it.
|
|
125
125
|
- The host gets tools to spawn agents, read their output, send text and keys, interrupt, stop, and handle approvals and presets. Workers get none of them unless you attach their CLI too.
|
|
126
126
|
- A Claude Code plugin ships in this repository, and the server is listed in the official MCP Registry as io.github.mertkayacs/reevesagents.
|
|
127
127
|
|
|
@@ -204,6 +204,7 @@ Use the id in a spawn spec such as `codex:tests`. Aliases like `claude` work the
|
|
|
204
204
|
| Qwen Code | `qwen` | yes |
|
|
205
205
|
| Aider | `aider` | |
|
|
206
206
|
| Gemini CLI | `gemini` | |
|
|
207
|
+
| Antigravity CLI | `agy` | yes |
|
|
207
208
|
| Cline CLI | `cline` | |
|
|
208
209
|
| Crush | `crush` | |
|
|
209
210
|
| Goose | `goose` | |
|
|
@@ -220,6 +221,12 @@ Use the id in a spawn spec such as `codex:tests`. Aliases like `claude` work the
|
|
|
220
221
|
| Cursor CLI | `cursor` | |
|
|
221
222
|
| Rovo Dev CLI | `rovo` | |
|
|
222
223
|
|
|
224
|
+
<sub>Antigravity CLI (`agy`) is the successor to Gemini CLI, and `gemini` is being superseded by it; `gemini` stays supported for now. Antigravity has no fixed model catalog: pick any id printed by `agy models` and it is forwarded with `--model`.</sub>
|
|
225
|
+
|
|
226
|
+
<sub>With permissions `skip`, ReevesAgents auto-accepts agy's folder-trust dialog, and agy remembers the folder as trusted afterwards. With `ask` it waits for you to answer the dialog in the pane.</sub>
|
|
227
|
+
|
|
228
|
+
<sub>agy rejects `--effort` for models that do not support it, and `--model` conflicts with `--effort` for models whose id already encodes an effort level, so set one or the other.</sub>
|
|
229
|
+
|
|
223
230
|
<sub>The binary on your PATH matches the id, except `claude` (cc), `kiro-cli` (kiro), `qodercli` (qoder), `cursor-agent` (cursor) and `acli` (rovo). `reevesagents providers` shows which of them it finds, with their aliases and suggested models.</sub>
|
|
224
231
|
|
|
225
232
|
## FAQ
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
execTmux,
|
|
4
|
+
listAgents,
|
|
5
|
+
listRuns,
|
|
6
|
+
realDriver,
|
|
7
|
+
redactSecrets,
|
|
8
|
+
sessionPaneIds,
|
|
9
|
+
updateAgent
|
|
10
|
+
} from "./chunk-FIMZIW2C.js";
|
|
11
|
+
|
|
12
|
+
// src/core/attention.ts
|
|
13
|
+
var SCAN_LINES = 40;
|
|
14
|
+
var BOX_CORNER = /[╭╰]/;
|
|
15
|
+
var NUMBERED_OPTION = /^\s*[│┃|]\s*(?:❯\s*)?\d+\.\s+\S/;
|
|
16
|
+
var NAV_HINT = /↑\/↓/;
|
|
17
|
+
var ANSWER_COUNTDOWN = /\(\s*\d+\s*s\s*\)/;
|
|
18
|
+
var APPROVAL_WORDS = [
|
|
19
|
+
"approv",
|
|
20
|
+
"approb",
|
|
21
|
+
"\u043E\u0434\u043E\u0431\u0440",
|
|
22
|
+
"\u0440\u0430\u0437\u0440\u0435\u0448",
|
|
23
|
+
"\u043E\u0442\u043A\u043B\u043E\u043D",
|
|
24
|
+
"\u043E\u043F\u0430\u0441\u043D",
|
|
25
|
+
"genehmig",
|
|
26
|
+
"freigabe",
|
|
27
|
+
"aprob",
|
|
28
|
+
"onay",
|
|
29
|
+
"\u0627\u0644\u0645\u0648\u0627\u0641\u0642",
|
|
30
|
+
"\u6279\u51C6",
|
|
31
|
+
"\u5371\u9669",
|
|
32
|
+
"consent",
|
|
33
|
+
"dangerous",
|
|
34
|
+
"risky",
|
|
35
|
+
"pericoloso",
|
|
36
|
+
"rischioso",
|
|
37
|
+
"tehlike"
|
|
38
|
+
];
|
|
39
|
+
var QUESTION_WORDS = [
|
|
40
|
+
"\u0432\u043E\u043F\u0440\u043E\u0441",
|
|
41
|
+
"question",
|
|
42
|
+
"frage",
|
|
43
|
+
"pregunta",
|
|
44
|
+
"pergunta",
|
|
45
|
+
"domanda",
|
|
46
|
+
"soru",
|
|
47
|
+
"\u95EE\u9898",
|
|
48
|
+
"\u0633\u0624\u0627\u0644"
|
|
49
|
+
];
|
|
50
|
+
function stripAnsi(text) {
|
|
51
|
+
return text.replace(/\u001b\][^\u0007]*\u0007/g, "").replace(/\u001b\[[0-9;?]*[ -/]*[@-~]/g, "").replace(/\r/g, "");
|
|
52
|
+
}
|
|
53
|
+
function cleanBoxLine(line) {
|
|
54
|
+
return line.replace(/^[\s│┃|╭╮╰╯─━═]+/, "").replace(/[\s│┃|╭╮╰╯─━═]+$/, "").trim();
|
|
55
|
+
}
|
|
56
|
+
function truncate(text, max = 140) {
|
|
57
|
+
return text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
|
|
58
|
+
}
|
|
59
|
+
function sanitizeDetail(text) {
|
|
60
|
+
return truncate(redactSecrets(text));
|
|
61
|
+
}
|
|
62
|
+
function containsAny(haystack, needles) {
|
|
63
|
+
const lower = haystack.toLowerCase();
|
|
64
|
+
return needles.some((needle) => lower.includes(needle));
|
|
65
|
+
}
|
|
66
|
+
function detectHermesAttention(paneText) {
|
|
67
|
+
const lines = stripAnsi(paneText).split("\n");
|
|
68
|
+
while (lines.length > 0 && (lines[lines.length - 1] ?? "").trim() === "") lines.pop();
|
|
69
|
+
const tail = lines.slice(-SCAN_LINES);
|
|
70
|
+
const text = tail.join("\n");
|
|
71
|
+
const hasModal = BOX_CORNER.test(text) && tail.some((line) => NUMBERED_OPTION.test(line)) && NAV_HINT.test(text) && ANSWER_COUNTDOWN.test(text);
|
|
72
|
+
if (hasModal) {
|
|
73
|
+
const optionIndex = tail.findIndex((line) => NUMBERED_OPTION.test(line));
|
|
74
|
+
let bodyStart = 0;
|
|
75
|
+
for (let i = (optionIndex === -1 ? tail.length : optionIndex) - 1; i >= 0; i -= 1) {
|
|
76
|
+
if (BOX_CORNER.test(tail[i] ?? "")) {
|
|
77
|
+
bodyStart = i + 1;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const body = tail.slice(bodyStart, optionIndex === -1 ? tail.length : optionIndex).map(cleanBoxLine).filter((line) => line.length > 0 && !line.startsWith("\u26A0"));
|
|
82
|
+
const detail = body.length > 0 ? body[body.length - 1] : "";
|
|
83
|
+
const bodyText = body.join(" ");
|
|
84
|
+
const asksQuestion = bodyText.includes("?") || bodyText.includes("\uFF1F");
|
|
85
|
+
const reason = asksQuestion ? "input" : containsAny(text, APPROVAL_WORDS) ? "approval" : containsAny(text, QUESTION_WORDS) ? "input" : "approval";
|
|
86
|
+
return { reason, detail: sanitizeDetail(detail) };
|
|
87
|
+
}
|
|
88
|
+
if (/BLOCKED:\s*Command was not approved/i.test(text)) {
|
|
89
|
+
return { reason: "approval", detail: sanitizeDetail("command was blocked, no approval could be delivered") };
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
var CODEX_PROMPT_QUESTION = /Would you like to run the following command\?/i;
|
|
94
|
+
var CODEX_PROMPT_HINT = /Press enter to confirm or esc to cancel/i;
|
|
95
|
+
var CODEX_SELECTED_OPTION = /^\s*[›>]\s*\d+\.\s+\S/;
|
|
96
|
+
var CODEX_OPTION = /^\s*\d+\.\s+\S/;
|
|
97
|
+
function lastIndexOfLine(lines, pattern, limit = lines.length) {
|
|
98
|
+
for (let index = Math.min(limit, lines.length) - 1; index >= 0; index -= 1) {
|
|
99
|
+
if (pattern.test(lines[index] ?? "")) return index;
|
|
100
|
+
}
|
|
101
|
+
return -1;
|
|
102
|
+
}
|
|
103
|
+
function detectCodexAttention(paneText) {
|
|
104
|
+
const lines = stripAnsi(paneText).split("\n");
|
|
105
|
+
while (lines.length > 0 && (lines[lines.length - 1] ?? "").trim() === "") lines.pop();
|
|
106
|
+
const tail = lines.slice(-SCAN_LINES);
|
|
107
|
+
const text = tail.join("\n");
|
|
108
|
+
const trimmed = tail.map((line) => line.trim());
|
|
109
|
+
const isChoiceList = trimmed.some((line) => CODEX_SELECTED_OPTION.test(line)) && trimmed.some((line) => CODEX_OPTION.test(line)) && CODEX_PROMPT_HINT.test(text);
|
|
110
|
+
if (!isChoiceList) return null;
|
|
111
|
+
const choicesAt = lastIndexOfLine(trimmed, CODEX_SELECTED_OPTION);
|
|
112
|
+
const questionAt = lastIndexOfLine(trimmed, CODEX_PROMPT_QUESTION, choicesAt);
|
|
113
|
+
if (questionAt === -1) return { reason: "approval", detail: "codex is waiting for command approval" };
|
|
114
|
+
const prompt = trimmed.slice(questionAt + 1, choicesAt);
|
|
115
|
+
const command = prompt.find((line) => line.startsWith("$ ") && line.length > 2);
|
|
116
|
+
const reason = prompt.find((line) => line.startsWith("Reason:"));
|
|
117
|
+
const detail = command ?? reason ?? "codex is waiting for command approval";
|
|
118
|
+
return { reason: "approval", detail: sanitizeDetail(detail) };
|
|
119
|
+
}
|
|
120
|
+
var OPENCODE_PROMPT_TITLE = /Permission required/i;
|
|
121
|
+
var OPENCODE_ALLOW_ONCE = /Allow once/i;
|
|
122
|
+
var OPENCODE_REJECT = /Reject\b/i;
|
|
123
|
+
function detectOpencodeAttention(paneText) {
|
|
124
|
+
const lines = stripAnsi(paneText).split("\n");
|
|
125
|
+
while (lines.length > 0 && (lines[lines.length - 1] ?? "").trim() === "") lines.pop();
|
|
126
|
+
const tail = lines.slice(-SCAN_LINES);
|
|
127
|
+
const text = tail.join("\n");
|
|
128
|
+
if (!OPENCODE_PROMPT_TITLE.test(text) || !OPENCODE_ALLOW_ONCE.test(text) || !OPENCODE_REJECT.test(text)) return null;
|
|
129
|
+
const trimmed = tail.map((line) => cleanBoxLine(line));
|
|
130
|
+
const buttonsAt = lastIndexOfLine(trimmed, OPENCODE_ALLOW_ONCE);
|
|
131
|
+
const titleAt = lastIndexOfLine(trimmed, OPENCODE_PROMPT_TITLE, buttonsAt);
|
|
132
|
+
if (titleAt === -1) return { reason: "approval", detail: "opencode is waiting for permission" };
|
|
133
|
+
const dialog = trimmed.slice(titleAt + 1, buttonsAt);
|
|
134
|
+
const command = dialog.find((line) => line.startsWith("$ ") && line.length > 2);
|
|
135
|
+
const kind = dialog.find((line) => line.startsWith("#"));
|
|
136
|
+
const detail = command ?? kind ?? "opencode is waiting for permission";
|
|
137
|
+
return { reason: "approval", detail: sanitizeDetail(detail) };
|
|
138
|
+
}
|
|
139
|
+
var DETECTORS = {
|
|
140
|
+
hermes: detectHermesAttention,
|
|
141
|
+
codex: detectCodexAttention,
|
|
142
|
+
opencode: detectOpencodeAttention
|
|
143
|
+
};
|
|
144
|
+
function detectAgentAttention(agent, paneText) {
|
|
145
|
+
const detector = DETECTORS[agent.provider];
|
|
146
|
+
if (!detector) return null;
|
|
147
|
+
return detector(paneText);
|
|
148
|
+
}
|
|
149
|
+
function nextAttentionState(previous, detected, at) {
|
|
150
|
+
if (!detected) return null;
|
|
151
|
+
if (previous && previous.reason === detected.reason && previous.detail === detected.detail) return previous;
|
|
152
|
+
return { reason: detected.reason, detail: detected.detail, since: at };
|
|
153
|
+
}
|
|
154
|
+
function defaultCapture(paneId) {
|
|
155
|
+
return execTmux(["capture-pane", "-p", "-S", String(-SCAN_LINES), "-t", paneId]);
|
|
156
|
+
}
|
|
157
|
+
function defaultSessionPanes(session) {
|
|
158
|
+
return sessionPaneIds(realDriver, session);
|
|
159
|
+
}
|
|
160
|
+
var lastSweepAt = 0;
|
|
161
|
+
function sweepAttention(options = {}) {
|
|
162
|
+
const capture = options.capture ?? defaultCapture;
|
|
163
|
+
const now = options.now ? options.now() : /* @__PURE__ */ new Date();
|
|
164
|
+
const at = now.toISOString();
|
|
165
|
+
const listRunsFn = options.runs ?? listRuns;
|
|
166
|
+
const listAgentsFn = options.agents ?? listAgents;
|
|
167
|
+
const update = options.update ?? updateAgent;
|
|
168
|
+
const panesBySession = /* @__PURE__ */ new Map();
|
|
169
|
+
const paneBelongsToAgent = (session, paneId) => {
|
|
170
|
+
if (options.paneInSession) return options.paneInSession(session, paneId);
|
|
171
|
+
let panes = panesBySession.get(session);
|
|
172
|
+
if (panes === void 0) {
|
|
173
|
+
panes = (options.sessionPanes ?? defaultSessionPanes)(session);
|
|
174
|
+
panesBySession.set(session, panes);
|
|
175
|
+
}
|
|
176
|
+
return panes.includes(paneId);
|
|
177
|
+
};
|
|
178
|
+
let changed = 0;
|
|
179
|
+
for (const run of listRunsFn()) {
|
|
180
|
+
if (run.ended_at) continue;
|
|
181
|
+
let agents;
|
|
182
|
+
try {
|
|
183
|
+
agents = listAgentsFn(run.id);
|
|
184
|
+
} catch {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
for (const agent of agents) {
|
|
188
|
+
const previous = agent.attention ?? null;
|
|
189
|
+
let detected = null;
|
|
190
|
+
if (!agent.ended_at && !agent.headless && agent.tmux_pane_id && paneBelongsToAgent(agent.tmux_session, agent.tmux_pane_id)) {
|
|
191
|
+
let paneText;
|
|
192
|
+
try {
|
|
193
|
+
paneText = capture(agent.tmux_pane_id);
|
|
194
|
+
} catch {
|
|
195
|
+
paneText = "";
|
|
196
|
+
}
|
|
197
|
+
const raw = detectAgentAttention(agent, paneText);
|
|
198
|
+
detected = raw ? { reason: raw.reason, detail: redactSecrets(raw.detail) } : null;
|
|
199
|
+
}
|
|
200
|
+
const next = nextAttentionState(previous, detected, at);
|
|
201
|
+
if (next?.reason === previous?.reason && next?.detail === previous?.detail && next?.since === previous?.since) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (next === null && previous === null) continue;
|
|
205
|
+
try {
|
|
206
|
+
update(run.id, agent.id, { attention: next });
|
|
207
|
+
changed += 1;
|
|
208
|
+
} catch {
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
lastSweepAt = now.getTime();
|
|
213
|
+
return changed;
|
|
214
|
+
}
|
|
215
|
+
function sweepAttentionThrottled(options = {}) {
|
|
216
|
+
const nowMs = options.now ? options.now().getTime() : Date.now();
|
|
217
|
+
const throttleMs = options.throttleMs ?? 1500;
|
|
218
|
+
if (nowMs - lastSweepAt < throttleMs) return 0;
|
|
219
|
+
return sweepAttention(options);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export {
|
|
223
|
+
sweepAttentionThrottled
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=chunk-57DS2BWS.js.map
|
|
@@ -28,7 +28,7 @@ async function startTuiWebServer() {
|
|
|
28
28
|
const { checkWebExtras, webExtrasMessage } = await import("./extras-MWGWGEPB.js");
|
|
29
29
|
const extras = await checkWebExtras();
|
|
30
30
|
if (!extras.ok) throw new Error(webExtrasMessage(extras.missing));
|
|
31
|
-
const { startWebServer } = await import("./server-
|
|
31
|
+
const { startWebServer } = await import("./server-KAQMJCXB.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-
|
|
51
|
+
//# sourceMappingURL=chunk-BN4ATJYV.js.map
|