arena-bridge 0.20.7 → 0.21.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 +11 -0
- package/README.md +20 -45
- package/SECURITY.md +5 -6
- package/package.json +2 -2
- package/src/approvals.mjs +4 -102
- package/src/browser.mjs +12 -26
- package/src/catalog.mjs +12 -12
- package/src/cli/index.mjs +1 -1
- package/src/cli.mjs +16 -104
- package/src/completion.mjs +2 -6
- package/src/config.mjs +1 -1
- package/src/direct.mjs +8 -29
- package/src/engine.mjs +4 -37
- package/src/errors.mjs +2 -2
- package/src/gate.mjs +7 -16
- package/src/hub.mjs +0 -2
- package/src/mac.mjs +12 -12
- package/src/mcp.mjs +1 -1
- package/src/prompt.mjs +8 -18
- package/src/telegram.mjs +3 -5
- package/src/version.mjs +1 -1
- package/src/trust.mjs +0 -168
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
The format follows [Keep a Changelog](https://keepachangelog.com/) and the project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## 0.21.0
|
|
8
|
+
|
|
9
|
+
### Removed
|
|
10
|
+
- Trust window removed completely (Python, Node, macOS app): `trust.py`/`trust.mjs`,
|
|
11
|
+
`arena-bridge trust` command, trust checks in the engine/gate, `trust_active` in
|
|
12
|
+
`/health`, auto-open on start/launch, and the "Approve for 3h" buttons.
|
|
13
|
+
- Approval gate removed: if the service is running, everything is allowed. Side-effecting
|
|
14
|
+
tools run without human confirmation; `requireApproval` is ignored (kept for
|
|
15
|
+
backwards compatibility). Historical approval records can still be listed and
|
|
16
|
+
settled (`approvals`/`approve` commands, `GET /approvals`, Telegram buttons).
|
|
17
|
+
|
|
7
18
|
## 0.20.7
|
|
8
19
|
|
|
9
20
|
### Fixed
|
package/README.md
CHANGED
|
@@ -300,16 +300,14 @@ Apple Silicon. Готовые сборки для обеих архитекту
|
|
|
300
300
|
| --- | --- |
|
|
301
301
|
| Статус | запущен/остановлен, версия, режим, число инструментов, публичный адрес, уведомления, Telegram |
|
|
302
302
|
| Управление | «Запустить» / «Остановить» (служба `ai.arena.bridge`), «Настроить…», «Скопировать промпт агенту» |
|
|
303
|
-
|
|
|
304
|
-
| Подтверждения | ожидающие запросы агента с кнопками «Разрешить» / «Разрешить на 3 ч» / «Отклонить» |
|
|
303
|
+
| Подтверждения | исторические запросы (новых не создаётся) с кнопками «Разрешить» / «Отклонить» |
|
|
305
304
|
| Журнал | команды с аргументами, клик по скриншоту или ax-tree открывает его целиком, «Сохранить…» в файл (с ax-tree) |
|
|
306
305
|
|
|
307
|
-
Окно следит за машиной само:
|
|
306
|
+
Окно следит за машиной само: статус и подтверждения обновляются каждые
|
|
308
307
|
несколько секунд, журнал — чуть реже. Кнопка обновления (⌘R) есть на всякий случай.
|
|
309
308
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
сразу, в карточке «Подтверждения».
|
|
309
|
+
Новых запросов на подтверждение не создаётся: если служба запущена, всё разрешено.
|
|
310
|
+
Исторические запросы (из старых версий) видны в карточке «Подтверждения».
|
|
313
311
|
|
|
314
312
|
«Настроить…» собирает конфиг, службу и запуск одной кнопкой: туннель (ngrok/cloudflared),
|
|
315
313
|
зарезервированный домен, authtoken, папки для агента, Telegram (токен бота и chat id).
|
|
@@ -375,15 +373,14 @@ Release downloads are ad-hoc signed, so after installing one, follow the grant s
|
|
|
375
373
|
|
|
376
374
|
## Подтверждения в Telegram: кнопки
|
|
377
375
|
|
|
378
|
-
|
|
376
|
+
Новых запросов на подтверждение не создаётся: если служба запущена, всё разрешено.
|
|
377
|
+
Исторические запросы (из старых версий) можно завершить кнопками:
|
|
379
378
|
|
|
380
379
|
```
|
|
381
|
-
Approve once
|
|
380
|
+
Approve once Deny
|
|
382
381
|
```
|
|
383
382
|
|
|
384
|
-
* **Approve once** — разрешить этот
|
|
385
|
-
* **Approve for 3h** — разрешить и открыть доверенное окно на 3 часа для этого же инструмента
|
|
386
|
-
(команды больше не спрашивают);
|
|
383
|
+
* **Approve once** — разрешить этот запрос;
|
|
387
384
|
* **Deny** — отклонить.
|
|
388
385
|
|
|
389
386
|
Кнопки работают и в приложении на Mac, и в Telegram; сообщение в Telegram после нажатия
|
|
@@ -391,25 +388,6 @@ Approve once Approve for 3h Deny
|
|
|
391
388
|
|
|
392
389
|
---
|
|
393
390
|
|
|
394
|
-
## Доверенное окно: работать без подтверждений
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
arena-bridge trust --for 2h # всё, на 2 часа
|
|
398
|
-
arena-bridge trust --for 30m --tools bash # только команды
|
|
399
|
-
arena-bridge trust --for 1h --paths ~/projects/my-app # только эта папка
|
|
400
|
-
arena-bridge trust --status
|
|
401
|
-
arena-bridge trust --status --json # для приложений и скриптов
|
|
402
|
-
arena-bridge trust --off
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
* окно снимает требование **подтверждения**, но не снимает защиту `protected` и системные ограничения;
|
|
406
|
-
* `--paths` ограничивает доверие конкретными папками; `bash` под такое ограничение не попадает —
|
|
407
|
-
чтобы доверять командам, укажите `--tools bash` явно;
|
|
408
|
-
* окно живёт локально (`~/.arena-bridge/trust.json`), агент открыть его не может;
|
|
409
|
-
* после истечения срока подтверждения возвращаются сами, а все действия остаются в журнале.
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
391
|
## Отдельные браузерные «кабинеты» агента
|
|
414
392
|
|
|
415
393
|
Агенту можно выдать несколько независимых профилей браузера — например «рабочий», «клиентский»,
|
|
@@ -457,17 +435,16 @@ arena-bridge browser close work # закрыть окно этого пр
|
|
|
457
435
|
| --- | --- | --- |
|
|
458
436
|
| `token` | агент | вызывать инструменты по HTTP/MCP |
|
|
459
437
|
| `deviceToken` | только устройство | подключаться к хабу |
|
|
460
|
-
| `localToken` | только вы |
|
|
438
|
+
| `localToken` | только вы | завершать исторические запросы |
|
|
461
439
|
|
|
462
|
-
* **Агент не может одобрить сам себя**: `POST /approvals/:id` требует локальный
|
|
440
|
+
* **Агент не может одобрить сам себя**: `POST /approvals/:id` требует локальный токен
|
|
441
|
+
(только для исторических запросов; новых не создаётся).
|
|
463
442
|
* **Защищённые пути**: список `protected` по умолчанию включает `~/.ssh`, `~/.aws`,
|
|
464
443
|
`~/.arena-bridge`, `~/.npmrc`, профили браузеров и ключи. `roots` сохраняется как
|
|
465
444
|
информационная настройка старых конфигураций и не является allowlist.
|
|
466
|
-
*
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
Для продолжения откройте `arena-bridge trust --for 1h` и повторите вызов один раз либо
|
|
470
|
-
согласуйте новый вызов, который пользователь подтвердит во время ожидания.
|
|
445
|
+
* **Подтверждений нет**: если служба запущена, всё разрешено — `bash`, запись, удаление,
|
|
446
|
+
управление вашим Chrome и десктопом выполняются без подтверждений и без окна доверия.
|
|
447
|
+
Защита `protected` и системные ограничения (macOS permissions) по-прежнему действуют.
|
|
471
448
|
* **Журнал**: `~/.arena-bridge/audit.log` (JSONL) — кто, что и когда вызвал.
|
|
472
449
|
* **Транспорт**: сервер слушает `127.0.0.1`, наружу — только туннель с HTTPS.
|
|
473
450
|
|
|
@@ -491,14 +468,13 @@ arena-bridge audit -n 50 # что происходило
|
|
|
491
468
|
| `hub` / `connect` | режим «хаб»: VPS принимает подключения многих машин |
|
|
492
469
|
| `prompt` | готовый промпт для чата с агентом |
|
|
493
470
|
| `tools` | каталог инструментов в JSON |
|
|
494
|
-
| `
|
|
495
|
-
| `approvals` / `approve <id>` | ожидающие подтверждения и ответ на них (`--deny`) |
|
|
471
|
+
| `approvals` / `approve <id>` | исторические подтверждения и ответ на них (`--deny`) |
|
|
496
472
|
| `audit [-n N]` | журнал действий |
|
|
497
473
|
| `logs [-n N] [--json]` | `bridge.log` (структурные логи, 5MB rotation) |
|
|
498
474
|
| `config get/set/edit/list` | управление `config.json` (`get <key>`, `set <key> <val>`, `--json`) |
|
|
499
475
|
| `cleanup [--days N]` | удалить старые артефакты + approvals (по умолчанию 14д) |
|
|
500
476
|
| `doctor [--fix] [--json]` | проверка установки, токенов, путей, Peekaboo, Chrome (`--fix` чинит dirs/perms) |
|
|
501
|
-
| `status [--json]` | рантайм-снапшот: config, url,
|
|
477
|
+
| `status [--json]` | рантайм-снапшот: config, url, pending, port, service |
|
|
502
478
|
| `url` / `open` | текущий публичный URL (open — открыть в браузере) |
|
|
503
479
|
| `completion bash|zsh|fish` | shell completion для bash/zsh/fish |
|
|
504
480
|
| `version` | установленная и последняя версии |
|
|
@@ -516,7 +492,7 @@ arena-bridge audit -n 50 # что происходило
|
|
|
516
492
|
GET /health liveness (без авторизации)
|
|
517
493
|
GET /tools каталог инструментов с JSON-схемами
|
|
518
494
|
GET /prompt этот промпт для агента
|
|
519
|
-
GET /approvals
|
|
495
|
+
GET /approvals исторические подтверждения
|
|
520
496
|
GET /audit журнал работы с артефактами
|
|
521
497
|
GET /audit/artifact сохранённый артефакт (entry=, file=)
|
|
522
498
|
POST /call {"tool":"bash","args":{...}}
|
|
@@ -539,7 +515,7 @@ curl -sS -X POST "https://<ваш-url>/call" \
|
|
|
539
515
|
|
|
540
516
|
```bash
|
|
541
517
|
npm install # зависимостей нет — только dev-тесты
|
|
542
|
-
npm test #
|
|
518
|
+
npm test # тесты Node: direct, MCP, hub, туннель, Chrome, десктоп
|
|
543
519
|
npm run test:python # 44 теста Python: то же самое
|
|
544
520
|
```
|
|
545
521
|
|
|
@@ -552,9 +528,8 @@ src/ Node-реализация (zero dependencies)
|
|
|
552
528
|
cdp.mjs клиент Chrome DevTools Protocol
|
|
553
529
|
browser.mjs 17 инструментов chrome_*
|
|
554
530
|
mac.mjs 20 инструментов mac_* (Peekaboo, Accessibility API)
|
|
555
|
-
trust.mjs окно доверия
|
|
556
531
|
policy.mjs проверка путей и protected-списка
|
|
557
|
-
engine.mjs каталог,
|
|
532
|
+
engine.mjs каталог, аудит
|
|
558
533
|
direct.mjs HTTP-сервер
|
|
559
534
|
hub.mjs хаб для нескольких машин
|
|
560
535
|
cli.mjs команды
|
|
@@ -569,7 +544,7 @@ arena_bridge/ тот же функционал на Python (stdlib only)
|
|
|
569
544
|
| туннель не поднимается | `cloudflared` по умолчанию использует QUIC и может быть заблокирован — `arena-bridge tunnel --protocol http2` (это поведение по умолчанию) |
|
|
570
545
|
| публичный адрес «живой», но агент не подключается, или Stop ругается на незакрытый адрес | `arena-bridge stop` закрывает и осиротевшие туннели прошлых запусков, затем Start заново |
|
|
571
546
|
| агент не видит файлы | проверьте `arena-bridge doctor` и `protected` в `~/.arena-bridge/config.json` |
|
|
572
|
-
| `APPROVAL_PENDING` |
|
|
547
|
+
| `APPROVAL_PENDING` | не возвращается: подтверждений нет, если служба запущена, всё разрешено |
|
|
573
548
|
| скриншоты не работают | `arena-bridge permissions` — выдайте Arena Bridge Screen Recording и Accessibility (see [macOS permissions](#macos-permissions)) |
|
|
574
549
|
| `peekaboo_not_found` | поставьте Peekaboo или укажите путь: `arena-bridge init` + `peekabooPath` в конфиге |
|
|
575
550
|
|
package/SECURITY.md
CHANGED
|
@@ -11,15 +11,14 @@ of the machine.
|
|
|
11
11
|
- **Localhost only.** The server binds `127.0.0.1` by default. Public access requires an explicit
|
|
12
12
|
tunnel.
|
|
13
13
|
- **Three separate tokens.** The agent token can only call tools, the device token only connects
|
|
14
|
-
a device to a hub, and the local token
|
|
15
|
-
token and cannot approve its own requests.
|
|
14
|
+
a device to a hub, and the local token settles historical approval requests. The agent never
|
|
15
|
+
receives the local token and cannot approve its own requests.
|
|
16
16
|
- **Path policy.** Every file operation is limited to the configured `roots`. A protected list
|
|
17
17
|
(`~/.ssh`, `~/.aws`, `~/.arena-bridge`, browser profiles, credential files) is denied even
|
|
18
18
|
inside a root.
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
policy — it only removes the approval requirement.
|
|
19
|
+
- **No approval gate, no trust window.** If the service is running, everything is allowed:
|
|
20
|
+
side-effecting tools run without human confirmation. Token auth and the path policy below
|
|
21
|
+
are the only gates.
|
|
23
22
|
- **Audit log.** Every call is appended to `~/.arena-bridge/audit.log` (0600) with the tool, the
|
|
24
23
|
arguments and the outcome.
|
|
25
24
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arena-bridge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Give a cloud AI agent (Arena.ai Agent Mode, Claude, Cursor, ...) controlled access to your own machine over HTTP/MCP: files, shell, Chrome and the macOS desktop, with an approval gate
|
|
3
|
+
"version": "0.21.0",
|
|
4
|
+
"description": "Give a cloud AI agent (Arena.ai Agent Mode, Claude, Cursor, ...) controlled access to your own machine over HTTP/MCP: files, shell, Chrome and the macOS desktop, with an audit log (no approval gate: if the service is running, everything is allowed).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"arena-bridge": "bin/arena-bridge.mjs"
|
package/src/approvals.mjs
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import
|
|
4
|
-
import { APPROVALS_DIR, ensureDirs } from './config.mjs';
|
|
5
|
-
import { sendTelegram, approvalKeyboard } from './telegram.mjs';
|
|
6
|
-
import { openTrust } from './trust.mjs';
|
|
7
|
-
|
|
8
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
3
|
+
import { APPROVALS_DIR } from './config.mjs';
|
|
9
4
|
|
|
10
5
|
function fileOf(id) {
|
|
11
6
|
return path.join(APPROVALS_DIR, `${id}.json`);
|
|
@@ -57,47 +52,13 @@ export function decide(id, decision, by = 'cli') {
|
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
/**
|
|
60
|
-
* Settle a request
|
|
61
|
-
*
|
|
62
|
-
* every tool for every agent is trusted until `until`.
|
|
55
|
+
* Settle a historical request. Kept for backwards compatibility;
|
|
56
|
+
* trustSec is ignored (there is no trust window).
|
|
63
57
|
*/
|
|
64
58
|
export function settle(id, decision, by = 'cli', { trustSec = 0 } = {}) {
|
|
65
|
-
|
|
66
|
-
if (res.ok && trustSec > 0) {
|
|
67
|
-
openTrust({
|
|
68
|
-
until: Date.now() + trustSec * 1000,
|
|
69
|
-
tools: [], // blanket: all tools, any agent
|
|
70
|
-
paths: [],
|
|
71
|
-
}, { via: 'approval' });
|
|
72
|
-
}
|
|
73
|
-
return res;
|
|
59
|
+
return decide(id, decision, by);
|
|
74
60
|
}
|
|
75
61
|
|
|
76
|
-
function redact(args) {
|
|
77
|
-
function scrub(v) {
|
|
78
|
-
if (Array.isArray(v)) return v.map(scrub);
|
|
79
|
-
if (v && typeof v === 'object') {
|
|
80
|
-
const out = {};
|
|
81
|
-
for (const [k, val] of Object.entries(v)) {
|
|
82
|
-
if (/token|secret|password|authorization/i.test(k)) out[k] = '***';
|
|
83
|
-
else out[k] = scrub(val);
|
|
84
|
-
}
|
|
85
|
-
return out;
|
|
86
|
-
}
|
|
87
|
-
return v;
|
|
88
|
-
}
|
|
89
|
-
const clone = scrub({ ...args });
|
|
90
|
-
if (typeof clone.command === 'string' && clone.command.length > 4000) {
|
|
91
|
-
clone.command = clone.command.slice(0, 4000) + '…';
|
|
92
|
-
}
|
|
93
|
-
return clone;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Create a pending approval request and wait for a local human decision.
|
|
98
|
-
* The request lives in a file so that the `arena-bridge approve` CLI (a separate
|
|
99
|
-
* process) can pick it up.
|
|
100
|
-
*/
|
|
101
62
|
export function pruneApprovals(days = 14) {
|
|
102
63
|
if (!fs.existsSync(APPROVALS_DIR)) return { removed: 0 };
|
|
103
64
|
const cutoff = Date.now() - days * 86400000;
|
|
@@ -116,62 +77,3 @@ export function pruneApprovals(days = 14) {
|
|
|
116
77
|
}
|
|
117
78
|
return { removed };
|
|
118
79
|
}
|
|
119
|
-
|
|
120
|
-
export async function requestApproval(tool, args, cfg) {
|
|
121
|
-
ensureDirs();
|
|
122
|
-
const id = crypto.randomUUID();
|
|
123
|
-
const now = Date.now();
|
|
124
|
-
const rec = {
|
|
125
|
-
id,
|
|
126
|
-
tool,
|
|
127
|
-
args: redact(args),
|
|
128
|
-
status: 'pending',
|
|
129
|
-
createdAt: now,
|
|
130
|
-
expiresAt: now + (cfg.approvalTtlSec ?? 900) * 1000,
|
|
131
|
-
decidedAt: null,
|
|
132
|
-
decidedBy: null,
|
|
133
|
-
};
|
|
134
|
-
// B8 atomic
|
|
135
|
-
{
|
|
136
|
-
const fp = fileOf(id); const tmp = fp + '.tmp';
|
|
137
|
-
fs.writeFileSync(tmp, JSON.stringify(rec, null, 2), { mode: 0o600 });
|
|
138
|
-
fs.renameSync(tmp, fp);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// tell the user about it right away, so a pending request is not a dead end
|
|
142
|
-
if (cfg.telegram?.enabled && cfg.telegram?.botToken) {
|
|
143
|
-
sendTelegram(cfg, {
|
|
144
|
-
title: 'Approval needed',
|
|
145
|
-
text:
|
|
146
|
-
`Tool: ${tool}\n` +
|
|
147
|
-
`id: ${id}\n` +
|
|
148
|
-
`Use the buttons below, reply /approve ${id} or /deny ${id}, or run: arena-bridge approve ${id}`,
|
|
149
|
-
buttons: approvalKeyboard(id),
|
|
150
|
-
}).catch(() => {});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const waitSec = Math.min(cfg.approvalWaitSec ?? 90, cfg.approvalTtlSec ?? 900);
|
|
154
|
-
const deadline = now + waitSec * 1000;
|
|
155
|
-
while (Date.now() < deadline) {
|
|
156
|
-
await sleep(400);
|
|
157
|
-
let cur;
|
|
158
|
-
try {
|
|
159
|
-
cur = JSON.parse(fs.readFileSync(fileOf(id), 'utf8'));
|
|
160
|
-
} catch {
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
if (cur.status === 'approved') return { approved: true, rec: cur };
|
|
164
|
-
if (cur.status !== 'pending') return { approved: false, rec: cur };
|
|
165
|
-
if (cur.expiresAt && Date.now() >= cur.expiresAt) {
|
|
166
|
-
return { approved: false, rec: expireIfNeeded(fileOf(id), cur) };
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const timedOut = expireIfNeeded(fileOf(id), JSON.parse(fs.readFileSync(fileOf(id), 'utf8')));
|
|
170
|
-
if (timedOut.status === 'pending') {
|
|
171
|
-
timedOut.status = 'timeout';
|
|
172
|
-
timedOut.decidedAt = Date.now();
|
|
173
|
-
timedOut.decidedBy = 'system';
|
|
174
|
-
{ const fp=fileOf(id); const tmp=fp+'.tmp'; fs.writeFileSync(tmp, JSON.stringify(timedOut, null, 2), {mode:0o600}); fs.renameSync(tmp, fp); }
|
|
175
|
-
}
|
|
176
|
-
return { approved: timedOut.status === 'approved', rec: timedOut };
|
|
177
|
-
}
|
package/src/browser.mjs
CHANGED
|
@@ -411,7 +411,7 @@ export class BrowserManager {
|
|
|
411
411
|
profile_name: profileName(args.profile),
|
|
412
412
|
ws_url: wsUrl,
|
|
413
413
|
tabs: [...session.tabs.values()].map((t) => ({ tab_id: t.targetId, title: t.title, url: t.url })),
|
|
414
|
-
note: 'This browser belongs to the agent
|
|
414
|
+
note: 'This browser belongs to the agent.',
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
417
|
|
|
@@ -441,7 +441,7 @@ export class BrowserManager {
|
|
|
441
441
|
ws_url: wsUrl,
|
|
442
442
|
tabs: tabs.map((t) => ({ tab_id: t.targetId, title: t.title, url: t.url })),
|
|
443
443
|
note:
|
|
444
|
-
'This is the user\'s own Chrome with their real profile.
|
|
444
|
+
'This is the user\'s own Chrome with their real profile.',
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
447
|
|
|
@@ -638,19 +638,13 @@ export class BrowserManager {
|
|
|
638
638
|
return session;
|
|
639
639
|
};
|
|
640
640
|
|
|
641
|
-
const requiresApproval = (args, ctx) => {
|
|
642
|
-
const session = ctx.browser.session(args.session_id);
|
|
643
|
-
// the agent's own browser is free; the user's real Chrome needs a human
|
|
644
|
-
return !(session && session.managed);
|
|
645
|
-
};
|
|
646
|
-
|
|
647
641
|
return [
|
|
648
642
|
{
|
|
649
643
|
name: 'chrome_launch',
|
|
650
644
|
description:
|
|
651
645
|
'Start a Chrome instance owned by the agent (its own profile, no personal data) and attach to it over CDP. ' +
|
|
652
646
|
'headless=true runs it without a window; headless=false opens a visible window. Use it for automated browsing, ' +
|
|
653
|
-
'screenshots and scraping.
|
|
647
|
+
'screenshots and scraping.',
|
|
654
648
|
approval: false,
|
|
655
649
|
schema: S(
|
|
656
650
|
{
|
|
@@ -700,7 +694,7 @@ export class BrowserManager {
|
|
|
700
694
|
name: 'chrome_attach',
|
|
701
695
|
description:
|
|
702
696
|
'Attach to a Chrome instance that is already running with --remote-debugging-port (typically the user\'s own ' +
|
|
703
|
-
'browser on port 9222, with their logged-in sessions).
|
|
697
|
+
'browser on port 9222, with their logged-in sessions).',
|
|
704
698
|
approval: false,
|
|
705
699
|
schema: S({ port: { type: 'number', description: 'CDP port (default 9222)' } }, []),
|
|
706
700
|
required: [],
|
|
@@ -729,8 +723,7 @@ export class BrowserManager {
|
|
|
729
723
|
"user's mouse cursor and does not steal OS focus — the window is not raised; only the selected tab " +
|
|
730
724
|
'changes. Some pages pause timers/rendering in background tabs, so activating the tab you are about ' +
|
|
731
725
|
'to work with makes interactions more reliable.',
|
|
732
|
-
approval:
|
|
733
|
-
approvalFor: requiresApproval,
|
|
726
|
+
approval: false,
|
|
734
727
|
schema: S({ session_id: { type: 'string' }, tab_id: { type: 'string' } }, []),
|
|
735
728
|
required: [],
|
|
736
729
|
handler: async (args, ctx) => {
|
|
@@ -743,8 +736,7 @@ export class BrowserManager {
|
|
|
743
736
|
{
|
|
744
737
|
name: 'chrome_open',
|
|
745
738
|
description: 'Open a URL in the browser (new tab by default).',
|
|
746
|
-
approval:
|
|
747
|
-
approvalFor: requiresApproval,
|
|
739
|
+
approval: false,
|
|
748
740
|
schema: S(
|
|
749
741
|
{
|
|
750
742
|
url: { type: 'string' },
|
|
@@ -777,8 +769,7 @@ export class BrowserManager {
|
|
|
777
769
|
{
|
|
778
770
|
name: 'chrome_navigate',
|
|
779
771
|
description: 'Navigate an existing tab to a URL.',
|
|
780
|
-
approval:
|
|
781
|
-
approvalFor: requiresApproval,
|
|
772
|
+
approval: false,
|
|
782
773
|
schema: S({ url: { type: 'string' }, session_id: { type: 'string' }, tab_id: { type: 'string' } }, ['url']),
|
|
783
774
|
required: ['url'],
|
|
784
775
|
handler: async (args, ctx) => {
|
|
@@ -880,8 +871,7 @@ export class BrowserManager {
|
|
|
880
871
|
'Find the visible text editor on the page (textarea, contenteditable or textbox), ' +
|
|
881
872
|
'optionally clear it, type text with real input events and read the value back. ' +
|
|
882
873
|
'No CSS selector needed.',
|
|
883
|
-
approval:
|
|
884
|
-
approvalFor: requiresApproval,
|
|
874
|
+
approval: false,
|
|
885
875
|
schema: S(
|
|
886
876
|
{
|
|
887
877
|
session_id: { type: 'string' },
|
|
@@ -931,8 +921,7 @@ export class BrowserManager {
|
|
|
931
921
|
name: 'chrome_click',
|
|
932
922
|
description:
|
|
933
923
|
'Click an element — by CSS selector or by visible text. Also accepts a zero-based index from the accessibility snapshot.',
|
|
934
|
-
approval:
|
|
935
|
-
approvalFor: requiresApproval,
|
|
924
|
+
approval: false,
|
|
936
925
|
schema: S(
|
|
937
926
|
{
|
|
938
927
|
session_id: { type: 'string' },
|
|
@@ -972,8 +961,7 @@ export class BrowserManager {
|
|
|
972
961
|
{
|
|
973
962
|
name: 'chrome_type',
|
|
974
963
|
description: 'Type text into an input field (by CSS selector) and optionally submit it with Enter.',
|
|
975
|
-
approval:
|
|
976
|
-
approvalFor: requiresApproval,
|
|
964
|
+
approval: false,
|
|
977
965
|
schema: S(
|
|
978
966
|
{
|
|
979
967
|
selector: { type: 'string' },
|
|
@@ -1014,8 +1002,7 @@ export class BrowserManager {
|
|
|
1014
1002
|
{
|
|
1015
1003
|
name: 'chrome_press',
|
|
1016
1004
|
description: 'Press a key in the page (Enter, Tab, Escape, ArrowUp/Down/Left/Right, Backspace, Delete, Space).',
|
|
1017
|
-
approval:
|
|
1018
|
-
approvalFor: requiresApproval,
|
|
1005
|
+
approval: false,
|
|
1019
1006
|
schema: S({ key: { type: 'string' }, session_id: { type: 'string' }, tab_id: { type: 'string' } }, ['key']),
|
|
1020
1007
|
required: ['key'],
|
|
1021
1008
|
handler: async (args, ctx) => {
|
|
@@ -1072,8 +1059,7 @@ export class BrowserManager {
|
|
|
1072
1059
|
name: 'chrome_evaluate',
|
|
1073
1060
|
description:
|
|
1074
1061
|
'Run arbitrary JavaScript in the page and return the result. Escape hatch for things the other tools do not cover.',
|
|
1075
|
-
approval:
|
|
1076
|
-
approvalFor: requiresApproval,
|
|
1062
|
+
approval: false,
|
|
1077
1063
|
schema: S({ expression: { type: 'string' }, session_id: { type: 'string' }, tab_id: { type: 'string' } }, ['expression']),
|
|
1078
1064
|
required: ['expression'],
|
|
1079
1065
|
handler: async (args, ctx) => {
|
package/src/catalog.mjs
CHANGED
|
@@ -25,8 +25,8 @@ export function toolCatalog() {
|
|
|
25
25
|
name: 'bash',
|
|
26
26
|
description:
|
|
27
27
|
'Run a shell command on the remote machine. Returns stdout, stderr and the exit code. ' +
|
|
28
|
-
'Use absolute paths; the working directory defaults to the configured base directory. This is a side-effecting operation
|
|
29
|
-
approval:
|
|
28
|
+
'Use absolute paths; the working directory defaults to the configured base directory. This is a side-effecting operation.',
|
|
29
|
+
approval: false,
|
|
30
30
|
schema: S({
|
|
31
31
|
command: { type: 'string', description: 'Shell command to execute' },
|
|
32
32
|
cwd: { type: 'string', description: 'Working directory (must be at the requested path)' },
|
|
@@ -86,8 +86,8 @@ export function toolCatalog() {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: 'write_file',
|
|
89
|
-
description: 'Create or overwrite a text file.
|
|
90
|
-
approval:
|
|
89
|
+
description: 'Create or overwrite a text file.',
|
|
90
|
+
approval: false,
|
|
91
91
|
schema: S({
|
|
92
92
|
path: { type: 'string' },
|
|
93
93
|
content: { type: 'string' },
|
|
@@ -115,7 +115,7 @@ export function toolCatalog() {
|
|
|
115
115
|
{
|
|
116
116
|
name: 'edit_file',
|
|
117
117
|
description: 'Replace an exact string inside a file (old_text must appear exactly once unless replace_all is true).',
|
|
118
|
-
approval:
|
|
118
|
+
approval: false,
|
|
119
119
|
schema: S({
|
|
120
120
|
path: { type: 'string' },
|
|
121
121
|
old_text: { type: 'string' },
|
|
@@ -284,8 +284,8 @@ export function toolCatalog() {
|
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
286
|
name: 'delete_path',
|
|
287
|
-
description: 'Delete a file or directory (recursively) on the remote machine.
|
|
288
|
-
approval:
|
|
287
|
+
description: 'Delete a file or directory (recursively) on the remote machine.',
|
|
288
|
+
approval: false,
|
|
289
289
|
schema: S({ path: { type: 'string' } }),
|
|
290
290
|
required: ['path'],
|
|
291
291
|
handler: async (args, ctx) => {
|
|
@@ -316,8 +316,8 @@ export function toolCatalog() {
|
|
|
316
316
|
},
|
|
317
317
|
{
|
|
318
318
|
name: 'file_put',
|
|
319
|
-
description: 'Upload a binary file (base64 payload).
|
|
320
|
-
approval:
|
|
319
|
+
description: 'Upload a binary file (base64 payload).',
|
|
320
|
+
approval: false,
|
|
321
321
|
schema: S({ path: { type: 'string' }, data_base64: { type: 'string' } }),
|
|
322
322
|
required: ['path', 'data_base64'],
|
|
323
323
|
handler: async (args, ctx) => {
|
|
@@ -446,7 +446,7 @@ export function toolCatalog() {
|
|
|
446
446
|
name: 'start_process',
|
|
447
447
|
description:
|
|
448
448
|
'Start a long-running background process (dev server, watcher, REPL). Returns a session_id to poll with read_process_output.',
|
|
449
|
-
approval:
|
|
449
|
+
approval: false,
|
|
450
450
|
schema: S({
|
|
451
451
|
command: { type: 'string' },
|
|
452
452
|
cwd: { type: 'string' },
|
|
@@ -586,8 +586,8 @@ export function toolCatalog() {
|
|
|
586
586
|
},
|
|
587
587
|
{
|
|
588
588
|
name: 'kill_process',
|
|
589
|
-
description: 'Terminate a running process session.
|
|
590
|
-
approval:
|
|
589
|
+
description: 'Terminate a running process session. ',
|
|
590
|
+
approval: false,
|
|
591
591
|
schema: S({
|
|
592
592
|
session_id: { type: 'string' },
|
|
593
593
|
signal: { type: 'string', description: 'SIGTERM (default) or SIGKILL' },
|
package/src/cli/index.mjs
CHANGED