@pi-harness/pi-harness 0.1.2 → 0.1.4
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-CihATCjR.css +2 -0
- package/apps/web/dist/assets/index-NzapJoGa.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 +2618 -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 +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/archify.json +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/context.json +28 -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 +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/genui.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +33 -0
- package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/memory.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +33 -0
- package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +30 -0
- package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +31 -0
- package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +28 -0
- package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +32 -0
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +29 -0
- package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +29 -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 +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/annotation.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/archify.json +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/at-file.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/context.json +28 -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 +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/genui.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +33 -0
- package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/memory.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +33 -0
- package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/modlens.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/module-search.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/openpets.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-export.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/session-search.json +30 -0
- package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +31 -0
- package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/synapse.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +28 -0
- package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/web-research.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +32 -0
- package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +29 -0
- package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +29 -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/release-version.test.ts +71 -0
- 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 +7360 -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,180 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool, parseSessionEntries, SessionManager, type AgentToolResult, type SessionInfo } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
|
|
7
|
+
const maxSessions = 200;
|
|
8
|
+
const maxSessionFileBytes = 4 * 1024 * 1024;
|
|
9
|
+
const maxMessageTextLength = 4_000;
|
|
10
|
+
const maxDiffMessages = 40;
|
|
11
|
+
|
|
12
|
+
export interface SessionCompareMessage {
|
|
13
|
+
role: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SessionCompareDiff {
|
|
18
|
+
shared: number;
|
|
19
|
+
added: SessionCompareMessage[];
|
|
20
|
+
removed: SessionCompareMessage[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SessionCompareSide {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
modified: string;
|
|
28
|
+
messageCount: number;
|
|
29
|
+
roles: Record<string, number>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SessionCompareReport extends SessionCompareDiff {
|
|
33
|
+
left: SessionCompareSide;
|
|
34
|
+
right: SessionCompareSide;
|
|
35
|
+
changed: boolean;
|
|
36
|
+
comparedAt: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function record(value: unknown): Record<string, unknown> | undefined {
|
|
40
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function contentText(value: unknown): string {
|
|
44
|
+
if (typeof value === "string") return value.trim();
|
|
45
|
+
if (!Array.isArray(value)) return "";
|
|
46
|
+
return value
|
|
47
|
+
.flatMap((part) => {
|
|
48
|
+
const item = record(part);
|
|
49
|
+
return item?.type === "text" && typeof item.text === "string" ? [item.text.trim()] : [];
|
|
50
|
+
})
|
|
51
|
+
.filter(Boolean)
|
|
52
|
+
.join("\n")
|
|
53
|
+
.trim();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function sessionMessageEntries(entries: readonly unknown[]): SessionCompareMessage[] {
|
|
57
|
+
return entries.flatMap((entry) => {
|
|
58
|
+
const item = record(entry);
|
|
59
|
+
const message = record(item?.message);
|
|
60
|
+
if (item?.type !== "message" || typeof message?.role !== "string") return [];
|
|
61
|
+
const text = contentText(message.content);
|
|
62
|
+
return text === "" ? [] : [{ role: message.role, text }];
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function compareMessageEntries(left: readonly SessionCompareMessage[], right: readonly SessionCompareMessage[]): SessionCompareDiff {
|
|
67
|
+
const added: SessionCompareMessage[] = [];
|
|
68
|
+
const removed: SessionCompareMessage[] = [];
|
|
69
|
+
let shared = 0;
|
|
70
|
+
const length = Math.max(left.length, right.length);
|
|
71
|
+
for (let index = 0; index < length; index += 1) {
|
|
72
|
+
const leftMessage = left[index];
|
|
73
|
+
const rightMessage = right[index];
|
|
74
|
+
if (leftMessage !== undefined && rightMessage !== undefined && leftMessage.role === rightMessage.role && leftMessage.text === rightMessage.text) {
|
|
75
|
+
shared += 1;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (rightMessage !== undefined && added.length < maxDiffMessages) added.push({ ...rightMessage, text: rightMessage.text.slice(0, maxMessageTextLength) });
|
|
79
|
+
if (leftMessage !== undefined && removed.length < maxDiffMessages) removed.push({ ...leftMessage, text: leftMessage.text.slice(0, maxMessageTextLength) });
|
|
80
|
+
}
|
|
81
|
+
return { shared, added, removed };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function sessionName(session: SessionInfo): string {
|
|
85
|
+
return session.name?.trim() || session.firstMessage.trim() || session.id;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function side(session: SessionInfo, messages: readonly SessionCompareMessage[]): SessionCompareSide {
|
|
89
|
+
const roles: Record<string, number> = {};
|
|
90
|
+
for (const message of messages) roles[message.role] = (roles[message.role] ?? 0) + 1;
|
|
91
|
+
return {
|
|
92
|
+
id: session.id,
|
|
93
|
+
name: sessionName(session),
|
|
94
|
+
path: session.path,
|
|
95
|
+
modified: session.modified.toISOString(),
|
|
96
|
+
messageCount: messages.length,
|
|
97
|
+
roles,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function readMessages(session: SessionInfo): Promise<SessionCompareMessage[]> {
|
|
102
|
+
const metadata = await stat(session.path);
|
|
103
|
+
if (!metadata.isFile()) throw new Error(`Session is not a file: ${session.id}`);
|
|
104
|
+
if (metadata.size > maxSessionFileBytes) throw new Error(`Session ${session.id} exceeds the ${maxSessionFileBytes}-byte comparison limit`);
|
|
105
|
+
return sessionMessageEntries(parseSessionEntries(await readFile(session.path, "utf8")));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function findSession(sessions: readonly SessionInfo[], requested: string): SessionInfo {
|
|
109
|
+
const value = requested.trim();
|
|
110
|
+
if (value === "") throw new Error("Session id is required");
|
|
111
|
+
const exact = sessions.find((session) => session.id === value || session.path === value || basename(session.path) === value);
|
|
112
|
+
if (exact === undefined) throw new Error(`Session was not found: ${value}`);
|
|
113
|
+
return exact;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function compareSessions(context: Context, leftId: string, rightId: string): Promise<SessionCompareReport> {
|
|
117
|
+
const sessions = await SessionManager.list(context.piHarnessLaunch.cwd, context.piSession.manager.getSessionDir());
|
|
118
|
+
const bounded = sessions.slice(0, maxSessions);
|
|
119
|
+
const leftSession = findSession(bounded, leftId);
|
|
120
|
+
const rightSession = findSession(bounded, rightId);
|
|
121
|
+
const [leftMessages, rightMessages] = await Promise.all([readMessages(leftSession), readMessages(rightSession)]);
|
|
122
|
+
const diff = compareMessageEntries(leftMessages, rightMessages);
|
|
123
|
+
return {
|
|
124
|
+
...diff,
|
|
125
|
+
left: side(leftSession, leftMessages),
|
|
126
|
+
right: side(rightSession, rightMessages),
|
|
127
|
+
changed: diff.shared !== leftMessages.length || diff.shared !== rightMessages.length,
|
|
128
|
+
comparedAt: new Date().toISOString(),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function renderMessage(message: SessionCompareMessage): string {
|
|
133
|
+
return `[${message.role}] ${message.text}`;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function renderReport(report: SessionCompareReport): string {
|
|
137
|
+
const lines = [
|
|
138
|
+
`Compared ${report.left.id} with ${report.right.id}: ${report.changed ? "changed" : "identical"}.`,
|
|
139
|
+
`Shared messages: ${report.shared}. Added in right: ${report.added.length}. Removed from left: ${report.removed.length}.`,
|
|
140
|
+
];
|
|
141
|
+
if (report.added.length > 0) lines.push(`Added:\n${report.added.map(renderMessage).join("\n")}`);
|
|
142
|
+
if (report.removed.length > 0) lines.push(`Removed:\n${report.removed.map(renderMessage).join("\n")}`);
|
|
143
|
+
return lines.join("\n\n");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export default {
|
|
147
|
+
name: "pi-session-compare",
|
|
148
|
+
inject: ["piHarnessLaunch", "piSession", "piPluginUi", "piTools"],
|
|
149
|
+
apply(context: Context) {
|
|
150
|
+
let latest: SessionCompareReport | undefined;
|
|
151
|
+
const unregister = context.piTools.register(
|
|
152
|
+
defineTool({
|
|
153
|
+
name: "session_compare",
|
|
154
|
+
label: "Compare sessions",
|
|
155
|
+
description: "Compare two persisted Pi JSONL sessions by message role and text without modifying either file.",
|
|
156
|
+
promptSnippet: "compare two persisted Pi sessions",
|
|
157
|
+
parameters: Type.Object({
|
|
158
|
+
left: Type.String({ description: "Left session id or session filename" }),
|
|
159
|
+
right: Type.String({ description: "Right session id or session filename" }),
|
|
160
|
+
}),
|
|
161
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<SessionCompareReport>> {
|
|
162
|
+
latest = await compareSessions(context, params.left, params.right);
|
|
163
|
+
return { content: [{ type: "text", text: renderReport(latest) }], details: latest };
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
);
|
|
167
|
+
const disposePanel = context.piPluginUi.register({
|
|
168
|
+
id: "session-compare-panel",
|
|
169
|
+
pluginId: "@pi-harness/core/plugins/session-compare",
|
|
170
|
+
title: "Session Compare",
|
|
171
|
+
description: "对比两个持久化会话的消息差异,不修改原始会话文件。",
|
|
172
|
+
icon: "⇄",
|
|
173
|
+
read: () => latest ?? { left: null, right: null, shared: 0, added: [], removed: [], changed: false, comparedAt: null },
|
|
174
|
+
});
|
|
175
|
+
context.effect(() => () => {
|
|
176
|
+
unregister();
|
|
177
|
+
disposePanel();
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { rename, writeFile } from "node:fs/promises";
|
|
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 { prepareWorkspaceFile } from "../workspace-path.js";
|
|
7
|
+
|
|
8
|
+
const maxOutputBytes = 1024 * 1024;
|
|
9
|
+
const defaultFileName = "pi-session.md";
|
|
10
|
+
|
|
11
|
+
type ExportState = { path: string; bytes: number; messages: number };
|
|
12
|
+
|
|
13
|
+
function record(value: unknown): Record<string, unknown> | undefined {
|
|
14
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function contentText(value: unknown): string {
|
|
18
|
+
if (typeof value === "string") return value.trim();
|
|
19
|
+
if (!Array.isArray(value)) return "";
|
|
20
|
+
return value
|
|
21
|
+
.flatMap((part) => {
|
|
22
|
+
const item = record(part);
|
|
23
|
+
return item?.type === "text" && typeof item.text === "string" ? [item.text.trim()] : [];
|
|
24
|
+
})
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.join("\n");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function heading(role: string, toolName: string | undefined): string {
|
|
30
|
+
if (role === "toolResult") return `### Tool: ${toolName?.trim() || "unknown"}`;
|
|
31
|
+
return `## ${role.slice(0, 1).toUpperCase()}${role.slice(1)}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function renderSessionMarkdown(messages: readonly unknown[]): string {
|
|
35
|
+
const sections = messages.flatMap((message) => {
|
|
36
|
+
const item = record(message);
|
|
37
|
+
if (item === undefined || typeof item.role !== "string") return [];
|
|
38
|
+
const text = contentText(item.content);
|
|
39
|
+
return text === "" ? [] : [`${heading(item.role, typeof item.toolName === "string" ? item.toolName : undefined)}\n\n${text}`];
|
|
40
|
+
});
|
|
41
|
+
return `# Pi Harness Session\n\n${sections.length > 0 ? `${sections.join("\n\n")}\n` : ""}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function normalizedOutputPath(requested: string): string {
|
|
45
|
+
const normalized = requested.trim() || defaultFileName;
|
|
46
|
+
if (normalized.length > 256) throw new Error("Session export path must be at most 256 characters");
|
|
47
|
+
if (!normalized.toLowerCase().endsWith(".md")) throw new Error("Session export path must end with .md");
|
|
48
|
+
return normalized;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
name: "pi-session-export",
|
|
53
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
54
|
+
apply(context: Context) {
|
|
55
|
+
let latest: ExportState | undefined;
|
|
56
|
+
const unregisterTool = context.piTools.register(
|
|
57
|
+
defineTool({
|
|
58
|
+
name: "session_export",
|
|
59
|
+
label: "Export session",
|
|
60
|
+
description: "Export the current Pi session as bounded Markdown without changing the conversation history.",
|
|
61
|
+
promptSnippet: "export the current session to a Markdown file",
|
|
62
|
+
parameters: Type.Object({
|
|
63
|
+
path: Type.Optional(Type.String({ description: "Markdown path relative to the workspace" })),
|
|
64
|
+
confirm: Type.Optional(Type.Boolean({ description: "Must be true to overwrite an existing file" })),
|
|
65
|
+
}),
|
|
66
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<ExportState>> {
|
|
67
|
+
const runtime = context.get("piRuntime");
|
|
68
|
+
if (runtime === undefined) throw new Error("Pi runtime is not ready");
|
|
69
|
+
const prepared = await prepareWorkspaceFile(
|
|
70
|
+
context.piHarnessLaunch.cwd,
|
|
71
|
+
normalizedOutputPath(params.path ?? defaultFileName),
|
|
72
|
+
"Session export path must stay inside the current workspace and target a regular file",
|
|
73
|
+
);
|
|
74
|
+
if (prepared.exists && params.confirm !== true) throw new Error("Session export would overwrite an existing file; retry with confirm=true");
|
|
75
|
+
const markdown = renderSessionMarkdown(runtime.session.messages);
|
|
76
|
+
const bytes = Buffer.byteLength(markdown, "utf8");
|
|
77
|
+
if (bytes > maxOutputBytes) throw new Error("Session export exceeds the 1 MiB output limit");
|
|
78
|
+
const temporary = `${prepared.target}.${randomUUID()}.tmp`;
|
|
79
|
+
await writeFile(temporary, markdown, { encoding: "utf8", mode: 0o600 });
|
|
80
|
+
await rename(temporary, prepared.target);
|
|
81
|
+
latest = { path: prepared.relativePath, bytes, messages: runtime.session.messages.length };
|
|
82
|
+
return { content: [{ type: "text", text: `Session exported to ${latest.path}.` }], details: latest };
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
const disposePanel = context.piPluginUi.register({
|
|
87
|
+
id: "session-export-panel",
|
|
88
|
+
pluginId: "@pi-harness/core/plugins/session-export",
|
|
89
|
+
title: "Session Export",
|
|
90
|
+
description: "将当前会话导出为工作区内的 Markdown 文件,不改变原会话历史。",
|
|
91
|
+
icon: "⇩",
|
|
92
|
+
read: () => ({ latest: latest ?? null, maxOutputBytes }),
|
|
93
|
+
});
|
|
94
|
+
context.effect(() => () => {
|
|
95
|
+
unregisterTool();
|
|
96
|
+
disposePanel();
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
3
|
+
import { defineTool, type AgentToolResult, type SessionStats } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: "pi-session-insights",
|
|
7
|
+
inject: ["piPluginUi", "piTools"],
|
|
8
|
+
apply(context: Context) {
|
|
9
|
+
const runtime = () => context.get("piRuntime");
|
|
10
|
+
const readStats = (): SessionStats => {
|
|
11
|
+
const service = runtime();
|
|
12
|
+
if (service === undefined) throw new Error("Pi runtime is not ready");
|
|
13
|
+
return service.session.getSessionStats();
|
|
14
|
+
};
|
|
15
|
+
const unregisterTool = context.piTools.register(
|
|
16
|
+
defineTool({
|
|
17
|
+
name: "session_report",
|
|
18
|
+
label: "Session report",
|
|
19
|
+
description: "Inspect the current session token, message, tool, cost, and context statistics.",
|
|
20
|
+
promptSnippet: "inspect current session usage and context statistics",
|
|
21
|
+
parameters: Type.Object({ compact: Type.Optional(Type.Boolean({ description: "Compact the session when true" })) }),
|
|
22
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<SessionStats>> {
|
|
23
|
+
const service = runtime();
|
|
24
|
+
if (service === undefined) throw new Error("Pi runtime is not ready");
|
|
25
|
+
if (params.compact === true) await service.session.compact();
|
|
26
|
+
const report = readStats();
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: `Session has ${report.totalMessages} messages and ${report.tokens.total} tracked tokens.` }],
|
|
29
|
+
details: report,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
const disposePanel = context.piPluginUi.register({
|
|
35
|
+
id: "session-insights-panel",
|
|
36
|
+
pluginId: "@pi-harness/core/plugins/session-insights",
|
|
37
|
+
title: "Session Insights",
|
|
38
|
+
description: "查看当前会话的消息、工具、token、成本和上下文统计,并可触发压缩。",
|
|
39
|
+
icon: "▥",
|
|
40
|
+
read: readStats,
|
|
41
|
+
});
|
|
42
|
+
context.effect(() => () => {
|
|
43
|
+
unregisterTool();
|
|
44
|
+
disposePanel();
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
4
|
+
import { defineTool, parseSessionEntries, SessionManager, type AgentToolResult, type SessionInfo } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
|
|
6
|
+
const maxQueryLength = 120;
|
|
7
|
+
const maxPreviewLength = 500;
|
|
8
|
+
const maxSessions = 200;
|
|
9
|
+
const maxHits = 100;
|
|
10
|
+
const maxSessionFileBytes = 4 * 1024 * 1024;
|
|
11
|
+
const sessionReadConcurrency = 8;
|
|
12
|
+
|
|
13
|
+
export type SessionSearchHit = { role: string; text: string };
|
|
14
|
+
export type SessionSearchItem = { id: string; name: string; path: string; modified: string; hits: SessionSearchHit[] };
|
|
15
|
+
|
|
16
|
+
function record(value: unknown): Record<string, unknown> | undefined {
|
|
17
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function contentText(value: unknown): string {
|
|
21
|
+
if (typeof value === "string") return value.trim();
|
|
22
|
+
if (!Array.isArray(value)) return "";
|
|
23
|
+
return value
|
|
24
|
+
.flatMap((part) => {
|
|
25
|
+
const item = record(part);
|
|
26
|
+
return item?.type === "text" && typeof item.text === "string" ? [item.text.trim()] : [];
|
|
27
|
+
})
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join("\n");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function matchingPreview(text: string, normalizedQuery: string): string {
|
|
33
|
+
if (text.length <= maxPreviewLength) return text;
|
|
34
|
+
const matchIndex = text.toLocaleLowerCase().indexOf(normalizedQuery);
|
|
35
|
+
const idealStart = matchIndex - Math.floor((maxPreviewLength - normalizedQuery.length) / 2);
|
|
36
|
+
const start = Math.max(0, Math.min(idealStart, text.length - maxPreviewLength));
|
|
37
|
+
return text.slice(start, start + maxPreviewLength);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function searchSessionEntries(entries: readonly unknown[], query: string): SessionSearchHit[] {
|
|
41
|
+
const normalized = query.trim().toLocaleLowerCase();
|
|
42
|
+
if (normalized.length < 1 || normalized.length > maxQueryLength) throw new Error("Session search query must contain 1-120 characters");
|
|
43
|
+
return entries.flatMap((entry) => {
|
|
44
|
+
const item = record(entry);
|
|
45
|
+
const message = record(item?.message);
|
|
46
|
+
if (item?.type !== "message" || typeof message?.role !== "string") return [];
|
|
47
|
+
const text = contentText(message.content);
|
|
48
|
+
return text.toLocaleLowerCase().includes(normalized) ? [{ role: message.role, text: matchingPreview(text, normalized) }] : [];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function searchSession(session: SessionInfo, query: string): Promise<SessionSearchItem | undefined> {
|
|
53
|
+
try {
|
|
54
|
+
const metadata = await stat(session.path);
|
|
55
|
+
if (!metadata.isFile() || metadata.size > maxSessionFileBytes) return undefined;
|
|
56
|
+
const hits = searchSessionEntries(parseSessionEntries(await readFile(session.path, "utf8")), query);
|
|
57
|
+
if (hits.length === 0) return undefined;
|
|
58
|
+
return {
|
|
59
|
+
id: session.id,
|
|
60
|
+
name: session.name?.trim() || session.firstMessage.trim() || session.id,
|
|
61
|
+
path: session.path,
|
|
62
|
+
modified: session.modified.toISOString(),
|
|
63
|
+
hits,
|
|
64
|
+
};
|
|
65
|
+
} catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function searchSessions(sessions: readonly SessionInfo[], query: string): Promise<SessionSearchItem[]> {
|
|
71
|
+
const results: SessionSearchItem[] = [];
|
|
72
|
+
for (let index = 0; index < sessions.length; index += sessionReadConcurrency) {
|
|
73
|
+
const batch = await Promise.all(sessions.slice(index, index + sessionReadConcurrency).map((session) => searchSession(session, query)));
|
|
74
|
+
results.push(...batch.filter((item): item is SessionSearchItem => item !== undefined));
|
|
75
|
+
}
|
|
76
|
+
return results;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default {
|
|
80
|
+
name: "pi-session-search",
|
|
81
|
+
inject: ["piHarnessLaunch", "piSession", "piPluginUi", "piTools"],
|
|
82
|
+
apply(context: Context) {
|
|
83
|
+
let latest: { query: string; total: number; items: SessionSearchItem[] } | undefined;
|
|
84
|
+
const search = async (query: string): Promise<SessionSearchItem[]> => {
|
|
85
|
+
const normalized = query.trim();
|
|
86
|
+
if (normalized.length < 1 || normalized.length > maxQueryLength) throw new Error("Session search query must contain 1-120 characters");
|
|
87
|
+
const sessions = await SessionManager.list(context.piHarnessLaunch.cwd, context.piSession.manager.getSessionDir());
|
|
88
|
+
const items = (await searchSessions(sessions.slice(0, maxSessions), normalized)).slice(0, maxHits);
|
|
89
|
+
latest = { query: normalized, total: items.length, items };
|
|
90
|
+
return items;
|
|
91
|
+
};
|
|
92
|
+
const unregister = context.piTools.register(
|
|
93
|
+
defineTool({
|
|
94
|
+
name: "session_search",
|
|
95
|
+
label: "Search sessions",
|
|
96
|
+
description: "Search persisted Pi JSONL sessions for a bounded text query without modifying session files.",
|
|
97
|
+
promptSnippet: "search previous Pi sessions for a phrase",
|
|
98
|
+
parameters: Type.Object({ query: Type.String({ description: "Text to search for, 1-120 characters" }) }),
|
|
99
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<{ query: string; total: number; items: SessionSearchItem[] }>> {
|
|
100
|
+
const items = await search(params.query);
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: items.map((item) => `${item.name}: ${item.hits.map((hit) => hit.text).join(" | ")}`).join("\n") || "No matching sessions found.",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
details: latest!,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
);
|
|
113
|
+
const disposePanel = context.piPluginUi.register({
|
|
114
|
+
id: "session-search-panel",
|
|
115
|
+
pluginId: "@pi-harness/core/plugins/session-search",
|
|
116
|
+
title: "Session Search",
|
|
117
|
+
description: "跨本地持久化会话搜索文本,只读不修改会话文件。",
|
|
118
|
+
icon: "⌕",
|
|
119
|
+
read: () => latest ?? { query: "", total: 0, items: [] },
|
|
120
|
+
});
|
|
121
|
+
context.effect(() => () => {
|
|
122
|
+
unregister();
|
|
123
|
+
disposePanel();
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -2,6 +2,7 @@ import { join, resolve } from "node:path";
|
|
|
2
2
|
import type { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
4
|
import { SessionManager } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { assertKnownConfigKeys } from "../config.js";
|
|
5
6
|
|
|
6
7
|
export interface SessionPluginConfig {
|
|
7
8
|
storage?: "memory" | "jsonl";
|
|
@@ -10,7 +11,7 @@ export interface SessionPluginConfig {
|
|
|
10
11
|
|
|
11
12
|
export const Config: z<SessionPluginConfig> = z.object({
|
|
12
13
|
storage: z.union(["memory", "jsonl"]).default("jsonl"),
|
|
13
|
-
directory: z.string(),
|
|
14
|
+
directory: z.string().min(1),
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
export default {
|
|
@@ -18,10 +19,11 @@ export default {
|
|
|
18
19
|
inject: ["piHarnessLaunch"],
|
|
19
20
|
Config,
|
|
20
21
|
apply(context: Context, config: SessionPluginConfig) {
|
|
22
|
+
assertKnownConfigKeys("pi-session", config, ["storage", "directory"]);
|
|
21
23
|
const storage = config.storage ?? "jsonl";
|
|
22
24
|
const manager = storage === "memory"
|
|
23
25
|
? SessionManager.inMemory(context.piHarnessLaunch.cwd)
|
|
24
|
-
: SessionManager.create(context.piHarnessLaunch.cwd, config.directory
|
|
26
|
+
: SessionManager.create(context.piHarnessLaunch.cwd, config.directory == null ? join(context.piHarnessLaunch.agentDir, "sessions") : resolve(context.piHarnessLaunch.cwd, config.directory));
|
|
25
27
|
context.provide("piSession", { manager });
|
|
26
28
|
},
|
|
27
29
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
4
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import type { PiMcpServerSnapshot } from "../services.js";
|
|
6
|
+
import { buildSkillInjection, type SkillInjection } from "./reverse-skill.js";
|
|
7
|
+
|
|
8
|
+
const maxQueryLength = 120;
|
|
9
|
+
const maxSkillBytes = 128 * 1024;
|
|
10
|
+
|
|
11
|
+
export interface SkillCatalogItem {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
filePath: string;
|
|
15
|
+
source: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SkillCatalogReport {
|
|
21
|
+
total: number;
|
|
22
|
+
skills: SkillCatalogItem[];
|
|
23
|
+
diagnostics: Array<{ type: string; message: string }>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function prepareSkillRead(name: string, content: string): SkillInjection {
|
|
27
|
+
return buildSkillInjection(content, name);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function queryText(value: string | undefined): string {
|
|
31
|
+
const query = (value ?? "").trim();
|
|
32
|
+
if (query.length > maxQueryLength) throw new Error(`Skill catalog query must contain 0-${maxQueryLength} characters`);
|
|
33
|
+
return query.toLocaleLowerCase();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function readCatalog(context: Context, query?: string): SkillCatalogReport {
|
|
37
|
+
const loaded = context.piResources.resourceLoader.getSkills();
|
|
38
|
+
const normalized = queryText(query);
|
|
39
|
+
const skills = loaded.skills
|
|
40
|
+
.map((skill): SkillCatalogItem => ({
|
|
41
|
+
name: skill.name,
|
|
42
|
+
description: skill.description,
|
|
43
|
+
filePath: skill.filePath,
|
|
44
|
+
source: skill.sourceInfo.source,
|
|
45
|
+
scope: skill.sourceInfo.scope,
|
|
46
|
+
disabled: skill.disableModelInvocation,
|
|
47
|
+
}))
|
|
48
|
+
.filter((skill) => normalized === "" || `${skill.name} ${skill.description} ${skill.source}`.toLocaleLowerCase().includes(normalized));
|
|
49
|
+
return {
|
|
50
|
+
total: skills.length,
|
|
51
|
+
skills,
|
|
52
|
+
diagnostics: loaded.diagnostics.map((diagnostic) => ({ type: diagnostic.type, message: diagnostic.message })),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
name: "pi-skill-catalog",
|
|
58
|
+
inject: ["piResources", "piMcp", "piPluginUi", "piTools"],
|
|
59
|
+
apply(context: Context) {
|
|
60
|
+
const readMcp = (): { servers: readonly PiMcpServerSnapshot[] } => context.piMcp.snapshot();
|
|
61
|
+
const unregister = context.piTools.register(
|
|
62
|
+
defineTool({
|
|
63
|
+
name: "skill_catalog",
|
|
64
|
+
label: "Skill catalog",
|
|
65
|
+
description:
|
|
66
|
+
"Inspect loaded Agent Skills, safely read one skill file through a bounded data boundary, and inspect MCP status without changing configuration.",
|
|
67
|
+
promptSnippet: "inspect loaded skills or managed MCP server status",
|
|
68
|
+
parameters: Type.Object({
|
|
69
|
+
action: Type.Union([Type.Literal("list"), Type.Literal("read"), Type.Literal("mcp")]),
|
|
70
|
+
query: Type.Optional(Type.String()),
|
|
71
|
+
name: Type.Optional(Type.String()),
|
|
72
|
+
}),
|
|
73
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<SkillCatalogReport | SkillInjection | { servers: readonly PiMcpServerSnapshot[] }>> {
|
|
74
|
+
if (params.action === "mcp") {
|
|
75
|
+
const result = readMcp();
|
|
76
|
+
return {
|
|
77
|
+
content: [{ type: "text", text: result.servers.map((server) => `${server.id}: ${server.status}`).join("\n") || "No MCP servers configured." }],
|
|
78
|
+
details: result,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const report = readCatalog(context, params.query);
|
|
82
|
+
if (params.action === "list") {
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: "text", text: report.skills.map((skill) => `${skill.name}: ${skill.description}`).join("\n") || "No matching skills loaded." }],
|
|
85
|
+
details: report,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const name = (params.name ?? "").trim();
|
|
89
|
+
if (name === "") throw new Error("Skill name is required");
|
|
90
|
+
const skill = report.skills.find((candidate) => candidate.name === name);
|
|
91
|
+
if (skill === undefined) throw new Error(`Skill was not found: ${name}`);
|
|
92
|
+
const content = await readFile(skill.filePath, "utf8");
|
|
93
|
+
if (Buffer.byteLength(content, "utf8") > maxSkillBytes) throw new Error(`Skill file exceeds ${maxSkillBytes} bytes`);
|
|
94
|
+
const result = prepareSkillRead(name, content);
|
|
95
|
+
const message = result.content === null ? `Skill ${result.name} was blocked from catalog output (${result.risk}).` : result.content;
|
|
96
|
+
return { content: [{ type: "text", text: message }], details: result };
|
|
97
|
+
},
|
|
98
|
+
}),
|
|
99
|
+
);
|
|
100
|
+
const disposePanel = context.piPluginUi.register({
|
|
101
|
+
id: "skill-catalog-panel",
|
|
102
|
+
pluginId: "@pi-harness/core/plugins/skill-catalog",
|
|
103
|
+
title: "Skills Catalog",
|
|
104
|
+
description: "查看当前运行时加载的 Skills 与 MCP 服务器状态。",
|
|
105
|
+
icon: "✦",
|
|
106
|
+
read: () => {
|
|
107
|
+
const report = readCatalog(context);
|
|
108
|
+
const mcp = readMcp();
|
|
109
|
+
return { skillCount: report.total, skills: report.skills, diagnostics: report.diagnostics, mcpCount: mcp.servers.length, mcpServers: mcp.servers };
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
context.effect(() => () => {
|
|
113
|
+
unregister();
|
|
114
|
+
disposePanel();
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
};
|