personal-bot 0.3.2 → 0.3.4
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 +2 -1
- package/DISCLAIMER.md +17 -0
- package/LICENSE +21 -0
- package/README.md +15 -5
- package/README.zh-CN.md +15 -5
- package/bin/pbot-pi-acp.mjs +1 -1
- package/bin/pbot.mjs +22 -2
- package/docs/README.md +2 -0
- package/docs/architecture/design.md +16 -16
- package/docs/architecture/extensibility.md +29 -2
- package/docs/architecture/model-context.md +3 -2
- package/docs/architecture/principles.md +2 -2
- package/docs/guides/capabilities.md +1 -1
- package/docs/guides/cross-harness-workers.md +3 -1
- package/docs/guides/history.md +30 -7
- package/docs/guides/workspace-configuration.md +20 -3
- package/docs/hosts/antigravity.md +1 -1
- package/docs/hosts/claude-code.md +1 -1
- package/docs/hosts/codex-qoder.md +63 -0
- package/docs/maintainers/architecture-governance.md +78 -0
- package/lib/antigravity-plugin/DISCLAIMER.md +17 -0
- package/lib/antigravity-plugin/LICENSE +21 -0
- package/lib/antigravity-plugin/bin/pbot-pi-acp.mjs +36 -0
- package/lib/antigravity-plugin/lib/common/files.d.ts +2 -0
- package/lib/antigravity-plugin/lib/common/files.js +44 -0
- package/lib/antigravity-plugin/lib/common/validation.d.ts +4 -0
- package/lib/antigravity-plugin/lib/common/validation.js +8 -0
- package/lib/antigravity-plugin/lib/extension/acp/member.d.ts +18 -0
- package/lib/antigravity-plugin/lib/extension/acp/member.js +44 -0
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +71 -45
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-entry.d.ts +1 -0
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-entry.js +22 -0
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.d.ts +4 -0
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.js +58 -0
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/files.d.ts +5 -0
- package/lib/antigravity-plugin/lib/extension/hosts/dsh/files.js +67 -0
- package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.d.ts +3 -0
- package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.js +100 -0
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.d.ts +3 -1
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +37 -22
- package/lib/antigravity-plugin/lib/extension/hosts/workspace-mcp.d.ts +6 -0
- package/lib/antigravity-plugin/lib/extension/hosts/workspace-mcp.js +21 -0
- package/lib/antigravity-plugin/lib/extension/mcp.js +2577 -2255
- package/lib/antigravity-plugin/lib/extension/workspace-cli.js +20171 -0
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +1 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +7 -59
- package/lib/antigravity-plugin/lib/integrations/hosts/codex/adapter.d.ts +2 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/codex/adapter.js +14 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/mcp.d.ts +4 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/mcp.js +28 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/messages.d.ts +36 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/messages.js +11 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.d.ts +6 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/resources.js +47 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/root-agents.d.ts +4 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/root-agents.js +3 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/skills.d.ts +8 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/dsh/skills.js +31 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/pi/agent-tools.d.ts +3 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/pi/agent-tools.js +32 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/pi/mcp.d.ts +4 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/pi/mcp.js +23 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/plugin-registry.d.ts +1 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/plugin-registry.js +8 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.d.ts +76 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/prompt-hooks.js +76 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/qoder/adapter.d.ts +2 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/qoder/adapter.js +16 -0
- package/lib/antigravity-plugin/lib/model/acp.d.ts +7 -3
- package/lib/antigravity-plugin/lib/model/acp.js +8 -0
- package/lib/antigravity-plugin/lib/model/agent.d.ts +121 -0
- package/lib/antigravity-plugin/lib/model/agent.js +4 -0
- package/lib/antigravity-plugin/lib/model/history.d.ts +10 -0
- package/lib/antigravity-plugin/lib/model/history.js +4 -1
- package/lib/antigravity-plugin/lib/model/plugin-host.d.ts +5 -0
- package/lib/antigravity-plugin/lib/model/workspace-config.d.ts +8 -12
- package/lib/antigravity-plugin/lib/model/workspace-config.js +2 -1
- package/lib/antigravity-plugin/lib/plugin.d.ts +2 -1
- package/lib/antigravity-plugin/lib/plugin.js +2 -2
- package/lib/antigravity-plugin/lib/services/history/history-capture.js +34 -22
- package/lib/antigravity-plugin/lib/services/history/summary-registry.js +2 -3
- package/lib/antigravity-plugin/lib/services/history/summary-runner.d.ts +2 -5
- package/lib/antigravity-plugin/lib/services/history/summary-runner.js +72 -74
- package/lib/antigravity-plugin/lib/services/history/workspace-history.d.ts +3 -0
- package/lib/antigravity-plugin/lib/services/history/workspace-history.js +6 -0
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +15 -0
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +126 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-config.js +9 -8
- package/lib/antigravity-plugin/lib/services/workspace/workspace-files.d.ts +2 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-files.js +17 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-mcp.d.ts +14 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-mcp.js +193 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.d.ts +1 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.js +4 -2
- package/lib/antigravity-plugin/lib/storage/acp-files.d.ts +11 -0
- package/lib/antigravity-plugin/lib/storage/acp-files.js +75 -0
- package/lib/antigravity-plugin/lib/storage/agent-files.d.ts +31 -0
- package/lib/antigravity-plugin/lib/storage/agent-files.js +159 -0
- package/lib/antigravity-plugin/lib/storage/atomic-json.d.ts +3 -1
- package/lib/antigravity-plugin/lib/storage/atomic-json.js +43 -3
- package/lib/antigravity-plugin/lib/storage/history-files.d.ts +2 -1
- package/lib/antigravity-plugin/lib/storage/history-files.js +21 -15
- package/lib/antigravity-plugin/lib/storage/history-format.d.ts +2 -3
- package/lib/antigravity-plugin/lib/storage/history-format.js +5 -7
- package/lib/antigravity-plugin/package.json +1 -1
- package/lib/antigravity-plugin/plugin.json +1 -1
- package/lib/antigravity-plugin/resources/prompts/history-monthly-summary.md +13 -0
- package/lib/antigravity-plugin/resources/prompts/history-summary.md +13 -0
- package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -0
- package/lib/antigravity-plugin/resources/skills/.claude-plugin/plugin.json +4 -0
- package/lib/antigravity-plugin/resources/skills/project-maintenance/SKILL.md +35 -0
- package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +52 -0
- package/lib/antigravity-plugin/skills/pbot/SKILL.md +11 -1
- package/lib/client.js +22 -50
- package/lib/codex-marketplace/.agents/plugins/marketplace.json +17 -0
- package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +7 -0
- package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +17 -0
- package/lib/codex-marketplace/plugins/personal-bot/DISCLAIMER.md +17 -0
- package/lib/codex-marketplace/plugins/personal-bot/LICENSE +21 -0
- package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +37 -0
- package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +9 -0
- package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/agents/openai.yaml +2 -0
- package/lib/common/validation.d.ts +4 -0
- package/lib/common/validation.js +8 -0
- package/lib/dsh.js +2 -2
- package/lib/extension/acp/member.d.ts +1 -1
- package/lib/extension/acp-worker.js +71 -45
- package/lib/extension/history/command.d.ts +37 -0
- package/lib/extension/history/command.js +57 -0
- package/lib/extension/hosts/dsh/acp-entry.d.ts +1 -0
- package/lib/extension/hosts/dsh/acp-entry.js +22 -0
- package/lib/extension/hosts/dsh/acp-member.js +4 -18
- package/lib/extension/hosts/dsh/command.d.ts +1 -2
- package/lib/extension/hosts/dsh/command.js +5 -49
- package/lib/extension/hosts/dsh/workspace.js +13 -44
- package/lib/extension/hosts/pi/acp-member.d.ts +3 -0
- package/lib/extension/hosts/pi/acp-member.js +100 -0
- package/lib/extension/hosts/plugin-runtime.d.ts +3 -1
- package/lib/extension/hosts/plugin-runtime.js +37 -22
- package/lib/extension/hosts/workspace-mcp.d.ts +6 -0
- package/lib/extension/hosts/workspace-mcp.js +21 -0
- package/lib/extension/mcp/bridge.d.ts +6 -8
- package/lib/extension/mcp/bridge.js +66 -84
- package/lib/extension/mcp/tool-contract.d.ts +735 -0
- package/lib/extension/mcp/tool-contract.js +441 -0
- package/lib/extension/mcp/workers.d.ts +29 -742
- package/lib/extension/mcp/workers.js +75 -525
- package/lib/extension/mcp.js +2577 -2255
- package/lib/extension/setup/cli.js +15 -0
- package/lib/extension/setup/upgrade.js +153 -0
- package/lib/extension/workspace-cli.js +20171 -0
- package/lib/integrations/acp/agents.d.ts +2 -3
- package/lib/integrations/acp/harnesses/dsh.js +1 -1
- package/lib/integrations/acp/harnesses/presets.js +8 -0
- package/lib/integrations/acp/history-summary.js +2 -1
- package/lib/integrations/acp/launch.d.ts +2 -2
- package/lib/integrations/agent-resources.js +1 -1
- package/lib/integrations/hosts/claude/adapter.js +7 -59
- package/lib/integrations/hosts/codex/adapter.d.ts +2 -0
- package/lib/integrations/hosts/codex/adapter.js +14 -0
- package/lib/integrations/hosts/pi/agent-tools.d.ts +3 -0
- package/lib/integrations/hosts/pi/agent-tools.js +32 -0
- package/lib/integrations/hosts/pi/mcp.d.ts +4 -0
- package/lib/integrations/hosts/pi/mcp.js +23 -0
- package/lib/integrations/hosts/plugin-registry.d.ts +1 -0
- package/lib/integrations/hosts/plugin-registry.js +8 -1
- package/lib/integrations/hosts/prompt-hooks.d.ts +76 -0
- package/lib/integrations/hosts/prompt-hooks.js +76 -0
- package/lib/integrations/hosts/qoder/adapter.d.ts +2 -0
- package/lib/integrations/hosts/qoder/adapter.js +16 -0
- package/lib/integrations/installation/cli-update.js +146 -0
- package/lib/integrations/installation/upgraders/antigravity.js +67 -0
- package/lib/integrations/installation/upgraders/claude.js +123 -0
- package/lib/integrations/installation/upgraders/codex.js +73 -0
- package/lib/integrations/installation/upgraders/dsh.js +62 -0
- package/lib/integrations/installation/upgraders/pi.js +90 -0
- package/lib/integrations/installation/upgraders/qoder.js +67 -0
- package/lib/integrations/installation/upgraders/registry.js +40 -0
- package/lib/model/acp.d.ts +7 -3
- package/lib/model/acp.js +8 -0
- package/lib/model/agent.d.ts +18 -4
- package/lib/model/agent.js +4 -1
- package/lib/model/history.d.ts +10 -0
- package/lib/model/history.js +4 -1
- package/lib/model/installation.js +1 -0
- package/lib/model/plugin-host.d.ts +5 -0
- package/lib/model/workspace-config.d.ts +8 -12
- package/lib/model/workspace-config.js +2 -1
- package/lib/plugin.d.ts +2 -1
- package/lib/plugin.js +2 -2
- package/lib/qoder-plugin/.mcp.json +17 -0
- package/lib/qoder-plugin/.qoder-plugin/plugin.json +7 -0
- package/lib/qoder-plugin/DISCLAIMER.md +17 -0
- package/lib/qoder-plugin/LICENSE +21 -0
- package/lib/qoder-plugin/hooks/hooks.json +37 -0
- package/lib/qoder-plugin/skills/pbot/SKILL.md +9 -0
- package/lib/services/agents/agent-service.d.ts +15 -45
- package/lib/services/agents/agent-service.js +22 -3
- package/lib/services/history/history-capture.js +34 -22
- package/lib/services/history/history-migrate.js +26 -60
- package/lib/services/history/history-query.js +38 -57
- package/lib/services/history/summary-command.d.ts +1 -1
- package/lib/services/history/summary-command.js +8 -7
- package/lib/services/history/summary-registry.js +2 -3
- package/lib/services/history/summary-runner.d.ts +2 -5
- package/lib/services/history/summary-runner.js +72 -74
- package/lib/services/history/workspace-history.d.ts +3 -0
- package/lib/services/history/workspace-history.js +6 -0
- package/lib/services/installation/setup-service.js +4 -1
- package/lib/services/installation/upgrade-service.js +95 -0
- package/lib/services/workspace/plugin-releases.d.ts +15 -0
- package/lib/services/workspace/plugin-releases.js +126 -0
- package/lib/services/workspace/workspace-config.js +9 -8
- package/lib/services/workspace/workspace-mcp.js +22 -29
- package/lib/services/workspace/workspace-skills.d.ts +1 -0
- package/lib/services/workspace/workspace-skills.js +4 -2
- package/lib/storage/acp-files.js +7 -12
- package/lib/storage/agent-files.js +6 -5
- package/lib/storage/atomic-json.d.ts +3 -1
- package/lib/storage/atomic-json.js +43 -3
- package/lib/storage/history-files.d.ts +2 -1
- package/lib/storage/history-files.js +21 -15
- package/lib/storage/history-format.d.ts +2 -3
- package/lib/storage/history-format.js +5 -7
- package/lib/tools/history/contract.d.ts +3 -11
- package/lib/tools/history/contract.js +8 -7
- package/lib/ui/dsh/elements.d.ts +2 -5
- package/lib/ui/dsh/elements.js +3 -16
- package/lib/ui/dsh/management.js +9 -9
- package/lib/ui/dsh/styles.d.ts +1 -1
- package/lib/ui/dsh/styles.js +5 -33
- package/package.json +4 -1
- package/resources/antigravity/skills/pbot/SKILL.md +11 -1
- package/resources/claude/skills/pbot/SKILL.md +11 -1
- package/resources/plugin/skills/pbot/SKILL.md +9 -0
- package/resources/prompts/history-coordinator.md +1 -0
- package/resources/prompts/plugin-coordinator.md +1 -0
- package/scripts/README.md +3 -2
- package/src/common/validation.ts +10 -0
- package/src/dsh.ts +2 -2
- package/src/extension/history/command.ts +68 -0
- package/src/extension/hosts/dsh/acp-entry.ts +21 -0
- package/src/extension/hosts/dsh/acp-member.ts +4 -15
- package/src/extension/hosts/dsh/command.ts +6 -46
- package/src/extension/hosts/dsh/workspace.ts +12 -38
- package/src/extension/hosts/pi/acp-member.ts +4 -10
- package/src/extension/hosts/pi/command.ts +14 -63
- package/src/extension/hosts/pi/events.ts +2 -8
- package/src/extension/hosts/pi/lifecycle.ts +3 -2
- package/src/extension/hosts/plugin-runtime.ts +39 -19
- package/src/extension/hosts/workspace-mcp.ts +25 -0
- package/src/extension/mcp/bridge.ts +80 -80
- package/src/extension/mcp/tool-contract.ts +462 -0
- package/src/extension/mcp/workers.ts +81 -551
- package/src/extension/setup/cli.ts +11 -1
- package/src/extension/setup/upgrade.ts +158 -0
- package/src/extension/setup/workspace-cli.ts +167 -0
- package/src/integrations/acp/agents.ts +2 -3
- package/src/integrations/acp/harnesses/dsh.ts +1 -1
- package/src/integrations/acp/harnesses/presets.ts +8 -0
- package/src/integrations/acp/history-summary.ts +2 -1
- package/src/integrations/agent-resources.ts +1 -1
- package/src/integrations/hosts/claude/adapter.ts +7 -53
- package/src/integrations/hosts/codex/adapter.ts +16 -0
- package/src/integrations/hosts/plugin-registry.ts +9 -1
- package/src/integrations/hosts/prompt-hooks.ts +72 -0
- package/src/integrations/hosts/qoder/adapter.ts +19 -0
- package/src/integrations/installation/cli-update.ts +144 -0
- package/src/integrations/installation/pi-bridge.ts +1 -1
- package/src/integrations/installation/pi-setup.ts +1 -1
- package/src/integrations/installation/processes.ts +1 -1
- package/src/integrations/installation/upgraders/antigravity.ts +68 -0
- package/src/integrations/installation/upgraders/claude.ts +123 -0
- package/src/integrations/installation/upgraders/codex.ts +73 -0
- package/src/integrations/installation/upgraders/dsh.ts +63 -0
- package/src/integrations/installation/upgraders/pi.ts +87 -0
- package/src/integrations/installation/upgraders/qoder.ts +68 -0
- package/src/integrations/installation/upgraders/registry.ts +48 -0
- package/src/model/acp.ts +11 -3
- package/src/model/agent.ts +20 -4
- package/src/model/history.ts +5 -0
- package/src/model/installation.ts +86 -0
- package/src/model/plugin-host.ts +5 -1
- package/src/model/workspace-config.ts +6 -12
- package/src/pbot.ts +13 -32
- package/src/plugin.ts +3 -3
- package/src/services/agents/agent-service.ts +29 -17
- package/src/services/history/history-capture.ts +30 -22
- package/src/services/history/history-migrate.ts +23 -50
- package/src/services/history/history-query.ts +34 -48
- package/src/services/history/summary-command.ts +9 -8
- package/src/services/history/summary-registry.ts +2 -3
- package/src/services/history/summary-runner.ts +72 -81
- package/src/services/history/workspace-history.ts +8 -0
- package/src/services/installation/setup-service.ts +9 -43
- package/src/services/installation/upgrade-service.ts +127 -0
- package/src/services/workspace/plugin-releases.ts +121 -0
- package/src/services/workspace/workspace-config.ts +9 -8
- package/src/services/workspace/workspace-mcp.ts +23 -28
- package/src/services/workspace/workspace-skills.ts +5 -2
- package/src/storage/acp-files.ts +7 -12
- package/src/storage/agent-files.ts +6 -5
- package/src/storage/atomic-json.ts +31 -4
- package/src/storage/history-files.ts +22 -15
- package/src/storage/history-format.ts +6 -8
- package/src/tools/history/contract.ts +9 -9
- package/src/tools/history/pi-tool.ts +6 -4
- package/src/ui/dsh/elements.ts +5 -12
- package/src/ui/dsh/management.ts +10 -10
- package/src/ui/dsh/styles.ts +5 -33
- package/lib/antigravity-plugin/lib/services/history/history-migrate.d.ts +0 -12
- package/lib/antigravity-plugin/lib/services/history/history-migrate.js +0 -88
- package/lib/ui/presentation.d.ts +0 -3
- package/lib/ui/presentation.js +0 -12
- package/src/tools/access.ts +0 -7
- package/src/tools/register.ts +0 -21
- package/src/ui/presentation.ts +0 -12
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"plugins": [
|
|
7
7
|
{
|
|
8
8
|
"name": "personal-bot",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.4",
|
|
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.3.
|
|
14
|
+
"version": "0.3.4"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
]
|
package/DISCLAIMER.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Disclaimer / 免责声明
|
|
2
|
+
|
|
3
|
+
## English
|
|
4
|
+
|
|
5
|
+
AI models can produce incorrect answers, commands, and code. Verify information before relying on it. Review proposed changes before applying them to important files or systems.
|
|
6
|
+
|
|
7
|
+
Workers and MCP tools may read or change files, run commands, or send workspace data to services you configure. Check which data and credentials a worker or service can access when granting permissions. Third-party providers may charge for requests and process data under their own terms and privacy policies.
|
|
8
|
+
|
|
9
|
+
Personal Bot is provided “as is”. Its warranty disclaimer and limitation of liability are set out in the project license. Third-party software is subject to its own licenses. [MIT License](LICENSE)
|
|
10
|
+
|
|
11
|
+
## 中文
|
|
12
|
+
|
|
13
|
+
AI 模型生成的回答、命令和代码可能有误。请在据此作出决定前核实关键信息,在将更改应用到重要文件或系统前审查具体内容。
|
|
14
|
+
|
|
15
|
+
Worker 和 MCP 工具可能读取或修改文件、执行命令,或将工作区数据发送给你配置的服务。授予权限时,请确认对方能够访问哪些数据和凭据。第三方服务可能按请求收费,并按各自的条款和隐私政策处理数据。
|
|
16
|
+
|
|
17
|
+
Personal Bot 按现状提供,担保免责和责任限制条款见项目许可证。第三方软件适用其各自的许可证。[MIT 许可证全文](LICENSE)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Personal Bot contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ English | [简体中文](README.zh-CN.md)
|
|
|
4
4
|
|
|
5
5
|
**A harness-agnostic personal assistant workspace and unified MCP cross-harness delegation layer.**
|
|
6
6
|
|
|
7
|
-
Personal Bot brings shared workspace materials and skills to [Pi](https://pi.dev), dsh, Claude Code, Antigravity, and extensible plugin hosts, while unifying cross-harness ACP v1 delegation onto a clean 6-tool stdio MCP server (`worker_create`, `worker_close`, `worker_request`, `worker_response`, `worker_output`, `worker_discover`). Host-native subagent and team tools remain untouched and complementary; Pi and dsh also provide `pbot_history`.
|
|
7
|
+
Personal Bot brings shared workspace materials and skills to [Pi](https://pi.dev), dsh, Claude Code, Antigravity, Codex, Qoder CLI, and extensible plugin hosts, while unifying cross-harness ACP v1 delegation onto a clean 6-tool stdio MCP server (`worker_create`, `worker_close`, `worker_request`, `worker_response`, `worker_output`, `worker_discover`). Host-native subagent and team tools remain untouched and complementary; Pi and dsh also provide `pbot_history`.
|
|
8
8
|
|
|
9
9
|
Quick links (Chinese): [Documentation Index](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) · [Cross-Harness Workers](docs/guides/cross-harness-workers.md).
|
|
10
10
|
|
|
@@ -20,6 +20,8 @@ Missing, disabled, or invalid configuration keeps Personal Bot inactive without
|
|
|
20
20
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
|
+
The workspace CLI runs from the workspace root or accepts `--workspace <dir>`. Install it with `npm install -g personal-bot`, or use `npx personal-bot@<installed-plugin-version>`. Use `pbot init`, `pbot status`, `pbot upgrade|update`, and `pbot history status|list|summary|migrate|search|read`. Run `pbot upgrade` to update the global CLI and all host plugins bound to the current workspace to the latest stable npm release. During initialization and in enabled workspaces, the CLI also selects a version that meets the registered plugins’ requirements. [Workspace configuration](docs/guides/workspace-configuration.md) · [CLI and history guide](docs/guides/history.md)
|
|
24
|
+
|
|
23
25
|
### Pi
|
|
24
26
|
|
|
25
27
|
Requires Linux/macOS, Node.js 22.19+, and npm:
|
|
@@ -33,7 +35,7 @@ pi install --local npm:personal-bot
|
|
|
33
35
|
pi
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
Run `/pbot init`. Once enabled, Pi automatically registers the `pbot` stdio MCP server (`worker_*`), exposes `pbot_history`, and provides `/pbot init | status | worker`. See the [Pi guide](docs/hosts/pi.md).
|
|
38
|
+
Run `/pbot init`. Once enabled, Pi automatically registers the `pbot` stdio MCP server (`worker_*`), exposes `pbot_history`, and provides `/pbot init | status | history | worker`. See the [Pi guide](docs/hosts/pi.md).
|
|
37
39
|
|
|
38
40
|
### dsh
|
|
39
41
|
|
|
@@ -58,6 +60,10 @@ Requires Linux/macOS, Node.js 22.19+, and Claude Code `2.1.325+`:
|
|
|
58
60
|
|
|
59
61
|
Run `/personal-bot:pbot init` in the workspace. Command hooks inject main-session context and gate bundled skills when disabled without intercepting native `Agent` subagents; `.mcp.json` mounts `worker_*`. See the [Claude Code guide](docs/hosts/claude-code.md).
|
|
60
62
|
|
|
63
|
+
### Codex / Qoder CLI
|
|
64
|
+
|
|
65
|
+
Install the Codex or Qoder CLI plugin and initialize the workspace with `pbot plugin codex init` or `pbot plugin qoder init`. See the [installation and workspace guide](docs/hosts/codex-qoder.md).
|
|
66
|
+
|
|
61
67
|
### Antigravity
|
|
62
68
|
|
|
63
69
|
Requires Linux/macOS, Node.js 22.19+, and Antigravity CLI (`agy` `1.5+`):
|
|
@@ -78,7 +84,7 @@ npx personal-bot@latest mcp
|
|
|
78
84
|
pbot mcp
|
|
79
85
|
```
|
|
80
86
|
|
|
81
|
-
Supports built-in presets (`pi`, `dsh`, `claude`, `antigravity`, `codex`) and arbitrary custom ACP v1 binaries declared in `.pbot/config.json` under `acp` (`{ "command", "args", "env?" }`). See [cross-harness workers](docs/guides/cross-harness-workers.md).
|
|
87
|
+
Supports built-in presets (`pi`, `dsh`, `claude`, `antigravity`, `codex`, `qoder`) and arbitrary custom ACP v1 binaries declared in `.pbot/config.json` under `acp` (`{ "command", "args", "env?" }`). See [cross-harness workers](docs/guides/cross-harness-workers.md).
|
|
82
88
|
|
|
83
89
|
## Workspace materials
|
|
84
90
|
|
|
@@ -90,11 +96,11 @@ Supports built-in presets (`pi`, `dsh`, `claude`, `antigravity`, `codex`) and ar
|
|
|
90
96
|
| `providers/` | External CLI/MCP guides and data definitions |
|
|
91
97
|
| `scratch/` | Temporary scripts, data, and working environments |
|
|
92
98
|
| `agents/` | Role additions (`coordinator.md`, `general-purpose.md`) |
|
|
93
|
-
| `.pbot/history/` |
|
|
99
|
+
| `.pbot/history/` | Raw exchanges from connected hosts in `raw/` and derived summaries in `summaries/` |
|
|
94
100
|
|
|
95
101
|
## Development
|
|
96
102
|
|
|
97
|
-
|
|
103
|
+
The package version is **0.3.4**. Full development uses Linux/macOS and Node.js 24.9+:
|
|
98
104
|
|
|
99
105
|
```bash
|
|
100
106
|
npm ci --ignore-scripts
|
|
@@ -108,3 +114,7 @@ git diff --check
|
|
|
108
114
|
- [Documentation index](docs/README.md)
|
|
109
115
|
- [Architecture principles](docs/architecture/principles.md) · [Technical design](docs/architecture/design.md) · [Extensibility design](docs/architecture/extensibility.md)
|
|
110
116
|
- [Release guide](docs/maintainers/release.md) · [Maintenance scripts](scripts/README.md) · [Domain terms](CONTEXT.md)
|
|
117
|
+
|
|
118
|
+
## License and disclaimer
|
|
119
|
+
|
|
120
|
+
Personal Bot is licensed under MIT. [License](LICENSE) · [Disclaimer](DISCLAIMER.md#english)
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**连接知识、研究与行动的跨 Harness 个人助手层。**
|
|
6
6
|
|
|
7
|
-
Personal Bot 为多宿主环境([Pi](https://pi.dev)、dsh、Claude Code、Antigravity 及可扩展的其他插件宿主)提供共享工作区资料与专业方法,并通过统一的 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)、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` 历史检索。
|
|
8
8
|
|
|
9
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)。
|
|
10
10
|
|
|
@@ -20,6 +20,8 @@ Personal Bot 为多宿主环境([Pi](https://pi.dev)、dsh、Claude Code、Ant
|
|
|
20
20
|
|
|
21
21
|
## 安装
|
|
22
22
|
|
|
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)。
|
|
24
|
+
|
|
23
25
|
### Pi
|
|
24
26
|
|
|
25
27
|
需要 Linux/macOS、Node.js 22.19+ 与 npm:
|
|
@@ -33,7 +35,7 @@ pi install --local npm:personal-bot
|
|
|
33
35
|
pi
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
在会话中执行 `/pbot init`。已启用后自动挂载 `pbot` MCP 服务(`worker_*`)与 `pbot_history`,提供 `/pbot init | status | worker`。详见 [Pi 使用指南](docs/hosts/pi.md)。
|
|
38
|
+
在会话中执行 `/pbot init`。已启用后自动挂载 `pbot` MCP 服务(`worker_*`)与 `pbot_history`,提供 `/pbot init | status | history | worker`。详见 [Pi 使用指南](docs/hosts/pi.md)。
|
|
37
39
|
|
|
38
40
|
### dsh
|
|
39
41
|
|
|
@@ -58,6 +60,10 @@ dsh --profile pbot
|
|
|
58
60
|
|
|
59
61
|
在工作区执行 `/personal-bot:pbot init`。插件通过标准 command hooks 注入主会话上下文并门控未启用技能,不拦截原生 `Agent`;跨 Harness 调度由内置 `.mcp.json` 挂载的 `worker_*` 提供。详见 [Claude Code 使用指南](docs/hosts/claude-code.md)。
|
|
60
62
|
|
|
63
|
+
### Codex / Qoder CLI
|
|
64
|
+
|
|
65
|
+
安装对应原生插件后,在工作区运行 `pbot plugin codex init` 或 `pbot plugin qoder init`。详见[安装与使用指南](docs/hosts/codex-qoder.md)。
|
|
66
|
+
|
|
61
67
|
### Antigravity
|
|
62
68
|
|
|
63
69
|
需要 Linux/macOS、Node.js 22.19+ 与 Antigravity CLI(`agy` `1.5+`):
|
|
@@ -78,7 +84,7 @@ npx personal-bot@latest mcp
|
|
|
78
84
|
pbot mcp
|
|
79
85
|
```
|
|
80
86
|
|
|
81
|
-
支持内置预设(`pi`、`dsh`、`claude`、`antigravity`、`codex`)及 `.pbot/config.json` 中声明的任意自定义 ACP v1 程序(支持 `{ "command", "args", "env?" }`),详见[跨 Harness 专家调度](docs/guides/cross-harness-workers.md)。
|
|
87
|
+
支持内置预设(`pi`、`dsh`、`claude`、`antigravity`、`codex`、`qoder`)及 `.pbot/config.json` 中声明的任意自定义 ACP v1 程序(支持 `{ "command", "args", "env?" }`),详见[跨 Harness 专家调度](docs/guides/cross-harness-workers.md)。
|
|
82
88
|
|
|
83
89
|
## 工作区资料
|
|
84
90
|
|
|
@@ -90,11 +96,11 @@ pbot mcp
|
|
|
90
96
|
| `providers/` | 外部 CLI/MCP 使用手册与数据口径 |
|
|
91
97
|
| `scratch/` | 临时脚本、计算数据与实验环境 |
|
|
92
98
|
| `agents/` | 角色职责补充(`coordinator.md`、`general-purpose.md`) |
|
|
93
|
-
| `.pbot/history/` |
|
|
99
|
+
| `.pbot/history/` | 各接入宿主的原始问答(`raw/`)与分层摘要(`summaries/`) |
|
|
94
100
|
|
|
95
101
|
## 开发与验证
|
|
96
102
|
|
|
97
|
-
当前版本 **0.3.
|
|
103
|
+
当前版本 **0.3.4**。完整开发使用 Linux/macOS、Node.js 24.9+:
|
|
98
104
|
|
|
99
105
|
```bash
|
|
100
106
|
npm ci --ignore-scripts
|
|
@@ -108,3 +114,7 @@ git diff --check
|
|
|
108
114
|
- [文档总索引](docs/README.md)
|
|
109
115
|
- [架构原则](docs/architecture/principles.md) · [技术设计](docs/architecture/design.md) · [插件与 ACP 扩展设计](docs/architecture/extensibility.md)
|
|
110
116
|
- [npm 发布与验收](docs/maintainers/release.md) · [维护脚本](scripts/README.md) · [领域术语](CONTEXT.md)
|
|
117
|
+
|
|
118
|
+
## 许可证与免责声明
|
|
119
|
+
|
|
120
|
+
Personal Bot 采用 MIT 许可证。[许可证全文](LICENSE) · [免责声明](DISCLAIMER.md#中文)
|
package/bin/pbot-pi-acp.mjs
CHANGED
|
@@ -22,7 +22,7 @@ if (process.env.PBOT_SUMMARY_WORKER === "1") {
|
|
|
22
22
|
const directory = process.env.PBOT_SUBAGENT_DIR;
|
|
23
23
|
if (!directory) throw new Error("Missing Personal Bot Pi ACP launch context");
|
|
24
24
|
const { options } = JSON.parse(readFileSync(join(directory, "descriptor.json"), "utf8"));
|
|
25
|
-
args = [...process.argv.slice(2), "--extension", fileURLToPath(new URL("../
|
|
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");
|
|
28
28
|
if (options.noPromptTemplates) args.push("--no-prompt-templates");
|
package/bin/pbot.mjs
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const args = process.argv.slice(2);
|
|
3
|
+
try {
|
|
4
|
+
if (["init", "status", "history", "--version", "-v", "--at-least", "--json", "--workspace"].includes(args[0]) || args[0]?.startsWith("--workspace=")) {
|
|
5
|
+
const { main } = await import("../lib/extension/workspace-cli.js");
|
|
6
|
+
process.exitCode = await main(args);
|
|
7
|
+
} else {
|
|
8
|
+
const { updateForCommand, updateForWorkspace } = await import("../lib/extension/workspace-cli.js");
|
|
9
|
+
const updated = args.length && !["-h", "--help", "upgrade", "update"].includes(args[0]) ? await updateForCommand(args) : undefined;
|
|
10
|
+
if (updated !== undefined) {
|
|
11
|
+
process.exitCode = updated;
|
|
12
|
+
} else if (args[0] === "plugin") {
|
|
13
|
+
const { main } = await import("../lib/plugin.js");
|
|
14
|
+
await main(args.slice(1), (root, input) => updateForWorkspace(root, args, input));
|
|
15
|
+
} else {
|
|
16
|
+
const { main } = await import("../lib/extension/setup/cli.js");
|
|
17
|
+
process.exitCode = await main(args);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
}
|
package/docs/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Personal Bot 文档按使用场景与职责分为四类,根目录 [README.zh-C
|
|
|
9
9
|
| [Pi 使用指南](hosts/pi.md) | `pbot setup` 安装、`/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
|
+
| [Codex 与 Qoder CLI](hosts/codex-qoder.md) | 原生插件安装、工作区启用、hook、历史与 MCP 工具 |
|
|
12
13
|
| [Antigravity 使用指南](hosts/antigravity.md) | npm 一键安装、hooks、技能门控、MCP `worker_*` 与原生 `invoke_subagent`/`/swarm` 互补 |
|
|
13
14
|
|
|
14
15
|
## 通用使用指南(`docs/guides/`)
|
|
@@ -36,3 +37,4 @@ Personal Bot 文档按使用场景与职责分为四类,根目录 [README.zh-C
|
|
|
36
37
|
| --- | --- |
|
|
37
38
|
| [npm 发布与验收](maintainers/release.md) | 候选包准备、CI/本机发布、消费检查与发布后验收 |
|
|
38
39
|
| [维护脚本](../scripts/README.md) | 构建顺序、原生插件校验与消费检查脚本说明 |
|
|
40
|
+
| [架构治理工作台](maintainers/architecture-governance.md) | 状态所有权、验证入口、当前任务与决策 |
|
|
@@ -4,31 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
## 模块与依赖
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
storage
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
7
|
+
下表列出源码的直接跨层依赖。单个模块的依赖由 `dependency-cruiser` 从导入关系生成,包含仅类型导入。入口负责装配,UI 通过宿主回调或 dsh Remote 取得数据。
|
|
8
|
+
|
|
9
|
+
| 消费层 | 直接使用的内部层 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| 顶层宿主与协议入口 | extension、tools、ui、integrations、services、common |
|
|
12
|
+
| extension | tools、ui、integrations、services、storage、model、common。ACP 子进程负责读写控制文件,MCP 与宿主命令经服务访问存储 |
|
|
13
|
+
| tools | services、integrations、model、common |
|
|
14
|
+
| ui | model、common |
|
|
15
|
+
| services、integrations | storage、model、common |
|
|
16
|
+
| storage | model、common |
|
|
17
|
+
| model、common | 仅各自层内的源码 |
|
|
19
18
|
|
|
20
19
|
| 目录 | 责任 |
|
|
21
20
|
| --- | --- |
|
|
22
21
|
| `src/pbot.ts` / `src/dsh.ts` | Pi 与 dsh Host 装配(工作区生命周期、历史工具、原生 MCP 挂载) |
|
|
23
22
|
| `src/plugin.ts` / `src/claude.ts` | 通用插件宿主 CLI/hook 入口(查 `PluginHostRegistry`)与 Claude 兼容入口 |
|
|
24
|
-
| `src/mcp.ts` | 独立 stdio MCP 服务入口,暴露 6 个 `worker_*`
|
|
25
|
-
| `src/extension/` |
|
|
23
|
+
| `src/mcp.ts` | 独立 stdio MCP 服务入口,暴露 6 个 `worker_*` 工具,按工作区功能与宿主原生挂载情况提供共享 MCP 和历史查询 |
|
|
24
|
+
| `src/extension/` | 运行时编排。 `hosts/` 装配宿主,`mcp/` 提供 MCP 服务与桥接,`acp/` 启动 worker,`history/` 执行共享历史命令,`setup/` 提供安装器、工作区 CLI 和 Pi 初始化保护 |
|
|
26
25
|
| `src/integrations/` | 按外部集成域划分的适配器:`hosts/`(各宿主平级目录 `pi/`、`dsh/`、`claude/`、`antigravity/` 及 `plugin-registry.ts`)、`acp/`(协议、`harnesses/` 与独立摘要执行器 `history-summary.ts`)、`installation/`(安装桥接),以及跨宿主辅助(`agent-resources.ts`) |
|
|
27
26
|
| `src/services/` | 宿主无关业务规则(`agents/`、`workspace/`、`history/`、`installation/`) |
|
|
28
27
|
| `src/model/` | 纯数据类型与窄能力契约(`plugin-host.ts`、`acp.ts`、`agent.ts`、`history.ts`、`workspace-config.ts`),不含实现或宿主 SDK 类型 |
|
|
29
28
|
| `src/storage/` | 原子 JSON、ACP worker 控制记录与历史归档存储 |
|
|
30
29
|
| `src/tools/` | `pbot_history` 契约与对称宿主注册(`history/pi-tool.ts`、`history/dsh-tool.ts`) |
|
|
31
|
-
| `src/ui/` | 宿主专属 UI(`pi/confirmation.ts`、`dsh/` Web
|
|
30
|
+
| `src/ui/` | 宿主专属 UI(`pi/confirmation.ts`、`dsh/` Web 工作区与历史面板)及安装器交互(`setup.ts`) |
|
|
32
31
|
| `src/common/` | JSON、校验、Ajv Schema、文件、路径与版本辅助 |
|
|
33
32
|
| `resources/` | 模型可见提示词、角色、技能、参考资料与模板 |
|
|
34
33
|
|
|
@@ -72,7 +71,8 @@ Claude / Antigravity / 任意插件宿主 hooks、CLI 与薄 stdio MCP
|
|
|
72
71
|
|
|
73
72
|
## 安装器(`pbot setup`)与 CLI
|
|
74
73
|
|
|
75
|
-
`bin/pbot.mjs`
|
|
74
|
+
`bin/pbot.mjs` 选择随包构建的工作区 CLI、安装器或插件运行时,提供工作区、安装与 MCP 命令:
|
|
75
|
+
- `pbot init|status` 与 `pbot history status|list|summary|migrate|search|read`:工作区 CLI 与 Pi/dsh 共用 `src/extension/history/command.ts`。根目录、精确版本和输出契约见[历史与 CLI 指南](../guides/history.md)。
|
|
76
76
|
- `pbot setup [--workspace <dir>]`:交互式检查环境、安装/更新 Pi 与工作区扩展,保留自定义本地/Git/固定来源,完成后通过临时 `setup-guard` 启动 Pi 执行 `/pbot init`。
|
|
77
77
|
- `pbot install-antigravity`:调用原生 `agy plugin install ./lib/antigravity-plugin` 安装或更新 Antigravity 插件。
|
|
78
78
|
- `pbot mcp`:直接运行独立打包的 `lib/extension/mcp.js` 供任意 MCP 客户端连接。
|
|
@@ -13,6 +13,8 @@ src/extension/hosts/plugin-runtime.ts (唯一核心逻辑:init/status/hook 引
|
|
|
13
13
|
└── PluginHostRegistry (src/integrations/hosts/plugin-registry.ts)
|
|
14
14
|
├── claudeAdapter (src/integrations/hosts/claude/adapter.ts)
|
|
15
15
|
├── antigravityAdapter (src/integrations/hosts/antigravity/adapter.ts)
|
|
16
|
+
├── codexAdapter (src/integrations/hosts/codex/adapter.ts)
|
|
17
|
+
├── qoderAdapter (src/integrations/hosts/qoder/adapter.ts)
|
|
16
18
|
└── <自定义宿主适配器> (通过 registerPluginHost 动态注册)
|
|
17
19
|
```
|
|
18
20
|
|
|
@@ -21,9 +23,11 @@ src/extension/hosts/plugin-runtime.ts (唯一核心逻辑:init/status/hook 引
|
|
|
21
23
|
- `host: string`:任意宿主标识符,运行时不做联合类型限制。
|
|
22
24
|
- `nativeRootAgents: boolean`:宿主是否原生加载工作区根 `AGENTS.md`(为 `false` 时由上下文拼装附带)。
|
|
23
25
|
- `nativeWorkspaceSkills?: boolean`:宿主是否原生扫描 `.agents/skills/`(为 `false` 或省略时,在 `features.skills` 开启下由上下文拼装附带技能元数据索引)。
|
|
26
|
+
- `indexBundledSkills?: boolean`:宿主只注册管理技能时,通过 hook 按工作区的 `features.skills` 提供包内方法索引。Codex 与 Qoder CLI 使用此方式,其原生技能发现负责工作区自有技能。
|
|
24
27
|
- `coordinatorPrompt?: string`:主会话协调者操作导航文件(默认使用宿主无关的 `plugin-coordinator.md`)。
|
|
25
28
|
- `resolveRoot(cwd, rawPayload)`:从宿主环境变量或 hook 载荷解析绑定工作区根目录。
|
|
26
|
-
-
|
|
29
|
+
- 宿主通过环境变量绑定工作区时,`boundWorkspaceRoot?()` 向命令、hook 与 stdio MCP 提供同一根目录。Qoder CLI 优先使用 `QODER_PROJECT_DIR`。
|
|
30
|
+
- `parseEvent(payload)` 将宿主原生 hook 映射为 `ignore`、`inject-context`、`record-history` 或 `check-skill`。宿主负责原生子代理的生命周期。
|
|
27
31
|
- `formatPass` / `formatContext` / `formatDeny`:输出宿主协议要求的 JSON 响应。
|
|
28
32
|
|
|
29
33
|
### 内置适配器对比
|
|
@@ -36,6 +40,8 @@ src/extension/hosts/plugin-runtime.ts (唯一核心逻辑:init/status/hook 引
|
|
|
36
40
|
| 未启用技能门控 | `PreToolUse(Skill)` 与 `UserPromptExpansion` 拦截工作方法,放行 `pbot` | `PreToolUse(read_file)` 拦截插件工作方法技能,放行 `pbot`;其余返回 `{ decision: "allow" }` |
|
|
37
41
|
| 原生 subagent | 完全不拦截、不提供覆盖性静态 agent | 完全不拦截、不提供覆盖性静态 agent |
|
|
38
42
|
|
|
43
|
+
Codex 与 Qoder CLI 在 `SessionStart` 投递历史提示,在 `UserPromptSubmit` 注入协调者上下文,在 `Stop` 归档回复。Codex 提供原生回合 ID,用于关联同一回合的追加输入与最终回复。两个适配器共用这些事件的解析和输出。安装与工作区配置见[宿主指南](../hosts/codex-qoder.md)。
|
|
44
|
+
|
|
39
45
|
### 接入新插件宿主的步骤
|
|
40
46
|
|
|
41
47
|
1. 在 `src/integrations/hosts/<host>/adapter.ts` 实现 `PluginHostAdapter`(禁止引入任何宿主 SDK)。
|
|
@@ -52,7 +58,7 @@ MCP Server (src/extension/mcp/workers.ts) -> AgentService -> AcpWorkerHost -> sr
|
|
|
52
58
|
↓
|
|
53
59
|
AcpHarnessRegistry (src/integrations/acp/registry.ts)
|
|
54
60
|
├── genericAcpHarness (任意自定义 ACP v1 默认回退)
|
|
55
|
-
├── standardAcpPresets (antigravity, codex,
|
|
61
|
+
├── standardAcpPresets (antigravity, codex, qoder)
|
|
56
62
|
├── piAcpHarness (src/integrations/acp/harnesses/pi.ts)
|
|
57
63
|
├── dshAcpHarness (src/integrations/acp/harnesses/dsh.ts)
|
|
58
64
|
└── claudeAcpHarness (src/integrations/acp/harnesses/claude.ts)
|
|
@@ -78,3 +84,24 @@ MCP Server (src/extension/mcp/workers.ts) -> AgentService -> AcpWorkerHost -> sr
|
|
|
78
84
|
- 每次调用动态读取工作区 `.pbot/config.json` 并刷新 `acp` 映射,新增自定义 Harness 即改即生效。
|
|
79
85
|
- 支持 `PBOT_MCP_SESSION_ID` 与 `PBOT_MCP_AGENT_DIR`,使 Pi/dsh 的 `/pbot worker` 命令与自动挂载的 MCP 进程共享同一会话归属。
|
|
80
86
|
- `lib/extension/mcp.js` 与 `lib/extension/acp-worker.js` 通过 `esbuild` 独立打包,确保插件缓存目录在无 `node_modules` 环境下稳定运行。
|
|
87
|
+
|
|
88
|
+
## 4. 可扩展宿主升级适配器(`HostUpgraderRegistry`)
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
pbot upgrade|update (src/extension/setup/upgrade.ts)
|
|
92
|
+
↓
|
|
93
|
+
src/services/installation/upgrade-service.ts (宿主无关编排与单宿主容错)
|
|
94
|
+
↓
|
|
95
|
+
HostUpgraderRegistry (src/integrations/installation/upgraders/registry.ts)
|
|
96
|
+
├── piUpgrader (src/integrations/installation/upgraders/pi.ts)
|
|
97
|
+
├── claudeUpgrader (src/integrations/installation/upgraders/claude.ts)
|
|
98
|
+
├── antigravityUpgrader (src/integrations/installation/upgraders/antigravity.ts)
|
|
99
|
+
├── codexUpgrader (src/integrations/installation/upgraders/codex.ts)
|
|
100
|
+
├── qoderUpgrader (src/integrations/installation/upgraders/qoder.ts)
|
|
101
|
+
├── dshUpgrader (src/integrations/installation/upgraders/dsh.ts)
|
|
102
|
+
└── <自定义宿主升级器> (通过 registerHostUpgrader 动态注册)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- `HostUpgrader` 契约定义在 `src/model/installation.ts`(`host: string` + `upgrade(context): Promise<HostUpgradeResult>`)。
|
|
106
|
+
- 升级编排主链路只按当前工作区绑定的宿主列表(`~/.pbot/workspaces/<hash>/*.json` 与本地 `.pi/`)动态查表调用,不感知具体宿主实现;单宿主失败或跳过不阻塞其余宿主。
|
|
107
|
+
- 接入新宿主升级能力只需新增 `src/integrations/installation/upgraders/<host>.ts` 并在 `registry.ts` 注册,无需修改 `upgrade-service.ts` 或 `upgrade.ts`。
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| 公共约定与资料目录用途 | `resources/prompts/workspace.md`,已启用主会话与 ACP worker 加载 |
|
|
10
10
|
| 协调者 / 通用专家职责 | `resources/agents/coordinator.md`、`general-purpose.md`,叠加工作区 `agents/<role>.md` |
|
|
11
11
|
| 协调者操作导航 | Pi/dsh 加载 `resources/prompts/history-coordinator.md`;轻插件宿主加载 `resources/prompts/plugin-coordinator.md` |
|
|
12
|
-
| 工作区自有技能 | `<workspace>/.agents/skills/*/SKILL.md`,Pi/dsh/Antigravity/Codex 原生发现;Claude Code 与未声明原生发现的 ACP worker 按需注入元数据索引(受 `features.skills` 控制) |
|
|
12
|
+
| 工作区自有技能 | `<workspace>/.agents/skills/*/SKILL.md`,Pi/dsh/Antigravity/Codex/Qoder CLI 原生发现;Claude Code 与未声明原生发现的 ACP worker 按需注入元数据索引(受 `features.skills` 控制) |
|
|
13
13
|
| 专业方法技能 | `resources/skills/`(`project-maintenance`、`provider-connections`),只暴露元数据,按任务读取正文(受 `features.skills` 控制) |
|
|
14
14
|
| 计算与外部任务参考 | `resources/references/compute.md`、`compute-finance.md`、`task-conductor.md`,按需读取 |
|
|
15
15
|
| 历史摘要专用提示 | `resources/prompts/history-summary.md`,仅用于 Pi/dsh 独立历史摘要调用 |
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
| **dsh** | `system-prompt/assemble` 当次刷新 section;技能 provider 仅注册到启用主会话;`dsh-mcp-client` 挂载 `mcp__pbot__worker_*` | dsh 原生加载与去重 | 不干预原生 `subagent`/`subagent_fork` |
|
|
23
23
|
| **Claude Code** | `UserPromptSubmit` 注入主会话上下文;`PreToolUse(Skill)` / `UserPromptExpansion` 门控未启用技能;`.mcp.json` 挂载 `worker_*` | 宿主不自动加载,由 hook 拼装附带 | 含 `agent_id` 的原生子代理直接放行,不注入 |
|
|
24
24
|
| **Antigravity** | `SessionStart` 通过 `injectSteps` 一次性注入;`PreToolUse(read_file)` 门控未启用技能;`mcp_config.json` 挂载 `worker_*` | Antigravity 原生加载与去重 | 不拦截 `invoke_subagent`,不覆盖 Prompt |
|
|
25
|
+
| **Codex / Qoder CLI** | `SessionStart` 按需提供历史提醒;`UserPromptSubmit` 刷新协调者上下文和包内方法索引;插件挂载 `pbot mcp` | 宿主原生加载 | 含 `agent_id` 的子代理事件直接放行 |
|
|
25
26
|
|
|
26
27
|
所有宿主在 `PBOT_SUBAGENT_RUN_ID` 存在时(作为 ACP worker 运行)自动跳过主会话上下文注入,避免重复叠加。
|
|
27
28
|
|
|
28
29
|
## ACP Worker 上下文
|
|
29
30
|
|
|
30
31
|
- **受管成员(`pi`、`dsh`)**:通过 `src/extension/hosts/pi/acp-member.ts` / `src/extension/hosts/dsh/acp-member.ts` 加载公共约定、`general-purpose` 职责、工作区 `agents/general-purpose.md` 与 `{ host, workspaceRoot, resourceRoot }`,禁止递归调用 `worker_*` / `pbot_history`。
|
|
31
|
-
- **标准 ACP v1 目标(`claude`、`antigravity`、`codex` 及自定义 Harness)**:由 `src/extension/acp/worker.ts` 拼装同一上下文;若对端声明 `sessionCapabilities.systemPrompt` 则在建会话时 append,否则在首轮消息前前置一次(后续轮次不重复)。
|
|
32
|
+
- **标准 ACP v1 目标(`claude`、`antigravity`、`codex`、`qoder` 及自定义 Harness)**:由 `src/extension/acp/worker.ts` 拼装同一上下文;若对端声明 `sessionCapabilities.systemPrompt` 则在建会话时 append,否则在首轮消息前前置一次(后续轮次不重复)。
|
|
@@ -20,8 +20,8 @@ Personal Bot 不绑定单一宿主,所有能力按两条正交主线组织:
|
|
|
20
20
|
|
|
21
21
|
## 保持单向依赖与对称目录维度
|
|
22
22
|
|
|
23
|
-
-
|
|
24
|
-
-
|
|
23
|
+
- 宿主入口与 extension 装配服务和适配器。tools 调用服务,UI 经宿主接口取得业务数据。services 与 integrations 通过 model 共享能力契约,两层分别访问所需存储。直接依赖见[技术设计](design.md),静态边界由 `.dependency-cruiser.cjs` 检查。
|
|
24
|
+
- `src/extension/` 按运行域划分为 `hosts/`、`mcp/`、`acp/`、`history/` 和 `setup/`。宿主与 CLI 在 `history/` 共用历史命令。 `src/integrations/` 按外部集成域划分为 `hosts/`、`acp/` 和 `installation/`。具体宿主在 `hosts/` 下平级建目录。详见[技术设计](design.md)。
|
|
25
25
|
- 资源的创建、状态变更和释放由同一责任主体管理。工具与服务绑定工作区实例,关闭后旧调用失效。
|
|
26
26
|
|
|
27
27
|
## 区分两类文档方法论
|
|
@@ -9,7 +9,7 @@ Personal Bot 复用各宿主的原生 CLI、MCP、认证与权限体系,不额
|
|
|
9
9
|
| CLI 参数、校验、认证 | 原生命令与 profile |
|
|
10
10
|
| 工作区共享 MCP(stdio / HTTP + 环境变量) | 工作区 `.pbot/mcp.json`(Pi/dsh 直接原生挂载;其余宿主经 `workspace_mcp_*` 桥接,二选一不重复暴露;ACP worker 自动透传) |
|
|
11
11
|
| 宿主原生 MCP(全局工具、原生插件/通知、交互式 OAuth 或独占本地资源) | 当前宿主的原生 MCP(与 `.pbot/mcp.json` 单点归属、互不重复注册) |
|
|
12
|
-
| 工作区共享技能 | 工作区 `.agents/skills/<name>/SKILL.md`(Pi/dsh/Antigravity/Codex 原生发现;Claude Code 与通用 ACP worker 自动注入元数据索引) |
|
|
12
|
+
| 工作区共享技能 | 工作区 `.agents/skills/<name>/SKILL.md`(Pi/dsh/Antigravity/Codex/Qoder CLI 原生发现;Claude Code 与通用 ACP worker 自动注入元数据索引) |
|
|
13
13
|
| 数据口径、项目约定与使用经验 | 工作区 `providers/<id>/GUIDE.md` |
|
|
14
14
|
| 跨 Harness 专家委派 | 统一 stdio MCP 服务(`worker_*` 工具集) |
|
|
15
15
|
| 任务范围与必要人工确认 | 用户与协调者模型 |
|
|
@@ -16,7 +16,8 @@ Personal Bot 将跨 Harness 专家调度统一为单一的 stdio MCP 服务(`l
|
|
|
16
16
|
| dsh | 插件启用时通过 `@deepseek-ai/dsh-mcp-client` 自动挂载 | `mcp__pbot__worker_*`(及 `/pbot worker`) |
|
|
17
17
|
| Claude Code | 根 `.mcp.json` 自动挂载 `${CLAUDE_PLUGIN_ROOT}/lib/extension/mcp.js` | `worker_*` |
|
|
18
18
|
| Antigravity | 插件 `mcp_config.json` 自动挂载 `./lib/extension/mcp.js` | `worker_*` |
|
|
19
|
-
| Codex /
|
|
19
|
+
| Codex / Qoder CLI | 插件 `.mcp.json` 自动启动 `pbot mcp` | `worker_*` |
|
|
20
|
+
| Cursor / 其他 MCP 宿主 | 手动配置 stdio MCP 命令 `npx personal-bot@latest mcp`(或 `pbot mcp`) | `worker_*` |
|
|
20
21
|
|
|
21
22
|
## 6 个 MCP 工具契约
|
|
22
23
|
|
|
@@ -70,6 +71,7 @@ worker_close({ "workerId": "<workerId>" })
|
|
|
70
71
|
| `dsh` | DeepSeek dsh | `dsh --profile acp` | `npm install -g @deepseek-ai/dsh@latest`;按 dsh 原生方式配置 profile |
|
|
71
72
|
| `claude` | Claude Code (`claude-code`) | `claude-agent-acp` | `npm install -g @agentclientprotocol/claude-agent-acp`;在 Claude Code 完成登录或 API 配置 |
|
|
72
73
|
| `antigravity` | Google Antigravity (`agy`) | `agy acp` | 安装 Google Antigravity CLI(`agy`)并完成登录 |
|
|
74
|
+
| `qoder` | Qoder CLI (`qodercli`, `qoder-cli`) | `qodercli --acp` | 安装 Qoder CLI 并运行 `qodercli login` |
|
|
73
75
|
| `codex` | OpenAI Codex (`openai-codex`, `codex-cli`) | `codex-acp` | `npm install -g @agentclientprotocol/codex-acp`;在 Codex 完成登录或 API 配置 |
|
|
74
76
|
| 自定义名 | `.pbot/config.json` `acp.<name>` | 自定义命令 | 任意符合 ACP v1 的 stdio 程序,无需修改 Personal Bot 代码 |
|
|
75
77
|
|
package/docs/guides/history.md
CHANGED
|
@@ -3,20 +3,43 @@
|
|
|
3
3
|
所有宿主(Pi、dsh、Claude Code、Antigravity 及自定义插件宿主)共用工作区 `.pbot/history/` 归档原始问答与多维度摘要:
|
|
4
4
|
|
|
5
5
|
- **统一 RAW 采集**:各宿主在主会话输入与回合结束时直接写入 `.pbot/history/raw/`(默认按会话开始时间 UTC `YYYY/MM/` 分层),工具调用、推理与子会话均不写入历史。
|
|
6
|
-
- **独立 Worker
|
|
6
|
+
- **独立 Worker 摘要生成**:所有宿主均可通过 `pbot history summary`(Pi / dsh 也提供 `/pbot history summary`)主动扫描 `.pbot/history/raw/`,为每个待摘要项启动**独立的临时 ACP worker**(默认 `backend: "pi"`,使用 Pi 当前默认模型;带 `PBOT_SUBAGENT_RUN_ID` 隔离,绝不写回 `raw/`,不挂载工作区 MCP/技能,跑完即销毁)。可在 `.pbot/config.json` 的 `summary` 字段中设置 `backend`、`model`、`thinking` 与 `concurrency`;命令行可覆盖前三项。
|
|
7
7
|
- **独立只读搜索**:Pi 与 dsh 提供原生 `pbot_history` 工具(dsh 另提供 Web 工作台“历史”页与 `/pbot history {"action":...}` 命令);Claude Code、Antigravity 与其他插件宿主通过 `pbot` MCP 提供的 `history_search` / `history_read` 检索全部宿主的原始问答与各维度摘要。
|
|
8
8
|
- **开关控制**:在 `.pbot/config.json` 中设置 `features.history: false` 可关闭当前工作区的历史采集、摘要生成与查询入口(默认 `true`)。
|
|
9
9
|
- **启动提醒**:会话启动时自动探测历史目录;当存在未迁移的旧平铺文件(`monthly` 布局下)或原始历史累计满 7 天且近 7 天未更新摘要时,给出一次性轻量提示。
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 所有宿主共用的 CLI
|
|
12
|
+
|
|
13
|
+
全局安装用 `npm install -g personal-bot`,然后运行 `pbot`。临时运行用 `npx --yes personal-bot@<插件的确切版本>` 替换命令中的 `pbot`。CLI 支持 Linux/macOS、Node.js 22.19+ 和 npm;摘要还需要所选 ACP 后端已安装并完成认证。
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pbot init --workspace ~/notes
|
|
17
|
+
pbot status --workspace ~/notes --json
|
|
18
|
+
pbot history status --workspace ~/notes
|
|
19
|
+
pbot history summary --workspace ~/notes
|
|
20
|
+
pbot history search "评审决定" --dimension session --limit 10 --workspace ~/notes --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
每个命令只处理 `--workspace` 指定的根目录,省略时使用进程启动目录。相对路径相对于启动目录。宿主从会话取得根目录后显式传入。工作区未启用、配置损坏或 `features.history: false` 时,历史命令返回错误;只有显式 `init` 才初始化工作区。
|
|
12
24
|
|
|
13
25
|
| 命令 | 作用 |
|
|
14
26
|
| --- | --- |
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
27
|
+
| `pbot init` / `pbot status` | 初始化共享资料并启用工作区,或只读查看根目录、运行版本、各宿主登记的版本和配置 |
|
|
28
|
+
| `pbot history status` / `list` | 查看布局、会话数与各维度已就绪、待处理数量,或列出可用维度 |
|
|
29
|
+
| `pbot history summary [维度...] [--force] [--backend <acp>] [--model <模型>] [--thinking <级别>]` | 默认增量整理;`--force` 强制重建。默认年月布局依次整理会话和月度摘要 |
|
|
30
|
+
| `pbot history migrate [--dry-run]` | 预览或显式迁移旧平铺文件;保留冲突目标,报告逐项结果 |
|
|
31
|
+
| `pbot history search [关键词]` | 省略关键词列会话,支持 `--host`、`--dimension`、`--session-id`、`--from`、`--to`、`--offset` 和 `--limit` |
|
|
32
|
+
| `pbot history read <节点ID>` | 按搜索结果 ID 读取正文及上下级,支持 `--host`、`--offset`、`--limit` 与 `--children-offset` |
|
|
33
|
+
|
|
34
|
+
CLI 默认输出缩进 JSON;`--json` 输出单行 JSON 到 stdout,生成进度和诊断进入 stderr。摘要有失败项、迁移有错误或目标冲突时,退出码非零,逐项报告仍在 stdout。按 Ctrl-C 取消,已发布的摘要可供下次增量运行复用。Pi 和 dsh 保留原有 `/pbot history` 命令和 JSON 查询语法。
|
|
35
|
+
|
|
36
|
+
### CLI 版本选择
|
|
37
|
+
|
|
38
|
+
显式运行 `init` 或在已启用的工作区执行命令时,CLI 从目标根目录的 npm、Pi 本地安装清单和宿主登记的插件中取最高版本。配置缺失、停用或损坏时,`status` 用当前 CLI 报告配置,`plugins` 为空对象,`minimumCliVersion` 为 `null`。关闭 `features.history` 后,历史命令直接报告功能已停用。`pbot --version` 显示当前 CLI 的版本,`pbot --at-least <版本>` 在本地比较版本,满足要求时返回 0。
|
|
39
|
+
|
|
40
|
+
宿主按用户、规范化工作区路径和宿主名,将插件绑定保存在 `~/.pbot/workspaces/`。目录只读时宿主仍可运行。CLI 重读可访问的绑定和安装清单,跳过已移除的清单。只提供发布版本的轻插件在下次绑定时刷新记录。宿主也可通过 `PBOT_PLUGIN_VERSION` 传入其确切版本。
|
|
41
|
+
|
|
42
|
+
满足最低版本时直接运行。版本不足时,npm 管理的全局安装会原位更新到所需版本,再按原参数和工作目录执行。项目依赖、npm link、npx 安装以及另一个进程正在更新或无法加锁的全局前缀,使用 npm 的版本缓存自动安装或复用所需版本,保留项目依赖与锁文件。更新失败时返回非零,原操作停止。已有 0.3.2 及更早的全局启动器需要先安装一次带升级功能的版本,或直接使用新版插件给出的精确版本 npx 命令。
|
|
20
43
|
|
|
21
44
|
## 可选历史与摘要配置(`.pbot/config.json`)
|
|
22
45
|
|
|
@@ -6,13 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
| 宿主 | 初始化 | 状态 |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
+
| 所有宿主 / 终端 | `pbot init [--workspace <目录>]` | `pbot status [--workspace <目录>]` |
|
|
9
10
|
| Pi | `/pbot init` | `/pbot status` |
|
|
10
11
|
| dsh | `/pbot init` 或 Web 工作区页按钮 | `/pbot status` 或 Web 工作区页 |
|
|
11
12
|
| Claude Code | `/personal-bot:pbot init`(或 `lib/claude.js init`) | `/personal-bot:pbot status` |
|
|
13
|
+
| Codex / Qoder CLI | `pbot plugin <codex或qoder> init` | `pbot plugin <codex或qoder> status` |
|
|
12
14
|
| Antigravity | `/pbot init`(或 `lib/plugin.js antigravity init`) | `/pbot status` |
|
|
13
15
|
|
|
14
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`)、已设置的开关/摘要配置及其他未知配置字段;配置文件损坏时先报错而不覆写。
|
|
15
17
|
|
|
18
|
+
## 统一升级工作区多宿主插件
|
|
19
|
+
|
|
20
|
+
当同一工作区交替使用多个宿主(如 Claude Code、Codex、Pi、Antigravity、Qoder CLI、dsh)时,各宿主激活后会在 `~/.pbot/workspaces/<工作区hash>/` 记录绑定版本;若检测到版本不一致,`pbot status` 会标记 `outOfSync: true`,会话启动时也会提示同步。在终端执行:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pbot upgrade [--workspace <目录>] [--version <版本>] [--hosts <h1,h2>] [--dsh-profile <名称>] [--json]
|
|
24
|
+
# 等价别名
|
|
25
|
+
pbot update [--workspace <目录>]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- 默认将全局 `pbot` CLI 与当前工作区已绑定的宿主插件统一升级到 npm 最新稳定版(本地开发或 `npm link` 安装跳过全局 CLI 覆盖)。
|
|
29
|
+
- 遵循最小影响原则:仅处理当前工作区已绑定的宿主并保留既有安装作用域(Pi 仅更新工作区 `--local` 的 `personal-bot`、非 npm 自定义来源跳过;Claude 保留原有的 `local`/`project`/`user` 作用域;dsh 自动从绑定路径识别 profile 或通过 `--dsh-profile` 指定,不强杀运行中的服务)。
|
|
30
|
+
|
|
16
31
|
## 启用、模块开关(`features`)与停用规则
|
|
17
32
|
|
|
18
33
|
```json
|
|
@@ -61,7 +76,9 @@
|
|
|
61
76
|
}
|
|
62
77
|
```
|
|
63
78
|
|
|
64
|
-
|
|
79
|
+
`pbot mcp list` 读取配置。`add` 与 `remove` 使用短时目录锁 `.pbot/mcp.json.lock` 串行更新服务项。若进程异常退出并遗留锁,先确认操作该文件的命令都已结束,再用 `rmdir .pbot/mcp.json.lock` 清理空锁目录。
|
|
80
|
+
|
|
81
|
+
启用 `features.mcp`(默认)后,原生挂载与桥接工具二选一,避免同一服务重复暴露:
|
|
65
82
|
- Pi 与 dsh 直接通过原生 API 挂载 `.pbot/mcp.json` 中的服务(不再暴露 `workspace_mcp_*` 桥接工具);
|
|
66
83
|
- 轻插件宿主(Claude Code、Antigravity)及其他 MCP 宿主通过 `pbot` MCP 提供的 `workspace_mcp_discover` / `workspace_mcp_call` 动态发现并调用(修改 `.pbot/mcp.json` 即改即生效);
|
|
67
84
|
- 跨 Harness ACP worker 自动通过 ACP v1 `mcpServers`(或 Pi/dsh 受管成员原生挂载)获得同一组服务。
|
|
@@ -96,7 +113,7 @@
|
|
|
96
113
|
|
|
97
114
|
## 历史目录布局与摘要配置(`history` / `summary`)
|
|
98
115
|
|
|
99
|
-
|
|
116
|
+
历史配置决定存储布局,以及 `pbot history summary` 使用的 ACP 后端、模型与并发度。Pi 和 dsh 的 `/pbot history summary` 读取同一配置。默认布局为 `monthly`,默认后端为 `pi`,模型沿用后端默认值。
|
|
100
117
|
|
|
101
118
|
```json
|
|
102
119
|
{
|
|
@@ -115,7 +132,7 @@
|
|
|
115
132
|
|
|
116
133
|
- `history.layout` 可选 `"monthly"`(默认,按 UTC `YYYY/MM/` 分层并启用 `monthly` 月度汇总)或 `"flat"`(平铺布局,不生成月度汇总)。已有平铺工作区可手工执行 `/pbot history migrate` 整理历史文件,不会自动修改此文件或静默迁移数据。
|
|
117
134
|
- 每个待摘要项独立启动一个临时 ACP worker(附带 `PBOT_SUBAGENT_RUN_ID`,绝不写回 `raw/`),完成后立即销毁。
|
|
118
|
-
- 修改后下次执行
|
|
135
|
+
- 修改后下次执行 `pbot history summary` 即生效,也可用 `--backend`、`--model`、`--thinking` 临时覆盖。
|
|
119
136
|
|
|
120
137
|
## 手工修改生效方式
|
|
121
138
|
|
|
@@ -41,7 +41,7 @@ node /path/to/installed/personal-bot/lib/plugin.js antigravity status
|
|
|
41
41
|
- 同宿主子任务与多成员协作直接使用 Antigravity 原生 `invoke_subagent`(`self`、`research` 等)与 `/swarm`,Personal Bot 不注入自定义静态 agent 也不改写 `invoke_subagent` 参数;
|
|
42
42
|
- 跨 Harness 调度(调用 `claude`、`codex`、`pi`、`dsh` 或自定义 ACP 目标)通过插件内置 `mcp_config.json` 挂载的 `pbot` stdio MCP 服务(`worker_*` 工具集)完成,详见[跨 Harness 专家调度](../guides/cross-harness-workers.md)。
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- **历史归档**使用 `Stop` hook 将主会话问答写入 `.pbot/history/raw/`。运行 `pbot history summary` 生成摘要,用 MCP 工具 `history_search` 和 `history_read` 检索各宿主的归档。`features.history: false` 可关闭历史功能。详见[历史与 CLI 指南](../guides/history.md)。
|
|
45
45
|
|
|
46
46
|
## MCP 与开发校验
|
|
47
47
|
|
|
@@ -34,7 +34,7 @@ node /absolute/path/to/personal-bot/lib/claude.js status
|
|
|
34
34
|
- **同宿主 vs 跨 Harness 互补**:
|
|
35
35
|
- 同宿主任务与团队协作直接使用 Claude 原生 `Agent` 及原生团队(用户自行管理 `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`);
|
|
36
36
|
- 跨 Harness 调度(调用 `antigravity`、`codex`、`pi`、`dsh` 或自定义 ACP 目标)通过 [.mcp.json](../../.mcp.json) 自动挂载的 `pbot` stdio MCP 服务(`worker_*` 工具集)完成,详见[跨 Harness 专家调度](../guides/cross-harness-workers.md)。
|
|
37
|
-
-
|
|
37
|
+
- **历史归档**使用 `UserPromptSubmit` 与 `Stop` hook 将主会话问答写入 `.pbot/history/raw/`,跳过带 `agent_id` 的原生子代理。运行 `pbot history summary` 生成摘要,用 MCP 工具 `history_search` 和 `history_read` 检索各宿主的归档。`features.history: false` 可关闭历史功能。详见[历史与 CLI 指南](../guides/history.md)。
|
|
38
38
|
|
|
39
39
|
## 本地开发与校验
|
|
40
40
|
|