personal-bot 0.3.5 → 0.3.6

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.
Files changed (45) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +191 -65
  4. package/README.zh-CN.md +189 -63
  5. package/docs/README.md +1 -1
  6. package/docs/architecture/design.md +3 -4
  7. package/docs/hosts/antigravity.md +4 -2
  8. package/docs/hosts/pi.md +4 -15
  9. package/docs/maintainers/release.md +2 -2
  10. package/lib/antigravity-plugin/lib/extension/cli.js +1392 -1493
  11. package/lib/antigravity-plugin/package.json +1 -1
  12. package/lib/antigravity-plugin/plugin.json +1 -1
  13. package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
  14. package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
  15. package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
  16. package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +1 -1
  17. package/lib/extension/cli.js +1392 -1493
  18. package/lib/qoder-plugin/.mcp.json +2 -2
  19. package/lib/qoder-plugin/.qoder-plugin/plugin.json +1 -1
  20. package/lib/qoder-plugin/hooks/hooks.json +3 -3
  21. package/lib/qoder-plugin/skills/pbot/SKILL.md +1 -1
  22. package/package.json +1 -1
  23. package/src/extension/cli/commands/install.ts +77 -0
  24. package/src/extension/cli/index.ts +3 -4
  25. package/src/integrations/installation/installers/antigravity.ts +49 -0
  26. package/src/integrations/installation/installers/claude.ts +30 -0
  27. package/src/integrations/installation/installers/codex.ts +56 -0
  28. package/src/integrations/installation/installers/dsh.ts +25 -0
  29. package/src/integrations/installation/installers/pi.ts +26 -0
  30. package/src/integrations/installation/installers/qoder.ts +49 -0
  31. package/src/integrations/installation/installers/registry.ts +48 -0
  32. package/src/integrations/installation/processes.ts +2 -41
  33. package/src/model/installation.ts +28 -36
  34. package/src/services/installation/install-service.ts +107 -0
  35. package/lib/common/package-source.js +0 -16
  36. package/lib/extension/setup/guard.js +0 -11
  37. package/lib/integrations/installation/pi-bridge.js +0 -131
  38. package/lib/model/installation.js +0 -1
  39. package/resources/installer/plugins.json +0 -16
  40. package/src/extension/cli/commands/setup.ts +0 -159
  41. package/src/extension/setup/guard.ts +0 -12
  42. package/src/integrations/installation/pi-bridge.ts +0 -109
  43. package/src/integrations/installation/pi-setup.ts +0 -165
  44. package/src/services/installation/setup-service.ts +0 -91
  45. package/src/ui/setup.ts +0 -40
package/README.zh-CN.md CHANGED
@@ -4,116 +4,242 @@
4
4
 
5
5
  **连接知识、研究与行动的跨 Harness 个人助手层。**
6
6
 
