agy-ext-swarm 0.2.0 → 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 CHANGED
@@ -8,9 +8,10 @@ An open-source Antigravity (AGY) plugin that lets Antigravity act as the **Coord
8
8
 
9
9
  ## Key Capabilities
10
10
 
11
+ - **First-Time CLI & Model Onboarding Wizard**: Automatically launches on first run to probe local CLIs, pick enabled backends and default models, optionally split Writer/Reader routing pools, and save everything in one batch.
11
12
  - **Zero-Setup AI Auto-Delegation (`rules/AGENTS.md`)**: Includes an always-on plugin rule that guides Antigravity to automatically compose and launch CLI squads for multi-module coding, batch tasks, broad research, or cross-review without manual squad setup—while staying out of the way for small single-file edits or when disabled.
12
13
  - **Pluggable External CLI Providers & One-Click Presets**: Auto-detects available CLIs across macOS, Linux, and Windows (`PATH`/`PATHEXT`), with one-click templates for popular coding CLIs (**OpenCode**, **Aider**, **Qwen Code**, **Goose**) plus inline `custom_command` or `providers.json`.
13
- - **Interactive UI Commander & Settings**: Create swarms, launch workers (with `depends_on` DAG dependencies), start Multi-CLI Arenas, apply Team Playbook Templates, configure CLI binaries/models/pricing, and preview/merge worktrees directly from the side-pane UI.
14
+ - **Interactive UI Commander & Settings**: Create swarms, launch workers (with `depends_on` DAG dependencies, `allowed_files` whitelists, and `verify_commands`/`auto_verify`), start Multi-CLI Arenas, apply Team Playbook Templates (or generate templates from the current swarm), configure CLI binaries/models/pricing/custom `env` (`KEY=VALUE`), inspect live elapsed duration badges, `Kill & Clean` / `Kill All` worktrees, compose multiline messages (`Enter` to send, `Shift+Enter` for newline) with focus-safe polling, and preview/merge worktrees directly from the side-pane UI.
14
15
  - **Deterministic DAG Orchestration (`depends_on`)**: Downstream workers queue as `blocked`, ignore premature `@all` / peer wakes, unlock automatically with upstream diffs & board summaries once dependencies succeed, and fail safely without deadlock if upstream breaks.
15
16
  - **Zero-Side-Effect Conflict Preview & Safe Merge (`ext_swarm_merge`)**: Uses `git merge-tree --write-tree` to detect conflicts without touching the working tree, then merges cleanly via `squash`, `cherry-pick`, or `merge` with automatic abort-on-error and optional worktree cleanup.
16
17
  - **Multi-CLI Arena & Cross-Vendor Auto Review**: Race 2+ CLI backends in parallel isolated worktrees (`ext_swarm_arena`), compare commits/diff/tokens side by side, and trigger another CLI vendor to perform a read-only audit (`ext_swarm_cross_review`).
@@ -18,7 +19,7 @@ An open-source Antigravity (AGY) plugin that lets Antigravity act as the **Coord
18
19
  - **Shared Message Board, Timeouts & Watchdog**: Append-only `board.jsonl` with `@name`, `@group`, `@all`, `@coordinator`, `max_hops`, hard `turn_timeout_seconds`, and silence `stall_timeout_seconds` watchdog.
19
20
  - **Session Resume & In-Place Switch / Retry**: Captures `sessionId` / `thread_id` across follow-up wakes and lets you retry failed workers or switch their `provider` / `model` in place while preserving their existing `git worktree` and branch.
20
21
  - **Git Worktree Isolation, Colored Diff Drawer & Auto Verify**: Parallel writers run in isolated `git worktree` branches (`ext-swarm/<swarmId>/<worker>`); optional `allowed_files` whitelists check out-of-scope edits mechanically, `auto_verify: true` deterministically runs `verify_commands` host-side after each turn, and the Workers tab includes a full colored Git Diff drawer.
