agy-delegate-rs 0.0.0-stage → 0.1.3
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.md +54 -2
- package/bin/agy-delegate-rs.cjs +31 -0
- package/bin/darwin-arm64/agy-delegate-rs +0 -0
- package/bin/darwin-x64/agy-delegate-rs +0 -0
- package/bin/linux-arm64/agy-delegate-rs +0 -0
- package/bin/linux-x64/agy-delegate-rs +0 -0
- package/bin/win32-arm64/agy-delegate-rs.exe +0 -0
- package/bin/win32-x64/agy-delegate-rs.exe +0 -0
- package/package.json +28 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agy-delegate-rs contributors
|
|
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.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agy-delegate-rs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
面向 Linux、macOS 和 Windows 的只读 agy 调查工具。调用用户已有的 agy,三端统一通过 Codex 的操作系统沙箱限制写入。当前为预览版:三端的 x86_64 与 ARM64 均已通过原生 CI 测试和真实沙箱检查;模型调用已在 Linux 验证,macOS、Windows 的模型认证仍待实机验收。
|
|
4
|
+
|
|
5
|
+
安装、配置、MCP 注册、环境诊断与历史清理见 [安装指南](INSTALL.md)。
|
|
6
|
+
|
|
7
|
+
支持 GitHub Release 预编译包、`npm install -g agy-delegate-rs` 和 `cargo install agy-delegate-rs --locked`。GitHub Release 和 npm 包覆盖 Linux、macOS、Windows 的 x86_64 与 ARM64,共六种组合;npm 包内附所有二进制,无需 Rust 或安装时下载。仍需自行安装 agy、Codex CLI 和对应沙箱依赖。依赖就绪后,可用 npm 安装并注册到 Codex:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g agy-delegate-rs
|
|
11
|
+
agy-delegate-rs install
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`install` 先检查依赖和沙箱,再注册 MCP 与受管理的 AGENTS 策略。成功后新开 Codex 会话。自定义配置、从源码安装和清理方式见安装指南。
|
|
15
|
+
|
|
16
|
+
## 前提
|
|
17
|
+
|
|
18
|
+
- 从源码安装需要 Rust 1.88+ 和本平台的 C 编译工具链;三端都需要 agy 和支持命名权限配置的 Codex CLI(本机验证为 0.160.0)。
|
|
19
|
+
- agy 须支持 stream-json 和 `--gemini_dir` 数据目录参数。
|
|
20
|
+
- agy 已能正常调用模型:原生登录或用户自行配置的兼容接口均可。
|
|
21
|
+
- 自定义接口若需要协议转换,转换服务须独立运行;本项目不包含代理。
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
cargo build --release
|
|
25
|
+
./target/release/agy-delegate-rs run --cwd /path/to/repo --task '梳理任务调度入口,附文件行号'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
认证环境默认继承。已有环境文件可在子命令前通过 `--agy-env-file /path/to/api.env` 加载;已有环境变量优先,环境文件内容不写入任务记录。`--model`、`--agy`、`--codex` 等配置覆盖参数也写在子命令前。
|
|
29
|
+
|
|
30
|
+
Linux 上的真实模型调用、重连、续聊及清理已通过现有 API/转换服务验证;原生 OAuth 登录和刷新尚未实测。`doctor` 不调用模型,安装后仍需运行一条实际调查确认认证可用。
|
|
31
|
+
|
|
32
|
+
## 沙箱边界
|
|
33
|
+
|
|
34
|
+
- 项目及普通宿主文件只读;新任务只允许写入本工具管理的独立会话目录和单个任务临时目录。
|
|
35
|
+
- 允许联网调用模型;这是防止项目被修改的工具,不是网络或凭据隔离工具。
|
|
36
|
+
- 同一会话的追问复用独立目录。首次使用时从用户默认的 `~/.gemini/antigravity-cli` 导入已有 `settings.json` 和 `antigravity-oauth-token`,后续保留私有目录中的刷新结果,原文件不回写;系统钥匙串的登录复用仍需实机验收。
|
|
37
|
+
- CLI 权限自动放行仅在操作系统沙箱内部使用;沙箱启动失败直接失败,不回退到无沙箱执行。
|
|
38
|
+
- 工作目录与可写目录重叠时拒绝启动。
|
|
39
|
+
- Linux 使用 Codex 的 Linux 沙箱(本机使用 bubblewrap/seccomp);macOS 使用系统 Seatbelt;Windows 指定 Codex 的 `unelevated` 模式。
|
|
40
|
+
- 六种原生 CI 环境均已验证项目读取、写入被拒及临时目录可写。Linux 另已验证真实模型读取和返回报告;macOS、Windows 的真实模型调用尚待实机验证。
|
|
41
|
+
|
|
42
|
+
状态默认保存在用户数据目录的 `agy-delegate-rs` 下,可用 `--state-dir` 指定。缓存、报告可能含私有代码,不应提交到版本库。
|
|
43
|
+
|
|
44
|
+
独立会话目录位于状态目录的 `conversations/<root_id>`。`profile_bytes` 默认 128000000 字节,监控整个会话目录内的文件总大小,超限终止任务;这是定时监控而非文件系统硬配额。自动或手动清理最后一条历史引用时才删除该目录,仍有记录可供追问时保留。私有目录中的登录文件和会话数据也不应提交到版本库。
|
|
45
|
+
|
|
46
|
+
升级前已使用共享 profile 的旧任务继续沿用其原有数据;清理不会删除用户的共享 `~/.gemini`。
|
|
47
|
+
|
|
48
|
+
## 验证
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
cargo test
|
|
52
|
+
cargo test --test sandbox native_sandbox_preserves_fixture -- --ignored
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
MIT 许可证仅覆盖本项目代码。当前调用外部安装的 Codex CLI,不捆绑其二进制或 bubblewrap。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const { spawn } = require("node:child_process");
|
|
7
|
+
|
|
8
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
9
|
+
const supported = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64", "win32-arm64"];
|
|
10
|
+
if (!supported.includes(platform)) {
|
|
11
|
+
console.error(`agy-delegate-rs: unsupported platform ${platform}; install from source with Cargo.`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const binary = path.join(__dirname, platform, `agy-delegate-rs${process.platform === "win32" ? ".exe" : ""}`);
|
|
15
|
+
if (!fs.existsSync(binary)) {
|
|
16
|
+
console.error("agy-delegate-rs: native binary missing; reinstall the published npm package.");
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
20
|
+
const handlers = new Map(["SIGINT", "SIGTERM"].map(signal => [signal, () => child.kill(signal)]));
|
|
21
|
+
for (const [signal, handler] of handlers) process.on(signal, handler);
|
|
22
|
+
let failed = false;
|
|
23
|
+
child.once("error", error => {
|
|
24
|
+
console.error(`agy-delegate-rs: ${error.message}`);
|
|
25
|
+
failed = true;
|
|
26
|
+
});
|
|
27
|
+
child.once("close", (code, signal) => {
|
|
28
|
+
for (const [name, handler] of handlers) process.off(name, handler);
|
|
29
|
+
if (signal) process.kill(process.pid, signal);
|
|
30
|
+
process.exitCode = failed ? 1 : (code ?? 1);
|
|
31
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-delegate-rs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Read-only agy investigations through the Codex OS sandbox",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/JIAFALSEDREAM/agy-delegate-rs.git"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"agy-delegate-rs": "bin/agy-delegate-rs.cjs"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.14.0"
|
|
20
|
+
},
|
|
21
|
+
"os": [
|
|
22
|
+
"linux",
|
|
23
|
+
"darwin",
|
|
24
|
+
"win32"
|
|
25
|
+
],
|
|
26
|
+
"cpu": [
|
|
27
|
+
"x64",
|
|
28
|
+
"arm64"
|
|
29
|
+
]
|
|
30
|
+
}
|