personal-bot 0.3.7 → 0.4.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -8
- package/README.zh-CN.md +5 -8
- package/bin/pbot-pi-acp.mjs +1 -1
- package/docs/architecture/design.md +2 -2
- package/docs/architecture/extensibility.md +1 -1
- package/docs/guides/cross-harness-workers.md +4 -4
- package/docs/guides/history.md +1 -3
- package/docs/guides/workspace-configuration.md +4 -4
- package/docs/hosts/claude-code.md +2 -2
- package/docs/hosts/codex-qoder.md +1 -1
- package/lib/antigravity-plugin/bin/pbot-pi-acp.mjs +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.d.ts +1 -1
- package/lib/antigravity-plugin/lib/extension/acp/member.js +11 -10
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +346 -201
- package/lib/antigravity-plugin/lib/extension/cli.js +563 -538
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +0 -11
- package/lib/antigravity-plugin/lib/extension/mcp.js +397 -278
- package/lib/antigravity-plugin/lib/model/acp.d.ts +29 -35
- package/lib/antigravity-plugin/lib/model/agent.d.ts +33 -17
- package/lib/antigravity-plugin/lib/model/agent.js +0 -1
- package/lib/antigravity-plugin/lib/storage/acp-files.d.ts +5 -8
- package/lib/antigravity-plugin/lib/storage/acp-files.js +34 -40
- package/lib/antigravity-plugin/lib/storage/agent-files.d.ts +19 -10
- package/lib/antigravity-plugin/lib/storage/agent-files.js +147 -43
- package/lib/antigravity-plugin/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +1 -1
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
- package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
- package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
- package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +1 -1
- package/lib/extension/acp/member.d.ts +1 -1
- package/lib/extension/acp/member.js +11 -10
- package/lib/extension/acp/worker.js +34 -33
- package/lib/extension/acp-worker.js +346 -201
- package/lib/extension/cli.js +563 -538
- package/lib/extension/hosts/dsh/acp-member.js +1 -1
- package/lib/extension/hosts/dsh/command.js +1 -1
- package/lib/extension/hosts/dsh/workspace.js +1 -3
- package/lib/extension/hosts/pi/acp-member.js +3 -4
- package/lib/extension/hosts/plugin-runtime.js +0 -11
- package/lib/extension/mcp/tool-contract.d.ts +8 -50
- package/lib/extension/mcp/tool-contract.js +0 -8
- package/lib/extension/mcp/workers.d.ts +7 -27
- package/lib/extension/mcp/workers.js +35 -17
- package/lib/extension/mcp.js +397 -278
- package/lib/integrations/acp/agents.d.ts +2 -3
- package/lib/integrations/acp/agents.js +22 -22
- package/lib/integrations/acp/harnesses/claude.js +1 -1
- package/lib/model/acp.d.ts +29 -35
- package/lib/model/agent.d.ts +33 -17
- package/lib/model/agent.js +0 -1
- package/lib/qoder-plugin/.mcp.json +2 -2
- package/lib/qoder-plugin/.qoder-plugin/plugin.json +1 -1
- package/lib/qoder-plugin/hooks/hooks.json +3 -3
- package/lib/qoder-plugin/skills/pbot/SKILL.md +1 -1
- package/lib/services/agents/acp-run.d.ts +6 -4
- package/lib/services/agents/acp-run.js +62 -43
- package/lib/services/agents/agent-run.d.ts +10 -6
- package/lib/services/agents/agent-run.js +142 -65
- package/lib/services/agents/agent-service.d.ts +3 -21
- package/lib/services/agents/agent-service.js +180 -126
- package/lib/storage/acp-files.d.ts +5 -8
- package/lib/storage/acp-files.js +34 -40
- package/lib/storage/agent-files.d.ts +19 -10
- package/lib/storage/agent-files.js +147 -43
- package/package.json +1 -1
- package/src/extension/acp/member.ts +14 -11
- package/src/extension/acp/worker.ts +31 -28
- package/src/extension/cli/commands/upgrade.ts +8 -36
- package/src/extension/cli/commands/workspace.ts +3 -8
- package/src/extension/cli/index.ts +1 -2
- package/src/extension/hosts/dsh/acp-member.ts +1 -1
- package/src/extension/hosts/dsh/command.ts +1 -1
- package/src/extension/hosts/dsh/workspace.ts +1 -3
- package/src/extension/hosts/pi/acp-member.ts +3 -4
- package/src/extension/hosts/pi/command.ts +1 -1
- package/src/extension/hosts/pi/lifecycle.ts +0 -2
- package/src/extension/hosts/plugin-runtime.ts +0 -10
- package/src/extension/mcp/tool-contract.ts +0 -8
- package/src/extension/mcp/workers.ts +34 -17
- package/src/integrations/acp/agents.ts +28 -27
- package/src/integrations/acp/harnesses/claude.ts +1 -1
- package/src/integrations/hosts/dsh/session.ts +2 -2
- package/src/integrations/installation/cli-update.ts +2 -2
- package/src/integrations/installation/installers/claude.ts +4 -4
- package/src/integrations/installation/installers/qoder.ts +5 -5
- package/src/integrations/installation/upgraders/antigravity.ts +57 -15
- package/src/integrations/installation/upgraders/claude.ts +1 -4
- package/src/integrations/installation/upgraders/codex.ts +85 -15
- package/src/integrations/installation/upgraders/dsh.ts +46 -24
- package/src/integrations/installation/upgraders/pi.ts +18 -11
- package/src/integrations/installation/upgraders/qoder.ts +95 -20
- package/src/model/acp.ts +27 -29
- package/src/model/agent.ts +80 -16
- package/src/model/installation.ts +0 -2
- package/src/pbot.ts +1 -1
- package/src/services/agents/acp-run.ts +81 -49
- package/src/services/agents/agent-run.ts +154 -56
- package/src/services/agents/agent-service.ts +204 -133
- package/src/services/installation/upgrade-service.ts +1 -5
- package/src/storage/acp-files.ts +50 -45
- package/src/storage/agent-files.ts +159 -46
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +0 -126
- package/lib/services/workspace/plugin-releases.d.ts +0 -15
- package/lib/services/workspace/plugin-releases.js +0 -126
- package/src/services/workspace/plugin-releases.ts +0 -121
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"plugins": [
|
|
7
7
|
{
|
|
8
8
|
"name": "personal-bot",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.4.0",
|
|
10
10
|
"description": "Workspace materials, skills, and cross-harness MCP worker delegation.",
|
|
11
11
|
"source": {
|
|
12
12
|
"source": "npm",
|
|
13
13
|
"package": "personal-bot",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.4.0"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
]
|
package/README.md
CHANGED
|
@@ -72,10 +72,10 @@ Pass `--dsh-profile <name>` to customize the `dsh` profile (defaults to `pbot`).
|
|
|
72
72
|
|
|
73
73
|
- **Pi** (in the target workspace): `pi install --local npm:personal-bot` · [Pi Guide](docs/hosts/pi.md)
|
|
74
74
|
- **dsh** (`0.2.2-rc.1+`, Node.js `24.9+`, `pnpm`): `dsh plugin --profile pbot add personal-bot@latest` (first time: `dsh --profile pbot --from-default-profile web --dump-config`) · [dsh Guide](docs/hosts/dsh.md)
|
|
75
|
-
- **Claude Code** (`2.1.325+`):
|
|
75
|
+
- **Claude Code** (`2.1.325+`): `claude plugin install personal-bot --marketplace realqiyan/personal-bot --scope project` · [Claude Code Guide](docs/hosts/claude-code.md)
|
|
76
76
|
- **Antigravity** (`agy` `1.5+`): `agy plugin install "$(npm root -g)/personal-bot/lib/antigravity-plugin"` · [Antigravity Guide](docs/hosts/antigravity.md)
|
|
77
77
|
- **Codex**: `codex plugin marketplace add "$(npm root -g)/personal-bot/lib/codex-marketplace" && codex plugin add personal-bot@pbot-local` (then trust hooks in `/hooks`) · [Codex & Qoder CLI Guide](docs/hosts/codex-qoder.md)
|
|
78
|
-
- **Qoder CLI**: `qodercli plugin install "$(npm root -g)/personal-bot/lib/qoder-plugin"` · [Codex & Qoder CLI Guide](docs/hosts/codex-qoder.md)
|
|
78
|
+
- **Qoder CLI**: `qodercli plugin install "$(npm root -g)/personal-bot/lib/qoder-plugin" --scope project` · [Codex & Qoder CLI Guide](docs/hosts/codex-qoder.md)
|
|
79
79
|
- **Other MCP Hosts (Cursor, etc.)**: Configure a stdio MCP server pointing to `pbot mcp` (or `npx personal-bot@latest mcp`).
|
|
80
80
|
|
|
81
81
|
## Usage
|
|
@@ -191,13 +191,11 @@ pbot upgrade
|
|
|
191
191
|
# Alias: pbot update
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
-
`pbot upgrade` updates the global `pbot` CLI and all host plugins
|
|
194
|
+
`pbot upgrade` updates the global `pbot` CLI and all host plugins installed on this machine or workspace (discovered via each host's official CLI) to the latest stable npm release while preserving each host's install scope. Useful options:
|
|
195
195
|
|
|
196
196
|
- `--version <x.y.z>`: pin a specific target version
|
|
197
197
|
- `--hosts <h1,h2>`: upgrade only specific hosts (e.g. `claude,codex`)
|
|
198
|
-
- `--dsh-profile <name>`: specify the dsh profile
|
|
199
|
-
|
|
200
|
-
When multiple hosts in the same workspace are on different versions, `pbot status` reports `outOfSync: true`.
|
|
198
|
+
- `--dsh-profile <name>`: specify the dsh profile (defaults to `pbot`)
|
|
201
199
|
|
|
202
200
|
### Per-host manual upgrade
|
|
203
201
|
|
|
@@ -232,8 +230,7 @@ Remove only the components you installed:
|
|
|
232
230
|
|
|
233
231
|
Uninstalling never deletes your workspace materials (`AGENTS.md`, `areas/`, `projects/`, `knowledge/`, `providers/`, `scratch/`, `agents/`, `.agents/skills/`) or local state. If you want to remove Personal Bot state files as well:
|
|
234
232
|
|
|
235
|
-
- Workspace state: `.pbot/` inside the workspace (contains `config.json`, `mcp.json`, and `
|
|
236
|
-
- User-level cache & bindings: `~/.pbot/`
|
|
233
|
+
- Workspace state: `.pbot/` inside the workspace (contains `config.json`, `mcp.json`, `history/`, and `subagents/`)
|
|
237
234
|
|
|
238
235
|
## Documentation & Development
|
|
239
236
|
|
package/README.zh-CN.md
CHANGED
|
@@ -72,10 +72,10 @@ pbot install claude
|
|
|
72
72
|
|
|
73
73
|
- **Pi**(在目标工作区根目录执行):`pi install --local npm:personal-bot` · [Pi 使用指南](docs/hosts/pi.md)
|
|
74
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
|
|
75
|
+
- **Claude Code**(`2.1.325+`):`claude plugin install personal-bot --marketplace realqiyan/personal-bot --scope project` · [Claude Code 使用指南](docs/hosts/claude-code.md)
|
|
76
76
|
- **Antigravity**(`agy` `1.5+`):`agy plugin install "$(npm root -g)/personal-bot/lib/antigravity-plugin"` · [Antigravity 使用指南](docs/hosts/antigravity.md)
|
|
77
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)
|
|
78
|
+
- **Qoder CLI**:`qodercli plugin install "$(npm root -g)/personal-bot/lib/qoder-plugin" --scope project` · [Codex 与 Qoder CLI 指南](docs/hosts/codex-qoder.md)
|
|
79
79
|
- **其他 MCP 宿主(Cursor 等)**:将宿主的 stdio MCP 服务命令配置为 `pbot mcp`(或 `npx personal-bot@latest mcp`)。
|
|
80
80
|
|
|
81
81
|
## 使用
|
|
@@ -191,13 +191,11 @@ pbot upgrade
|
|
|
191
191
|
# 等价别名:pbot update
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
-
`pbot upgrade` 会将全局 `pbot` CLI
|
|
194
|
+
`pbot upgrade` 会将全局 `pbot` CLI 与本机/当前工作区已安装的各宿主插件(通过各宿主官方 CLI 查询)统一升级到 npm 最新稳定版,并保留各宿主原有安装作用域。常用选项:
|
|
195
195
|
|
|
196
196
|
- `--version <x.y.z>`:指定目标版本
|
|
197
197
|
- `--hosts <h1,h2>`:仅升级指定宿主(如 `claude,codex`)
|
|
198
|
-
- `--dsh-profile
|
|
199
|
-
|
|
200
|
-
同一工作区下多个宿主版本不一致时,`pbot status` 会标记 `outOfSync: true`。
|
|
198
|
+
- `--dsh-profile <名称>`:指定 dsh profile(默认 `pbot`)
|
|
201
199
|
|
|
202
200
|
### 单宿主手动升级
|
|
203
201
|
|
|
@@ -232,8 +230,7 @@ pbot upgrade
|
|
|
232
230
|
|
|
233
231
|
卸载操作不会删除你的工作区资料(`AGENTS.md`、`areas/`、`projects/`、`knowledge/`、`providers/`、`scratch/`、`agents/`、`.agents/skills/`)或本地状态。如需彻底清理 Personal Bot 状态文件,可手动删除:
|
|
234
232
|
|
|
235
|
-
- 工作区状态目录:工作区内的 `.pbot/`(含 `config.json`、`mcp.json
|
|
236
|
-
- 用户级缓存与宿主绑定记录:`~/.pbot/`
|
|
233
|
+
- 工作区状态目录:工作区内的 `.pbot/`(含 `config.json`、`mcp.json`、`history/` 与 `subagents/`)
|
|
237
234
|
|
|
238
235
|
## 文档与开发
|
|
239
236
|
|
package/bin/pbot-pi-acp.mjs
CHANGED
|
@@ -21,7 +21,7 @@ if (process.env.PBOT_SUMMARY_WORKER === "1") {
|
|
|
21
21
|
// pi-acp supplies RPC arguments. Add the managed member's native resource options.
|
|
22
22
|
const directory = process.env.PBOT_SUBAGENT_DIR;
|
|
23
23
|
if (!directory) throw new Error("Missing Personal Bot Pi ACP launch context");
|
|
24
|
-
const { options } = JSON.parse(readFileSync(join(directory, "
|
|
24
|
+
const { options = {} } = JSON.parse(readFileSync(join(directory, "worker.json"), "utf8"));
|
|
25
25
|
args = [...process.argv.slice(2), "--extension", fileURLToPath(new URL("../lib/extension/hosts/pi/acp-member.js", import.meta.url))];
|
|
26
26
|
if (options.noExtensions !== false) args.push("--no-extensions", "--extension", "builtin:mcp", "--extension", "builtin:codemode", "--extension", "builtin:tool-search");
|
|
27
27
|
if (options.noSkills) args.push("--no-skills");
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
| `<workspace>/AGENTS.md`、`areas/`、`projects/`、`knowledge/`、`providers/`、`scratch/`、`agents/` | 用户工作区资料(`init` 只补缺、不覆盖) |
|
|
65
65
|
| `<workspace>/.pbot/history/raw/[<YYYY>/<MM>/]<id>.json` | 全宿主(Pi、dsh、Claude Code、Antigravity 等)原始问答与已知分支(默认按 UTC `YYYY/MM/` 分层,可配置 `history.layout: "flat"` 切回平铺;各自只写本宿主来源) |
|
|
66
66
|
| `<workspace>/.pbot/history/summaries/<dimension>/[<YYYY>/<MM>/]<id>.json` | 按维度派生的摘要产物(内置 `session` 与 `monthly` 月度汇总,由 `SummaryRunner` 按 `.write-summary-<dimension>` 锁并发生成,携带来源指纹支持去重与增量更新,可独立重建,损坏不影响原始问答查询) |
|
|
67
|
-
|
|
|
67
|
+
| `<workspace>/.pbot/subagents/<id>/`(或 `PBOT_MCP_AGENT_DIR`) | MCP `worker_*` 的最小运行时控制记录(常驻 `worker.json`、`state.json` 与最新一轮 `output.json`;`inbox/`、`interactions/`、`acp-answer.json` 按需创建、用完即删;会话关闭时清理整个 `<id>/` 目录) |
|
|
68
68
|
|
|
69
69
|
- `atomic-json` 先校验对象再写入临时文件并原子替换,拒绝符号链接、路径越界与特殊文件;短目录锁(`.control` / `.write-<host>`)串行化控制写操作。
|
|
70
70
|
- 兼容线规则:发布版本遵循 `package.json` 的 `MAJOR.MINOR.PATCH`,1.0 前按次版本、之后按主版本判断控制记录兼容性,不引入自动迁移或存储版本计数器。
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
`bin/pbot.mjs` 直接委派给独立打包的 `lib/extension/cli.js`(同时保留 `lib/extension/workspace-cli.js` 兼容入口供既有插件技能调用),由 `src/extension/cli/index.ts` 统一负责参数提取(`--workspace`、`--json`、`--help`)、本地探针(`--version`、`--at-least`)、工作区版本自动更新中间件与声明式命令分发:
|
|
75
75
|
- `pbot init|status` 与 `pbot history status|list|summary|migrate|search|read`:与 Pi/dsh 共用 `src/extension/history/command.ts`。根目录、精确版本和输出契约见[历史与 CLI 指南](../guides/history.md)。
|
|
76
|
-
- `pbot upgrade|update [--workspace <dir>] [--version <ver>] [--hosts <h1,h2>] [--dsh-profile <name>] [--json]`:统一升级全局 CLI
|
|
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
79
|
- `pbot install <host|all> [--workspace <dir>] [--dsh-profile <name>] [--json]`:经 `HostInstallerRegistry` 为指定宿主或本机已安装的各宿主统一安装插件。
|
|
@@ -103,5 +103,5 @@ HostUpgraderRegistry (src/integrations/installation/upgraders/registry.ts)
|
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
- `HostUpgrader` 契约定义在 `src/model/installation.ts`(`host: string` + `upgrade(context): Promise<HostUpgradeResult>`)。
|
|
106
|
-
-
|
|
106
|
+
- 升级编排主链路默认遍历 `HostUpgraderRegistry` 中已注册的全部宿主(或 `--hosts` 指定列表)动态查表调用,由各宿主适配器通过官方 CLI 自查是否安装与当前版本,不读取宿主私有文件,也不感知具体宿主实现;单宿主失败或跳过不阻塞其余宿主。
|
|
107
107
|
- 接入新宿主升级能力只需新增 `src/integrations/installation/upgraders/<host>.ts` 并在 `registry.ts` 注册,无需修改 `upgrade-service.ts` 或 `upgrade.ts`。
|
|
@@ -23,14 +23,14 @@ Personal Bot 将跨 Harness 专家调度统一为单一的 stdio MCP 服务(`l
|
|
|
23
23
|
|
|
24
24
|
MCP 服务在 `initialize` 返回服务级流程说明 `instructions`,`tools/list` 根据已注册预设与当前工作区 `.pbot/config.json` 的 `acp` 配置动态探测本机可用 `backend`,为每个工具提供独立的严格 Schema 与 MCP `annotations`(读写与破坏性标记):
|
|
25
25
|
|
|
26
|
-
| 工具 | 读写属性 | 必填参数 |
|
|
26
|
+
| 工具 | 读写属性 | 必填参数 | 可选参数 | 职责与行为 |
|
|
27
27
|
| --- | --- | --- | --- | --- |
|
|
28
|
-
| `worker_create` | 写 | `backend` | `model`, `thinking`, `
|
|
29
|
-
| `worker_close` | 销毁写 | `workerId` | 无 | 停止并关闭 worker
|
|
28
|
+
| `worker_create` | 写 | `backend` | `model`, `thinking`, `workspace` | 创建并启动新 ACP worker(在 `workspace` 目录执行),等待握手与模型/思考力度配置完成(非法值立即报错),返回 `idle` 态资源与 `capabilities.resume`(不发任务指令) |
|
|
29
|
+
| `worker_close` | 销毁写 | `workerId` | 无 | 停止并关闭 worker,释放进程并清理瞬时记录(目标支持恢复时后续仍可由 `worker_request` 自动恢复;会话关闭时删除目录) |
|
|
30
30
|
| `worker_request` | 主动写 | `workerId`, `message` | `waitMs` | 主动发送首轮任务、多轮追问或回合后问答回复(已关闭自动恢复);默认同步等待 50s 返回报告(`waitMs: 0` 立即异步),遇到挂起交互立即返回 `needsResponse: true` |
|
|
31
31
|
| `worker_response` | 被动回复写 | `workerId`, `action` | `requestId`, `optionId`, `content`, `waitMs` | 回复 worker 执行中途发起的挂起请求(`pendingRequests[]`):`action` 为 `accept` / `decline` / `cancel`;权限审批(`kind: "permission"`)可用 `optionId` 指定策略,问答/选择/表单输入(`kind: "form"`,含 Claude `AskUserQuestion`)用 `content` 提交键值答案,URL 确认(`kind: "url"`)直接用 `action`;默认回复后继续等待 50s |
|
|
32
32
|
| `worker_output` | **只读** | `workerId` | `offset`, `waitMs` | 获取最新一轮执行报告:运行中自动等待至结束(默认 50s,可返回 `timedOut` 或 `needsResponse`),已结束立即返回报告;超长报告(单页 16000 字符)含 `nextOffset` 时传 `offset` 立即翻页 |
|
|
33
|
-
| `worker_discover` | **只读** | 无 | `target`, `workerId`, `backend`, `model` | 统一只读发现:`target` 省略或 `"overview"` 即时返回本机 `backends` 与当前会话 `workers`;`"workers"` 查全部或单个 worker 状态;`"backends"` 查可用目标与权限策略;`"models"` 临时探测目标可选模型与思考力度(省略 `backend` 回退 `PBOT_HOST`) |
|
|
33
|
+
| `worker_discover` | **只读** | 无 | `target`, `workerId`, `backend`, `model`, `workspace` | 统一只读发现:`target` 省略或 `"overview"` 即时返回本机 `backends` 与当前会话 `workers`;`"workers"` 查全部或单个 worker 状态;`"backends"` 查可用目标与权限策略;`"models"` 临时探测目标可选模型与思考力度(省略 `backend` 回退 `PBOT_HOST`) |
|
|
34
34
|
|
|
35
35
|
典型调用示例:
|
|
36
36
|
|
package/docs/guides/history.md
CHANGED
|
@@ -35,9 +35,7 @@ CLI 默认输出缩进 JSON;`--json` 输出单行 JSON 到 stdout,生成进
|
|
|
35
35
|
|
|
36
36
|
### CLI 版本选择
|
|
37
37
|
|
|
38
|
-
显式运行 `init` 或在已启用的工作区执行命令时,CLI 从目标根目录的 npm、Pi
|
|
39
|
-
|
|
40
|
-
宿主按用户、规范化工作区路径和宿主名,将插件绑定保存在 `~/.pbot/workspaces/`。目录只读时宿主仍可运行。CLI 重读可访问的绑定和安装清单,跳过已移除的清单。只提供发布版本的轻插件在下次绑定时刷新记录。宿主也可通过 `PBOT_PLUGIN_VERSION` 传入其确切版本。
|
|
38
|
+
显式运行 `init` 或在已启用的工作区执行命令时,CLI 从目标根目录的 npm、Pi 本地安装清单以及 `PBOT_PLUGIN_VERSION` 环境变量中取最高版本。配置缺失、停用或损坏时,`status` 用当前 CLI 报告配置,`minimumCliVersion` 为 `null`。关闭 `features.history` 后,历史命令直接报告功能已停用。`pbot --version` 显示当前 CLI 的版本,`pbot --at-least <版本>` 在本地比较版本,满足要求时返回 0。
|
|
41
39
|
|
|
42
40
|
满足最低版本时直接运行。版本不足时,npm 管理的全局安装会原位更新到所需版本,再按原参数和工作目录执行。项目依赖、npm link、npx 安装以及另一个进程正在更新或无法加锁的全局前缀,使用 npm 的版本缓存自动安装或复用所需版本,保留项目依赖与锁文件。更新失败时返回非零,原操作停止。已有 0.3.2 及更早的全局启动器需要先安装一次带升级功能的版本,或直接使用新版插件给出的精确版本 npx 命令。
|
|
43
41
|
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
`init` 先补建资料目录(`areas/`、`projects/`、`knowledge/`、`providers/`、`scratch/`、`agents/`)和缺失的根 `AGENTS.md`,再将 `.pbot/config.json` 中的 `enabled` 设为 `true` 并显式写入 `features`(`prompts`、`skills`、`mcp`、`history`,未设置项默认 `true`)与 `summary`(`backend: "pi"`、`concurrency: 3`),保留已有资料、宿主自有文件(如 `CLAUDE.md`)、已设置的开关/摘要配置及其他未知配置字段;配置文件损坏时先报错而不覆写。
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## 统一升级多宿主插件
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
在工作区根目录(或通过 `--workspace <目录>` 指定)执行:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
pbot upgrade [--workspace <目录>] [--version <版本>] [--hosts <h1,h2>] [--dsh-profile <名称>] [--json]
|
|
@@ -25,8 +25,8 @@ pbot upgrade [--workspace <目录>] [--version <版本>] [--hosts <h1,h2>] [--ds
|
|
|
25
25
|
pbot update [--workspace <目录>]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
- 默认将全局 `pbot` CLI
|
|
29
|
-
-
|
|
28
|
+
- 默认将全局 `pbot` CLI 与本机/当前工作区已安装的各宿主插件统一升级到 npm 最新稳定版(本地开发或 `npm link` 安装跳过全局 CLI 覆盖)。
|
|
29
|
+
- 每个宿主升级适配器通过各自宿主的官方 CLI 查询 `personal-bot` 是否已安装及当前版本,未安装该宿主或未安装插件时自动跳过,并保留既有安装作用域(Pi 仅更新工作区 `--local` 的 `personal-bot`、非 npm 自定义来源跳过;Claude 保留原有的 `local`/`project`/`user` 作用域;dsh 默认检查 `pbot` profile 或通过 `--dsh-profile` 指定,不强杀运行中的服务)。
|
|
30
30
|
|
|
31
31
|
## 启用、模块开关(`features`)与停用规则
|
|
32
32
|
|
|
@@ -6,8 +6,8 @@ Personal Bot 以标准原生插件接入 Claude Code,提供工作区资料、
|
|
|
6
6
|
|
|
7
7
|
支持 Linux 和 macOS,需要 Node.js 22.19+ 与 Claude Code 2.1.325+:
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
9
|
+
```sh
|
|
10
|
+
claude plugin install personal-bot --marketplace realqiyan/personal-bot --scope project
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
在目标工作区启动 Claude 后执行原生管理技能:
|
|
@@ -23,7 +23,7 @@ codex plugin add personal-bot@pbot-local
|
|
|
23
23
|
Qoder CLI 支持直接从本地插件目录安装。清单和组件目录格式见 [Qoder 插件参考](https://docs.qoder.com/cli/plugins-reference)。
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
qodercli plugin install "$pbot_lib/qoder-plugin"
|
|
26
|
+
qodercli plugin install "$pbot_lib/qoder-plugin" --scope project
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## 工作区与工具
|
|
@@ -21,7 +21,7 @@ if (process.env.PBOT_SUMMARY_WORKER === "1") {
|
|
|
21
21
|
// pi-acp supplies RPC arguments. Add the managed member's native resource options.
|
|
22
22
|
const directory = process.env.PBOT_SUBAGENT_DIR;
|
|
23
23
|
if (!directory) throw new Error("Missing Personal Bot Pi ACP launch context");
|
|
24
|
-
const { options } = JSON.parse(readFileSync(join(directory, "
|
|
24
|
+
const { options = {} } = JSON.parse(readFileSync(join(directory, "worker.json"), "utf8"));
|
|
25
25
|
args = [...process.argv.slice(2), "--extension", fileURLToPath(new URL("../lib/extension/hosts/pi/acp-member.js", import.meta.url))];
|
|
26
26
|
if (options.noExtensions !== false) args.push("--no-extensions", "--extension", "builtin:mcp", "--extension", "builtin:codemode", "--extension", "builtin:tool-search");
|
|
27
27
|
if (options.noSkills) args.push("--no-skills");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentFiles } from "../../storage/agent-files.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AcpAnswer, AcpInput } from "../../model/acp.js";
|
|
3
3
|
export declare function acpMember(): Promise<{
|
|
4
4
|
files: AgentFiles;
|
|
5
5
|
d: import("../../model/agent.js").AgentDescriptor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname } from "node:path";
|
|
2
2
|
import { realpathSync } from "node:fs";
|
|
3
|
-
import { AgentFiles,
|
|
4
|
-
import {
|
|
3
|
+
import { AgentFiles, status, toDescriptor } from "../../storage/agent-files.js";
|
|
4
|
+
import { acpAnswer } from "../../storage/acp-files.js";
|
|
5
5
|
import { requireThat } from "../../common/validation.js";
|
|
6
6
|
import { packageVersion, releaseLine } from "../../common/version.js";
|
|
7
7
|
import { loadWorkspaceContext } from "../../integrations/agent-resources.js";
|
|
@@ -11,15 +11,15 @@ export async function acpMember() {
|
|
|
11
11
|
requireThat(id && directory && generation, "缺少 ACP 成员启动身份。");
|
|
12
12
|
const files = new AgentFiles(dirname(realpathSync(directory)));
|
|
13
13
|
requireThat(files.directory(id) === realpathSync(directory), "ACP 成员目录不匹配。");
|
|
14
|
-
const d = files.
|
|
14
|
+
const d = toDescriptor(files.worker(id));
|
|
15
15
|
requireThat(d.agentId === id && releaseLine(d.release) === releaseLine(packageVersion), "ACP 成员身份或版本无效。");
|
|
16
16
|
const configuration = await readWorkspaceConfig(d.workspace);
|
|
17
17
|
requireThat(configuration.enabled, workspaceDisabledMessage(configuration));
|
|
18
18
|
const features = workspaceFeatures(configuration);
|
|
19
19
|
const check = () => {
|
|
20
20
|
files.check();
|
|
21
|
-
const
|
|
22
|
-
requireThat(
|
|
21
|
+
const w = files.worker(id);
|
|
22
|
+
requireThat(w.generation === generation && (!w.stop || process.env.PBOT_ACP_VALIDATE === "1"), "ACP 成员已停止或启动代次变化。");
|
|
23
23
|
};
|
|
24
24
|
const context = async () => {
|
|
25
25
|
const reference = files.reference(id);
|
|
@@ -27,16 +27,17 @@ export async function acpMember() {
|
|
|
27
27
|
const loaded = await loadWorkspaceContext({ host, root: d.workspace, role: "general-purpose" });
|
|
28
28
|
return { workspace: loaded.workspace, role: loaded.role, environment: JSON.stringify(loaded.environment) };
|
|
29
29
|
};
|
|
30
|
-
return {
|
|
30
|
+
return {
|
|
31
|
+
files, d, id, generation, configuration, features, check, context,
|
|
31
32
|
input() {
|
|
32
33
|
check();
|
|
33
|
-
const
|
|
34
|
-
requireThat(
|
|
35
|
-
return
|
|
34
|
+
const saved = files.read(id, "state.json", status);
|
|
35
|
+
requireThat(saved.generation === generation && typeof saved.activeRequestId === "string" && saved.activeRequestId.length > 0, "ACP 输入代次无效。");
|
|
36
|
+
return { generation, requestId: saved.activeRequestId };
|
|
36
37
|
},
|
|
37
38
|
answer(input, state, answer, error) {
|
|
38
39
|
// A stop can race the native terminal event. The current generation may still seal its result.
|
|
39
|
-
if (files.
|
|
40
|
+
if (files.worker(id).generation !== generation)
|
|
40
41
|
return;
|
|
41
42
|
files.write(id, "acp-answer.json", { ...input, state, answer, ...(error ? { error } : {}) }, acpAnswer);
|
|
42
43
|
},
|