agy-mcp-bridge 0.1.25 → 0.1.27
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/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Fastest first run: from inside the project you want to work on, `agy-mcp-bridge
|
|
|
18
18
|
|
|
19
19
|
`agy-mcp-bridge check | setup codex|claude|both | delegation on|off|status | skill install | config | update | help`. `--open` launches the web UI in your browser. Config and task history live in the user data directory (`%APPDATA%\agy-mcp-bridge`, `~/.config/agy-mcp-bridge`, `~/Library/Application Support/agy-mcp-bridge`; override with `BRIDGE_HOME`), so an upgrade never deletes them. `agy-mcp-bridge config` prints the real paths.
|
|
20
20
|
|
|
21
|
-
At startup the bridge probes each CLI. An agent that is missing or unsupported is marked unavailable and takes no task; if `agy` is unavailable, the default agent silently becomes the next enabled one, so check `agents_list` after changing machines. Priority and per-agent switches live under `agents` in `config/workspaces.json`. Verified against real agent execution on `agy` 1.4.3 and 1.4.
|
|
21
|
+
At startup the bridge probes each CLI. An agent that is missing or unsupported is marked unavailable and takes no task; if `agy` is unavailable, the default agent silently becomes the next enabled one, so check `agents_list` after changing machines. Priority and per-agent switches live under `agents` in `config/workspaces.json`. Verified against real agent execution on `agy` 1.4.3, 1.4.7, 1.4.8 and 1.4.9; other 1.4.x patches run with a logged warning; other majors are refused.
|
|
22
22
|
|
|
23
23
|
From a git clone instead of npm: `npm ci && npm run build && npm start`, then `npm run check` in a second terminal. `npm run dev` builds and runs; there is no hot reload, because an automatic restart would cut off a task mid-edit.
|
|
24
24
|
|
|
@@ -90,12 +90,12 @@ Four rules about these ids are easy to get wrong, all measured rather than infer
|
|
|
90
90
|
|
|
91
91
|
- `agents.enabled` must list **every profile id** you declare, not just the adapters. A profile missing there is silently disabled, and a pool of such members then refuses with `Unknown agent "<pool id>"` — a message that names the pool while the broken line is `enabled`. Omitting `enabled` entirely enables everything; the example keeps the key so you can see it exists, which means a new profile has to be added to that list too.
|
|
92
92
|
- A `codex` profile also needs the base `codex` id in `enabled`, because that is what makes the bridge probe the codex CLI at all. Without it the profile is unavailable **and reports no warning**, so `agents_list` shows a dead agent with no reason.
|
|
93
|
-
- `model` on a profile is read only for a `codex` profile.
|
|
93
|
+
- `model` on a profile is read only for a `codex` profile; an `antigravity` profile runs with the model you choose in the web UI.
|
|
94
94
|
- `priority` and `enabled` accept a pool id without complaining, but the default agent is matched against agent ids only — a pool there silently selects nothing. Name the pool in the `agent` argument of a task instead.
|
|
95
95
|
|
|
96
96
|
`agents.pools.<id>` groups profiles for quota handling. Delegating to a pool id picks the first healthy member. When a member stops with something that reads like an exhausted quota or rate limit, the bridge marks it cooling for `quota_cooldown_seconds` and re-runs **the same task** on the next member — each member at most once per task, after which the task fails instead of looping. The replaced attempt is kept on the record as `attempts[]` (agent, error, exit, log tails) so a reviewer can still see why the first CLI stopped, and the retry keeps holding the execution lock rather than releasing and re-taking it, so no second ordinary task slips into the gap.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
The owner's Settings reach an `antigravity` **profile** exactly as they reach `antigravity`, because they key on the adapter behind the id, not on the id: the model, the permission level, the effort, and the soft deadline with its `--log-file` and its extended `--print-timeout` are all on the command line of a profile task. Read that as a widening, not a cosmetic fix — before, a profile was locked to the CLI's own defaults and could not be given `--dangerously-skip-permissions` at all; now your permission level applies to its tasks too, so a profile is no more restricted than the agent it comes from.
|
|
99
99
|
|
|
100
100
|
Two knobs are opt-in because they widen what the bridge can reach. Neither is reachable from a task, and neither stays invisible: the codex pair is reported in `agents_list` warnings, and the XERJ pair in `/api/xerj/status` plus the refusal `code_search` gives while it is off.
|
|
101
101
|
|
|
@@ -6,6 +6,7 @@ export function antigravityAdapter(executable, defaultTransport, options = {}) {
|
|
|
6
6
|
return {
|
|
7
7
|
id: options.id ?? 'antigravity',
|
|
8
8
|
label: options.label ?? 'Antigravity',
|
|
9
|
+
family: 'antigravity',
|
|
9
10
|
capabilities: CAPABILITIES,
|
|
10
11
|
buildInvocation(task) {
|
|
11
12
|
const transport = task.promptTransport ?? defaultTransport;
|
package/dist/src/agents/codex.js
CHANGED
|
@@ -9,6 +9,7 @@ export function codexAdapter(command, options = {}) {
|
|
|
9
9
|
return {
|
|
10
10
|
id: options.id ?? 'codex',
|
|
11
11
|
label: options.label ?? 'Codex',
|
|
12
|
+
family: 'codex',
|
|
12
13
|
capabilities: CAPABILITIES,
|
|
13
14
|
buildInvocation(task) {
|
|
14
15
|
const resultFile = path.join(task.stateDirectory, 'results', `${task.taskId}.txt`);
|
|
@@ -3,7 +3,7 @@ import { access, readFile, realpath } from 'node:fs/promises';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { inside } from '../security/workspace.js';
|
|
5
5
|
/** Patch releases exercised with a real agent run; other 1.4.x patches still run but warn. */
|
|
6
|
-
export const VERIFIED_AGY_VERSIONS = ['1.4.3', '1.4.7'];
|
|
6
|
+
export const VERIFIED_AGY_VERSIONS = ['1.4.3', '1.4.7', '1.4.8', '1.4.9'];
|
|
7
7
|
/**
|
|
8
8
|
* Resolve a command without ever going through a shell. On Windows an npm-installed CLI is usually a `.cmd`
|
|
9
9
|
* shim; spawning it with shell:false fails, and spawning it through cmd.exe would allow argument injection.
|
|
@@ -183,7 +183,7 @@ export class TaskManager {
|
|
|
183
183
|
context: input.context === undefined ? null : redact(input.context), timeout_seconds: timeout,
|
|
184
184
|
client: meta.client ? redact(meta.client).slice(0, 100) : null,
|
|
185
185
|
agent: task.agent, isolation: input.isolation, owns: input.owns, autonomy,
|
|
186
|
-
model: agent?.adapter.
|
|
186
|
+
model: agent?.adapter.family === 'antigravity' ? await readModel(this.runtime.stateDirectory) : null,
|
|
187
187
|
permission: permissionState(this.runtime.stateDirectory).level,
|
|
188
188
|
effort: readEffort(this.runtime.stateDirectory)
|
|
189
189
|
}
|
|
@@ -312,7 +312,7 @@ export class TaskManager {
|
|
|
312
312
|
entry.request.permission = permission;
|
|
313
313
|
// Soft deadline (owner setting, off by default): agy gets the absolute limit as its own print timeout and a log file whose growth shows it is alive.
|
|
314
314
|
const soft = readSoftTimeout(this.runtime.stateDirectory);
|
|
315
|
-
const antigravity = agent.adapter.
|
|
315
|
+
const antigravity = agent.adapter.family === 'antigravity';
|
|
316
316
|
const absoluteLimit = Math.max(timeout, soft.limit_seconds);
|
|
317
317
|
let logFile;
|
|
318
318
|
if (antigravity && soft.enabled) {
|
package/docs/HARDENING.md
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
2. Task queued được validate lại trước launch. Chuyển sang running được ghi trước spawn để restore không kết luận sai rằng task chưa từng sửa file. Recheck trạng thái ngay trước spawn ngăn launch tiếp sau cancel/shutdown trong lúc chờ I/O.
|
|
9
9
|
3. POSIX SIGTERM cả nhóm, tối đa 8 giây rồi SIGKILL. Windows vẫn taskkill theo PID/cây thuộc server khi hủy; khi agent tự thoát, bridge còn giải phóng các cây con mà agent để lại (mục "Dọn cây tiến trình agent" dưới đây). Bridge watchdog chạy sau CLI timeout thêm 10 giây; cancellation có thể chờ thêm thời gian cleanup.
|
|
10
10
|
4. Startup và acquisition tự thu hồi lock chỉ khi cả hai PID trong owner đều hợp lệ và không còn sống. Record thiếu/hỏng, PID còn sống, ownership đổi hoặc owner cũ hơn lock thì giữ nguyên. `agy-mcp-bridge unlock` dùng cùng logic và không kill process. PID reuse và server crash vẫn cần xử lý thận trọng; chưa có Windows Job Object.
|
|
11
|
-
5. Family 1.4.x phải có đủ cờ bắt buộc trong help.
|
|
11
|
+
5. Family 1.4.x phải có đủ cờ bắt buộc trong help. Mỗi patch 1.4.3, 1.4.7, 1.4.8 và 1.4.9 đều có một lần `npm run test:live` đạt trên CLI thật (smoke + hủy task + shutdown; 1.4.8 và 1.4.9 thêm mission ba bước); patch 1.4.x khác có cảnh báo log/environment; minor/major khác không chạy.
|
|
12
12
|
6. Môi trường child mặc định chỉ có PATH, HOME, USERPROFILE, APPDATA, LOCALAPPDATA, TEMP, TMP, TMPDIR, SystemRoot, ComSpec, LANG, LC_*, XDG_*, HTTP_PROXY, HTTPS_PROXY, NO_PROXY; tên không phân biệt hoa thường. Tên chứa TOKEN/SECRET/PASSWORD/API_KEY chỉ được truyền khi có trong `extra_env_passthrough`. Các thiết lập auth/tool phụ thuộc env khác có thể cần opt-in.
|
|
13
13
|
7. Bridge không có bearer token. Chỉ bind 127.0.0.1 và giữ kiểm tra Host/Origin; bất kỳ tiến trình cục bộ cùng user đều có thể điều khiển agent, hủy task hoặc tắt server. Đây là mô hình tin cậy cục bộ có chủ đích, không dùng cho máy chia sẻ hoặc mạng ngoài.
|
|
14
|
-
8. Prompt mặc định vẫn đi qua argv với print/json, là đường đã được chạy thật với `agy` 1.4.3 và 1.4.
|
|
14
|
+
8. Prompt mặc định vẫn đi qua argv với print/json, là đường đã được chạy thật với `agy` 1.4.3, 1.4.7, 1.4.8 và 1.4.9. Chế độ `"prompt_transport": "stdin"` (tùy chọn, chưa mặc định) gửi NDJSON qua stdin để prompt không hiện trong danh sách tiến trình: một event user rồi end, stdout phải có đúng một event result hợp lệ. Chỉ bật khi đã xác nhận bằng một lần chạy `agy` thật; nếu định dạng không khớp, task fail và lỗi có gợi ý quay lại argv. Cap API 24000 ký tự và output cap không thay đổi; progress/init cũng tính vào output.
|
|
15
15
|
9. Output được gom vào mảng chunk; decode/redact snapshot tối đa mỗi giây, cuối task flush đầy đủ. Byte counts và truncated giữ ngữ nghĩa cũ.
|
|
16
16
|
10. Repeated SIGINT/SIGTERM không bỏ cleanup; in thông báo chờ.
|
|
17
17
|
11. Prompt nhận clientLabel thực tế; MCP/UI version đọc manifest. Prerelease được so từng phần, numeric so bằng BigInt, ví dụ rc.2 < rc.10; build metadata không ảnh hưởng precedence.
|
|
@@ -33,7 +33,7 @@ Chỉ thêm env khi cơ chế xác thực/tool của chính bạn cần nó. `"p
|
|
|
33
33
|
- Test mới bao phủ link nội bộ/ngoài workspace, queue revalidation và history transition, SIGTERM/escalation, PID lock recovery/unlock, patch-version/flag gates, env của executable giả, stdin/fallback/malformed results, snapshot throttling, repeated signals, client prompt, MCP/UI version và prerelease ordering.
|
|
34
34
|
- Một lần suite Windows gặp ECONNRESET trong test HTTP oversized-body có sẵn. Test riêng và suite chạy lại xanh; không nới assertion/body cap/auth để né lỗi.
|
|
35
35
|
- `agy --help` xác nhận `--input-format stream-json` đọc NDJSON từ stdin và cần output stream-json. Đối chiếu [tài liệu Google chính thức](https://antigravity.google/docs/cli/headless/) về user/message.content, result envelope và EOF.
|
|
36
|
-
- Probe CLI thật dùng **control_request cố ý không hỗ trợ**, không gửi user prompt: exit 2, result ERROR, num_turns 0, tất cả usage counters 0. Xác minh parser/đường lỗi; thành công của AI qua stdin chỉ được test bằng executable giả trong đợt này. Không tuyên bố đã kiểm thử agent thật cho patch
|
|
36
|
+
- Probe CLI thật dùng **control_request cố ý không hỗ trợ**, không gửi user prompt: exit 2, result ERROR, num_turns 0, tất cả usage counters 0. Xác minh parser/đường lỗi; thành công của AI qua stdin chỉ được test bằng executable giả trong đợt này. Không tuyên bố đã kiểm thử agent thật cho patch ngoài danh sách ở mục 5, hoặc cho transport mới.
|
|
37
37
|
- Không thay bind 127.0.0.1 hoặc Host/Origin; không mở LAN. Bridge cố ý không có xác thực — chỉ dùng trên máy do chủ máy kiểm soát.
|
|
38
38
|
|
|
39
39
|
## Dọn cây tiến trình agent (nhánh deepseek, 2026-10-26)
|
package/docs/VERIFICATION.md
CHANGED
|
@@ -14,6 +14,13 @@ Lần HTTP live cuối ngày khảo sát đạt: endpoint tạm 127.0.0.1:54791,
|
|
|
14
14
|
|
|
15
15
|
**Cập nhật 2026-10-26:** chạy lại `npm run test:live` với `agy 1.4.7` trên cùng máy, đạt đầy đủ: task trả đúng `BRIDGE_SMOKE_OK`, `response_verified=true`, `workspace_unchanged=true`, hủy task thật `canceled`, `shutdown_with_active_task_verified=true`, `server_exit_code=0`. Vì vậy 1.4.7 được thêm vào danh sách patch đã xác minh; các số liệu 1.4.3 phía trên giữ nguyên làm bằng chứng lịch sử.
|
|
16
16
|
|
|
17
|
+
**Cập nhật 2026-10-28 — `agy 1.4.8` và `agy 1.4.9`.** Hai patch này vào `VERIFIED_AGY_VERSIONS` vì mỗi patch có một lần `npm run test:live` đạt trên CLI thật, không phải vì một task lẻ chạy được:
|
|
18
|
+
|
|
19
|
+
- **1.4.8** — đợt nghiệm thu nhánh `antigravity` (bằng chứng ghi ở `docs/HANDOFF.md` mục 6.3): exit 0, `success: true`, `workspace_unchanged: true`, `reconnected: true`, `shutdown_with_active_task_verified: true`, smoke `completed` trả đúng `BRIDGE_SMOKE_OK`, mission ba bước `a → b → c` cả ba `completed`, sáu lời từ chối vẫn nguyên văn, task cancel `canceled` exit 1, `denied_actions: []`.
|
|
20
|
+
- **1.4.9** — ngày 2026-10-28, `node dist/scripts/live.js` trên `main` `17209c3` (trước bản sửa này, nên đường cài đặt vẫn báo `ready 1.4.9` kèm cảnh báo "only 1.4.3 and 1.4.7 have been verified"): **exit 0**, `success: true`, `started_at 08:59:49Z → finished_at 09:00:59Z` (70,7 s cho sáu task thật, một trong số đó bị hủy ngay), smoke `completed` exit 0 `BRIDGE_SMOKE_OK`, `response_verified=true`, `workspace_unchanged=true` (sentinel `UNCHANGED`, thư mục chỉ còn `sentinel.txt`), `reconnected=true`, mission `a/b/c` đều `completed` với `progress {total:3, completed:3, active:0, ready:0, pending:0, unmet:0}` và `plan_steps:3`, cancel `canceled` exit 1 `process_running=false` `denied_actions: []`, `server_exit_code=0`, `shutdown_with_active_task_verified=true` (PID 33664 đã chết khi server tắt).
|
|
21
|
+
|
|
22
|
+
Sau bản sửa, `antigravity_environment` trên đúng CLI 1.4.9 không còn cảnh báo patch chưa xác minh, và `limitations` đọc là "real execution was verified on 1.4.3, 1.4.7, 1.4.8 and 1.4.9".
|
|
23
|
+
|
|
17
24
|
Đã khởi động `npm start` thật trong terminal với PORT=0 tại 127.0.0.1:64646, không mở IDE/client để giữ server sống. `npm run check` gọi environment qua HTTP thành công, sau đó gửi Ctrl+C trong terminal: in Shutting down và Stopped. Check lại đúng endpoint đã tắt trả lỗi kết nối kèm hướng dẫn npm start/PORT, exit 1. Cổng thử đã đóng; không để lại HTTP server chạy nền. Shutdown có task chạy được xác minh riêng bằng harness SIGINT và agy thật; thao tác Ctrl+C terminal trực tiếp được thử khi không có task.
|
|
18
25
|
|
|
19
26
|
Chưa sửa cấu hình client thực tế. Tài liệu kết nối đã đối chiếu [Codex HTTP MCP](https://developers.openai.com/codex/mcp/) và [Claude Code MCP](https://code.claude.com/docs/en/mcp), cùng help CLI tại máy. Protocol handshake bằng SDK không chứng minh Codex/Claude Code đã được đăng ký hoặc tải tool.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-mcp-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "Local loopback HTTP MCP bridge that delegates bounded coding tasks to multiple agent CLIs (Antigravity, Codex) with optional parallel git worktrees",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|