@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,158 @@
|
|
|
1
|
+
import { createServer, type IncomingMessage, type ServerResponse, type Server } from "node:http";
|
|
2
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import z from "@deepseek-ai/schemastery";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
|
|
7
|
+
type MockRoute = { path: string; method?: string; status?: number; headers?: Record<string, string>; body?: string };
|
|
8
|
+
type MockServerState = { running: boolean; url: string | null; routes: number; lastRequest: string | null };
|
|
9
|
+
|
|
10
|
+
const maxRoutes = 64;
|
|
11
|
+
const maxBodyBytes = 128 * 1024;
|
|
12
|
+
const allowedMethods = new Set(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
|
|
13
|
+
|
|
14
|
+
export interface MockServerPluginConfig {
|
|
15
|
+
port?: number;
|
|
16
|
+
routes?: MockRoute[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const routeConfig = z.object({
|
|
20
|
+
path: z.string(),
|
|
21
|
+
method: z.string().default("GET"),
|
|
22
|
+
status: z.number().default(200),
|
|
23
|
+
headers: z.dict(z.string()).default({}),
|
|
24
|
+
body: z.string().default(""),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const Config: z<MockServerPluginConfig> = z.object({ port: z.number().default(0), routes: z.array(routeConfig).default([]) });
|
|
28
|
+
|
|
29
|
+
function normalizeRoutes(routes: MockRoute[]): MockRoute[] {
|
|
30
|
+
if (routes.length > maxRoutes) throw new Error(`Mock server cannot exceed ${maxRoutes} routes`);
|
|
31
|
+
return routes.map((route) => {
|
|
32
|
+
const path = route.path.trim();
|
|
33
|
+
if (!path.startsWith("/") || path.length > 2048 || path.includes("#")) throw new Error("Mock route path must start with / and be at most 2048 characters");
|
|
34
|
+
const method = (route.method ?? "GET").trim().toUpperCase();
|
|
35
|
+
if (!allowedMethods.has(method)) throw new Error(`Mock route method is not allowed: ${method}`);
|
|
36
|
+
const status = route.status ?? 200;
|
|
37
|
+
if (!Number.isInteger(status) || status < 100 || status > 599) throw new Error("Mock route status must be an integer between 100 and 599");
|
|
38
|
+
const body = route.body ?? "";
|
|
39
|
+
if (Buffer.byteLength(body, "utf8") > maxBodyBytes) throw new Error(`Mock route body cannot exceed ${maxBodyBytes} bytes`);
|
|
40
|
+
const headers = Object.fromEntries(Object.entries(route.headers ?? {}).map(([name, value]) => [name, String(value)]));
|
|
41
|
+
return { path, method, status, headers, body };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function routeKey(method: string, path: string): string {
|
|
46
|
+
return `${method} ${path}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
name: "pi-mock-server",
|
|
51
|
+
inject: ["piPluginUi", "piTools"],
|
|
52
|
+
Config,
|
|
53
|
+
apply(context: Context, config: MockServerPluginConfig) {
|
|
54
|
+
const routes = normalizeRoutes(config.routes ?? []);
|
|
55
|
+
let server: Server | undefined;
|
|
56
|
+
let state: MockServerState = { running: false, url: null, routes: routes.length, lastRequest: null };
|
|
57
|
+
const start = async (requestedPort?: number): Promise<MockServerState> => {
|
|
58
|
+
if (server !== undefined) throw new Error("Mock server is already running");
|
|
59
|
+
const port = requestedPort ?? config.port ?? 0;
|
|
60
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) throw new Error("Mock server port must be an integer between 0 and 65535");
|
|
61
|
+
const routeMap = new Map(routes.map((route) => [routeKey(route.method ?? "GET", route.path), route]));
|
|
62
|
+
server = createServer((request: IncomingMessage, response: ServerResponse) => {
|
|
63
|
+
const method = (request.method ?? "GET").toUpperCase();
|
|
64
|
+
const pathname = new URL(request.url ?? "/", "http://127.0.0.1").pathname;
|
|
65
|
+
state = { ...state, lastRequest: routeKey(method, pathname) };
|
|
66
|
+
const route = routeMap.get(routeKey(method, pathname));
|
|
67
|
+
if (route === undefined) {
|
|
68
|
+
response.statusCode = 404;
|
|
69
|
+
response.setHeader("content-type", "text/plain; charset=utf-8");
|
|
70
|
+
response.end("Not found");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
response.statusCode = route.status ?? 200;
|
|
74
|
+
for (const [name, value] of Object.entries(route.headers ?? {})) response.setHeader(name, value);
|
|
75
|
+
if (!response.hasHeader("content-type")) response.setHeader("content-type", "text/plain; charset=utf-8");
|
|
76
|
+
response.end(route.body ?? "");
|
|
77
|
+
});
|
|
78
|
+
await new Promise<void>((resolve, reject) => {
|
|
79
|
+
const onError = (error: Error): void => {
|
|
80
|
+
server?.off("listening", onListening);
|
|
81
|
+
reject(error);
|
|
82
|
+
};
|
|
83
|
+
const onListening = (): void => {
|
|
84
|
+
server?.off("error", onError);
|
|
85
|
+
resolve();
|
|
86
|
+
};
|
|
87
|
+
server!.once("error", onError);
|
|
88
|
+
server!.once("listening", onListening);
|
|
89
|
+
server!.listen(port, "127.0.0.1");
|
|
90
|
+
});
|
|
91
|
+
const address = server.address();
|
|
92
|
+
if (address === null || typeof address === "string") throw new Error("Mock server did not expose a TCP address");
|
|
93
|
+
state = { ...state, running: true, url: `http://127.0.0.1:${address.port}` };
|
|
94
|
+
return state;
|
|
95
|
+
};
|
|
96
|
+
const stop = async (): Promise<boolean> => {
|
|
97
|
+
if (server === undefined) return false;
|
|
98
|
+
const current = server;
|
|
99
|
+
server = undefined;
|
|
100
|
+
await new Promise<void>((resolve, reject) => current.close((error) => (error ? reject(error) : resolve())));
|
|
101
|
+
state = { ...state, running: false, url: null };
|
|
102
|
+
return true;
|
|
103
|
+
};
|
|
104
|
+
const unregisterStart = context.piTools.register(
|
|
105
|
+
defineTool({
|
|
106
|
+
name: "mock_server_start",
|
|
107
|
+
label: "Mock server start",
|
|
108
|
+
description: "Start a local deterministic HTTP mock server from configured routes.",
|
|
109
|
+
promptSnippet: "start the local mock HTTP server",
|
|
110
|
+
parameters: Type.Object({ port: Type.Optional(Type.Number({ description: "Bind port; 0 selects a free local port" })) }),
|
|
111
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<MockServerState>> {
|
|
112
|
+
const result = await start(params.port);
|
|
113
|
+
return { content: [{ type: "text", text: `Mock server listening at ${result.url}` }], details: result };
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
117
|
+
const unregisterStop = context.piTools.register(
|
|
118
|
+
defineTool({
|
|
119
|
+
name: "mock_server_stop",
|
|
120
|
+
label: "Mock server stop",
|
|
121
|
+
description: "Stop the local HTTP mock server.",
|
|
122
|
+
promptSnippet: "stop the local mock HTTP server",
|
|
123
|
+
parameters: Type.Object({}),
|
|
124
|
+
async execute(): Promise<AgentToolResult<{ stopped: boolean }>> {
|
|
125
|
+
const stopped = await stop();
|
|
126
|
+
return { content: [{ type: "text", text: stopped ? "Mock server stopped." : "Mock server was not running." }], details: { stopped } };
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
);
|
|
130
|
+
const unregisterStatus = context.piTools.register(
|
|
131
|
+
defineTool({
|
|
132
|
+
name: "mock_server_status",
|
|
133
|
+
label: "Mock server status",
|
|
134
|
+
description: "Show local HTTP mock server status and route count.",
|
|
135
|
+
promptSnippet: "check the local mock server status",
|
|
136
|
+
parameters: Type.Object({}),
|
|
137
|
+
execute(): Promise<AgentToolResult<MockServerState>> {
|
|
138
|
+
return Promise.resolve({ content: [{ type: "text", text: `${state.running ? "running" : "stopped"} ${state.url ?? ""}`.trim() }], details: state });
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
);
|
|
142
|
+
const disposePanel = context.piPluginUi.register({
|
|
143
|
+
id: "mock-server-panel",
|
|
144
|
+
pluginId: "@pi-harness/core/plugins/mock-server",
|
|
145
|
+
title: "Mock Server",
|
|
146
|
+
description: "在本机回环地址提供可控的 HTTP mock 路由。",
|
|
147
|
+
icon: "⇄",
|
|
148
|
+
read: () => state,
|
|
149
|
+
});
|
|
150
|
+
context.effect(() => () => {
|
|
151
|
+
unregisterStart();
|
|
152
|
+
unregisterStop();
|
|
153
|
+
unregisterStatus();
|
|
154
|
+
disposePanel();
|
|
155
|
+
void stop();
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import { assertKnownConfigKeys } from "../config.js";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
name: "pi-model",
|
|
5
6
|
inject: ["piModelRuntime", "piResources"],
|
|
6
|
-
apply(context: Context) {
|
|
7
|
+
apply(context: Context, config: unknown) {
|
|
8
|
+
assertKnownConfigKeys("pi-model", config, []);
|
|
7
9
|
const { runtime, provider, model: modelId } = context.piModelRuntime;
|
|
8
10
|
const model = runtime.getModel(provider, modelId);
|
|
9
11
|
if (model === undefined) throw new Error(`Pi model is not registered: ${provider}/${modelId}`);
|
|
@@ -2,6 +2,7 @@ import { join } from "node:path";
|
|
|
2
2
|
import type { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
import z from "@deepseek-ai/schemastery";
|
|
4
4
|
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { assertKnownConfigKeys } from "../config.js";
|
|
5
6
|
|
|
6
7
|
export interface ModelsPluginConfig {
|
|
7
8
|
provider: string;
|
|
@@ -10,8 +11,8 @@ export interface ModelsPluginConfig {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const Config: z<ModelsPluginConfig> = z.object({
|
|
13
|
-
provider: z.string().required(),
|
|
14
|
-
model: z.string().required(),
|
|
14
|
+
provider: z.string().required().min(1),
|
|
15
|
+
model: z.string().required().min(1),
|
|
15
16
|
refreshOnCreate: z.boolean().default(false),
|
|
16
17
|
});
|
|
17
18
|
|
|
@@ -20,12 +21,14 @@ export default {
|
|
|
20
21
|
inject: ["piHarnessLaunch"],
|
|
21
22
|
Config,
|
|
22
23
|
async apply(context: Context, config: ModelsPluginConfig) {
|
|
24
|
+
assertKnownConfigKeys("pi-models", config, ["provider", "model", "refreshOnCreate"]);
|
|
23
25
|
const agentDir = context.piHarnessLaunch.agentDir;
|
|
24
26
|
const runtime = await ModelRuntime.create({
|
|
25
27
|
authPath: join(agentDir, "auth.json"),
|
|
26
28
|
modelsPath: join(agentDir, "models.json"),
|
|
27
29
|
modelsStorePath: join(agentDir, "models-store.json"),
|
|
28
30
|
refreshOnCreate: config.refreshOnCreate ?? false,
|
|
31
|
+
allowModelNetwork: config.refreshOnCreate ?? false,
|
|
29
32
|
});
|
|
30
33
|
context.provide("piModelRuntime", { runtime, provider: config.provider, model: config.model });
|
|
31
34
|
},
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { extname, relative, resolve } from "node:path";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
|
|
7
|
+
const mimeByExtension: Readonly<Record<string, string>> = {
|
|
8
|
+
".gif": "image/gif",
|
|
9
|
+
".jpeg": "image/jpeg",
|
|
10
|
+
".jpg": "image/jpeg",
|
|
11
|
+
".png": "image/png",
|
|
12
|
+
".webp": "image/webp",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: "pi-modlens",
|
|
17
|
+
inject: ["piHarnessLaunch", "piTools", "piPluginUi"],
|
|
18
|
+
apply(context: Context) {
|
|
19
|
+
let lastImage: { path: string; mimeType: string; bytes: number } | undefined;
|
|
20
|
+
const unregisterTool = context.piTools.register(
|
|
21
|
+
defineTool({
|
|
22
|
+
name: "vision_inspect",
|
|
23
|
+
label: "Vision inspect",
|
|
24
|
+
description: "Attach a local image from the current workspace so a vision-capable model can inspect it.",
|
|
25
|
+
promptSnippet: "attach a local image for visual inspection",
|
|
26
|
+
parameters: Type.Object({ path: Type.String({ description: "Image path relative to the workspace" }) }),
|
|
27
|
+
async execute(_toolCallId, params) {
|
|
28
|
+
const workspace = resolve(context.piHarnessLaunch.cwd);
|
|
29
|
+
const target = resolve(workspace, params.path);
|
|
30
|
+
const relativePath = relative(workspace, target);
|
|
31
|
+
if (relativePath.startsWith("..") || relativePath.includes("/..")) throw new Error("Image path must stay inside the current workspace");
|
|
32
|
+
const mimeType = mimeByExtension[extname(target).toLowerCase()];
|
|
33
|
+
if (mimeType === undefined) throw new Error("Unsupported image type; use png, jpeg, gif, or webp");
|
|
34
|
+
const metadata = await stat(target);
|
|
35
|
+
if (!metadata.isFile()) throw new Error("Image path is not a file");
|
|
36
|
+
if (metadata.size > 10 * 1024 * 1024) throw new Error("Image exceeds the 10 MiB attachment limit");
|
|
37
|
+
const data = (await readFile(target)).toString("base64");
|
|
38
|
+
lastImage = { path: relativePath || ".", mimeType, bytes: metadata.size };
|
|
39
|
+
return {
|
|
40
|
+
content: [{ type: "image", data, mimeType }],
|
|
41
|
+
details: lastImage,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
const disposePanel = context.piPluginUi.register({
|
|
47
|
+
id: "modlens-panel",
|
|
48
|
+
pluginId: "@pi-harness/core/plugins/modlens",
|
|
49
|
+
title: "视觉桥接",
|
|
50
|
+
description: "将工作区内的图片安全附加到当前对话,交由支持视觉的模型分析。",
|
|
51
|
+
icon: "◉",
|
|
52
|
+
read: () => ({
|
|
53
|
+
attached: lastImage !== undefined,
|
|
54
|
+
image: lastImage ?? null,
|
|
55
|
+
supportedTypes: Object.keys(mimeByExtension).map((extension) => extension.slice(1)),
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
context.effect(() => () => {
|
|
59
|
+
unregisterTool();
|
|
60
|
+
disposePanel();
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { lstat, readdir, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
4
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
5
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import { resolveExistingWorkspacePath } from "../workspace-path.js";
|
|
7
|
+
|
|
8
|
+
const maxQueryLength = 120;
|
|
9
|
+
const maxPathLength = 512;
|
|
10
|
+
const maxFileBytes = 2 * 1024 * 1024;
|
|
11
|
+
const maxFiles = 1_000;
|
|
12
|
+
const maxResults = 100;
|
|
13
|
+
const ignoredDirectories = new Set([".git", "node_modules", ".pi", "dist", "build"]);
|
|
14
|
+
const sourceExtensions = new Set([".cjs", ".js", ".jsx", ".mjs", ".ts", ".tsx"]);
|
|
15
|
+
|
|
16
|
+
export type ModuleMatchKind = "import" | "export" | "symbol";
|
|
17
|
+
export type ModuleMatch = { kind: ModuleMatchKind; name: string; path: string; line: number; text: string };
|
|
18
|
+
export type ModuleSearchKind = ModuleMatchKind | "all";
|
|
19
|
+
export type ModuleSearchReport = {
|
|
20
|
+
query: string;
|
|
21
|
+
kind: ModuleSearchKind;
|
|
22
|
+
path: string;
|
|
23
|
+
matches: ModuleMatch[];
|
|
24
|
+
scannedFiles: number;
|
|
25
|
+
skippedFiles: number;
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function moduleNames(source: string, kind: ModuleMatchKind): string[] {
|
|
30
|
+
if (kind === "import") {
|
|
31
|
+
const named = [...source.matchAll(/\bimport\s*\{([^}]*)\}/gu)].flatMap(
|
|
32
|
+
(match) =>
|
|
33
|
+
match[1]
|
|
34
|
+
?.split(",")
|
|
35
|
+
.map(
|
|
36
|
+
(item) =>
|
|
37
|
+
item
|
|
38
|
+
.trim()
|
|
39
|
+
.split(/\s+as\s+/iu)[0]
|
|
40
|
+
?.trim() ?? "",
|
|
41
|
+
)
|
|
42
|
+
.filter(Boolean) ?? [],
|
|
43
|
+
);
|
|
44
|
+
const defaults = [...source.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s+from\s*["']/gu)].map((match) => match[1]!).filter(Boolean);
|
|
45
|
+
const namespaces = [...source.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s*["']/gu)].map((match) => match[1]!).filter(Boolean);
|
|
46
|
+
return [...named, ...defaults, ...namespaces];
|
|
47
|
+
}
|
|
48
|
+
if (kind === "export") {
|
|
49
|
+
const declarations = [...source.matchAll(/\bexport\s+(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\s+([A-Za-z_$][\w$]*)/gu)].map(
|
|
50
|
+
(match) => match[1]!,
|
|
51
|
+
);
|
|
52
|
+
const named = [...source.matchAll(/\bexport\s*\{([^}]*)\}/gu)].flatMap(
|
|
53
|
+
(match) =>
|
|
54
|
+
match[1]
|
|
55
|
+
?.split(",")
|
|
56
|
+
.map(
|
|
57
|
+
(item) =>
|
|
58
|
+
item
|
|
59
|
+
.trim()
|
|
60
|
+
.split(/\s+as\s+/iu)
|
|
61
|
+
.at(-1)
|
|
62
|
+
?.trim() ?? "",
|
|
63
|
+
)
|
|
64
|
+
.filter(Boolean) ?? [],
|
|
65
|
+
);
|
|
66
|
+
return [...declarations, ...named];
|
|
67
|
+
}
|
|
68
|
+
return [...source.matchAll(/\b(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\s+([A-Za-z_$][\w$]*)/gu)]
|
|
69
|
+
.map((match) => match[1]!)
|
|
70
|
+
.filter(Boolean);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function extractModuleMatches(source: string, path: string, query: string, kind: ModuleSearchKind): ModuleMatch[] {
|
|
74
|
+
const normalizedQuery = query.trim().toLocaleLowerCase();
|
|
75
|
+
if (normalizedQuery.length < 1 || normalizedQuery.length > maxQueryLength) throw new Error("Module search query must contain 1-120 characters");
|
|
76
|
+
const kinds: ModuleMatchKind[] = kind === "all" ? ["import", "export", "symbol"] : [kind];
|
|
77
|
+
return source.split(/\r?\n/u).flatMap((line, index) => {
|
|
78
|
+
const matches: ModuleMatch[] = [];
|
|
79
|
+
for (const entryKind of kinds) {
|
|
80
|
+
if (kind === "all" && entryKind === "symbol" && /\bexport\b/u.test(line)) continue;
|
|
81
|
+
for (const name of moduleNames(line, entryKind)) {
|
|
82
|
+
if (!name.toLocaleLowerCase().includes(normalizedQuery)) continue;
|
|
83
|
+
matches.push({ kind: entryKind, name, path, line: index + 1, text: line });
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return matches;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function filesUnder(target: string, root: string, files: string[]): Promise<void> {
|
|
91
|
+
if (files.length >= maxFiles) return;
|
|
92
|
+
const metadata = await lstat(target);
|
|
93
|
+
if (metadata.isSymbolicLink()) return;
|
|
94
|
+
if (metadata.isFile()) {
|
|
95
|
+
if (sourceExtensions.has(target.slice(target.lastIndexOf(".")).toLocaleLowerCase())) files.push(target);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!metadata.isDirectory()) return;
|
|
99
|
+
const entries = (await readdir(target, { withFileTypes: true })).sort((left, right) => left.name.localeCompare(right.name));
|
|
100
|
+
for (const entry of entries) {
|
|
101
|
+
if (files.length >= maxFiles) return;
|
|
102
|
+
if (entry.isDirectory() && ignoredDirectories.has(entry.name)) continue;
|
|
103
|
+
const child = resolve(target, entry.name);
|
|
104
|
+
await filesUnder(child, root, files);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default {
|
|
109
|
+
name: "pi-module-search",
|
|
110
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
111
|
+
apply(context: Context) {
|
|
112
|
+
let latest: ModuleSearchReport | undefined;
|
|
113
|
+
const search = async (
|
|
114
|
+
query: string,
|
|
115
|
+
requestedPath: string | undefined,
|
|
116
|
+
kind: ModuleSearchKind,
|
|
117
|
+
requestedLimit: number | undefined,
|
|
118
|
+
): Promise<ModuleSearchReport> => {
|
|
119
|
+
const normalizedQuery = query.trim();
|
|
120
|
+
if (normalizedQuery.length < 1 || normalizedQuery.length > maxQueryLength) throw new Error("Module search query must contain 1-120 characters");
|
|
121
|
+
const normalizedKind = kind === "import" || kind === "export" || kind === "symbol" ? kind : "all";
|
|
122
|
+
const requested = requestedPath?.trim() ?? ".";
|
|
123
|
+
if (requested.length > maxPathLength || requested.includes("\\"))
|
|
124
|
+
throw new Error("Module search path must be a relative POSIX path of at most 512 characters");
|
|
125
|
+
const resolved = await resolveExistingWorkspacePath(context.piHarnessLaunch.cwd, requested, "Module search path must stay inside the current workspace");
|
|
126
|
+
const root = resolved.root;
|
|
127
|
+
const target = resolved.target;
|
|
128
|
+
const targetMetadata = await stat(target);
|
|
129
|
+
const files: string[] = [];
|
|
130
|
+
await filesUnder(target, root, files);
|
|
131
|
+
const limit = Math.max(1, Math.min(maxResults, Math.trunc(requestedLimit ?? maxResults)));
|
|
132
|
+
const matches: ModuleMatch[] = [];
|
|
133
|
+
let truncated = false;
|
|
134
|
+
let scannedFiles = 0;
|
|
135
|
+
let skippedFiles = targetMetadata.isFile() && targetMetadata.size > maxFileBytes ? 1 : 0;
|
|
136
|
+
for (const file of files) {
|
|
137
|
+
if (matches.length >= limit) break;
|
|
138
|
+
const metadata = await stat(file);
|
|
139
|
+
if (metadata.size > maxFileBytes) {
|
|
140
|
+
skippedFiles += 1;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const source = await readFile(file, "utf8");
|
|
144
|
+
scannedFiles += 1;
|
|
145
|
+
const fileMatches = extractModuleMatches(source, relative(root, file), normalizedQuery, normalizedKind);
|
|
146
|
+
const remaining = limit - matches.length;
|
|
147
|
+
matches.push(...fileMatches.slice(0, remaining));
|
|
148
|
+
if (fileMatches.length > remaining) truncated = true;
|
|
149
|
+
}
|
|
150
|
+
const report: ModuleSearchReport = {
|
|
151
|
+
query: normalizedQuery,
|
|
152
|
+
kind: normalizedKind,
|
|
153
|
+
path: relative(root, target) || ".",
|
|
154
|
+
matches,
|
|
155
|
+
scannedFiles,
|
|
156
|
+
skippedFiles,
|
|
157
|
+
truncated: truncated || (matches.length >= limit && files.length > scannedFiles + skippedFiles),
|
|
158
|
+
};
|
|
159
|
+
latest = report;
|
|
160
|
+
return report;
|
|
161
|
+
};
|
|
162
|
+
const unregister = context.piTools.register(
|
|
163
|
+
defineTool({
|
|
164
|
+
name: "module_search",
|
|
165
|
+
label: "Search modules",
|
|
166
|
+
description: "Find imports, exports, or declared symbols in bounded workspace source files without modifying them.",
|
|
167
|
+
promptSnippet: "find a module import, export, or symbol in the workspace",
|
|
168
|
+
parameters: Type.Object({
|
|
169
|
+
query: Type.String({ description: "Name fragment to find, 1-120 characters" }),
|
|
170
|
+
kind: Type.Optional(Type.Union([Type.Literal("all"), Type.Literal("import"), Type.Literal("export"), Type.Literal("symbol")])),
|
|
171
|
+
path: Type.Optional(Type.String({ description: "Relative workspace path" })),
|
|
172
|
+
maxResults: Type.Optional(Type.Number({ description: "Maximum matches, 1-100" })),
|
|
173
|
+
}),
|
|
174
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<ModuleSearchReport>> {
|
|
175
|
+
const report = await search(params.query, params.path, params.kind ?? "all", params.maxResults);
|
|
176
|
+
return {
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
type: "text",
|
|
180
|
+
text: report.matches.map((match) => `${match.path}:${match.line} ${match.kind} ${match.name}`).join("\n") || "No module matches found.",
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
details: report,
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
}),
|
|
187
|
+
);
|
|
188
|
+
const disposePanel = context.piPluginUi.register({
|
|
189
|
+
id: "module-search-panel",
|
|
190
|
+
pluginId: "@pi-harness/core/plugins/module-search",
|
|
191
|
+
title: "Module Search",
|
|
192
|
+
description: "按导入、导出和声明符号检索工作区源码。",
|
|
193
|
+
icon: "⌕",
|
|
194
|
+
read: () => ({ latest: latest ?? null, matchCount: latest?.matches.length ?? 0 }),
|
|
195
|
+
});
|
|
196
|
+
context.effect(() => () => {
|
|
197
|
+
unregister();
|
|
198
|
+
disposePanel();
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { lstat, mkdir, realpath, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, relative, resolve } from "node:path";
|
|
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 maxContentBytes = 512 * 1024;
|
|
9
|
+
const maxRelativePathLength = 512;
|
|
10
|
+
type SyncResult = { relativePath: string; absolutePath: string; bytes: number };
|
|
11
|
+
|
|
12
|
+
export interface ObsidianSyncPluginConfig {
|
|
13
|
+
vaultPath?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Config: z<ObsidianSyncPluginConfig> = z.object({ vaultPath: z.string().default("") });
|
|
17
|
+
|
|
18
|
+
function isInside(root: string, target: string): boolean {
|
|
19
|
+
const remainder = relative(root, target);
|
|
20
|
+
return remainder === "" || (remainder !== ".." && !remainder.startsWith(`..${"/"}`) && !remainder.startsWith(`..${"\\"}`) && !remainder.startsWith("/"));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: "pi-obsidian-sync",
|
|
25
|
+
inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
|
|
26
|
+
Config,
|
|
27
|
+
apply(context: Context, config: ObsidianSyncPluginConfig) {
|
|
28
|
+
const configuredVault = config.vaultPath?.trim() ?? "";
|
|
29
|
+
let last: SyncResult | undefined;
|
|
30
|
+
const sync = async (relativePath: string, content: string, confirm: boolean): Promise<SyncResult> => {
|
|
31
|
+
if (configuredVault === "") throw new Error("Obsidian sync requires vaultPath in the plugin configuration");
|
|
32
|
+
if (!confirm) throw new Error("Obsidian sync requires confirm=true before writing a note");
|
|
33
|
+
if (relativePath.length === 0 || relativePath.length > maxRelativePathLength || !relativePath.toLowerCase().endsWith(".md"))
|
|
34
|
+
throw new Error("Obsidian note path must be a relative .md path of at most 512 characters");
|
|
35
|
+
if (content.length === 0 || Buffer.byteLength(content, "utf8") > maxContentBytes)
|
|
36
|
+
throw new Error(`Obsidian note content must be between 1 and ${maxContentBytes} bytes`);
|
|
37
|
+
await mkdir(configuredVault, { recursive: true });
|
|
38
|
+
const vault = await realpath(configuredVault);
|
|
39
|
+
const target = resolve(vault, relativePath);
|
|
40
|
+
if (!isInside(vault, target)) throw new Error("Obsidian note path must stay inside the configured vault");
|
|
41
|
+
const parent = dirname(target);
|
|
42
|
+
await mkdir(parent, { recursive: true });
|
|
43
|
+
if (!isInside(vault, await realpath(parent))) throw new Error("Obsidian note path must stay inside the configured vault");
|
|
44
|
+
try {
|
|
45
|
+
if ((await lstat(target)).isSymbolicLink()) throw new Error("Obsidian note target cannot be a symbolic link");
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
|
|
48
|
+
}
|
|
49
|
+
await writeFile(target, content, { encoding: "utf8", mode: 0o600 });
|
|
50
|
+
last = { relativePath, absolutePath: target, bytes: Buffer.byteLength(content, "utf8") };
|
|
51
|
+
return last;
|
|
52
|
+
};
|
|
53
|
+
const unregisterTool = context.piTools.register(
|
|
54
|
+
defineTool({
|
|
55
|
+
name: "obsidian_sync",
|
|
56
|
+
label: "Obsidian sync",
|
|
57
|
+
description: "Write a confirmed Markdown note inside the configured Obsidian vault.",
|
|
58
|
+
promptSnippet: "save this result as a Markdown note in the Obsidian vault",
|
|
59
|
+
parameters: Type.Object({
|
|
60
|
+
relativePath: Type.String({ description: "Relative .md path inside the configured vault" }),
|
|
61
|
+
content: Type.String({ description: "Markdown note content" }),
|
|
62
|
+
confirm: Type.Boolean({ description: "Must be true to write the note" }),
|
|
63
|
+
}),
|
|
64
|
+
async execute(_toolCallId, params): Promise<AgentToolResult<SyncResult>> {
|
|
65
|
+
const result = await sync(params.relativePath, params.content, params.confirm);
|
|
66
|
+
return { content: [{ type: "text", text: `Obsidian note written: ${result.relativePath}` }], details: result };
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
const disposePanel = context.piPluginUi.register({
|
|
71
|
+
id: "obsidian-sync-panel",
|
|
72
|
+
pluginId: "@pi-harness/core/plugins/obsidian-sync",
|
|
73
|
+
title: "Obsidian Sync",
|
|
74
|
+
description: "将 Agent 产出的 Markdown 安全写入指定 Obsidian vault。",
|
|
75
|
+
icon: "▤",
|
|
76
|
+
read: () => ({ configured: configuredVault !== "", vaultPath: configuredVault || null, last: last ?? null }),
|
|
77
|
+
});
|
|
78
|
+
context.effect(() => () => {
|
|
79
|
+
unregisterTool();
|
|
80
|
+
disposePanel();
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import z from "@deepseek-ai/schemastery";
|
|
3
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
4
|
+
import { defineTool, type AgentToolResult } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
|
|
6
|
+
const customType = "pi-harness/openpets";
|
|
7
|
+
type PetMood = "idle" | "focused" | "happy" | "concerned";
|
|
8
|
+
type PetState = { name: string; mood: PetMood; energy: number; interactions: number; lastEvent: string; updatedAt: string };
|
|
9
|
+
|
|
10
|
+
export interface OpenPetsPluginConfig {
|
|
11
|
+
name?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Config: z<OpenPetsPluginConfig> = z.object({ name: z.string().default("Pi") });
|
|
15
|
+
|
|
16
|
+
function clampEnergy(value: number): number {
|
|
17
|
+
return Math.max(0, Math.min(100, Math.round(value)));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function initialState(name: string): PetState {
|
|
21
|
+
return { name, mood: "idle", energy: 80, interactions: 0, lastEvent: "session_start", updatedAt: new Date(0).toISOString() };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function readState(context: Context, name: string): PetState {
|
|
25
|
+
const entry = [...context.piSession.manager.getEntries()].reverse().find((item) => item.type === "custom" && item.customType === customType);
|
|
26
|
+
if (entry?.type !== "custom" || entry.data === undefined || typeof entry.data !== "object" || entry.data === null) return initialState(name);
|
|
27
|
+
const value = entry.data as Partial<PetState>;
|
|
28
|
+
const mood: PetMood = value.mood === "focused" || value.mood === "happy" || value.mood === "concerned" ? value.mood : "idle";
|
|
29
|
+
return {
|
|
30
|
+
name: typeof value.name === "string" && value.name.trim() !== "" ? value.name : name,
|
|
31
|
+
mood,
|
|
32
|
+
energy: typeof value.energy === "number" ? clampEnergy(value.energy) : 80,
|
|
33
|
+
interactions: typeof value.interactions === "number" && Number.isFinite(value.interactions) ? Math.max(0, Math.trunc(value.interactions)) : 0,
|
|
34
|
+
lastEvent: typeof value.lastEvent === "string" ? value.lastEvent : "session_start",
|
|
35
|
+
updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : new Date(0).toISOString(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function persist(context: Context, state: PetState): void {
|
|
40
|
+
context.piSession.manager.appendCustomEntry(customType, state);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "pi-openpets",
|
|
45
|
+
inject: ["piSession", "piPluginUi", "piTools"],
|
|
46
|
+
Config,
|
|
47
|
+
apply(context: Context, config: OpenPetsPluginConfig) {
|
|
48
|
+
const name = config.name?.trim() || "Pi";
|
|
49
|
+
let state = readState(context, name);
|
|
50
|
+
const update = (next: Partial<PetState>, persistState = true): PetState => {
|
|
51
|
+
state = { ...state, ...next, name, updatedAt: new Date().toISOString() };
|
|
52
|
+
if (persistState) persist(context, state);
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
55
|
+
const unsubscribe = context.on("pi/session-event", (event) => {
|
|
56
|
+
if (event.type === "agent_start") update({ mood: "focused", energy: clampEnergy(state.energy - 5), lastEvent: event.type });
|
|
57
|
+
else if (event.type === "agent_end") update({ mood: "happy", energy: clampEnergy(state.energy + 5), lastEvent: event.type });
|
|
58
|
+
else if (event.type === "tool_execution_end" && "isError" in event && event.isError === true) update({ mood: "concerned", lastEvent: event.type });
|
|
59
|
+
});
|
|
60
|
+
const unregisterTool = context.piTools.register(
|
|
61
|
+
defineTool({
|
|
62
|
+
name: "pet_react",
|
|
63
|
+
label: "Pet companion",
|
|
64
|
+
description: "Read or update the local OpenPets companion state for the current Pi session.",
|
|
65
|
+
promptSnippet: "check the companion state or let the pet react",
|
|
66
|
+
parameters: Type.Object({
|
|
67
|
+
action: Type.Union([Type.Literal("status"), Type.Literal("feed"), Type.Literal("play"), Type.Literal("set_mood")]),
|
|
68
|
+
mood: Type.Optional(Type.String()),
|
|
69
|
+
}),
|
|
70
|
+
execute(_toolCallId, params): Promise<AgentToolResult<PetState>> {
|
|
71
|
+
return Promise.resolve().then(() => {
|
|
72
|
+
if (params.action === "status")
|
|
73
|
+
return { content: [{ type: "text" as const, text: `${state.name}: ${state.mood}, energy ${state.energy}` }], details: state };
|
|
74
|
+
if (params.action === "feed")
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text" as const, text: `${state.name} is refreshed.` }],
|
|
77
|
+
details: update({ mood: "happy", energy: 100, interactions: state.interactions + 1, lastEvent: "feed" }),
|
|
78
|
+
};
|
|
79
|
+
if (params.action === "play")
|
|
80
|
+
return {
|
|
81
|
+
content: [{ type: "text" as const, text: `${state.name} had a play break.` }],
|
|
82
|
+
details: update({ mood: "happy", energy: clampEnergy(state.energy + 10), interactions: state.interactions + 1, lastEvent: "play" }),
|
|
83
|
+
};
|
|
84
|
+
const mood = params.mood?.trim();
|
|
85
|
+
if (mood !== "idle" && mood !== "focused" && mood !== "happy" && mood !== "concerned")
|
|
86
|
+
throw new Error("mood must be idle, focused, happy, or concerned");
|
|
87
|
+
return {
|
|
88
|
+
content: [{ type: "text" as const, text: `${state.name} mood set to ${mood}.` }],
|
|
89
|
+
details: update({ mood, interactions: state.interactions + 1, lastEvent: "set_mood" }),
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
95
|
+
const disposePanel = context.piPluginUi.register({
|
|
96
|
+
id: "openpets-panel",
|
|
97
|
+
pluginId: "@pi-harness/core/plugins/openpets",
|
|
98
|
+
title: "OpenPets",
|
|
99
|
+
description: "根据 Pi 会话事件反应的本地桌面伙伴状态。",
|
|
100
|
+
icon: "◉",
|
|
101
|
+
read: () => state,
|
|
102
|
+
});
|
|
103
|
+
context.effect(() => () => {
|
|
104
|
+
unsubscribe();
|
|
105
|
+
unregisterTool();
|
|
106
|
+
disposePanel();
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
};
|