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
package/lib/model/history.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { HistoryLayout } from "./workspace-config.js";
|
|
2
|
+
export type { HistoryLayout };
|
|
3
|
+
export type HistoryHost = string;
|
|
1
4
|
export interface HistoryExchange {
|
|
2
5
|
entryIds: string[];
|
|
3
6
|
text: string;
|
|
@@ -23,44 +26,25 @@ export interface RawHistory extends HistoryIdentity {
|
|
|
23
26
|
exchanges: (HistoryExchange & {
|
|
24
27
|
id: string;
|
|
25
28
|
})[];
|
|
26
|
-
/** Ordered paths observed in the native source.
|
|
29
|
+
/** Ordered paths observed in the native source. */
|
|
27
30
|
branches: string[][];
|
|
28
31
|
}
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ready: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface HistoryArchive {
|
|
36
|
-
raw: RawHistory;
|
|
37
|
-
/** Empty if absent; null if the derived file is unreadable. */
|
|
38
|
-
summaries: HistorySummary[] | null;
|
|
39
|
-
}
|
|
40
|
-
export interface HistoryNode extends HistorySummary {
|
|
41
|
-
kind: "session" | "exchange" | "summary";
|
|
42
|
-
parents: string[];
|
|
32
|
+
export interface SummarySource {
|
|
33
|
+
rawIds: string[];
|
|
34
|
+
exchangeIds: string[];
|
|
35
|
+
fingerprint: string;
|
|
43
36
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export type HistoryHost = "pi" | "dsh" | "claude";
|
|
50
|
-
export type HistoryLocation = {
|
|
51
|
-
host: "pi";
|
|
52
|
-
directory: string;
|
|
53
|
-
file?: string;
|
|
54
|
-
} | {
|
|
55
|
-
host: "dsh";
|
|
37
|
+
export interface SummaryArtifact {
|
|
38
|
+
id: string;
|
|
39
|
+
dimension: string;
|
|
40
|
+
host?: HistoryHost;
|
|
56
41
|
sessionId?: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}>;
|
|
42
|
+
title: string;
|
|
43
|
+
text: string;
|
|
44
|
+
from: string;
|
|
45
|
+
to: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
source: SummarySource;
|
|
64
48
|
}
|
|
65
49
|
export interface HistorySummaryRequest {
|
|
66
50
|
system: string;
|
|
@@ -68,3 +52,128 @@ export interface HistorySummaryRequest {
|
|
|
68
52
|
maxTokens: number;
|
|
69
53
|
}
|
|
70
54
|
export type HistorySummarizer = (request: HistorySummaryRequest, signal: AbortSignal) => Promise<string>;
|
|
55
|
+
export type SummaryTaskMode = "create" | "incremental" | "rebuild";
|
|
56
|
+
export interface SummaryTask {
|
|
57
|
+
id: string;
|
|
58
|
+
dimension: string;
|
|
59
|
+
mode: SummaryTaskMode;
|
|
60
|
+
title: string;
|
|
61
|
+
host?: HistoryHost;
|
|
62
|
+
sessionId?: string;
|
|
63
|
+
from: string;
|
|
64
|
+
to: string;
|
|
65
|
+
source: SummarySource;
|
|
66
|
+
exchanges: readonly (HistoryExchange & {
|
|
67
|
+
id: string;
|
|
68
|
+
})[];
|
|
69
|
+
existing?: SummaryArtifact;
|
|
70
|
+
addedExchanges?: readonly (HistoryExchange & {
|
|
71
|
+
id: string;
|
|
72
|
+
})[];
|
|
73
|
+
sourceSummaries?: readonly SummaryArtifact[];
|
|
74
|
+
}
|
|
75
|
+
export interface SummaryPlanOptions {
|
|
76
|
+
force?: boolean;
|
|
77
|
+
summariesByDimension?: ReadonlyMap<string, ReadonlyMap<string, SummaryArtifact>>;
|
|
78
|
+
}
|
|
79
|
+
export interface SummaryPlanResult {
|
|
80
|
+
tasks: SummaryTask[];
|
|
81
|
+
skipped: number;
|
|
82
|
+
}
|
|
83
|
+
export interface SummaryDimension {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly title: string;
|
|
86
|
+
readonly description: string;
|
|
87
|
+
readonly requiresMonthlyLayout?: boolean;
|
|
88
|
+
plan(raws: readonly RawHistory[], existing: ReadonlyMap<string, SummaryArtifact>, options?: SummaryPlanOptions): SummaryPlanResult;
|
|
89
|
+
buildRequest(task: SummaryTask): HistorySummaryRequest;
|
|
90
|
+
finalize(task: SummaryTask, output: string, now: string): SummaryArtifact;
|
|
91
|
+
}
|
|
92
|
+
export interface HistoryMigrationItem {
|
|
93
|
+
kind: "raw" | "summary";
|
|
94
|
+
dimension?: string;
|
|
95
|
+
id: string;
|
|
96
|
+
from: string;
|
|
97
|
+
to: string;
|
|
98
|
+
}
|
|
99
|
+
export interface HistoryMigrationConflict {
|
|
100
|
+
kind: "raw" | "summary";
|
|
101
|
+
dimension?: string;
|
|
102
|
+
from: string;
|
|
103
|
+
to: string;
|
|
104
|
+
reason: string;
|
|
105
|
+
}
|
|
106
|
+
export interface HistoryMigrationReport {
|
|
107
|
+
layout: HistoryLayout;
|
|
108
|
+
dryRun: boolean;
|
|
109
|
+
moved: HistoryMigrationItem[];
|
|
110
|
+
skipped: HistoryMigrationConflict[];
|
|
111
|
+
errors: {
|
|
112
|
+
path: string;
|
|
113
|
+
error: string;
|
|
114
|
+
}[];
|
|
115
|
+
}
|
|
116
|
+
export interface SummaryDimensionStatus {
|
|
117
|
+
dimension: string;
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
total: number;
|
|
121
|
+
ready: number;
|
|
122
|
+
pendingCreate: number;
|
|
123
|
+
pendingIncremental: number;
|
|
124
|
+
pendingRebuild: number;
|
|
125
|
+
}
|
|
126
|
+
export interface HistorySummaryReminder {
|
|
127
|
+
rawCount: number;
|
|
128
|
+
pendingCount: number;
|
|
129
|
+
oldestRawAt: string;
|
|
130
|
+
latestSummaryAt?: string;
|
|
131
|
+
rawAgeDays: number;
|
|
132
|
+
daysSinceLastSummary?: number;
|
|
133
|
+
thresholdDays: number;
|
|
134
|
+
message: string;
|
|
135
|
+
}
|
|
136
|
+
export interface SummaryRunProgress {
|
|
137
|
+
dimension: string;
|
|
138
|
+
completed: number;
|
|
139
|
+
total: number;
|
|
140
|
+
currentId: string;
|
|
141
|
+
mode: SummaryTaskMode;
|
|
142
|
+
}
|
|
143
|
+
export interface SummaryDimensionReport {
|
|
144
|
+
dimension: string;
|
|
145
|
+
scanned: number;
|
|
146
|
+
skipped: number;
|
|
147
|
+
created: number;
|
|
148
|
+
incremental: number;
|
|
149
|
+
rebuilt: number;
|
|
150
|
+
failed: {
|
|
151
|
+
id: string;
|
|
152
|
+
error: string;
|
|
153
|
+
}[];
|
|
154
|
+
}
|
|
155
|
+
export interface SummaryRunReport {
|
|
156
|
+
dimensions: SummaryDimensionReport[];
|
|
157
|
+
durationMs: number;
|
|
158
|
+
warnings: string[];
|
|
159
|
+
}
|
|
160
|
+
export declare const historyPageLimits: {
|
|
161
|
+
readonly search: {
|
|
162
|
+
readonly default: 20;
|
|
163
|
+
readonly max: 50;
|
|
164
|
+
};
|
|
165
|
+
readonly read: {
|
|
166
|
+
readonly default: 12000;
|
|
167
|
+
readonly max: 24000;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export interface HistoryQuery {
|
|
171
|
+
host?: HistoryHost;
|
|
172
|
+
query?: string;
|
|
173
|
+
sessionId?: string;
|
|
174
|
+
dimension?: string;
|
|
175
|
+
from?: string;
|
|
176
|
+
to?: string;
|
|
177
|
+
offset?: number;
|
|
178
|
+
limit?: number;
|
|
179
|
+
}
|
package/lib/model/history.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HistorySession } from "./history.js";
|
|
1
2
|
import type { WorkspaceSkillMeta } from "./workspace-mcp.js";
|
|
2
3
|
export type HostId = string;
|
|
3
4
|
export type PluginHostId = string;
|
|
@@ -15,12 +16,33 @@ export interface WorkspaceContext {
|
|
|
15
16
|
environment: WorkspaceEnvironment;
|
|
16
17
|
text: string;
|
|
17
18
|
}
|
|
19
|
+
export type HistoryCapture = {
|
|
20
|
+
kind: "input";
|
|
21
|
+
sessionId: string;
|
|
22
|
+
turnId?: string;
|
|
23
|
+
text: string;
|
|
24
|
+
timestamp?: string;
|
|
25
|
+
} | {
|
|
26
|
+
kind: "answer";
|
|
27
|
+
sessionId: string;
|
|
28
|
+
turnId?: string;
|
|
29
|
+
userText?: string;
|
|
30
|
+
assistantText: string;
|
|
31
|
+
completed: boolean;
|
|
32
|
+
isContinuation?: boolean;
|
|
33
|
+
timestamp?: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "session";
|
|
36
|
+
session: HistorySession;
|
|
37
|
+
};
|
|
18
38
|
export type HostEvent = {
|
|
19
39
|
kind: "ignore";
|
|
20
40
|
} | {
|
|
21
41
|
kind: "inject-context";
|
|
22
42
|
role: WorkspaceRole;
|
|
23
43
|
localRoleOnly?: boolean;
|
|
44
|
+
isSessionStart?: boolean;
|
|
45
|
+
noticesOnly?: boolean;
|
|
24
46
|
cwd: string;
|
|
25
47
|
raw: unknown;
|
|
26
48
|
} | {
|
|
@@ -28,16 +50,25 @@ export type HostEvent = {
|
|
|
28
50
|
skill: string;
|
|
29
51
|
cwd: string;
|
|
30
52
|
raw: unknown;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "record-history";
|
|
55
|
+
cwd: string;
|
|
56
|
+
raw: unknown;
|
|
31
57
|
};
|
|
32
58
|
export interface PluginHostAdapter {
|
|
33
59
|
readonly host: PluginHostId;
|
|
34
60
|
readonly nativeRootAgents: boolean;
|
|
61
|
+
readonly indexBundledSkills?: boolean;
|
|
35
62
|
readonly nativeWorkspaceSkills?: boolean;
|
|
36
63
|
readonly coordinatorPrompt?: string;
|
|
37
64
|
readonly initCommandHint: string;
|
|
38
65
|
readonly usage: string;
|
|
66
|
+
boundWorkspaceRoot?(): string | undefined;
|
|
39
67
|
resolveRoot(cwd: string, rawPayload?: unknown): Promise<string>;
|
|
40
68
|
parseEvent(payload: unknown): HostEvent;
|
|
69
|
+
extractHistory?(event: Extract<HostEvent, {
|
|
70
|
+
kind: "inject-context" | "record-history";
|
|
71
|
+
}>): Promise<HistoryCapture | undefined>;
|
|
41
72
|
formatPass(payload: unknown): Record<string, unknown>;
|
|
42
73
|
formatContext(event: Extract<HostEvent, {
|
|
43
74
|
kind: "inject-context";
|
|
@@ -3,22 +3,43 @@ export interface WorkspaceFeatures {
|
|
|
3
3
|
prompts?: boolean;
|
|
4
4
|
skills?: boolean;
|
|
5
5
|
mcp?: boolean;
|
|
6
|
+
history?: boolean;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
8
|
+
export type ResolvedWorkspaceFeatures = Readonly<Required<WorkspaceFeatures>>;
|
|
9
|
+
export declare const summaryConcurrency: {
|
|
10
|
+
readonly default: 3;
|
|
11
|
+
readonly max: 8;
|
|
12
|
+
};
|
|
13
|
+
export interface WorkspaceSummaryConfig {
|
|
14
|
+
backend?: string;
|
|
15
|
+
model?: string;
|
|
16
|
+
thinking?: string;
|
|
17
|
+
concurrency?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ResolvedWorkspaceSummaryConfig {
|
|
20
|
+
readonly backend: string;
|
|
21
|
+
readonly model?: string;
|
|
22
|
+
readonly thinking?: string;
|
|
23
|
+
readonly concurrency: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const historyLayouts: readonly ["monthly", "flat"];
|
|
26
|
+
export type HistoryLayout = typeof historyLayouts[number];
|
|
27
|
+
export interface WorkspaceHistoryConfig {
|
|
28
|
+
layout?: HistoryLayout;
|
|
29
|
+
}
|
|
30
|
+
export interface ResolvedWorkspaceHistoryConfig {
|
|
31
|
+
readonly layout: HistoryLayout;
|
|
11
32
|
}
|
|
12
33
|
export interface WorkspaceConfig {
|
|
13
34
|
enabled?: boolean;
|
|
14
35
|
features?: WorkspaceFeatures;
|
|
15
36
|
acp?: AcpCommands;
|
|
37
|
+
summary?: WorkspaceSummaryConfig;
|
|
38
|
+
history?: WorkspaceHistoryConfig;
|
|
16
39
|
}
|
|
17
|
-
export interface WorkspaceConfiguration {
|
|
40
|
+
export interface WorkspaceConfiguration extends WorkspaceConfig {
|
|
18
41
|
path: string;
|
|
19
42
|
present: boolean;
|
|
20
43
|
enabled: boolean;
|
|
21
44
|
error?: string;
|
|
22
|
-
features?: WorkspaceFeatures;
|
|
23
|
-
acp?: AcpCommands;
|
|
24
45
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export const summaryConcurrency = { default: 3, max: 8 };
|
|
2
|
+
export const historyLayouts = ["monthly", "flat"];
|
package/lib/plugin.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReplayPluginHook } from "./extension/hosts/plugin-runtime.js";
|
|
2
|
+
export declare function main(args: readonly string[], replayHook?: ReplayPluginHook): Promise<void>;
|
package/lib/plugin.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
import { requireThat } from "./common/validation.js";
|
|
4
|
-
import { runPluginHost } from "./extension/plugin-runtime.js";
|
|
5
|
-
import { listPluginHosts, pluginHosts } from "./integrations/hosts/registry.js";
|
|
6
|
-
export async function main(args) {
|
|
4
|
+
import { runPluginHost } from "./extension/hosts/plugin-runtime.js";
|
|
5
|
+
import { listPluginHosts, pluginHosts } from "./integrations/hosts/plugin-registry.js";
|
|
6
|
+
export async function main(args, replayHook) {
|
|
7
7
|
const [host, ...rest] = args;
|
|
8
8
|
const adapter = host ? pluginHosts.get(host) : undefined;
|
|
9
9
|
requireThat(adapter, `用法:node <插件目录>/lib/plugin.js <${listPluginHosts().join("|")}> hook|init|status`);
|
|
10
|
-
await runPluginHost(adapter, rest);
|
|
10
|
+
await runPluginHost(adapter, rest, replayHook);
|
|
11
11
|
}
|
|
12
12
|
if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
|
|
13
13
|
void main(process.argv.slice(2)).catch(error => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"pbot": {
|
|
4
|
+
"command": "sh",
|
|
5
|
+
"args": [
|
|
6
|
+
"-c",
|
|
7
|
+
"if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"",
|
|
8
|
+
"pbot",
|
|
9
|
+
"mcp"
|
|
10
|
+
],
|
|
11
|
+
"env": {
|
|
12
|
+
"PBOT_HOST": "qoder",
|
|
13
|
+
"PBOT_PLUGIN_VERSION": "0.3.3"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -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)
|
|
@@ -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.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${QODER_PLUGIN_ROOT:+$QODER_PLUGIN_ROOT/.qoder-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin qoder hook",
|
|
9
|
+
"timeout": 120
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"UserPromptSubmit": [
|
|
15
|
+
{
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${QODER_PLUGIN_ROOT:+$QODER_PLUGIN_ROOT/.qoder-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin qoder hook",
|
|
20
|
+
"timeout": 120
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"Stop": [
|
|
26
|
+
{
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${QODER_PLUGIN_ROOT:+$QODER_PLUGIN_ROOT/.qoder-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin qoder hook",
|
|
31
|
+
"timeout": 120
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pbot
|
|
3
|
+
description: 初始化 Personal Bot 工作区、查看状态、搜索归档或生成历史摘要。
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
使用当前会话的 `workspaceRoot` 作为 `--workspace`。省略子命令时使用 `status`。可执行 `init`、`status`、`history status|list|summary|migrate|search|read`。保留用户指定的维度、模型和筛选参数。
|
|
8
|
+
|
|
9
|
+
运行 `npx --yes personal-bot@0.3.3 <子命令> --workspace "<workspaceRoot>"`。如果 `pbot --at-least 0.3.3` 返回 0,也可以用 `pbot` 执行同一条命令。返回实际结果。
|
|
@@ -8,7 +8,7 @@ export declare class AgentRun {
|
|
|
8
8
|
readonly generation: string;
|
|
9
9
|
constructor(files: AgentFiles, id: string, generation: string);
|
|
10
10
|
get current(): Readonly<AgentCycle> | undefined;
|
|
11
|
-
get state(): "starting" | "busy" | "idle" | "stopping" | "stopped"
|
|
11
|
+
get state(): "error" | "starting" | "busy" | "idle" | "stopping" | "stopped";
|
|
12
12
|
get pending(): number;
|
|
13
13
|
get interactive(): boolean;
|
|
14
14
|
accepted(requestId: string): boolean;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import type { AcpBackend, AcpSessionReference } from "../../model/acp.js";
|
|
4
|
-
export interface AgentHost {
|
|
5
|
-
available(backend: AcpBackend): void;
|
|
6
|
-
filterOptions?(backend: AcpBackend, options: AgentOptions): AgentOptions;
|
|
7
|
-
prepare(backend: AcpBackend, options: AgentOptions): AcpSessionReference;
|
|
8
|
-
alive(id: string): boolean;
|
|
9
|
-
validateSession(value: AgentDescriptor, reference: AgentSessionReference): void | Promise<void>;
|
|
10
|
-
launch(value: AgentDescriptor, directory: string, generation: string, reference: AgentSessionReference, resume: boolean, signal: AbortSignal): void | Promise<void>;
|
|
11
|
-
release(id: string, generation: string): void | Promise<void>;
|
|
12
|
-
report(value: AgentDescriptor, reference: AgentSessionReference, leaf: string): string | Promise<string>;
|
|
13
|
-
}
|
|
1
|
+
import type { AgentOwner, AgentOptions, AgentMessage, AgentPendingRequest, AgentResponseInput, AgentStartOptions, AgentCycle, AgentHost, AgentView } from "../../model/agent.js";
|
|
2
|
+
export type { AgentHost } from "../../model/agent.js";
|
|
14
3
|
/** Host-neutral lifecycle manager for cross-harness ACP workers. */
|
|
15
4
|
export declare class AgentService {
|
|
16
5
|
#private;
|
|
17
6
|
readonly root: string;
|
|
18
7
|
readonly host: AgentHost;
|
|
19
|
-
readonly files
|
|
8
|
+
private readonly files;
|
|
20
9
|
constructor(root: string, directory: string, host: AgentHost);
|
|
21
10
|
private alive;
|
|
22
11
|
private check;
|
|
@@ -35,7 +24,7 @@ export declare class AgentService {
|
|
|
35
24
|
state: import("../../model/agent.js").AgentStatus["state"];
|
|
36
25
|
activity: string;
|
|
37
26
|
alive: boolean;
|
|
38
|
-
backend: AcpBackend;
|
|
27
|
+
backend: import("../../model/acp.js").AcpBackend;
|
|
39
28
|
transport: "acp";
|
|
40
29
|
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
41
30
|
capabilities: {
|
|
@@ -57,7 +46,7 @@ export declare class AgentService {
|
|
|
57
46
|
options: AgentOptions;
|
|
58
47
|
}>;
|
|
59
48
|
private launch;
|
|
60
|
-
send(id: string, text: string, delivery: "
|
|
49
|
+
send(id: string, text: string, delivery: AgentMessage["delivery"], owner: AgentOwner, attachments?: readonly string[]): {
|
|
61
50
|
requestId: string;
|
|
62
51
|
messageStatus: "queued";
|
|
63
52
|
name: string;
|
|
@@ -65,7 +54,7 @@ export declare class AgentService {
|
|
|
65
54
|
state: import("../../model/agent.js").AgentStatus["state"];
|
|
66
55
|
activity: string;
|
|
67
56
|
alive: boolean;
|
|
68
|
-
backend: AcpBackend;
|
|
57
|
+
backend: import("../../model/acp.js").AcpBackend;
|
|
69
58
|
transport: "acp";
|
|
70
59
|
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
71
60
|
capabilities: {
|
|
@@ -98,7 +87,7 @@ export declare class AgentService {
|
|
|
98
87
|
state: import("../../model/agent.js").AgentStatus["state"];
|
|
99
88
|
activity: string;
|
|
100
89
|
alive: boolean;
|
|
101
|
-
backend: AcpBackend;
|
|
90
|
+
backend: import("../../model/acp.js").AcpBackend;
|
|
102
91
|
transport: "acp";
|
|
103
92
|
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
104
93
|
capabilities: {
|
|
@@ -121,32 +110,13 @@ export declare class AgentService {
|
|
|
121
110
|
}>;
|
|
122
111
|
private restart;
|
|
123
112
|
cycles(id: string, owner: AgentOwner): AgentCycle[];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
backend: AcpBackend;
|
|
132
|
-
transport: "acp";
|
|
133
|
-
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
134
|
-
capabilities: {
|
|
135
|
-
steer: boolean;
|
|
136
|
-
resume: boolean;
|
|
137
|
-
transcript: boolean;
|
|
138
|
-
};
|
|
139
|
-
error?: string;
|
|
140
|
-
owned: boolean;
|
|
141
|
-
pendingRequests?: AgentPendingRequest[];
|
|
142
|
-
agentId: string;
|
|
143
|
-
release: string;
|
|
144
|
-
workspace: string;
|
|
145
|
-
cwd: string;
|
|
146
|
-
parentSessionId: string;
|
|
147
|
-
parentLeaf: string | null;
|
|
148
|
-
createdAt: number;
|
|
149
|
-
options: AgentOptions;
|
|
113
|
+
private cyclesFor;
|
|
114
|
+
private snapshot;
|
|
115
|
+
status(id: string, owner: AgentOwner): AgentView;
|
|
116
|
+
outputStatus(id: string, owner: AgentOwner, requestId?: string): {
|
|
117
|
+
current: AgentView;
|
|
118
|
+
cycle: AgentCycle | undefined;
|
|
119
|
+
terminal: boolean;
|
|
150
120
|
};
|
|
151
121
|
read(id: string, owner: AgentOwner, cycleId?: string, offset?: number, limit?: number): Promise<{
|
|
152
122
|
cycles: {
|
|
@@ -162,7 +132,7 @@ export declare class AgentService {
|
|
|
162
132
|
state: import("../../model/agent.js").AgentStatus["state"];
|
|
163
133
|
activity: string;
|
|
164
134
|
alive: boolean;
|
|
165
|
-
backend: AcpBackend;
|
|
135
|
+
backend: import("../../model/acp.js").AcpBackend;
|
|
166
136
|
transport: "acp";
|
|
167
137
|
selection?: import("../../model/acp.js").AcpModelSelection;
|
|
168
138
|
capabilities: {
|
|
@@ -298,7 +298,11 @@ export class AgentService {
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
cycles(id, owner) {
|
|
301
|
-
|
|
301
|
+
return this.cyclesFor(this.view(this.get(id, owner), owner));
|
|
302
|
+
}
|
|
303
|
+
cyclesFor(view) {
|
|
304
|
+
const id = view.agentId;
|
|
305
|
+
const values = this.files.completions(id);
|
|
302
306
|
if (view.cycle && !values.some(c => c.cycleId === view.cycle.cycleId)) {
|
|
303
307
|
values.push(view.state === "stopped" || view.state === "error" ? { ...view.cycle, state: "interrupted", finishedAt: view.cycle.finishedAt ?? Date.now() } : view.cycle);
|
|
304
308
|
}
|
|
@@ -321,9 +325,24 @@ export class AgentService {
|
|
|
321
325
|
}
|
|
322
326
|
return values;
|
|
323
327
|
}
|
|
328
|
+
snapshot(id, owner) {
|
|
329
|
+
const view = this.view(this.get(id, owner), owner);
|
|
330
|
+
const cycles = this.cyclesFor(view);
|
|
331
|
+
const latest = cycles.at(-1);
|
|
332
|
+
return { current: latest ? { ...view, cycle: latest } : view, cycles };
|
|
333
|
+
}
|
|
324
334
|
status(id, owner) {
|
|
325
|
-
|
|
326
|
-
|
|
335
|
+
return this.snapshot(id, owner).current;
|
|
336
|
+
}
|
|
337
|
+
outputStatus(id, owner, requestId) {
|
|
338
|
+
const { current, cycles } = this.snapshot(id, owner);
|
|
339
|
+
const request = requestId ?? this.files.messages(id).findLast(item => item.generation === current.generation)?.requestId;
|
|
340
|
+
const cycle = request
|
|
341
|
+
? cycles.find(item => item.generation === current.generation && item.requestIds.includes(request))
|
|
342
|
+
: current.cycle;
|
|
343
|
+
const stopped = current.state === "stopped" || current.state === "error";
|
|
344
|
+
const terminal = request ? stopped && !cycle : stopped || (current.state === "idle" && !cycle);
|
|
345
|
+
return { current, cycle, terminal };
|
|
327
346
|
}
|
|
328
347
|
async read(id, owner, cycleId, offset = 0, limit = 16000) {
|
|
329
348
|
const d = this.get(id, owner), cycles = this.cycles(id, owner);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HistoryHost } from "../../model/history.js";
|
|
2
|
+
import type { HistoryCapture } from "../../model/plugin-host.js";
|
|
3
|
+
/** Persist a host raw history observation atomically into .pbot/history/raw/. */
|
|
4
|
+
export declare function recordHistoryCapture(root: string, host: HistoryHost, capture: HistoryCapture): void;
|