agent-bridge-rs 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README-CN.md +73 -0
- package/README.md +72 -2
- package/bin/cli.js +58 -0
- package/package.json +48 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README-CN.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# agent-bridge 本地 Runtime(支持 Antigravity 与 Codex)
|
|
2
|
+
|
|
3
|
+
[English](README.md) | [简体中文](README-CN.md)
|
|
4
|
+
|
|
5
|
+
`agent-bridge` 是一个轻量级本地单例 PTY 运行时,支持 **2×2 有界宿主/执行器矩阵**:
|
|
6
|
+
|
|
7
|
+
- **Codex → Grok**(Codex 规划与终验,Grok 执行实现)
|
|
8
|
+
- **AGY → Codex**(Antigravity 规划路线与验收门禁,Codex 在指定 Worktree 编写代码与自测,AGY 独立看 Diff/跑测试并发起对抗式挑战打回)
|
|
9
|
+
- **AGY → Grok**(Antigravity 规划与挑战,Grok 执行实现)
|
|
10
|
+
|
|
11
|
+
运行时与旧版 `grok-bridge` 完全隔离(独立命名管道 `agent-bridge-runtime-v1-*`、默认 WebUI 端口 `127.0.0.1:47654`、独立环境变量前缀 `AGENT_BRIDGE_*`)。
|
|
12
|
+
|
|
13
|
+
## 快速开始
|
|
14
|
+
|
|
15
|
+
### 1. 环境准备
|
|
16
|
+
|
|
17
|
+
确认本机已安装并登录目标执行器 CLI(`codex` 和/或 `grok`):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
codex --version
|
|
21
|
+
grok --version
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. 安装与双宿主部署
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add -g agent-bridge-rs@latest
|
|
28
|
+
# 或源码构建: cargo build --release
|
|
29
|
+
agent-bridge install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`agent-bridge install` 会自动部署:
|
|
33
|
+
- **Codex Skill**:`~/.agents/skills/agent-bridge/`(`SKILL.md`、`agents/openai.yaml`、原生二进制)
|
|
34
|
+
- **Antigravity (AGY) 原生插件**:`~/.gemini/config/plugins/agent-bridge/`(`plugin.json`、`skills/codex-worker/SKILL.md`、`skills/grok-worker/SKILL.md`、原生二进制)
|
|
35
|
+
- **Lifecycle Hooks**:
|
|
36
|
+
- Grok Hooks → `~/.grok/hooks/agent-bridge.json`(若检测到旧版 `grok-bridge.json` 会提示你手动删除,不会自动擅删)
|
|
37
|
+
- Codex Hooks → **无损合并**进 `~/.codex/hooks.json`(保留用户已有的第三方 Hook,如 `rtk hook codex`)
|
|
38
|
+
|
|
39
|
+
### 3. 常用命令
|
|
40
|
+
|
|
41
|
+
`create` 和创建态 `terminal` 必须显式指定 `--worker grok|codex`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# AGY 调度 Codex(--always-approve 默认映射为 -s workspace-write -a never)
|
|
45
|
+
agent-bridge create --worker codex --cwd D:\repo\.worktrees\task\core --owner "任务标题" --prompt "Objective: ..." --always-approve
|
|
46
|
+
|
|
47
|
+
# 调度 Grok
|
|
48
|
+
agent-bridge create --worker grok --cwd D:\repo --owner "任务标题" --prompt "Objective: ..." --always-approve
|
|
49
|
+
|
|
50
|
+
# 等待空闲、读取输出、对抗式挑战打回、清理
|
|
51
|
+
agent-bridge wait --session <id> --for tui-idle --timeout-ms 300000
|
|
52
|
+
agent-bridge read --session <id> --cursor 0 --limit 4096 --wait-ms 5000
|
|
53
|
+
agent-bridge send --session <id> --text "Challenge round 1: ..."
|
|
54
|
+
agent-bridge close --session <id>
|
|
55
|
+
agent-bridge close-client # 一键关闭当前宿主对话(CODEX_THREAD_ID / ANTIGRAVITY_CONVERSATION_ID)派生的全部子进程
|
|
56
|
+
|
|
57
|
+
# WebUI 看板与人工接管终端
|
|
58
|
+
agent-bridge server ui # http://127.0.0.1:47654
|
|
59
|
+
agent-bridge terminal --session <id>
|
|
60
|
+
agent-bridge doctor --worker all
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 主要环境变量
|
|
64
|
+
|
|
65
|
+
| 变量 | 说明 |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `CODEX_BIN` / `GROK_BIN` | 覆盖默认执行器可执行文件路径 |
|
|
68
|
+
| `AGENT_BRIDGE_WEB_ADDR` | WebUI 回环监听地址(默认 `127.0.0.1:47654`) |
|
|
69
|
+
| `AGENT_BRIDGE_ALLOWED_ROOTS` | 限制允许的 `--cwd` 根目录 |
|
|
70
|
+
| `AGENT_BRIDGE_CLIENT_LEASE_SECONDS` | 宿主租约超时秒数(默认 `120`) |
|
|
71
|
+
| `AGENT_BRIDGE_ORPHAN_GRACE_SECONDS` | 空闲孤儿宽限期秒数(默认 `600`) |
|
|
72
|
+
| `AGENT_BRIDGE_CJK_FONT` / `AGENT_BRIDGE_CJK_FONT_INDEX` | 覆盖 egui 中文字体回退路径 |
|
|
73
|
+
| `AGENT_BRIDGE_DISABLE_UPDATE_CHECK` | 禁用 GitHub Release 更新检查 |
|
package/README.md
CHANGED
|
@@ -1,3 +1,73 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agent-bridge Local Runtime (Codex & Antigravity)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[English](README.md) | [简体中文](README-CN.md)
|
|
4
|
+
|
|
5
|
+
`agent-bridge` is a local, single-runtime PTY bridge supporting a bounded **2×2 supervisor/worker matrix**:
|
|
6
|
+
|
|
7
|
+
- **Codex → Grok** (`codex` host delegating implementation tasks to `grok`)
|
|
8
|
+
- **AGY → Codex** (`Antigravity` planning/reviewing/challenging while `codex` executes inside a worktree)
|
|
9
|
+
- **AGY → Grok** (`Antigravity` planning/reviewing/challenging while `grok` executes)
|
|
10
|
+
|
|
11
|
+
It is completely isolated from legacy `grok-bridge` (`agent-bridge-runtime-v1-*` IPC, `127.0.0.1:47654` WebUI, `AGENT_BRIDGE_*` env vars).
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Prerequisites
|
|
16
|
+
|
|
17
|
+
Ensure the target worker CLIs (`codex` and/or `grok`) are installed and authenticated on your machine:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
codex --version
|
|
21
|
+
grok --version
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Install & Deploy Host Integrations
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add -g agent-bridge-rs@latest
|
|
28
|
+
# or run from source: cargo build --release
|
|
29
|
+
agent-bridge install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`agent-bridge install` deploys:
|
|
33
|
+
- **Codex Skill**: `~/.agents/skills/agent-bridge/` (`SKILL.md`, `agents/openai.yaml`, binary)
|
|
34
|
+
- **Antigravity (AGY) Native Plugin**: `~/.gemini/config/plugins/agent-bridge/` (`plugin.json`, `skills/codex-worker/SKILL.md`, `skills/grok-worker/SKILL.md`, binary)
|
|
35
|
+
- **Lifecycle Hooks**:
|
|
36
|
+
- Grok hooks → `~/.grok/hooks/agent-bridge.json` (if legacy `grok-bridge.json` exists, a reminder is printed so you can delete it manually)
|
|
37
|
+
- Codex hooks → non-destructively merged into `~/.codex/hooks.json` (preserving any existing hooks such as `rtk hook codex`)
|
|
38
|
+
|
|
39
|
+
### 3. CLI Usage
|
|
40
|
+
|
|
41
|
+
`--worker grok|codex` is required for `create` and creation-mode `terminal`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# AGY -> Codex (defaults --always-approve to: -s workspace-write -a never)
|
|
45
|
+
agent-bridge create --worker codex --cwd /path/to/worktree --owner "my-task" --prompt "Objective: ..." --always-approve
|
|
46
|
+
|
|
47
|
+
# AGY/Codex -> Grok
|
|
48
|
+
agent-bridge create --worker grok --cwd /path/to/repo --owner "my-task" --prompt "Objective: ..." --always-approve
|
|
49
|
+
|
|
50
|
+
# Wait, inspect, challenge/rework, and clean up
|
|
51
|
+
agent-bridge wait --session <id> --for tui-idle --timeout-ms 300000
|
|
52
|
+
agent-bridge read --session <id> --cursor 0 --limit 4096 --wait-ms 5000
|
|
53
|
+
agent-bridge send --session <id> --text "Challenge round 1: ..."
|
|
54
|
+
agent-bridge close --session <id>
|
|
55
|
+
agent-bridge close-client # closes all sessions owned by current CODEX_THREAD_ID / ANTIGRAVITY_CONVERSATION_ID
|
|
56
|
+
|
|
57
|
+
# WebUI & interactive takeover terminal
|
|
58
|
+
agent-bridge server ui # http://127.0.0.1:47654
|
|
59
|
+
agent-bridge terminal --session <id>
|
|
60
|
+
agent-bridge doctor --worker all
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Environment Variables
|
|
64
|
+
|
|
65
|
+
| Variable | Purpose |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `CODEX_BIN` / `GROK_BIN` | Override worker executable path |
|
|
68
|
+
| `AGENT_BRIDGE_WEB_ADDR` | Loopback WebUI listen address (default `127.0.0.1:47654`) |
|
|
69
|
+
| `AGENT_BRIDGE_ALLOWED_ROOTS` | Path list restricting accepted `--cwd` roots |
|
|
70
|
+
| `AGENT_BRIDGE_CLIENT_LEASE_SECONDS` | Client heartbeat lease duration (default `120`) |
|
|
71
|
+
| `AGENT_BRIDGE_ORPHAN_GRACE_SECONDS` | Idle orphan cleanup grace period (default `600`) |
|
|
72
|
+
| `AGENT_BRIDGE_CJK_FONT` / `AGENT_BRIDGE_CJK_FONT_INDEX` | Override egui CJK fallback font |
|
|
73
|
+
| `AGENT_BRIDGE_DISABLE_UPDATE_CHECK` | Disable GitHub release update check |
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { existsSync } = require('node:fs');
|
|
5
|
+
const { dirname, join } = require('node:path');
|
|
6
|
+
|
|
7
|
+
const TARGETS = {
|
|
8
|
+
'win32:x64': ['@asural/agent-bridge-win32-x64', 'agent-bridge.exe'],
|
|
9
|
+
'win32:arm64': ['@asural/agent-bridge-win32-arm64', 'agent-bridge.exe'],
|
|
10
|
+
'linux:x64': ['@asural/agent-bridge-linux-x64', 'agent-bridge'],
|
|
11
|
+
'linux:arm64': ['@asural/agent-bridge-linux-arm64', 'agent-bridge'],
|
|
12
|
+
'darwin:x64': ['@asural/agent-bridge-darwin-x64', 'agent-bridge'],
|
|
13
|
+
'darwin:arm64': ['@asural/agent-bridge-darwin-arm64', 'agent-bridge'],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
(() => {
|
|
17
|
+
try {
|
|
18
|
+
const binary = resolveBinary();
|
|
19
|
+
const interactive = process.stdin.isTTY && process.stdout.isTTY;
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const result = spawnSync(binary, args, interactive
|
|
22
|
+
? { stdio: 'inherit', env: process.env, windowsHide: true }
|
|
23
|
+
: args.length > 0
|
|
24
|
+
? { stdio: ['ignore', 'inherit', 'inherit'], env: process.env, windowsHide: true }
|
|
25
|
+
: { stdio: ['inherit', 'inherit', 'inherit'], env: process.env, windowsHide: true });
|
|
26
|
+
if (result.error) throw result.error;
|
|
27
|
+
process.exit(result.status ?? (result.signal ? 1 : 0));
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.error(`[agent-bridge] ${err.message}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
|
|
34
|
+
function resolveBinary() {
|
|
35
|
+
if (process.env.AGENT_BRIDGE_BINARY) {
|
|
36
|
+
if (!existsSync(process.env.AGENT_BRIDGE_BINARY)) {
|
|
37
|
+
throw new Error(`AGENT_BRIDGE_BINARY not found: ${process.env.AGENT_BRIDGE_BINARY}`);
|
|
38
|
+
}
|
|
39
|
+
return process.env.AGENT_BRIDGE_BINARY;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const target = TARGETS[`${process.platform}:${process.arch}`];
|
|
43
|
+
if (!target) {
|
|
44
|
+
throw new Error(`unsupported platform: ${process.platform}:${process.arch}`);
|
|
45
|
+
}
|
|
46
|
+
const [packageName, executable] = target;
|
|
47
|
+
try {
|
|
48
|
+
const packageRoot = dirname(require.resolve(`${packageName}/package.json`));
|
|
49
|
+
const binary = join(packageRoot, 'bin', executable);
|
|
50
|
+
if (!existsSync(binary)) throw new Error(`binary not found: ${binary}`);
|
|
51
|
+
return binary;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`native package ${packageName} is unavailable (${error.message}). ` +
|
|
55
|
+
'Reinstall from the official npm registry.'
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-bridge-rs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "A local runtime server and CLI bridge for Codex and Grok Build subagents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"agent-bridge": "bin/cli.js",
|
|
12
|
+
"agent-bridge-rs": "bin/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin",
|
|
16
|
+
"README.md",
|
|
17
|
+
"README-CN.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"optionalDependencies": {
|
|
21
|
+
"@asural/agent-bridge-win32-x64": "0.9.0",
|
|
22
|
+
"@asural/agent-bridge-win32-arm64": "0.9.0",
|
|
23
|
+
"@asural/agent-bridge-linux-x64": "0.9.0",
|
|
24
|
+
"@asural/agent-bridge-linux-arm64": "0.9.0",
|
|
25
|
+
"@asural/agent-bridge-darwin-x64": "0.9.0",
|
|
26
|
+
"@asural/agent-bridge-darwin-arm64": "0.9.0"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/luodaoyi/agent-bridge-rs.git"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/luodaoyi/agent-bridge-rs",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/luodaoyi/agent-bridge-rs/issues"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"codex",
|
|
38
|
+
"antigravity",
|
|
39
|
+
"grok",
|
|
40
|
+
"agent",
|
|
41
|
+
"skill",
|
|
42
|
+
"plugin",
|
|
43
|
+
"cli",
|
|
44
|
+
"rust",
|
|
45
|
+
"tui"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18"
|
|
49
|
+
}
|
|
50
|
+
}
|