7
- Personal Bot 为多宿主环境([Pi](https://pi.dev)、dsh、Claude Code、Antigravity、Codex、Qoder CLI 及可扩展的其他插件宿主)提供共享工作区资料与专业方法,并通过统一的 stdio MCP 工具集(`worker_create`、`worker_close`、`worker_request`、`worker_response`、`worker_output`、`worker_discover`)实现跨 Harness ACP v1 专家调度。同宿主子任务与团队完全交由宿主原生能力,两者互补互不干扰;Pi 与 dsh 另提供 `pbot_history` 历史检索。
7
+ Personal Bot 将 [Pi](https://pi.dev)、DeepSeek Harness(`dsh`)、Claude Code、Antigravity、Codex、Qoder CLI 及任意支持 MCP 的宿主接入同一份工作区——提供共享资料与技能、工作区统一 MCP、跨宿主历史对话,以及基于 ACP v1 的跨 Harness 专家调度。各宿主原生的子代理和团队能力保持独立,互不干扰。
8
8
 
9
- 快速导航:[文档总索引](docs/README.md) · [Pi](docs/hosts/pi.md) · [dsh](docs/hosts/dsh.md) · [Claude Code](docs/hosts/claude-code.md) · [Antigravity](docs/hosts/antigravity.md) · [跨 Harness 调度](docs/guides/cross-harness-workers.md)。
9
+ 快速导航:[文档总索引](docs/README.md) · [Pi](docs/hosts/pi.md) · [dsh](docs/hosts/dsh.md) · [Claude Code](docs/hosts/claude-code.md) · [Antigravity](docs/hosts/antigravity.md) · [Codex 与 Qoder CLI](docs/hosts/codex-qoder.md)。
10
10
 
11
- ## 工作区启用
11
+ ## 核心功能
12
12
 
13
- 安装后在目标工作区运行初始化命令(Pi / dsh / Antigravity:`/pbot init`;Claude Code:`/personal-bot:pbot init`),补建缺失资料目录与根 `AGENTS.md`,并启用各宿主共用的 `.pbot/config.json`:
13
+ 1. **共享工作区与技能**
14
+ - 以统一目录沉淀长期事务、项目产物、可复用知识、外部接入手册、实验脚本与角色约定(`AGENTS.md`、`areas/`、`projects/`、`knowledge/`、`providers/`、`scratch/`、`agents/`、`.agents/skills/`)。
15
+ - 通过工作区根目录的 `.pbot/config.json` 显式启用(只检查绑定根目录,不向父目录继承);配置缺失、停用或损坏时保持休眠。
16
+ - 支持按模块精细开关 `features`(`prompts`、`skills`、`mcp`、`history`,默认均为 `true`),按需启用。
14
17
 
15
- ```json
16
- { "enabled": true }
17
- ```
18
+ 2. **跨 Harness 专家调度(`worker_*`)**
19
+ - 通过单一 stdio MCP 服务(`pbot mcp`)暴露 6 个读写分离的工具:`worker_discover`、`worker_create`、`worker_request`、`worker_response`、`worker_output`、`worker_close`。
20
+ - 内置 `pi`、`dsh`、`claude`、`antigravity`、`codex`、`qoder` 六种 ACP v1 预设,并支持在 `.pbot/config.json` 中接入任意自定义 ACP v1 程序。
21
+ - 与宿主原生子代理互补(Claude `Agent`/团队、Antigravity `invoke_subagent`/`/swarm`、dsh `subagent`),不拦截、不覆盖原生能力。
22
+
23
+ 3. **工作区共享 MCP(`.pbot/mcp.json`)**
24
+ - 通过 `pbot mcp add|list|remove` 在工作区统一维护 stdio 与 Streamable HTTP MCP 服务,支持 `${ENV_VAR}` 环境变量展开,不保存明文凭据。
25
+ - Pi 与 dsh 直接原生挂载;插件宿主通过 `workspace_mcp_discover` / `workspace_mcp_call` 按需调用;ACP worker 自动继承同一组服务。
26
+
27
+ 4. **跨宿主历史对话与摘要(`.pbot/history/`)**
28
+ - 将各已接入宿主的主会话原始问答统一归档到 `.pbot/history/raw/`(默认按年月分层)。
29
+ - 通过 `pbot history summary` 增量生成单会话与月度摘要。
30
+ - 通过 `pbot_history`(Pi / dsh)、MCP `history_search` / `history_read`(插件与其他 MCP 宿主)及 `pbot history` CLI 只读检索与逐层下钻。
18
31
 
19
- 配置缺失、停用或损坏时 Personal Bot 保持未启用,不干扰宿主原生能力;只检查绑定工作区根目录,不向父目录继承。详见[工作区配置](docs/guides/workspace-configuration.md)。
32
+ ### 宿主支持一览
33
+
34
+ | 宿主 | 接入方式 | 工作区启用 | 跨 Harness MCP | 历史对话 |
35
+ | --- | --- | --- | --- | --- |
36
+ | **Pi** | 原生扩展 | `/pbot init` | 自动挂载 + `/pbot worker` | `pbot_history` + `/pbot history` |
37
+ | **dsh** | 原生插件 + Web 工作台 | `/pbot init` | 自动挂载 + `/pbot worker` | `pbot_history` + Web 历史页 + `/pbot history` |
38
+ | **Claude Code** | 原生插件(hooks + MCP) | `/personal-bot:pbot init` | 自动挂载 | Hooks + MCP `history_*` |
39
+ | **Antigravity** | 原生插件(hooks + MCP) | `/pbot init` | 自动挂载 | Hooks + MCP `history_*` |
40
+ | **Codex** | 原生插件(hooks + MCP) | `pbot plugin codex init` | 自动挂载 | Hooks + MCP `history_*` |
41
+ | **Qoder CLI** | 原生插件(hooks + MCP) | `pbot plugin qoder init` | 自动挂载 | Hooks + MCP `history_*` |
42
+ | **其他 MCP 宿主**(Cursor 等) | Stdio MCP(`pbot mcp`) | `pbot init` | 手动配置 MCP | MCP `history_*` + CLI |
20
43
 
21
44
  ## 安装
22
45
 
23
- 在工作区根目录运行 CLI,或用 `--workspace <目录>` 指定。全局安装用 `npm install -g personal-bot`,临时运行用 `npx personal-bot@<插件版本>`。所有宿主共用 `pbot init`、`pbot status`、`pbot upgrade|update` 和 `pbot history status|list|summary|migrate|search|read`。运行 `pbot upgrade` 可将全局 CLI 与当前工作区已绑定的各宿主插件统一升级到 npm 最新稳定版;显式初始化或在已启用的工作区执行命令时,CLI 也会自动选择满足插件要求的版本。详见[工作区配置](docs/guides/workspace-configuration.md)与[历史与 CLI 指南](docs/guides/history.md)。
46
+ **环境要求**:Linux 或 macOS,Node.js `22.19+` 与 npm(`dsh` 需要 Node.js `24.9+` 与 `pnpm`)。
24
47
 
25
- ### Pi
48
+ ### 1. 安装通用 CLI(推荐)
26
49
 
27
- 需要 Linux/macOS、Node.js 22.19+ 与 npm:
50
+ ```bash
51
+ npm install -g personal-bot
52
+ ```
53
+
54
+ 所有宿主共用 `pbot` CLI(`pbot install`、`pbot init`、`pbot status`、`pbot upgrade`、`pbot mcp`、`pbot history`)。如不想全局安装,可用 `npx personal-bot@latest` 代替 `pbot`。
55
+
56
+ ### 2. 安装宿主插件
57
+
58
+ **方式一:通过 `pbot install` 统一安装(推荐)**
28
59
 
29
60
  ```bash
30
- # 向导安装
31
- npx personal-bot@latest setup
61
+ # 为本机所有已安装的宿主统一安装(未安装的宿主自动跳过)
62
+ pbot install all
32
63
 
33
- # 或在已有 Pi 的工作区安装
34
- pi install --local npm:personal-bot
35
- pi
64
+ # 或为单个宿主安装:pi | dsh | claude | antigravity | codex | qoder
65
+ pbot install pi --workspace /path/to/workspace
66
+ pbot install claude
36
67
  ```
37
68
 
38
- 在会话中执行 `/pbot init`。已启用后自动挂载 `pbot` MCP 服务(`worker_*`)与 `pbot_history`,提供 `/pbot init | status | history | worker`。详见 [Pi 使用指南](docs/hosts/pi.md)。
69
+ 可通过 `--dsh-profile <名称>` 指定 `dsh` profile(默认 `pbot`)。Codex 安装后需在 `/hooks` 中检查并信任 Personal Bot hooks 再开始会话。
70
+
71
+ **方式二:各宿主原生安装**
72
+
73
+ - **Pi**(在目标工作区根目录执行):`pi install --local npm:personal-bot` · [Pi 使用指南](docs/hosts/pi.md)
74
+ - **dsh**(`0.2.2-rc.1+`,Node.js `24.9+`,`pnpm`):`dsh plugin --profile pbot add personal-bot@latest`(首次创建 profile:`dsh --profile pbot --from-default-profile web --dump-config`) · [dsh 使用指南](docs/hosts/dsh.md)
75
+ - **Claude Code**(`2.1.325+`):`/plugin install personal-bot --marketplace realqiyan/personal-bot` · [Claude Code 使用指南](docs/hosts/claude-code.md)
76
+ - **Antigravity**(`agy` `1.5+`):`agy plugin install "$(npm root -g)/personal-bot/lib/antigravity-plugin"` · [Antigravity 使用指南](docs/hosts/antigravity.md)
77
+ - **Codex**:`codex plugin marketplace add "$(npm root -g)/personal-bot/lib/codex-marketplace" && codex plugin add personal-bot@pbot-local`(安装后在 `/hooks` 信任 hooks) · [Codex 与 Qoder CLI 指南](docs/hosts/codex-qoder.md)
78
+ - **Qoder CLI**:`qodercli plugin install "$(npm root -g)/personal-bot/lib/qoder-plugin"` · [Codex 与 Qoder CLI 指南](docs/hosts/codex-qoder.md)
79
+ - **其他 MCP 宿主(Cursor 等)**:将宿主的 stdio MCP 服务命令配置为 `pbot mcp`(或 `npx personal-bot@latest mcp`)。
80
+
81
+ ## 使用
39
82
 
40
- ### dsh
83
+ ### 启用工作区
41
84
 
42
- 需要 Node.js 24.9+、npm、pnpm 与 dsh `0.2.2-rc.1+`:
85
+ 在目标工作区根目录初始化一次即可(所有宿主共用同一份 `.pbot/config.json`):
43
86
 
44
87
  ```bash
45
- npm install -g @deepseek-ai/dsh@latest pnpm@latest
46
- dsh --profile pbot --from-default-profile web --dump-config
47
- dsh plugin --profile pbot add personal-bot@latest
48
- dsh --profile pbot
88
+ # 在终端执行(适用于所有宿主)
89
+ pbot init --workspace /path/to/workspace
49
90
  ```
50
91
 
51
- 选择工作区并执行 `/pbot init`。已启用后通过原生 `@deepseek-ai/dsh-mcp-client` 自动挂载 `mcp__pbot__worker_*`,并提供 Web 工作区/历史面板与 `/pbot status | init | worker | history`。详见 [dsh 使用指南](docs/hosts/dsh.md)。
92
+ 或在宿主会话中执行对应命令:
93
+ - Pi / dsh / Antigravity:`/pbot init`
94
+ - Claude Code:`/personal-bot:pbot init`
95
+ - Codex / Qoder CLI:`pbot plugin codex init` 或 `pbot plugin qoder init`
96
+
97
+ `init` 会补建缺失的资料目录与根 `AGENTS.md`(不覆盖已有文件),并启用 `.pbot/config.json`:
98
+
99
+ ```json
100
+ {
101
+ "enabled": true,
102
+ "features": {
103
+ "prompts": true,
104
+ "skills": true,
105
+ "mcp": true,
106
+ "history": true
107
+ }
108
+ }
109
+ ```
110
+
111
+ 随时运行 `pbot status`(或会话内 `/pbot status`)查看启用状态与各宿主插件版本同步情况。详见[工作区配置](docs/guides/workspace-configuration.md)。
112
+
113
+ ### 工作区目录说明
114
+
115
+ | 路径 | 用途 |
116
+ | --- | --- |
117
+ | `.pbot/config.json` | 工作区启用开关、`features` 模块开关、`acp` 后端与 `history`/`summary` 配置 |
118
+ | `.pbot/mcp.json` | 工作区共享的 stdio / HTTP MCP 服务配置 |
119
+ | `.pbot/history/` | 各宿主原始问答(`raw/`)与派生摘要(`summaries/`) |
120
+ | `AGENTS.md` | 项目索引、工作约定与可选的跨 Harness 分工偏好 |
121
+ | `areas/`、`projects/`、`knowledge/` | 长期事务、项目产物与可复用知识方法 |
122
+ | `providers/` | 外部 CLI/MCP 使用手册与数据口径 |
123
+ | `scratch/` | 临时脚本、计算数据与实验环境 |
124
+ | `agents/` | 角色职责补充(`coordinator.md`、`general-purpose.md`) |
125
+ | `.agents/skills/` | 跨宿主共享的工作区自有技能(`<name>/SKILL.md`) |
126
+
127
+ ### 常用功能
52
128
 
53
- ### Claude Code
129
+ **1. 跨 Harness 专家调度(`worker_*`)**
54
130
 
55
- 需要 Linux/macOS、Node.js 22.19+ 与 Claude Code `2.1.325+`:
131
+ 在对话中直接要求调用其他宿主(例如“让 Codex 实现并测试模块 A”或“请 Claude 独立审查这份改动”),或在 Pi / dsh 中使用 `/pbot worker` 命令:
56
132
 
57
133
  ```text
58
- /plugin install personal-bot --marketplace realqiyan/personal-bot
134
+ /pbot worker overview
135
+ /pbot worker backends
136
+ /pbot worker models claude
137
+ /pbot worker create {"backend":"codex"}
59
138
  ```
60
139
 
61
- 在工作区执行 `/personal-bot:pbot init`。插件通过标准 command hooks 注入主会话上下文并门控未启用技能,不拦截原生 `Agent`;跨 Harness 调度由内置 `.mcp.json` 挂载的 `worker_*` 提供。详见 [Claude Code 使用指南](docs/hosts/claude-code.md)。
140
+ 使用内置 ACP 目标前,需先安装并登录对应目标程序(`pi-acp`、`dsh`、`@agentclientprotocol/claude-agent-acp`、`agy`、`@agentclientprotocol/codex-acp` 或 `qodercli`)。如需接入自定义 ACP v1 程序,在 `.pbot/config.json` 中声明即可:
62
141
 
63
- ### Codex / Qoder CLI
142
+ ```json
143
+ {
144
+ "enabled": true,
145
+ "acp": {
146
+ "my-harness": {
147
+ "command": "/absolute/path/to/my-acp",
148
+ "args": ["--stdio"],
149
+ "env": { "MY_HARNESS_MODE": "headless" },
150
+ "permission": "ask"
151
+ }
152
+ }
153
+ }
154
+ ```
64
155
 
65
- 安装对应原生插件后,在工作区运行 `pbot plugin codex init` 或 `pbot plugin qoder init`。详见[安装与使用指南](docs/hosts/codex-qoder.md)。
156
+ 详见[跨 Harness 专家调度](docs/guides/cross-harness-workers.md)。
66
157
 
67
- ### Antigravity
158
+ **2. 管理工作区共享 MCP**
68
159
 
69
- 需要 Linux/macOS、Node.js 22.19+ 与 Antigravity CLI(`agy` `1.5+`):
160
+ ```bash
161
+ # 添加 stdio MCP 服务
162
+ pbot mcp add sqlite --description "本地 SQLite 查询" -- npx -y @modelcontextprotocol/server-sqlite ./data.db
163
+
164
+ # 添加 Streamable HTTP MCP 服务(用环境变量引用凭据)
165
+ pbot mcp add internal-api --url https://mcp.example.com/mcp --header Authorization='Bearer ${INTERNAL_MCP_TOKEN}'
166
+
167
+ # 查看或移除
168
+ pbot mcp list
169
+ pbot mcp remove sqlite
170
+ ```
171
+
172
+ **3. 跨宿主历史与摘要**
70
173
 
71
174
  ```bash
72
- npx personal-bot@latest install-antigravity
175
+ pbot history status
176
+ pbot history summary
177
+ pbot history search "评审决定" --limit 10
178
+ pbot history read <节点ID>
73
179
  ```
74
180
 
75
- 在工作区执行 `/pbot init`。插件通过 `SessionStart`/`PreToolUse` hooks 注入上下文并门控未启用技能,不拦截原生 `invoke_subagent`/`/swarm`;跨 Harness 调度由内置 `mcp_config.json` 挂载的 `worker_*` 提供。详见 [Antigravity 使用指南](docs/hosts/antigravity.md)。
181
+ 详见[历史对话](docs/guides/history.md)。
182
+
183
+ ## 升级
76
184
 
77
- ### 其他 MCP 宿主与自定义 ACP Harness
185
+ ### 统一升级(推荐)
78
186
 
79
- 在 Codex、Cursor 等任意 MCP 宿主中使用 `worker_*`,将 stdio MCP 服务指向:
187
+ 在工作区根目录执行(或通过 `--workspace <目录>` 指定):
80
188
 
81
189
  ```bash
82
- npx personal-bot@latest mcp
83
- # 或全局安装后使用
84
- pbot mcp
190
+ pbot upgrade
191
+ # 等价别名:pbot update
85
192
  ```
86
193
 
87
- 支持内置预设(`pi`、`dsh`、`claude`、`antigravity`、`codex`、`qoder`)及 `.pbot/config.json` 中声明的任意自定义 ACP v1 程序(支持 `{ "command", "args", "env?" }`),详见[跨 Harness 专家调度](docs/guides/cross-harness-workers.md)。
194
+ `pbot upgrade` 会将全局 `pbot` CLI 与当前工作区已绑定的各宿主插件统一升级到 npm 最新稳定版,并保留各宿主原有安装作用域。常用选项:
88
195
 
89
- ## 工作区资料
196
+ - `--version <x.y.z>`:指定目标版本
197
+ - `--hosts <h1,h2>`:仅升级指定宿主(如 `claude,codex`)
198
+ - `--dsh-profile <名称>`:自动识别失败时显式指定 dsh profile
90
199
 
91
- | 位置 | 用途 |
92
- | --- | --- |
93
- | `.pbot/config.json` | 全宿主共用的工作区启用与开放 ACP Harness 配置 |
94
- | `AGENTS.md` | 项目导航、工作约定与可选的跨 Harness 分工偏好 |
95
- | `areas/`、`projects/`、`knowledge/` | 长期事务、项目产物与可复用知识方法 |
96
- | `providers/` | 外部 CLI/MCP 使用手册与数据口径 |
97
- | `scratch/` | 临时脚本、计算数据与实验环境 |
98
- | `agents/` | 角色职责补充(`coordinator.md`、`general-purpose.md`) |
99
- | `.pbot/history/` | 各接入宿主的原始问答(`raw/`)与分层摘要(`summaries/`) |
200
+ 同一工作区下多个宿主版本不一致时,`pbot status` 会标记 `outOfSync: true`。
100
201
 
101
- ## 开发与验证
202
+ ### 单宿主手动升级
102
203
 
103
- 当前版本 **0.3.4**。完整开发使用 Linux/macOS、Node.js 24.9+:
204
+ - **全局 CLI**:`npm install -g personal-bot@latest`
205
+ - **Pi**:`pi install --local npm:personal-bot@latest`(随后在 Pi 中执行 `/reload`)
206
+ - **dsh**:先停止运行中的 dsh 服务,再执行 `dsh plugin --profile pbot update personal-bot --latest`
207
+ - **Claude Code**:`claude plugin update personal-bot`(重启会话生效)
208
+ - **Antigravity**:先执行 `npm install -g personal-bot@latest`,再执行 `agy plugin install "$(npm root -g)/personal-bot/lib/antigravity-plugin"` 或 `pbot install antigravity`(重启会话生效)
209
+ - **Codex**:先执行 `npm install -g personal-bot@latest`,再执行 `codex plugin add personal-bot@pbot-local`(若 hooks 有变化,需在 `/hooks` 中重新确认信任)
210
+ - **Qoder CLI**:先执行 `npm install -g personal-bot@latest`,再执行 `qodercli plugin install "$(npm root -g)/personal-bot/lib/qoder-plugin"`
104
211
 
105
- ```bash
106
- npm ci --ignore-scripts
107
- npm run check
108
- npm test
109
- agy plugin validate --strict ./lib/antigravity-plugin --json
110
- claude plugin validate --json ./.claude-plugin/plugin.json
111
- git diff --check
112
- ```
212
+ ## 卸载
213
+
214
+ ### 仅在单个工作区停用
215
+
216
+ 如果只想在某个工作区停用 Personal Bot 而保留插件和资料,将 `.pbot/config.json` 中的 `"enabled"` 改为 `false`(或删除 `.pbot/config.json`)即可。
217
+
218
+ ### 卸载插件与 CLI
219
+
220
+ 按实际安装情况移除对应组件:
221
+
222
+ - **全局 CLI**:`npm uninstall -g personal-bot`
223
+ - **Pi**(在工作区根目录执行):`pi remove --local npm:personal-bot`
224
+ - **dsh**(先停止服务):`dsh plugin --profile pbot remove personal-bot`
225
+ - **Claude Code**:`claude plugin uninstall personal-bot`
226
+ - **Antigravity**:`agy plugin uninstall personal-bot`
227
+ - **Codex**:`codex plugin remove personal-bot@pbot-local`(可选:`codex plugin marketplace remove pbot-local`)
228
+ - **Qoder CLI**:`qodercli plugin uninstall personal-bot`
229
+ - **其他 MCP 宿主**:从宿主的 MCP 配置中移除 `pbot` 条目。
230
+
231
+ ### 可选的数据清理
232
+
233
+ 卸载操作不会删除你的工作区资料(`AGENTS.md`、`areas/`、`projects/`、`knowledge/`、`providers/`、`scratch/`、`agents/`、`.agents/skills/`)或本地状态。如需彻底清理 Personal Bot 状态文件,可手动删除:
234
+
235
+ - 工作区状态目录:工作区内的 `.pbot/`(含 `config.json`、`mcp.json` 与 `history/`)
236
+ - 用户级缓存与宿主绑定记录:`~/.pbot/`
237
+
238
+ ## 文档与开发
113
239
 
114
- - [文档总索引](docs/README.md)
115
- - [架构原则](docs/architecture/principles.md) · [技术设计](docs/architecture/design.md) · [插件与 ACP 扩展设计](docs/architecture/extensibility.md)
116
- - [npm 发布与验收](docs/maintainers/release.md) · [维护脚本](scripts/README.md) · [领域术语](CONTEXT.md)
240
+ - [文档总索引](docs/README.md) · [工作区配置](docs/guides/workspace-configuration.md) · [跨 Harness 专家调度](docs/guides/cross-harness-workers.md) · [历史对话](docs/guides/history.md) · [工具与执行能力](docs/guides/capabilities.md)
241
+ - [架构原则](docs/architecture/principles.md) · [技术设计](docs/architecture/design.md) · [插件与 ACP 扩展设计](docs/architecture/extensibility.md) · [npm 发布与验收](docs/maintainers/release.md) · [领域术语](CONTEXT.md)
242
+ - 参与开发与验证请参考 [AGENTS.md](AGENTS.md)。
117
243
 
118
244
  ## 许可证与免责声明
119
245
 
package/docs/README.md CHANGED
@@ -6,7 +6,7 @@ Personal Bot 文档按使用场景与职责分为四类,根目录 [README.zh-C
6
6
 
7
7
  | 文档 | 适用对象与内容 |
8
8
  | --- | --- |
9
- | [Pi 使用指南](hosts/pi.md) | `pbot setup` 安装、`/pbot init\|status\|worker`、自动挂载 MCP `worker_*` 与 `pbot_history` |
9
+ | [Pi 使用指南](hosts/pi.md) | `pbot install pi` / 原生安装、`/pbot init\|status\|worker`、自动挂载 MCP `worker_*` 与 `pbot_history` |
10
10
  | [dsh 使用指南](hosts/dsh.md) | profile 与插件管理、工作区/历史 Web 工作台、`/pbot` 聊天命令、自动挂载 MCP `worker_*` |
11
11
  | [Claude Code 使用指南](hosts/claude-code.md) | 原生插件安装、command hooks、技能门控、MCP `worker_*` 与原生 Agent/团队互补 |
12
12
  | [Codex 与 Qoder CLI](hosts/codex-qoder.md) | 原生插件安装、工作区启用、hook、历史与 MCP 工具 |
@@ -41,7 +41,7 @@
41
41
  2. **跨宿主协议与运行域**:
42
42
  - **ACP Harness**:实现 `AcpHarnessAdapter` 放入 `src/integrations/acp/harnesses/<name>.ts` 并在 `src/integrations/acp/registry.ts` 注册;运行时在 `src/extension/acp/`;辅助模块避免与适配器重名(如 `acp/claude-settings.ts`)。
43
43
  - **MCP 服务与桥接**:统一放在 `src/extension/mcp/`。
44
- - **统一 CLI 与安装器**:CLI 路由与命令处理器在 `src/extension/cli/`,Pi 初始化保护在 `src/extension/setup/guard.ts`,外部环境桥接与宿主升级器在 `src/integrations/installation/`。
44
+ - **统一 CLI 与安装器**:CLI 路由与命令处理器在 `src/extension/cli/`,宿主安装器与升级器在 `src/integrations/installation/`。
45
45
  3. **宿主无关业务与共享模块**:业务规则放 `src/services/<domain>/`,纯数据契约放 `src/model/`,存储放 `src/storage/`,跨宿主 UI/展示辅助放 `src/ui/` 顶层。
46
46
 
47
47
  所有单向依赖与宿主 SDK 隔离规则由 `.dependency-cruiser.cjs` 静态强制。`common/validation` 保持零第三方依赖,`common/schema`(Ajv)仅由 Pi/dsh 历史工具与管理查询显式引入。
@@ -76,13 +76,12 @@
76
76
  - `pbot upgrade|update [--workspace <dir>] [--version <ver>] [--hosts <h1,h2>] [--dsh-profile <name>] [--json]`:统一升级全局 CLI 与当前工作区已绑定的各宿主插件。
77
77
  - `pbot mcp [list|add|remove ...]`:无参数时运行独立打包的 `lib/extension/mcp.js` 供任意 MCP 客户端连接;带子命令时管理工作区 `.pbot/mcp.json`。
78
78
  - `pbot plugin <host> hook|init|status`:经 `PluginHostRegistry` 运行轻插件宿主的无状态 hook 或工作区命令。
79
- - `pbot setup [--workspace <dir>]`:交互式检查环境、安装/更新 Pi 与工作区扩展,保留自定义本地/Git/固定来源,完成后通过临时 `setup-guard` 启动 Pi 执行 `/pbot init`。
80
- - `pbot install-antigravity`:调用原生 `agy plugin install ./lib/antigravity-plugin` 安装或更新 Antigravity 插件。
79
+ - `pbot install <host|all> [--workspace <dir>] [--dsh-profile <name>] [--json]`:经 `HostInstallerRegistry` 为指定宿主或本机已安装的各宿主统一安装插件。
81
80
 
82
81
  ## 构建与分发
83
82
 
84
83
  构建顺序固定为 **`dist → build:cli → build:dsh → build:plugins`**(`build:cli` 清空 `lib/`):
85
- 1. `build:cli`:编译独立 CLI、Pi 检查桥接与 `setup-guard`。
84
+ 1. `build:cli`:打包独立 CLI(`lib/extension/cli.js` 与 `lib/extension/workspace-cli.js` 兼容入口)。
86
85
  2. `build:dsh`:编译 dsh Host,打包内置 TypeBox 及许可证,构建 Web 客户端模块 `lib/client.js`。
87
86
  3. `build:plugins`:编译共享插件运行时(`lib/plugin.js`、`lib/claude.js`),用 `esbuild` 打包零外部依赖的 `lib/extension/mcp.js` 与 `lib/extension/acp-worker.js`(内联 `@agentclientprotocol/sdk`),执行已注册的各插件宿主目标(同步 Claude 清单、组装自包含 `lib/antigravity-plugin/`)。
88
87
 
@@ -7,14 +7,16 @@ Personal Bot 以自包含原生插件(`lib/antigravity-plugin/`)接入 Googl
7
7
  支持 Linux 和 macOS,需要 Node.js 22.19+ 与 Antigravity CLI(`agy` 1.5+):
8
8
 
9
9
  ```sh
10
- npx personal-bot@latest install-antigravity
10
+ npx personal-bot@latest install antigravity
11
+ # 或全局安装后使用
12
+ pbot install antigravity
11
13
  ```
12
14
 
13
15
  从源码本地构建安装:
14
16
 
15
17
  ```sh
16
18
  npm run build
17
- node bin/pbot.mjs install-antigravity
19
+ node bin/pbot.mjs install antigravity
18
20
  # 或直接调用原生命令
19
21
  agy plugin install ./lib/antigravity-plugin
20
22
  ```
package/docs/hosts/pi.md CHANGED
@@ -4,23 +4,12 @@ Personal Bot 以 Pi 扩展形式接入 [Pi](https://pi.dev),提供共享工作
4
4
 
5
5
  ## 安装与启用
6
6
 
7
- 支持 Linux 和 macOS,需要 Node.js 22.19+ 与 npm。
8
-
9
- ### 向导安装
10
-
11
- ```bash
12
- npx personal-bot@latest setup
13
- # 或直接指定工作区
14
- npx personal-bot@latest setup --workspace ~/pbot-workspace
15
- ```
16
-
17
- 向导负责安装或更新 Pi 与工作区扩展,并在确认后启动 Pi 执行 `/pbot init`。已有全局或本地来源按原生规则保留,可按需切换到 npm 最新稳定版。
18
-
19
- ### 已有 Pi 安装
20
-
21
- 在目标工作区根目录执行:
7
+ 支持 Linux 和 macOS,需要 Node.js 22.19+ 与 npm。在目标工作区根目录执行:
22
8
 
23
9
  ```bash
10
+ # 通过 pbot CLI 安装
11
+ pbot install pi
12
+ # 或使用 Pi 原生命令
24
13
  pi install --local npm:personal-bot
25
14
  pi
26
15
  ```
@@ -1,6 +1,6 @@
1
1
  # npm 发布与验收
2
2
 
3
- 发布配置以 `package.json` 为准:包名 `personal-bot`,registry 为 npmjs,稳定版本使用 `latest`。发布包包含 Pi 扩展源码、共享资源、独立 CLI(`setup` / `install-antigravity` / `mcp`)、dsh Host/Web、Claude 插件、自包含 `lib/antigravity-plugin/` 以及独立打包的 `lib/extension/{mcp,acp-worker}.js`。
3
+ 发布配置以 `package.json` 为准:包名 `personal-bot`,registry 为 npmjs,稳定版本使用 `latest`。发布包包含 Pi 扩展源码、共享资源、独立 CLI(`install` / `upgrade` / `mcp` / `history`)、dsh Host/Web、Claude 插件、自包含 `lib/antigravity-plugin/` 以及独立打包的 `lib/extension/{mcp,acp-worker}.js`。
4
4
 
5
5
  ## 首次配置
6
6
 
@@ -55,5 +55,5 @@ npm publish "./personal-bot-$VERSION.tgz" --ignore-scripts --access public --tag
55
55
  2. Pi 消费检查:`node scripts/check-consumer.mjs npm:personal-bot@<version>`。
56
56
  3. dsh:在独立 profile 安装 `personal-bot@latest`,核对 `/pbot status`、Web 工作区/历史页与 `mcp__pbot__worker_*`。
57
57
  4. Claude Code:通过 `/plugin install personal-bot --marketplace realqiyan/personal-bot` 安装,核对版本、`/personal-bot:pbot status` 与 `worker_*` MCP。
58
- 5. Antigravity:通过 `npx personal-bot@latest install-antigravity` 安装,核对 `/pbot status` 与 `worker_*` MCP。
58
+ 5. Antigravity:通过 `npx personal-bot@latest install antigravity` 安装,核对 `/pbot status` 与 `worker_*` MCP。
59
59
  6. 真实模型环境下各宿主首轮上下文、技能选择与跨 Harness 实测调用(含 `npm run test:e2e:acp`)在独立批准环境单独验收。