21
- - **Unified Token, Cache & Cost Telemetry + Markdown Export**: Tracks **AGY Main Model** and **External CLI Workers** side-by-side (`cacheRead / (input + cacheRead)`), calculates optional estimated costs when model rates are set, and supports exporting full Markdown post-mortem reports (`ext_swarm_export`) or cleaning up historical swarms (`ext_swarm_delete`).
22
+ - **Unified Token, Cache & Cost Telemetry + Markdown Export**: Tracks **AGY Main Model** (including **AGY Orchestrator (Plan/Execute)** multi-model breakdowns via `byModelSession` / `byModelSinceSwarm`) and **External CLI Workers** side-by-side (`cacheRead / (input + cacheRead)`), calculates optional estimated costs when model rates are set, and supports exporting full Markdown post-mortem reports (`ext_swarm_export`) or cleaning up historical swarms (`ext_swarm_delete`).
22
23
  - **Bilingual Side-Pane MCP App (`中 / EN`)**: Interactive Board, curved Bezier Graph & Replay scrubber (with DAG edges), Workers Commander + Event/Diff/Merge Drawers, Usage Dashboard, and Settings Center.
23
24
 
24
25
  ## Supported CLI Providers
@@ -151,6 +152,7 @@ If using `dsh`, never modify `~/.dsh/profiles/desktop` (locked by the desktop cl
151
152
  ## Privacy & Security
152
153
 
153
154
  - Main-model usage telemetry reads local Antigravity `transcript.jsonl` files in **strictly read-only mode** and never mutates Antigravity logs or sends telemetry anywhere externally.
155
+ - Custom CLI `env` values configured in Settings are stored locally for UI editing and automatically redacted from LLM-facing tools (`ext_swarm_providers` returns only `envKeys`, and inline `custom_command.env` values in add/status/update tool outputs are masked as `***`).
154
156
  - External CLI workers run locally on your machine under their configured sandbox flags (`read-only`, `workspace-write`, `danger-full-access`).
155
157
 
156
158
  ## Customizing the Side-Pane UI
@@ -166,12 +168,18 @@ cd server && pnpm typecheck && pnpm build
166
168
  ```
167
169
  Then refresh/restart `agy-ext-swarm_ext_swarm` in Antigravity MCP settings (or set `EXT_SWARM_APP_HTML` during UI iteration).
168
170
 
169
- ## Tests
171
+ ## Tests & Packaging
170
172
 
171
173
  ```bash
172
174
  cd server
173
- pnpm test:providers # Offline multi-provider, parser, and i18n verification (zero API tokens)
175
+ pnpm typecheck # Type-check server & UI
176
+ pnpm build # Build zero-dependency dist/index.mjs, dist/providers.mjs, and dist/board.html
177
+ pnpm test:providers # Offline multi-provider, parser, security, and i18n verification
178
+ pnpm test:standalone # Zero-dependency standalone bundle & HTTP/SSE smoke test
174
179
  pnpm test:smoke # Live dsh E2E smoke test
180
+
181
+ # From repository root: verify GitHub Release archives & SHA256 checksums
182
+ pnpm run pack:release
175
183
  ```
176
184
 
177
185
  ## License
package/README.zh-CN.md CHANGED
@@ -8,9 +8,10 @@
8
8
 
9
9
  ## 核心能力
10
10
 
11
+ - **首次启动 CLI & 模型配置引导向导**:初次打开自动扫描本机可用 CLI,支持一步勾选启用后端、默认模型及可选读写角色池并批量保存配置。
11
12
  - **免手动配置、AI 主动自动调用(`rules/AGENTS.md`)**:内置插件级常驻规则与自动编队策略,当识别到多模块并行开发、批量分片任务、只读代码调研或交叉审查时,Antigravity 会自动探测可用 CLI 并按预设/工作池直接建群派活;日常小改动或禁用插件时零打扰、自动回退。
12
13
  - **可插拔外部 CLI 后端与一键预设模板**:全面兼容 macOS、Linux 与 Windows(支持 `PATHEXT` 与 `.cmd`/`.bat`),内置 **OpenCode**、**Aider**、**Qwen Code**、**Goose** 等常见开源 CLI 一键预设,以及 `custom_command` / `providers.json` 任意拓展。
13
- - **侧边栏交互式控制台(Commander Bar)与配置中心**:无需手写工具调用或 JSON,直接在执行器页签一键新建 Swarm、启动执行器(含 DAG 前置依赖)、发起多模型 Arena 擂台、套用团队编排模板,以及管理 CLI 后端与单价估算。
14
+ - **侧边栏交互式控制台(Commander Bar)与配置中心**:无需手写工具调用或 JSON,直接在执行器页签一键新建 Swarm、启动执行器(支持 `depends_on` DAG 依赖、`allowed_files` 白名单、`verify_commands` / `auto_verify`)、从当前 Swarm 生成并套用模板、发起多模型 Arena 擂台、查看运行耗时与使用 `Kill & Clean` / `Kill All` 清理 worktree、管理 CLI 后端/单价与环境变量(`KEY=VALUE`),并提供防轮询抢焦点与多行消息输入(`Enter` 发送、`Shift+Enter` 换行)。
14
15
  - **确定性 DAG 前置依赖调度(`depends_on`)**:带依赖的执行器初始进入 `blocked` 状态并屏蔽 `@all` 等提前唤醒,上游全部成功后自动注入改动摘要并释放入队;上游失败或被终止时自动级联止损,防止 `wait` 死等。
15
16
  - **零副作用冲突预检与安全合入(`ext_swarm_merge`)**:通过 `git merge-tree --write-tree` 零副作用预检分支冲突,支持按 `squash`(默认)、`cherry-pick` 或 `merge` 安全合入,冲突/失败自动回滚并支持可选清理 worktree。
16
17
  - **多 CLI Arena 同题竞技与跨厂商自动审查**:使用不同 CLI / 模型在隔离 worktree 并行作答(`ext_swarm_arena`),在侧边栏横向对比提交数、改动文件与 Token,并一键调用另一家模型只读交叉审查(`ext_swarm_cross_review`)。
@@ -18,7 +19,7 @@
18
19
  - **共享消息板、超时与无心跳看门狗**:追加式 `board.jsonl` 协作,内置 `max_hops` 自主跳数熔断、硬超时(`turn_timeout_seconds`)与静默卡死看门狗(`stall_timeout_seconds`)。
19
20
  - **会话持久化续跑与原位换模接力**:支持复用 `sessionId` / `thread_id`,并可在保留原 `git worktree` 与分支的情况下对 `waiting` / `failed` 执行器原地换模或重试。
20
21
  - **Git Worktree 隔离、彩色 Diff 抽屉与机械验证**:`allowed_files` 白名单守卫每轮自动核查越界改动;支持 `auto_verify: true` 由宿主确定性执行 `verify_commands`;内置彩色 Git Diff 抽屉。
21
- - **主模型 + 外部集群统一监控与 Markdown 战报导出**:并排统计新增输入、缓存读取与标准输入缓存命中率,支持可选模型单价成本估算,以及一键导出 Markdown 复盘报告与清理历史 Swarm。
22
+ - **主模型 + 外部集群统一监控与 Markdown 战报导出**:并排统计新增输入、缓存读取与标准输入缓存命中率,兼容 **AGY Orchestrator(Plan/Execute)** 多模型拆分明细(`byModelSession` / `byModelSinceSwarm`),支持可选模型单价成本估算与一键导出 Markdown 复盘报告、清理历史 Swarm。
22
23
 
23
24
  ## 支持的 CLI 执行器后端
24
25
 
@@ -150,6 +151,7 @@ pnpm build
150
151
  ## 隐私与安全边界
151
152
 
152
153
  - 主模型用量统计仅在本地**只读读取** Antigravity `transcript.jsonl`,不会写入或修改任何宿主日志,也不会向任何外部服务器上报数据。
154
+ - 在「配置」页为自定义 CLI 设置的 `env` 环境变量仅保存在本地供 UI 读写,并会在返回给主模型侧的工具中自动脱敏(`ext_swarm_providers` 仅暴露 `envKeys` 键名,内联 `custom_command.env` 值在 `add`/`status`/`update` 输出中统一遮蔽为 `***`)。
153
155
  - 外部 CLI 执行器完全在本地按设定的权限模式(`read-only`、`workspace-write`、`danger-full-access`)运行。
154
156
 
155
157
  ## 自定义侧边栏 UI
@@ -162,12 +164,18 @@ cd server && pnpm typecheck && pnpm build
162
164
 
163
165
  然后在 Antigravity MCP 设置中刷新 `agy-ext-swarm_ext_swarm`(调试时可设 `EXT_SWARM_APP_HTML` 指向 `server/dist/board.html`)。
164
166
 
165
- ## 测试
167
+ ## 测试与发版打包
166
168
 
167
169
  ```bash
168
170
  cd server
169
- pnpm test:providers # 离线验证多 Provider、事件解析器与中英文偏好持久化(零额度消耗)
171
+ pnpm typecheck # 服务端与 UI 类型检查
172
+ pnpm build # 构建零依赖单文件产物 dist/index.mjs、dist/providers.mjs 与 dist/board.html
173
+ pnpm test:providers # 离线验证多 Provider、事件解析、脱敏安全与中英文偏好(零额度消耗)
174
+ pnpm test:standalone # 零依赖独立产物包与 HTTP/SSE 看板冒烟测试
170
175
  pnpm test:smoke # 真实 dsh 端到端冒烟测试
176
+
177
+ # 在仓库根目录校验并生成 GitHub Release 归档包与 SHA256 清单
178
+ pnpm run pack:release
171
179
  ```
172
180
 
173
181
  ## 开源协议
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agy-ext-swarm",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "External multi-CLI agent swarm plugin for Antigravity supporting dsh, Claude Code, Codex, Gemini CLI, and custom CLIs with shared board, @mention routing, git worktree isolation, unified token/cache telemetry, and bilingual (中/EN) live UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,7 +42,10 @@
42
42
  "bin/ext-board.mjs",
43
43
  "rules/AGENTS.md",
44
44
  "skills/agy-ext-swarm/SKILL.md",
45
+ "skills/agy-ext-swarm/references/orchestrator.md",
46
+ "skills/agy-ext-swarm/references/advanced.md",
45
47
  "scripts/install.mjs",
48
+ "scripts/manifest.mjs",
46
49
  "server/dist/index.mjs",
47
50
  "server/dist/board.html"
48
51
  ],
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agy-ext-swarm",
3
3
  "displayName": "AGY Ext Swarm",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "homepage": "https://github.com/ycuwq/agy-ext-swarm",
6
6
  "repository": "https://github.com/ycuwq/agy-ext-swarm",
7
7
  "description": "External multi-CLI agent swarm plugin for Antigravity supporting dsh, Claude Code, Codex, Gemini CLI, and custom CLIs with shared board, @mention routing, git worktree isolation, unified token/cache telemetry, and bilingual (中/EN) live UI.",
package/rules/AGENTS.md CHANGED
@@ -1,15 +1,8 @@
1
- # AGY Ext Swarm — Automatic Multi-CLI Delegation
1
+ # AGY Ext Swarm — Delegation Router
2
2
 
3
- When this plugin is enabled, do not wait for the user to manually configure workers or CLI squads. Proactively invoke the `agy-ext-swarm` skill and its `ext_swarm_*` MCP tools whenever a coding or codebase-analysis task benefits from parallel execution or model offloading:
3
+ When a task fits external multi-CLI parallelism, **read the `agy-ext-swarm` skill first** before acting:
4
4
 
5
- - **Auto-trigger scenarios**:
6
- 1. Multi-module or multi-file development/refactoring spanning 2+ independent files, adapters, or features.
7
- 2. Feature implementation paired with tests, docs, or post-change review (`feature-squad` / `doc-and-test`).
8
- 3. Batch repetitive fixes, test backfills, or parallelizable tasks across independent targets (`ext_swarm_add` with `tasks`).
9
- 4. Broad read-only codebase reconnaissance/audits alongside main architectural thinking (`workspace: "inherit"`, `permission_mode: "read-only"`).
10
- 5. Requests asking for multi-model comparison, competition, or cross-vendor code review (`ext_swarm_arena` / `ext_swarm_cross_review`).
11
- - **Zero-setup squad composition & graceful fallback**:
12
- 1. Start by calling `ext_swarm_providers` to inspect locally available CLIs and any user-configured `activePool` / `routingPolicy`.
13
- 2. If zero external CLI providers are available on the machine, silently handle the task directly without mentioning or forcing `agy-ext-swarm`.
14
- 3. Otherwise, automatically select the right squad template or worker DAG (`ext_swarm_apply_template`, or `ext_swarm_create` + `ext_swarm_add`), omit per-worker `provider` whenever an active pool/routing policy covers the role so load-balancing and `autoFailover` work automatically, and call `ext_swarm_open_board` so progress is live-visible.
15
- - **Avoid over-orchestrating small tasks**: Do NOT spin up external CLIs or worktrees for quick Q&A, single-file minor edits, simple one-off commands, or tightly coupled single-thread debugging.
5
+ - **Trigger**: ≥2 independent modules, feature + review/tests, sharded batches, broad read-only recon, or multi-model Arena/cross-review.
6
+ - **Skip**: Q&A, minor single-file edits, tightly coupled debugging, or (in Orchestrator mode) 2–3 small files better handled by AGY's executor.
7
+ - **Pre-flight (`ext_swarm_providers`)**: If 0 CLIs are ready, silently handle implicit tasks yourself; on explicit user requests to use/configure the swarm, call `ext_swarm_open_board` for the setup wizard.
8
+ - **Plan Mode (`exit_plan_mode` available)**: Call read-only `ext_swarm_*` tools only—never create, spawn, wait, or merge in Plan Mode. Put full specs in the plan; see `skills/agy-ext-swarm/references/orchestrator.md` on handoff or `[plan review]`.
@@ -17,25 +17,11 @@ import {
17
17
  import { homedir } from 'node:os';
18
18
  import { dirname, join, resolve } from 'node:path';
19
19
  import { fileURLToPath } from 'node:url';
20
+ import { RUNTIME_PLUGIN_FILES } from './manifest.mjs';
20
21
 
21
22
  const PLUGIN_DIR_NAME = 'agy-ext-swarm';
22
23
  const MIN_NODE_MAJOR = 20;
23
24
 
24
- const RUNTIME_PLUGIN_FILES = [
25
- 'plugin.json',
26
- 'mcp_config.json',
27
- 'README.md',
28
- 'README.zh-CN.md',
29
- 'LICENSE',
30
- 'assets/logo.svg',
31
- 'assets/preview.svg',
32
- 'bin/ext-board.mjs',
33
- 'rules/AGENTS.md',
34
- 'skills/agy-ext-swarm/SKILL.md',
35
- 'server/dist/index.mjs',
36
- 'server/dist/board.html',
37
- ];
38
-
39
25
  const scriptPath = realpathSync(fileURLToPath(import.meta.url));
40
26
  const __dirname = dirname(scriptPath);
41
27
  const repoRoot = resolve(__dirname, '..');
@@ -0,0 +1,22 @@
1
+ export const RUNTIME_PLUGIN_FILES = [
2
+ 'plugin.json',
3
+ 'mcp_config.json',
4
+ 'README.md',
5
+ 'README.zh-CN.md',
6
+ 'LICENSE',
7
+ 'assets/logo.svg',
8
+ 'assets/preview.svg',
9
+ 'bin/ext-board.mjs',
10
+ 'rules/AGENTS.md',
11
+ 'skills/agy-ext-swarm/SKILL.md',
12
+ 'skills/agy-ext-swarm/references/orchestrator.md',
13
+ 'skills/agy-ext-swarm/references/advanced.md',
14
+ 'server/dist/index.mjs',
15
+ 'server/dist/board.html',
16
+ ];
17
+
18
+ export const RELEASE_PLUGIN_FILES = [
19
+ ...RUNTIME_PLUGIN_FILES,
20
+ 'scripts/install.mjs',
21
+ 'scripts/manifest.mjs',
22
+ ];