@pi-harness/pi-harness 0.1.2 → 0.1.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/LICENSE +9 -0
- package/README.md +31 -7
- package/apps/web/dist/assets/index-BoEwZu6r.css +2 -0
- package/apps/web/dist/assets/index-alZn4u37.js +20 -0
- package/apps/web/dist/assets/markdown-vendor-DUdMWn0M.js +66 -0
- package/apps/web/dist/assets/react-vendor-BD7-wQo9.js +9 -0
- package/apps/web/dist/icons/app/android-192.png +0 -0
- package/apps/web/dist/icons/app/android-512.png +0 -0
- package/apps/web/dist/icons/app/app-blue-512.png +0 -0
- package/apps/web/dist/icons/app/app-store-1024.png +0 -0
- package/apps/web/dist/icons/app/apple-touch-icon-180.png +0 -0
- package/apps/web/dist/icons/app/maskable-512.png +0 -0
- package/apps/web/dist/icons/favicon/favicon-16.png +0 -0
- package/apps/web/dist/icons/favicon/favicon-32.png +0 -0
- package/apps/web/dist/icons/favicon/favicon-48.png +0 -0
- package/apps/web/dist/icons/png-blue/pi-256.png +0 -0
- package/apps/web/dist/icons/png-blue/pi-512.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-1024.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-128.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-16.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-24.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-256.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-32.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-48.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-512.png +0 -0
- package/apps/web/dist/icons/png-ink/pi-64.png +0 -0
- package/apps/web/dist/icons/png-white/pi-1024.png +0 -0
- package/apps/web/dist/icons/png-white/pi-128.png +0 -0
- package/apps/web/dist/icons/png-white/pi-16.png +0 -0
- package/apps/web/dist/icons/png-white/pi-24.png +0 -0
- package/apps/web/dist/icons/png-white/pi-256.png +0 -0
- package/apps/web/dist/icons/png-white/pi-32.png +0 -0
- package/apps/web/dist/icons/png-white/pi-48.png +0 -0
- package/apps/web/dist/icons/png-white/pi-512.png +0 -0
- package/apps/web/dist/icons/png-white/pi-64.png +0 -0
- package/apps/web/dist/icons/social/og-1200x630.png +0 -0
- package/apps/web/dist/icons/svg/app-icon-blue.svg +13 -0
- package/apps/web/dist/icons/svg/app-icon-ink.svg +13 -0
- package/apps/web/dist/icons/svg/favicon.svg +10 -0
- package/apps/web/dist/icons/svg/lockup-horizontal.svg +13 -0
- package/apps/web/dist/icons/svg/mark-blue.svg +10 -0
- package/apps/web/dist/icons/svg/mark-compact.svg +10 -0
- package/apps/web/dist/icons/svg/mark-ink.svg +10 -0
- package/apps/web/dist/icons/svg/mark-white.svg +10 -0
- package/apps/web/dist/icons/svg/mark.svg +10 -0
- package/apps/web/dist/index.html +18 -6
- package/apps/web/dist/manifest.webmanifest +14 -0
- package/apps/web/index.html +14 -4
- package/apps/web/package.json +11 -9
- package/apps/web/profile/cordis.yml +222 -1
- package/apps/web/public/icons/app/android-192.png +0 -0
- package/apps/web/public/icons/app/android-512.png +0 -0
- package/apps/web/public/icons/app/app-blue-512.png +0 -0
- package/apps/web/public/icons/app/app-store-1024.png +0 -0
- package/apps/web/public/icons/app/apple-touch-icon-180.png +0 -0
- package/apps/web/public/icons/app/maskable-512.png +0 -0
- package/apps/web/public/icons/favicon/favicon-16.png +0 -0
- package/apps/web/public/icons/favicon/favicon-32.png +0 -0
- package/apps/web/public/icons/favicon/favicon-48.png +0 -0
- package/apps/web/public/icons/png-blue/pi-256.png +0 -0
- package/apps/web/public/icons/png-blue/pi-512.png +0 -0
- package/apps/web/public/icons/png-ink/pi-1024.png +0 -0
- package/apps/web/public/icons/png-ink/pi-128.png +0 -0
- package/apps/web/public/icons/png-ink/pi-16.png +0 -0
- package/apps/web/public/icons/png-ink/pi-24.png +0 -0
- package/apps/web/public/icons/png-ink/pi-256.png +0 -0
- package/apps/web/public/icons/png-ink/pi-32.png +0 -0
- package/apps/web/public/icons/png-ink/pi-48.png +0 -0
- package/apps/web/public/icons/png-ink/pi-512.png +0 -0
- package/apps/web/public/icons/png-ink/pi-64.png +0 -0
- package/apps/web/public/icons/png-white/pi-1024.png +0 -0
- package/apps/web/public/icons/png-white/pi-128.png +0 -0
- package/apps/web/public/icons/png-white/pi-16.png +0 -0
- package/apps/web/public/icons/png-white/pi-24.png +0 -0
- package/apps/web/public/icons/png-white/pi-256.png +0 -0
- package/apps/web/public/icons/png-white/pi-32.png +0 -0
- package/apps/web/public/icons/png-white/pi-48.png +0 -0
- package/apps/web/public/icons/png-white/pi-512.png +0 -0
- package/apps/web/public/icons/png-white/pi-64.png +0 -0
- package/apps/web/public/icons/social/og-1200x630.png +0 -0
- package/apps/web/public/icons/svg/app-icon-blue.svg +13 -0
- package/apps/web/public/icons/svg/app-icon-ink.svg +13 -0
- package/apps/web/public/icons/svg/favicon.svg +10 -0
- package/apps/web/public/icons/svg/lockup-horizontal.svg +13 -0
- package/apps/web/public/icons/svg/mark-blue.svg +10 -0
- package/apps/web/public/icons/svg/mark-compact.svg +10 -0
- package/apps/web/public/icons/svg/mark-ink.svg +10 -0
- package/apps/web/public/icons/svg/mark-white.svg +10 -0
- package/apps/web/public/icons/svg/mark.svg +10 -0
- package/apps/web/public/manifest.webmanifest +14 -0
- package/apps/web/server-dist/bin.js +19 -6
- package/apps/web/server-dist/bin.js.map +1 -1
- package/apps/web/src/command-palette.ts +28 -7
- package/apps/web/src/file-diff.ts +15 -10
- package/apps/web/src/main.ts +4 -1
- package/apps/web/src/runtime.css +17 -4
- package/apps/web/src/server/bin.ts +24 -7
- package/apps/web/src/style.css +2604 -8
- package/apps/web/src/tailwind.css +25 -0
- package/apps/web/tsconfig.build.json +5 -1
- package/apps/web/tsconfig.json +1 -1
- package/apps/web/vite.config.ts +20 -0
- package/package.json +29 -17
- package/packages/api-gateway/LICENSE +9 -0
- package/packages/api-gateway/dist/index.d.ts.map +1 -1
- package/packages/api-gateway/dist/index.js +1188 -42
- package/packages/api-gateway/dist/index.js.map +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/agent-teams.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/archify.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +25 -0
- package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +22 -0
- package/packages/api-gateway/dist/marketplace-entries/official/context.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-group.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-timer.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cost-meter.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/genui.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +25 -0
- package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/memory.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +19 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +22 -0
- package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +19 -0
- package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +22 -0
- package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +16 -0
- package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +16 -0
- package/packages/api-gateway/dist/marketplace.d.ts +40 -2
- package/packages/api-gateway/dist/marketplace.d.ts.map +1 -1
- package/packages/api-gateway/dist/marketplace.js +225 -19
- package/packages/api-gateway/dist/marketplace.js.map +1 -1
- package/packages/api-gateway/dist/workspaces.d.ts +8 -0
- package/packages/api-gateway/dist/workspaces.d.ts.map +1 -0
- package/packages/api-gateway/dist/workspaces.js +14 -0
- package/packages/api-gateway/dist/workspaces.js.map +1 -0
- package/packages/api-gateway/package.json +20 -10
- package/packages/api-gateway/scripts/copy-marketplace-entries.mjs +13 -0
- package/packages/api-gateway/src/index.ts +1258 -61
- package/packages/api-gateway/src/marketplace-entries/official/agent-teams.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/annotation.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/archify.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/at-file.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +25 -0
- package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +22 -0
- package/packages/api-gateway/src/marketplace-entries/official/context.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cordis-group.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cordis-logger-console.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cordis-timer.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/cost-meter.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/genui.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +25 -0
- package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/memory.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +19 -0
- package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/modlens.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/module-search.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/openpets.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +22 -0
- package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-export.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-search.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/synapse.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +19 -0
- package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +22 -0
- package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/web-research.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +16 -0
- package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +16 -0
- package/packages/api-gateway/src/marketplace.ts +267 -22
- package/packages/api-gateway/src/workspaces.ts +20 -0
- package/packages/api-gateway/test/index.test.ts +483 -33
- package/packages/api-gateway/test/marketplace.test.ts +282 -3
- package/packages/api-gateway/test/workspaces.test.ts +13 -0
- package/packages/api-gateway/tsconfig.build.json +1 -1
- package/packages/api-gateway/tsconfig.json +1 -1
- package/packages/bundle-web-app/LICENSE +9 -0
- package/packages/bundle-web-app/package.json +19 -9
- package/packages/bundle-web-app/tsconfig.build.json +1 -1
- package/packages/bundle-web-app/tsconfig.json +1 -1
- package/packages/cli/LICENSE +9 -0
- package/packages/cli/dist/args.d.ts.map +1 -1
- package/packages/cli/dist/args.js +16 -9
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/bin.js +12 -3
- package/packages/cli/dist/bin.js.map +1 -1
- package/packages/cli/dist/main.d.ts +1 -0
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +49 -9
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/dist/node-stdio.d.ts +3 -1
- package/packages/cli/dist/node-stdio.d.ts.map +1 -1
- package/packages/cli/dist/node-stdio.js +91 -13
- package/packages/cli/dist/node-stdio.js.map +1 -1
- package/packages/cli/dist/relaunch.d.ts.map +1 -1
- package/packages/cli/dist/relaunch.js +23 -10
- package/packages/cli/dist/relaunch.js.map +1 -1
- package/packages/cli/package.json +18 -8
- package/packages/cli/src/args.ts +16 -10
- package/packages/cli/src/bin.ts +12 -3
- package/packages/cli/src/main.ts +54 -10
- package/packages/cli/src/node-stdio.ts +85 -13
- package/packages/cli/src/relaunch.ts +19 -6
- package/packages/cli/test/args.test.ts +22 -3
- package/packages/cli/test/binary.test.ts +58 -0
- package/packages/cli/test/broken-pipe.test.ts +32 -0
- package/packages/cli/test/cli.test.ts +57 -8
- package/packages/cli/test/node-stdio.test.ts +89 -0
- package/packages/cli/test/relaunch.test.ts +30 -2
- package/packages/cli/test/stdin-shutdown.test.ts +59 -0
- package/packages/cli/tsconfig.build.json +1 -3
- package/packages/cli/tsconfig.json +1 -4
- package/packages/client-web/LICENSE +9 -0
- package/packages/client-web/dist/annotation-ui.d.ts +11 -0
- package/packages/client-web/dist/annotation-ui.d.ts.map +1 -0
- package/packages/client-web/dist/annotation-ui.js +24 -0
- package/packages/client-web/dist/annotation-ui.js.map +1 -0
- package/packages/client-web/dist/browser-session-view.d.ts +7 -0
- package/packages/client-web/dist/browser-session-view.d.ts.map +1 -0
- package/packages/client-web/dist/browser-session-view.js +8 -0
- package/packages/client-web/dist/browser-session-view.js.map +1 -0
- package/packages/client-web/dist/control-room.d.ts +151 -6
- package/packages/client-web/dist/control-room.d.ts.map +1 -1
- package/packages/client-web/dist/control-room.js +156 -11
- package/packages/client-web/dist/control-room.js.map +1 -1
- package/packages/client-web/dist/design-contract.d.ts.map +1 -1
- package/packages/client-web/dist/design-contract.js +178 -19
- package/packages/client-web/dist/design-contract.js.map +1 -1
- package/packages/client-web/dist/index.d.ts +4 -1
- package/packages/client-web/dist/index.d.ts.map +1 -1
- package/packages/client-web/dist/index.js +11 -3
- package/packages/client-web/dist/index.js.map +1 -1
- package/packages/client-web/dist/markdown.d.ts +5 -0
- package/packages/client-web/dist/markdown.d.ts.map +1 -0
- package/packages/client-web/dist/markdown.js +20 -0
- package/packages/client-web/dist/markdown.js.map +1 -0
- package/packages/client-web/dist/marketplace-catalog.d.ts +3 -0
- package/packages/client-web/dist/marketplace-catalog.d.ts.map +1 -0
- package/packages/client-web/dist/marketplace-catalog.js +10 -0
- package/packages/client-web/dist/marketplace-catalog.js.map +1 -0
- package/packages/client-web/dist/marketplace-navigation.d.ts +19 -0
- package/packages/client-web/dist/marketplace-navigation.d.ts.map +1 -0
- package/packages/client-web/dist/marketplace-navigation.js +31 -0
- package/packages/client-web/dist/marketplace-navigation.js.map +1 -0
- package/packages/client-web/dist/message-content.d.ts +9 -0
- package/packages/client-web/dist/message-content.d.ts.map +1 -0
- package/packages/client-web/dist/message-content.js +54 -0
- package/packages/client-web/dist/message-content.js.map +1 -0
- package/packages/client-web/dist/plugin-navigation.d.ts +3 -0
- package/packages/client-web/dist/plugin-navigation.d.ts.map +1 -0
- package/packages/client-web/dist/plugin-navigation.js +10 -0
- package/packages/client-web/dist/plugin-navigation.js.map +1 -0
- package/packages/client-web/dist/plugin-search.d.ts +2 -0
- package/packages/client-web/dist/plugin-search.d.ts.map +1 -0
- package/packages/client-web/dist/plugin-search.js +7 -0
- package/packages/client-web/dist/plugin-search.js.map +1 -0
- package/packages/client-web/dist/plugin-stars-view.d.ts +12 -0
- package/packages/client-web/dist/plugin-stars-view.d.ts.map +1 -0
- package/packages/client-web/dist/plugin-stars-view.js +8 -0
- package/packages/client-web/dist/plugin-stars-view.js.map +1 -0
- package/packages/client-web/dist/prompt-completion.d.ts +13 -0
- package/packages/client-web/dist/prompt-completion.d.ts.map +1 -0
- package/packages/client-web/dist/prompt-completion.js +17 -0
- package/packages/client-web/dist/prompt-completion.js.map +1 -0
- package/packages/client-web/dist/react-room.d.ts +2 -1
- package/packages/client-web/dist/react-room.d.ts.map +1 -1
- package/packages/client-web/dist/react-room.js +2347 -93
- package/packages/client-web/dist/react-room.js.map +1 -1
- package/packages/client-web/dist/runtime-events.d.ts +4 -0
- package/packages/client-web/dist/runtime-events.d.ts.map +1 -0
- package/packages/client-web/dist/runtime-events.js +29 -0
- package/packages/client-web/dist/runtime-events.js.map +1 -0
- package/packages/client-web/package.json +19 -7
- package/packages/client-web/src/annotation-ui.ts +29 -0
- package/packages/client-web/src/browser-session-view.ts +13 -0
- package/packages/client-web/src/control-room.ts +359 -11
- package/packages/client-web/src/design-contract.ts +248 -26
- package/packages/client-web/src/index.ts +17 -4
- package/packages/client-web/src/markdown.tsx +22 -0
- package/packages/client-web/src/marketplace-catalog.ts +10 -0
- package/packages/client-web/src/marketplace-navigation.ts +46 -0
- package/packages/client-web/src/message-content.ts +51 -0
- package/packages/client-web/src/plugin-navigation.ts +9 -0
- package/packages/client-web/src/plugin-search.ts +5 -0
- package/packages/client-web/src/plugin-stars-view.ts +19 -0
- package/packages/client-web/src/prompt-completion.ts +24 -0
- package/packages/client-web/src/react-room.tsx +7358 -54
- package/packages/client-web/src/runtime-events.ts +29 -0
- package/packages/client-web/test/annotation-ui.test.ts +21 -0
- package/packages/client-web/test/browser-session-view.test.ts +17 -0
- package/packages/client-web/test/design-contract.test.ts +46 -1
- package/packages/client-web/test/marketplace-catalog.test.ts +52 -0
- package/packages/client-web/test/message-content.test.ts +43 -0
- package/packages/client-web/test/plugin-navigation.test.ts +16 -0
- package/packages/client-web/test/plugin-search.test.ts +22 -0
- package/packages/client-web/test/plugin-stars-view.test.ts +20 -0
- package/packages/client-web/test/prompt-completion.test.ts +21 -0
- package/packages/client-web/test/runtime-events.test.ts +28 -0
- package/packages/client-web/tsconfig.build.json +13 -1
- package/packages/client-web/tsconfig.json +11 -1
- package/packages/core/LICENSE +9 -0
- package/packages/core/dist/boot.d.ts.map +1 -1
- package/packages/core/dist/boot.js +42 -3
- package/packages/core/dist/boot.js.map +1 -1
- package/packages/core/dist/config.d.ts +2 -0
- package/packages/core/dist/config.d.ts.map +1 -0
- package/packages/core/dist/config.js +8 -0
- package/packages/core/dist/config.js.map +1 -0
- package/packages/core/dist/http.d.ts +8 -0
- package/packages/core/dist/http.d.ts.map +1 -0
- package/packages/core/dist/http.js +27 -0
- package/packages/core/dist/http.js.map +1 -0
- package/packages/core/dist/index.d.ts +2 -0
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +2 -0
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/plugins/agent-teams.d.ts +17 -0
- package/packages/core/dist/plugins/agent-teams.d.ts.map +1 -0
- package/packages/core/dist/plugins/agent-teams.js +298 -0
- package/packages/core/dist/plugins/agent-teams.js.map +1 -0
- package/packages/core/dist/plugins/anchored-standard.d.ts +14 -0
- package/packages/core/dist/plugins/anchored-standard.d.ts.map +1 -0
- package/packages/core/dist/plugins/anchored-standard.js +84 -0
- package/packages/core/dist/plugins/anchored-standard.js.map +1 -0
- package/packages/core/dist/plugins/annotation.d.ts +18 -0
- package/packages/core/dist/plugins/annotation.d.ts.map +1 -0
- package/packages/core/dist/plugins/annotation.js +94 -0
- package/packages/core/dist/plugins/annotation.js.map +1 -0
- package/packages/core/dist/plugins/archify.d.ts +23 -0
- package/packages/core/dist/plugins/archify.d.ts.map +1 -0
- package/packages/core/dist/plugins/archify.js +98 -0
- package/packages/core/dist/plugins/archify.js.map +1 -0
- package/packages/core/dist/plugins/at-file.d.ts +8 -0
- package/packages/core/dist/plugins/at-file.d.ts.map +1 -0
- package/packages/core/dist/plugins/at-file.js +52 -0
- package/packages/core/dist/plugins/at-file.js.map +1 -0
- package/packages/core/dist/plugins/auto-mode.d.ts +15 -0
- package/packages/core/dist/plugins/auto-mode.d.ts.map +1 -0
- package/packages/core/dist/plugins/auto-mode.js +114 -0
- package/packages/core/dist/plugins/auto-mode.js.map +1 -0
- package/packages/core/dist/plugins/better-sidebar.d.ts +37 -0
- package/packages/core/dist/plugins/better-sidebar.d.ts.map +1 -0
- package/packages/core/dist/plugins/better-sidebar.js +89 -0
- package/packages/core/dist/plugins/better-sidebar.js.map +1 -0
- package/packages/core/dist/plugins/browser-fetch.d.ts +14 -0
- package/packages/core/dist/plugins/browser-fetch.d.ts.map +1 -0
- package/packages/core/dist/plugins/browser-fetch.js +167 -0
- package/packages/core/dist/plugins/browser-fetch.js.map +1 -0
- package/packages/core/dist/plugins/browser-session.d.ts +14 -0
- package/packages/core/dist/plugins/browser-session.d.ts.map +1 -0
- package/packages/core/dist/plugins/browser-session.js +265 -0
- package/packages/core/dist/plugins/browser-session.js.map +1 -0
- package/packages/core/dist/plugins/canvas-draw.d.ts +8 -0
- package/packages/core/dist/plugins/canvas-draw.d.ts.map +1 -0
- package/packages/core/dist/plugins/canvas-draw.js +88 -0
- package/packages/core/dist/plugins/canvas-draw.js.map +1 -0
- package/packages/core/dist/plugins/change-verifier.d.ts +8 -0
- package/packages/core/dist/plugins/change-verifier.d.ts.map +1 -0
- package/packages/core/dist/plugins/change-verifier.js +67 -0
- package/packages/core/dist/plugins/change-verifier.js.map +1 -0
- package/packages/core/dist/plugins/cleaner.d.ts +8 -0
- package/packages/core/dist/plugins/cleaner.d.ts.map +1 -0
- package/packages/core/dist/plugins/cleaner.js +56 -0
- package/packages/core/dist/plugins/cleaner.js.map +1 -0
- package/packages/core/dist/plugins/cli-notifier.d.ts +15 -0
- package/packages/core/dist/plugins/cli-notifier.d.ts.map +1 -0
- package/packages/core/dist/plugins/cli-notifier.js +110 -0
- package/packages/core/dist/plugins/cli-notifier.js.map +1 -0
- package/packages/core/dist/plugins/code2skill.d.ts +8 -0
- package/packages/core/dist/plugins/code2skill.d.ts.map +1 -0
- package/packages/core/dist/plugins/code2skill.js +95 -0
- package/packages/core/dist/plugins/code2skill.js.map +1 -0
- package/packages/core/dist/plugins/colleague-skill.d.ts +27 -0
- package/packages/core/dist/plugins/colleague-skill.d.ts.map +1 -0
- package/packages/core/dist/plugins/colleague-skill.js +99 -0
- package/packages/core/dist/plugins/colleague-skill.js.map +1 -0
- package/packages/core/dist/plugins/context-doctor.d.ts +30 -0
- package/packages/core/dist/plugins/context-doctor.d.ts.map +1 -0
- package/packages/core/dist/plugins/context-doctor.js +95 -0
- package/packages/core/dist/plugins/context-doctor.js.map +1 -0
- package/packages/core/dist/plugins/context.d.ts +8 -0
- package/packages/core/dist/plugins/context.d.ts.map +1 -0
- package/packages/core/dist/plugins/context.js +87 -0
- package/packages/core/dist/plugins/context.js.map +1 -0
- package/packages/core/dist/plugins/cost-meter.d.ts +32 -0
- package/packages/core/dist/plugins/cost-meter.d.ts.map +1 -0
- package/packages/core/dist/plugins/cost-meter.js +204 -0
- package/packages/core/dist/plugins/cost-meter.js.map +1 -0
- package/packages/core/dist/plugins/dependency-checker.d.ts +27 -0
- package/packages/core/dist/plugins/dependency-checker.d.ts.map +1 -0
- package/packages/core/dist/plugins/dependency-checker.js +221 -0
- package/packages/core/dist/plugins/dependency-checker.js.map +1 -0
- package/packages/core/dist/plugins/docker-sandbox.d.ts +8 -0
- package/packages/core/dist/plugins/docker-sandbox.d.ts.map +1 -0
- package/packages/core/dist/plugins/docker-sandbox.js +102 -0
- package/packages/core/dist/plugins/docker-sandbox.js.map +1 -0
- package/packages/core/dist/plugins/fail-logger.d.ts +8 -0
- package/packages/core/dist/plugins/fail-logger.d.ts.map +1 -0
- package/packages/core/dist/plugins/fail-logger.js +51 -0
- package/packages/core/dist/plugins/fail-logger.js.map +1 -0
- package/packages/core/dist/plugins/genui.d.ts +8 -0
- package/packages/core/dist/plugins/genui.d.ts.map +1 -0
- package/packages/core/dist/plugins/genui.js +79 -0
- package/packages/core/dist/plugins/genui.js.map +1 -0
- package/packages/core/dist/plugins/git-time-capsule.d.ts +9 -0
- package/packages/core/dist/plugins/git-time-capsule.d.ts.map +1 -0
- package/packages/core/dist/plugins/git-time-capsule.js +90 -0
- package/packages/core/dist/plugins/git-time-capsule.js.map +1 -0
- package/packages/core/dist/plugins/graph-memory.d.ts +16 -0
- package/packages/core/dist/plugins/graph-memory.d.ts.map +1 -0
- package/packages/core/dist/plugins/graph-memory.js +382 -0
- package/packages/core/dist/plugins/graph-memory.js.map +1 -0
- package/packages/core/dist/plugins/history-compressor.d.ts +15 -0
- package/packages/core/dist/plugins/history-compressor.d.ts.map +1 -0
- package/packages/core/dist/plugins/history-compressor.js +80 -0
- package/packages/core/dist/plugins/history-compressor.js.map +1 -0
- package/packages/core/dist/plugins/hol-guard.d.ts +29 -0
- package/packages/core/dist/plugins/hol-guard.d.ts.map +1 -0
- package/packages/core/dist/plugins/hol-guard.js +139 -0
- package/packages/core/dist/plugins/hol-guard.js.map +1 -0
- package/packages/core/dist/plugins/i18n-pair.d.ts +8 -0
- package/packages/core/dist/plugins/i18n-pair.d.ts.map +1 -0
- package/packages/core/dist/plugins/i18n-pair.js +76 -0
- package/packages/core/dist/plugins/i18n-pair.js.map +1 -0
- package/packages/core/dist/plugins/image-compressor.d.ts +8 -0
- package/packages/core/dist/plugins/image-compressor.d.ts.map +1 -0
- package/packages/core/dist/plugins/image-compressor.js +150 -0
- package/packages/core/dist/plugins/image-compressor.js.map +1 -0
- package/packages/core/dist/plugins/llm-verifier.d.ts +42 -0
- package/packages/core/dist/plugins/llm-verifier.d.ts.map +1 -0
- package/packages/core/dist/plugins/llm-verifier.js +128 -0
- package/packages/core/dist/plugins/llm-verifier.js.map +1 -0
- package/packages/core/dist/plugins/mcp-client.d.ts +19 -0
- package/packages/core/dist/plugins/mcp-client.d.ts.map +1 -0
- package/packages/core/dist/plugins/mcp-client.js +534 -0
- package/packages/core/dist/plugins/mcp-client.js.map +1 -0
- package/packages/core/dist/plugins/mcp-panel.d.ts +14 -0
- package/packages/core/dist/plugins/mcp-panel.d.ts.map +1 -0
- package/packages/core/dist/plugins/mcp-panel.js +180 -0
- package/packages/core/dist/plugins/mcp-panel.js.map +1 -0
- package/packages/core/dist/plugins/memory.d.ts +15 -0
- package/packages/core/dist/plugins/memory.d.ts.map +1 -0
- package/packages/core/dist/plugins/memory.js +161 -0
- package/packages/core/dist/plugins/memory.js.map +1 -0
- package/packages/core/dist/plugins/mirage-bridge.d.ts +23 -0
- package/packages/core/dist/plugins/mirage-bridge.d.ts.map +1 -0
- package/packages/core/dist/plugins/mirage-bridge.js +149 -0
- package/packages/core/dist/plugins/mirage-bridge.js.map +1 -0
- package/packages/core/dist/plugins/mock-server.d.ts +22 -0
- package/packages/core/dist/plugins/mock-server.d.ts.map +1 -0
- package/packages/core/dist/plugins/mock-server.js +149 -0
- package/packages/core/dist/plugins/mock-server.js.map +1 -0
- package/packages/core/dist/plugins/model.d.ts +1 -1
- package/packages/core/dist/plugins/model.d.ts.map +1 -1
- package/packages/core/dist/plugins/model.js +3 -1
- package/packages/core/dist/plugins/model.js.map +1 -1
- package/packages/core/dist/plugins/models.d.ts.map +1 -1
- package/packages/core/dist/plugins/models.js +5 -2
- package/packages/core/dist/plugins/models.js.map +1 -1
- package/packages/core/dist/plugins/modlens.d.ts +8 -0
- package/packages/core/dist/plugins/modlens.d.ts.map +1 -0
- package/packages/core/dist/plugins/modlens.js +63 -0
- package/packages/core/dist/plugins/modlens.js.map +1 -0
- package/packages/core/dist/plugins/module-search.d.ts +27 -0
- package/packages/core/dist/plugins/module-search.d.ts.map +1 -0
- package/packages/core/dist/plugins/module-search.js +174 -0
- package/packages/core/dist/plugins/module-search.js.map +1 -0
- package/packages/core/dist/plugins/obsidian-sync.d.ts +14 -0
- package/packages/core/dist/plugins/obsidian-sync.d.ts.map +1 -0
- package/packages/core/dist/plugins/obsidian-sync.js +79 -0
- package/packages/core/dist/plugins/obsidian-sync.js.map +1 -0
- package/packages/core/dist/plugins/openpets.d.ts +14 -0
- package/packages/core/dist/plugins/openpets.d.ts.map +1 -0
- package/packages/core/dist/plugins/openpets.js +99 -0
- package/packages/core/dist/plugins/openpets.js.map +1 -0
- package/packages/core/dist/plugins/plan-execute.d.ts +8 -0
- package/packages/core/dist/plugins/plan-execute.d.ts.map +1 -0
- package/packages/core/dist/plugins/plan-execute.js +70 -0
- package/packages/core/dist/plugins/plan-execute.js.map +1 -0
- package/packages/core/dist/plugins/plugin-check.d.ts +38 -0
- package/packages/core/dist/plugins/plugin-check.d.ts.map +1 -0
- package/packages/core/dist/plugins/plugin-check.js +227 -0
- package/packages/core/dist/plugins/plugin-check.js.map +1 -0
- package/packages/core/dist/plugins/plugin-dev.d.ts +8 -0
- package/packages/core/dist/plugins/plugin-dev.d.ts.map +1 -0
- package/packages/core/dist/plugins/plugin-dev.js +44 -0
- package/packages/core/dist/plugins/plugin-dev.js.map +1 -0
- package/packages/core/dist/plugins/plugin-finder.d.ts +16 -0
- package/packages/core/dist/plugins/plugin-finder.d.ts.map +1 -0
- package/packages/core/dist/plugins/plugin-finder.js +98 -0
- package/packages/core/dist/plugins/plugin-finder.js.map +1 -0
- package/packages/core/dist/plugins/plugin-radar.d.ts +29 -0
- package/packages/core/dist/plugins/plugin-radar.d.ts.map +1 -0
- package/packages/core/dist/plugins/plugin-radar.js +146 -0
- package/packages/core/dist/plugins/plugin-radar.js.map +1 -0
- package/packages/core/dist/plugins/plugin-stars.d.ts +45 -0
- package/packages/core/dist/plugins/plugin-stars.d.ts.map +1 -0
- package/packages/core/dist/plugins/plugin-stars.js +165 -0
- package/packages/core/dist/plugins/plugin-stars.js.map +1 -0
- package/packages/core/dist/plugins/prompt-guard.d.ts +8 -0
- package/packages/core/dist/plugins/prompt-guard.d.ts.map +1 -0
- package/packages/core/dist/plugins/prompt-guard.js +114 -0
- package/packages/core/dist/plugins/prompt-guard.js.map +1 -0
- package/packages/core/dist/plugins/prompt-library.d.ts +25 -0
- package/packages/core/dist/plugins/prompt-library.d.ts.map +1 -0
- package/packages/core/dist/plugins/prompt-library.js +142 -0
- package/packages/core/dist/plugins/prompt-library.js.map +1 -0
- package/packages/core/dist/plugins/readme-gen.d.ts +25 -0
- package/packages/core/dist/plugins/readme-gen.d.ts.map +1 -0
- package/packages/core/dist/plugins/readme-gen.js +139 -0
- package/packages/core/dist/plugins/readme-gen.js.map +1 -0
- package/packages/core/dist/plugins/recall-unread.d.ts +24 -0
- package/packages/core/dist/plugins/recall-unread.d.ts.map +1 -0
- package/packages/core/dist/plugins/recall-unread.js +124 -0
- package/packages/core/dist/plugins/recall-unread.js.map +1 -0
- package/packages/core/dist/plugins/resources.d.ts +1 -0
- package/packages/core/dist/plugins/resources.d.ts.map +1 -1
- package/packages/core/dist/plugins/resources.js +31 -22
- package/packages/core/dist/plugins/resources.js.map +1 -1
- package/packages/core/dist/plugins/reverse-skill.d.ts +23 -0
- package/packages/core/dist/plugins/reverse-skill.d.ts.map +1 -0
- package/packages/core/dist/plugins/reverse-skill.js +60 -0
- package/packages/core/dist/plugins/reverse-skill.js.map +1 -0
- package/packages/core/dist/plugins/reviewer-bot.d.ts +14 -0
- package/packages/core/dist/plugins/reviewer-bot.d.ts.map +1 -0
- package/packages/core/dist/plugins/reviewer-bot.js +133 -0
- package/packages/core/dist/plugins/reviewer-bot.js.map +1 -0
- package/packages/core/dist/plugins/runtime-doctor.d.ts +33 -0
- package/packages/core/dist/plugins/runtime-doctor.d.ts.map +1 -0
- package/packages/core/dist/plugins/runtime-doctor.js +114 -0
- package/packages/core/dist/plugins/runtime-doctor.js.map +1 -0
- package/packages/core/dist/plugins/runtime.d.ts.map +1 -1
- package/packages/core/dist/plugins/runtime.js +63 -14
- package/packages/core/dist/plugins/runtime.js.map +1 -1
- package/packages/core/dist/plugins/secure-audit.d.ts +31 -0
- package/packages/core/dist/plugins/secure-audit.d.ts.map +1 -0
- package/packages/core/dist/plugins/secure-audit.js +121 -0
- package/packages/core/dist/plugins/secure-audit.js.map +1 -0
- package/packages/core/dist/plugins/session-bookmarks.d.ts +15 -0
- package/packages/core/dist/plugins/session-bookmarks.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-bookmarks.js +87 -0
- package/packages/core/dist/plugins/session-bookmarks.js.map +1 -0
- package/packages/core/dist/plugins/session-bridge.d.ts +44 -0
- package/packages/core/dist/plugins/session-bridge.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-bridge.js +265 -0
- package/packages/core/dist/plugins/session-bridge.js.map +1 -0
- package/packages/core/dist/plugins/session-compare.d.ts +33 -0
- package/packages/core/dist/plugins/session-compare.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-compare.js +150 -0
- package/packages/core/dist/plugins/session-compare.js.map +1 -0
- package/packages/core/dist/plugins/session-export.d.ts +9 -0
- package/packages/core/dist/plugins/session-export.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-export.js +93 -0
- package/packages/core/dist/plugins/session-export.js.map +1 -0
- package/packages/core/dist/plugins/session-insights.d.ts +8 -0
- package/packages/core/dist/plugins/session-insights.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-insights.js +47 -0
- package/packages/core/dist/plugins/session-insights.js.map +1 -0
- package/packages/core/dist/plugins/session-search.d.ts +20 -0
- package/packages/core/dist/plugins/session-search.d.ts.map +1 -0
- package/packages/core/dist/plugins/session-search.js +122 -0
- package/packages/core/dist/plugins/session-search.js.map +1 -0
- package/packages/core/dist/plugins/session.d.ts.map +1 -1
- package/packages/core/dist/plugins/session.js +4 -2
- package/packages/core/dist/plugins/session.js.map +1 -1
- package/packages/core/dist/plugins/skill-catalog.d.ts +26 -0
- package/packages/core/dist/plugins/skill-catalog.d.ts.map +1 -0
- package/packages/core/dist/plugins/skill-catalog.js +97 -0
- package/packages/core/dist/plugins/skill-catalog.js.map +1 -0
- package/packages/core/dist/plugins/skill-guard.d.ts +26 -0
- package/packages/core/dist/plugins/skill-guard.d.ts.map +1 -0
- package/packages/core/dist/plugins/skill-guard.js +139 -0
- package/packages/core/dist/plugins/skill-guard.js.map +1 -0
- package/packages/core/dist/plugins/sql-lens.d.ts +8 -0
- package/packages/core/dist/plugins/sql-lens.d.ts.map +1 -0
- package/packages/core/dist/plugins/sql-lens.js +85 -0
- package/packages/core/dist/plugins/sql-lens.js.map +1 -0
- package/packages/core/dist/plugins/stdio.d.ts +1 -1
- package/packages/core/dist/plugins/stdio.d.ts.map +1 -1
- package/packages/core/dist/plugins/stdio.js +3 -1
- package/packages/core/dist/plugins/stdio.js.map +1 -1
- package/packages/core/dist/plugins/synapse.d.ts +38 -0
- package/packages/core/dist/plugins/synapse.d.ts.map +1 -0
- package/packages/core/dist/plugins/synapse.js +93 -0
- package/packages/core/dist/plugins/synapse.js.map +1 -0
- package/packages/core/dist/plugins/tab-manager.d.ts +8 -0
- package/packages/core/dist/plugins/tab-manager.d.ts.map +1 -0
- package/packages/core/dist/plugins/tab-manager.js +135 -0
- package/packages/core/dist/plugins/tab-manager.js.map +1 -0
- package/packages/core/dist/plugins/taskboard.d.ts +15 -0
- package/packages/core/dist/plugins/taskboard.d.ts.map +1 -0
- package/packages/core/dist/plugins/taskboard.js +347 -0
- package/packages/core/dist/plugins/taskboard.js.map +1 -0
- package/packages/core/dist/plugins/telemetry-blocker.d.ts +8 -0
- package/packages/core/dist/plugins/telemetry-blocker.d.ts.map +1 -0
- package/packages/core/dist/plugins/telemetry-blocker.js +57 -0
- package/packages/core/dist/plugins/telemetry-blocker.js.map +1 -0
- package/packages/core/dist/plugins/test-harness.d.ts +8 -0
- package/packages/core/dist/plugins/test-harness.d.ts.map +1 -0
- package/packages/core/dist/plugins/test-harness.js +64 -0
- package/packages/core/dist/plugins/test-harness.js.map +1 -0
- package/packages/core/dist/plugins/theme-studio.d.ts +29 -0
- package/packages/core/dist/plugins/theme-studio.d.ts.map +1 -0
- package/packages/core/dist/plugins/theme-studio.js +141 -0
- package/packages/core/dist/plugins/theme-studio.js.map +1 -0
- package/packages/core/dist/plugins/token-guard.d.ts +15 -0
- package/packages/core/dist/plugins/token-guard.d.ts.map +1 -0
- package/packages/core/dist/plugins/token-guard.js +78 -0
- package/packages/core/dist/plugins/token-guard.js.map +1 -0
- package/packages/core/dist/plugins/tools.d.ts.map +1 -1
- package/packages/core/dist/plugins/tools.js +5 -2
- package/packages/core/dist/plugins/tools.js.map +1 -1
- package/packages/core/dist/plugins/turn-rewind.d.ts +19 -0
- package/packages/core/dist/plugins/turn-rewind.d.ts.map +1 -0
- package/packages/core/dist/plugins/turn-rewind.js +74 -0
- package/packages/core/dist/plugins/turn-rewind.js.map +1 -0
- package/packages/core/dist/plugins/undo-savepoint.d.ts +17 -0
- package/packages/core/dist/plugins/undo-savepoint.d.ts.map +1 -0
- package/packages/core/dist/plugins/undo-savepoint.js +247 -0
- package/packages/core/dist/plugins/undo-savepoint.js.map +1 -0
- package/packages/core/dist/plugins/vision-toolkit.d.ts +17 -0
- package/packages/core/dist/plugins/vision-toolkit.d.ts.map +1 -0
- package/packages/core/dist/plugins/vision-toolkit.js +145 -0
- package/packages/core/dist/plugins/vision-toolkit.js.map +1 -0
- package/packages/core/dist/plugins/web-research.d.ts +17 -0
- package/packages/core/dist/plugins/web-research.d.ts.map +1 -0
- package/packages/core/dist/plugins/web-research.js +275 -0
- package/packages/core/dist/plugins/web-research.js.map +1 -0
- package/packages/core/dist/plugins/workspace-navigator.d.ts +36 -0
- package/packages/core/dist/plugins/workspace-navigator.d.ts.map +1 -0
- package/packages/core/dist/plugins/workspace-navigator.js +150 -0
- package/packages/core/dist/plugins/workspace-navigator.js.map +1 -0
- package/packages/core/dist/plugins/workspace-search.d.ts +8 -0
- package/packages/core/dist/plugins/workspace-search.d.ts.map +1 -0
- package/packages/core/dist/plugins/workspace-search.js +134 -0
- package/packages/core/dist/plugins/workspace-search.js.map +1 -0
- package/packages/core/dist/plugins/yaml-validator.d.ts +8 -0
- package/packages/core/dist/plugins/yaml-validator.d.ts.map +1 -0
- package/packages/core/dist/plugins/yaml-validator.js +94 -0
- package/packages/core/dist/plugins/yaml-validator.js.map +1 -0
- package/packages/core/dist/profile.d.ts +1 -0
- package/packages/core/dist/profile.d.ts.map +1 -1
- package/packages/core/dist/profile.js +3 -0
- package/packages/core/dist/profile.js.map +1 -1
- package/packages/core/dist/runtime.d.ts.map +1 -1
- package/packages/core/dist/runtime.js +13 -4
- package/packages/core/dist/runtime.js.map +1 -1
- package/packages/core/dist/services.d.ts +55 -0
- package/packages/core/dist/services.d.ts.map +1 -1
- package/packages/core/dist/services.js +58 -2
- package/packages/core/dist/services.js.map +1 -1
- package/packages/core/dist/stdio.d.ts +13 -2
- package/packages/core/dist/stdio.d.ts.map +1 -1
- package/packages/core/dist/stdio.js +75 -9
- package/packages/core/dist/stdio.js.map +1 -1
- package/packages/core/dist/workspace-path.d.ts +12 -0
- package/packages/core/dist/workspace-path.d.ts.map +1 -0
- package/packages/core/dist/workspace-path.js +62 -0
- package/packages/core/dist/workspace-path.js.map +1 -0
- package/packages/core/package.json +18 -8
- package/packages/core/profiles/default/cordis.yml +85 -0
- package/packages/core/profiles/development/cordis.yml +1 -1
- package/packages/core/src/boot.ts +38 -2
- package/packages/core/src/config.ts +5 -0
- package/packages/core/src/http.ts +32 -0
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/plugins/agent-teams.ts +291 -0
- package/packages/core/src/plugins/anchored-standard.ts +88 -0
- package/packages/core/src/plugins/annotation.ts +106 -0
- package/packages/core/src/plugins/archify.ts +124 -0
- package/packages/core/src/plugins/at-file.ts +54 -0
- package/packages/core/src/plugins/auto-mode.ts +123 -0
- package/packages/core/src/plugins/better-sidebar.ts +117 -0
- package/packages/core/src/plugins/browser-fetch.ts +171 -0
- package/packages/core/src/plugins/browser-session.ts +287 -0
- package/packages/core/src/plugins/canvas-draw.ts +90 -0
- package/packages/core/src/plugins/change-verifier.ts +79 -0
- package/packages/core/src/plugins/cleaner.ts +61 -0
- package/packages/core/src/plugins/cli-notifier.ts +125 -0
- package/packages/core/src/plugins/code2skill.ts +96 -0
- package/packages/core/src/plugins/colleague-skill.ts +122 -0
- package/packages/core/src/plugins/context-doctor.ts +117 -0
- package/packages/core/src/plugins/context.ts +102 -0
- package/packages/core/src/plugins/cost-meter.ts +231 -0
- package/packages/core/src/plugins/dependency-checker.ts +241 -0
- package/packages/core/src/plugins/docker-sandbox.ts +100 -0
- package/packages/core/src/plugins/fail-logger.ts +51 -0
- package/packages/core/src/plugins/genui.ts +88 -0
- package/packages/core/src/plugins/git-time-capsule.ts +97 -0
- package/packages/core/src/plugins/graph-memory.ts +394 -0
- package/packages/core/src/plugins/history-compressor.ts +81 -0
- package/packages/core/src/plugins/hol-guard.ts +153 -0
- package/packages/core/src/plugins/i18n-pair.ts +82 -0
- package/packages/core/src/plugins/image-compressor.ts +144 -0
- package/packages/core/src/plugins/llm-verifier.ts +164 -0
- package/packages/core/src/plugins/mcp-client.ts +559 -0
- package/packages/core/src/plugins/mcp-panel.ts +190 -0
- package/packages/core/src/plugins/memory.ts +176 -0
- package/packages/core/src/plugins/mirage-bridge.ts +179 -0
- package/packages/core/src/plugins/mock-server.ts +158 -0
- package/packages/core/src/plugins/model.ts +3 -1
- package/packages/core/src/plugins/models.ts +5 -2
- package/packages/core/src/plugins/modlens.ts +63 -0
- package/packages/core/src/plugins/module-search.ts +201 -0
- package/packages/core/src/plugins/obsidian-sync.ts +83 -0
- package/packages/core/src/plugins/openpets.ts +109 -0
- package/packages/core/src/plugins/plan-execute.ts +76 -0
- package/packages/core/src/plugins/plugin-check.ts +232 -0
- package/packages/core/src/plugins/plugin-dev.ts +47 -0
- package/packages/core/src/plugins/plugin-finder.ts +108 -0
- package/packages/core/src/plugins/plugin-radar.ts +179 -0
- package/packages/core/src/plugins/plugin-stars.ts +205 -0
- package/packages/core/src/plugins/prompt-guard.ts +122 -0
- package/packages/core/src/plugins/prompt-library.ts +165 -0
- package/packages/core/src/plugins/readme-gen.ts +147 -0
- package/packages/core/src/plugins/recall-unread.ts +142 -0
- package/packages/core/src/plugins/resources.ts +28 -21
- package/packages/core/src/plugins/reverse-skill.ts +79 -0
- package/packages/core/src/plugins/reviewer-bot.ts +146 -0
- package/packages/core/src/plugins/runtime-doctor.ts +137 -0
- package/packages/core/src/plugins/runtime.ts +61 -14
- package/packages/core/src/plugins/secure-audit.ts +146 -0
- package/packages/core/src/plugins/session-bookmarks.ts +89 -0
- package/packages/core/src/plugins/session-bridge.ts +299 -0
- package/packages/core/src/plugins/session-compare.ts +180 -0
- package/packages/core/src/plugins/session-export.ts +99 -0
- package/packages/core/src/plugins/session-insights.ts +47 -0
- package/packages/core/src/plugins/session-search.ts +126 -0
- package/packages/core/src/plugins/session.ts +4 -2
- package/packages/core/src/plugins/skill-catalog.ts +117 -0
- package/packages/core/src/plugins/skill-guard.ts +152 -0
- package/packages/core/src/plugins/sql-lens.ts +92 -0
- package/packages/core/src/plugins/stdio.ts +3 -1
- package/packages/core/src/plugins/synapse.ts +130 -0
- package/packages/core/src/plugins/tab-manager.ts +135 -0
- package/packages/core/src/plugins/taskboard.ts +412 -0
- package/packages/core/src/plugins/telemetry-blocker.ts +62 -0
- package/packages/core/src/plugins/test-harness.ts +67 -0
- package/packages/core/src/plugins/theme-studio.ts +165 -0
- package/packages/core/src/plugins/token-guard.ts +84 -0
- package/packages/core/src/plugins/tools.ts +5 -2
- package/packages/core/src/plugins/turn-rewind.ts +86 -0
- package/packages/core/src/plugins/undo-savepoint.ts +284 -0
- package/packages/core/src/plugins/vision-toolkit.ts +153 -0
- package/packages/core/src/plugins/web-research.ts +289 -0
- package/packages/core/src/plugins/workspace-navigator.ts +164 -0
- package/packages/core/src/plugins/workspace-search.ts +139 -0
- package/packages/core/src/plugins/yaml-validator.ts +97 -0
- package/packages/core/src/profile.ts +3 -0
- package/packages/core/src/runtime.ts +11 -4
- package/packages/core/src/services.ts +110 -3
- package/packages/core/src/stdio.ts +79 -9
- package/packages/core/src/workspace-path.ts +69 -0
- package/packages/core/test/agent-teams.test.ts +24 -0
- package/packages/core/test/archify.test.ts +33 -0
- package/packages/core/test/better-sidebar.test.ts +125 -0
- package/packages/core/test/boot.test.ts +49 -6
- package/packages/core/test/colleague-skill.test.ts +74 -0
- package/packages/core/test/config.test.ts +121 -0
- package/packages/core/test/context-doctor.test.ts +32 -0
- package/packages/core/test/dependency-checker.test.ts +60 -0
- package/packages/core/test/git-time-capsule.test.ts +115 -0
- package/packages/core/test/http.test.ts +34 -0
- package/packages/core/test/llm-verifier.test.ts +72 -0
- package/packages/core/test/mirage-bridge.test.ts +54 -0
- package/packages/core/test/module-search.test.ts +78 -0
- package/packages/core/test/plugin-check.test.ts +16 -0
- package/packages/core/test/plugin-stars.test.ts +55 -0
- package/packages/core/test/profiles.integration.test.ts +49 -15
- package/packages/core/test/prompt-library.test.ts +56 -0
- package/packages/core/test/readme-gen.test.ts +45 -0
- package/packages/core/test/recall-unread.test.ts +35 -0
- package/packages/core/test/registry.test.ts +48 -0
- package/packages/core/test/reverse-skill.test.ts +40 -0
- package/packages/core/test/runtime-doctor.test.ts +55 -0
- package/packages/core/test/runtime-fixture.ts +4 -4
- package/packages/core/test/runtime.test.ts +90 -1
- package/packages/core/test/secure-audit.test.ts +16 -0
- package/packages/core/test/services.test.ts +2024 -5
- package/packages/core/test/session-bookmarks.test.ts +62 -0
- package/packages/core/test/session-bridge.test.ts +103 -0
- package/packages/core/test/session-compare.test.ts +94 -0
- package/packages/core/test/session-export.test.ts +54 -0
- package/packages/core/test/session-search.test.ts +30 -0
- package/packages/core/test/skill-catalog.test.ts +18 -0
- package/packages/core/test/skill-guard.test.ts +21 -0
- package/packages/core/test/stdio-args.test.ts +178 -0
- package/packages/core/test/theme-studio.test.ts +39 -0
- package/packages/core/test/token-guard.test.ts +34 -0
- package/packages/core/test/turn-rewind.test.ts +19 -0
- package/packages/core/test/vision-toolkit.test.ts +38 -0
- package/packages/core/test/workspace-git-status.test.ts +37 -0
- package/packages/core/test/workspace-navigator.test.ts +33 -0
- package/packages/core/test/workspace-path.test.ts +34 -0
- package/packages/core/tsconfig.build.json +1 -3
- package/packages/core/tsconfig.json +1 -4
- package/packages/host-webserver/LICENSE +9 -0
- package/packages/host-webserver/dist/index.js +1 -1
- package/packages/host-webserver/dist/index.js.map +1 -1
- package/packages/host-webserver/package.json +17 -7
- package/packages/host-webserver/src/index.ts +1 -1
- package/packages/host-webserver/test/index.test.ts +4 -1
- package/packages/host-webserver/tsconfig.build.json +1 -1
- package/packages/host-webserver/tsconfig.json +1 -1
- package/apps/web/dist/assets/index-Bwqek8LF.js +0 -20
- package/apps/web/dist/assets/index-DCHSASjq.css +0 -1
- package/packages/api-gateway/dist/marketplace-registry.json +0 -62
- package/packages/api-gateway/src/marketplace-registry.json +0 -62
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
4
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
|
|
6
|
+
export interface AnchoredStandardPluginConfig {
|
|
7
|
+
maxToolCalls?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Config: z<AnchoredStandardPluginConfig> = z.object({ maxToolCalls: z.number().default(64) });
|
|
11
|
+
type AnchorStatus = "idle" | "anchored" | "violated";
|
|
12
|
+
type Violation = { code: "orphan_tool" | "nested_run" | "tool_budget" | "orphan_end"; message: string };
|
|
13
|
+
type AnchorReport = { status: AnchorStatus; events: number; toolCalls: number; maxToolCalls: number; violations: Violation[] };
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "pi-anchored-standard",
|
|
17
|
+
inject: ["piPluginUi", "piTools"],
|
|
18
|
+
Config,
|
|
19
|
+
apply(context: Context, config: AnchoredStandardPluginConfig) {
|
|
20
|
+
const maxToolCalls = Math.max(1, Math.min(512, Math.trunc(config.maxToolCalls ?? 64)));
|
|
21
|
+
let active = false;
|
|
22
|
+
let events = 0;
|
|
23
|
+
let toolCalls = 0;
|
|
24
|
+
const violations: Violation[] = [];
|
|
25
|
+
const record = (violation: Violation): void => {
|
|
26
|
+
if (!violations.some((item) => item.code === violation.code)) violations.push(violation);
|
|
27
|
+
};
|
|
28
|
+
const inspect = (event: { type: string }): void => {
|
|
29
|
+
events += 1;
|
|
30
|
+
if (event.type === "agent_start") {
|
|
31
|
+
if (active) record({ code: "nested_run", message: "检测到未结束的 Agent 运行被再次启动。" });
|
|
32
|
+
active = true;
|
|
33
|
+
toolCalls = 0;
|
|
34
|
+
} else if (event.type === "agent_end") {
|
|
35
|
+
if (!active) record({ code: "orphan_end", message: "检测到没有对应启动事件的 Agent 结束事件。" });
|
|
36
|
+
active = false;
|
|
37
|
+
} else if (event.type === "tool_execution_start") {
|
|
38
|
+
toolCalls += 1;
|
|
39
|
+
if (!active) record({ code: "orphan_tool", message: "工具调用发生在 Agent 运行锚点之外。" });
|
|
40
|
+
if (toolCalls > maxToolCalls) record({ code: "tool_budget", message: `单次运行工具调用超过 ${maxToolCalls} 次上限。` });
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const report = (): AnchorReport => ({
|
|
44
|
+
status: violations.length > 0 ? "violated" : active ? "anchored" : "idle",
|
|
45
|
+
events,
|
|
46
|
+
toolCalls,
|
|
47
|
+
maxToolCalls,
|
|
48
|
+
violations: [...violations],
|
|
49
|
+
});
|
|
50
|
+
const unsubscribe = context.on("pi/session-event", inspect);
|
|
51
|
+
const unregisterTool = context.piTools.register(
|
|
52
|
+
defineTool({
|
|
53
|
+
name: "trajectory_anchor_check",
|
|
54
|
+
label: "Trajectory anchor check",
|
|
55
|
+
description: "Audit Agent lifecycle and tool-call ordering against the anchored execution standard.",
|
|
56
|
+
promptSnippet: "audit the current agent trajectory for lifecycle violations",
|
|
57
|
+
parameters: Type.Object({}),
|
|
58
|
+
execute(): Promise<AgentToolResult<AnchorReport>> {
|
|
59
|
+
return Promise.resolve().then(() => {
|
|
60
|
+
const result = report();
|
|
61
|
+
return {
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: "text" as const,
|
|
65
|
+
text: `${result.status}: ${result.events} events, ${result.toolCalls} tool calls, ${result.violations.length} violation(s).`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
details: result,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
const disposePanel = context.piPluginUi.register({
|
|
75
|
+
id: "anchored-standard-panel",
|
|
76
|
+
pluginId: "@pi-harness/core/plugins/anchored-standard",
|
|
77
|
+
title: "Anchored Standard",
|
|
78
|
+
description: "审计 Agent 生命周期和工具调用顺序,发现脱离运行锚点的执行。",
|
|
79
|
+
icon: "⌁",
|
|
80
|
+
read: report,
|
|
81
|
+
});
|
|
82
|
+
context.effect(() => () => {
|
|
83
|
+
unsubscribe();
|
|
84
|
+
unregisterTool();
|
|
85
|
+
disposePanel();
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
3
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
|
|
5
|
+
const maxQuoteLength = 4_000;
|
|
6
|
+
const maxNoteLength = 1_000;
|
|
7
|
+
const maxAnnotations = 50;
|
|
8
|
+
|
|
9
|
+
export interface Annotation {
|
|
10
|
+
id: number;
|
|
11
|
+
quote: string;
|
|
12
|
+
note: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AnnotationReport {
|
|
17
|
+
count: number;
|
|
18
|
+
annotations: Annotation[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function requiredText(value: string, label: string, max: number): string {
|
|
22
|
+
const text = value.trim();
|
|
23
|
+
if (text.length === 0 || text.length > max) throw new Error(`${label} must contain 1-${max} characters`);
|
|
24
|
+
return text;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function formatPrompt(annotations: readonly Annotation[], question: string): string {
|
|
28
|
+
const lines = annotations.flatMap((item) => [`${item.id}. ${item.quote}`, ...(item.note === "" ? [] : [` Note: ${item.note}`])]);
|
|
29
|
+
const instruction = annotations.map((item) => `Annotation ${item.id}: …`).join("; ");
|
|
30
|
+
const body = lines.join("\n");
|
|
31
|
+
const ask = question.trim();
|
|
32
|
+
return `I annotated the following ${annotations.length} passage(s):\n\n${body}\n\nPlease respond to each annotation using ${instruction}.\n\nAsk:\n${ask}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: "pi-annotation",
|
|
37
|
+
inject: ["piPluginUi", "piTools"],
|
|
38
|
+
apply(context: Context) {
|
|
39
|
+
let annotations: Annotation[] = [];
|
|
40
|
+
let lastPrompt: string | undefined;
|
|
41
|
+
const report = (): AnnotationReport => ({ count: annotations.length, annotations: [...annotations] });
|
|
42
|
+
const unregister = context.piTools.register(
|
|
43
|
+
defineTool({
|
|
44
|
+
name: "annotation_manage",
|
|
45
|
+
label: "Manage annotations",
|
|
46
|
+
description: "Collect numbered passage annotations and render them into a model-ready prompt block.",
|
|
47
|
+
promptSnippet: "collect a passage annotation and prepare it for the next question",
|
|
48
|
+
parameters: Type.Object({
|
|
49
|
+
action: Type.Union([Type.Literal("add"), Type.Literal("list"), Type.Literal("remove"), Type.Literal("clear"), Type.Literal("prompt")]),
|
|
50
|
+
quote: Type.Optional(Type.String()),
|
|
51
|
+
note: Type.Optional(Type.String()),
|
|
52
|
+
id: Type.Optional(Type.Number()),
|
|
53
|
+
question: Type.Optional(Type.String()),
|
|
54
|
+
}),
|
|
55
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<AnnotationReport | Annotation | { prompt: string }>> {
|
|
56
|
+
await Promise.resolve();
|
|
57
|
+
if (params.action === "add") {
|
|
58
|
+
if (annotations.length >= maxAnnotations) throw new Error(`At most ${maxAnnotations} annotations can be collected`);
|
|
59
|
+
const quote = requiredText(params.quote ?? "", "Annotation quote", maxQuoteLength);
|
|
60
|
+
const note = (params.note ?? "").trim();
|
|
61
|
+
if (note.length > maxNoteLength) throw new Error(`Annotation note must contain 0-${maxNoteLength} characters`);
|
|
62
|
+
const annotation: Annotation = {
|
|
63
|
+
id: annotations.length === 0 ? 1 : Math.max(...annotations.map((item) => item.id)) + 1,
|
|
64
|
+
quote,
|
|
65
|
+
note,
|
|
66
|
+
createdAt: new Date().toISOString(),
|
|
67
|
+
};
|
|
68
|
+
annotations = [...annotations, annotation];
|
|
69
|
+
return { content: [{ type: "text", text: `Annotation ${annotation.id} added.` }], details: annotation };
|
|
70
|
+
}
|
|
71
|
+
if (params.action === "remove") {
|
|
72
|
+
if (!Number.isInteger(params.id) || params.id === undefined) throw new Error("Annotation id is required");
|
|
73
|
+
const before = annotations.length;
|
|
74
|
+
annotations = annotations.filter((item) => item.id !== params.id);
|
|
75
|
+
if (annotations.length === before) throw new Error(`Annotation ${params.id} was not found`);
|
|
76
|
+
return { content: [{ type: "text", text: `Annotation ${params.id} removed.` }], details: report() };
|
|
77
|
+
}
|
|
78
|
+
if (params.action === "clear") {
|
|
79
|
+
annotations = [];
|
|
80
|
+
lastPrompt = undefined;
|
|
81
|
+
return { content: [{ type: "text", text: "Annotations cleared." }], details: report() };
|
|
82
|
+
}
|
|
83
|
+
if (params.action === "prompt") {
|
|
84
|
+
if (annotations.length === 0) throw new Error("Add at least one annotation before rendering a prompt");
|
|
85
|
+
const prompt = formatPrompt(annotations, params.question ?? "");
|
|
86
|
+
lastPrompt = prompt;
|
|
87
|
+
return { content: [{ type: "text", text: prompt }], details: { prompt } };
|
|
88
|
+
}
|
|
89
|
+
return { content: [{ type: "text", text: `${annotations.length} annotation(s) collected.` }], details: report() };
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
);
|
|
93
|
+
const disposePanel = context.piPluginUi.register({
|
|
94
|
+
id: "annotation-panel",
|
|
95
|
+
pluginId: "@pi-harness/core/plugins/annotation",
|
|
96
|
+
title: "Annotations",
|
|
97
|
+
description: "收集回复片段并生成带编号的提问上下文。",
|
|
98
|
+
icon: "⌁",
|
|
99
|
+
read: () => ({ ...report(), lastPrompt }),
|
|
100
|
+
});
|
|
101
|
+
context.effect(() => () => {
|
|
102
|
+
unregister();
|
|
103
|
+
disposePanel();
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { basename, resolve } from "node:path";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { listWorkspaceNodes, type WorkspaceNode } from "./workspace-navigator.js";
|
|
7
|
+
|
|
8
|
+
const defaultMaxNodes = 300;
|
|
9
|
+
const maxComponents = 40;
|
|
10
|
+
const maxDependencies = 40;
|
|
11
|
+
|
|
12
|
+
export interface ArchitectureComponent {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly files: number;
|
|
17
|
+
readonly directories: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ArchitectureReport {
|
|
21
|
+
readonly workspace: string;
|
|
22
|
+
readonly components: readonly ArchitectureComponent[];
|
|
23
|
+
readonly dependencies: readonly string[];
|
|
24
|
+
readonly truncated: boolean;
|
|
25
|
+
readonly mermaid: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function componentId(path: string): string {
|
|
29
|
+
const normalized = path.replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
30
|
+
return `component_${normalized || "root"}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function dependencyId(name: string): string {
|
|
34
|
+
const normalized = name.replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
35
|
+
return `dependency_${normalized || "package"}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function escapeLabel(value: string): string {
|
|
39
|
+
return value.replace(/["\r\n]/g, (character) => (character === '"' ? """ : " "));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function topLevelComponents(nodes: readonly WorkspaceNode[]): ArchitectureComponent[] {
|
|
43
|
+
return nodes
|
|
44
|
+
.filter((node) => node.kind === "directory" && node.depth === 1)
|
|
45
|
+
.slice(0, maxComponents)
|
|
46
|
+
.map((directory) => {
|
|
47
|
+
const prefix = `${directory.path}/`;
|
|
48
|
+
const descendants = nodes.filter((node) => node.path.startsWith(prefix));
|
|
49
|
+
return {
|
|
50
|
+
id: componentId(directory.path),
|
|
51
|
+
label: directory.name,
|
|
52
|
+
path: directory.path,
|
|
53
|
+
files: descendants.filter((node) => node.kind === "file").length,
|
|
54
|
+
directories: descendants.filter((node) => node.kind === "directory").length,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function packageDependencies(root: string): Promise<string[]> {
|
|
60
|
+
try {
|
|
61
|
+
const parsed = JSON.parse(await readFile(resolve(root, "package.json"), "utf8")) as Record<string, unknown>;
|
|
62
|
+
const sections = [parsed.dependencies, parsed.devDependencies, parsed.peerDependencies, parsed.optionalDependencies];
|
|
63
|
+
return [...new Set(sections.flatMap((section) => (section !== null && typeof section === "object" && !Array.isArray(section) ? Object.keys(section) : [])))]
|
|
64
|
+
.sort((left, right) => left.localeCompare(right))
|
|
65
|
+
.slice(0, maxDependencies);
|
|
66
|
+
} catch {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function render(workspace: string, components: readonly ArchitectureComponent[], dependencies: readonly string[]): string {
|
|
72
|
+
const lines = [`flowchart LR`, ` project["${escapeLabel(basename(workspace) || "workspace")}"]`];
|
|
73
|
+
for (const component of components) {
|
|
74
|
+
lines.push(` ${component.id}["${escapeLabel(component.label)}\\n${component.files} files · ${component.directories} dirs"]`);
|
|
75
|
+
lines.push(` project --> ${component.id}`);
|
|
76
|
+
}
|
|
77
|
+
for (const dependency of dependencies) {
|
|
78
|
+
const id = dependencyId(dependency);
|
|
79
|
+
lines.push(` ${id}["${escapeLabel(dependency)}"]`);
|
|
80
|
+
lines.push(` project --> ${id}`);
|
|
81
|
+
}
|
|
82
|
+
return lines.join("\n");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function buildArchitectureReport(root: string, maxNodes = defaultMaxNodes): Promise<ArchitectureReport> {
|
|
86
|
+
const workspace = resolve(root);
|
|
87
|
+
const tree = await listWorkspaceNodes(workspace, { maxDepth: 4, maxNodes: Math.max(1, Math.min(500, Math.trunc(maxNodes))) });
|
|
88
|
+
const components = topLevelComponents(tree.nodes);
|
|
89
|
+
const dependencies = await packageDependencies(workspace);
|
|
90
|
+
return { workspace, components, dependencies, truncated: tree.truncated, mermaid: render(workspace, components, dependencies) };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
name: "pi-archify",
|
|
95
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
96
|
+
apply(context: Context) {
|
|
97
|
+
let latest: ArchitectureReport | undefined;
|
|
98
|
+
const unregister = context.piTools.register(
|
|
99
|
+
defineTool({
|
|
100
|
+
name: "architecture_map",
|
|
101
|
+
label: "Architecture map",
|
|
102
|
+
description: "Build a bounded, read-only architecture map from top-level workspace components and package dependencies.",
|
|
103
|
+
promptSnippet: "map the current workspace architecture",
|
|
104
|
+
parameters: Type.Object({ maxNodes: Type.Optional(Type.Number({ description: "Maximum scanned workspace nodes, 1-500" })) }),
|
|
105
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<ArchitectureReport>> {
|
|
106
|
+
latest = await buildArchitectureReport(context.piHarnessLaunch.cwd, params.maxNodes);
|
|
107
|
+
return { content: [{ type: "text", text: latest.mermaid }], details: latest };
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
const disposePanel = context.piPluginUi.register({
|
|
112
|
+
id: "archify-panel",
|
|
113
|
+
pluginId: "@pi-harness/core/plugins/archify",
|
|
114
|
+
title: "Architecture Map",
|
|
115
|
+
description: "从工作区目录和 package.json 依赖生成可审计的架构图源码。",
|
|
116
|
+
icon: "⌘",
|
|
117
|
+
read: () => ({ latest: latest ?? null, componentCount: latest?.components.length ?? 0, dependencyCount: latest?.dependencies.length ?? 0 }),
|
|
118
|
+
});
|
|
119
|
+
context.effect(() => () => {
|
|
120
|
+
unregister();
|
|
121
|
+
disposePanel();
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
|
|
7
|
+
const maxBytes = 256 * 1024;
|
|
8
|
+
|
|
9
|
+
function resolveWorkspaceFile(workspace: string, requested: string): string {
|
|
10
|
+
const root = resolve(workspace);
|
|
11
|
+
const target = resolve(root, requested);
|
|
12
|
+
const path = relative(root, target);
|
|
13
|
+
if (path.startsWith("..") || path.includes("/..")) throw new Error("File path must stay inside the current workspace");
|
|
14
|
+
return target;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: "pi-at-file",
|
|
19
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
20
|
+
apply(context: Context) {
|
|
21
|
+
let lastFile: { path: string; bytes: number } | undefined;
|
|
22
|
+
const unregisterTool = context.piTools.register(
|
|
23
|
+
defineTool({
|
|
24
|
+
name: "file_context",
|
|
25
|
+
label: "File context",
|
|
26
|
+
description: "Attach a text file from the current workspace to the model context with a bounded size.",
|
|
27
|
+
promptSnippet: "attach a workspace file to the current context",
|
|
28
|
+
parameters: Type.Object({ path: Type.String({ description: "File path relative to the workspace" }) }),
|
|
29
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<{ path: string; bytes: number }>> {
|
|
30
|
+
const target = resolveWorkspaceFile(context.piHarnessLaunch.cwd, params.path);
|
|
31
|
+
const metadata = await stat(target);
|
|
32
|
+
if (!metadata.isFile()) throw new Error("Context path is not a file");
|
|
33
|
+
if (metadata.size > maxBytes) throw new Error("Context file exceeds the 256 KiB attachment limit");
|
|
34
|
+
const path = relative(context.piHarnessLaunch.cwd, target) || ".";
|
|
35
|
+
const text = await readFile(target, "utf8");
|
|
36
|
+
lastFile = { path, bytes: metadata.size };
|
|
37
|
+
return { content: [{ type: "text", text: `<file path="${path}">\n${text}\n</file>` }], details: lastFile };
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
const disposePanel = context.piPluginUi.register({
|
|
42
|
+
id: "at-file-panel",
|
|
43
|
+
pluginId: "@pi-harness/core/plugins/at-file",
|
|
44
|
+
title: "@file 上下文",
|
|
45
|
+
description: "将工作区内的文本文件安全附加到当前对话。",
|
|
46
|
+
icon: "⌁",
|
|
47
|
+
read: () => ({ lastFile: lastFile ?? null, maxBytes }),
|
|
48
|
+
});
|
|
49
|
+
context.effect(() => () => {
|
|
50
|
+
unregisterTool();
|
|
51
|
+
disposePanel();
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import z from "@deepseek-ai/schemastery";
|
|
5
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
6
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
const maxArgs = 32;
|
|
10
|
+
const maxArgBytes = 4096;
|
|
11
|
+
const maxOutputBytes = 128 * 1024;
|
|
12
|
+
const defaultTimeoutMs = 30_000;
|
|
13
|
+
const shellWrappers = new Set(["sh", "bash", "zsh", "fish", "cmd", "powershell", "pwsh"]);
|
|
14
|
+
const riskyCommands = new Set(["rm", "rmdir", "del", "sudo", "su", "chmod", "chown", "kill", "pkill", "dd", "mkfs"]);
|
|
15
|
+
const riskyWords = new Set(["reset", "clean", "push", "publish", "curl", "wget", "ssh", "scp"]);
|
|
16
|
+
type AutoModeResult = { command: string[]; allowed: boolean; confirmed: boolean; exitCode: number | null; stdout: string; stderr: string; durationMs: number };
|
|
17
|
+
|
|
18
|
+
export interface AutoModePluginConfig {
|
|
19
|
+
mode?: "safe" | "confirm";
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export const Config: z<AutoModePluginConfig> = z.object({
|
|
23
|
+
mode: z.union(["safe", "confirm"]).default("safe"),
|
|
24
|
+
timeoutMs: z.number().default(defaultTimeoutMs),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
function validateCommand(command: string[]): void {
|
|
28
|
+
if (command.length === 0 || command.length > maxArgs) throw new Error(`Auto mode command must contain between 1 and ${maxArgs} arguments`);
|
|
29
|
+
if (command.some((part) => part.length === 0 || Buffer.byteLength(part, "utf8") > maxArgBytes))
|
|
30
|
+
throw new Error("Auto mode command contains an invalid argument");
|
|
31
|
+
if (shellWrappers.has((command[0] ?? "").split("/").at(-1)!.toLowerCase()))
|
|
32
|
+
throw new Error("Auto mode rejects shell wrappers; pass an executable argv directly");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isRisky(command: string[]): boolean {
|
|
36
|
+
const executable = (command[0] ?? "").split("/").at(-1)!.toLowerCase();
|
|
37
|
+
return riskyCommands.has(executable) || command.slice(1).some((part) => riskyWords.has(part.toLowerCase()));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
name: "pi-auto-mode",
|
|
42
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
43
|
+
Config,
|
|
44
|
+
apply(context: Context, config: AutoModePluginConfig) {
|
|
45
|
+
const mode = config.mode === "confirm" ? "confirm" : "safe";
|
|
46
|
+
const timeoutMs = Math.max(1_000, Math.min(120_000, Math.trunc(config.timeoutMs ?? defaultTimeoutMs)));
|
|
47
|
+
let blocked = 0;
|
|
48
|
+
let last: AutoModeResult | undefined;
|
|
49
|
+
const execute = async (command: string[], confirm: boolean): Promise<AutoModeResult> => {
|
|
50
|
+
try {
|
|
51
|
+
validateCommand(command);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
blocked += 1;
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
const risky = isRisky(command);
|
|
57
|
+
if (risky && !confirm) {
|
|
58
|
+
blocked += 1;
|
|
59
|
+
throw new Error("Auto mode blocked a risky command; retry with confirm=true");
|
|
60
|
+
}
|
|
61
|
+
if (mode === "confirm" && !confirm) {
|
|
62
|
+
blocked += 1;
|
|
63
|
+
throw new Error("Auto mode is configured for confirmation; retry with confirm=true");
|
|
64
|
+
}
|
|
65
|
+
const started = Date.now();
|
|
66
|
+
try {
|
|
67
|
+
const result = await execFileAsync(command[0]!, command.slice(1), { cwd: context.piHarnessLaunch.cwd, timeout: timeoutMs, maxBuffer: maxOutputBytes });
|
|
68
|
+
last = {
|
|
69
|
+
command: [...command],
|
|
70
|
+
allowed: true,
|
|
71
|
+
confirmed: confirm,
|
|
72
|
+
exitCode: 0,
|
|
73
|
+
stdout: result.stdout.slice(-maxOutputBytes),
|
|
74
|
+
stderr: result.stderr.slice(-maxOutputBytes),
|
|
75
|
+
durationMs: Date.now() - started,
|
|
76
|
+
};
|
|
77
|
+
} catch (error) {
|
|
78
|
+
const failure = error as { code?: number | string; stdout?: string; stderr?: string; message?: string };
|
|
79
|
+
last = {
|
|
80
|
+
command: [...command],
|
|
81
|
+
allowed: true,
|
|
82
|
+
confirmed: confirm,
|
|
83
|
+
exitCode: typeof failure.code === "number" ? failure.code : 1,
|
|
84
|
+
stdout: (failure.stdout ?? "").slice(-maxOutputBytes),
|
|
85
|
+
stderr: (failure.stderr ?? failure.message ?? "").slice(-maxOutputBytes),
|
|
86
|
+
durationMs: Date.now() - started,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return last;
|
|
90
|
+
};
|
|
91
|
+
const unregisterTool = context.piTools.register(
|
|
92
|
+
defineTool({
|
|
93
|
+
name: "auto_mode_exec",
|
|
94
|
+
label: "Auto mode exec",
|
|
95
|
+
description: "Execute an argv command under the configured safe/confirmation policy without a shell.",
|
|
96
|
+
promptSnippet: "run a command through the safe auto-mode policy",
|
|
97
|
+
parameters: Type.Object({
|
|
98
|
+
command: Type.Array(Type.String()),
|
|
99
|
+
confirm: Type.Optional(Type.Boolean({ description: "Confirm a risky or confirmation-mode command" })),
|
|
100
|
+
}),
|
|
101
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<AutoModeResult>> {
|
|
102
|
+
const result = await execute(params.command, params.confirm === true);
|
|
103
|
+
return {
|
|
104
|
+
content: [{ type: "text", text: `${result.command.join(" ")} exited with ${result.exitCode ?? "unknown"}.\n${result.stdout}${result.stderr}` }],
|
|
105
|
+
details: result,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
110
|
+
const disposePanel = context.piPluginUi.register({
|
|
111
|
+
id: "auto-mode-panel",
|
|
112
|
+
pluginId: "@pi-harness/core/plugins/auto-mode",
|
|
113
|
+
title: "Auto Mode",
|
|
114
|
+
description: "按安全策略执行 argv 命令,风险操作需要确认。",
|
|
115
|
+
icon: "◈",
|
|
116
|
+
read: () => ({ mode, timeoutMs, blocked, last: last ?? null }),
|
|
117
|
+
});
|
|
118
|
+
context.effect(() => () => {
|
|
119
|
+
unregisterTool();
|
|
120
|
+
disposePanel();
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
3
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { listWorkspaceNodes, readWorkspaceGitStatus, type WorkspaceGitStatus, type WorkspaceNodeReport } from "./workspace-navigator.js";
|
|
5
|
+
|
|
6
|
+
export interface SidebarOverviewInput {
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly gitAvailable: boolean;
|
|
9
|
+
readonly branch: string | null;
|
|
10
|
+
readonly clean: boolean;
|
|
11
|
+
readonly changedFiles: readonly { readonly path: string; readonly status: string }[];
|
|
12
|
+
readonly directoryCount: number;
|
|
13
|
+
readonly fileCount: number;
|
|
14
|
+
readonly truncated: boolean;
|
|
15
|
+
readonly sessionId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SidebarOverview extends SidebarOverviewInput {
|
|
19
|
+
readonly changedCount: number;
|
|
20
|
+
readonly summary: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function summarizeSidebar(input: SidebarOverviewInput): SidebarOverview {
|
|
24
|
+
const changedCount = input.changedFiles.length;
|
|
25
|
+
const summary = !input.gitAvailable
|
|
26
|
+
? `非 Git 工作区 · ${changedCount > 0 ? `${changedCount} 个变更` : "无变更"}`
|
|
27
|
+
: `${input.branch ?? "detached HEAD"} · ${changedCount > 0 ? `${changedCount} 个变更` : "clean"}`;
|
|
28
|
+
return { ...input, changedFiles: input.changedFiles.slice(0, 12), changedCount, summary };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function createSidebarInspector(input: {
|
|
32
|
+
readonly cwd: string;
|
|
33
|
+
readonly getSessionId: () => string;
|
|
34
|
+
readonly listNodes?: (root: string, options: { maxDepth: number; maxNodes: number }) => Promise<WorkspaceNodeReport>;
|
|
35
|
+
readonly readGitStatus?: (root: string) => Promise<WorkspaceGitStatus>;
|
|
36
|
+
}): () => Promise<SidebarOverview> {
|
|
37
|
+
const readNodes = input.listNodes ?? listWorkspaceNodes;
|
|
38
|
+
const readGit = input.readGitStatus ?? readWorkspaceGitStatus;
|
|
39
|
+
let tree: WorkspaceNodeReport | undefined;
|
|
40
|
+
let inFlight: Promise<SidebarOverview> | undefined;
|
|
41
|
+
|
|
42
|
+
const inspect = async (): Promise<SidebarOverview> => {
|
|
43
|
+
const [currentTree, git] = await Promise.all([
|
|
44
|
+
tree === undefined
|
|
45
|
+
? readNodes(input.cwd, { maxDepth: 2, maxNodes: 80 }).then((result) => {
|
|
46
|
+
tree = result;
|
|
47
|
+
return result;
|
|
48
|
+
})
|
|
49
|
+
: Promise.resolve(tree),
|
|
50
|
+
readGit(input.cwd),
|
|
51
|
+
]);
|
|
52
|
+
return summarizeSidebar({
|
|
53
|
+
cwd: input.cwd,
|
|
54
|
+
gitAvailable: git.available,
|
|
55
|
+
branch: git.available ? git.branch : null,
|
|
56
|
+
clean: git.available && git.clean,
|
|
57
|
+
changedFiles: git.entries,
|
|
58
|
+
directoryCount: currentTree.directoryCount,
|
|
59
|
+
fileCount: currentTree.fileCount,
|
|
60
|
+
truncated: currentTree.truncated,
|
|
61
|
+
sessionId: input.getSessionId(),
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return () => {
|
|
66
|
+
if (inFlight !== undefined) return inFlight;
|
|
67
|
+
const current = inspect().finally(() => {
|
|
68
|
+
if (inFlight === current) inFlight = undefined;
|
|
69
|
+
});
|
|
70
|
+
inFlight = current;
|
|
71
|
+
return current;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function textSummary(report: SidebarOverview): string {
|
|
76
|
+
const files = report.changedFiles
|
|
77
|
+
.slice(0, 8)
|
|
78
|
+
.map((entry) => `${entry.status} ${entry.path}`)
|
|
79
|
+
.join(", ");
|
|
80
|
+
return `${report.summary}; ${report.directoryCount} 个目录,${report.fileCount} 个文件${files ? `; ${files}` : ""}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default {
|
|
84
|
+
name: "pi-better-sidebar",
|
|
85
|
+
inject: ["piHarnessLaunch", "piSession", "piPluginUi", "piTools"],
|
|
86
|
+
apply(context: Context) {
|
|
87
|
+
const inspect = createSidebarInspector({
|
|
88
|
+
cwd: context.piHarnessLaunch.cwd,
|
|
89
|
+
getSessionId: () => context.piSession.manager.getSessionId(),
|
|
90
|
+
});
|
|
91
|
+
const unregisterTool = context.piTools.register(
|
|
92
|
+
defineTool({
|
|
93
|
+
name: "sidebar_overview",
|
|
94
|
+
label: "Sidebar overview",
|
|
95
|
+
description: "Read a compact workspace and Git overview for the current session without modifying files.",
|
|
96
|
+
promptSnippet: "inspect the workspace overview shown in the sidebar",
|
|
97
|
+
parameters: Type.Object({}),
|
|
98
|
+
async execute(): Promise<AgentToolResult<SidebarOverview>> {
|
|
99
|
+
const report = await inspect();
|
|
100
|
+
return { content: [{ type: "text", text: textSummary(report) }], details: report };
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
103
|
+
);
|
|
104
|
+
const disposePanel = context.piPluginUi.register({
|
|
105
|
+
id: "better-sidebar-panel",
|
|
106
|
+
pluginId: "@pi-harness/core/plugins/better-sidebar",
|
|
107
|
+
title: "Better Sidebar",
|
|
108
|
+
description: "在会话旁显示当前工作区、Git 变更和文件概览。",
|
|
109
|
+
icon: "▤",
|
|
110
|
+
read: inspect,
|
|
111
|
+
});
|
|
112
|
+
context.effect(() => () => {
|
|
113
|
+
unregisterTool();
|
|
114
|
+
disposePanel();
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
};
|