personal-bot 0.3.5 → 0.3.7

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 (86) 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 +2 -2
  6. package/docs/architecture/design.md +3 -4
  7. package/docs/architecture/model-context.md +1 -2
  8. package/docs/guides/capabilities.md +4 -8
  9. package/docs/hosts/antigravity.md +4 -2
  10. package/docs/hosts/pi.md +4 -15
  11. package/docs/maintainers/release.md +2 -2
  12. package/lib/antigravity-plugin/lib/extension/acp-worker.js +2 -2
  13. package/lib/antigravity-plugin/lib/extension/cli.js +1403 -1504
  14. package/lib/antigravity-plugin/lib/extension/mcp.js +66 -49
  15. package/lib/antigravity-plugin/lib/integrations/agent-resources.js +2 -2
  16. package/lib/antigravity-plugin/package.json +1 -1
  17. package/lib/antigravity-plugin/plugin.json +1 -1
  18. package/lib/antigravity-plugin/resources/agents/coordinator.md +3 -7
  19. package/lib/antigravity-plugin/resources/agents/general-purpose.md +3 -3
  20. package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -2
  21. package/lib/antigravity-plugin/resources/prompts/workspace.md +12 -16
  22. package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +7 -6
  23. package/lib/antigravity-plugin/resources/templates/workspace-agents.md +0 -4
  24. package/lib/antigravity-plugin/skills/pbot/SKILL.md +14 -6
  25. package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +7 -6
  26. package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
  27. package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
  28. package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
  29. package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +2 -2
  30. package/lib/extension/acp-worker.js +2 -2
  31. package/lib/extension/cli.js +1403 -1504
  32. package/lib/extension/mcp/tool-contract.js +49 -55
  33. package/lib/extension/mcp/workers.d.ts +6 -0
  34. package/lib/extension/mcp/workers.js +25 -8
  35. package/lib/extension/mcp.js +66 -49
  36. package/lib/integrations/agent-resources.js +2 -2
  37. package/lib/qoder-plugin/.mcp.json +2 -2
  38. package/lib/qoder-plugin/.qoder-plugin/plugin.json +1 -1
  39. package/lib/qoder-plugin/hooks/hooks.json +3 -3
  40. package/lib/qoder-plugin/skills/pbot/SKILL.md +2 -2
  41. package/lib/tools/history/contract.js +12 -12
  42. package/package.json +1 -1
  43. package/resources/agents/coordinator.md +3 -7
  44. package/resources/agents/general-purpose.md +3 -3
  45. package/resources/antigravity/skills/pbot/SKILL.md +14 -6
  46. package/resources/claude/skills/pbot/SKILL.md +14 -6
  47. package/resources/plugin/skills/pbot/SKILL.md +2 -2
  48. package/resources/prompts/history-coordinator.md +1 -2
  49. package/resources/prompts/plugin-coordinator.md +1 -2
  50. package/resources/prompts/workspace.md +12 -16
  51. package/resources/skills/provider-connections/SKILL.md +7 -6
  52. package/resources/templates/workspace-agents.md +0 -4
  53. package/src/extension/cli/commands/install.ts +77 -0
  54. package/src/extension/cli/index.ts +3 -4
  55. package/src/extension/mcp/tool-contract.ts +49 -55
  56. package/src/extension/mcp/workers.ts +32 -10
  57. package/src/integrations/agent-resources.ts +2 -2
  58. package/src/integrations/installation/installers/antigravity.ts +49 -0
  59. package/src/integrations/installation/installers/claude.ts +30 -0
  60. package/src/integrations/installation/installers/codex.ts +56 -0
  61. package/src/integrations/installation/installers/dsh.ts +25 -0
  62. package/src/integrations/installation/installers/pi.ts +26 -0
  63. package/src/integrations/installation/installers/qoder.ts +49 -0
  64. package/src/integrations/installation/installers/registry.ts +48 -0
  65. package/src/integrations/installation/processes.ts +2 -41
  66. package/src/model/installation.ts +28 -36
  67. package/src/pbot.ts +1 -1
  68. package/src/services/installation/install-service.ts +107 -0
  69. package/src/tools/history/contract.ts +12 -12
  70. package/lib/antigravity-plugin/resources/references/compute-finance.md +0 -22
  71. package/lib/antigravity-plugin/resources/references/compute.md +0 -16
  72. package/lib/antigravity-plugin/resources/references/task-conductor.md +0 -25
  73. package/lib/common/package-source.js +0 -16
  74. package/lib/extension/setup/guard.js +0 -11
  75. package/lib/integrations/installation/pi-bridge.js +0 -131
  76. package/lib/model/installation.js +0 -1
  77. package/resources/installer/plugins.json +0 -16
  78. package/resources/references/compute-finance.md +0 -22
  79. package/resources/references/compute.md +0 -16
  80. package/resources/references/task-conductor.md +0 -25
  81. package/src/extension/cli/commands/setup.ts +0 -159
  82. package/src/extension/setup/guard.ts +0 -12
  83. package/src/integrations/installation/pi-bridge.ts +0 -109
  84. package/src/integrations/installation/pi-setup.ts +0 -165
  85. package/src/services/installation/setup-service.ts +0 -91
  86. package/src/ui/setup.ts +0 -40
