dsh-subagent-agy 0.2.1 → 0.3.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/README.md +9 -4
- package/lib/index.js +6 -0
- package/lib/run.js +5 -2
- package/lib/types/index.d.ts +4 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -29,7 +29,8 @@ Antigravity(`agy`)是 Google 提供的 Agent CLI 工具,没有对外开放
|
|
|
29
29
|
本插件为 DSH 提供原生接入 Antigravity 的能力:
|
|
30
30
|
|
|
31
31
|
- **单次委派(One-shot External Provider)**:在宿主会话的工作区下 spawn 独立的 `agy` 子进程,执行单个独立任务后收集结果并退出。
|
|
32
|
-
-
|
|
32
|
+
- **每次调用独立会话**:每次 `--print` 本身就是一个新会话(新 `conversation_id`),不复用上一轮对话上下文;默认**不再**附加 `--new-project`,避免在 Antigravity Desktop 的 Projects 列表里堆积大量同名项目。
|
|
33
|
+
- **项目归属可配**:默认沿用当前工作目录已有的项目;需要固定归属时配置 `projectName`(映射 `--project <name>`),需要恢复「每次新建项目」的旧行为时配置 `newProject: true`。
|
|
33
34
|
- **环境清理与解耦**:清理父级 CLI 注入的环境变量,阻断会话劫持。
|
|
34
35
|
- **多模型与推理档位透传**:支持通过 Antigravity 调度 Gemini 4 Argon、Gemini 3.8 Flash、Claude 5.5 系列及开源大模型。
|
|
35
36
|
- **异步并发子智能体**:`subagent_agy_team` 让 agy 主模型用原生 `invoke_subagent` 拆分并发;`subagent_agy_parallel` 在 DSH 侧一次启动多个独立 agy 子进程,立即返回 id,结果异步回传。
|
|
@@ -65,7 +66,7 @@ dsh plugin --profile desktop add dsh-subagent-agy
|
|
|
65
66
|
```json
|
|
66
67
|
{
|
|
67
68
|
"dependencies": {
|
|
68
|
-
"dsh-subagent-agy": "file:C:/Users/moyi_/Documents/Claude-Mok/dsh-subagent-
|
|
69
|
+
"dsh-subagent-agy": "file:C:/Users/moyi_/Documents/Claude-Mok/dsh-subagent-agy"
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
```
|
|
@@ -96,7 +97,7 @@ dsh plugin --profile desktop add dsh-subagent-agy
|
|
|
96
97
|
插件内部拼装并执行的核心命令行格式如下:
|
|
97
98
|
|
|
98
99
|
```powershell
|
|
99
|
-
agy --print <prompt> --output-format stream-json --new-project `
|
|
100
|
+
agy --print <prompt> --output-format stream-json [--new-project | --project <name>] `
|
|
100
101
|
[--model <model>] [--effort <effort>] `
|
|
101
102
|
(--dangerously-skip-permissions | --mode auto) `
|
|
102
103
|
[--print-timeout <duration>] [--json-schema <schema>] `
|
|
@@ -157,6 +158,8 @@ agy --print <prompt> --output-format stream-json --new-project `
|
|
|
157
158
|
model: gemini-4-argon-high
|
|
158
159
|
effort: high
|
|
159
160
|
permissionMode: dangerously-skip-permissions
|
|
161
|
+
newProject: false
|
|
162
|
+
projectName: ''
|
|
160
163
|
printTimeout: 180s
|
|
161
164
|
# jsonSchema: '{"type": "object"}' # 可选,内联 JSON 或文件路径;不要传空字符串(min(1) 校验)
|
|
162
165
|
addDirs: []
|
|
@@ -183,6 +186,8 @@ agy --print <prompt> --output-format stream-json --new-project `
|
|
|
183
186
|
| `printTimeout` | `string` (`min(1)`) | *无(无限等待)* | 原生执行超时(Go duration 格式,如 `"180s"`、`"10m"`),映射为 `--print-timeout <val>`。**注意:CLI 到期超时后输出部分结果、在 stderr 打 warning,并以 exit 0 退出**,不是失败。 |
|
|
184
187
|
| `jsonSchema` | `string` (`min(1)`) | *无* | 结构化输出约束,映射为 `--json-schema <val>`。支持内联 JSON Schema 字符串或本地 schema 文件路径。 |
|
|
185
188
|
| `addDirs` | `string[]` | *无* | 附加只读工作区目录列表。每个路径映射为一个 `--add-dir <dir>` 参数。 |
|
|
189
|
+
| `newProject` | `boolean` | `false` | 是否附加 `--new-project` 强制为本次任务新建 Antigravity 项目。默认关闭:`--print` 每次已是独立会话,无需再新建项目;开启后每次调用都会在 Desktop 的 Projects 列表里多出一条同名项目。 |
|
|
190
|
+
| `projectName` | `string` | `''` | 固定项目归属,非空时映射为 `--project <name>`。同一工作区反复调用会复用同一个项目,Projects 列表只保留一条。与 `newProject: true` 同时配置时以本项为准(不再附加 `--new-project`)。 |
|
|
186
191
|
| `fallbackModel` | `string` (`min(1)`) | *无(不重试)* | 降级重试备用模型。首轮出现配额耗尽(`quota_exhausted`)或限流(`rate_limited`)时,用该模型重试一次。 |
|
|
187
192
|
| `retryOnRateLimit` | `boolean` | `false` | 429 限流重试开关。首轮限流且未触发降级模型时,按提示时长退避(上限 15s)并用原模型重试一次。 |
|
|
188
193
|
| `disposeGraceMs` | `number` | `3000` | 终止清理子进程的宽限时长(毫秒)。必须为正有限数且 ≤ `MAX_TIMER_DELAY_MS`。 |
|
|
@@ -348,7 +353,7 @@ node --check lib/index.js; node --check lib/run.js; node --check lib/wire.js; no
|
|
|
348
353
|
验证本地 Antigravity CLI 安装与参数响应:
|
|
349
354
|
|
|
350
355
|
```powershell
|
|
351
|
-
& "$env:USERPROFILE\.gemini\bin\agy.exe" --print "Say OK" --output-format stream-json --
|
|
356
|
+
& "$env:USERPROFILE\.gemini\bin\agy.exe" --print "Say OK" --output-format stream-json --project dsh-subagent-agy --dangerously-skip-permissions
|
|
352
357
|
```
|
|
353
358
|
|
|
354
359
|
*期望结果*:末尾输出状态为 `{"status":"SUCCESS","response":"OK\n"}` 的结果帧。
|
package/lib/index.js
CHANGED
|
@@ -52,6 +52,8 @@ export const Config = z.object({
|
|
|
52
52
|
env: z.dict(z.string()).default({}),
|
|
53
53
|
permissionMode: z.union([...ANTIGRAVITY_PERMISSION_MODES]).default(DEFAULT_ANTIGRAVITY_PERMISSION_MODE),
|
|
54
54
|
extraArgs: z.array(z.string()).default([]),
|
|
55
|
+
newProject: z.boolean().default(false),
|
|
56
|
+
projectName: z.string().default(''),
|
|
55
57
|
printTimeout: z.string().min(1),
|
|
56
58
|
jsonSchema: z.string().min(1),
|
|
57
59
|
addDirs: z.array(z.string()),
|
|
@@ -99,6 +101,8 @@ class AntigravityProvider {
|
|
|
99
101
|
...this.config.effort === undefined ? {} : { effort: this.config.effort },
|
|
100
102
|
permissionMode: this.config.permissionMode,
|
|
101
103
|
extraArgs: this.config.extraArgs,
|
|
104
|
+
newProject: this.config.newProject,
|
|
105
|
+
projectName: this.config.projectName,
|
|
102
106
|
...this.config.promptPrefix === undefined ? {} : { promptPrefix: this.config.promptPrefix },
|
|
103
107
|
...this.config.printTimeout === undefined ? {} : { printTimeout: this.config.printTimeout },
|
|
104
108
|
...this.config.jsonSchema === undefined ? {} : { jsonSchema: this.config.jsonSchema },
|
|
@@ -138,6 +142,8 @@ export function apply(ctx, config) {
|
|
|
138
142
|
env: config.env ?? {},
|
|
139
143
|
permissionMode: config.permissionMode ?? DEFAULT_ANTIGRAVITY_PERMISSION_MODE,
|
|
140
144
|
extraArgs: config.extraArgs ?? [],
|
|
145
|
+
newProject: config.newProject ?? false,
|
|
146
|
+
projectName: config.projectName ?? '',
|
|
141
147
|
...config.printTimeout === undefined ? {} : { printTimeout: config.printTimeout },
|
|
142
148
|
...config.jsonSchema === undefined ? {} : { jsonSchema: config.jsonSchema },
|
|
143
149
|
...config.addDirs === undefined ? {} : { addDirs: config.addDirs },
|
package/lib/run.js
CHANGED
|
@@ -54,20 +54,23 @@ function thrown(value) {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Build the CLI argv for one run.
|
|
57
|
-
* @param {{executable: string, model?: string, effort?: string, permissionMode: string, printTimeout?: string, jsonSchema?: string, addDirs?: readonly string[], extraArgs: readonly string[], prompt: string, promptPrefix?: string}} spec
|
|
57
|
+
* @param {{executable: string, model?: string, effort?: string, permissionMode: string, printTimeout?: string, jsonSchema?: string, addDirs?: readonly string[], extraArgs: readonly string[], prompt: string, promptPrefix?: string, newProject?: boolean, projectName?: string}} spec
|
|
58
58
|
* @returns {string[]}
|
|
59
59
|
*/
|
|
60
60
|
export function antigravityArgv(spec) {
|
|
61
61
|
const prompt = spec.promptPrefix === undefined || spec.promptPrefix.length === 0
|
|
62
62
|
? spec.prompt
|
|
63
63
|
: `${spec.promptPrefix}\n\n${spec.prompt}`;
|
|
64
|
+
const projectName = typeof spec.projectName === 'string' ? spec.projectName.trim() : '';
|
|
64
65
|
return [
|
|
65
66
|
spec.executable,
|
|
66
67
|
'--print',
|
|
67
68
|
prompt,
|
|
68
69
|
'--output-format',
|
|
69
70
|
'stream-json',
|
|
70
|
-
|
|
71
|
+
...(projectName.length > 0
|
|
72
|
+
? ['--project', projectName]
|
|
73
|
+
: spec.newProject === true ? ['--new-project'] : []),
|
|
71
74
|
...(spec.model === undefined ? [] : ['--model', spec.model]),
|
|
72
75
|
...(spec.effort === undefined ? [] : ['--effort', spec.effort]),
|
|
73
76
|
...(spec.permissionMode === 'dangerously-skip-permissions' ? ['--dangerously-skip-permissions'] : ['--mode', 'auto']),
|
package/lib/types/index.d.ts
CHANGED
|
@@ -31,6 +31,10 @@ export interface Config {
|
|
|
31
31
|
permissionMode?: AntigravityPermissionMode;
|
|
32
32
|
/** Extra CLI arguments appended verbatim. */
|
|
33
33
|
extraArgs?: string[];
|
|
34
|
+
/** Add `--new-project` so every run creates an isolated Antigravity project (default false). */
|
|
35
|
+
newProject?: boolean;
|
|
36
|
+
/** Fixed Antigravity project name or id passed as `--project <name>`; takes precedence over `newProject` (default ''). */
|
|
37
|
+
projectName?: string;
|
|
34
38
|
/** Go-style duration for `--print-timeout` (e.g. "180s", "10m"); omitted to wait until the turn completes. */
|
|
35
39
|
printTimeout?: string;
|
|
36
40
|
/** JSON schema (inline or file path) for `--json-schema`, constraining the final structured result. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-subagent-agy",
|
|
3
3
|
"description": "Run Google Antigravity CLI (agy) as DeepSeek Harness subagents, with Gemini web Deep Research and parallel/team modes.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"author": "mokngai",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/Michael-LY/dsh-subagent-
|
|
24
|
+
"url": "git+https://github.com/Michael-LY/dsh-subagent-agy.git"
|
|
25
25
|
},
|
|
26
|
-
"homepage": "https://github.com/Michael-LY/dsh-subagent-
|
|
26
|
+
"homepage": "https://github.com/Michael-LY/dsh-subagent-agy#readme",
|
|
27
27
|
"bugs": {
|
|
28
|
-
"url": "https://github.com/Michael-LY/dsh-subagent-
|
|
28
|
+
"url": "https://github.com/Michael-LY/dsh-subagent-agy/issues"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|