@pi-harness/pi-harness 0.1.31 → 0.1.33
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/apps/web/dist/assets/index-CZMbiZj6.css +2 -0
- package/apps/web/dist/assets/index-DLcE8YQ7.js +26 -0
- package/apps/web/dist/index.html +2 -2
- package/apps/web/package.json +1 -1
- package/apps/web/server-dist/bin.js +19 -3
- package/apps/web/server-dist/bin.js.map +1 -1
- package/apps/web/src/server/bin.ts +18 -2
- package/apps/web/src/style.css +51 -1
- package/node_modules/@pi-harness/api-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/index.js +117 -11
- package/node_modules/@pi-harness/api-gateway/dist/index.js.map +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/agent-teams.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/anchored-standard.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/annotation.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/archify.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/at-file.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/auto-mode.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/better-sidebar.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-fetch.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-session.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/canvas-draw.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/change-verifier.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cleaner.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cli-notifier.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/colleague-skill.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context-doctor.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context.json +3 -9
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-group.json +12 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +16 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-timer.json +11 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cost-meter.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/dependency-checker.json +4 -12
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/fail-logger.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/genui.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/graph-memory.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/history-compressor.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/hol-guard.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/i18n-pair.json +3 -9
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/image-compressor.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/llm-verifier.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-client.json +5 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-panel.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/memory.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mock-server.json +5 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/modlens.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/module-search.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/openpets.json +4 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plan-execute.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-check.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-dev.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-finder.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-radar.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-stars.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-guard.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-library.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/readme-gen.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/recall-unread.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reverse-skill.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/secure-audit.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bridge.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-compare.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-export.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-insights.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-search.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-catalog.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-guard.json +4 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/sql-lens.json +5 -12
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/synapse.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/tab-manager.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/taskboard.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/test-harness.json +5 -13
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/theme-studio.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/token-guard.json +3 -11
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/turn-rewind.json +3 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +3 -9
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/web-research.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-search.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/yaml-validator.json +3 -9
- package/node_modules/@pi-harness/api-gateway/dist/marketplace.d.ts +18 -2
- package/node_modules/@pi-harness/api-gateway/dist/marketplace.d.ts.map +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace.js +93 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace.js.map +1 -1
- package/node_modules/@pi-harness/api-gateway/package.json +1 -1
- package/node_modules/@pi-harness/cli/dist/main.d.ts.map +1 -1
- package/node_modules/@pi-harness/cli/dist/main.js +21 -3
- package/node_modules/@pi-harness/cli/dist/main.js.map +1 -1
- package/node_modules/@pi-harness/cli/package.json +1 -1
- package/node_modules/@pi-harness/host-webserver/package.json +1 -1
- package/node_modules/@pi-harness/web-app/package.json +1 -1
- package/package.json +6 -6
- package/packages/api-gateway/dist/index.d.ts.map +1 -1
- package/packages/api-gateway/dist/index.js +117 -11
- package/packages/api-gateway/dist/index.js.map +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/agent-teams.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/archify.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/context.json +3 -9
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-group.json +12 -5
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +16 -5
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-timer.json +11 -5
- package/packages/api-gateway/dist/marketplace-entries/official/cost-meter.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +4 -12
- package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/genui.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +3 -9
- package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +5 -11
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/memory.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +4 -10
- package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +4 -11
- package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +5 -12
- package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +5 -13
- package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +3 -11
- package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +3 -10
- package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +3 -9
- package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +3 -9
- package/packages/api-gateway/dist/marketplace.d.ts +18 -2
- package/packages/api-gateway/dist/marketplace.d.ts.map +1 -1
- package/packages/api-gateway/dist/marketplace.js +93 -10
- package/packages/api-gateway/dist/marketplace.js.map +1 -1
- package/packages/api-gateway/package.json +1 -1
- package/packages/api-gateway/src/index.ts +121 -12
- package/packages/api-gateway/src/marketplace-entries/official/agent-teams.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/annotation.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/archify.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/at-file.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/context.json +3 -9
- package/packages/api-gateway/src/marketplace-entries/official/cordis-group.json +12 -5
- package/packages/api-gateway/src/marketplace-entries/official/cordis-logger-console.json +16 -5
- package/packages/api-gateway/src/marketplace-entries/official/cordis-timer.json +11 -5
- package/packages/api-gateway/src/marketplace-entries/official/cost-meter.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +4 -12
- package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/genui.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +3 -9
- package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +5 -11
- package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/memory.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/modlens.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/module-search.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/openpets.json +4 -10
- package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/session-export.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/session-search.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +4 -11
- package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +5 -12
- package/packages/api-gateway/src/marketplace-entries/official/synapse.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +5 -13
- package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +3 -11
- package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +3 -10
- package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +3 -9
- package/packages/api-gateway/src/marketplace-entries/official/web-research.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +3 -9
- package/packages/api-gateway/src/marketplace.ts +113 -12
- package/packages/api-gateway/test/index.test.ts +148 -6
- package/packages/api-gateway/test/marketplace-schema.test.ts +12 -0
- package/packages/api-gateway/test/marketplace.test.ts +255 -354
- package/packages/bundle-web-app/package.json +1 -1
- package/packages/cli/dist/main.d.ts.map +1 -1
- package/packages/cli/dist/main.js +21 -3
- package/packages/cli/dist/main.js.map +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/main.ts +20 -3
- package/packages/cli/test/cli.test.ts +20 -0
- package/packages/host-webserver/package.json +1 -1
- package/apps/web/dist/assets/index-D9ZcvGXi.js +0 -25
- package/apps/web/dist/assets/index-DJsNIiIo.css +0 -2
package/apps/web/dist/index.html
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
<link rel="apple-touch-icon" href="/icons/app/apple-touch-icon-180.png" sizes="180x180" />
|
|
16
16
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
17
17
|
<title>Pi Harness / Control Room</title>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-DLcE8YQ7.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-BxoMtjVy.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/markdown-vendor-DUdMWn0M.js">
|
|
21
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
21
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CZMbiZj6.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
24
|
<main id="root"></main>
|
package/apps/web/package.json
CHANGED
|
@@ -63,11 +63,27 @@ const processExit = new Promise((resolve) => {
|
|
|
63
63
|
});
|
|
64
64
|
let harness;
|
|
65
65
|
const exitCodeFor = (signal) => (signal === "SIGINT" ? 130 : signal === "SIGHUP" ? 129 : 143);
|
|
66
|
+
// The Cordis loader wraps this failure in its own entry path and stack, none of which a user with an unprovisioned agent directory can act on, so the recognized case reports the remedy first and keeps exactly one line naming the model that is missing. Every other failure is still reported in full, because nothing here knows what it means.
|
|
67
|
+
const UNREGISTERED_EVERYAPI_MODEL = /Pi model is not registered: (everyapi\/[^\s"'`,;)\]]+)/u;
|
|
68
|
+
// Node reports a taken port as a bare errno, and the overwhelmingly likely cause is a Pi Harness the user already started, so the failure names that possibility and the variable that moves this one out of the way.
|
|
69
|
+
const ADDRESS_IN_USE = /\bEADDRINUSE\b/u;
|
|
70
|
+
// This launcher takes no arguments and has no help output, so the one place a user can learn that the frames are still available is the failure that dropped them.
|
|
71
|
+
const DEBUG_HINT = "Set PI_HARNESS_DEBUG=1 and start again to keep the stack frames.";
|
|
66
72
|
const formatStartupError = (error) => {
|
|
67
73
|
const message = error instanceof Error ? error.message : String(error);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
const debug = process.env.PI_HARNESS_DEBUG === "1";
|
|
75
|
+
if (ADDRESS_IN_USE.test(message)) {
|
|
76
|
+
const authority = `${host.includes(":") ? `[${host}]` : host}:${port}`;
|
|
77
|
+
const holder = process.platform === "win32" ? `netstat -ano | findstr :${port}` : `lsof -nP -iTCP:${port} -sTCP:LISTEN`;
|
|
78
|
+
const remedy = `Port ${port} on ${host} is already in use. If that is a Pi Harness you already started, its console is at http://${authority}/. Otherwise set PI_HARNESS_PORT to a free port, or stop whatever holds this one (${holder}).`;
|
|
79
|
+
return debug ? `${remedy}\n${message}` : remedy;
|
|
80
|
+
}
|
|
81
|
+
const unregistered = UNREGISTERED_EVERYAPI_MODEL.exec(message);
|
|
82
|
+
if (unregistered === null)
|
|
83
|
+
return debug ? message : `${message}\n${DEBUG_HINT}`;
|
|
84
|
+
const remedy = `The EveryAPI model catalog is not provisioned in PI_AGENT_DIR. Start with \`everyapi use pi-harness\`, or set PI_HARNESS_PROVIDER and PI_HARNESS_MODEL to a model already registered in that agent directory.`;
|
|
85
|
+
// Under the debug flag the message already carries the frames bootHarness kept, and a reader who asked for them wants the remedy as well as the detail, not instead of it.
|
|
86
|
+
return debug ? `${remedy}\n${message}` : `${remedy}\nPi model is not registered: ${unregistered[1]}`;
|
|
71
87
|
};
|
|
72
88
|
const shutdown = async (signal) => {
|
|
73
89
|
if (shuttingDown)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/server/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC9G,OAAO,4BAA4B,CAAC;AAMpC,kSAAkS;AAClS,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACrC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAErC,6LAA6L;AAC7L,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,WAAW,CAAC;AAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,C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CAAC;QACD,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC;AACD,IAAI,CAAC;IACH,OAAO,GAAG,MAAM,WAAW,CAAC;QAC1B,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,OAAO,CAAC,OAAO;YACb,oBAAoB,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,KAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;KACF,CAAC,CAAC;IACH,MAAM,SAAS,GAAI,OAAO,CAAC,OAAoE,CAAC,SAAS,CAAC;IAC1G,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,GAAG,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACxE,MAAM,WAAW,CAAC;AACpB,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -70,10 +70,26 @@ const processExit = new Promise<void>((resolve) => {
|
|
|
70
70
|
});
|
|
71
71
|
let harness: Awaited<ReturnType<typeof bootHarness>> | undefined;
|
|
72
72
|
const exitCodeFor = (signal: NodeJS.Signals): number => (signal === "SIGINT" ? 130 : signal === "SIGHUP" ? 129 : 143);
|
|
73
|
+
// The Cordis loader wraps this failure in its own entry path and stack, none of which a user with an unprovisioned agent directory can act on, so the recognized case reports the remedy first and keeps exactly one line naming the model that is missing. Every other failure is still reported in full, because nothing here knows what it means.
|
|
74
|
+
const UNREGISTERED_EVERYAPI_MODEL = /Pi model is not registered: (everyapi\/[^\s"'`,;)\]]+)/u;
|
|
75
|
+
// Node reports a taken port as a bare errno, and the overwhelmingly likely cause is a Pi Harness the user already started, so the failure names that possibility and the variable that moves this one out of the way.
|
|
76
|
+
const ADDRESS_IN_USE = /\bEADDRINUSE\b/u;
|
|
77
|
+
// This launcher takes no arguments and has no help output, so the one place a user can learn that the frames are still available is the failure that dropped them.
|
|
78
|
+
const DEBUG_HINT = "Set PI_HARNESS_DEBUG=1 and start again to keep the stack frames.";
|
|
73
79
|
const formatStartupError = (error: unknown): string => {
|
|
74
80
|
const message = error instanceof Error ? error.message : String(error);
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
const debug = process.env.PI_HARNESS_DEBUG === "1";
|
|
82
|
+
if (ADDRESS_IN_USE.test(message)) {
|
|
83
|
+
const authority = `${host.includes(":") ? `[${host}]` : host}:${port}`;
|
|
84
|
+
const holder = process.platform === "win32" ? `netstat -ano | findstr :${port}` : `lsof -nP -iTCP:${port} -sTCP:LISTEN`;
|
|
85
|
+
const remedy = `Port ${port} on ${host} is already in use. If that is a Pi Harness you already started, its console is at http://${authority}/. Otherwise set PI_HARNESS_PORT to a free port, or stop whatever holds this one (${holder}).`;
|
|
86
|
+
return debug ? `${remedy}\n${message}` : remedy;
|
|
87
|
+
}
|
|
88
|
+
const unregistered = UNREGISTERED_EVERYAPI_MODEL.exec(message);
|
|
89
|
+
if (unregistered === null) return debug ? message : `${message}\n${DEBUG_HINT}`;
|
|
90
|
+
const remedy = `The EveryAPI model catalog is not provisioned in PI_AGENT_DIR. Start with \`everyapi use pi-harness\`, or set PI_HARNESS_PROVIDER and PI_HARNESS_MODEL to a model already registered in that agent directory.`;
|
|
91
|
+
// Under the debug flag the message already carries the frames bootHarness kept, and a reader who asked for them wants the remedy as well as the detail, not instead of it.
|
|
92
|
+
return debug ? `${remedy}\n${message}` : `${remedy}\nPi model is not registered: ${unregistered[1]}`;
|
|
77
93
|
};
|
|
78
94
|
const shutdown = async (signal: NodeJS.Signals): Promise<void> => {
|
|
79
95
|
if (shuttingDown) return;
|
package/apps/web/src/style.css
CHANGED
|
@@ -557,6 +557,9 @@ button:disabled {
|
|
|
557
557
|
.pending-turn .user-bubble {
|
|
558
558
|
@apply [opacity:0.72];
|
|
559
559
|
}
|
|
560
|
+
.turn-stopped {
|
|
561
|
+
@apply [display:inline-block] [margin:8px_0_0] [border:1px_solid_rgba(236,_19,_19,_0.24)] [border-radius:6px] [padding:1px_7px] [color:var(--color-red)] [font:10.5px_var(--font-mono)];
|
|
562
|
+
}
|
|
560
563
|
.turn-markdown {
|
|
561
564
|
@apply [margin:0] [min-width:0] [font-size:13.5px] [line-height:1.78];
|
|
562
565
|
}
|
|
@@ -628,6 +631,30 @@ button:disabled {
|
|
|
628
631
|
.message-reasoning .reasoning-body {
|
|
629
632
|
@apply [margin-top:6px];
|
|
630
633
|
}
|
|
634
|
+
.turn-tool {
|
|
635
|
+
@apply [margin:0_0_10px] [overflow:hidden] [border:1px_solid_var(--color-line)] [border-radius:8px] [background:#fbfcfd];
|
|
636
|
+
}
|
|
637
|
+
.turn-tool.failed {
|
|
638
|
+
@apply [border-color:rgba(236,_19,_19,_0.28)] [background:#fdf6f6];
|
|
639
|
+
}
|
|
640
|
+
.turn-tool-head {
|
|
641
|
+
@apply [display:flex] [cursor:pointer] [align-items:baseline] [gap:8px] [padding:7px_10px] [color:var(--color-muted)] [font-size:11.5px];
|
|
642
|
+
}
|
|
643
|
+
.turn-tool-head strong {
|
|
644
|
+
@apply [flex:none] [color:var(--color-blue)] [font:12px_var(--font-mono)];
|
|
645
|
+
}
|
|
646
|
+
.turn-tool-args {
|
|
647
|
+
@apply [min-width:0] [flex:1] [overflow:hidden] [font:11px_var(--font-mono)] [text-overflow:ellipsis] [white-space:nowrap];
|
|
648
|
+
}
|
|
649
|
+
.turn-tool-status {
|
|
650
|
+
@apply [flex:none] [color:var(--color-faint)];
|
|
651
|
+
}
|
|
652
|
+
.turn-tool.failed .turn-tool-status {
|
|
653
|
+
@apply [color:var(--color-red)];
|
|
654
|
+
}
|
|
655
|
+
.turn-tool-output {
|
|
656
|
+
@apply [max-height:320px] [margin:0] [overflow:auto] [border-top:1px_solid_var(--color-line)] [padding:10px] [font:11.5px_var(--font-mono)] [line-height:1.65] [white-space:pre-wrap] [word-break:break-word];
|
|
657
|
+
}
|
|
631
658
|
.visually-hidden {
|
|
632
659
|
@apply [position:absolute] [width:1px] [height:1px] [padding:0] [margin:-1px] [overflow:hidden] [clip:rect(0,0,0,0)] [white-space:nowrap] [border:0];
|
|
633
660
|
}
|
|
@@ -811,6 +838,10 @@ button:disabled {
|
|
|
811
838
|
.tool-chip {
|
|
812
839
|
@apply [padding:0_9px] [color:#61666b] [font-family:var(--font-sans)] [font-size:11.5px];
|
|
813
840
|
}
|
|
841
|
+
/* Chrome and Safari drop pointer events on a disabled control and never show its title, so the chip's explanation of why it is dead sits on this wrapper instead. */
|
|
842
|
+
.tool-chip-hint {
|
|
843
|
+
@apply [display:inline-flex] [min-width:0];
|
|
844
|
+
}
|
|
814
845
|
.composer-hint {
|
|
815
846
|
@apply [flex:1] [color:#687381] [font:10px_var(--font-mono)] [text-align:right];
|
|
816
847
|
}
|
|
@@ -1652,7 +1683,7 @@ button:disabled {
|
|
|
1652
1683
|
.main-header .active-heading small {
|
|
1653
1684
|
@apply [display:none];
|
|
1654
1685
|
}
|
|
1655
|
-
.run-indicator {
|
|
1686
|
+
.run-indicator > span:not(.run-dot) {
|
|
1656
1687
|
@apply [display:none];
|
|
1657
1688
|
}
|
|
1658
1689
|
.view-tab {
|
|
@@ -1890,6 +1921,25 @@ button:disabled {
|
|
|
1890
1921
|
.marketplace-count {
|
|
1891
1922
|
@apply [margin-left:auto] [color:var(--color-faint)] [font:10.5px_var(--font-mono)];
|
|
1892
1923
|
}
|
|
1924
|
+
.marketplace-toolbar-message {
|
|
1925
|
+
@apply [display:grid] [min-width:0] [flex-basis:100%] [gap:6px];
|
|
1926
|
+
}
|
|
1927
|
+
/* The region has to stay in the accessibility tree between messages, or the screen reader has nothing to attach the next announcement to, so an empty one is collapsed to nothing instead of being removed with display:none. */
|
|
1928
|
+
.marketplace-toolbar-message:empty {
|
|
1929
|
+
@apply [flex-basis:0] [gap:0];
|
|
1930
|
+
}
|
|
1931
|
+
.marketplace-message {
|
|
1932
|
+
@apply [display:flex] [min-width:0] [flex-wrap:wrap] [align-items:center] [gap:8px] [border-radius:8px] [padding:8px_10px] [font-size:11.5px] [line-height:1.7];
|
|
1933
|
+
}
|
|
1934
|
+
.marketplace-message.notice {
|
|
1935
|
+
@apply [border:1px_solid_rgba(65,_118,_230,_0.28)] [background:#f4f8ff] [color:#3565c5];
|
|
1936
|
+
}
|
|
1937
|
+
.marketplace-message.error {
|
|
1938
|
+
@apply [border:1px_solid_rgba(185,_28,_28,_0.24)] [background:#fff5f5] [color:var(--color-red)];
|
|
1939
|
+
}
|
|
1940
|
+
.marketplace-message-dismiss {
|
|
1941
|
+
@apply [flex:none] [margin-left:auto] [border:1px_solid_currentColor] [border-radius:6px] [padding:2px_8px] [font-size:11px];
|
|
1942
|
+
}
|
|
1893
1943
|
.marketplace-categories {
|
|
1894
1944
|
@apply [display:flex] [min-width:0] [flex:1] [flex-wrap:nowrap] [gap:4px] [overflow-x:auto] [padding:8px_48px_8px_24px] [background:#fff] [scrollbar-width:none];
|
|
1895
1945
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;;;;mBAmyBlC,OAAO;;AAHxB,wBA47CE"}
|
|
@@ -6,7 +6,8 @@ import { SessionManager } from "@earendil-works/pi-coding-agent";
|
|
|
6
6
|
import { atomicWriteFile, isPiToolRegistryLeasedError } from "@pi-harness/core";
|
|
7
7
|
import { MARKETPLACE_CAPABILITIES, MARKETPLACE_CATEGORIES, MARKETPLACE_PLUGINS, attachMarketplaceStatistics, createMarketplaceStatisticsLoader, paginateMarketplace, searchMarketplace, marketplaceNpmPackageName, sortMarketplaceByRecommendation, } from "./marketplace.js";
|
|
8
8
|
import { parseGitWorktrees } from "./workspaces.js";
|
|
9
|
-
|
|
9
|
+
// The first paint waits for every console endpoint to answer, so the catalogue is sorted from whatever npm statistics are already cached and the misses are warmed in the background instead of held on to.
|
|
10
|
+
const { readCached: readCachedMarketplaceStatistics } = createMarketplaceStatisticsLoader();
|
|
10
11
|
const RUNTIME_ENTRY_NAME = "@pi-harness/core/plugins/runtime";
|
|
11
12
|
const DEFAULT_BODY_LIMIT_BYTES = 64 * 1024;
|
|
12
13
|
const IMPORT_CONTENT_LIMIT_BYTES = 10 * 1024 * 1024;
|
|
@@ -14,7 +15,11 @@ const IMPORT_CONTENT_LIMIT_BYTES = 10 * 1024 * 1024;
|
|
|
14
15
|
const IMPORT_BODY_LIMIT_BYTES = 16 * 1024 * 1024;
|
|
15
16
|
// Retained trajectory events are replayed to every SSE client and returned by /api/session, so the array must stay bounded.
|
|
16
17
|
const MAX_RETAINED_EVENTS = 2000;
|
|
18
|
+
// Tool calls that opened but never closed. Far above any real concurrency, so the cap only ever trims a run the runtime abandoned.
|
|
19
|
+
const MAX_PENDING_TOOL_CALLS = 256;
|
|
17
20
|
const GIT_TIMEOUT_MS = 15_000;
|
|
21
|
+
const PROCESS_FAILURE_TEXT_LIMIT = 400;
|
|
22
|
+
const PROCESS_TIMEOUT_MS = 120_000;
|
|
18
23
|
// Mutating commands run user hooks (pre-commit, lint-staged, test suites) and may stage large trees; killing them part-way leaves index.lock and a half-finished operation behind, so they get a far more generous bound than read-only queries.
|
|
19
24
|
const GIT_MUTATION_TIMEOUT_MS = 120_000;
|
|
20
25
|
class PayloadTooLargeError extends Error {
|
|
@@ -71,10 +76,13 @@ function jsonSafe(value, seen = new WeakSet()) {
|
|
|
71
76
|
seen.delete(value);
|
|
72
77
|
}
|
|
73
78
|
}
|
|
79
|
+
// A plugin that contributes tools only joins on the next start, so the console remembers what it installed until then. That memory is about one particular process, and the console cannot tell a restart from a reconnect on its own, so the identity of this process rides along with the status it already polls.
|
|
80
|
+
const PROCESS_STARTED_AT = new Date(Date.now() - Math.round(process.uptime() * 1000)).toISOString();
|
|
74
81
|
function createStatus(services, events) {
|
|
75
82
|
const activeModel = services.runtime.session.model ?? services.models.model;
|
|
76
83
|
const cwd = activeCwd(services);
|
|
77
84
|
return {
|
|
85
|
+
processStartedAt: PROCESS_STARTED_AT,
|
|
78
86
|
status: services.runtime.session.isStreaming ? "running" : "ready",
|
|
79
87
|
model: activeModel.provider + "/" + activeModel.id,
|
|
80
88
|
messages: services.runtime.session.messages.length,
|
|
@@ -275,6 +283,41 @@ function pluginSummary(entry) {
|
|
|
275
283
|
category: marketplacePlugin?.category,
|
|
276
284
|
};
|
|
277
285
|
}
|
|
286
|
+
/** The state a marketplace plugin is in between the install that wrote it and the restart that loads it. It is not a loader state because the loader has no entry for it at all. */
|
|
287
|
+
const RESTART_REQUIRED_STATE = "restart-required";
|
|
288
|
+
// The install writes the entry as two adjacent lines, so this reads back exactly what `marketplaceProfileEntry` writes rather than parsing the profile as YAML, which the `!!js` tags in it would need a schema for.
|
|
289
|
+
const MARKETPLACE_PROFILE_ENTRY_PATTERN = /^[ \t]*- id: (marketplace-\S+)[ \t]*\r?\n[ \t]*name: "([^"]+)"/gmu;
|
|
290
|
+
/** The loader holds what is running; the profile file holds what is installed. The two differ for a plugin that contributes tools, which cannot join a harness that is already running: the install leaves its package and its profile entry in place and the plugin arrives on the next start. Reading only the loader makes that plugin indistinguishable from one that was never installed, which is why the console answered an install that had just succeeded with "nothing is installed" and then could not uninstall what it had hidden. */
|
|
291
|
+
async function readMarketplaceProfileEntries(configPath) {
|
|
292
|
+
const source = await readFile(configPath, "utf8").catch(() => undefined);
|
|
293
|
+
if (source === undefined)
|
|
294
|
+
return [];
|
|
295
|
+
const entries = [];
|
|
296
|
+
for (const match of source.matchAll(MARKETPLACE_PROFILE_ENTRY_PATTERN))
|
|
297
|
+
entries.push({ id: match[1] ?? "", packageName: match[2] ?? "" });
|
|
298
|
+
return entries;
|
|
299
|
+
}
|
|
300
|
+
/** The installed plugins the loader does not have, described the same way a loaded one is so the console can list them side by side instead of leaving the user to guess what happened to the install. */
|
|
301
|
+
async function restartPendingSummaries(services) {
|
|
302
|
+
const configPath = services.launch.configPath;
|
|
303
|
+
if (configPath === undefined || services.loader === undefined)
|
|
304
|
+
return [];
|
|
305
|
+
const loaded = new Set([...services.loader.entries()].map((entry) => entry.options.id));
|
|
306
|
+
const entries = await readMarketplaceProfileEntries(configPath);
|
|
307
|
+
return entries
|
|
308
|
+
.filter((entry) => !loaded.has(entry.id))
|
|
309
|
+
.map((entry) => {
|
|
310
|
+
const plugin = MARKETPLACE_PLUGINS.find((item) => item.packageName === entry.packageName);
|
|
311
|
+
return {
|
|
312
|
+
id: entry.id,
|
|
313
|
+
name: entry.packageName,
|
|
314
|
+
enabled: true,
|
|
315
|
+
state: RESTART_REQUIRED_STATE,
|
|
316
|
+
removable: true,
|
|
317
|
+
category: plugin?.category,
|
|
318
|
+
};
|
|
319
|
+
});
|
|
320
|
+
}
|
|
278
321
|
function pluginLoaded(services, packageName) {
|
|
279
322
|
return services.loader !== undefined && [...services.loader.entries()].some((entry) => entry.options.name === packageName && !entry.disabled);
|
|
280
323
|
}
|
|
@@ -424,11 +467,26 @@ function registerPluginPanels(context, services) {
|
|
|
424
467
|
];
|
|
425
468
|
return () => disposers.reverse().forEach((dispose) => dispose());
|
|
426
469
|
}
|
|
470
|
+
// npm ends every failure with the path to a debug log inside its own cache, which the reader of this console has no reason to open and no easy way to reach.
|
|
471
|
+
const PROCESS_FAILURE_NOISE = /^npm (error|ERR!) A complete log of this run can be found in:/u;
|
|
472
|
+
// npm reports a failure over many lines and the whole text is shown to someone who never typed the command, so the lines are joined up to a character budget and the command itself stays on the cause for diagnostics. Node's own message is never used as the fallback: it reads `Command failed: <the whole command line>`, which is exactly what this is removing.
|
|
473
|
+
function processFailureText(executable, stderr, error) {
|
|
474
|
+
const text = stderr
|
|
475
|
+
.split(/\r?\n/u)
|
|
476
|
+
.map((line) => line.trim())
|
|
477
|
+
.filter((line) => line !== "" && !PROCESS_FAILURE_NOISE.test(line))
|
|
478
|
+
.join(" ");
|
|
479
|
+
if (text === "")
|
|
480
|
+
return error.killed === true
|
|
481
|
+
? `${executable} was stopped after ${PROCESS_TIMEOUT_MS / 1000}s`
|
|
482
|
+
: `${executable} exited with code ${error.code ?? "unknown"} and reported nothing`;
|
|
483
|
+
return text.length <= PROCESS_FAILURE_TEXT_LIMIT ? text : text.slice(0, PROCESS_FAILURE_TEXT_LIMIT) + "…";
|
|
484
|
+
}
|
|
427
485
|
function runProcess(executable, args, cwd) {
|
|
428
486
|
return new Promise((resolveProcess, rejectProcess) => {
|
|
429
|
-
execFile(executable, [...args], { cwd, timeout:
|
|
487
|
+
execFile(executable, [...args], { cwd, timeout: PROCESS_TIMEOUT_MS, maxBuffer: 2 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
430
488
|
if (error) {
|
|
431
|
-
rejectProcess(new Error(`${executable} ${args.join(" ")}
|
|
489
|
+
rejectProcess(new Error(processFailureText(executable, stderr, error), { cause: { command: `${executable} ${args.join(" ")}`, error } }));
|
|
432
490
|
return;
|
|
433
491
|
}
|
|
434
492
|
resolveProcess({ stdout, stderr });
|
|
@@ -667,7 +725,31 @@ export default {
|
|
|
667
725
|
let busy = false;
|
|
668
726
|
const events = [];
|
|
669
727
|
const eventClients = new Set();
|
|
670
|
-
|
|
728
|
+
// Pi puts a wall-clock on a message payload and nowhere else, so a tool call has no time of its own and nothing downstream can recover when the harness saw it. The gateway is the one place that sees every event as it happens, so it stamps each one on arrival, and pairs a tool call's two events to record how long the call took.
|
|
729
|
+
// The stamp is written onto the event rather than onto a copy: a copy would give every event a new identity, and the serializer's cycle detection reads identity, so a self-referential event would serialize one level deeper on every hop.
|
|
730
|
+
const toolCallStartedAt = new Map();
|
|
731
|
+
const stampEvent = (event) => {
|
|
732
|
+
const receivedAt = Date.now();
|
|
733
|
+
const toolCallId = event.toolCallId;
|
|
734
|
+
if (typeof toolCallId === "string" && event.type === "tool_execution_start") {
|
|
735
|
+
// A call whose end never arrives would otherwise keep its entry forever; the oldest is dropped rather than letting a stalled run grow the map without bound.
|
|
736
|
+
if (toolCallStartedAt.size >= MAX_PENDING_TOOL_CALLS) {
|
|
737
|
+
const oldest = toolCallStartedAt.keys().next().value;
|
|
738
|
+
if (oldest !== undefined)
|
|
739
|
+
toolCallStartedAt.delete(oldest);
|
|
740
|
+
}
|
|
741
|
+
toolCallStartedAt.set(toolCallId, receivedAt);
|
|
742
|
+
}
|
|
743
|
+
if (typeof toolCallId === "string" && event.type === "tool_execution_end") {
|
|
744
|
+
const startedAt = toolCallStartedAt.get(toolCallId);
|
|
745
|
+
toolCallStartedAt.delete(toolCallId);
|
|
746
|
+
if (startedAt !== undefined)
|
|
747
|
+
return Object.assign(event, { receivedAt, durationMs: receivedAt - startedAt });
|
|
748
|
+
}
|
|
749
|
+
return Object.assign(event, { receivedAt });
|
|
750
|
+
};
|
|
751
|
+
const handleEvent = (rawEvent) => {
|
|
752
|
+
const event = stampEvent(rawEvent);
|
|
671
753
|
// Streaming deltas reach clients live over SSE and each one carries the whole partial message, so only durable events are retained for snapshots.
|
|
672
754
|
if (event.type !== "message_update") {
|
|
673
755
|
events.push(event);
|
|
@@ -979,8 +1061,10 @@ export default {
|
|
|
979
1061
|
});
|
|
980
1062
|
const disposePlugins = services.webServer.register({
|
|
981
1063
|
path: "/api/plugins",
|
|
982
|
-
handler(_request, response) {
|
|
983
|
-
const
|
|
1064
|
+
async handler(_request, response) {
|
|
1065
|
+
const loaded = services.loader ? [...services.loader.entries()].map(pluginSummary) : [];
|
|
1066
|
+
// The pending entries follow the loaded ones so a list that was stable before an install stays in the same order after it.
|
|
1067
|
+
const items = [...loaded, ...(await restartPendingSummaries(services))];
|
|
984
1068
|
sendJson(response, 200, jsonSafe({ items }));
|
|
985
1069
|
},
|
|
986
1070
|
});
|
|
@@ -1002,7 +1086,7 @@ export default {
|
|
|
1002
1086
|
});
|
|
1003
1087
|
const disposeMarketplace = services.webServer.register({
|
|
1004
1088
|
path: "/api/marketplace",
|
|
1005
|
-
|
|
1089
|
+
handler(request, response) {
|
|
1006
1090
|
if (request.method !== "GET") {
|
|
1007
1091
|
sendJson(response, 405, { error: "Method not allowed" });
|
|
1008
1092
|
return;
|
|
@@ -1027,9 +1111,9 @@ export default {
|
|
|
1027
1111
|
return;
|
|
1028
1112
|
}
|
|
1029
1113
|
const filtered = searchMarketplace(query, capability, category);
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
|
|
1114
|
+
const cached = readCachedMarketplaceStatistics(MARKETPLACE_PLUGINS);
|
|
1115
|
+
// Recommendation is only applied once the whole catalogue has been looked up. Scoring a half-warm cache would reorder the grid under the reader's cursor on every poll as the background lookups land, which costs more than the few seconds the first sort is delayed.
|
|
1116
|
+
const items = sort === "recommended" && cached.ready ? sortMarketplaceByRecommendation(attachMarketplaceStatistics(filtered, cached.statistics)) : filtered;
|
|
1033
1117
|
sendJson(response, 200, {
|
|
1034
1118
|
...paginateMarketplace(items, page, pageSize),
|
|
1035
1119
|
capabilities: MARKETPLACE_CAPABILITIES,
|
|
@@ -1072,6 +1156,11 @@ export default {
|
|
|
1072
1156
|
sendJson(response, 409, { error: "Plugin is already installed", plugin });
|
|
1073
1157
|
return;
|
|
1074
1158
|
}
|
|
1159
|
+
// A plugin already waiting for a restart is installed even though the loader has no entry for it, so installing it again would re-run npm and report a fresh restart for work that is already done.
|
|
1160
|
+
if ((await readMarketplaceProfileEntries(configPath)).some((entry) => entry.packageName === plugin.packageName)) {
|
|
1161
|
+
sendJson(response, 200, { plugin, installed: true, restartRequired: true });
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1075
1164
|
const installDirectory = await marketplaceInstallDirectory(configPath, services.launch.cwd);
|
|
1076
1165
|
const packageJsonPath = join(installDirectory, "package.json");
|
|
1077
1166
|
const packageLockPath = join(installDirectory, "package-lock.json");
|
|
@@ -1210,7 +1299,24 @@ export default {
|
|
|
1210
1299
|
}
|
|
1211
1300
|
const entry = [...loader.entries()].find((item) => item.id === payload.id || item.options.id === payload.id);
|
|
1212
1301
|
if (entry === undefined) {
|
|
1213
|
-
|
|
1302
|
+
// A plugin waiting for a restart has no loader entry to remove, only the profile entry and the package the install left behind. Refusing here left the user unable to undo an install until they restarted the very process they installed it to avoid restarting.
|
|
1303
|
+
const pending = (await readMarketplaceProfileEntries(configPath)).find((item) => item.id === payload.id);
|
|
1304
|
+
const pendingPlugin = pending === undefined ? undefined : MARKETPLACE_PLUGINS.find((item) => item.packageName === pending.packageName);
|
|
1305
|
+
if (pending === undefined || pendingPlugin === undefined) {
|
|
1306
|
+
sendJson(response, 404, { error: "Installed plugin was not found" });
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
const pendingProfileBefore = await readFile(configPath, "utf8");
|
|
1310
|
+
const pendingInstallDirectory = await marketplaceInstallDirectory(configPath, services.launch.cwd);
|
|
1311
|
+
try {
|
|
1312
|
+
await updateMarketplaceProfile(configPath, pending.id, { remove: true });
|
|
1313
|
+
await runProcess("npm", ["uninstall", "--package-lock=false", marketplaceNpmPackageName(pendingPlugin.packageName)], pendingInstallDirectory);
|
|
1314
|
+
sendJson(response, 200, { uninstalled: true, id: payload.id });
|
|
1315
|
+
}
|
|
1316
|
+
catch (error) {
|
|
1317
|
+
await writeFile(configPath, pendingProfileBefore, "utf8").catch(() => { });
|
|
1318
|
+
sendJson(response, 502, { error: errorText(error) });
|
|
1319
|
+
}
|
|
1214
1320
|
return;
|
|
1215
1321
|
}
|
|
1216
1322
|
const plugin = marketplacePluginForEntry(entry);
|