@@ -6,21 +6,29 @@ disable-model-invocation: true
6
6
 
7
7
  # Personal Bot 工作区
8
8
 
9
- 从当前 Antigravity 工作区根目录,通过 `run_command` 执行对应命令。`<plugin-root>` 为本 `SKILL.md` 路径向上两级目录(即去掉尾部 `/skills/pbot/SKILL.md` 后的目录)。
9
+ 从当前 Antigravity 工作区根目录,通过 `run_command` 执行对应命令。`<plugin-root>` 为本 `SKILL.md` 路径向上两级目录(去掉尾部 `/skills/pbot/SKILL.md`)。
10
+
11
+ ## 初始化与状态
10
12
 
11
13
  ```sh
12
14
  node "<plugin-root>/lib/plugin.js" antigravity init
13
15
  node "<plugin-root>/lib/plugin.js" antigravity status
14
16
  ```
15
17
 
16
- 根据用户参数选择一条:`init` 补建资料目录与根 `AGENTS.md` 并启用工作区,`status` 只查看工作区及当前配置状态。省略参数时查看状态。返回命令的实际结果和需要处理的错误。
18
+ `init` 补建资料目录与根 `AGENTS.md` 并启用工作区,`status` 查看工作区及配置状态;省略参数时执行 `status`。
19
+
20
+ ## 历史管理与检索
21
+
22
+ `--workspace` 传入当前会话的 `workspaceRoot`(工作区未启用时使用当前工作区根目录)。支持 `history status|list|summary|migrate|search|read`,保留用户指定参数(迁移预览加 `--dry-run`):
17
23
 
18
- 用户要求整理历史时,在当前工作区执行 `pbot history summary --workspace "<workspaceRoot>"`。检查待处理数量用 `history status`,列维度用 `history list`,搜索与读取用 `history search`、`history read`,迁移预览用 `history migrate --dry-run`。保留用户指定的参数。
24
+ ```sh
25
+ pbot history summary --workspace "<workspaceRoot>"
26
+ ```
19
27
 
20
- 首次使用或全局 CLI 缺少该子命令时,可直接运行随插件安装的 CLI:
28
+ 未安装全局 `pbot` 或版本不匹配时,直接运行随插件打包的 CLI:
21
29
 
22
30
  ```sh
23
- node "<plugin-root>/lib/extension/workspace-cli.js" history summary --workspace "<workspaceRoot>"
31
+ node "<plugin-root>/lib/extension/cli.js" history summary --workspace "<workspaceRoot>"
24
32
  ```
25
33
 
26
- 也可读取 `<plugin-root>/package.json` 的 `version`,运行 `npx --yes personal-bot@<version> history summary --workspace "<workspaceRoot>"`。
34
+ 返回命令的实际结果和需要处理的错误。
@@ -15,7 +15,7 @@ description: 接入或修复工作区共享 MCP 与原生 CLI/MCP,核对认证
15
15
 
