@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,190 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { lstat, mkdir, readFile, rename, unlink, writeFile } from "node:fs/promises";
|
|
3
|
+
import { basename, dirname, isAbsolute, resolve } from "node:path";
|
|
4
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
5
|
+
import z from "@deepseek-ai/schemastery";
|
|
6
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
7
|
+
import { defineTool, type AgentToolResult, type ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import type { PiMcpServerSnapshot } from "../services.js";
|
|
9
|
+
|
|
10
|
+
type McpPanelServer = Omit<PiMcpServerSnapshot, "command"> & { executable: string; toolCount: number; statusSource: "runtime" };
|
|
11
|
+
type McpPanelHealth = { serverId: string; status: string; severity: "ok" | "warning"; suggestions: string[] };
|
|
12
|
+
|
|
13
|
+
export interface McpPanelPluginConfig {
|
|
14
|
+
patchPath?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Config: z<McpPanelPluginConfig> = z.object({ patchPath: z.string().default("") });
|
|
18
|
+
|
|
19
|
+
function mcpToolPrefix(serverId: string): string {
|
|
20
|
+
return `mcp__${serverId}__`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function serverTools(serverId: string, tools: readonly ToolDefinition[]): ToolDefinition[] {
|
|
24
|
+
const prefix = mcpToolPrefix(serverId);
|
|
25
|
+
return tools.filter((tool) => tool.name.startsWith(prefix));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function healthFor(server: McpPanelServer | undefined): McpPanelHealth {
|
|
29
|
+
if (server === undefined) throw new Error("MCP server was not found");
|
|
30
|
+
if (server.status === "running") return { serverId: server.id, status: server.status, severity: "ok", suggestions: [] };
|
|
31
|
+
return { serverId: server.id, status: server.status, severity: "warning", suggestions: ["使用 mcp_server_start 启动该服务器,再重新检查健康状态。"] };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function validateServerId(serverId: string): string {
|
|
35
|
+
const normalized = serverId.trim();
|
|
36
|
+
if (!/^[a-z0-9][a-z0-9_-]{0,63}$/iu.test(normalized)) throw new Error("MCP server id must use letters, numbers, _ or -");
|
|
37
|
+
return normalized;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function validateCommand(command: readonly string[]): string[] {
|
|
41
|
+
if (command.length === 0 || command.length > 32 || command.some((part) => part.trim() === "" || part.length > 4096))
|
|
42
|
+
throw new Error("MCP command must contain 1-32 non-empty arguments");
|
|
43
|
+
return [...command];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function patchFragment(serverId: string, command: readonly string[], autoStart: boolean): string {
|
|
47
|
+
const rowId = `mcp-${serverId}`;
|
|
48
|
+
const commandRows = command.map((part) => ` - ${JSON.stringify(part)}`).join("\n");
|
|
49
|
+
return [
|
|
50
|
+
`- id: ${rowId}`,
|
|
51
|
+
` name: "@pi-harness/core/plugins/mcp-client"`,
|
|
52
|
+
" config:",
|
|
53
|
+
" servers:",
|
|
54
|
+
` - id: ${JSON.stringify(serverId)}`,
|
|
55
|
+
" command:",
|
|
56
|
+
commandRows,
|
|
57
|
+
` autoStart: ${autoStart ? "true" : "false"}`,
|
|
58
|
+
"",
|
|
59
|
+
].join("\n");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
name: "pi-mcp-panel",
|
|
64
|
+
inject: ["piHarnessLaunch", "piMcp", "piPluginUi", "piTools"],
|
|
65
|
+
Config,
|
|
66
|
+
apply(context: Context, config: McpPanelPluginConfig) {
|
|
67
|
+
const configuredPatchPath = config.patchPath?.trim() ?? "";
|
|
68
|
+
const patchTarget =
|
|
69
|
+
configuredPatchPath === ""
|
|
70
|
+
? undefined
|
|
71
|
+
: isAbsolute(configuredPatchPath)
|
|
72
|
+
? resolve(configuredPatchPath)
|
|
73
|
+
: resolve(context.piHarnessLaunch.agentDir, configuredPatchPath);
|
|
74
|
+
const snapshot = (): McpPanelServer[] => {
|
|
75
|
+
const customTools = context.piTools.snapshot().customTools;
|
|
76
|
+
return context.piMcp.snapshot().servers.map((server) => ({
|
|
77
|
+
id: server.id,
|
|
78
|
+
status: server.status,
|
|
79
|
+
startedAt: server.startedAt,
|
|
80
|
+
executable: basename(server.command[0] ?? ""),
|
|
81
|
+
toolCount: serverTools(server.id, customTools).length,
|
|
82
|
+
statusSource: "runtime",
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
const buildPatch = (serverId: string, command: readonly string[], autoStart: boolean): string =>
|
|
86
|
+
patchFragment(validateServerId(serverId), validateCommand(command), autoStart);
|
|
87
|
+
let patchWriteQueue = Promise.resolve();
|
|
88
|
+
const applyPatch = async (fragment: string, serverId: string): Promise<string> => {
|
|
89
|
+
const write = patchWriteQueue.then(async () => {
|
|
90
|
+
if (patchTarget === undefined) throw new Error("MCP profile writes are disabled; configure patchPath first");
|
|
91
|
+
await mkdir(dirname(patchTarget), { recursive: true });
|
|
92
|
+
const metadata = await lstat(patchTarget).catch((error: unknown) => {
|
|
93
|
+
if (error instanceof Error && "code" in error && (error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
|
|
94
|
+
throw error;
|
|
95
|
+
});
|
|
96
|
+
if (metadata?.isSymbolicLink() || (metadata !== undefined && !metadata.isFile()))
|
|
97
|
+
throw new Error("MCP profile patch target must be a regular file and cannot be a symbolic link");
|
|
98
|
+
const existing = metadata === undefined ? "" : await readFile(patchTarget, "utf8");
|
|
99
|
+
const rowPattern = new RegExp(`^- id: mcp-${serverId}\\s*$`, "mu");
|
|
100
|
+
if (rowPattern.test(existing)) throw new Error(`MCP server patch already exists: ${serverId}`);
|
|
101
|
+
const backup = `${patchTarget}.bak`;
|
|
102
|
+
await writeFile(backup, existing, { encoding: "utf8", mode: 0o600, flag: "wx" }).catch((error: unknown) => {
|
|
103
|
+
if (!(error instanceof Error && "code" in error && (error as NodeJS.ErrnoException).code === "EEXIST")) throw error;
|
|
104
|
+
});
|
|
105
|
+
const temporary = `${patchTarget}.${randomUUID()}.tmp`;
|
|
106
|
+
let renamed = false;
|
|
107
|
+
try {
|
|
108
|
+
await writeFile(temporary, `${existing.trimEnd()}${existing.trimEnd() === "" ? "" : "\n"}${fragment}`, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
109
|
+
await rename(temporary, patchTarget);
|
|
110
|
+
renamed = true;
|
|
111
|
+
} finally {
|
|
112
|
+
if (!renamed) await unlink(temporary).catch(() => {});
|
|
113
|
+
}
|
|
114
|
+
return patchTarget;
|
|
115
|
+
});
|
|
116
|
+
patchWriteQueue = write.then(
|
|
117
|
+
() => undefined,
|
|
118
|
+
() => undefined,
|
|
119
|
+
);
|
|
120
|
+
return write;
|
|
121
|
+
};
|
|
122
|
+
const unregister = context.piTools.register(
|
|
123
|
+
defineTool({
|
|
124
|
+
name: "mcp_panel",
|
|
125
|
+
label: "MCP panel",
|
|
126
|
+
description: "Inspect MCP status and tools, derive health suggestions, and preview or explicitly apply a backed-up profile patch.",
|
|
127
|
+
promptSnippet: "inspect MCP status or preview a server profile patch",
|
|
128
|
+
parameters: Type.Object({
|
|
129
|
+
action: Type.Union([Type.Literal("status"), Type.Literal("tools"), Type.Literal("health"), Type.Literal("preview"), Type.Literal("apply")]),
|
|
130
|
+
serverId: Type.Optional(Type.String({ description: "Configured or running MCP server id" })),
|
|
131
|
+
command: Type.Optional(Type.Array(Type.String(), { description: "MCP server executable and arguments" })),
|
|
132
|
+
autoStart: Type.Optional(Type.Boolean({ description: "Start the configured server with the runtime" })),
|
|
133
|
+
confirm: Type.Optional(Type.Boolean({ description: "Must be true before applying a patch" })),
|
|
134
|
+
}),
|
|
135
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<unknown>> {
|
|
136
|
+
await Promise.resolve();
|
|
137
|
+
const servers = snapshot();
|
|
138
|
+
if (params.action === "status") {
|
|
139
|
+
return {
|
|
140
|
+
content: [
|
|
141
|
+
{
|
|
142
|
+
type: "text",
|
|
143
|
+
text: servers.map((server) => `${server.id}: ${server.status} · ${server.toolCount} tools`).join("\n") || "No MCP servers configured.",
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
details: { action: "status", servers },
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (params.serverId === undefined || params.serverId.trim() === "") throw new Error(`action ${params.action} requires serverId`);
|
|
150
|
+
if (params.action === "preview" || params.action === "apply") {
|
|
151
|
+
if (params.command === undefined) throw new Error(`action ${params.action} requires command`);
|
|
152
|
+
const serverId = validateServerId(params.serverId);
|
|
153
|
+
const fragment = buildPatch(serverId, params.command, params.autoStart === true);
|
|
154
|
+
if (params.action === "preview")
|
|
155
|
+
return { content: [{ type: "text", text: fragment }], details: { action: "preview", serverId, path: patchTarget ?? null, fragment } };
|
|
156
|
+
if (params.confirm !== true) throw new Error("Applying an MCP profile patch requires confirm=true");
|
|
157
|
+
const path = await applyPatch(fragment, serverId);
|
|
158
|
+
return {
|
|
159
|
+
content: [{ type: "text", text: `MCP server patch appended to ${path}.` }],
|
|
160
|
+
details: { action: "apply", serverId, path, backup: `${path}.bak` },
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const server = servers.find((item) => item.id === params.serverId);
|
|
164
|
+
if (params.action === "health") {
|
|
165
|
+
const health = healthFor(server);
|
|
166
|
+
return { content: [{ type: "text", text: `${health.serverId}: ${health.status} (${health.severity})` }], details: { action: "health", ...health } };
|
|
167
|
+
}
|
|
168
|
+
if (server === undefined) throw new Error(`MCP server was not found: ${params.serverId}`);
|
|
169
|
+
const tools = serverTools(server.id, context.piTools.snapshot().customTools).map((tool) => ({ name: tool.name, description: tool.description }));
|
|
170
|
+
return {
|
|
171
|
+
content: [{ type: "text", text: tools.map((tool) => `${tool.name}: ${tool.description ?? ""}`).join("\n") || "No bridged tools." }],
|
|
172
|
+
details: { action: "tools", serverId: server.id, tools },
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
}),
|
|
176
|
+
);
|
|
177
|
+
const disposePanel = context.piPluginUi.register({
|
|
178
|
+
id: "mcp-panel",
|
|
179
|
+
pluginId: "@pi-harness/core/plugins/mcp-panel",
|
|
180
|
+
title: "MCP Console",
|
|
181
|
+
description: "查看 MCP 服务器状态、桥接工具和健康建议。",
|
|
182
|
+
icon: "⌘",
|
|
183
|
+
read: () => ({ servers: snapshot(), statusSource: "runtime", writesEnabled: patchTarget !== undefined, patchPath: patchTarget ?? null }),
|
|
184
|
+
});
|
|
185
|
+
context.effect(() => () => {
|
|
186
|
+
unregister();
|
|
187
|
+
disposePanel();
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
4
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
5
|
+
import z from "@deepseek-ai/schemastery";
|
|
6
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
7
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
const defaultFileName = "memory.json";
|
|
10
|
+
const maxKeyLength = 128;
|
|
11
|
+
const maxValueBytes = 64 * 1024;
|
|
12
|
+
const maxTagLength = 64;
|
|
13
|
+
const maxTags = 16;
|
|
14
|
+
const maxEntries = 500;
|
|
15
|
+
|
|
16
|
+
type Memory = { id: string; key: string; value: string; tags: string[]; createdAt: string; updatedAt: string };
|
|
17
|
+
type MemoryFile = { version: 1; memories: Memory[] };
|
|
18
|
+
type MemorySearchReport = { query: string; total: number; memories: Memory[] };
|
|
19
|
+
|
|
20
|
+
export interface MemoryPluginConfig {
|
|
21
|
+
fileName?: string;
|
|
22
|
+
maxEntries?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Config: z<MemoryPluginConfig> = z.object({ fileName: z.string().default(defaultFileName), maxEntries: z.number().default(maxEntries) });
|
|
26
|
+
|
|
27
|
+
function normalizeFilePath(agentDir: string, fileName: string | undefined): string {
|
|
28
|
+
const name = (fileName ?? defaultFileName).trim();
|
|
29
|
+
if (name === "" || basename(name) !== name || !name.toLowerCase().endsWith(".json")) throw new Error("Memory fileName must be a single .json filename");
|
|
30
|
+
return resolve(agentDir, name);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function normalizeKey(key: string): string {
|
|
34
|
+
const value = key.trim();
|
|
35
|
+
if (value.length === 0 || value.length > maxKeyLength) throw new Error(`Memory key must contain 1-${maxKeyLength} characters`);
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function normalizeValue(value: string): string {
|
|
40
|
+
if (value.trim() === "" || Buffer.byteLength(value, "utf8") > maxValueBytes)
|
|
41
|
+
throw new Error(`Memory value must be non-empty and at most ${maxValueBytes} bytes`);
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function normalizeTags(tags: readonly string[] | undefined): string[] {
|
|
46
|
+
const values = [...new Set((tags ?? []).map((tag) => tag.trim()).filter(Boolean))];
|
|
47
|
+
if (values.length > maxTags || values.some((tag) => tag.length > maxTagLength))
|
|
48
|
+
throw new Error(`Memory tags must contain at most ${maxTags} entries of ${maxTagLength} characters`);
|
|
49
|
+
return values;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
name: "pi-memory",
|
|
54
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
55
|
+
Config,
|
|
56
|
+
apply(context: Context, config: MemoryPluginConfig) {
|
|
57
|
+
const filePath = normalizeFilePath(context.piHarnessLaunch.agentDir, config.fileName);
|
|
58
|
+
const entryLimit = Math.max(1, Math.min(maxEntries, Math.trunc(config.maxEntries ?? maxEntries)));
|
|
59
|
+
let memories: Memory[] = [];
|
|
60
|
+
let loaded = false;
|
|
61
|
+
let loading: Promise<void> | undefined;
|
|
62
|
+
let writeQueue = Promise.resolve();
|
|
63
|
+
let last: MemorySearchReport | undefined;
|
|
64
|
+
const load = async (): Promise<void> => {
|
|
65
|
+
if (loaded) return;
|
|
66
|
+
if (loading !== undefined) return loading;
|
|
67
|
+
loading = (async () => {
|
|
68
|
+
try {
|
|
69
|
+
const parsed = JSON.parse(await readFile(filePath, "utf8")) as Partial<MemoryFile>;
|
|
70
|
+
if (parsed.version !== 1 || !Array.isArray(parsed.memories)) throw new Error("Memory file has an unsupported format");
|
|
71
|
+
memories = parsed.memories.filter(
|
|
72
|
+
(item): item is Memory => typeof item === "object" && item !== null && typeof item.key === "string" && typeof item.value === "string",
|
|
73
|
+
);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
76
|
+
memories = [];
|
|
77
|
+
}
|
|
78
|
+
loaded = true;
|
|
79
|
+
})();
|
|
80
|
+
return loading;
|
|
81
|
+
};
|
|
82
|
+
const persist = async (): Promise<void> => {
|
|
83
|
+
const payload = JSON.stringify({ version: 1, memories } satisfies MemoryFile, null, 2);
|
|
84
|
+
writeQueue = writeQueue.then(async () => {
|
|
85
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
86
|
+
const temporary = join(dirname(filePath), `.${basename(filePath)}.${randomUUID()}.tmp`);
|
|
87
|
+
await writeFile(temporary, payload, { encoding: "utf8", mode: 0o600 });
|
|
88
|
+
await rename(temporary, filePath);
|
|
89
|
+
});
|
|
90
|
+
await writeQueue;
|
|
91
|
+
};
|
|
92
|
+
const unregisterSet = context.piTools.register(
|
|
93
|
+
defineTool({
|
|
94
|
+
name: "memory_set",
|
|
95
|
+
label: "Remember fact",
|
|
96
|
+
description: "Persist one explicit fact in the Pi Harness memory store, replacing an existing value with the same key.",
|
|
97
|
+
promptSnippet: "save an explicit fact for future sessions",
|
|
98
|
+
parameters: Type.Object({ key: Type.String(), value: Type.String(), tags: Type.Optional(Type.Array(Type.String())) }),
|
|
99
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<Memory>> {
|
|
100
|
+
await load();
|
|
101
|
+
const key = normalizeKey(params.key);
|
|
102
|
+
const value = normalizeValue(params.value);
|
|
103
|
+
const tags = normalizeTags(params.tags);
|
|
104
|
+
const now = new Date().toISOString();
|
|
105
|
+
const existing = memories.find((item) => item.key === key);
|
|
106
|
+
const memory: Memory =
|
|
107
|
+
existing === undefined ? { id: randomUUID(), key, value, tags, createdAt: now, updatedAt: now } : { ...existing, value, tags, updatedAt: now };
|
|
108
|
+
memories = [memory, ...memories.filter((item) => item.key !== key)].slice(0, entryLimit);
|
|
109
|
+
await persist();
|
|
110
|
+
return { content: [{ type: "text", text: `Memory saved: ${key}` }], details: memory };
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
114
|
+
const unregisterSearch = context.piTools.register(
|
|
115
|
+
defineTool({
|
|
116
|
+
name: "memory_search",
|
|
117
|
+
label: "Search memories",
|
|
118
|
+
description: "Search explicit cross-session memories by key, value, or tag.",
|
|
119
|
+
promptSnippet: "search remembered facts from earlier sessions",
|
|
120
|
+
parameters: Type.Object({ query: Type.String() }),
|
|
121
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<MemorySearchReport>> {
|
|
122
|
+
await load();
|
|
123
|
+
const query = params.query.trim().toLocaleLowerCase();
|
|
124
|
+
if (query.length < 2 || query.length > maxKeyLength) throw new Error(`Memory search query must contain 2-${maxKeyLength} characters`);
|
|
125
|
+
const results = memories.filter((item) => [item.key, item.value, ...item.tags].some((field) => field.toLocaleLowerCase().includes(query)));
|
|
126
|
+
last = { query: params.query.trim(), total: results.length, memories: results };
|
|
127
|
+
return {
|
|
128
|
+
content: [
|
|
129
|
+
{
|
|
130
|
+
type: "text",
|
|
131
|
+
text: results.length === 0 ? `No memories found for ${params.query.trim()}.` : results.map((item) => `${item.key}: ${item.value}`).join("\n"),
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
details: last,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
139
|
+
const unregisterDelete = context.piTools.register(
|
|
140
|
+
defineTool({
|
|
141
|
+
name: "memory_delete",
|
|
142
|
+
label: "Forget memory",
|
|
143
|
+
description: "Delete one explicit memory by key. Confirmation is required.",
|
|
144
|
+
promptSnippet: "forget a stored memory after confirmation",
|
|
145
|
+
parameters: Type.Object({ key: Type.String(), confirm: Type.Boolean() }),
|
|
146
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<{ key: string; removed: boolean }>> {
|
|
147
|
+
await load();
|
|
148
|
+
const key = normalizeKey(params.key);
|
|
149
|
+
if (params.confirm !== true) throw new Error("Deleting a memory requires confirm=true");
|
|
150
|
+
const before = memories.length;
|
|
151
|
+
memories = memories.filter((item) => item.key !== key);
|
|
152
|
+
const removed = memories.length !== before;
|
|
153
|
+
if (removed) await persist();
|
|
154
|
+
return { content: [{ type: "text", text: removed ? `Memory deleted: ${key}` : `Memory not found: ${key}` }], details: { key, removed } };
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
);
|
|
158
|
+
const disposePanel = context.piPluginUi.register({
|
|
159
|
+
id: "memory-panel",
|
|
160
|
+
pluginId: "@pi-harness/core/plugins/memory",
|
|
161
|
+
title: "Memory",
|
|
162
|
+
description: "只保存 Agent 明确写入的事实,跨会话持久化并支持检索与删除。",
|
|
163
|
+
icon: "▣",
|
|
164
|
+
read: async () => {
|
|
165
|
+
await load();
|
|
166
|
+
return { filePath, count: memories.length, last: last ?? null, memories: memories.slice(0, 8) };
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
context.effect(() => () => {
|
|
170
|
+
unregisterSet();
|
|
171
|
+
unregisterSearch();
|
|
172
|
+
unregisterDelete();
|
|
173
|
+
disposePanel();
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
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 defaultExecutable = "mirage";
|
|
10
|
+
const defaultTimeoutMs = 60_000;
|
|
11
|
+
const maxCommandLength = 4_000;
|
|
12
|
+
const maxOutputBytes = 128 * 1024;
|
|
13
|
+
|
|
14
|
+
export interface MirageBridgeConfig {
|
|
15
|
+
executable?: string;
|
|
16
|
+
workspaceId?: string;
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type MirageRun = {
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
command: string;
|
|
23
|
+
exitCode: number | null;
|
|
24
|
+
durationMs: number;
|
|
25
|
+
output: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type MirageBridgeState = {
|
|
29
|
+
executable: string;
|
|
30
|
+
workspaceId: string | null;
|
|
31
|
+
available: boolean | null;
|
|
32
|
+
version: string | null;
|
|
33
|
+
lastError: string | null;
|
|
34
|
+
lastRun: MirageRun | null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Config: z<MirageBridgeConfig> = z.object({
|
|
38
|
+
executable: z.string().default(defaultExecutable),
|
|
39
|
+
workspaceId: z.string().default(""),
|
|
40
|
+
timeoutMs: z.number().default(defaultTimeoutMs),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
function normalizeExecutable(input: string | undefined): string {
|
|
44
|
+
const executable = (input ?? defaultExecutable).trim();
|
|
45
|
+
if (executable.length < 1 || executable.length > 512 || executable.includes("\0")) throw new Error("Mirage executable must contain 1-512 characters");
|
|
46
|
+
return executable;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function normalizeWorkspaceId(input: string | undefined): string | null {
|
|
50
|
+
const workspaceId = input?.trim() ?? "";
|
|
51
|
+
if (workspaceId === "") return null;
|
|
52
|
+
if (!/^[a-z0-9][a-z0-9._-]{0,127}$/iu.test(workspaceId))
|
|
53
|
+
throw new Error("Mirage workspaceId must contain 1-128 letters, numbers, dots, underscores, or hyphens");
|
|
54
|
+
return workspaceId;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function normalizeCommand(input: string): string {
|
|
58
|
+
const command = input.trim();
|
|
59
|
+
if (command.length < 1 || command.length > maxCommandLength) throw new Error(`Mirage command must contain 1-${maxCommandLength} characters`);
|
|
60
|
+
return command;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function errorMessage(error: unknown): string {
|
|
64
|
+
if (error instanceof Error) return error.message;
|
|
65
|
+
return String(error);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
name: "pi-mirage-bridge",
|
|
70
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
71
|
+
Config,
|
|
72
|
+
apply(context: Context, config: MirageBridgeConfig) {
|
|
73
|
+
const executable = normalizeExecutable(config.executable);
|
|
74
|
+
const workspaceId = normalizeWorkspaceId(config.workspaceId);
|
|
75
|
+
const timeoutMs = Math.max(1_000, Math.min(120_000, Math.trunc(config.timeoutMs ?? defaultTimeoutMs)));
|
|
76
|
+
let state: MirageBridgeState = { executable, workspaceId, available: null, version: null, lastError: null, lastRun: null };
|
|
77
|
+
|
|
78
|
+
const doctor = async (): Promise<MirageBridgeState> => {
|
|
79
|
+
try {
|
|
80
|
+
const result = await execFileAsync(executable, ["--version"], {
|
|
81
|
+
cwd: context.piHarnessLaunch.cwd,
|
|
82
|
+
timeout: Math.min(timeoutMs, 10_000),
|
|
83
|
+
maxBuffer: maxOutputBytes,
|
|
84
|
+
});
|
|
85
|
+
const version = `${result.stdout}${result.stderr}`.trim().split(/\r?\n/u)[0]?.slice(0, 256) || "Mirage CLI detected";
|
|
86
|
+
state = { ...state, available: true, version, lastError: null };
|
|
87
|
+
} catch (error) {
|
|
88
|
+
state = { ...state, available: false, version: null, lastError: errorMessage(error).slice(0, 1_000) };
|
|
89
|
+
}
|
|
90
|
+
return state;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const run = async (commandInput: string): Promise<MirageRun> => {
|
|
94
|
+
if (workspaceId === null) throw new Error("Mirage workspaceId is not configured");
|
|
95
|
+
const command = normalizeCommand(commandInput);
|
|
96
|
+
const startedAt = Date.now();
|
|
97
|
+
try {
|
|
98
|
+
const result = await execFileAsync(executable, ["execute", "--workspace_id", workspaceId, "--command", command], {
|
|
99
|
+
cwd: context.piHarnessLaunch.cwd,
|
|
100
|
+
timeout: timeoutMs,
|
|
101
|
+
maxBuffer: maxOutputBytes,
|
|
102
|
+
});
|
|
103
|
+
state = {
|
|
104
|
+
...state,
|
|
105
|
+
available: true,
|
|
106
|
+
lastError: null,
|
|
107
|
+
lastRun: { workspaceId, command, exitCode: 0, durationMs: Date.now() - startedAt, output: `${result.stdout}${result.stderr}`.slice(-maxOutputBytes) },
|
|
108
|
+
};
|
|
109
|
+
} catch (error) {
|
|
110
|
+
const failure = error as { code?: number | string; stdout?: string; stderr?: string; message?: string };
|
|
111
|
+
const unavailable = failure.code === "ENOENT";
|
|
112
|
+
const output = `${failure.stdout ?? ""}${failure.stderr ?? failure.message ?? ""}`.slice(-maxOutputBytes);
|
|
113
|
+
state = {
|
|
114
|
+
...state,
|
|
115
|
+
available: unavailable ? false : state.available,
|
|
116
|
+
lastError: unavailable ? output : null,
|
|
117
|
+
lastRun: {
|
|
118
|
+
workspaceId,
|
|
119
|
+
command,
|
|
120
|
+
exitCode: typeof failure.code === "number" ? failure.code : null,
|
|
121
|
+
durationMs: Date.now() - startedAt,
|
|
122
|
+
output,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return state.lastRun!;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const unregisterDoctor = context.piTools.register(
|
|
130
|
+
defineTool({
|
|
131
|
+
name: "mirage_doctor",
|
|
132
|
+
label: "Check Mirage CLI",
|
|
133
|
+
description: "Check whether the official Mirage virtual-terminal CLI is available and report its configured workspace.",
|
|
134
|
+
promptSnippet: "check the official Mirage virtual terminal integration",
|
|
135
|
+
parameters: Type.Object({}),
|
|
136
|
+
async execute(): Promise<AgentToolResult<MirageBridgeState>> {
|
|
137
|
+
const details = await doctor();
|
|
138
|
+
return {
|
|
139
|
+
content: [
|
|
140
|
+
{
|
|
141
|
+
type: "text",
|
|
142
|
+
text: details.available
|
|
143
|
+
? `${details.version}; workspace ${details.workspaceId ?? "not configured"}`
|
|
144
|
+
: `Mirage unavailable: ${details.lastError}`,
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
details,
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
}),
|
|
151
|
+
);
|
|
152
|
+
const unregisterExecute = context.piTools.register(
|
|
153
|
+
defineTool({
|
|
154
|
+
name: "mirage_execute",
|
|
155
|
+
label: "Execute in Mirage",
|
|
156
|
+
description: "Pass one command to the official Mirage virtual terminal in the configured virtual workspace.",
|
|
157
|
+
promptSnippet: "run a command inside the configured Mirage virtual workspace",
|
|
158
|
+
parameters: Type.Object({ command: Type.String({ description: "Command interpreted by Mirage, not the host shell" }) }),
|
|
159
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<MirageRun>> {
|
|
160
|
+
const details = await run(params.command);
|
|
161
|
+
return { content: [{ type: "text", text: `Mirage exited with ${details.exitCode ?? "unknown"}.\n${details.output}` }], details };
|
|
162
|
+
},
|
|
163
|
+
}),
|
|
164
|
+
);
|
|
165
|
+
const disposePanel = context.piPluginUi.register({
|
|
166
|
+
id: "mirage-bridge-panel",
|
|
167
|
+
pluginId: "@pi-harness/core/plugins/mirage-bridge",
|
|
168
|
+
title: "Mirage Bridge",
|
|
169
|
+
description: "连接官方 Mirage 虚拟终端,在配置的虚拟工作区中执行命令。",
|
|
170
|
+
icon: "◇",
|
|
171
|
+
read: () => ({ ...state, timeoutMs }),
|
|
172
|
+
});
|
|
173
|
+
context.effect(() => () => {
|
|
174
|
+
unregisterDoctor();
|
|
175
|
+
unregisterExecute();
|
|
176
|
+
disposePanel();
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
};
|