personal-bot 0.3.1 → 0.3.3
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 +27 -11
- package/bin/pbot.mjs +22 -2
- package/docs/README.md +3 -1
- package/docs/architecture/design.md +37 -24
- package/docs/architecture/extensibility.md +27 -19
- package/docs/architecture/model-context.md +4 -3
- package/docs/architecture/principles.md +5 -4
- package/docs/guides/capabilities.md +4 -4
- package/docs/guides/cross-harness-workers.md +3 -1
- package/docs/guides/history.md +73 -16
- package/docs/guides/workspace-configuration.md +35 -6
- package/docs/hosts/antigravity.md +2 -0
- package/docs/hosts/claude-code.md +1 -1
- package/docs/hosts/codex-qoder.md +63 -0
- package/docs/hosts/dsh.md +1 -1
- package/docs/hosts/pi.md +1 -1
- package/docs/maintainers/architecture-governance.md +78 -0
- package/hooks/hooks.json +3 -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/hooks.json +7 -0
- package/lib/antigravity-plugin/lib/claude.js +2 -2
- 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/{extension/acp-member.d.ts → antigravity-plugin/lib/extension/acp/member.d.ts} +5 -5
- package/lib/{extension/acp-member.js → antigravity-plugin/lib/extension/acp/member.js} +6 -6
- package/lib/antigravity-plugin/lib/extension/acp-worker.js +222 -51
- 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/{extension → antigravity-plugin/lib/extension/hosts}/dsh/acp-member.js +11 -25
- package/lib/{extension → antigravity-plugin/lib/extension/hosts}/dsh/files.js +3 -3
- 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 +12 -0
- package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +101 -0
- 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 +2705 -1348
- package/lib/antigravity-plugin/lib/extension/workspace-cli.js +20127 -0
- package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +1 -0
- package/lib/antigravity-plugin/lib/integrations/agent-resources.js +6 -2
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.d.ts +6 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity/adapter.js +171 -0
- package/lib/antigravity-plugin/lib/integrations/hosts/{claude.d.ts → claude/adapter.d.ts} +1 -1
- package/lib/antigravity-plugin/lib/integrations/hosts/claude/adapter.js +36 -0
- 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/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/mcp.d.ts +1 -1
- package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/resources.d.ts +1 -1
- package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/resources.js +4 -4
- package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/skills.js +1 -1
- 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/{registry.d.ts → plugin-registry.d.ts} +1 -0
- package/lib/{integrations/hosts/registry.js → antigravity-plugin/lib/integrations/hosts/plugin-registry.js} +10 -3
- 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 +179 -0
- package/lib/antigravity-plugin/lib/model/history.js +4 -0
- package/lib/antigravity-plugin/lib/model/plugin-host.d.ts +31 -0
- package/lib/antigravity-plugin/lib/model/workspace-config.d.ts +28 -7
- 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 +4 -4
- package/lib/antigravity-plugin/lib/services/history/history-capture.d.ts +4 -0
- package/lib/antigravity-plugin/lib/services/history/history-capture.js +98 -0
- package/lib/antigravity-plugin/lib/services/history/history-index.d.ts +17 -0
- package/lib/antigravity-plugin/lib/services/history/history-index.js +112 -0
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.d.ts +7 -0
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/monthly.js +121 -0
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.d.ts +7 -0
- package/lib/antigravity-plugin/lib/services/history/summary-dimensions/session.js +124 -0
- package/lib/antigravity-plugin/lib/services/history/summary-registry.d.ts +7 -0
- package/lib/antigravity-plugin/lib/services/history/summary-registry.js +35 -0
- package/lib/antigravity-plugin/lib/services/history/summary-runner.d.ts +34 -0
- package/lib/antigravity-plugin/lib/services/history/summary-runner.js +299 -0
- 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 +3 -0
- package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +78 -0
- package/lib/antigravity-plugin/lib/services/workspace/workspace-config.d.ts +5 -1
- package/lib/antigravity-plugin/lib/services/workspace/workspace-config.js +77 -7
- 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/file-access.d.ts +2 -0
- package/lib/antigravity-plugin/lib/storage/file-access.js +26 -0
- package/lib/antigravity-plugin/lib/storage/history-files.d.ts +55 -0
- package/lib/antigravity-plugin/lib/storage/history-files.js +473 -0
- package/lib/antigravity-plugin/lib/storage/history-format.d.ts +5 -0
- package/lib/antigravity-plugin/lib/storage/history-format.js +60 -0
- 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/antigravity-plugin/skills/provider-connections/SKILL.md +22 -12
- package/lib/claude.js +2 -2
- package/lib/client.js +42 -60
- 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 +6 -6
- package/lib/extension/acp/member.d.ts +18 -0
- package/lib/extension/acp/member.js +44 -0
- package/lib/extension/acp/worker.js +384 -0
- package/lib/extension/acp-worker.js +222 -51
- 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.d.ts +4 -0
- package/lib/extension/hosts/dsh/acp-member.js +58 -0
- package/lib/extension/{dsh → hosts/dsh}/command.d.ts +1 -2
- package/lib/extension/{dsh → hosts/dsh}/command.js +9 -11
- package/lib/extension/hosts/dsh/files.d.ts +5 -0
- package/lib/extension/hosts/dsh/files.js +67 -0
- package/lib/extension/hosts/dsh/history.d.ts +4 -0
- package/lib/extension/hosts/dsh/history.js +62 -0
- package/lib/extension/{dsh → hosts/dsh}/management.d.ts +1 -1
- package/lib/extension/{dsh → hosts/dsh}/management.js +12 -10
- package/lib/extension/{dsh → hosts/dsh}/workspace.d.ts +3 -9
- package/lib/extension/{dsh → hosts/dsh}/workspace.js +30 -99
- 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 +12 -0
- package/lib/extension/hosts/plugin-runtime.js +101 -0
- 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 → mcp/bridge.d.ts} +7 -9
- package/lib/extension/{mcp-bridge.js → mcp/bridge.js} +70 -88
- package/lib/extension/{mcp-workers.d.ts → mcp/tool-contract.d.ts} +129 -374
- package/lib/extension/mcp/tool-contract.js +441 -0
- package/lib/extension/mcp/workers.d.ts +487 -0
- package/lib/extension/mcp/workers.js +598 -0
- package/lib/extension/mcp.js +2705 -1348
- package/lib/extension/{setup-cli.js → setup/cli.js} +12 -9
- package/lib/extension/workspace-cli.js +20127 -0
- package/lib/integrations/acp/agents.d.ts +2 -3
- package/lib/integrations/acp/connection.d.ts +11 -10
- package/lib/integrations/acp/connection.js +6 -0
- package/lib/integrations/acp/harnesses/claude.js +1 -1
- package/lib/integrations/acp/harnesses/dsh.js +1 -1
- package/lib/integrations/acp/harnesses/presets.js +8 -0
- package/lib/integrations/acp/history-summary.d.ts +17 -0
- package/lib/integrations/acp/history-summary.js +101 -0
- package/lib/integrations/acp/launch.d.ts +2 -2
- package/lib/integrations/agent-resources.d.ts +1 -0
- package/lib/integrations/agent-resources.js +6 -2
- package/lib/integrations/hosts/antigravity/adapter.d.ts +6 -0
- package/lib/integrations/hosts/antigravity/adapter.js +171 -0
- package/lib/integrations/hosts/{claude.d.ts → claude/adapter.d.ts} +1 -1
- package/lib/integrations/hosts/claude/adapter.js +36 -0
- package/lib/integrations/hosts/codex/adapter.d.ts +2 -0
- package/lib/integrations/hosts/codex/adapter.js +14 -0
- package/lib/integrations/hosts/dsh/mcp.d.ts +4 -0
- package/lib/integrations/hosts/dsh/mcp.js +28 -0
- package/lib/integrations/hosts/dsh/messages.d.ts +36 -0
- package/lib/integrations/hosts/dsh/messages.js +11 -0
- package/lib/integrations/hosts/dsh/resources.d.ts +6 -0
- package/lib/integrations/hosts/dsh/resources.js +47 -0
- package/lib/integrations/hosts/dsh/root-agents.d.ts +4 -0
- package/lib/integrations/hosts/dsh/root-agents.js +3 -0
- package/lib/integrations/{dsh → hosts/dsh}/schema.js +1 -1
- package/lib/integrations/hosts/dsh/skills.d.ts +8 -0
- package/lib/integrations/hosts/dsh/skills.js +31 -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/{registry.d.ts → plugin-registry.d.ts} +1 -0
- package/lib/{antigravity-plugin/lib/integrations/hosts/registry.js → integrations/hosts/plugin-registry.js} +10 -3
- 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/pi-setup.js +1 -1
- 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 +143 -34
- package/lib/model/history.js +4 -1
- package/lib/model/installation.js +1 -0
- package/lib/model/plugin-host.d.ts +31 -0
- package/lib/model/workspace-config.d.ts +28 -7
- package/lib/model/workspace-config.js +2 -1
- package/lib/plugin.d.ts +2 -1
- package/lib/plugin.js +4 -4
- 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-run.d.ts +1 -1
- 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.d.ts +4 -0
- package/lib/services/history/history-capture.js +98 -0
- package/lib/services/history/history-index.d.ts +16 -7
- package/lib/services/history/history-index.js +48 -70
- package/lib/services/history/history-migrate.d.ts +12 -0
- package/lib/services/history/history-migrate.js +54 -0
- package/lib/services/history/history-query.d.ts +51 -0
- package/lib/services/history/history-query.js +352 -0
- package/lib/services/history/summary-command.d.ts +20 -0
- package/lib/services/history/summary-command.js +69 -0
- package/lib/services/history/summary-dimensions/monthly.d.ts +7 -0
- package/lib/services/history/summary-dimensions/monthly.js +121 -0
- package/lib/services/history/summary-dimensions/session.d.ts +7 -0
- package/lib/services/history/summary-dimensions/session.js +124 -0
- package/lib/services/history/summary-registry.d.ts +7 -0
- package/lib/services/history/summary-registry.js +35 -0
- package/lib/services/history/summary-runner.d.ts +34 -0
- package/lib/services/history/summary-runner.js +299 -0
- package/lib/services/history/workspace-history.d.ts +3 -0
- package/lib/services/history/workspace-history.js +6 -0
- package/lib/services/workspace/plugin-releases.d.ts +3 -0
- package/lib/services/workspace/plugin-releases.js +78 -0
- package/lib/services/workspace/workspace-config.d.ts +5 -1
- package/lib/services/workspace/workspace-config.js +77 -7
- 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 +46 -9
- package/lib/storage/history-files.js +382 -250
- package/lib/storage/history-format.d.ts +3 -13
- package/lib/storage/history-format.js +26 -52
- package/lib/tools/history/actions.d.ts +3 -68
- package/lib/tools/history/actions.js +7 -5
- package/lib/tools/history/contract.d.ts +16 -17
- package/lib/tools/history/contract.js +63 -22
- package/lib/tools/history/dsh-tool.d.ts +1 -2
- package/lib/tools/history/dsh-tool.js +11 -5
- package/lib/ui/dsh/elements.d.ts +2 -5
- package/lib/ui/dsh/elements.js +3 -16
- package/lib/ui/dsh/management.js +26 -13
- 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 +2 -1
- package/resources/prompts/history-monthly-summary.md +13 -0
- package/resources/prompts/history-summary.md +10 -4
- package/resources/prompts/plugin-coordinator.md +1 -0
- package/resources/skills/provider-connections/SKILL.md +22 -12
- package/scripts/README.md +3 -2
- package/src/claude.ts +2 -2
- package/src/common/validation.ts +10 -0
- package/src/dsh.ts +6 -6
- package/src/extension/{acp-member.ts → acp/member.ts} +7 -7
- package/src/extension/{acp-worker.ts → acp/worker.ts} +131 -17
- package/src/extension/history/command.ts +68 -0
- package/src/extension/hosts/dsh/acp-entry.ts +21 -0
- package/src/extension/{dsh → hosts/dsh}/acp-member.ts +12 -23
- package/src/extension/{dsh → hosts/dsh}/command.ts +10 -12
- package/src/extension/{dsh → hosts/dsh}/files.ts +3 -3
- package/src/extension/hosts/dsh/history.ts +67 -0
- package/src/extension/{dsh → hosts/dsh}/management.ts +11 -9
- package/src/extension/{dsh → hosts/dsh}/workspace.ts +31 -76
- package/src/extension/{pi-acp-member.ts → hosts/pi/acp-member.ts} +12 -18
- package/src/extension/{command.ts → hosts/pi/command.ts} +44 -11
- package/src/extension/{events.ts → hosts/pi/events.ts} +8 -4
- package/src/extension/hosts/pi/history.ts +45 -0
- package/src/extension/{lifecycle.ts → hosts/pi/lifecycle.ts} +9 -12
- package/src/extension/hosts/plugin-runtime.ts +96 -0
- package/src/extension/hosts/workspace-mcp.ts +25 -0
- package/src/extension/{mcp-bridge.ts → mcp/bridge.ts} +85 -85
- package/src/extension/mcp/tool-contract.ts +462 -0
- package/src/extension/{mcp-workers.ts → mcp/workers.ts} +151 -448
- package/src/extension/{setup-cli.ts → setup/cli.ts} +14 -11
- package/src/extension/setup/workspace-cli.ts +159 -0
- package/src/integrations/acp/agents.ts +2 -3
- package/src/integrations/acp/connection.ts +6 -0
- package/src/integrations/acp/harnesses/claude.ts +1 -1
- 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 +109 -0
- package/src/integrations/agent-resources.ts +7 -1
- package/src/integrations/hosts/antigravity/adapter.ts +161 -0
- package/src/integrations/hosts/claude/adapter.ts +39 -0
- package/src/integrations/hosts/codex/adapter.ts +16 -0
- package/src/integrations/{dsh → hosts/dsh}/mcp.ts +1 -1
- package/src/integrations/{dsh → hosts/dsh}/resources.ts +5 -5
- package/src/integrations/{dsh → hosts/dsh}/schema.ts +1 -1
- package/src/integrations/{dsh → hosts/dsh}/session.ts +2 -2
- package/src/integrations/{dsh → hosts/dsh}/skills.ts +1 -1
- package/src/integrations/{pi → hosts/pi}/mcp.ts +1 -1
- package/src/integrations/{pi → hosts/pi}/skills.ts +1 -1
- package/src/integrations/hosts/{registry.ts → plugin-registry.ts} +11 -3
- 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 +116 -0
- package/src/integrations/installation/pi-bridge.ts +1 -1
- package/src/integrations/installation/pi-setup.ts +2 -2
- package/src/integrations/installation/processes.ts +1 -1
- package/src/mcp.ts +1 -1
- package/src/model/acp.ts +11 -3
- package/src/model/agent.ts +20 -4
- package/src/model/history.ts +156 -26
- package/src/model/installation.ts +41 -0
- package/src/model/plugin-host.ts +30 -2
- package/src/model/workspace-config.ts +31 -7
- package/src/pbot.ts +22 -50
- package/src/plugin.ts +4 -4
- package/src/services/agents/agent-service.ts +29 -17
- package/src/services/history/history-capture.ts +91 -0
- package/src/services/history/history-index.ts +48 -62
- package/src/services/history/history-migrate.ts +62 -0
- package/src/services/history/history-query.ts +401 -0
- package/src/services/history/summary-command.ts +70 -0
- package/src/services/history/summary-dimensions/monthly.ts +139 -0
- package/src/services/history/summary-dimensions/session.ts +149 -0
- package/src/services/history/summary-registry.ts +43 -0
- package/src/services/history/summary-runner.ts +343 -0
- package/src/services/history/workspace-history.ts +8 -0
- package/src/services/installation/setup-service.ts +2 -41
- package/src/services/workspace/plugin-releases.ts +68 -0
- package/src/services/workspace/workspace-config.ts +95 -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 +416 -189
- package/src/storage/history-format.ts +45 -61
- package/src/tools/history/actions.ts +8 -6
- package/src/tools/history/contract.ts +70 -25
- package/src/tools/history/dsh-tool.ts +17 -8
- package/src/tools/history/pi-tool.ts +23 -0
- package/src/ui/dsh/elements.ts +5 -12
- package/src/ui/dsh/management.ts +36 -20
- package/src/ui/dsh/styles.ts +5 -33
- package/src/ui/{confirmation.ts → pi/confirmation.ts} +1 -1
- package/lib/antigravity-plugin/lib/extension/plugin-runtime.d.ts +0 -10
- package/lib/antigravity-plugin/lib/extension/plugin-runtime.js +0 -67
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.d.ts +0 -4
- package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.js +0 -79
- package/lib/antigravity-plugin/lib/integrations/hosts/claude.js +0 -60
- package/lib/extension/dsh/history.d.ts +0 -15
- package/lib/extension/dsh/history.js +0 -87
- package/lib/extension/mcp-workers.js +0 -882
- package/lib/extension/plugin-runtime.d.ts +0 -10
- package/lib/extension/plugin-runtime.js +0 -67
- package/lib/integrations/dsh/history-summary.d.ts +0 -11
- package/lib/integrations/dsh/history-summary.js +0 -36
- package/lib/integrations/dsh/history.d.ts +0 -16
- package/lib/integrations/dsh/history.js +0 -167
- package/lib/integrations/history-summary.d.ts +0 -4
- package/lib/integrations/history-summary.js +0 -32
- package/lib/integrations/hosts/antigravity.d.ts +0 -4
- package/lib/integrations/hosts/antigravity.js +0 -79
- package/lib/integrations/hosts/claude.js +0 -60
- package/lib/services/history/history-service.d.ts +0 -106
- package/lib/services/history/history-service.js +0 -242
- package/lib/storage/acp-history.d.ts +0 -10
- package/lib/storage/acp-history.js +0 -57
- package/lib/ui/presentation.d.ts +0 -3
- package/lib/ui/presentation.js +0 -12
- package/src/extension/dsh/history.ts +0 -74
- package/src/extension/history.ts +0 -26
- package/src/extension/plugin-runtime.ts +0 -63
- package/src/integrations/dsh/history-summary.ts +0 -39
- package/src/integrations/dsh/history.ts +0 -84
- package/src/integrations/history-summary.ts +0 -30
- package/src/integrations/hosts/antigravity.ts +0 -83
- package/src/integrations/hosts/claude.ts +0 -62
- package/src/integrations/pi/history.ts +0 -99
- package/src/services/history/history-service.ts +0 -195
- package/src/storage/acp-history.ts +0 -49
- package/src/tools/access.ts +0 -7
- package/src/tools/history/tool.ts +0 -19
- package/src/tools/register.ts +0 -22
- package/src/ui/presentation.ts +0 -12
- /package/lib/{extension → antigravity-plugin/lib/extension/hosts}/dsh/acp-member.d.ts +0 -0
- /package/lib/{extension → antigravity-plugin/lib/extension/hosts}/dsh/files.d.ts +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/mcp.js +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/messages.d.ts +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/messages.js +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/root-agents.d.ts +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/root-agents.js +0 -0
- /package/lib/{integrations → antigravity-plugin/lib/integrations/hosts}/dsh/skills.d.ts +0 -0
- /package/lib/extension/{acp-worker.d.ts → acp/worker.d.ts} +0 -0
- /package/lib/extension/{setup-guard.js → setup/guard.js} +0 -0
- /package/lib/integrations/acp/{claude.d.ts → claude-settings.d.ts} +0 -0
- /package/lib/integrations/acp/{claude.js → claude-settings.js} +0 -0
- /package/lib/integrations/{dsh → hosts/dsh}/schema.d.ts +0 -0
- /package/src/extension/{setup-guard.ts → setup/guard.ts} +0 -0
- /package/src/integrations/acp/{claude.ts → claude-settings.ts} +0 -0
- /package/src/integrations/{dsh → hosts/dsh}/messages.ts +0 -0
- /package/src/integrations/{dsh → hosts/dsh}/root-agents.ts +0 -0
- /package/src/integrations/{pi → hosts/pi}/agent-tools.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parsePatch } from "@deepseek-ai/dsh-fs-patch";
|
|
2
|
-
import { object } from "
|
|
3
|
-
import { requireThat } from "
|
|
4
|
-
import { mutationScope } from "
|
|
2
|
+
import { object } from "../../../common/json.js";
|
|
3
|
+
import { requireThat } from "../../../common/validation.js";
|
|
4
|
+
import { mutationScope } from "../../../services/workspace/workspace-files.js";
|
|
5
5
|
/** Native filesystem mutations share the original workspace's confirmation rule.
|
|
6
6
|
* This does not confine Bash, Python, MCP, or other extensions. */
|
|
7
7
|
export function registerDshFileEvents(ctx, agent, root, expert, check) {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { isMcpWorkerTool } from "../../../model/acp.js";
|
|
5
|
+
import { acpMember } from "../../acp/member.js";
|
|
6
|
+
import { agentFileTools } from "../../../integrations/hosts/pi/agent-tools.js";
|
|
7
|
+
import { toPiMcpConfig } from "../../../integrations/hosts/pi/mcp.js";
|
|
8
|
+
import { authorizeMutation } from "../../../services/workspace/workspace-files.js";
|
|
9
|
+
import { loadNativeWorkspaceServers } from "../workspace-mcp.js";
|
|
10
|
+
import { resourceRoot } from "../../../common/paths.js";
|
|
11
|
+
import { launch } from "../../../storage/agent-files.js";
|
|
12
|
+
import { requireThat } from "../../../common/validation.js";
|
|
13
|
+
const isBlockedTool = (name) => name === "pbot_history" || isMcpWorkerTool(name);
|
|
14
|
+
/** Member resources and authoritative final answers; ACP owns input delivery. */
|
|
15
|
+
export default async function piAcpMember(pi) {
|
|
16
|
+
const member = await acpMember(), lifetime = new AbortController();
|
|
17
|
+
const registeredMcp = [];
|
|
18
|
+
let input, startLeaf = null;
|
|
19
|
+
const checkSession = (ctx) => {
|
|
20
|
+
const reference = member.files.reference(member.id);
|
|
21
|
+
requireThat(reference.host === "acp" && reference.backend === "pi" && realpathSync(ctx.cwd) === member.d.cwd &&
|
|
22
|
+
(reference.sessionId === null || reference.sessionId === ctx.sessionManager.getSessionId()), "Pi ACP 会话身份或工作目录不匹配。");
|
|
23
|
+
};
|
|
24
|
+
const workspaceMcpServers = [];
|
|
25
|
+
if (member.features.mcp && process.env.PBOT_ACP_VALIDATE !== "1") {
|
|
26
|
+
await loadNativeWorkspaceServers(member.d.workspace, server => { workspaceMcpServers.push(server); });
|
|
27
|
+
}
|
|
28
|
+
pi.on("resources_discover", async () => {
|
|
29
|
+
if (!member.features.skills || member.d.options.noSkills)
|
|
30
|
+
return {};
|
|
31
|
+
const skillPaths = [join(resourceRoot, "skills")], workspaceSkills = join(member.d.workspace, ".agents/skills");
|
|
32
|
+
try {
|
|
33
|
+
if ((await stat(workspaceSkills)).isDirectory())
|
|
34
|
+
skillPaths.push(workspaceSkills);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (error.code !== "ENOENT")
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
return { skillPaths };
|
|
41
|
+
});
|
|
42
|
+
pi.on("session_start", (_event, ctx) => {
|
|
43
|
+
checkSession(ctx);
|
|
44
|
+
const active = pi.getActiveTools();
|
|
45
|
+
for (const tool of agentFileTools(member.d.cwd, lifetime.signal, async (path, change, signal) => {
|
|
46
|
+
member.check();
|
|
47
|
+
await authorizeMutation(member.d.workspace, path, change, async () => false, signal);
|
|
48
|
+
member.check();
|
|
49
|
+
}))
|
|
50
|
+
pi.registerTool(tool);
|
|
51
|
+
for (const server of workspaceMcpServers) {
|
|
52
|
+
pi.registerMcpServer(server.name, toPiMcpConfig(server));
|
|
53
|
+
registeredMcp.push(server.name);
|
|
54
|
+
}
|
|
55
|
+
pi.setActiveTools(active.filter(name => !isBlockedTool(name)));
|
|
56
|
+
pi.setSessionName(member.files.read(member.id, "launch.json", launch).name);
|
|
57
|
+
startLeaf = ctx.sessionManager.getLeafId();
|
|
58
|
+
});
|
|
59
|
+
pi.on("before_agent_start", async (event, ctx) => {
|
|
60
|
+
try {
|
|
61
|
+
checkSession(ctx);
|
|
62
|
+
const current = member.input();
|
|
63
|
+
if (current.requestId !== input?.requestId) {
|
|
64
|
+
input = current;
|
|
65
|
+
startLeaf = ctx.sessionManager.getLeafId();
|
|
66
|
+
}
|
|
67
|
+
if (!member.features.prompts)
|
|
68
|
+
return;
|
|
69
|
+
const context = await member.context();
|
|
70
|
+
member.check();
|
|
71
|
+
Object.assign(event.systemPromptOptions.sections, { pbot_workspace: context.workspace, pbot_child: context.role, pbot_environment: context.environment });
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
ctx.abort();
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
pi.on("tool_call", event => {
|
|
79
|
+
member.check();
|
|
80
|
+
if (isBlockedTool(event.toolName))
|
|
81
|
+
return { block: true, reason: "专家不提供协调管理工具。" };
|
|
82
|
+
return;
|
|
83
|
+
});
|
|
84
|
+
pi.on("agent_settled", (event, ctx) => {
|
|
85
|
+
if (!input)
|
|
86
|
+
return;
|
|
87
|
+
const branch = ctx.sessionManager.getBranch(), at = startLeaf === null ? -1 : branch.findIndex(entry => entry.id === startLeaf);
|
|
88
|
+
const last = branch.slice(at + 1).findLast(entry => entry.type === "message" && entry.message.role === "assistant");
|
|
89
|
+
const assistant = last?.type === "message" && last.message.role === "assistant" ? last.message : undefined;
|
|
90
|
+
const answer = assistant?.content.filter(block => block.type === "text").map(block => block.text).join("\n") ?? "";
|
|
91
|
+
member.answer(input, event.aborted ? "cancelled" : assistant?.stopReason === "stop" ? "completed" : "failed", answer, assistant?.errorMessage);
|
|
92
|
+
});
|
|
93
|
+
pi.on("session_before_switch", () => ({ cancel: true }));
|
|
94
|
+
pi.on("session_before_fork", () => ({ cancel: true }));
|
|
95
|
+
pi.on("session_shutdown", () => {
|
|
96
|
+
for (const name of registeredMcp.splice(0))
|
|
97
|
+
pi.unregisterMcpServer(name);
|
|
98
|
+
lifetime.abort();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginHostAdapter } from "../../model/plugin-host.js";
|
|
2
|
+
export declare function pluginCommand(adapter: PluginHostAdapter, args: readonly string[], cwd: string): Promise<{
|
|
3
|
+
version: string;
|
|
4
|
+
workspaceRoot: string;
|
|
5
|
+
resourceRoot: string;
|
|
6
|
+
configuration: import("../../model/workspace-config.js").WorkspaceConfiguration;
|
|
7
|
+
}>;
|
|
8
|
+
export type ReplayPluginHook = (root: string, input: string) => Promise<number | undefined>;
|
|
9
|
+
export declare function runPluginHost(adapter: PluginHostAdapter, args: readonly string[], replay?: ReplayPluginHook): Promise<void>;
|
|
10
|
+
/** Shared hook execution engine; host-specific protocols stay in PluginHostAdapter implementations. */
|
|
11
|
+
export declare function pluginHook(adapter: PluginHostAdapter, payload: unknown): Promise<Record<string, unknown>>;
|
|
12
|
+
export declare function pluginHook(adapter: PluginHostAdapter, payload: unknown, replay: ((root: string) => Promise<number | undefined>) | undefined): Promise<Record<string, unknown> | number>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { resourceRoot } from "../../common/paths.js";
|
|
3
|
+
import { packageVersion } from "../../common/version.js";
|
|
4
|
+
import { requireThat } from "../../common/validation.js";
|
|
5
|
+
import { loadWorkspaceContext } from "../../integrations/agent-resources.js";
|
|
6
|
+
import { recordHistoryCapture } from "../../services/history/history-capture.js";
|
|
7
|
+
import { historyStartupNotices } from "../../services/history/summary-runner.js";
|
|
8
|
+
import { bindWorkspacePlugin } from "../../services/workspace/plugin-releases.js";
|
|
9
|
+
import { readWorkspaceConfig, workspaceFeatures } from "../../services/workspace/workspace-config.js";
|
|
10
|
+
import { initializeWorkspace } from "../../services/workspace/workspace-preparation.js";
|
|
11
|
+
import { discoverSkills, discoverWorkspaceSkills } from "../../services/workspace/workspace-skills.js";
|
|
12
|
+
function disabledMessage(adapter, configuration) {
|
|
13
|
+
return configuration.error ?? `Personal Bot 未在此工作区启用。运行 ${adapter.initCommandHint};配置文件:${configuration.path}`;
|
|
14
|
+
}
|
|
15
|
+
export async function pluginCommand(adapter, args, cwd) {
|
|
16
|
+
const root = await adapter.resolveRoot(cwd);
|
|
17
|
+
const action = args.join(" ");
|
|
18
|
+
requireThat(["init", "status"].includes(action), adapter.usage);
|
|
19
|
+
if (action === "init") {
|
|
20
|
+
await initializeWorkspace(root);
|
|
21
|
+
bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
|
|
22
|
+
}
|
|
23
|
+
const configuration = await readWorkspaceConfig(root);
|
|
24
|
+
return { version: packageVersion, workspaceRoot: root, resourceRoot, configuration };
|
|
25
|
+
}
|
|
26
|
+
export async function runPluginHost(adapter, args, replay) {
|
|
27
|
+
if (args[0] === "hook") {
|
|
28
|
+
let input = "";
|
|
29
|
+
process.stdin.setEncoding("utf8");
|
|
30
|
+
for await (const chunk of process.stdin)
|
|
31
|
+
input += String(chunk);
|
|
32
|
+
const result = await pluginHook(adapter, JSON.parse(input), replay && (root => replay(root, input)));
|
|
33
|
+
if (typeof result === "number")
|
|
34
|
+
process.exitCode = result;
|
|
35
|
+
else
|
|
36
|
+
process.stdout.write(JSON.stringify(result) + "\n");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
process.stdout.write(JSON.stringify(await pluginCommand(adapter, args, process.cwd()), null, 2) + "\n");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export async function pluginHook(adapter, payload, replay) {
|
|
43
|
+
if (process.env.PBOT_SUBAGENT_RUN_ID)
|
|
44
|
+
return adapter.formatPass(payload);
|
|
45
|
+
const event = adapter.parseEvent(payload);
|
|
46
|
+
if (event.kind === "ignore")
|
|
47
|
+
return adapter.formatPass(payload);
|
|
48
|
+
const root = await adapter.resolveRoot(event.cwd, event.raw);
|
|
49
|
+
const configuration = await readWorkspaceConfig(root);
|
|
50
|
+
if (configuration.enabled && replay) {
|
|
51
|
+
const code = await replay(root);
|
|
52
|
+
if (code !== undefined)
|
|
53
|
+
return code;
|
|
54
|
+
}
|
|
55
|
+
const features = workspaceFeatures(configuration);
|
|
56
|
+
if (event.kind === "check-skill") {
|
|
57
|
+
if (!configuration.enabled)
|
|
58
|
+
return adapter.formatDeny(event, disabledMessage(adapter, configuration));
|
|
59
|
+
if (!features.skills)
|
|
60
|
+
return adapter.formatDeny(event, `Personal Bot 工作区技能已在 ${configuration.path} 中停用(features.skills: false)。`);
|
|
61
|
+
return adapter.formatPass(payload);
|
|
62
|
+
}
|
|
63
|
+
if (!configuration.enabled)
|
|
64
|
+
return adapter.formatPass(payload);
|
|
65
|
+
if (event.kind === "inject-context")
|
|
66
|
+
bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
|
|
67
|
+
if (features.history && adapter.extractHistory) {
|
|
68
|
+
try {
|
|
69
|
+
const capture = await adapter.extractHistory(event);
|
|
70
|
+
if (capture)
|
|
71
|
+
recordHistoryCapture(root, adapter.host, capture);
|
|
72
|
+
}
|
|
73
|
+
catch { /* Never block a host turn if history persistence encounters a transient error or busy lock. */ }
|
|
74
|
+
}
|
|
75
|
+
if (event.kind === "record-history")
|
|
76
|
+
return adapter.formatPass(payload);
|
|
77
|
+
const includePrompts = features.prompts && !event.noticesOnly;
|
|
78
|
+
const includeSkills = features.skills && !event.noticesOnly;
|
|
79
|
+
const workspaceSkills = includeSkills && !adapter.nativeWorkspaceSkills
|
|
80
|
+
? await discoverWorkspaceSkills(root)
|
|
81
|
+
: [];
|
|
82
|
+
if (includeSkills && adapter.indexBundledSkills) {
|
|
83
|
+
const directory = join(resourceRoot, "skills");
|
|
84
|
+
workspaceSkills.push(...await discoverSkills(directory, directory));
|
|
85
|
+
}
|
|
86
|
+
const notices = event.isSessionStart && features.history ? historyStartupNotices(root) : [];
|
|
87
|
+
if (!includePrompts && !workspaceSkills.length && !notices.length)
|
|
88
|
+
return adapter.formatPass(payload);
|
|
89
|
+
const context = await loadWorkspaceContext({
|
|
90
|
+
host: adapter.host,
|
|
91
|
+
root,
|
|
92
|
+
role: event.role,
|
|
93
|
+
...(adapter.coordinatorPrompt ? { coordinatorPrompt: adapter.coordinatorPrompt } : {}),
|
|
94
|
+
includePrompts,
|
|
95
|
+
includeRootAgents: includePrompts && !adapter.nativeRootAgents,
|
|
96
|
+
...(event.localRoleOnly ? { localRoleOnly: true } : {}),
|
|
97
|
+
workspaceSkills,
|
|
98
|
+
notices,
|
|
99
|
+
});
|
|
100
|
+
return adapter.formatContext(event, context);
|
|
101
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResolvedWorkspaceMcpServer } from "../../model/workspace-mcp.js";
|
|
2
|
+
/** A native host can keep its other tools when one workspace server cannot be mounted. */
|
|
3
|
+
export declare function loadNativeWorkspaceServers(root: string, mount: (server: ResolvedWorkspaceMcpServer) => void | Promise<void>, options?: {
|
|
4
|
+
check?: () => void;
|
|
5
|
+
warn?: (message: string) => void;
|
|
6
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { readWorkspaceMcpConfig, resolveWorkspaceMcpServer } from "../../services/workspace/workspace-mcp.js";
|
|
2
|
+
/** A native host can keep its other tools when one workspace server cannot be mounted. */
|
|
3
|
+
export async function loadNativeWorkspaceServers(root, mount, options = {}) {
|
|
4
|
+
const config = await readWorkspaceMcpConfig(root);
|
|
5
|
+
options.check?.();
|
|
6
|
+
if (config.error) {
|
|
7
|
+
options.warn?.(config.error);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
for (const [name, server] of Object.entries(config.servers)) {
|
|
11
|
+
if (server.enabled === false)
|
|
12
|
+
continue;
|
|
13
|
+
options.check?.();
|
|
14
|
+
try {
|
|
15
|
+
await mount(resolveWorkspaceMcpServer(root, name, server));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
options.warn?.(error instanceof Error ? error.message : String(error));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|