16
16
  接入新 MCP 前先判断归属;边界不明确或用户未说明作用域时,写入前先向用户确认放工作区共享还是当前宿主原生:
17
17
 
18
- - **工作区共享 MCP(`.pbot/mcp.json`)**:归属当前工作区业务、需要跨宿主(Pi、dsh、Claude Code、Antigravity、Codex 及 ACP worker)共用,使用 stdio 或 Streamable HTTP + 环境变量/本地凭据,纯 `tools/list` + `tools/call` 请求-响应且可并发连接的服务。
18
+ - **工作区共享 MCP(`.pbot/mcp.json`)**:归属当前工作区业务、需要跨宿主(Pi、dsh、Claude Code、Antigravity、Codex、Qoder CLI 及 ACP worker)共用,使用 stdio 或 Streamable HTTP + 环境变量/本地凭据,纯 `tools/list` + `tools/call` 请求-响应且可并发连接的服务。
19
19
  - **宿主原生 MCP(全局或项目级)**:满足以下任一条件时走当前宿主原生入口,不写入 `.pbot/mcp.json`:
20
20
  1. 跨项目通用的本机全局基础设施或开发工具(如浏览器调试、全局调度);
21
21
  2. 依赖宿主浏览器交互式 OAuth 登录;
@@ -27,14 +27,14 @@ description: 接入或修复工作区共享 MCP 与原生 CLI/MCP,核对认证
27
27
 
28
28
  不保存明文凭据,使用 `${ENV_VAR}` 引用,保留无关项,不能使用保留名 `pbot`:
29
29
 
30
- - **查看**:`pbot mcp list --workspace <workspaceRoot>` 或(轻插件宿主)调用 `workspace_mcp_discover`
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>`
30
+ - **查看**:`pbot mcp list --workspace "<workspaceRoot>"`(若当前环境提供 `workspace_mcp_discover` 也可直接查询)
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
34
 
35
35
  生效方式(原生挂载与桥接二选一,不重复暴露):
36
36
  - Pi 执行 `/reload`、dsh 重启会话后由宿主直接原生挂载(不暴露 `workspace_mcp_*`);
37
- - 轻插件宿主与任意 MCP 宿主通过 `workspace_mcp_discover` / `workspace_mcp_call` 桥接,即改即生效,无需重启;
37
+ - 通过 `workspace_mcp_discover` / `workspace_mcp_call` 桥接的宿主即改即生效,无需重启;
38
38
  - ACP worker 在下次新建或恢复会话时自动加载最新 `.pbot/mcp.json`。
39
39
 
40
40
  ## 宿主原生 MCP
@@ -43,6 +43,7 @@ description: 接入或修复工作区共享 MCP 与原生 CLI/MCP,核对认证
43
43
  - **`host = dsh`**:通过原生界面或 profile 配置管理(注意同一 profile 可能被多工作区共用)。
44
44
  - **`host = claude`**:`claude mcp add --scope project --transport http <server> <url>`(写入 `.mcp.json`),改完后请用户在会话中用 `/mcp` 核对认证与工具。
45
45
  - **`host = antigravity`**:全局使用 `agy mcp add <name> <commandOrUrl> [args...]` / `agy mcp remove <name>`(管理 `~/.gemini/config/mcp_config.json`),通过 `agy mcp list` 或 UI 面板核对。
46
+ - **其他宿主(如 `codex`、`qoder`)**:使用该宿主自身的原生 MCP 命令或配置入口管理。
46
47
 
47
48
  ## 验证与手册
48
49
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "personal-bot",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Personal Bot workspace context and cross-harness workers.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./.mcp.json"
@@ -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.3.5 \"$@\"",
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.3.7 \"$@\"",
8
8
  "pbot",
9
9
  "mcp"
10
10
  ],
11
11
  "env": {
12
12
  "PBOT_HOST": "codex",
13
- "PBOT_PLUGIN_VERSION": "0.3.5"
13
+ "PBOT_PLUGIN_VERSION": "0.3.7"
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.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.5 \"$@\"' pbot plugin codex hook",
8
+ "command": "PBOT_PLUGIN_VERSION=0.3.7 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.7 \"$@\"' 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.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.5 \"$@\"' pbot plugin codex hook",
19
+ "command": "PBOT_PLUGIN_VERSION=0.3.7 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.7 \"$@\"' 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.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.5 \"$@\"' pbot plugin codex hook",
30
+ "command": "PBOT_PLUGIN_VERSION=0.3.7 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" 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.3.7 \"$@\"' pbot plugin codex hook",
31
31
  "timeout": 120
32
32
  }
33
33
  ]
@@ -4,6 +4,6 @@ description: 初始化 Personal Bot 工作区、查看状态、搜索归档或
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- 使用当前会话的 `workspaceRoot` 作为 `--workspace`。省略子命令时使用 `status`。可执行 `init`、`status`、`history status|list|summary|migrate|search|read`。保留用户指定的维度、模型和筛选参数。
7
+ `--workspace` 传入当前会话的 `workspaceRoot`(工作区未启用时使用当前工作区根目录)。省略子命令时使用 `status`。可执行 `init`、`status`、`history status|list|summary|migrate|search|read`,保留用户指定的维度、模型和筛选参数。
8
8
 
9
- 运行 `npx --yes personal-bot@0.3.5 <子命令> --workspace "<workspaceRoot>"`。如果 `pbot --at-least 0.3.5` 返回 0,也可以用 `pbot` 执行同一条命令。返回实际结果。
9
+ 若 `pbot --at-least 0.3.7` 返回 0,运行 `pbot <子命令> --workspace "<workspaceRoot>"`;否则运行 `npx --yes personal-bot@0.3.7 <子命令> --workspace "<workspaceRoot>"`。返回实际结果。
@@ -11026,7 +11026,7 @@ async function agentText(agent, root, coordinatorPrompt = "plugin-coordinator.md
11026
11026
  function formatWorkspaceSkills(skills) {
11027
11027
  if (!skills.length) return "";
11028
11028
  const lines = skills.map((skill) => `- **${skill.name}**\uFF08\`${skill.path}\`\uFF09\uFF1A${skill.description}`);
