@agentguardx/helper 0.3.91 → 0.3.94
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 +8 -4
- package/bin/agentguard.cjs +4 -1
- package/lib/wizard.cjs +1 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ agentguard init --server https://企业服务器域名
|
|
|
10
10
|
|
|
11
11
|
公共 npmjs 尚未发布;可发布到企业私有仓库后用 `npx --registry <仓库地址> @agentguardx/helper`(见 docs/client/B13_INSTALLATION.md 的发布步骤),或使用管理员分发的离线 tgz。离线安装时同时安装主包和本机对应的平台包;全局命令仍为 `agentguard`。包不固定企业服务器地址;可交互填写,或使用 `--server` / `AGENTGUARD_SERVER`。支持 HTTP/HTTPS;HTTP 每个新服务器先明确确认明文风险,确认前不发送令牌。
|
|
12
12
|
|
|
13
|
-
npx 即用不会创建全局 `agentguard` 命令;后续使用 `npx @agentguardx/helper launch opencode
|
|
13
|
+
npx 即用不会创建全局 `agentguard` 命令;后续使用 `npx @agentguardx/helper launch opencode`(OpenCode 已原生接入时也可直接运行 `opencode`)、`npx @agentguardx/helper uninstall`,或全局安装后使用短命令。
|
|
14
14
|
|
|
15
15
|
向导先显示当前服务器地址(优先级:`--server` 参数 > 环境变量 `AGENTGUARD_SERVER` > 上次保存的配置)作为默认值:回车沿用,也可直接输入别的 IP 或域名;输入后重新校验 `/client/v1/config`,HTTP 只提示一次明文风险。已有登录属于旧服务器时,向导提示需要重新登录,并在你确认后先退出旧登录(撤销旧令牌、恢复已接入工具配置);旧令牌绝不会发给新服务器。命令行同样可用:`agentguard server show` 查看当前地址,`agentguard server set <地址>` 修改(加 `--switch` 同时退出旧登录并恢复工具配置;旧服务器无法访问时可再加 `--local-only`,只清除本机登录,旧令牌在服务端仍有效直到到期或由管理员撤销)。
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ npx 即用不会创建全局 `agentguard` 命令;后续使用 `npx @agentguard
|
|
|
18
18
|
|
|
19
19
|
企业对话正文留存不要求员工告知或确认,向导不展示告知步骤、不提交已读;正常对话不会因告知流程被阻断。留存开启仍须独立双审,正文访问按当前角色与服务端审批结果执行,平台管理员可审核本人申请;正式环境默认关闭。
|
|
20
20
|
|
|
21
|
-
支持入口为 OpenCode、OpenClaw、Cursor 远程 MCP
|
|
21
|
+
支持入口为 OpenCode、OpenClaw、Cursor 远程 MCP 及 Cherry Studio 手动说明(Claude Desktop 向导不再提供,2026-10-23 用户决定);厂商原生实测范围以企业兼容记录为准。Codex 暂缓,Gemini、Claude Code、Claude Desktop 不接入。B15 为 OpenCode 同时注册本机安全 stdio MCP,并写入关闭自带本机工具的配置;仅经 ag_* 入口的调用由服务端逐次授权、执行上报和输出检查。其他厂商未验证关闭原生工具时,其自带本机终端、文件操作不受该 MCP 管控。客户端可被员工修改的边界不等同操作系统强制隔离。
|
|
22
22
|
|
|
23
23
|
启动器每次执行 Go 核心前,使用内置固定公钥验证 originless npm 清单的 RSA-3072/SHA-256 签名,再检查平台二进制与 macOS 钥匙串 helper 的大小和 SHA-256。验证失败拒绝执行,不下载替换公钥。
|
|
24
24
|
|
|
@@ -31,12 +31,16 @@ Claude Desktop 的 stdio 桥接保存当前 Node 程序与主包启动器的绝
|
|
|
31
31
|
本机安全工具命令(全局安装示例;仅 npx 使用时替换为 `npx -- @agentguardx/helper`):
|
|
32
32
|
|
|
33
33
|
```sh
|
|
34
|
-
agentguard connect opencode
|
|
35
|
-
agentguard launch
|
|
34
|
+
agentguard connect opencode # 原生模式(默认):把 OpenCode 默认模型设为 AgentGuard,之后直接运行 opencode 即可
|
|
35
|
+
agentguard connect opencode --launch-only # 旧方式:不改默认模型、不落地令牌,只能经 launch 启动
|
|
36
|
+
agentguard launch opencode # 仍可用,令牌只交给本次子进程
|
|
37
|
+
agentguard disconnect opencode # 恢复原默认模型,删除写入的令牌
|
|
36
38
|
agentguard mcp serve
|
|
37
39
|
agentguard pause
|
|
38
40
|
agentguard resume
|
|
39
41
|
agentguard activity
|
|
40
42
|
```
|
|
41
43
|
|
|
44
|
+
OpenCode 原生模式的令牌与 GLM 编程助手同类,写入 OpenCode 自己的 `auth.json`(键 `agentguard`,0600,保留其他条目)和 AgentGuard 配置目录下 0600 的令牌文件(供远程 MCP 请求头的 `{file:}` 引用);`opencode.json` 不含令牌。`disconnect`、`uninstall`、`logout` 会清除这些副本并恢复原 `model`/`small_model`。
|
|
45
|
+
|
|
42
46
|
`mcp serve` 的 stdout 专用于 stdio MCP 协议,工作根固定为进程启动目录,不接受模型自报身份或 root。`pause` 是本机应急停用,不是企业级一键暂停,也不能撤回已发生的副作用。
|
package/bin/agentguard.cjs
CHANGED
|
@@ -17,5 +17,8 @@ async function main() {
|
|
|
17
17
|
}
|
|
18
18
|
main().catch(error => {
|
|
19
19
|
const code = /^[a-z0-9_]+$/.test(error.message) ? error.message : 'helper_operation_failed';
|
|
20
|
-
process.stderr.write(`接入助手未完成:${code}\n`);
|
|
20
|
+
process.stderr.write(`接入助手未完成:${code}\n`);
|
|
21
|
+
// 平台包缺失或版本不一致,最常见的原因是国内镜像只同步了主包;npx 还会缓存这次不完整的安装。
|
|
22
|
+
if (code === 'npm_platform_package_missing' || code === 'npm_package_version_mismatch') process.stderr.write('本机平台包缺失或版本不一致,通常是 npm 镜像尚未同步完新版本。可改用官方仓库:npx --registry https://registry.npmjs.org/ @agentguardx/helper ;若仍报错,清理 npx 缓存(npm cache clean --force,或删除 ~/.npm/_npx 下含 @agentguardx 的目录)后重试。\n');
|
|
23
|
+
process.exitCode = 1;
|
|
21
24
|
});
|
package/lib/wizard.cjs
CHANGED
|
@@ -101,7 +101,6 @@ function supportedTools() {
|
|
|
101
101
|
{ label: 'OpenCode(模型与远程 MCP)', value: 'opencode', present: command('opencode'), install: 'npm i -g opencode-ai' },
|
|
102
102
|
{ label: 'OpenClaw(模型)', value: 'openclaw', present: command('openclaw'), install: '按 OpenClaw 官方说明安装' },
|
|
103
103
|
{ label: 'Cursor(远程 MCP)', value: 'cursor', present: command('cursor') || apps('Cursor.app', 'Programs/Cursor/Cursor.exe'), install: '从 cursor.com 下载安装' },
|
|
104
|
-
{ label: 'Claude Desktop(MCP 桥接)', value: 'claude-desktop', present: command('claude-desktop') || apps('Claude.app', 'AnthropicClaude/Claude.exe'), install: '从 claude.ai/download 下载安装' },
|
|
105
104
|
{ label: 'Cherry Studio(手动填写说明)', value: 'cherry-studio', present: apps('Cherry Studio.app', 'Programs/Cherry Studio/Cherry Studio.exe'), install: '从 cherry-ai.com 下载安装' },
|
|
106
105
|
];
|
|
107
106
|
}
|
|
@@ -206,7 +205,7 @@ async function init(runtime, args) {
|
|
|
206
205
|
else {
|
|
207
206
|
const selected = await choose(ask, '选择要接入的已检测工具', tools, true);
|
|
208
207
|
for (const tool of selected) { code = await run(runtime, [...prefix, 'connect', tool], ''); if (code) { process.exitCode = code; return; } }
|
|
209
|
-
if (selected.includes('opencode')) process.stdout.write('OpenCode
|
|
208
|
+
if (selected.includes('opencode')) process.stdout.write('OpenCode 已设为默认走 AgentGuard(原默认模型已记录,断开时恢复):直接运行 opencode 即可,也可用 launch 启动。接入包含本机安全 MCP 配置,使用 ag_* 工具;实际连接与授权结果以诊断和服务端记录为准。\n');
|
|
210
209
|
}
|
|
211
210
|
process.stdout.write('运行实际诊断:\n'); code = await run(runtime, [...prefix, 'doctor'], ''); process.exitCode = code;
|
|
212
211
|
process.stdout.write(code === 0 ? '初始化完成。用 npx @agentguardx/helper launch <工具名> 启动;全局安装后也可用 agentguard launch <工具名>。\n' : '诊断未全部通过,请按上述实际结果处理。\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentguardx/helper",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.94",
|
|
4
4
|
"description": "AgentGuard \u5458\u5de5\u63a5\u5165\u52a9\u624b",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"engines": {
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"preuninstall": "node lib/preuninstall.cjs"
|
|
20
20
|
},
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@agentguardx/helper-darwin-x64": "0.3.
|
|
23
|
-
"@agentguardx/helper-darwin-arm64": "0.3.
|
|
24
|
-
"@agentguardx/helper-linux-x64": "0.3.
|
|
25
|
-
"@agentguardx/helper-linux-arm64": "0.3.
|
|
26
|
-
"@agentguardx/helper-win32-x64": "0.3.
|
|
27
|
-
"@agentguardx/helper-win32-arm64": "0.3.
|
|
22
|
+
"@agentguardx/helper-darwin-x64": "0.3.94",
|
|
23
|
+
"@agentguardx/helper-darwin-arm64": "0.3.94",
|
|
24
|
+
"@agentguardx/helper-linux-x64": "0.3.94",
|
|
25
|
+
"@agentguardx/helper-linux-arm64": "0.3.94",
|
|
26
|
+
"@agentguardx/helper-win32-x64": "0.3.94",
|
|
27
|
+
"@agentguardx/helper-win32-arm64": "0.3.94"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|