personal-bot 0.4.0 → 0.4.2
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 +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +4 -1
- package/README.zh-CN.md +4 -1
- package/docs/README.md +2 -3
- package/docs/architecture/design.md +41 -2
- package/docs/architecture/extensibility.md +3 -3
- package/docs/architecture/model-context.md +10 -4
- package/docs/architecture/principles.md +2 -2
- package/docs/guides/cross-harness-workers.md +27 -2
- package/docs/guides/workspace-configuration.md +3 -1
- package/docs/hosts/claude-code.md +1 -1
- package/docs/hosts/codex-qoder.md +3 -1
- package/hooks/hooks.json +3 -0
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +22 -6
- package/lib/antigravity-plugin/lib/extension/cli.js +169 -95
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +3 -1
- package/lib/antigravity-plugin/lib/extension/mcp.js +163 -119
- package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +4 -2
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +23 -5
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.d.ts +2 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.js +12 -13
- package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/antigravity-plugin/lib/model/worker-template.d.ts +21 -0
- package/lib/antigravity-plugin/lib/model/worker-template.js +1 -0
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/antigravity-plugin/lib/services/history/summary-runner.js +3 -3
- package/lib/antigravity-plugin/lib/services/workspace/worker-templates.d.ts +17 -0
- package/lib/antigravity-plugin/lib/services/workspace/worker-templates.js +88 -0
- package/lib/antigravity-plugin/lib/storage/history-files.js +3 -2
- package/lib/antigravity-plugin/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +2 -2
- package/lib/antigravity-plugin/resources/agents/coordinator.md +2 -4
- package/lib/antigravity-plugin/resources/agents/general-purpose.md +2 -4
- package/lib/antigravity-plugin/resources/prompts/history-monthly-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/history-summary.md +6 -11
- package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -1
- package/lib/antigravity-plugin/resources/prompts/workspace.md +16 -23
- package/lib/antigravity-plugin/resources/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +23 -36
- package/lib/antigravity-plugin/resources/templates/workspace-agents.md +5 -13
- package/lib/antigravity-plugin/skills/pbot/SKILL.md +6 -23
- package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +14 -21
- package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +23 -36
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +2 -2
- 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 +11 -3
- package/lib/extension/acp-worker.js +22 -6
- package/lib/extension/cli.js +169 -95
- package/lib/extension/hosts/dsh/command.js +1 -1
- package/lib/extension/hosts/dsh/workspace.js +5 -2
- package/lib/extension/hosts/plugin-runtime.js +3 -1
- package/lib/extension/mcp/tool-contract.d.ts +3 -3
- package/lib/extension/mcp/tool-contract.js +63 -101
- package/lib/extension/mcp/workers.d.ts +1 -1
- package/lib/extension/mcp/workers.js +19 -13
- package/lib/extension/mcp.js +163 -119
- package/lib/integrations/agent-resources.d.ts +4 -2
- package/lib/integrations/agent-resources.js +23 -5
- package/lib/integrations/hosts/antigravity/adapter.js +0 -1
- package/lib/integrations/hosts/claude/adapter.js +1 -2
- package/lib/integrations/hosts/dsh/resources.d.ts +2 -1
- package/lib/integrations/hosts/dsh/resources.js +12 -13
- package/lib/integrations/hosts/prompt-hooks.js +4 -7
- package/lib/model/worker-template.d.ts +21 -0
- package/lib/model/worker-template.js +1 -0
- package/lib/qoder-plugin/.mcp.json +2 -2
- package/lib/qoder-plugin/.qoder-plugin/plugin.json +2 -2
- package/lib/qoder-plugin/hooks/hooks.json +3 -3
- package/lib/qoder-plugin/skills/pbot/SKILL.md +11 -3
- package/lib/services/agents/agent-service.js +2 -2
- package/lib/services/history/summary-dimensions/monthly.js +1 -1
- package/lib/services/history/summary-dimensions/session.js +6 -3
- package/lib/services/history/summary-runner.js +3 -3
- package/lib/services/workspace/worker-templates.d.ts +17 -0
- package/lib/services/workspace/worker-templates.js +88 -0
- package/lib/storage/history-files.js +3 -2
- package/lib/tools/history/contract.d.ts +1 -1
- package/lib/tools/history/contract.js +14 -16
- package/package.json +2 -2
- package/resources/agents/coordinator.md +2 -4
- package/resources/agents/general-purpose.md +2 -4
- package/resources/antigravity/skills/pbot/SKILL.md +6 -23
- package/resources/claude/skills/pbot/SKILL.md +6 -23
- package/resources/plugin/skills/pbot/SKILL.md +11 -3
- package/resources/prompts/history-coordinator.md +1 -1
- package/resources/prompts/history-monthly-summary.md +6 -11
- package/resources/prompts/history-summary.md +6 -11
- package/resources/prompts/plugin-coordinator.md +1 -1
- package/resources/prompts/workspace.md +16 -23
- package/resources/skills/project-maintenance/SKILL.md +14 -21
- package/resources/skills/provider-connections/SKILL.md +23 -36
- package/resources/templates/workspace-agents.md +5 -13
- package/src/extension/cli/commands/mcp.ts +1 -1
- package/src/extension/hosts/dsh/command.ts +1 -1
- package/src/extension/hosts/dsh/workspace.ts +5 -1
- package/src/extension/hosts/pi/command.ts +1 -1
- package/src/extension/hosts/pi/events.ts +3 -1
- package/src/extension/hosts/plugin-runtime.ts +3 -1
- package/src/extension/mcp/tool-contract.ts +63 -103
- package/src/extension/mcp/workers.ts +21 -14
- package/src/integrations/agent-resources.ts +27 -7
- package/src/integrations/hosts/antigravity/adapter.ts +0 -1
- package/src/integrations/hosts/claude/adapter.ts +1 -2
- package/src/integrations/hosts/dsh/resources.ts +14 -13
- package/src/integrations/hosts/prompt-hooks.ts +3 -6
- package/src/model/worker-template.ts +24 -0
- package/src/pbot.ts +2 -2
- package/src/services/agents/agent-service.ts +2 -2
- package/src/services/history/summary-dimensions/monthly.ts +1 -1
- package/src/services/history/summary-dimensions/session.ts +6 -3
- package/src/services/history/summary-runner.ts +3 -3
- package/src/services/workspace/worker-templates.ts +80 -0
- package/src/storage/history-files.ts +3 -2
- package/src/tools/history/contract.ts +14 -16
- package/docs/architecture/model-instruction-guidelines.md +0 -34
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: provider-connections
|
|
3
|
-
description:
|
|
3
|
+
description: 接入或排查 CLI 和 MCP,选择工作区或宿主配置,并更新工具手册。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# CLI 与 MCP 接入
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
沿用工作区现有的工具索引和手册,默认位置为 `providers/AGENTS.md` 和 `providers/<id>/GUIDE.md`。CLI 沿用现有登录和 profile,按已安装版本的子命令 `--help` 核对参数。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 确定 MCP 放在哪里
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
先查工作区和宿主已配置的服务,复用已有接入。一个服务只登记一处。
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- 给当前工作区的多个宿主和受派助手共用,写入 `.pbot/mcp.json`。适合能接受并发连接、通过 stdio 或 Streamable HTTP 提供工具调用的 MCP 服务。
|
|
15
|
+
- 跨项目通用的工具,或依赖宿主浏览器 OAuth、配套插件、MCP resources/prompts、主动通知或独占本地资源的服务,使用宿主原生配置。工具很多、需要频繁直接调用,或用户明确要求绑定宿主时,也用原生入口。
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
范围明确就按该范围配置。两处都适用、用户意图不清时,先问要给当前工作区共用还是绑定宿主。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
- **宿主原生 MCP(全局或项目级)**:满足以下任一条件时走当前宿主原生入口,不写入 `.pbot/mcp.json`:
|
|
20
|
-
1. 跨项目通用的本机全局基础设施或开发工具(如浏览器调试、全局调度);
|
|
21
|
-
2. 依赖宿主浏览器交互式 OAuth 登录;
|
|
22
|
-
3. 依赖宿主配套插件、斜杠命令、原生技能、MCP resources/prompts 或服务端主动事件推送;
|
|
23
|
-
4. 工具极多且高频交互,或独占本机端口/浏览器目录、不宜自动透传给 ACP worker;
|
|
24
|
-
5. 用户明确要求绑定到当前宿主原生配置。
|
|
19
|
+
## 工作区共享 MCP
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
将 `<workspaceRoot>` 换成工作区根目录。`pbot mcp add` 新建或替换同名服务,`pbot` 是保留服务名。配置用环境变量引用凭据。给命令参数加单引号,保留字面量 `${TOKEN}` 供连接时读取。
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
```sh
|
|
24
|
+
pbot mcp list --workspace "<workspaceRoot>"
|
|
25
|
+
pbot mcp add <name> --workspace "<workspaceRoot>" --env 'KEY=${TOKEN}' --cwd . -- <command> [args...]
|
|
26
|
+
pbot mcp add <name> --workspace "<workspaceRoot>" --url <url> --header 'Authorization=Bearer ${TOKEN}'
|
|
27
|
+
pbot mcp remove <name> --workspace "<workspaceRoot>"
|
|
28
|
+
```
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
- **新增 / 更新 stdio**:`pbot mcp add <name> --workspace "<workspaceRoot>" [--env 'K=${VAR}'] [--cwd .] [--description "..."] -- <command> [args...]`
|
|
32
|
-
- **新增 / 更新 HTTP**:`pbot mcp add <name> --workspace "<workspaceRoot>" --url https://... [--header 'Authorization=Bearer ${TOKEN}'] [--description "..."]`
|
|
33
|
-
- **删除**:`pbot mcp remove <name> --workspace "<workspaceRoot>"`
|
|
34
|
-
|
|
35
|
-
生效方式(原生挂载与桥接二选一,不重复暴露):
|
|
36
|
-
- Pi 执行 `/reload`、dsh 重启会话后由宿主直接原生挂载(不暴露 `workspace_mcp_*`);
|
|
37
|
-
- 通过 `workspace_mcp_discover` / `workspace_mcp_call` 桥接的宿主即改即生效,无需重启;
|
|
38
|
-
- ACP worker 在下次新建或恢复会话时自动加载最新 `.pbot/mcp.json`。
|
|
30
|
+
终端没有 `pbot` 时,用 `node "<resourceRoot>/../lib/extension/cli.js"` 运行相同子命令。修改后,Pi 执行 `/reload`,dsh 打开新会话,再直接调用服务的工具。提供 `workspace_mcp_discover` 的宿主可立即查询该服务,并用 `workspace_mcp_call` 调用。受派助手在新建或恢复会话时加载服务,HTTP 接入需要该助手支持。
|
|
39
31
|
|
|
40
32
|
## 宿主原生 MCP
|
|
41
33
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
## 验证与手册
|
|
49
|
-
|
|
50
|
-
用一个简单的只读查询验证所需能力(例如 `workspace_mcp_discover(server)` + 只读 `workspace_mcp_call` 或原生工具调用),失败时按实际错误排障。
|
|
34
|
+
- Pi 用 `pi mcp add <name> --local ...` 配置当前项目,全局配置省略 `--local`。用 `/reload` 重新加载,用 `/mcp` 查看状态。
|
|
35
|
+
- dsh 使用原生界面或 profile 配置,先确认该 profile 的使用范围。
|
|
36
|
+
- Claude Code 的项目级 HTTP 服务用 `claude mcp add --scope project --transport http <name> <url>`,在会话的 `/mcp` 中核对认证。
|
|
37
|
+
- Antigravity 的全局服务用 `agy mcp add <name> <commandOrUrl> [args...]` 注册,用 `agy mcp list` 查看,删除用 `agy mcp remove <name>`。
|
|
38
|
+
- 其他宿主使用其原生 MCP 命令或配置入口。
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
- `providers/AGENTS.md`:只做能力导航和选用约定。
|
|
40
|
+
用一个能覆盖本次需求的只读查询验证接入。在工具索引中登记能力和适用场景,在手册中更新接入位置、适用版本,以及原生帮助未说明的数据口径和限制。
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 工作区导航
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 项目速查
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
./
|
|
7
|
-
├── areas/ # 长期目标、约束、建议、决策与复盘
|
|
8
|
-
├── projects/ # 任务定义、结论、交付物与源码
|
|
9
|
-
├── knowledge/ # 可复用的概念、方法与口径
|
|
10
|
-
├── providers/ # 能力提供方导航与手册
|
|
11
|
-
├── scratch/ # 临时脚本、查询与计算数据、下载及运行环境
|
|
12
|
-
└── agents/ # coordinator.md 与 general-purpose.md 的职责补充
|
|
13
|
-
```
|
|
5
|
+
用项目目录名和常用称呼登记项目。默认入口为 `projects/<目录名>/README.md`,其他项目链接到实际入口。
|
|
14
6
|
|
|
15
|
-
##
|
|
7
|
+
## 资料目录
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
[项目](projects/) · [长期事务](areas/) · [可复用知识](knowledge/) · [工具手册](providers/) · [临时文件](scratch/) · [角色补充](agents/)
|
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pbot
|
|
3
|
-
description:
|
|
3
|
+
description: 初始化或检查 Personal Bot 工作区,检索、汇总或迁移历史归档。
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
用 `run_command` 从当前 Antigravity 工作区根目录执行用户选择的命令。将本技能路径末尾的 `/skills/pbot/SKILL.md` 去掉,即得 `<plugin-root>`。无参数时执行 `status`。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
node "<plugin-root>/lib/plugin.js" antigravity init
|
|
15
|
-
node "<plugin-root>/lib/plugin.js" antigravity status
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
`init` 补建资料目录与根 `AGENTS.md` 并启用工作区,`status` 查看工作区及配置状态;省略参数时执行 `status`。
|
|
19
|
-
|
|
20
|
-
## 历史管理与检索
|
|
21
|
-
|
|
22
|
-
`--workspace` 传入当前会话的 `workspaceRoot`(工作区未启用时使用当前工作区根目录)。支持 `history status|list|summary|migrate|search|read`,保留用户指定参数(迁移预览加 `--dry-run`):
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
pbot history summary --workspace "<workspaceRoot>"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
未安装全局 `pbot` 或版本不匹配时,直接运行随插件打包的 CLI:
|
|
9
|
+
- 查看状态用 `node "<plugin-root>/lib/plugin.js" antigravity status`。
|
|
10
|
+
- 初始化用同一命令将 `status` 换成 `init`。它会启用工作区,补建缺失的资料目录和根 `AGENTS.md`。
|
|
11
|
+
- 历史操作使用随插件提供的 CLI,保留用户指定的参数。`summary` 更新各维度,`summary monthly` 汇总已有会话摘要。迁移预览用 `migrate --dry-run`,其他用法见 `history --help`。
|
|
29
12
|
|
|
30
13
|
```sh
|
|
31
14
|
node "<plugin-root>/lib/extension/cli.js" history summary --workspace "<workspaceRoot>"
|
|
32
15
|
```
|
|
33
16
|
|
|
34
|
-
|
|
17
|
+
`<workspaceRoot>` 取当前会话的工作区根目录。
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: project-maintenance
|
|
3
|
-
description:
|
|
3
|
+
description: 续做周期任务、更新项目结论或归档交付物时,维护正文、任务定义和项目导航。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 项目资料维护
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
从根 `AGENTS.md` 的项目速查找到实际入口,沿用项目已有布局。更新本次涉及的资料和引用,全盘整理按用户指定的范围进行。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 续做或复现任务
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- **用户偏好与约定**:按用户实际表达记录,不把推测写成既定约定。
|
|
14
|
-
- **可复用知识**(`knowledge/<主题>/`):提炼可跨任务复用的概念、方法与口径,注明适用条件并引用来源。需要留史的研究和决策按日期与主题命名。
|
|
15
|
-
- **排查过程与测试流水**:不逐次追加到正文,必要实现细节写入对应技术资料。
|
|
12
|
+
在所属项目或 `areas/<领域>/` 查原任务定义。需要重复执行的任务,记下目标、输入、执行入口和预期交付物。周期报告还应保留影响复算的口径,如来源和查询方式、筛选范围、期间与时区、单位、指标公式与分母、分组与比较基准。每期报告引用这份定义。
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
- 查上次结论,引用当期正文或交付物。
|
|
15
|
+
- 按原口径更新,核对原定义,用本期数据计算。口径变动时写明对比较结果的影响。
|
|
16
|
+
- 复现历史结果,使用当时的输入和版本。
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
## 更新正文与导航
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
直接修订项目正文(默认 `projects/<目录名>/README.md`)或长期事务正文。合并同主题内容,写清当前结论、适用条件和未决问题。决定有变化时,注明原因、日期并引用原始资料。来源有冲突且无法判定时,标明分歧。用户偏好按用户实际表达记录。
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
可跨任务复用的方法归入 `knowledge/<主题>/`,注明适用条件与来源。需要留史的资料按日期和主题命名。排查记录与实现细节按需放在技术资料中。
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
在根 `AGENTS.md` 用目录名和常用称呼登记项目。默认入口写目录名即可,其他入口链接到实际文件。
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
- 按原口径更新:核对原定义的来源与前提,使用本期数据;口径变化时说明对可比性的影响。
|
|
29
|
-
- 复现历史结果:使用当时的输入和版本。
|
|
26
|
+
## 归档与结项
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
整理或结项时,检查本次涉及的项目目录和 `scratch/`:将结论与方法并入正文,将交付物和可复用源码归入项目目录,同步来源引用与执行入口。
|
|
34
|
-
|
|
35
|
-
归集完成后,只清理本次范围内已被吸收或不再需要的临时文件,不删除正式资料、历史记录或备份。结项时按目标核对交付物和执行入口,在项目正文记录交付结果、剩余工作和复用条件。
|
|
28
|
+
把本次交付物和可复用源码归入项目,补齐来源引用和执行入口。核对交付结果,记录余项和复用条件。只清理本次 `scratch/` 等临时目录中已归集或用完的文件,保留正式资料、历史记录和备份。
|
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: provider-connections
|
|
3
|
-
description:
|
|
3
|
+
description: 接入或排查 CLI 和 MCP,选择工作区或宿主配置,并更新工具手册。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# CLI 与 MCP 接入
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
沿用工作区现有的工具索引和手册,默认位置为 `providers/AGENTS.md` 和 `providers/<id>/GUIDE.md`。CLI 沿用现有登录和 profile,按已安装版本的子命令 `--help` 核对参数。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 确定 MCP 放在哪里
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
先查工作区和宿主已配置的服务,复用已有接入。一个服务只登记一处。
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- 给当前工作区的多个宿主和受派助手共用,写入 `.pbot/mcp.json`。适合能接受并发连接、通过 stdio 或 Streamable HTTP 提供工具调用的 MCP 服务。
|
|
15
|
+
- 跨项目通用的工具,或依赖宿主浏览器 OAuth、配套插件、MCP resources/prompts、主动通知或独占本地资源的服务,使用宿主原生配置。工具很多、需要频繁直接调用,或用户明确要求绑定宿主时,也用原生入口。
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
范围明确就按该范围配置。两处都适用、用户意图不清时,先问要给当前工作区共用还是绑定宿主。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
- **宿主原生 MCP(全局或项目级)**:满足以下任一条件时走当前宿主原生入口,不写入 `.pbot/mcp.json`:
|
|
20
|
-
1. 跨项目通用的本机全局基础设施或开发工具(如浏览器调试、全局调度);
|
|
21
|
-
2. 依赖宿主浏览器交互式 OAuth 登录;
|
|
22
|
-
3. 依赖宿主配套插件、斜杠命令、原生技能、MCP resources/prompts 或服务端主动事件推送;
|
|
23
|
-
4. 工具极多且高频交互,或独占本机端口/浏览器目录、不宜自动透传给 ACP worker;
|
|
24
|
-
5. 用户明确要求绑定到当前宿主原生配置。
|
|
19
|
+
## 工作区共享 MCP
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
将 `<workspaceRoot>` 换成工作区根目录。`pbot mcp add` 新建或替换同名服务,`pbot` 是保留服务名。配置用环境变量引用凭据。给命令参数加单引号,保留字面量 `${TOKEN}` 供连接时读取。
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
```sh
|
|
24
|
+
pbot mcp list --workspace "<workspaceRoot>"
|
|
25
|
+
pbot mcp add <name> --workspace "<workspaceRoot>" --env 'KEY=${TOKEN}' --cwd . -- <command> [args...]
|
|
26
|
+
pbot mcp add <name> --workspace "<workspaceRoot>" --url <url> --header 'Authorization=Bearer ${TOKEN}'
|
|
27
|
+
pbot mcp remove <name> --workspace "<workspaceRoot>"
|
|
28
|
+
```
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
- **新增 / 更新 stdio**:`pbot mcp add <name> --workspace "<workspaceRoot>" [--env 'K=${VAR}'] [--cwd .] [--description "..."] -- <command> [args...]`
|
|
32
|
-
- **新增 / 更新 HTTP**:`pbot mcp add <name> --workspace "<workspaceRoot>" --url https://... [--header 'Authorization=Bearer ${TOKEN}'] [--description "..."]`
|
|
33
|
-
- **删除**:`pbot mcp remove <name> --workspace "<workspaceRoot>"`
|
|
34
|
-
|
|
35
|
-
生效方式(原生挂载与桥接二选一,不重复暴露):
|
|
36
|
-
- Pi 执行 `/reload`、dsh 重启会话后由宿主直接原生挂载(不暴露 `workspace_mcp_*`);
|
|
37
|
-
- 通过 `workspace_mcp_discover` / `workspace_mcp_call` 桥接的宿主即改即生效,无需重启;
|
|
38
|
-
- ACP worker 在下次新建或恢复会话时自动加载最新 `.pbot/mcp.json`。
|
|
30
|
+
终端没有 `pbot` 时,用 `node "<resourceRoot>/../lib/extension/cli.js"` 运行相同子命令。修改后,Pi 执行 `/reload`,dsh 打开新会话,再直接调用服务的工具。提供 `workspace_mcp_discover` 的宿主可立即查询该服务,并用 `workspace_mcp_call` 调用。受派助手在新建或恢复会话时加载服务,HTTP 接入需要该助手支持。
|
|
39
31
|
|
|
40
32
|
## 宿主原生 MCP
|
|
41
33
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
## 验证与手册
|
|
49
|
-
|
|
50
|
-
用一个简单的只读查询验证所需能力(例如 `workspace_mcp_discover(server)` + 只读 `workspace_mcp_call` 或原生工具调用),失败时按实际错误排障。
|
|
34
|
+
- Pi 用 `pi mcp add <name> --local ...` 配置当前项目,全局配置省略 `--local`。用 `/reload` 重新加载,用 `/mcp` 查看状态。
|
|
35
|
+
- dsh 使用原生界面或 profile 配置,先确认该 profile 的使用范围。
|
|
36
|
+
- Claude Code 的项目级 HTTP 服务用 `claude mcp add --scope project --transport http <name> <url>`,在会话的 `/mcp` 中核对认证。
|
|
37
|
+
- Antigravity 的全局服务用 `agy mcp add <name> <commandOrUrl> [args...]` 注册,用 `agy mcp list` 查看,删除用 `agy mcp remove <name>`。
|
|
38
|
+
- 其他宿主使用其原生 MCP 命令或配置入口。
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
- `providers/AGENTS.md`:只做能力导航和选用约定。
|
|
40
|
+
用一个能覆盖本次需求的只读查询验证接入。在工具索引中登记能力和适用场景,在手册中更新接入位置、适用版本,以及原生帮助未说明的数据口径和限制。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "personal-bot",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "Organize workspace files, search past conversations, use shared MCP tools, and delegate tasks to other assistants.",
|
|
5
5
|
"skills": "./skills/",
|
|
6
6
|
"mcpServers": "./.mcp.json"
|
|
7
7
|
}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"command": "sh",
|
|
5
5
|
"args": [
|
|
6
6
|
"-c",
|
|
7
|
-
"if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.4.
|
|
7
|
+
"if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.4.2 \"$@\"",
|
|
8
8
|
"pbot",
|
|
9
9
|
"mcp"
|
|
10
10
|
],
|
|
11
11
|
"env": {
|
|
12
12
|
"PBOT_HOST": "codex",
|
|
13
|
-
"PBOT_PLUGIN_VERSION": "0.4.
|
|
13
|
+
"PBOT_PLUGIN_VERSION": "0.4.2"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"hooks": [
|
|
6
6
|
{
|
|
7
7
|
"type": "command",
|
|
8
|
-
"command": "PBOT_PLUGIN_VERSION=0.4.
|
|
8
|
+
"command": "PBOT_PLUGIN_VERSION=0.4.2 sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.4.2 \"$@\"' pbot plugin codex hook",
|
|
9
9
|
"timeout": 120
|
|
10
10
|
}
|
|
11
11
|
]
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"hooks": [
|
|
17
17
|
{
|
|
18
18
|
"type": "command",
|
|
19
|
-
"command": "PBOT_PLUGIN_VERSION=0.4.
|
|
19
|
+
"command": "PBOT_PLUGIN_VERSION=0.4.2 sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.4.2 \"$@\"' pbot plugin codex hook",
|
|
20
20
|
"timeout": 120
|
|
21
21
|
}
|
|
22
22
|
]
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"hooks": [
|
|
28
28
|
{
|
|
29
29
|
"type": "command",
|
|
30
|
-
"command": "PBOT_PLUGIN_VERSION=0.4.
|
|
30
|
+
"command": "PBOT_PLUGIN_VERSION=0.4.2 sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.4.2 \"$@\"' pbot plugin codex hook",
|
|
31
31
|
"timeout": 120
|
|
32
32
|
}
|
|
33
33
|
]
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pbot
|
|
3
|
-
description:
|
|
3
|
+
description: 初始化或检查 Personal Bot 工作区,检索、汇总或迁移历史归档。
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
用当前会话的工作区根目录替换 `<workspaceRoot>`。无参数时执行 `status`。用户要求初始化时执行 `init`,启用工作区并补建缺失的资料目录和根 `AGENTS.md`。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
会话给出 `resourceRoot` 时,用随包 CLI 执行所选命令。查看状态可运行
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
node "<resourceRoot>/../lib/extension/cli.js" status --workspace "<workspaceRoot>"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
没有该路径时,若 `pbot --at-least 0.4.2` 成功,用 `pbot` 替换上例的 `node ".../cli.js"`,否则用 `npx --yes --ignore-scripts personal-bot@0.4.2`。
|
|
16
|
+
|
|
17
|
+
历史操作将 `status` 替换为 `history` 和用户指定的子命令、参数。`history summary` 更新各维度,`history summary monthly` 汇总已有会话摘要。迁移预览用 `history migrate --dry-run`,其他用法见 `history --help`。
|
|
@@ -11158,7 +11158,7 @@ async function readLocalRole(agent, root) {
|
|
|
11158
11158
|
async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md") {
|
|
11159
11159
|
requireThat(agent === "coordinator" || agent === "general-purpose", "\u672A\u77E5\u804C\u8D23\u3002");
|
|
11160
11160
|
let text3 = await readFile(join7(resourceRoot, "agents", agent + ".md"), "utf8");
|
|
11161
|
-
if (agent === "coordinator") {
|
|
11161
|
+
if (agent === "coordinator" && coordinatorPrompt) {
|
|
11162
11162
|
text3 += "\n\n" + await readFile(join7(resourceRoot, "prompts", coordinatorPrompt), "utf8");
|
|
11163
11163
|
}
|
|
11164
11164
|
const local = await readLocalRole(agent, root);
|
|
@@ -11169,7 +11169,21 @@ async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md
|
|
|
11169
11169
|
function formatWorkspaceSkills(skills) {
|
|
11170
11170
|
if (!skills.length) return "";
|
|
11171
11171
|
const lines = skills.map((skill) => `- **${skill.name}**\uFF08\`${skill.path}\`\uFF09\uFF1A${skill.description}`);
|
|
11172
|
-
return "## \
|
|
11172
|
+
return "## \u6309\u9700\u8BFB\u53D6\u7684\u6280\u80FD\n\n" + lines.join("\n");
|
|
11173
|
+
}
|
|
11174
|
+
function formatWorkerTemplates(templates) {
|
|
11175
|
+
if (!templates.length) return "";
|
|
11176
|
+
const lines = templates.map(({ id, name, description, create }) => {
|
|
11177
|
+
const label = name === id ? id : `${name}\uFF08${id}\uFF09`;
|
|
11178
|
+
const settings = [
|
|
11179
|
+
["\u52A9\u624B", create.backend],
|
|
11180
|
+
["\u6267\u884C\u5DE5\u4F5C\u533A", create.workspace],
|
|
11181
|
+
["\u6A21\u578B", create.model],
|
|
11182
|
+
["\u601D\u8003\u6DF1\u5EA6", create.thinking]
|
|
11183
|
+
].filter(([, value]) => value !== void 0).map(([field, value]) => `${field} ${JSON.stringify(value)}`).join("\uFF0C");
|
|
11184
|
+
return `- ${label}\u3000${description}\uFF08${settings}\uFF09`;
|
|
11185
|
+
});
|
|
11186
|
+
return "## \u5DE5\u4F5C\u533A\u52A9\u624B\u6A21\u677F\n\n\u9009\u7528\u6A21\u677F\u65F6\uFF0C\u7528 worker_discover \u67E5\u8BE2\u6700\u65B0\u8BBE\u7F6E\uFF08target=templates\uFF09\u3002\n\n" + lines.join("\n");
|
|
11173
11187
|
}
|
|
11174
11188
|
async function loadWorkspaceContext(options) {
|
|
11175
11189
|
const {
|
|
@@ -11183,13 +11197,15 @@ async function loadWorkspaceContext(options) {
|
|
|
11183
11197
|
workspaceSkills = [],
|
|
11184
11198
|
notices = []
|
|
11185
11199
|
} = options;
|
|
11186
|
-
const [workspace,
|
|
11200
|
+
const [workspace, baseRole, rootAgents, catalog] = includePrompts ? await Promise.all([
|
|
11187
11201
|
readFile(join7(resourceRoot, "prompts/workspace.md"), "utf8"),
|
|
11188
11202
|
localRoleOnly ? readLocalRole(role, root) : agentText(role, root, coordinatorPrompt),
|
|
11189
|
-
includeRootAgents ? readOptionalFile(join7(root, "AGENTS.md")) : Promise.resolve("")
|
|
11190
|
-
|
|
11203
|
+
includeRootAgents ? readOptionalFile(join7(root, "AGENTS.md")) : Promise.resolve(""),
|
|
11204
|
+
role === "coordinator" ? options.readWorkerTemplates?.(root) : void 0
|
|
11205
|
+
]) : ["", "", "", void 0];
|
|
11206
|
+
const roleText = [baseRole, formatWorkerTemplates(catalog?.templates ?? [])].filter(Boolean).join("\n\n");
|
|
11191
11207
|
const skillsSection = formatWorkspaceSkills(workspaceSkills);
|
|
11192
|
-
const noticesSection = notices.length ? "## \
|
|
11208
|
+
const noticesSection = notices.length ? "## \u7EF4\u62A4\u63D0\u9192\n\n\u544A\u77E5\u7528\u6237\uFF0C\u6309\u7528\u6237\u8981\u6C42\u6267\u884C\u3002\n\n" + notices.map((item) => `- ${item}`).join("\n") : "";
|
|
11193
11209
|
const environment = { host, workspaceRoot: root, resourceRoot };
|
|
11194
11210
|
const text3 = [
|
|
11195
11211
|
workspace,
|