11029
- return "## \u5DE5\u4F5C\u533A\u6280\u80FD\n\n\u5339\u914D\u4EFB\u52A1\u65F6\u6309\u9700\u8BFB\u53D6\u5BF9\u5E94 `SKILL.md` \u6B63\u6587\uFF1A\n" + lines.join("\n");
11029
+ return "## \u53EF\u7528\u6280\u80FD\n\n\u4EFB\u52A1\u5339\u914D\u65F6\u6309\u9700\u8BFB\u53D6\u5BF9\u5E94 `SKILL.md` \u6B63\u6587\uFF1A\n" + lines.join("\n");
11030
11030
  }
11031
11031
  async function loadWorkspaceContext(options) {
11032
11032
  const {
@@ -11046,7 +11046,7 @@ async function loadWorkspaceContext(options) {
11046
11046
  includeRootAgents ? readOptionalFile(join7(root, "AGENTS.md")) : Promise.resolve("")
11047
11047
  ]) : ["", "", ""];
11048
11048
  const skillsSection = formatWorkspaceSkills(workspaceSkills);
11049
- const noticesSection = notices.length ? "## \u542F\u52A8\u63D0\u793A\n\n" + notices.map((item) => `- ${item}`).join("\n") : "";
11049
+ const noticesSection = notices.length ? "## \u542F\u52A8\u63D0\u793A\n\n\u4EE5\u4E0B\u4E3A\u5DE5\u4F5C\u533A\u7EF4\u62A4\u63D0\u9192\uFF0C\u9002\u65F6\u987A\u5E26\u544A\u77E5\u7528\u6237\u5373\u53EF\uFF0C\u52FF\u672A\u7ECF\u7528\u6237\u8981\u6C42\u81EA\u884C\u6267\u884C\uFF1A\n" + notices.map((item) => `- ${item}`).join("\n") : "";
11050
11050
  const environment = { host, workspaceRoot: root, resourceRoot };
11051
11051
  const text3 = [
11052
11052
  workspace,