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,20 +1,24 @@
|
|
|
1
1
|
import { object } from "../common/json.js";
|
|
2
|
-
import { requireThat } from "../common/validation.js";
|
|
3
|
-
import type { HistoryExchange,
|
|
2
|
+
import { isHistoryIdentifier, requireThat } from "../common/validation.js";
|
|
3
|
+
import type { HistoryExchange, HistoryIdentity, RawHistory, SummaryArtifact } from "../model/history.js";
|
|
4
4
|
import { fileId } from "./file-access.js";
|
|
5
5
|
|
|
6
6
|
const strings = (value: unknown): value is string[] => Array.isArray(value) && value.every(item => typeof item === "string");
|
|
7
7
|
const fields = (value: object, names: readonly string[]) => Object.keys(value).every(key => names.includes(key));
|
|
8
|
+
|
|
8
9
|
const rawFields = ["host", "id", "sessionId", "name", "exchanges", "branches"];
|
|
9
|
-
const hierarchyFields = ["host", "id", "sessionId", "summaries"];
|
|
10
10
|
const exchangeFields = ["id", "entryIds", "text", "from", "to", "completed"];
|
|
11
|
-
const
|
|
11
|
+
const summaryArtifactFields = ["id", "dimension", "host", "sessionId", "title", "text", "from", "to", "updatedAt", "source"];
|
|
12
|
+
const summarySourceFields = ["rawIds", "exchangeIds", "fingerprint"];
|
|
12
13
|
|
|
13
|
-
export
|
|
14
|
+
export { isHistoryIdentifier as isHistoryHost, isHistoryIdentifier as isSummaryDimension } from "../common/validation.js";
|
|
14
15
|
|
|
15
16
|
function identity(value: unknown): asserts value is HistoryIdentity {
|
|
16
|
-
requireThat(
|
|
17
|
-
typeof value.
|
|
17
|
+
requireThat(
|
|
18
|
+
object(value) && isHistoryIdentifier(value.host) && typeof value.id === "string" &&
|
|
19
|
+
typeof value.sessionId === "string" && value.sessionId.length > 0,
|
|
20
|
+
"历史归档身份无效。",
|
|
21
|
+
);
|
|
18
22
|
fileId(value.id);
|
|
19
23
|
}
|
|
20
24
|
|
|
@@ -31,68 +35,48 @@ function exchange(value: unknown): value is HistoryExchange & { id: string } {
|
|
|
31
35
|
|
|
32
36
|
export function rawHistory(value: unknown): RawHistory {
|
|
33
37
|
identity(value);
|
|
34
|
-
requireThat(
|
|
35
|
-
|
|
38
|
+
requireThat(
|
|
39
|
+
object(value) && fields(value, rawFields) && typeof value.name === "string" &&
|
|
40
|
+
Array.isArray(value.exchanges) && Array.isArray(value.branches),
|
|
41
|
+
"历史原文归档无效。",
|
|
42
|
+
);
|
|
36
43
|
const ids = new Set<string>();
|
|
37
44
|
for (const item of value.exchanges) {
|
|
38
45
|
requireThat(exchange(item) && fields(item, exchangeFields) && item.entryIds.length > 0, "历史问答或其来源消息 ID 无效。");
|
|
39
46
|
requireThat(item.id !== value.id && !ids.has(item.id), "历史问答 ID 重复:" + item.id);
|
|
40
47
|
ids.add(item.id);
|
|
41
48
|
}
|
|
42
|
-
for (const branch of value.branches)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export interface HierarchicalHistory extends HistoryIdentity { summaries: HistorySummary[] }
|
|
48
|
-
|
|
49
|
-
export function hierarchicalHistory(value: unknown, raw: RawHistory): HierarchicalHistory {
|
|
50
|
-
identity(value);
|
|
51
|
-
matchIdentity(value, raw);
|
|
52
|
-
requireThat(object(value) && fields(value, hierarchyFields) && Array.isArray(value.summaries), "历史摘要归档无效。");
|
|
53
|
-
const levels = new Map(raw.exchanges.map(item => [item.id, 0]));
|
|
54
|
-
for (const item of value.summaries) {
|
|
55
|
-
requireThat(object(item) && exchange(item) && fields(item, summaryFields) && item.entryIds.length > 0 &&
|
|
56
|
-
typeof item.level === "number" && Number.isSafeInteger(item.level) && item.level > 0 && strings(item.children) && typeof item.ready === "boolean", "历史摘要节点无效。");
|
|
57
|
-
requireThat(item.id !== raw.id && !levels.has(item.id), "历史摘要 ID 重复:" + item.id);
|
|
58
|
-
levels.set(item.id, item.level);
|
|
49
|
+
for (const branch of value.branches) {
|
|
50
|
+
requireThat(
|
|
51
|
+
strings(branch) && new Set(branch).size === branch.length && branch.every(id => ids.has(id)),
|
|
52
|
+
"历史分支包含重复或未知的问答 ID。",
|
|
53
|
+
);
|
|
59
54
|
}
|
|
60
|
-
|
|
61
|
-
for (const item of result.summaries) requireThat(item.children.length > 0 && new Set(item.children).size === item.children.length &&
|
|
62
|
-
item.children.every(id => levels.get(id) === item.level - 1), "历史摘要子节点缺失、重复或层级不匹配:" + item.id);
|
|
63
|
-
return result;
|
|
55
|
+
return value as unknown as RawHistory;
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
export function summaryArtifact(value: unknown, expectedDimension?: string): SummaryArtifact {
|
|
59
|
+
requireThat(object(value) && fields(value, summaryArtifactFields), "历史摘要产物格式无效。");
|
|
60
|
+
requireThat(typeof value.id === "string" && value.id.length > 0, "历史摘要 ID 无效。");
|
|
61
|
+
fileId(value.id);
|
|
62
|
+
requireThat(isHistoryIdentifier(value.dimension), "历史摘要维度无效。");
|
|
63
|
+
if (expectedDimension !== undefined) {
|
|
64
|
+
requireThat(value.dimension === expectedDimension, `历史摘要维度不匹配,预期 ${expectedDimension},实际 ${value.dimension}。`);
|
|
71
65
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
requireThat(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export function summaryData(item: HistorySummary): HistorySummary {
|
|
90
|
-
return { ...exchangeData(item), level: item.level, children: item.children, ready: item.ready };
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function splitLegacy(record: HistoryRecord): { raw: RawHistory; summaries: HistorySummary[] } {
|
|
94
|
-
const { host, id, sessionId, name } = record;
|
|
95
|
-
const raw = rawHistory({ host, id, sessionId, name, exchanges: record.nodes.filter(node => node.kind === "exchange").map(exchangeData), branches: [] });
|
|
96
|
-
const summaries = record.nodes.filter(node => node.kind === "summary").map(summaryData);
|
|
97
|
-
return { raw, summaries: hierarchicalHistory({ host, id, sessionId, summaries }, raw).summaries };
|
|
66
|
+
if (value.host !== undefined) requireThat(isHistoryIdentifier(value.host), "历史摘要来源 host 无效。");
|
|
67
|
+
if (value.sessionId !== undefined) requireThat(typeof value.sessionId === "string" && value.sessionId.length > 0, "历史摘要 sessionId 无效。");
|
|
68
|
+
requireThat(
|
|
69
|
+
typeof value.title === "string" && typeof value.text === "string" && value.text.trim().length > 0 &&
|
|
70
|
+
typeof value.from === "string" && typeof value.to === "string" && typeof value.updatedAt === "string",
|
|
71
|
+
"历史摘要正文或时间字段无效。",
|
|
72
|
+
);
|
|
73
|
+
const source = value.source;
|
|
74
|
+
requireThat(
|
|
75
|
+
object(source) && fields(source, summarySourceFields) &&
|
|
76
|
+
strings(source.rawIds) && source.rawIds.length > 0 &&
|
|
77
|
+
strings(source.exchangeIds) &&
|
|
78
|
+
typeof source.fingerprint === "string" && source.fingerprint.length > 0,
|
|
79
|
+
"历史摘要来源指纹无效。",
|
|
80
|
+
);
|
|
81
|
+
return value as unknown as SummaryArtifact;
|
|
98
82
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { HistoryService } from "../../services/history/history-service.js";
|
|
1
|
+
import { readWorkspaceHistory, searchWorkspaceHistory } from "../../services/history/history-query.js";
|
|
3
2
|
import type { HistoryInput } from "./contract.js";
|
|
4
3
|
|
|
5
|
-
export
|
|
6
|
-
signal?.throwIfAborted();
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export function executeHistory(root: string, args: HistoryInput, signal?: AbortSignal) {
|
|
5
|
+
signal?.throwIfAborted();
|
|
6
|
+
if (args.action === "search") {
|
|
7
|
+
return searchWorkspaceHistory(root, args);
|
|
8
|
+
}
|
|
9
|
+
const node = readWorkspaceHistory(root, args.id, args.offset, args.limit, args.childrenOffset, args.host);
|
|
10
|
+
return { node, warnings: node.warnings };
|
|
9
11
|
}
|
|
@@ -1,40 +1,77 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
|
-
import type
|
|
3
|
-
import { requireThat } from "../../common/validation.js";
|
|
2
|
+
import { historyPageLimits, type HistoryHost, type HistoryQuery } from "../../model/history.js";
|
|
3
|
+
import { historyIdentifierPattern, requireThat } from "../../common/validation.js";
|
|
4
4
|
import { schema } from "../../common/schema.js";
|
|
5
5
|
import { inputObject, need, nullable, pick } from "../input.js";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const identifier = Type.String({ pattern: historyIdentifierPattern.source });
|
|
8
8
|
const nullableOffset = Type.Union([Type.Integer(), Type.Null()]);
|
|
9
|
-
const node = Type.Object({
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const node = Type.Object({
|
|
10
|
+
host: identifier,
|
|
11
|
+
id: Type.String(),
|
|
12
|
+
kind: Type.Union([Type.Literal("session"), Type.Literal("exchange"), Type.Literal("summary")], {
|
|
13
|
+
description: "session=会话根;summary=维度摘要;exchange=单轮问答原文。",
|
|
14
|
+
}),
|
|
15
|
+
dimension: Type.Optional(identifier),
|
|
16
|
+
sessionId: Type.String(),
|
|
17
|
+
name: Type.String(),
|
|
18
|
+
preview: Type.String(),
|
|
19
|
+
from: Type.String(),
|
|
20
|
+
to: Type.String(),
|
|
12
21
|
ready: Type.Boolean({ description: "正文或摘要是否已生成。" }),
|
|
13
|
-
completed: Type.Boolean({ description: "该对话或问答是否正常结束(false 表示中断或未完)。" })
|
|
22
|
+
completed: Type.Boolean({ description: "该对话或问答是否正常结束(false 表示中断或未完)。" }),
|
|
23
|
+
});
|
|
24
|
+
|
|
14
25
|
export const historyResultSchema = Type.Object({
|
|
15
|
-
matches: Type.Optional(Type.Array(Type.Object({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
parents: Type.Array(
|
|
19
|
-
|
|
26
|
+
matches: Type.Optional(Type.Array(Type.Object({
|
|
27
|
+
...node.properties,
|
|
28
|
+
snippet: Type.String(),
|
|
29
|
+
parents: Type.Array(Type.String()),
|
|
30
|
+
}))),
|
|
31
|
+
total: Type.Optional(Type.Integer()),
|
|
32
|
+
nextOffset: Type.Optional(nullableOffset),
|
|
33
|
+
node: Type.Optional(Type.Object({
|
|
34
|
+
...node.properties,
|
|
35
|
+
text: Type.String(),
|
|
36
|
+
totalLength: Type.Integer(),
|
|
37
|
+
nextOffset: nullableOffset,
|
|
38
|
+
parents: Type.Array(node),
|
|
39
|
+
children: Type.Array(node),
|
|
40
|
+
nextChildrenOffset: nullableOffset,
|
|
41
|
+
source: Type.Object({
|
|
42
|
+
host: identifier,
|
|
43
|
+
sessionId: Type.String({ description: "原始宿主会话 ID。" }),
|
|
44
|
+
entryIds: Type.Array(Type.String()),
|
|
45
|
+
dimension: Type.Optional(identifier),
|
|
46
|
+
}),
|
|
47
|
+
warnings: Type.Array(Type.String()),
|
|
48
|
+
})),
|
|
20
49
|
warnings: Type.Array(Type.String()),
|
|
21
50
|
});
|
|
22
|
-
|
|
51
|
+
|
|
52
|
+
export const historyDescription =
|
|
53
|
+
"查询当前工作区的历史问答与各维度摘要,host 可筛选来源(如 pi、dsh、claude、antigravity),dimension 可筛选 raw 原文或特定摘要维度(如 monthly 月度汇总、session 会话摘要)。" +
|
|
54
|
+
"search 按不区分大小写的连续关键词匹配原文和摘要,省略 query 列出各会话或指定维度摘要;无匹配时换词。" +
|
|
55
|
+
"read 按节点 id 展开正文与上下级(可从 monthly 下钻至 session 摘要,再下钻至 exchange 原文),nextOffset 续读正文,nextChildrenOffset 续读子节点。归档不含工具调用日志。";
|
|
56
|
+
|
|
23
57
|
export const historyParameters = Type.Object({
|
|
24
|
-
action: Type.Union([Type.Literal("search"), Type.Literal("read")], {
|
|
25
|
-
|
|
26
|
-
|
|
58
|
+
action: Type.Union([Type.Literal("search"), Type.Literal("read")], {
|
|
59
|
+
description: "search 搜索或列会话;read 读取指定节点正文与上下级。各动作仅读取自身字段,其余字段忽略。",
|
|
60
|
+
}),
|
|
61
|
+
host: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "可选来源筛选(如 pi、dsh、claude、antigravity)。" })),
|
|
62
|
+
dimension: nullable(Type.String({ pattern: historyIdentifierPattern.source, description: "仅 search:可选范围筛选(raw 表示仅原文,或指定摘要维度如 monthly、session;省略查全部)。" })),
|
|
63
|
+
query: nullable(Type.String({ description: "仅 search:不区分大小写的连续关键词;省略时列出各会话(或指定维度摘要)。" })),
|
|
27
64
|
sessionId: nullable(Type.String({ description: "仅 search:限定在指定会话 ID 内搜索。" })),
|
|
28
65
|
from: nullable(Type.String({ description: "仅 search:ISO 日期或时间下界。" })),
|
|
29
66
|
to: nullable(Type.String({ description: "仅 search:ISO 日期或时间上界。" })),
|
|
30
67
|
id: nullable(Type.String({ description: "仅 read,必填:search 或上下级返回的节点 id。" })),
|
|
31
68
|
offset: nullable(Type.Integer({ minimum: 0, description: "search:匹配结果偏移;read:正文字符偏移。默认 0。" })),
|
|
32
|
-
limit: nullable(Type.Integer({ minimum: 1, maximum:
|
|
69
|
+
limit: nullable(Type.Integer({ minimum: 1, maximum: historyPageLimits.read.max, description: `search:最多返回条数(默认 ${historyPageLimits.search.default},上限 ${historyPageLimits.search.max});read:正文字符数(默认 ${historyPageLimits.read.default})。` })),
|
|
33
70
|
childrenOffset: nullable(Type.Integer({ minimum: 0, description: "仅 read:子节点列表偏移,默认 0;续读传上页 nextChildrenOffset。" })),
|
|
34
71
|
}, { additionalProperties: false });
|
|
35
72
|
|
|
36
73
|
export type HistoryInput =
|
|
37
|
-
| { action: "search"
|
|
74
|
+
| ({ action: "search" } & HistoryQuery)
|
|
38
75
|
| { action: "read"; id: string; host?: HistoryHost; offset?: number; limit?: number; childrenOffset?: number };
|
|
39
76
|
|
|
40
77
|
const valid = schema(historyParameters);
|
|
@@ -42,13 +79,21 @@ const valid = schema(historyParameters);
|
|
|
42
79
|
export function historyInput(value: unknown): HistoryInput {
|
|
43
80
|
const args = inputObject(value, valid, "历史参数格式无效");
|
|
44
81
|
if (args.action === "search") {
|
|
45
|
-
const limit = args.limit === undefined ?
|
|
46
|
-
requireThat(limit <=
|
|
47
|
-
return {
|
|
48
|
-
|
|
82
|
+
const limit = args.limit === undefined ? historyPageLimits.search.default : args.limit as number;
|
|
83
|
+
requireThat(limit <= historyPageLimits.search.max, `search 的 limit 最多 ${historyPageLimits.search.max}。`);
|
|
84
|
+
return {
|
|
85
|
+
action: "search",
|
|
86
|
+
...(pick(args, ["host", "dimension", "query", "sessionId", "from", "to", "offset", "limit"]) as
|
|
87
|
+
Omit<Extract<HistoryInput, { action: "search" }>, "action">),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (args.action === "read") {
|
|
91
|
+
return {
|
|
92
|
+
action: "read",
|
|
93
|
+
id: need("read", args, "id"),
|
|
94
|
+
...(pick(args, ["host", "offset", "limit", "childrenOffset"]) as
|
|
95
|
+
Omit<Extract<HistoryInput, { action: "read" }>, "action" | "id">),
|
|
96
|
+
};
|
|
49
97
|
}
|
|
50
|
-
if (args.action === "read") return { action: "read", id: need("read", args, "id"),
|
|
51
|
-
...(pick(args, ["host", "offset", "limit", "childrenOffset"]) as
|
|
52
|
-
Omit<Extract<HistoryInput, { action: "read" }>, "action" | "id">) };
|
|
53
98
|
throw new Error("未知的历史 action。");
|
|
54
99
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
import type { Agent } from "@deepseek-ai/dsh-agent";
|
|
3
|
-
import
|
|
4
|
-
import { dshParameters, dshOutputSchema } from "../../integrations/dsh/schema.js";
|
|
3
|
+
import { dshParameters, dshOutputSchema } from "../../integrations/hosts/dsh/schema.js";
|
|
5
4
|
import { requireThat } from "../../common/validation.js";
|
|
6
5
|
import { schema } from "../../common/schema.js";
|
|
7
6
|
import { json } from "../../common/json.js";
|
|
@@ -9,15 +8,25 @@ import { markdownFields } from "../../common/markdown.js";
|
|
|
9
8
|
import { historyDescription, historyInput, historyParameters, historyResultSchema } from "./contract.js";
|
|
10
9
|
import { executeHistory } from "./actions.js";
|
|
11
10
|
|
|
12
|
-
export function registerDshHistoryTool(ctx: Context, agent: Agent,
|
|
11
|
+
export function registerDshHistoryTool(ctx: Context, agent: Agent, root: string, lifetime: AbortSignal, check: () => void) {
|
|
13
12
|
const valid = schema(historyResultSchema);
|
|
14
|
-
ctx.tools.register({
|
|
15
|
-
|
|
13
|
+
ctx.tools.register({
|
|
14
|
+
name: "pbot_history",
|
|
15
|
+
description: historyDescription,
|
|
16
|
+
parameters: dshParameters(historyParameters),
|
|
17
|
+
output: {
|
|
18
|
+
schema: dshOutputSchema(historyResultSchema),
|
|
19
|
+
render: (_args, value) => [{ type: "text", text: "# 历史\n\n" + markdownFields(value) }],
|
|
20
|
+
},
|
|
16
21
|
async execute(value, exec) {
|
|
17
|
-
check();
|
|
22
|
+
check();
|
|
23
|
+
requireThat(exec.agent === agent, "历史工具不属于当前会话。");
|
|
18
24
|
const signal = AbortSignal.any([exec.signal, lifetime]);
|
|
19
|
-
const result =
|
|
20
|
-
check();
|
|
25
|
+
const result = executeHistory(root, historyInput(value), signal);
|
|
26
|
+
check();
|
|
27
|
+
signal.throwIfAborted();
|
|
28
|
+
requireThat(valid(result), "历史输出不符合契约。");
|
|
29
|
+
return json(result);
|
|
21
30
|
},
|
|
22
31
|
});
|
|
23
32
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { markdownResult } from "../result.js";
|
|
3
|
+
import { historyDescription, historyInput, historyParameters, historyResultSchema } from "./contract.js";
|
|
4
|
+
import { executeHistory } from "./actions.js";
|
|
5
|
+
|
|
6
|
+
export function registerPiHistoryTool(pi: ExtensionAPI, root: string, access: { check(): void }) {
|
|
7
|
+
const tool = defineTool({
|
|
8
|
+
namespace: { name: "pbot", description: "工作区历史查询。" },
|
|
9
|
+
name: "pbot_history",
|
|
10
|
+
label: "历史对话",
|
|
11
|
+
description: historyDescription,
|
|
12
|
+
parameters: historyParameters,
|
|
13
|
+
outputSchema: historyResultSchema,
|
|
14
|
+
async execute(_id, args, signal) {
|
|
15
|
+
access.check();
|
|
16
|
+
const result = executeHistory(root, historyInput(args), signal);
|
|
17
|
+
access.check();
|
|
18
|
+
return markdownResult(result, args.action === "search" ? "历史搜索" : "历史正文");
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
pi.registerTool(tool);
|
|
22
|
+
return () => pi.registerTool({ ...tool, exposure: "hidden" });
|
|
23
|
+
}
|
package/src/ui/dsh/elements.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { object } from "../../common/json.js";
|
|
2
|
-
import { stateLabel } from "../presentation.js";
|
|
3
2
|
|
|
4
3
|
export const record = (value: unknown): Record<string, unknown> => { if (!object(value)) throw new Error("管理数据无效。"); return value; };
|
|
5
4
|
export const rows = (value: unknown) => Array.isArray(value) ? value.map(record) : [];
|
|
6
5
|
export const text = (value: unknown) => value === null || value === undefined ? "" : String(value);
|
|
7
|
-
export const objectInput = (value: string) => record(JSON.parse(value || "{}"));
|
|
8
|
-
export const lines = (value: string) => value.split(/\r?\n/).map(item => item.trim()).filter(Boolean);
|
|
9
6
|
|
|
10
7
|
export function element<K extends keyof HTMLElementTagNameMap>(tag: K, content = "", className = "") {
|
|
11
8
|
const node = document.createElement(tag); node.textContent = content; node.className = className; return node;
|
|
@@ -18,10 +15,9 @@ export function group(parent: HTMLElement, className = "pbot-stack") {
|
|
|
18
15
|
export function details(parent: HTMLElement, title: string) {
|
|
19
16
|
const node = element("details", "", "pbot-disclosure"); node.append(element("summary", title)); parent.append(node); return node;
|
|
20
17
|
}
|
|
21
|
-
export function field(parent: HTMLElement, label: string
|
|
22
|
-
const wrapper = element("label", "", "pbot-field"), input =
|
|
23
|
-
wrapper.append(element("span", label)); input.
|
|
24
|
-
if (input instanceof HTMLTextAreaElement) input.rows = 3;
|
|
18
|
+
export function field(parent: HTMLElement, label: string) {
|
|
19
|
+
const wrapper = element("label", "", "pbot-field"), input = element("input");
|
|
20
|
+
wrapper.append(element("span", label)); input.setAttribute("aria-label", label);
|
|
25
21
|
wrapper.append(input); parent.append(wrapper); return input;
|
|
26
22
|
}
|
|
27
23
|
export function select(parent: HTMLElement, label: string, values: [string, string][]) {
|
|
@@ -30,9 +26,6 @@ export function select(parent: HTMLElement, label: string, values: [string, stri
|
|
|
30
26
|
for (const [value, title] of values) { const option = element("option", title); option.value = value; input.append(option); }
|
|
31
27
|
wrapper.append(input); parent.append(wrapper); return input;
|
|
32
28
|
}
|
|
33
|
-
export function badge(state: unknown) {
|
|
34
|
-
const node = element("span", stateLabel(state), "pbot-badge"); node.dataset.state = text(state); return node;
|
|
35
|
-
}
|
|
36
29
|
export function facts(values: [string, unknown][]) {
|
|
37
30
|
const node = element("dl", "", "pbot-facts");
|
|
38
31
|
for (const [label, value] of values) node.append(element("dt", label), element("dd", text(value) || "—"));
|
|
@@ -41,8 +34,8 @@ export function facts(values: [string, unknown][]) {
|
|
|
41
34
|
export function empty(title: string, description: string) {
|
|
42
35
|
const node = element("div", "", "pbot-empty"); node.append(element("h3", title), note(description)); return node;
|
|
43
36
|
}
|
|
44
|
-
export function pageTitle(parent: HTMLElement, title: string
|
|
45
|
-
const node = element("header", "", "pbot-page-title"); node.append(element("h2", title));
|
|
37
|
+
export function pageTitle(parent: HTMLElement, title: string) {
|
|
38
|
+
const node = element("header", "", "pbot-page-title"); node.append(element("h2", title)); parent.append(node); return node;
|
|
46
39
|
}
|
|
47
40
|
export function time(value: unknown) {
|
|
48
41
|
const date = new Date(typeof value === "number" ? value : text(value));
|
package/src/ui/dsh/management.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
import type {} from "@deepseek-ai/dsh-api-remotes/client";
|
|
3
3
|
import type { SessionId } from "@deepseek-ai/dsh-session/types";
|
|
4
|
+
import { historyPageLimits } from "../../model/history.js";
|
|
4
5
|
import { object, json } from "../../common/json.js";
|
|
5
6
|
import { block, details, element, empty, facts, field, group, note, pageTitle, record, rows, select, text, time } from "./elements.js";
|
|
6
7
|
import { managementStyles } from "./styles.js";
|
|
@@ -72,29 +73,28 @@ export function showManagement(ctx: Context, parentSessionId: SessionId) {
|
|
|
72
73
|
if (!result.ok) throw new Error(result.error.message);
|
|
73
74
|
lifetime.signal.throwIfAborted(); return record(result.value);
|
|
74
75
|
}
|
|
75
|
-
async function
|
|
76
|
-
const result = await ctx.remote.commands.execute(parentSessionId, "/pbot "
|
|
76
|
+
async function initializeWorkspace() {
|
|
77
|
+
const result = await ctx.remote.commands.execute(parentSessionId, "/pbot init", []);
|
|
77
78
|
if (!result.ok) throw new Error(result.error.message + ";如连接中断,请先刷新记录确认操作是否已接纳。");
|
|
78
79
|
if (!result.value) throw new Error("管理命令未被接纳。");
|
|
79
80
|
if (result.value.result.kind === "error") throw new Error(result.value.result.text);
|
|
80
|
-
inform(
|
|
81
|
+
inform("工作区已初始化并启用。");
|
|
81
82
|
if (!closed) { try { await refresh(); } catch (error) { inform("操作已接纳;刷新状态未成功:" + String(error), "error"); } }
|
|
82
|
-
return result.value.result.text ?? "";
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const status = section("status", "工作区"); pageTitle(status, "工作区"
|
|
85
|
+
const status = section("status", "工作区"); pageTitle(status, "工作区");
|
|
86
86
|
const counts = note(""), workspaceInfo = group(status); status.querySelector("header")!.after(counts); counts.classList.add("pbot-counts");
|
|
87
87
|
const materials = group(status, "pbot-setting"); materials.append(element("h3", "资料目录"));
|
|
88
|
-
const initializeButton = button(materials, "准备目录",
|
|
88
|
+
const initializeButton = button(materials, "准备目录", initializeWorkspace);
|
|
89
89
|
const diagnostic = details(status, "环境详情"), statusBody = block(""); statusBody.classList.add("pbot-raw"); diagnostic.append(statusBody);
|
|
90
90
|
|
|
91
|
-
const history = section("history", "历史"); pageTitle(history, "历史"
|
|
91
|
+
const history = section("history", "历史"); pageTitle(history, "历史");
|
|
92
92
|
const searchForm = form(history); searchForm.className = "pbot-search";
|
|
93
|
-
const historyQuery = field(searchForm, "关键词"), host = select(searchForm, "来源", [["", "全部"], ["pi", "Pi"], ["dsh", "dsh"], ["claude", "Claude Code"]]);
|
|
93
|
+
const historyQuery = field(searchForm, "关键词"), host = select(searchForm, "来源", [["", "全部"], ["pi", "Pi"], ["dsh", "dsh"], ["claude", "Claude Code"], ["antigravity", "Antigravity"], ["codex", "Codex"], ["qoder", "Qoder CLI"]]);
|
|
94
94
|
historyQuery.placeholder = "留空查看最近会话"; submit(searchForm, "查询", () => searchHistory());
|
|
95
95
|
const dateFilters = details(history, "时间范围"), dateGrid = group(dateFilters, "pbot-grid");
|
|
96
96
|
const historyFrom = field(dateGrid, "开始时间"), historyTo = field(dateGrid, "结束时间");
|
|
97
|
-
for (const input of [historyFrom, historyTo])
|
|
97
|
+
for (const input of [historyFrom, historyTo]) input.type = "datetime-local";
|
|
98
98
|
const historyBody = group(history, "pbot-history-results"), historyPaging = group(history, "pbot-pagination"), historyNode = group(history, "pbot-card"); historyNode.hidden = true;
|
|
99
99
|
historyBody.append(empty("查询历史", "输入关键词,或留空查看最近会话。"));
|
|
100
100
|
let historySearch: Record<string, unknown> = {};
|
|
@@ -114,11 +114,12 @@ export function showManagement(ctx: Context, parentSessionId: SessionId) {
|
|
|
114
114
|
for (const match of rows(data.matches)) {
|
|
115
115
|
const item = element("article"), meta = group(item, "pbot-between"); item.dataset.id = text(match.id); item.dataset.host = text(match.host);
|
|
116
116
|
meta.append(element("h4", text(match.name)), element("span", text(match.host), "pbot-badge"));
|
|
117
|
-
|
|
117
|
+
const kindLabel = match.kind === "session" ? "会话" : match.kind === "summary" ? `摘要${match.dimension ? "·" + text(match.dimension) : ""}` : "问答";
|
|
118
|
+
item.append(note(`${time(match.from)} · ${kindLabel}`), block(match.snippet || match.preview));
|
|
118
119
|
button(item, "读取", () => readHistory(text(match.id), text(match.host)), "pbot-quiet"); historyBody.append(item);
|
|
119
120
|
}
|
|
120
121
|
if (!rows(data.matches).length) historyBody.append(empty("没有找到匹配内容", "试试更短的关键词,或调整来源和时间范围。"));
|
|
121
|
-
if (offset) button(historyPaging, "上一页", () => searchHistory(Math.max(0, offset -
|
|
122
|
+
if (offset) button(historyPaging, "上一页", () => searchHistory(Math.max(0, offset - historyPageLimits.search.default), true));
|
|
122
123
|
if (typeof data.nextOffset === "number") button(historyPaging, "下一页", () => searchHistory(data.nextOffset as number, true));
|
|
123
124
|
}
|
|
124
125
|
async function readHistory(id: string, source: string, offset = 0, childrenOffset = 0) {
|
|
@@ -166,17 +167,32 @@ export function showManagement(ctx: Context, parentSessionId: SessionId) {
|
|
|
166
167
|
}
|
|
167
168
|
for (const control of tabs.values()) enabled(control, true);
|
|
168
169
|
materials.hidden = false; initializeButton.textContent = "准备目录"; enabled(initializeButton, true);
|
|
169
|
-
const historyState =
|
|
170
|
+
const historyState = object(snapshot.history) ? snapshot.history : null;
|
|
171
|
+
const historyDims = historyState && Array.isArray(historyState.dimensions) ? rows(historyState.dimensions) : [];
|
|
172
|
+
const historySummaryText = !historyState
|
|
173
|
+
? "已停用"
|
|
174
|
+
: `原始会话 ${text(historyState.rawCount ?? 0)}` + (historyDims.length
|
|
175
|
+
? " · " + historyDims.map(dim => {
|
|
176
|
+
const pending = Number(dim.pendingCreate ?? 0) + Number(dim.pendingIncremental ?? 0) + Number(dim.pendingRebuild ?? 0);
|
|
177
|
+
return `${text(dim.dimension)} ${text(dim.ready ?? 0)}/${text(dim.total ?? 0)}${pending ? `(待处理 ${pending})` : ""}`;
|
|
178
|
+
}).join(",")
|
|
179
|
+
: "");
|
|
180
|
+
const historyReminder = historyState && object(historyState.reminder) && typeof historyState.reminder.message === "string"
|
|
181
|
+
? historyState.reminder.message
|
|
182
|
+
: "";
|
|
170
183
|
counts.textContent = "Personal Bot 已启动 · 跨 Harness 调度通过 MCP worker_* 提供";
|
|
171
184
|
const model = object(snapshot.model) ? snapshot.model : {};
|
|
172
|
-
workspaceInfo.replaceChildren(
|
|
173
|
-
[
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
185
|
+
workspaceInfo.replaceChildren(
|
|
186
|
+
facts([
|
|
187
|
+
["状态", "已启动"],
|
|
188
|
+
["工作区", snapshot.workspaceRoot],
|
|
189
|
+
["配置文件", record(snapshot.configuration).path],
|
|
190
|
+
["模型", model.model || "尚未选择"],
|
|
191
|
+
["Provider", model.provider || "—"],
|
|
192
|
+
["历史", historySummaryText],
|
|
193
|
+
]),
|
|
194
|
+
...(historyReminder ? [note(historyReminder)] : []),
|
|
195
|
+
);
|
|
180
196
|
statusBody.textContent = JSON.stringify(snapshot, null, 2);
|
|
181
197
|
}
|
|
182
198
|
|
package/src/ui/dsh/styles.ts
CHANGED
|
@@ -20,15 +20,14 @@ export const managementStyles = `
|
|
|
20
20
|
.pbot-management h2 { font-size: 21px; font-weight: 600; }
|
|
21
21
|
.pbot-management h3 { font-size: 16px; font-weight: 600; }
|
|
22
22
|
.pbot-management h4 { font-size: 14px; font-weight: 600; }
|
|
23
|
-
.pbot-management button, .pbot-management input, .pbot-management
|
|
23
|
+
.pbot-management button, .pbot-management input, .pbot-management select { font: inherit; color: inherit; }
|
|
24
24
|
.pbot-management button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 13px; border: 1px solid var(--pbot-line); border-radius: 8px; background: var(--pbot-surface); cursor: pointer; line-height: 1.4; }
|
|
25
25
|
.pbot-management button:hover:not(:disabled) { background: var(--pbot-tint); border-color: color-mix(in srgb, var(--pbot-accent) 40%, var(--pbot-line)); }
|
|
26
26
|
.pbot-management button:disabled { opacity: .45; cursor: not-allowed; }
|
|
27
|
-
.pbot-management :is(button, input,
|
|
27
|
+
.pbot-management :is(button, input, select, summary):focus-visible { outline: 2px solid var(--pbot-accent); outline-offset: 3px; }
|
|
28
28
|
.pbot-management button.pbot-primary { background: var(--pbot-accent); border-color: var(--pbot-accent); color: var(--pbot-surface); font-weight: 600; }
|
|
29
29
|
.pbot-management button.pbot-primary:hover:not(:disabled) { filter: brightness(.94); background: var(--pbot-accent); }
|
|
30
30
|
.pbot-management button.pbot-quiet { border-color: transparent; background: transparent; }
|
|
31
|
-
.pbot-management button.pbot-danger { color: var(--pbot-danger); }
|
|
32
31
|
.pbot-management button[data-busy=true]::after { content: "…"; }
|
|
33
32
|
.pbot-shell { height: 100%; display: grid; grid-template-columns: 178px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
|
|
34
33
|
.pbot-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--pbot-line); }
|
|
@@ -39,7 +38,6 @@ export const managementStyles = `
|
|
|
39
38
|
.pbot-nav { display: flex; flex-direction: column; gap: 6px; padding: 22px 12px; background: var(--pbot-bg); border-right: 1px solid var(--pbot-line); }
|
|
40
39
|
.pbot-nav button { text-align: left; justify-content: space-between; border-color: transparent; background: transparent; padding: 11px 12px; color: var(--pbot-muted); }
|
|
41
40
|
.pbot-nav button[aria-selected=true] { color: var(--pbot-accent); background: var(--pbot-tint); font-weight: 600; }
|
|
42
|
-
.pbot-nav small { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .8; }
|
|
43
41
|
.pbot-main { min-width: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 26px 28px; }
|
|
44
42
|
.pbot-page-title { margin-bottom: 22px; display: grid; gap: 5px; }
|
|
45
43
|
.pbot-muted { color: var(--pbot-muted); font-size: 13px; overflow-wrap: anywhere; }
|
|
@@ -50,7 +48,6 @@ export const managementStyles = `
|
|
|
50
48
|
.pbot-notice[data-tone=error] { border-left-color: var(--pbot-danger); }
|
|
51
49
|
.pbot-notice:empty { display: none; }
|
|
52
50
|
.pbot-stack { display: grid; gap: 16px; }
|
|
53
|
-
.pbot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
54
51
|
.pbot-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
|
|
55
52
|
.pbot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
|
|
56
53
|
.pbot-counts { margin: -8px 0 20px !important; }
|
|
@@ -62,10 +59,6 @@ export const managementStyles = `
|
|
|
62
59
|
.pbot-card > :is(h3, .pbot-between) { margin-bottom: 12px; }
|
|
63
60
|
.pbot-badge { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--pbot-muted); background: var(--pbot-bg); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
|
|
64
61
|
.pbot-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
|
|
65
|
-
.pbot-badge:is([data-state=busy],[data-state=running],[data-state=starting]) { color: var(--pbot-accent); background: var(--pbot-tint); }
|
|
66
|
-
.pbot-badge:is([data-state=error],[data-state=failed]) { color: var(--pbot-danger); }
|
|
67
|
-
.pbot-badge[data-state=completed] { color: var(--dsw-alias-state-success-primary, #26834b); }
|
|
68
|
-
.pbot-badge:is([data-state=paused],[data-state=stopping]) { color: var(--dsw-alias-state-warn-label, #9a6500); }
|
|
69
62
|
.pbot-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; margin: 12px 0; font-size: 13px; }
|
|
70
63
|
.pbot-facts dt { color: var(--pbot-muted); }
|
|
71
64
|
.pbot-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
@@ -75,33 +68,15 @@ export const managementStyles = `
|
|
|
75
68
|
.pbot-disclosure .pbot-disclosure { background: var(--pbot-bg); }
|
|
76
69
|
.pbot-field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; font-size: 13px; }
|
|
77
70
|
.pbot-field > span { font-weight: 500; }
|
|
78
|
-
.pbot-field :is(input,
|
|
79
|
-
.pbot-field input
|
|
80
|
-
.pbot-field input::file-selector-button { border: 0; padding: 5px 8px; margin-right: 10px; border-radius: 4px; background: var(--pbot-tint); color: var(--pbot-ink); cursor: pointer; }
|
|
81
|
-
.pbot-field textarea { resize: vertical; min-height: 84px; }
|
|
82
|
-
.pbot-field input::placeholder, .pbot-field textarea::placeholder { color: var(--pbot-muted); opacity: .8; }
|
|
83
|
-
.pbot-split { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); gap: 22px; align-items: start; }
|
|
84
|
-
.pbot-list { display: grid; align-content: start; grid-auto-rows: max-content; gap: 6px; max-height: 470px; overflow-y: auto; padding: 3px; }
|
|
85
|
-
.pbot-management .pbot-list-item { display: block; width: 100%; text-align: left; padding: 12px; border: 1px solid transparent; min-width: 0; }
|
|
86
|
-
.pbot-list-item[aria-pressed=true] { background: var(--pbot-tint); border-color: color-mix(in srgb, var(--pbot-accent) 40%, var(--pbot-line)); }
|
|
87
|
-
.pbot-list-item strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
|
|
88
|
-
.pbot-list-item .pbot-muted { margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
71
|
+
.pbot-field :is(input,select) { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--pbot-line); border-radius: 7px; background: var(--pbot-surface); line-height: 1.5; }
|
|
72
|
+
.pbot-field input::placeholder { color: var(--pbot-muted); opacity: .8; }
|
|
89
73
|
.pbot-empty { padding: 38px 20px; border: 1px dashed var(--pbot-line); border-radius: 12px; text-align: center; display: grid; gap: 8px; }
|
|
90
74
|
.pbot-empty h3 { font-weight: 550; }
|
|
91
75
|
.pbot-empty button { justify-self: center; margin-top: 10px; }
|
|
92
|
-
.pbot-detail { min-width: 0; display: grid; gap: 18px; }
|
|
93
|
-
.pbot-detail-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
|
|
94
76
|
.pbot-prose { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 10px 0; line-height: 1.7; }
|
|
95
77
|
.pbot-raw { font: 12px/1.6 ui-monospace, SFMono-Regular, monospace; max-height: 340px; overflow: auto; }
|
|
96
|
-
.pbot-transcript { margin-top: 14px; }
|
|
97
|
-
.pbot-event { border-left: 2px solid var(--pbot-line); padding: 0 0 0 14px; margin: 18px 0; }
|
|
98
|
-
.pbot-event .pbot-prose { font-size: 13px; }
|
|
99
|
-
.pbot-event .pbot-row, .pbot-message .pbot-row { justify-content: space-between; }
|
|
100
78
|
.pbot-management .pbot-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; color: var(--pbot-muted); font-size: 12px; }
|
|
101
79
|
.pbot-pagination button { font-size: 12px; min-height: 30px; padding: 5px 9px; }
|
|
102
|
-
.pbot-message { padding: 16px 0; border-bottom: 1px solid var(--pbot-line); }
|
|
103
|
-
.pbot-message:last-child { border-bottom: 0; }
|
|
104
|
-
.pbot-message .pbot-prose { font-size: 13px; }
|
|
105
80
|
.pbot-search { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 12px; align-items: end; }
|
|
106
81
|
.pbot-search .pbot-field { margin: 0; }
|
|
107
82
|
.pbot-search > button { margin-bottom: 2px; }
|
|
@@ -114,16 +89,13 @@ export const managementStyles = `
|
|
|
114
89
|
.pbot-shell { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr) auto; }
|
|
115
90
|
.pbot-nav { flex-direction: row; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--pbot-line); }
|
|
116
91
|
.pbot-nav button { flex: 1; justify-content: center; padding: 8px; }
|
|
117
|
-
.pbot-nav small { display: none; }
|
|
118
92
|
.pbot-main { padding: 22px 18px; }
|
|
119
93
|
.pbot-notice { top: -22px; }
|
|
120
94
|
.pbot-header { padding: 14px 18px; }
|
|
121
|
-
.pbot-split { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: 16px; }
|
|
122
95
|
}
|
|
123
96
|
@media (max-width: 600px) {
|
|
124
97
|
.pbot-management { width: calc(100vw - 12px); height: calc(100dvh - 16px); }
|
|
125
|
-
.pbot-grid
|
|
126
|
-
.pbot-list { max-height: 215px; }
|
|
98
|
+
.pbot-grid { grid-template-columns: minmax(0, 1fr); }
|
|
127
99
|
.pbot-search { grid-template-columns: minmax(0, 1fr) 110px; }
|
|
128
100
|
.pbot-search > button { grid-column: 1 / -1; }
|
|
129
101
|
.pbot-footer { padding: 8px 14px; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtensionContext, KeybindingsManager, Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { ScrollView, SelectList, Text, matchesKey, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { Component } from "@earendil-works/pi-tui";
|
|
4
|
-
import { requireThat } from "
|
|
4
|
+
import { requireThat } from "../../common/validation.js";
|
|
5
5
|
|
|
6
6
|
/** One confirmation owns its viewport, selection, and abort listener. */
|
|
7
7
|
export class ConfirmationDialog implements Component {
|