@pi-harness/pi-harness 0.1.13 → 0.1.15
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/README.md +682 -4
- package/apps/web/dist/assets/index-BVI_IS-R.css +2 -0
- package/apps/web/dist/assets/index-BZQRoR8H.js +22 -0
- package/apps/web/dist/index.html +2 -2
- package/apps/web/package.json +6 -6
- package/node_modules/@pi-harness/api-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/index.js +97 -9
- 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 +6 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/anchored-standard.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/annotation.json +1 -2
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/archify.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/at-file.json +11 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/auto-mode.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/better-sidebar.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-fetch.json +12 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-session.json +14 -8
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/canvas-draw.json +3 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/change-verifier.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cleaner.json +11 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cli-notifier.json +5 -5
- 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 +1 -2
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context-doctor.json +12 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context.json +10 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-group.json +2 -2
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-timer.json +3 -3
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cost-meter.json +9 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/dependency-checker.json +13 -10
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +10 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/fail-logger.json +11 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/genui.json +7 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +13 -8
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/graph-memory.json +13 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/history-compressor.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/hol-guard.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/i18n-pair.json +9 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/image-compressor.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/llm-verifier.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-client.json +12 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-panel.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/memory.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mock-server.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/modlens.json +4 -4
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/module-search.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/openpets.json +9 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plan-execute.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-check.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-dev.json +8 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-finder.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-radar.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-stars.json +15 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-guard.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-library.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/readme-gen.json +12 -8
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/recall-unread.json +11 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reverse-skill.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/secure-audit.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bridge.json +13 -8
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-compare.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-export.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-insights.json +12 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-search.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-catalog.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-guard.json +9 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/sql-lens.json +13 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/synapse.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/tab-manager.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/taskboard.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/test-harness.json +14 -7
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/theme-studio.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/token-guard.json +12 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/turn-rewind.json +11 -6
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +8 -5
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/web-research.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-search.json +1 -1
- package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/yaml-validator.json +8 -5
- package/node_modules/@pi-harness/api-gateway/package.json +1 -1
- package/node_modules/@pi-harness/cli/dist/node-stdio.d.ts.map +1 -1
- package/node_modules/@pi-harness/cli/dist/node-stdio.js +83 -20
- package/node_modules/@pi-harness/cli/dist/node-stdio.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 +16 -9
- package/packages/api-gateway/dist/index.d.ts.map +1 -1
- package/packages/api-gateway/dist/index.js +97 -9
- package/packages/api-gateway/dist/index.js.map +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/agent-teams.json +6 -6
- package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +1 -2
- package/packages/api-gateway/dist/marketplace-entries/official/archify.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +11 -5
- package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +12 -5
- package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +14 -8
- package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +3 -4
- package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +11 -6
- package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
- package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +1 -2
- package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +12 -7
- package/packages/api-gateway/dist/marketplace-entries/official/context.json +10 -5
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-group.json +2 -2
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/cordis-timer.json +3 -3
- package/packages/api-gateway/dist/marketplace-entries/official/cost-meter.json +9 -6
- package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +13 -10
- package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +10 -5
- package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +11 -6
- package/packages/api-gateway/dist/marketplace-entries/official/genui.json +7 -5
- package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +13 -8
- package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +13 -7
- package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +9 -6
- package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +12 -7
- package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/memory.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +4 -4
- package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +9 -5
- package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +8 -6
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +15 -7
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +12 -8
- package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +11 -6
- package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +13 -8
- package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +12 -6
- package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +9 -5
- package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +13 -7
- package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +14 -7
- package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +12 -6
- package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +11 -6
- package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +8 -5
- package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +1 -1
- package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +8 -5
- package/packages/api-gateway/package.json +1 -1
- package/packages/api-gateway/src/index.ts +90 -9
- package/packages/api-gateway/src/marketplace-entries/official/agent-teams.json +6 -6
- package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/annotation.json +1 -2
- package/packages/api-gateway/src/marketplace-entries/official/archify.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/at-file.json +11 -5
- package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +12 -5
- package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +14 -8
- package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +3 -4
- package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +11 -6
- package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +5 -5
- package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +1 -2
- package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +12 -7
- package/packages/api-gateway/src/marketplace-entries/official/context.json +10 -5
- package/packages/api-gateway/src/marketplace-entries/official/cordis-group.json +2 -2
- package/packages/api-gateway/src/marketplace-entries/official/cordis-logger-console.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/cordis-timer.json +3 -3
- package/packages/api-gateway/src/marketplace-entries/official/cost-meter.json +9 -6
- package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +13 -10
- package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +10 -5
- package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +11 -6
- package/packages/api-gateway/src/marketplace-entries/official/genui.json +7 -5
- package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +13 -8
- package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +13 -7
- package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +9 -6
- package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +12 -7
- package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/memory.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/modlens.json +4 -4
- package/packages/api-gateway/src/marketplace-entries/official/module-search.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/openpets.json +9 -5
- package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +8 -6
- package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +15 -7
- package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +12 -8
- package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +11 -6
- package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +13 -8
- package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/session-export.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +12 -6
- package/packages/api-gateway/src/marketplace-entries/official/session-search.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +9 -5
- package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +13 -7
- package/packages/api-gateway/src/marketplace-entries/official/synapse.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +14 -7
- package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +12 -6
- package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +11 -6
- package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +8 -5
- package/packages/api-gateway/src/marketplace-entries/official/web-research.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +1 -1
- package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +8 -5
- package/packages/api-gateway/test/index.test.ts +1594 -2
- package/packages/api-gateway/test/marketplace.test.ts +389 -2
- package/packages/api-gateway/test/release-package.test.ts +6 -11
- package/packages/api-gateway/test/release-version.test.ts +2 -2
- package/packages/bundle-web-app/package.json +1 -1
- package/packages/cli/dist/node-stdio.d.ts.map +1 -1
- package/packages/cli/dist/node-stdio.js +83 -20
- package/packages/cli/dist/node-stdio.js.map +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/node-stdio.ts +77 -20
- package/packages/cli/test/node-stdio.test.ts +118 -2
- package/packages/host-webserver/package.json +1 -1
- package/apps/web/dist/assets/index-C_AdODuM.js +0 -20
- package/apps/web/dist/assets/index-De8Rm01Z.css +0 -2
- package/node_modules/@pi-harness/core/LICENSE +0 -9
- package/node_modules/@pi-harness/core/dist/boot.d.ts +0 -13
- package/node_modules/@pi-harness/core/dist/boot.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/boot.js +0 -135
- package/node_modules/@pi-harness/core/dist/boot.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/config.d.ts +0 -2
- package/node_modules/@pi-harness/core/dist/config.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/config.js +0 -8
- package/node_modules/@pi-harness/core/dist/config.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/context.d.ts +0 -3
- package/node_modules/@pi-harness/core/dist/context.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/context.js +0 -2
- package/node_modules/@pi-harness/core/dist/context.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/http.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/http.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/http.js +0 -27
- package/node_modules/@pi-harness/core/dist/http.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/index.d.ts +0 -9
- package/node_modules/@pi-harness/core/dist/index.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/index.js +0 -8
- package/node_modules/@pi-harness/core/dist/index.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts +0 -17
- package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js +0 -298
- package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js +0 -84
- package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts +0 -18
- package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/annotation.js +0 -94
- package/node_modules/@pi-harness/core/dist/plugins/annotation.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts +0 -23
- package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/archify.js +0 -98
- package/node_modules/@pi-harness/core/dist/plugins/archify.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/at-file.js +0 -52
- package/node_modules/@pi-harness/core/dist/plugins/at-file.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/auto-mode.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/auto-mode.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js +0 -114
- package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts +0 -37
- package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js +0 -89
- package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js +0 -167
- package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/browser-session.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/browser-session.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/browser-session.js +0 -265
- package/node_modules/@pi-harness/core/dist/plugins/browser-session.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js +0 -88
- package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js +0 -67
- package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cleaner.js +0 -56
- package/node_modules/@pi-harness/core/dist/plugins/cleaner.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js +0 -110
- package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/code2skill.js +0 -95
- package/node_modules/@pi-harness/core/dist/plugins/code2skill.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts +0 -27
- package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js +0 -99
- package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts +0 -30
- package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js +0 -95
- package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/context.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/context.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/context.js +0 -87
- package/node_modules/@pi-harness/core/dist/plugins/context.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts +0 -32
- package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js +0 -204
- package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts +0 -27
- package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js +0 -221
- package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js +0 -102
- package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js +0 -51
- package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/genui.js +0 -79
- package/node_modules/@pi-harness/core/dist/plugins/genui.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts +0 -9
- package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js +0 -90
- package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/graph-memory.d.ts +0 -16
- package/node_modules/@pi-harness/core/dist/plugins/graph-memory.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js +0 -382
- package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/history-compressor.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/history-compressor.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js +0 -80
- package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/hol-guard.d.ts +0 -29
- package/node_modules/@pi-harness/core/dist/plugins/hol-guard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js +0 -139
- package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js +0 -76
- package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js +0 -150
- package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.d.ts +0 -42
- package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js +0 -128
- package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mcp-client.d.ts +0 -19
- package/node_modules/@pi-harness/core/dist/plugins/mcp-client.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js +0 -534
- package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js +0 -180
- package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/memory.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/memory.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/memory.js +0 -161
- package/node_modules/@pi-harness/core/dist/plugins/memory.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.d.ts +0 -23
- package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js +0 -149
- package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mock-server.d.ts +0 -22
- package/node_modules/@pi-harness/core/dist/plugins/mock-server.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/mock-server.js +0 -149
- package/node_modules/@pi-harness/core/dist/plugins/mock-server.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/model.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/model.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/model.js +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/model.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/models.d.ts +0 -16
- package/node_modules/@pi-harness/core/dist/plugins/models.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/models.js +0 -27
- package/node_modules/@pi-harness/core/dist/plugins/models.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/modlens.js +0 -63
- package/node_modules/@pi-harness/core/dist/plugins/modlens.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts +0 -27
- package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/module-search.js +0 -174
- package/node_modules/@pi-harness/core/dist/plugins/module-search.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js +0 -79
- package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/openpets.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/openpets.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/openpets.js +0 -99
- package/node_modules/@pi-harness/core/dist/plugins/openpets.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js +0 -70
- package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts +0 -38
- package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js +0 -227
- package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js +0 -44
- package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts +0 -16
- package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js +0 -98
- package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts +0 -29
- package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js +0 -146
- package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.d.ts +0 -45
- package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js +0 -165
- package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js +0 -114
- package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts +0 -25
- package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js +0 -142
- package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts +0 -25
- package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js +0 -139
- package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts +0 -24
- package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js +0 -124
- package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/resources.d.ts +0 -19
- package/node_modules/@pi-harness/core/dist/plugins/resources.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/resources.js +0 -63
- package/node_modules/@pi-harness/core/dist/plugins/resources.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.d.ts +0 -23
- package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js +0 -60
- package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js +0 -133
- package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts +0 -33
- package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js +0 -114
- package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/runtime.d.ts +0 -14
- package/node_modules/@pi-harness/core/dist/plugins/runtime.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/runtime.js +0 -125
- package/node_modules/@pi-harness/core/dist/plugins/runtime.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts +0 -31
- package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js +0 -121
- package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js +0 -87
- package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts +0 -44
- package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js +0 -265
- package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts +0 -33
- package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-compare.js +0 -150
- package/node_modules/@pi-harness/core/dist/plugins/session-compare.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts +0 -9
- package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-export.js +0 -93
- package/node_modules/@pi-harness/core/dist/plugins/session-export.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-insights.js +0 -47
- package/node_modules/@pi-harness/core/dist/plugins/session-insights.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts +0 -20
- package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session-search.js +0 -122
- package/node_modules/@pi-harness/core/dist/plugins/session-search.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/session.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/session.js +0 -22
- package/node_modules/@pi-harness/core/dist/plugins/session.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts +0 -26
- package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js +0 -97
- package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts +0 -26
- package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js +0 -139
- package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js +0 -85
- package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/stdio.js +0 -22
- package/node_modules/@pi-harness/core/dist/plugins/stdio.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/synapse.d.ts +0 -38
- package/node_modules/@pi-harness/core/dist/plugins/synapse.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/synapse.js +0 -93
- package/node_modules/@pi-harness/core/dist/plugins/synapse.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js +0 -135
- package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/taskboard.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/taskboard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/taskboard.js +0 -347
- package/node_modules/@pi-harness/core/dist/plugins/taskboard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js +0 -57
- package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/test-harness.js +0 -64
- package/node_modules/@pi-harness/core/dist/plugins/test-harness.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/theme-studio.d.ts +0 -29
- package/node_modules/@pi-harness/core/dist/plugins/theme-studio.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js +0 -141
- package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/token-guard.d.ts +0 -15
- package/node_modules/@pi-harness/core/dist/plugins/token-guard.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/token-guard.js +0 -78
- package/node_modules/@pi-harness/core/dist/plugins/token-guard.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/tools.d.ts +0 -13
- package/node_modules/@pi-harness/core/dist/plugins/tools.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/tools.js +0 -20
- package/node_modules/@pi-harness/core/dist/plugins/tools.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts +0 -19
- package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js +0 -74
- package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.d.ts +0 -17
- package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js +0 -247
- package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts +0 -17
- package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js +0 -145
- package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/web-research.d.ts +0 -17
- package/node_modules/@pi-harness/core/dist/plugins/web-research.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/web-research.js +0 -275
- package/node_modules/@pi-harness/core/dist/plugins/web-research.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts +0 -36
- package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js +0 -150
- package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js +0 -134
- package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts +0 -8
- package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js +0 -94
- package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/profile.d.ts +0 -9
- package/node_modules/@pi-harness/core/dist/profile.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/profile.js +0 -33
- package/node_modules/@pi-harness/core/dist/profile.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/runtime.d.ts +0 -16
- package/node_modules/@pi-harness/core/dist/runtime.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/runtime.js +0 -42
- package/node_modules/@pi-harness/core/dist/runtime.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/services.d.ts +0 -118
- package/node_modules/@pi-harness/core/dist/services.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/services.js +0 -95
- package/node_modules/@pi-harness/core/dist/services.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/stdio.d.ts +0 -36
- package/node_modules/@pi-harness/core/dist/stdio.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/stdio.js +0 -140
- package/node_modules/@pi-harness/core/dist/stdio.js.map +0 -1
- package/node_modules/@pi-harness/core/dist/workspace-path.d.ts +0 -12
- package/node_modules/@pi-harness/core/dist/workspace-path.d.ts.map +0 -1
- package/node_modules/@pi-harness/core/dist/workspace-path.js +0 -62
- package/node_modules/@pi-harness/core/dist/workspace-path.js.map +0 -1
- package/node_modules/@pi-harness/core/package.json +0 -42
- package/node_modules/@pi-harness/core/profiles/default/cordis.yml +0 -120
- package/node_modules/@pi-harness/core/profiles/development/cordis.yml +0 -47
- package/packages/client-web/LICENSE +0 -9
- package/packages/client-web/dist/annotation-ui.d.ts +0 -11
- package/packages/client-web/dist/annotation-ui.d.ts.map +0 -1
- package/packages/client-web/dist/annotation-ui.js +0 -24
- package/packages/client-web/dist/annotation-ui.js.map +0 -1
- package/packages/client-web/dist/browser-session-view.d.ts +0 -7
- package/packages/client-web/dist/browser-session-view.d.ts.map +0 -1
- package/packages/client-web/dist/browser-session-view.js +0 -8
- package/packages/client-web/dist/browser-session-view.js.map +0 -1
- package/packages/client-web/dist/control-room.d.ts +0 -270
- package/packages/client-web/dist/control-room.d.ts.map +0 -1
- package/packages/client-web/dist/control-room.js +0 -157
- package/packages/client-web/dist/control-room.js.map +0 -1
- package/packages/client-web/dist/design-contract.d.ts +0 -85
- package/packages/client-web/dist/design-contract.d.ts.map +0 -1
- package/packages/client-web/dist/design-contract.js +0 -258
- package/packages/client-web/dist/design-contract.js.map +0 -1
- package/packages/client-web/dist/index.d.ts +0 -20
- package/packages/client-web/dist/index.d.ts.map +0 -1
- package/packages/client-web/dist/index.js +0 -27
- package/packages/client-web/dist/index.js.map +0 -1
- package/packages/client-web/dist/markdown.d.ts +0 -5
- package/packages/client-web/dist/markdown.d.ts.map +0 -1
- package/packages/client-web/dist/markdown.js +0 -20
- package/packages/client-web/dist/markdown.js.map +0 -1
- package/packages/client-web/dist/marketplace-catalog.d.ts +0 -3
- package/packages/client-web/dist/marketplace-catalog.d.ts.map +0 -1
- package/packages/client-web/dist/marketplace-catalog.js +0 -10
- package/packages/client-web/dist/marketplace-catalog.js.map +0 -1
- package/packages/client-web/dist/marketplace-navigation.d.ts +0 -19
- package/packages/client-web/dist/marketplace-navigation.d.ts.map +0 -1
- package/packages/client-web/dist/marketplace-navigation.js +0 -31
- package/packages/client-web/dist/marketplace-navigation.js.map +0 -1
- package/packages/client-web/dist/message-content.d.ts +0 -9
- package/packages/client-web/dist/message-content.d.ts.map +0 -1
- package/packages/client-web/dist/message-content.js +0 -54
- package/packages/client-web/dist/message-content.js.map +0 -1
- package/packages/client-web/dist/plugin-card.d.ts +0 -8
- package/packages/client-web/dist/plugin-card.d.ts.map +0 -1
- package/packages/client-web/dist/plugin-card.js +0 -15
- package/packages/client-web/dist/plugin-card.js.map +0 -1
- package/packages/client-web/dist/plugin-navigation.d.ts +0 -3
- package/packages/client-web/dist/plugin-navigation.d.ts.map +0 -1
- package/packages/client-web/dist/plugin-navigation.js +0 -10
- package/packages/client-web/dist/plugin-navigation.js.map +0 -1
- package/packages/client-web/dist/plugin-search.d.ts +0 -2
- package/packages/client-web/dist/plugin-search.d.ts.map +0 -1
- package/packages/client-web/dist/plugin-search.js +0 -7
- package/packages/client-web/dist/plugin-search.js.map +0 -1
- package/packages/client-web/dist/plugin-stars-view.d.ts +0 -12
- package/packages/client-web/dist/plugin-stars-view.d.ts.map +0 -1
- package/packages/client-web/dist/plugin-stars-view.js +0 -8
- package/packages/client-web/dist/plugin-stars-view.js.map +0 -1
- package/packages/client-web/dist/prompt-completion.d.ts +0 -13
- package/packages/client-web/dist/prompt-completion.d.ts.map +0 -1
- package/packages/client-web/dist/prompt-completion.js +0 -17
- package/packages/client-web/dist/prompt-completion.js.map +0 -1
- package/packages/client-web/dist/react-room.d.ts +0 -7
- package/packages/client-web/dist/react-room.d.ts.map +0 -1
- package/packages/client-web/dist/react-room.js +0 -2600
- package/packages/client-web/dist/react-room.js.map +0 -1
- package/packages/client-web/dist/runtime-events.d.ts +0 -4
- package/packages/client-web/dist/runtime-events.d.ts.map +0 -1
- package/packages/client-web/dist/runtime-events.js +0 -29
- package/packages/client-web/dist/runtime-events.js.map +0 -1
- package/packages/client-web/package.json +0 -42
- package/packages/client-web/src/annotation-ui.ts +0 -29
- package/packages/client-web/src/browser-session-view.ts +0 -13
- package/packages/client-web/src/control-room.ts +0 -359
- package/packages/client-web/src/design-contract.ts +0 -334
- package/packages/client-web/src/index.ts +0 -34
- package/packages/client-web/src/markdown.tsx +0 -22
- package/packages/client-web/src/marketplace-catalog.ts +0 -10
- package/packages/client-web/src/marketplace-navigation.ts +0 -46
- package/packages/client-web/src/message-content.ts +0 -51
- package/packages/client-web/src/plugin-card.ts +0 -22
- package/packages/client-web/src/plugin-navigation.ts +0 -9
- package/packages/client-web/src/plugin-search.ts +0 -5
- package/packages/client-web/src/plugin-stars-view.ts +0 -19
- package/packages/client-web/src/prompt-completion.ts +0 -24
- package/packages/client-web/src/react-room.tsx +0 -7711
- package/packages/client-web/src/runtime-events.ts +0 -29
- package/packages/client-web/test/annotation-ui.test.ts +0 -21
- package/packages/client-web/test/browser-session-view.test.ts +0 -17
- package/packages/client-web/test/design-contract.test.ts +0 -69
- package/packages/client-web/test/marketplace-catalog.test.ts +0 -52
- package/packages/client-web/test/message-content.test.ts +0 -43
- package/packages/client-web/test/plugin-card.test.ts +0 -46
- package/packages/client-web/test/plugin-navigation.test.ts +0 -14
- package/packages/client-web/test/plugin-search.test.ts +0 -22
- package/packages/client-web/test/plugin-stars-view.test.ts +0 -20
- package/packages/client-web/test/prompt-completion.test.ts +0 -21
- package/packages/client-web/test/runtime-events.test.ts +0 -28
- package/packages/client-web/tsconfig.build.json +0 -13
- package/packages/client-web/tsconfig.json +0 -11
- package/packages/core/LICENSE +0 -9
- package/packages/core/dist/boot.d.ts +0 -13
- package/packages/core/dist/boot.d.ts.map +0 -1
- package/packages/core/dist/boot.js +0 -135
- package/packages/core/dist/boot.js.map +0 -1
- package/packages/core/dist/config.d.ts +0 -2
- package/packages/core/dist/config.d.ts.map +0 -1
- package/packages/core/dist/config.js +0 -8
- package/packages/core/dist/config.js.map +0 -1
- package/packages/core/dist/context.d.ts +0 -3
- package/packages/core/dist/context.d.ts.map +0 -1
- package/packages/core/dist/context.js +0 -2
- package/packages/core/dist/context.js.map +0 -1
- package/packages/core/dist/http.d.ts +0 -8
- package/packages/core/dist/http.d.ts.map +0 -1
- package/packages/core/dist/http.js +0 -27
- package/packages/core/dist/http.js.map +0 -1
- package/packages/core/dist/index.d.ts +0 -9
- package/packages/core/dist/index.d.ts.map +0 -1
- package/packages/core/dist/index.js +0 -8
- package/packages/core/dist/index.js.map +0 -1
- package/packages/core/dist/plugins/agent-teams.d.ts +0 -17
- package/packages/core/dist/plugins/agent-teams.d.ts.map +0 -1
- package/packages/core/dist/plugins/agent-teams.js +0 -298
- package/packages/core/dist/plugins/agent-teams.js.map +0 -1
- package/packages/core/dist/plugins/anchored-standard.d.ts +0 -14
- package/packages/core/dist/plugins/anchored-standard.d.ts.map +0 -1
- package/packages/core/dist/plugins/anchored-standard.js +0 -84
- package/packages/core/dist/plugins/anchored-standard.js.map +0 -1
- package/packages/core/dist/plugins/annotation.d.ts +0 -18
- package/packages/core/dist/plugins/annotation.d.ts.map +0 -1
- package/packages/core/dist/plugins/annotation.js +0 -94
- package/packages/core/dist/plugins/annotation.js.map +0 -1
- package/packages/core/dist/plugins/archify.d.ts +0 -23
- package/packages/core/dist/plugins/archify.d.ts.map +0 -1
- package/packages/core/dist/plugins/archify.js +0 -98
- package/packages/core/dist/plugins/archify.js.map +0 -1
- package/packages/core/dist/plugins/at-file.d.ts +0 -8
- package/packages/core/dist/plugins/at-file.d.ts.map +0 -1
- package/packages/core/dist/plugins/at-file.js +0 -52
- package/packages/core/dist/plugins/at-file.js.map +0 -1
- package/packages/core/dist/plugins/auto-mode.d.ts +0 -15
- package/packages/core/dist/plugins/auto-mode.d.ts.map +0 -1
- package/packages/core/dist/plugins/auto-mode.js +0 -114
- package/packages/core/dist/plugins/auto-mode.js.map +0 -1
- package/packages/core/dist/plugins/better-sidebar.d.ts +0 -37
- package/packages/core/dist/plugins/better-sidebar.d.ts.map +0 -1
- package/packages/core/dist/plugins/better-sidebar.js +0 -89
- package/packages/core/dist/plugins/better-sidebar.js.map +0 -1
- package/packages/core/dist/plugins/browser-fetch.d.ts +0 -14
- package/packages/core/dist/plugins/browser-fetch.d.ts.map +0 -1
- package/packages/core/dist/plugins/browser-fetch.js +0 -167
- package/packages/core/dist/plugins/browser-fetch.js.map +0 -1
- package/packages/core/dist/plugins/browser-session.d.ts +0 -14
- package/packages/core/dist/plugins/browser-session.d.ts.map +0 -1
- package/packages/core/dist/plugins/browser-session.js +0 -265
- package/packages/core/dist/plugins/browser-session.js.map +0 -1
- package/packages/core/dist/plugins/canvas-draw.d.ts +0 -8
- package/packages/core/dist/plugins/canvas-draw.d.ts.map +0 -1
- package/packages/core/dist/plugins/canvas-draw.js +0 -88
- package/packages/core/dist/plugins/canvas-draw.js.map +0 -1
- package/packages/core/dist/plugins/change-verifier.d.ts +0 -8
- package/packages/core/dist/plugins/change-verifier.d.ts.map +0 -1
- package/packages/core/dist/plugins/change-verifier.js +0 -67
- package/packages/core/dist/plugins/change-verifier.js.map +0 -1
- package/packages/core/dist/plugins/cleaner.d.ts +0 -8
- package/packages/core/dist/plugins/cleaner.d.ts.map +0 -1
- package/packages/core/dist/plugins/cleaner.js +0 -56
- package/packages/core/dist/plugins/cleaner.js.map +0 -1
- package/packages/core/dist/plugins/cli-notifier.d.ts +0 -15
- package/packages/core/dist/plugins/cli-notifier.d.ts.map +0 -1
- package/packages/core/dist/plugins/cli-notifier.js +0 -110
- package/packages/core/dist/plugins/cli-notifier.js.map +0 -1
- package/packages/core/dist/plugins/code2skill.d.ts +0 -8
- package/packages/core/dist/plugins/code2skill.d.ts.map +0 -1
- package/packages/core/dist/plugins/code2skill.js +0 -95
- package/packages/core/dist/plugins/code2skill.js.map +0 -1
- package/packages/core/dist/plugins/colleague-skill.d.ts +0 -27
- package/packages/core/dist/plugins/colleague-skill.d.ts.map +0 -1
- package/packages/core/dist/plugins/colleague-skill.js +0 -99
- package/packages/core/dist/plugins/colleague-skill.js.map +0 -1
- package/packages/core/dist/plugins/context-doctor.d.ts +0 -30
- package/packages/core/dist/plugins/context-doctor.d.ts.map +0 -1
- package/packages/core/dist/plugins/context-doctor.js +0 -95
- package/packages/core/dist/plugins/context-doctor.js.map +0 -1
- package/packages/core/dist/plugins/context.d.ts +0 -8
- package/packages/core/dist/plugins/context.d.ts.map +0 -1
- package/packages/core/dist/plugins/context.js +0 -87
- package/packages/core/dist/plugins/context.js.map +0 -1
- package/packages/core/dist/plugins/cost-meter.d.ts +0 -32
- package/packages/core/dist/plugins/cost-meter.d.ts.map +0 -1
- package/packages/core/dist/plugins/cost-meter.js +0 -204
- package/packages/core/dist/plugins/cost-meter.js.map +0 -1
- package/packages/core/dist/plugins/dependency-checker.d.ts +0 -27
- package/packages/core/dist/plugins/dependency-checker.d.ts.map +0 -1
- package/packages/core/dist/plugins/dependency-checker.js +0 -221
- package/packages/core/dist/plugins/dependency-checker.js.map +0 -1
- package/packages/core/dist/plugins/docker-sandbox.d.ts +0 -8
- package/packages/core/dist/plugins/docker-sandbox.d.ts.map +0 -1
- package/packages/core/dist/plugins/docker-sandbox.js +0 -102
- package/packages/core/dist/plugins/docker-sandbox.js.map +0 -1
- package/packages/core/dist/plugins/fail-logger.d.ts +0 -8
- package/packages/core/dist/plugins/fail-logger.d.ts.map +0 -1
- package/packages/core/dist/plugins/fail-logger.js +0 -51
- package/packages/core/dist/plugins/fail-logger.js.map +0 -1
- package/packages/core/dist/plugins/genui.d.ts +0 -8
- package/packages/core/dist/plugins/genui.d.ts.map +0 -1
- package/packages/core/dist/plugins/genui.js +0 -79
- package/packages/core/dist/plugins/genui.js.map +0 -1
- package/packages/core/dist/plugins/git-time-capsule.d.ts +0 -9
- package/packages/core/dist/plugins/git-time-capsule.d.ts.map +0 -1
- package/packages/core/dist/plugins/git-time-capsule.js +0 -90
- package/packages/core/dist/plugins/git-time-capsule.js.map +0 -1
- package/packages/core/dist/plugins/graph-memory.d.ts +0 -16
- package/packages/core/dist/plugins/graph-memory.d.ts.map +0 -1
- package/packages/core/dist/plugins/graph-memory.js +0 -382
- package/packages/core/dist/plugins/graph-memory.js.map +0 -1
- package/packages/core/dist/plugins/history-compressor.d.ts +0 -15
- package/packages/core/dist/plugins/history-compressor.d.ts.map +0 -1
- package/packages/core/dist/plugins/history-compressor.js +0 -80
- package/packages/core/dist/plugins/history-compressor.js.map +0 -1
- package/packages/core/dist/plugins/hol-guard.d.ts +0 -29
- package/packages/core/dist/plugins/hol-guard.d.ts.map +0 -1
- package/packages/core/dist/plugins/hol-guard.js +0 -139
- package/packages/core/dist/plugins/hol-guard.js.map +0 -1
- package/packages/core/dist/plugins/i18n-pair.d.ts +0 -8
- package/packages/core/dist/plugins/i18n-pair.d.ts.map +0 -1
- package/packages/core/dist/plugins/i18n-pair.js +0 -76
- package/packages/core/dist/plugins/i18n-pair.js.map +0 -1
- package/packages/core/dist/plugins/image-compressor.d.ts +0 -8
- package/packages/core/dist/plugins/image-compressor.d.ts.map +0 -1
- package/packages/core/dist/plugins/image-compressor.js +0 -150
- package/packages/core/dist/plugins/image-compressor.js.map +0 -1
- package/packages/core/dist/plugins/llm-verifier.d.ts +0 -42
- package/packages/core/dist/plugins/llm-verifier.d.ts.map +0 -1
- package/packages/core/dist/plugins/llm-verifier.js +0 -128
- package/packages/core/dist/plugins/llm-verifier.js.map +0 -1
- package/packages/core/dist/plugins/mcp-client.d.ts +0 -19
- package/packages/core/dist/plugins/mcp-client.d.ts.map +0 -1
- package/packages/core/dist/plugins/mcp-client.js +0 -534
- package/packages/core/dist/plugins/mcp-client.js.map +0 -1
- package/packages/core/dist/plugins/mcp-panel.d.ts +0 -14
- package/packages/core/dist/plugins/mcp-panel.d.ts.map +0 -1
- package/packages/core/dist/plugins/mcp-panel.js +0 -180
- package/packages/core/dist/plugins/mcp-panel.js.map +0 -1
- package/packages/core/dist/plugins/memory.d.ts +0 -15
- package/packages/core/dist/plugins/memory.d.ts.map +0 -1
- package/packages/core/dist/plugins/memory.js +0 -161
- package/packages/core/dist/plugins/memory.js.map +0 -1
- package/packages/core/dist/plugins/mirage-bridge.d.ts +0 -23
- package/packages/core/dist/plugins/mirage-bridge.d.ts.map +0 -1
- package/packages/core/dist/plugins/mirage-bridge.js +0 -149
- package/packages/core/dist/plugins/mirage-bridge.js.map +0 -1
- package/packages/core/dist/plugins/mock-server.d.ts +0 -22
- package/packages/core/dist/plugins/mock-server.d.ts.map +0 -1
- package/packages/core/dist/plugins/mock-server.js +0 -149
- package/packages/core/dist/plugins/mock-server.js.map +0 -1
- package/packages/core/dist/plugins/model.d.ts +0 -8
- package/packages/core/dist/plugins/model.d.ts.map +0 -1
- package/packages/core/dist/plugins/model.js +0 -14
- package/packages/core/dist/plugins/model.js.map +0 -1
- package/packages/core/dist/plugins/models.d.ts +0 -16
- package/packages/core/dist/plugins/models.d.ts.map +0 -1
- package/packages/core/dist/plugins/models.js +0 -27
- package/packages/core/dist/plugins/models.js.map +0 -1
- package/packages/core/dist/plugins/modlens.d.ts +0 -8
- package/packages/core/dist/plugins/modlens.d.ts.map +0 -1
- package/packages/core/dist/plugins/modlens.js +0 -63
- package/packages/core/dist/plugins/modlens.js.map +0 -1
- package/packages/core/dist/plugins/module-search.d.ts +0 -27
- package/packages/core/dist/plugins/module-search.d.ts.map +0 -1
- package/packages/core/dist/plugins/module-search.js +0 -174
- package/packages/core/dist/plugins/module-search.js.map +0 -1
- package/packages/core/dist/plugins/obsidian-sync.d.ts +0 -14
- package/packages/core/dist/plugins/obsidian-sync.d.ts.map +0 -1
- package/packages/core/dist/plugins/obsidian-sync.js +0 -79
- package/packages/core/dist/plugins/obsidian-sync.js.map +0 -1
- package/packages/core/dist/plugins/openpets.d.ts +0 -14
- package/packages/core/dist/plugins/openpets.d.ts.map +0 -1
- package/packages/core/dist/plugins/openpets.js +0 -99
- package/packages/core/dist/plugins/openpets.js.map +0 -1
- package/packages/core/dist/plugins/plan-execute.d.ts +0 -8
- package/packages/core/dist/plugins/plan-execute.d.ts.map +0 -1
- package/packages/core/dist/plugins/plan-execute.js +0 -70
- package/packages/core/dist/plugins/plan-execute.js.map +0 -1
- package/packages/core/dist/plugins/plugin-check.d.ts +0 -38
- package/packages/core/dist/plugins/plugin-check.d.ts.map +0 -1
- package/packages/core/dist/plugins/plugin-check.js +0 -227
- package/packages/core/dist/plugins/plugin-check.js.map +0 -1
- package/packages/core/dist/plugins/plugin-dev.d.ts +0 -8
- package/packages/core/dist/plugins/plugin-dev.d.ts.map +0 -1
- package/packages/core/dist/plugins/plugin-dev.js +0 -44
- package/packages/core/dist/plugins/plugin-dev.js.map +0 -1
- package/packages/core/dist/plugins/plugin-finder.d.ts +0 -16
- package/packages/core/dist/plugins/plugin-finder.d.ts.map +0 -1
- package/packages/core/dist/plugins/plugin-finder.js +0 -98
- package/packages/core/dist/plugins/plugin-finder.js.map +0 -1
- package/packages/core/dist/plugins/plugin-radar.d.ts +0 -29
- package/packages/core/dist/plugins/plugin-radar.d.ts.map +0 -1
- package/packages/core/dist/plugins/plugin-radar.js +0 -146
- package/packages/core/dist/plugins/plugin-radar.js.map +0 -1
- package/packages/core/dist/plugins/plugin-stars.d.ts +0 -45
- package/packages/core/dist/plugins/plugin-stars.d.ts.map +0 -1
- package/packages/core/dist/plugins/plugin-stars.js +0 -165
- package/packages/core/dist/plugins/plugin-stars.js.map +0 -1
- package/packages/core/dist/plugins/prompt-guard.d.ts +0 -8
- package/packages/core/dist/plugins/prompt-guard.d.ts.map +0 -1
- package/packages/core/dist/plugins/prompt-guard.js +0 -114
- package/packages/core/dist/plugins/prompt-guard.js.map +0 -1
- package/packages/core/dist/plugins/prompt-library.d.ts +0 -25
- package/packages/core/dist/plugins/prompt-library.d.ts.map +0 -1
- package/packages/core/dist/plugins/prompt-library.js +0 -142
- package/packages/core/dist/plugins/prompt-library.js.map +0 -1
- package/packages/core/dist/plugins/readme-gen.d.ts +0 -25
- package/packages/core/dist/plugins/readme-gen.d.ts.map +0 -1
- package/packages/core/dist/plugins/readme-gen.js +0 -139
- package/packages/core/dist/plugins/readme-gen.js.map +0 -1
- package/packages/core/dist/plugins/recall-unread.d.ts +0 -24
- package/packages/core/dist/plugins/recall-unread.d.ts.map +0 -1
- package/packages/core/dist/plugins/recall-unread.js +0 -124
- package/packages/core/dist/plugins/recall-unread.js.map +0 -1
- package/packages/core/dist/plugins/resources.d.ts +0 -19
- package/packages/core/dist/plugins/resources.d.ts.map +0 -1
- package/packages/core/dist/plugins/resources.js +0 -63
- package/packages/core/dist/plugins/resources.js.map +0 -1
- package/packages/core/dist/plugins/reverse-skill.d.ts +0 -23
- package/packages/core/dist/plugins/reverse-skill.d.ts.map +0 -1
- package/packages/core/dist/plugins/reverse-skill.js +0 -60
- package/packages/core/dist/plugins/reverse-skill.js.map +0 -1
- package/packages/core/dist/plugins/reviewer-bot.d.ts +0 -14
- package/packages/core/dist/plugins/reviewer-bot.d.ts.map +0 -1
- package/packages/core/dist/plugins/reviewer-bot.js +0 -133
- package/packages/core/dist/plugins/reviewer-bot.js.map +0 -1
- package/packages/core/dist/plugins/runtime-doctor.d.ts +0 -33
- package/packages/core/dist/plugins/runtime-doctor.d.ts.map +0 -1
- package/packages/core/dist/plugins/runtime-doctor.js +0 -114
- package/packages/core/dist/plugins/runtime-doctor.js.map +0 -1
- package/packages/core/dist/plugins/runtime.d.ts +0 -14
- package/packages/core/dist/plugins/runtime.d.ts.map +0 -1
- package/packages/core/dist/plugins/runtime.js +0 -125
- package/packages/core/dist/plugins/runtime.js.map +0 -1
- package/packages/core/dist/plugins/secure-audit.d.ts +0 -31
- package/packages/core/dist/plugins/secure-audit.d.ts.map +0 -1
- package/packages/core/dist/plugins/secure-audit.js +0 -121
- package/packages/core/dist/plugins/secure-audit.js.map +0 -1
- package/packages/core/dist/plugins/session-bookmarks.d.ts +0 -15
- package/packages/core/dist/plugins/session-bookmarks.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-bookmarks.js +0 -87
- package/packages/core/dist/plugins/session-bookmarks.js.map +0 -1
- package/packages/core/dist/plugins/session-bridge.d.ts +0 -44
- package/packages/core/dist/plugins/session-bridge.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-bridge.js +0 -265
- package/packages/core/dist/plugins/session-bridge.js.map +0 -1
- package/packages/core/dist/plugins/session-compare.d.ts +0 -33
- package/packages/core/dist/plugins/session-compare.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-compare.js +0 -150
- package/packages/core/dist/plugins/session-compare.js.map +0 -1
- package/packages/core/dist/plugins/session-export.d.ts +0 -9
- package/packages/core/dist/plugins/session-export.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-export.js +0 -93
- package/packages/core/dist/plugins/session-export.js.map +0 -1
- package/packages/core/dist/plugins/session-insights.d.ts +0 -8
- package/packages/core/dist/plugins/session-insights.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-insights.js +0 -47
- package/packages/core/dist/plugins/session-insights.js.map +0 -1
- package/packages/core/dist/plugins/session-search.d.ts +0 -20
- package/packages/core/dist/plugins/session-search.d.ts.map +0 -1
- package/packages/core/dist/plugins/session-search.js +0 -122
- package/packages/core/dist/plugins/session-search.js.map +0 -1
- package/packages/core/dist/plugins/session.d.ts +0 -15
- package/packages/core/dist/plugins/session.d.ts.map +0 -1
- package/packages/core/dist/plugins/session.js +0 -22
- package/packages/core/dist/plugins/session.js.map +0 -1
- package/packages/core/dist/plugins/skill-catalog.d.ts +0 -26
- package/packages/core/dist/plugins/skill-catalog.d.ts.map +0 -1
- package/packages/core/dist/plugins/skill-catalog.js +0 -97
- package/packages/core/dist/plugins/skill-catalog.js.map +0 -1
- package/packages/core/dist/plugins/skill-guard.d.ts +0 -26
- package/packages/core/dist/plugins/skill-guard.d.ts.map +0 -1
- package/packages/core/dist/plugins/skill-guard.js +0 -139
- package/packages/core/dist/plugins/skill-guard.js.map +0 -1
- package/packages/core/dist/plugins/sql-lens.d.ts +0 -8
- package/packages/core/dist/plugins/sql-lens.d.ts.map +0 -1
- package/packages/core/dist/plugins/sql-lens.js +0 -85
- package/packages/core/dist/plugins/sql-lens.js.map +0 -1
- package/packages/core/dist/plugins/stdio.d.ts +0 -8
- package/packages/core/dist/plugins/stdio.d.ts.map +0 -1
- package/packages/core/dist/plugins/stdio.js +0 -22
- package/packages/core/dist/plugins/stdio.js.map +0 -1
- package/packages/core/dist/plugins/synapse.d.ts +0 -38
- package/packages/core/dist/plugins/synapse.d.ts.map +0 -1
- package/packages/core/dist/plugins/synapse.js +0 -93
- package/packages/core/dist/plugins/synapse.js.map +0 -1
- package/packages/core/dist/plugins/tab-manager.d.ts +0 -8
- package/packages/core/dist/plugins/tab-manager.d.ts.map +0 -1
- package/packages/core/dist/plugins/tab-manager.js +0 -135
- package/packages/core/dist/plugins/tab-manager.js.map +0 -1
- package/packages/core/dist/plugins/taskboard.d.ts +0 -15
- package/packages/core/dist/plugins/taskboard.d.ts.map +0 -1
- package/packages/core/dist/plugins/taskboard.js +0 -347
- package/packages/core/dist/plugins/taskboard.js.map +0 -1
- package/packages/core/dist/plugins/telemetry-blocker.d.ts +0 -8
- package/packages/core/dist/plugins/telemetry-blocker.d.ts.map +0 -1
- package/packages/core/dist/plugins/telemetry-blocker.js +0 -57
- package/packages/core/dist/plugins/telemetry-blocker.js.map +0 -1
- package/packages/core/dist/plugins/test-harness.d.ts +0 -8
- package/packages/core/dist/plugins/test-harness.d.ts.map +0 -1
- package/packages/core/dist/plugins/test-harness.js +0 -64
- package/packages/core/dist/plugins/test-harness.js.map +0 -1
- package/packages/core/dist/plugins/theme-studio.d.ts +0 -29
- package/packages/core/dist/plugins/theme-studio.d.ts.map +0 -1
- package/packages/core/dist/plugins/theme-studio.js +0 -141
- package/packages/core/dist/plugins/theme-studio.js.map +0 -1
- package/packages/core/dist/plugins/token-guard.d.ts +0 -15
- package/packages/core/dist/plugins/token-guard.d.ts.map +0 -1
- package/packages/core/dist/plugins/token-guard.js +0 -78
- package/packages/core/dist/plugins/token-guard.js.map +0 -1
- package/packages/core/dist/plugins/tools.d.ts +0 -13
- package/packages/core/dist/plugins/tools.d.ts.map +0 -1
- package/packages/core/dist/plugins/tools.js +0 -20
- package/packages/core/dist/plugins/tools.js.map +0 -1
- package/packages/core/dist/plugins/turn-rewind.d.ts +0 -19
- package/packages/core/dist/plugins/turn-rewind.d.ts.map +0 -1
- package/packages/core/dist/plugins/turn-rewind.js +0 -74
- package/packages/core/dist/plugins/turn-rewind.js.map +0 -1
- package/packages/core/dist/plugins/undo-savepoint.d.ts +0 -17
- package/packages/core/dist/plugins/undo-savepoint.d.ts.map +0 -1
- package/packages/core/dist/plugins/undo-savepoint.js +0 -247
- package/packages/core/dist/plugins/undo-savepoint.js.map +0 -1
- package/packages/core/dist/plugins/vision-toolkit.d.ts +0 -17
- package/packages/core/dist/plugins/vision-toolkit.d.ts.map +0 -1
- package/packages/core/dist/plugins/vision-toolkit.js +0 -145
- package/packages/core/dist/plugins/vision-toolkit.js.map +0 -1
- package/packages/core/dist/plugins/web-research.d.ts +0 -17
- package/packages/core/dist/plugins/web-research.d.ts.map +0 -1
- package/packages/core/dist/plugins/web-research.js +0 -275
- package/packages/core/dist/plugins/web-research.js.map +0 -1
- package/packages/core/dist/plugins/workspace-navigator.d.ts +0 -36
- package/packages/core/dist/plugins/workspace-navigator.d.ts.map +0 -1
- package/packages/core/dist/plugins/workspace-navigator.js +0 -150
- package/packages/core/dist/plugins/workspace-navigator.js.map +0 -1
- package/packages/core/dist/plugins/workspace-search.d.ts +0 -8
- package/packages/core/dist/plugins/workspace-search.d.ts.map +0 -1
- package/packages/core/dist/plugins/workspace-search.js +0 -134
- package/packages/core/dist/plugins/workspace-search.js.map +0 -1
- package/packages/core/dist/plugins/yaml-validator.d.ts +0 -8
- package/packages/core/dist/plugins/yaml-validator.d.ts.map +0 -1
- package/packages/core/dist/plugins/yaml-validator.js +0 -94
- package/packages/core/dist/plugins/yaml-validator.js.map +0 -1
- package/packages/core/dist/profile.d.ts +0 -9
- package/packages/core/dist/profile.d.ts.map +0 -1
- package/packages/core/dist/profile.js +0 -33
- package/packages/core/dist/profile.js.map +0 -1
- package/packages/core/dist/runtime.d.ts +0 -16
- package/packages/core/dist/runtime.d.ts.map +0 -1
- package/packages/core/dist/runtime.js +0 -42
- package/packages/core/dist/runtime.js.map +0 -1
- package/packages/core/dist/services.d.ts +0 -118
- package/packages/core/dist/services.d.ts.map +0 -1
- package/packages/core/dist/services.js +0 -95
- package/packages/core/dist/services.js.map +0 -1
- package/packages/core/dist/stdio.d.ts +0 -36
- package/packages/core/dist/stdio.d.ts.map +0 -1
- package/packages/core/dist/stdio.js +0 -140
- package/packages/core/dist/stdio.js.map +0 -1
- package/packages/core/dist/workspace-path.d.ts +0 -12
- package/packages/core/dist/workspace-path.d.ts.map +0 -1
- package/packages/core/dist/workspace-path.js +0 -62
- package/packages/core/dist/workspace-path.js.map +0 -1
- package/packages/core/package.json +0 -42
- package/packages/core/profiles/default/cordis.yml +0 -120
- package/packages/core/profiles/development/cordis.yml +0 -47
- package/packages/core/src/boot.ts +0 -143
- package/packages/core/src/config.ts +0 -6
- package/packages/core/src/context.ts +0 -3
- package/packages/core/src/http.ts +0 -32
- package/packages/core/src/index.ts +0 -8
- package/packages/core/src/plugins/agent-teams.ts +0 -291
- package/packages/core/src/plugins/anchored-standard.ts +0 -88
- package/packages/core/src/plugins/annotation.ts +0 -106
- package/packages/core/src/plugins/archify.ts +0 -124
- package/packages/core/src/plugins/at-file.ts +0 -54
- package/packages/core/src/plugins/auto-mode.ts +0 -123
- package/packages/core/src/plugins/better-sidebar.ts +0 -117
- package/packages/core/src/plugins/browser-fetch.ts +0 -171
- package/packages/core/src/plugins/browser-session.ts +0 -287
- package/packages/core/src/plugins/canvas-draw.ts +0 -90
- package/packages/core/src/plugins/change-verifier.ts +0 -79
- package/packages/core/src/plugins/cleaner.ts +0 -61
- package/packages/core/src/plugins/cli-notifier.ts +0 -125
- package/packages/core/src/plugins/code2skill.ts +0 -96
- package/packages/core/src/plugins/colleague-skill.ts +0 -122
- package/packages/core/src/plugins/context-doctor.ts +0 -117
- package/packages/core/src/plugins/context.ts +0 -102
- package/packages/core/src/plugins/cost-meter.ts +0 -231
- package/packages/core/src/plugins/dependency-checker.ts +0 -241
- package/packages/core/src/plugins/docker-sandbox.ts +0 -100
- package/packages/core/src/plugins/fail-logger.ts +0 -51
- package/packages/core/src/plugins/genui.ts +0 -88
- package/packages/core/src/plugins/git-time-capsule.ts +0 -97
- package/packages/core/src/plugins/graph-memory.ts +0 -394
- package/packages/core/src/plugins/history-compressor.ts +0 -81
- package/packages/core/src/plugins/hol-guard.ts +0 -153
- package/packages/core/src/plugins/i18n-pair.ts +0 -82
- package/packages/core/src/plugins/image-compressor.ts +0 -144
- package/packages/core/src/plugins/llm-verifier.ts +0 -164
- package/packages/core/src/plugins/mcp-client.ts +0 -559
- package/packages/core/src/plugins/mcp-panel.ts +0 -190
- package/packages/core/src/plugins/memory.ts +0 -176
- package/packages/core/src/plugins/mirage-bridge.ts +0 -179
- package/packages/core/src/plugins/mock-server.ts +0 -158
- package/packages/core/src/plugins/model.ts +0 -14
- package/packages/core/src/plugins/models.ts +0 -35
- package/packages/core/src/plugins/modlens.ts +0 -63
- package/packages/core/src/plugins/module-search.ts +0 -201
- package/packages/core/src/plugins/obsidian-sync.ts +0 -83
- package/packages/core/src/plugins/openpets.ts +0 -109
- package/packages/core/src/plugins/plan-execute.ts +0 -76
- package/packages/core/src/plugins/plugin-check.ts +0 -232
- package/packages/core/src/plugins/plugin-dev.ts +0 -47
- package/packages/core/src/plugins/plugin-finder.ts +0 -108
- package/packages/core/src/plugins/plugin-radar.ts +0 -179
- package/packages/core/src/plugins/plugin-stars.ts +0 -205
- package/packages/core/src/plugins/prompt-guard.ts +0 -122
- package/packages/core/src/plugins/prompt-library.ts +0 -165
- package/packages/core/src/plugins/readme-gen.ts +0 -147
- package/packages/core/src/plugins/recall-unread.ts +0 -142
- package/packages/core/src/plugins/resources.ts +0 -78
- package/packages/core/src/plugins/reverse-skill.ts +0 -79
- package/packages/core/src/plugins/reviewer-bot.ts +0 -146
- package/packages/core/src/plugins/runtime-doctor.ts +0 -137
- package/packages/core/src/plugins/runtime.ts +0 -141
- package/packages/core/src/plugins/secure-audit.ts +0 -146
- package/packages/core/src/plugins/session-bookmarks.ts +0 -89
- package/packages/core/src/plugins/session-bridge.ts +0 -299
- package/packages/core/src/plugins/session-compare.ts +0 -180
- package/packages/core/src/plugins/session-export.ts +0 -99
- package/packages/core/src/plugins/session-insights.ts +0 -47
- package/packages/core/src/plugins/session-search.ts +0 -126
- package/packages/core/src/plugins/session.ts +0 -33
- package/packages/core/src/plugins/skill-catalog.ts +0 -117
- package/packages/core/src/plugins/skill-guard.ts +0 -152
- package/packages/core/src/plugins/sql-lens.ts +0 -92
- package/packages/core/src/plugins/stdio.ts +0 -22
- package/packages/core/src/plugins/synapse.ts +0 -130
- package/packages/core/src/plugins/tab-manager.ts +0 -135
- package/packages/core/src/plugins/taskboard.ts +0 -412
- package/packages/core/src/plugins/telemetry-blocker.ts +0 -62
- package/packages/core/src/plugins/test-harness.ts +0 -67
- package/packages/core/src/plugins/theme-studio.ts +0 -165
- package/packages/core/src/plugins/token-guard.ts +0 -84
- package/packages/core/src/plugins/tools.ts +0 -26
- package/packages/core/src/plugins/turn-rewind.ts +0 -86
- package/packages/core/src/plugins/undo-savepoint.ts +0 -284
- package/packages/core/src/plugins/vision-toolkit.ts +0 -153
- package/packages/core/src/plugins/web-research.ts +0 -289
- package/packages/core/src/plugins/workspace-navigator.ts +0 -164
- package/packages/core/src/plugins/workspace-search.ts +0 -139
- package/packages/core/src/plugins/yaml-validator.ts +0 -97
- package/packages/core/src/profile.ts +0 -37
- package/packages/core/src/runtime.ts +0 -46
- package/packages/core/src/services.ts +0 -212
- package/packages/core/src/stdio.ts +0 -160
- package/packages/core/src/workspace-path.ts +0 -69
- package/packages/core/test/agent-teams.test.ts +0 -24
- package/packages/core/test/archify.test.ts +0 -33
- package/packages/core/test/better-sidebar.test.ts +0 -125
- package/packages/core/test/boot.test.ts +0 -137
- package/packages/core/test/colleague-skill.test.ts +0 -74
- package/packages/core/test/config.test.ts +0 -139
- package/packages/core/test/context-doctor.test.ts +0 -32
- package/packages/core/test/dependency-checker.test.ts +0 -60
- package/packages/core/test/git-time-capsule.test.ts +0 -115
- package/packages/core/test/http.test.ts +0 -36
- package/packages/core/test/llm-verifier.test.ts +0 -72
- package/packages/core/test/mirage-bridge.test.ts +0 -54
- package/packages/core/test/module-search.test.ts +0 -78
- package/packages/core/test/plugin-check.test.ts +0 -16
- package/packages/core/test/plugin-stars.test.ts +0 -55
- package/packages/core/test/profile.test.ts +0 -39
- package/packages/core/test/profiles.integration.test.ts +0 -127
- package/packages/core/test/prompt-library.test.ts +0 -56
- package/packages/core/test/readme-gen.test.ts +0 -45
- package/packages/core/test/recall-unread.test.ts +0 -35
- package/packages/core/test/registry.test.ts +0 -48
- package/packages/core/test/reverse-skill.test.ts +0 -40
- package/packages/core/test/runtime-doctor.test.ts +0 -55
- package/packages/core/test/runtime-fixture.ts +0 -46
- package/packages/core/test/runtime.test.ts +0 -160
- package/packages/core/test/secure-audit.test.ts +0 -16
- package/packages/core/test/services.test.ts +0 -2150
- package/packages/core/test/session-bookmarks.test.ts +0 -62
- package/packages/core/test/session-bridge.test.ts +0 -103
- package/packages/core/test/session-compare.test.ts +0 -94
- package/packages/core/test/session-export.test.ts +0 -54
- package/packages/core/test/session-search.test.ts +0 -30
- package/packages/core/test/skill-catalog.test.ts +0 -18
- package/packages/core/test/skill-guard.test.ts +0 -21
- package/packages/core/test/stdio-args.test.ts +0 -178
- package/packages/core/test/stdio.test.ts +0 -87
- package/packages/core/test/theme-studio.test.ts +0 -39
- package/packages/core/test/token-guard.test.ts +0 -34
- package/packages/core/test/turn-rewind.test.ts +0 -19
- package/packages/core/test/vision-toolkit.test.ts +0 -38
- package/packages/core/test/workspace-git-status.test.ts +0 -37
- package/packages/core/test/workspace-navigator.test.ts +0 -33
- package/packages/core/test/workspace-path.test.ts +0 -34
- package/packages/core/tsconfig.build.json +0 -8
- package/packages/core/tsconfig.json +0 -7
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./react-vendor-BxoMtjVy.js";import{n as i,t as a}from"./markdown-vendor-DUdMWn0M.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var o=e(),s=t();function c(e){return e==null}function l(e,t,n){return Object.defineProperty(e,t,{writable:!0,value:n,enumerable:!1})}function u(e,t){return arguments.length===1?t=>u(e,t):e in globalThis&&t instanceof globalThis[e]||Object.prototype.toString.call(t).slice(8,-1)===e}function d(e){return u(`ArrayBuffer`,e)||u(`SharedArrayBuffer`,e)}function f(e){return d(e)||ArrayBuffer.isView(e)}var p;(function(e){e.is=d,e.isSource=f;function t(e){return ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e}e.fromSource=t;function n(e){if(e=t(e),typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let n=``,r=new Uint8Array(e);for(let e=0;e<r.byteLength;e++)n+=String.fromCharCode(r[e]);return btoa(n)}e.toBase64=n;function r(e){return typeof Buffer<`u`?t(Buffer.from(e,`base64`)):Uint8Array.from(atob(e),e=>e.charCodeAt(0))}e.fromBase64=r;function i(e){return e=t(e),typeof Buffer<`u`?Buffer.from(e).toString(`hex`):Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``)}e.toHex=i;function a(e){if(typeof Buffer<`u`)return t(Buffer.from(e,`hex`));let n=e.length%2==0?e:e.slice(0,e.length-1),r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(`${n[e]}${n[e+1]}`,16));return Uint8Array.from(r).buffer}e.fromHex=a})(p||={}),p.fromBase64,p.toBase64,p.fromHex,p.toHex;function m(e,t,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=65&&o<=90){if(i===1){let t=e.charCodeAt(a+1);t>=97&&t<=122&&r.push(n),r.push(o+32)}else i!==0&&r.push(n),r.push(o+32);i=1}else o>=97&&o<=122?(r.push(o),i=2):t.includes(o)?(i!==0&&r.push(n),i=0):r.push(o)}return String.fromCharCode(...r)}function h(e){return m(e,[45,95],45)}var g=h,_;(function(e){e.millisecond=1,e.second=1e3,e.minute=e.second*60,e.hour=e.minute*60,e.day=e.hour*24,e.week=e.day*7;let t=new Date().getTimezoneOffset();function n(e){t=e}e.setTimezoneOffset=n;function r(){return t}e.getTimezoneOffset=r;function i(n=new Date,r){return typeof n==`number`&&(n=new Date(n)),r===void 0&&(r=t),Math.floor((n.valueOf()/e.minute-r)/1440)}e.getDateNumber=i;function a(n,r){let i=new Date(n*e.day);return r===void 0&&(r=t),new Date(+i+r*e.minute)}e.fromDateNumber=a;let o=RegExp(`^${[`w(?:eek(?:s)?)?`,`d(?:ay(?:s)?)?`,`h(?:our(?:s)?)?`,`m(?:in(?:ute)?(?:s)?)?`,`s(?:ec(?:ond)?(?:s)?)?`].map(e=>`(\\d+(?:\\.\\d+)?${e})?`).join(``)}$`);function s(t){let n=o.exec(t);return n?(parseFloat(n[1])*e.week||0)+(parseFloat(n[2])*e.day||0)+(parseFloat(n[3])*e.hour||0)+(parseFloat(n[4])*e.minute||0)+(parseFloat(n[5])*e.second||0):0}e.parseTime=s;function c(e){let t=s(e);return t?e=Date.now()+t:/^\d{1,2}(:\d{1,2}){1,2}$/.test(e)?e=`${new Date().toLocaleDateString()}-${e}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(e)&&(e=`${new Date().getFullYear()}-${e}`),e?new Date(e):new Date}e.parseDate=c;function l(t){let n=Math.abs(t);return n>=e.day-e.hour/2?Math.round(t/e.day)+`d`:n>=e.hour-e.minute/2?Math.round(t/e.hour)+`h`:n>=e.minute-e.second/2?Math.round(t/e.minute)+`m`:n>=e.second?Math.round(t/e.second)+`s`:t+`ms`}e.format=l;function u(e,t=2){return e.toString().padStart(t,`0`)}e.toDigits=u;function d(e,t=new Date){return e.replace(`yyyy`,t.getFullYear().toString()).replace(`yy`,t.getFullYear().toString().slice(2)).replace(`MM`,u(t.getMonth()+1)).replace(`dd`,u(t.getDate())).replace(`hh`,u(t.getHours())).replace(`mm`,u(t.getMinutes())).replace(`ss`,u(t.getSeconds())).replace(`SSS`,u(t.getMilliseconds(),3))}e.template=d})(_||={});var v=class{sn=0;map=new Map;weak=new WeakMap;get length(){return this.map.size}push(e){let t=++this.sn;return this.map.set(t,e),this.weak.set(e,t),()=>this.map.delete(t)}delete(e){let t=this.weak.get(e);return t?this.map.delete(t):!1}clear(){let e=[...this.map.values()];return this.map.clear(),e.reverse()}[Symbol.iterator](){return this.map.values()}[Symbol.for(`nodejs.util.inspect.custom`)](){return[...this]}},y={shadow:Symbol.for(`cordis.shadow`),receiver:Symbol.for(`cordis.receiver`),original:Symbol.for(`cordis.original`),metadata:Symbol.for(`cordis.metadata`),initHooks:Symbol.for(`cordis.initHooks`),checkProto:Symbol.for(`cordis.checkProto`),effect:Symbol.for(`cordis.effect`),filter:Symbol.for(`cordis.filter`),isolate:Symbol.for(`cordis.isolate`),intercept:Symbol.for(`cordis.intercept`),init:Symbol.for(`cordis.init`),check:Symbol.for(`cordis.check`),config:Symbol.for(`cordis.config`),invoke:Symbol.for(`cordis.invoke`),extend:Symbol.for(`cordis.extend`),tracker:Symbol.for(`cordis.tracker`),resolveConfig:Symbol.for(`cordis.resolveConfig`)},b=function*(){}.constructor,x=async function*(){}.constructor;function S(e){return!(!e.prototype||e instanceof b||x!==Function&&e instanceof x)}function C(e,t){if(e===Object.prototype)return t;let n=Object.create(C(Object.getPrototypeOf(e),t));for(let t of Reflect.ownKeys(e))Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t));return n}function w(e){return e&&(typeof e==`object`||typeof e==`function`)}function T(e,t){let n=e;for(;n;){let e=Reflect.getOwnPropertyDescriptor(n,t);if(e)return e;n=Object.getPrototypeOf(n)}}function E(e,t){if(!w(t))return t;if(Object.hasOwn(t,y.shadow))return Object.getPrototypeOf(t);let n=t[y.tracker];return n?ne(e,t,n):t}function ee(e,t){return t?new Proxy(e,{get:(e,n,r)=>n in t&&n!==`constructor`?Reflect.get(t,n,r):Reflect.get(e,n,r),set:(e,n,r,i)=>n in t&&n!==`constructor`?Reflect.set(t,n,r,i):Reflect.set(e,n,r,i)}):e}function D(e,t,n){return ee(e,Object.defineProperty(Object.create(null),t,{value:n,writable:!1}))}function O(e,t,n,r){if(!n)return r;let i=Reflect.getOwnPropertyDescriptor(t,n)?.value;return i?D(r,n,e.extend({[y.shadow]:i})):r}function te(e,t,n,r){return new Proxy(t,{apply:(t,i,a)=>(i===n&&(i=r),E(e,Reflect.apply(t,i,a)))})}function ne(e,t,n){e[y.shadow]&&!n.noShadow&&(e=Object.getPrototypeOf(e));let r=new Proxy(t,{get:(t,r,i)=>{if(r===y.original)return t;if(r===n.property)return e;if(typeof r==`symbol`)return Reflect.get(t,r,i);if(n.associate&&e.reflect.props[`${n.associate}.${r}`])return Reflect.get(e,`${n.associate}.${r}`,D(e,y.receiver,i));let a,o,s=T(t,r);s&&`value`in s?o=s.value:(a=O(e,t,n.property,i),o=Reflect.get(t,r,a));let c=o?.[y.tracker];return c?ne(e,o,c):!n.noShadow&&typeof o==`function`?(a??=O(e,t,n.property,i),te(e,o,i,a)):o},set:(t,r,i,a)=>{if(r===y.original||r===n.property)return!1;if(typeof r==`symbol`)return Reflect.set(t,r,i,a);if(n.associate&&e.reflect.props[`${n.associate}.${r}`])return Reflect.set(e,`${n.associate}.${r}`,i,D(e,y.receiver,a));let o=O(e,t,n.property,a);return Reflect.set(t,r,i,o)},apply:(e,t,n)=>re(r,e,t,n)});return r}function re(e,t,n,r){return t[y.invoke]?t[y.invoke].apply(e,r):Reflect.apply(t,n,r)}function ie(e,t,n){let r=function(...e){return re(ne(r.ctx,r,n),r,this,e)};return l(r,`name`,e),Object.setPrototypeOf(r,t)}function ae(e,t,n){let r=e.error.stack.split(`
|
|
2
|
+
`);if(typeof t?.stack!=`string`){let e=Error(t),r=e.stack.split(`
|
|
3
|
+
`);throw r.splice(1,1/0,...n()),e.stack=r.join(`
|
|
4
|
+
`),e}let i=t.stack.split(`
|
|
5
|
+
`),a=i.indexOf(r[2]);if(a===-1)throw t;for(a-=e.offset;a>0&&i[a-1].endsWith(` (<anonymous>)`);)--a;throw i.splice(a,1/0,...n()),t.stack=i.join(`
|
|
6
|
+
`),t}function k(e,t=oe()){let n={offset:1,error:Error()};try{let r=e(n);return w(r)&&`then`in r?r.then(void 0,e=>ae(n,e,t)):r}catch(e){ae(n,e,t)}}function oe(e=0){let t=Error();return()=>t.stack.split(`
|
|
7
|
+
`).slice(3+e)}function se(e){return e!==null&&e!==!1&&e!==void 0}var ce=class{ctx;_hooks={};constructor(e){this.ctx=e,l(this,y.tracker,{property:`ctx`,noShadow:!0}),this.on(`internal/listener`,function(e,t,n){if(e===`internal/update`&&!n.global)return(this.fiber._hooks[`internal/update`]??=new v)[n.prepend?`unshift`:`push`](t)}),this.on(`internal/update`,function(e,t,n){let r=[...this._hooks[`internal/update`]||[]],i=()=>(r.shift()??n).call(this,e,t,i);return i()},{global:!0,prepend:!0})}dispatch(e,t){let n=typeof t[0]==`object`||typeof t[0]==`function`?t.shift():null,r=t.shift();r.startsWith(`internal/`)||this.emit(`internal/dispatch`,e,r,t,n);let i=n?.[Ae.filter];return(this._hooks[r]||[]).filter(e=>e.global||!i||i.call(n,e.ctx)).map(e=>e.callback.bind(n))}async parallel(...e){let t=(await Promise.allSettled(this.dispatch(`emit`,e).map(async t=>t(...e)))).filter(e=>e.status===`rejected`);if(t.length)throw AggregateError(t.map(e=>e.reason))}emit(...e){this.dispatch(`emit`,e).map(t=>t(...e))}async serial(...e){for(let t of this.dispatch(`serial`,e)){let n=await t(...e);if(se(n))return n}}bail(...e){for(let t of this.dispatch(`bail`,e)){let n=t(...e);if(se(n))return n}}waterfall(...e){let t=this.dispatch(`waterfall`,e),n=e.pop(),r=()=>(t.shift()??n)(...e);return e.push(r),r()}register(e,t,n,r){let i=r.prepend?`unshift`:`push`;return this.ctx.fiber.effect(()=>(t[i]({ctx:this.ctx,callback:n,...r}),()=>this.unregister(t,n)),e)}unregister(e,t){let n=e.findIndex(e=>e.callback===t);if(n>=0)return e.splice(n,1),!0}on(e,t,n){typeof n!=`object`&&(n={prepend:n}),this.ctx.fiber.assertActive(),t=this.ctx.reflect.bind(t);let r=this.bail(this.ctx,`internal/listener`,e,t,n);if(r)return r;let i=this._hooks[e]||=[],a=`ctx.on(${typeof e==`string`?JSON.stringify(e):e.toString()})`;return this.register(a,i,t,n)}once(e,t,n){let r=this.on(e,function(...e){return r(),t.apply(this,e)},n);return r}},le={s:e=>String(e),d:e=>Math.trunc(Number(e)),i:e=>Math.trunc(Number(e)),f:e=>Number(e),o:e=>JSON.stringify(e),O:e=>JSON.stringify(e),c:()=>``,C:(e,t,n)=>de.color(t,de.code(n.name,t.colors),e)};function ue(e){return e instanceof Error&&Array.isArray(e.errors)}var de=class{service;static color(e,t,n,r=``){return e.colors?`\u001b[3${t<8?t:`8;5;`+t}${e.colors>=2?r:``}m${n}\u001b[0m`:``+n}static code(e,t){let n=0;for(let t=0;t<e.length;t++)n=(n<<3)-n+e.charCodeAt(t)+13,n|=0;let r=t?t>=2?pe:fe:[];return r[Math.abs(n)%r.length]}static format(e,t){let n=t.args.slice();n[0]instanceof Error?(n[0]=n[0].stack||n[0].message,n.unshift(`%s`)):typeof n[0]!=`string`&&n.unshift(`%o`);let r=n.shift();r=r.replace(/%([a-zA-Z%])/g,(r,i)=>{if(r===`%%`)return`%`;let a=e.formatters?.[i]??le[i];return typeof a==`function`?a(n.shift(),e,t):r});let i=e.formatters?.o??le.o;for(let a of n)typeof a==`object`&&a&&(a=i(a,e,t)),r+=` `+a;let{maxLength:a=10240}=e;return r.split(/\r?\n/g).map(e=>e.slice(0,a)+(e.length>a?`...`:``)).join(`
|
|
8
|
+
`)}constructor(e,t){this.service=t,Object.assign(this,e),this.error=this._method(`error`,0),this.info=this._method(`info`,1),this.warn=this._method(`warn`,2),this.debug=this._method(`debug`,3)}_method(e,t){return(...n)=>{if(n.length===1&&n[0]instanceof Error){if(n[0].cause)this[e](n[0].cause);else if(ue(n[0])){n[0].errors.forEach(t=>this[e](t));return}}let r=++this.service._snMessage,i=Date.now();for(let a of this.service.exporters.values()){if((a.levels?.[this.name]??a.levels?.default??this.level??1)<t)continue;let o={sn:r,ts:i,type:e,level:t,name:this.name,...this.meta,args:n};a.export(o)}}}},fe=[6,2,3,4,5,1],pe=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221],me=class e{bufferSize=1e3;buffer=[];ctx;_snMessage=0;_snExporter=0;exporters=new Map;constructor(e){let t={property:`ctx`,noShadow:!0},n=ie(`logger`,C(Object.getPrototypeOf(this),Function.prototype),t);return Object.assign(n,this),n.ctx=e,l(n,y.tracker,t),n.exporter({colors:3,export:e=>{n.buffer.push(e),n.buffer.length>n.bufferSize&&(n.buffer=n.buffer.slice(-n.bufferSize))}}),n}exporter(e){return this.ctx.effect(()=>(this.exporters.set(++this._snExporter,e),()=>this.exporters.delete(this._snExporter)),`ctx.logger.exporter()`)}_resolveConfig(){let e=this.ctx[y.intercept],t=[];for(;`logger`in e;)Object.hasOwn(e,`logger`)&&t.unshift(e.logger),e=Object.getPrototypeOf(e);return Object.assign({},...t)}[y.invoke](e){let t=this._resolveConfig(),n=(this.ctx[y.shadow]??this.ctx).fiber;return e??=t.name,e??=g(n.name),new de({name:e,level:t.level,meta:{fiber:new WeakRef(n)}},this)}static{for(let t of[`error`,`info`,`warn`,`debug`])e.prototype[t]=function(...e){return this()[t](...e)}}};function he(e){let t=e.stack.split(`
|
|
9
|
+
`);return t.splice(0,2,`Error: ${e.message}`),e.stack=t.join(`
|
|
10
|
+
`),e}var ge=[`prototype`,`then`];function _e(e){return typeof e==`symbol`||ge.includes(e)||parseInt(e).toString()===e||e.startsWith(`_`)}var ve=class{ctx;static handler={get:(e,t,n)=>{if(_e(t))return Reflect.get(e,t,n);if(Reflect.has(e,t))return E(n,Reflect.get(e,t,n));let r=Error(`cannot get property "${t}" without inject`);try{let i=e.reflect.props[t];return i?.type===`accessor`?i.get.call(n,n[y.receiver],r):n.fiber.runtime?n.events.waterfall(`internal/get`,n,t,r,()=>{let i=e[y.isolate][t],a=(n[y.shadow]??n).fiber;for(;;){let e=a.store?.[t];if(e)return E(n,e.value);if(t in a.inject)throw r.message=`cannot get required service "${t}" in inactive context`,r;if(!a.runtime||a.parent[y.isolate][t]!==i)throw r;a=a.parent.fiber}}):n.reflect.get(t,!1)}catch(e){throw e===r?he(e):e}},set:(e,t,n,r)=>{if(_e(t))return Reflect.set(e,t,n,r);let i=Error(`cannot set property "${t}" without provide`),a=e.reflect.props[t];if(!a){if(!r.fiber.runtime)return Reflect.set(e,t,n,r);throw he(i)}try{return a.type===`accessor`?a.set?a.set.call(r,n,r[y.receiver],i):!1:r.events.waterfall(`internal/set`,r,t,n,i,()=>r.reflect.set(t,n,i))}catch(e){throw e===i?he(e):e}},has:(e,t)=>_e(t)?Reflect.has(e,t):Reflect.has(e,t)?!0:!!e.reflect.props[t]};store=Object.create(null);props=Object.create(null);constructor(e){this.ctx=e,l(this,y.tracker,{property:`ctx`,noShadow:!0}),this.mixin(`reflect`,[`get`,`set`,`provide`,`accessor`,`mixin`]),this.mixin(`fiber`,[`runtime`,`effect`]),this.mixin(`registry`,[`inject`,`plugin`]),this.mixin(`events`,[`on`,`once`,`parallel`,`emit`,`serial`,`bail`,`waterfall`])}get(e,t=!0){return E(this.ctx,this._getImpl(e,t)?.value)}_getImpl(e,t=!0){let n=this.ctx[y.isolate][e],r=n&&this.store[n];if(r&&!(t&&r.fiber.state!==2))return r}set(e,t,n){let r=this.ctx[y.isolate][e],i=this.store[r];if(!i)throw Error(`cannot set property "${e}" without provide`);if(i.fiber!==this.ctx.fiber)throw Error(`cannot set property "${e}" in multiple fibers`);return i.value=t,!0}provide(e,t,n){return this.ctx.fiber.effect(()=>{if(!this.props[e])this.props[e]??={type:`service`};else if(this.props[e].type!==`service`)throw Error(`property "${e}" is already declared as ${this.props[e].type}`);this.props[e]={type:`service`},this.ctx.root[y.isolate][e]??=Symbol(e);let r=this.ctx[y.isolate][e],i={name:e,value:t,fiber:this.ctx.fiber,check:n};if(this.store[r])throw Error(`service "${e}" has been registered at <${this.store[r].fiber.name}>`);return this.store[r]=i,this.ctx.fiber.store[e]=i,this.ctx.fiber.state===2&&this.notify([e]),async()=>{delete this.store[r];let t=this.notify([e]);await Promise.allSettled(t.map(e=>e.await())),delete this.ctx.fiber.store[e]}},`ctx.provide(${JSON.stringify(e)})`)}notify(e,t=(e,t)=>e[y.isolate][t]===this.ctx[y.isolate][t]){let n=[];for(let r of this.ctx.registry.values())for(let i of r.fibers){let r=!1;for(let n of e)n in i.inject&&t(i.ctx,n)&&(r=!0,i._checkImpl(n));r&&(i._refresh(),n.push(i))}for(let n of e){let e=Object.create(this.ctx);e[y.filter]=e=>t(e,n),this.ctx.events.emit(e,`internal/service`,n,this._getImpl(n,!1)?.value)}return n}accessor(e,t){return this.ctx.fiber.effect(()=>{if(e in this.props)throw Error(`property "${e}" is already declared as ${this.props[e].type}`);return this.props[e]={type:`accessor`,...t},()=>delete this.props[e]},`ctx.accessor(${JSON.stringify(e)})`)}mixin(e,t){let n=this;return this.ctx.fiber.effect(function*(){let r=Array.isArray(t)?t.map(e=>[e,e]):Object.entries(t),i=(t,n)=>t[e];for(let[e,t]of r)yield n.accessor(t,{get(t,n){let r=i(this,n);if(c(r))return r;let a=t?ee(t,r):r,o=Reflect.get(r,e,a);return typeof o==`function`?o.bind(a??r):o},set(t,n,r){let a=i(this,r),o=n?ee(n,a):a;return Reflect.set(a,e,t,o)}})},`ctx.mixin(${JSON.stringify(e)})`)}trace(e){return E(this.ctx,e)}bind(e){return new Proxy(e,{apply:(e,t,n)=>Reflect.apply(e,this.trace(t),n.map(e=>this.trace(e))),construct:(e,t,n)=>Reflect.construct(e,t.map(e=>this.trace(e)),n)})}},ye=Symbol.for(`ValidationError`),A=class extends TypeError{name=`ValidationError`;constructor(e){super(`invalid config:
|
|
11
|
+
`+e.map(e=>e.path?` - ${e.message} (at ${e.path.join(`.`)})`:` - ${e.message}`).join(`
|
|
12
|
+
`))}};Object.defineProperty(A.prototype,ye,{value:!0});function be(e,t){if(!e.Config)return t;let n=e.Config[`~standard`].validate(t);if(`then`in n)throw TypeError(`Async config validation is not supported`);if(n.issues)throw new A(n.issues);return n.value}var xe=new WeakMap;function Se(e){let t=e();return xe.get(e)?.()??t}function Ce(e,t){let n=[`internal/plugin`,t],r;try{r=e.events.dispatch(`emit`,n)}catch(t){e.logger.error(t);return}for(let t of r)try{let r=t(...n);Promise.resolve(r).catch(t=>e.logger.error(t))}catch(t){e.logger.error(t)}}var we=class e extends Error{code;constructor(t,n){super(n??e.Code[t]),this.code=t}};(function(e){e.Code={INACTIVE_EFFECT:`cannot create effect on inactive context`}})(we||={});var Te=`__INACTIVE__`,Ee=class{parent;inject;runtime;uid;ctx;config;_config;state=0;dispose;store;inertia;_hooks=Object.create(null);_disposables=new v;context;_error;_runner;_store=Object.create(null);constructor(e,t,n,r,i){this.parent=e,this.inject=n,this.runtime=r,this._config=t;let a=e=>{this._disposables.push(e)};if(r){this.uid=e.registry.counter,this.ctx=this.context=e.extend({fiber:this});let t=Object.entries(this.inject);if(t.length){this.ctx[Ae.intercept]=Object.create(e[Ae.intercept]);for(let[e,n]of t)c(n)||(this.ctx[Ae.intercept][e]=n)}this._runner={epoch:Te,getOuterStack:i,execute:function(){if(S(r.callback)){let e=new r.callback(this.ctx,this.config);for(let t of e?.[y.initHooks]??[])t();return e?.[y.init]?.()}return r.callback(this.ctx,this.config)},collect:a},this.dispose=e.fiber.effect(()=>{let e=r.fibers.push(this);return async()=>{for(this.uid=null,Ce(this.context,this),this.ctx.registry.has(r.callback)&&(e(),r.fibers.length||this.ctx.registry.delete(r.callback)),this._setEpoch(Te),this.inertia||this._updateState(()=>(this.inertia=this._unload(),5));this.inertia;)await this.inertia}},`ctx.plugin()`);try{this.context.emit(`internal/plugin`,this)}catch(e){throw Promise.resolve(this.dispose()).catch(e=>this.ctx.logger.error(e)),e}if(this.uid!==null&&e.fiber.state!==5){for(let e of Object.keys(this.inject))this._checkImpl(e);this._refresh()}}else this.uid=0,this.ctx=this.context=e,this.state=2,this.store=Object.create(null),this._runner={epoch:``,getOuterStack:i,execute:()=>{},collect:a},this.dispose=()=>this.restart()}get name(){let e=this;do{if(e.runtime?.name)return e.runtime.name;e=e.parent.fiber}while(e!==e.parent.fiber);return`root`}assertActive(){if(this.uid===null)throw new we(`INACTIVE_EFFECT`)}_execute(e){let t=e.epoch;return k(n=>{let r=t=>{if(typeof t==`function`)e.collect(t);else if(!c(t))throw TypeError(`Invalid effect`)},i=e.execute.call(this);if(typeof i==`function`)return e.collect(i);if(!c(i)){if(!w(i))throw TypeError(`Invalid effect`);if(`then`in i)return i.then(r);if(Symbol.iterator in i){n.error=Error();let e=i[Symbol.iterator]();for(;;){let t=e.next();if(r(t.value),t.done)return}}else if(Symbol.asyncIterator in i){let a=i[Symbol.asyncIterator]();return(async()=>{for(await Promise.resolve(),n.error=Error();;){if(e.epoch!==t)return;let n=await a.next();if(r(n.value),n.done)return}})()}else throw TypeError(`Invalid effect`)}},e.getOuterStack)}effect(e,t=`anonymous`){if(this.assertActive(),this.state===5)throw new we(`INACTIVE_EFFECT`);let n=[],r=!1,i,a=()=>{if(r)return i;r=!0;let e;for(let t of n.splice(0).reverse())if(e)e=e.then(()=>Se(t));else{let n=Se(t);w(n)&&`then`in n&&(e=n)}return i=e},o={label:t,children:[]},s={execute:e,epoch:!0,collect:e=>{n.push(e),this._disposables.delete(e),e[y.effect]&&o.children.push(e[y.effect])},getOuterStack:oe()},c,u=!0,d,f,p,m=!1,h,g=()=>!1,_=()=>(p??=new Promise((e,t)=>{d=e,f=t}),p),v=e=>Promise.resolve(e).then(()=>a(),async e=>{throw await a(),e}),b=e=>{let t;try{t=e()}catch(e){throw g(),e}if(w(t)&&`then`in t){let e=Promise.resolve(t).finally(()=>{g(),h===e&&(h=void 0)});return h=e}return g(),t},x=l(()=>s.epoch?(s.epoch=!1,b(()=>u?v(_()):c?v(c):a())):m?h:void 0,y.effect,o);xe.set(x,()=>h),g=this._disposables.push(x);try{c=this._execute(s)}catch(e){u=!1,m=!0,s.epoch=!1;let t;try{t=b(a)}finally{f?.(e)}throw w(t)&&`then`in t&&t.catch(e=>this.ctx.logger.error(e)),e}u=!1,p&&Promise.resolve(c).then(d,f),c?.catch(()=>s.epoch?b(a):a()).catch(e=>this.ctx.logger.error(e));let S=()=>{if(s.epoch)return s.epoch=!1,b(a)};return x.then=async(e,t)=>Promise.resolve(c).then(()=>S).then(e,t),x}getEffects(){return[...this._disposables].map(e=>e[y.effect]).filter(Boolean)}_getState(){return this.uid===null?4:this._error?3:this._runner.epoch===Te?0:2}_updateState(e){let t=this.state;if(this.state=e()??this._getState(),t!==this.state&&(this.context.emit(`internal/status`,this,t),t===2||this.state===2))for(let e of Reflect.ownKeys(this.ctx.reflect.store)){let t=this.ctx.reflect.store[e];t.fiber===this&&this.ctx.reflect.notify([t.name])}}_checkImpl(e){let t=this.ctx.reflect._getImpl(e,!0);if(!t)return delete this._store[e];try{if(t.check&&!t.check.call(E(this.ctx,t.value)))return delete this._store[e]}catch(n){return t.fiber.ctx.logger.error(n),delete this._store[e]}this._store[e]=t}_refresh(){let e=!1;e=``;for(let t of Object.keys(this.inject)){let n=this._store[t];if(!n){e=Te;break}e+=`:`+n.fiber.uid}this._setEpoch(e)}_setEpoch(e){let t=this._runner.epoch;e!==t&&(this._runner.epoch=e,!this.inertia&&this._updateState(()=>e!==Te&&t===Te?(this.inertia=this._reload(),1):(this.inertia=this._unload(),5)))}_resolveConfig(e){return e=this.context.waterfall(this,`internal/config`,e,()=>e),this.runtime?be(this.runtime,e):e}async _reload(){this.store={...this._store};let e=this._runner.epoch;try{await Promise.resolve(),this._runner.epoch===e&&(this.config=this._resolveConfig(this._config),await this._execute(this._runner),this._error=void 0)}catch(e){this.ctx.logger.error(e),this._error=e,this._runner.epoch=Te}this._updateState(()=>{if(this._runner.epoch===e)this.inertia=void 0;else return this.inertia=this._unload(),5})}async _unload(){await Promise.all(this._disposables.clear().map(async e=>{try{await k(async t=>{await Promise.resolve(),t.error=Error(),await Se(e)},this._runner.getOuterStack)}catch(e){this.ctx.logger.error(e)}})),this.store=void 0,this._updateState(()=>{if(this._runner.epoch===Te)this.inertia=void 0;else return this.inertia=this._reload(),1})}async await(){for(;this.inertia;)await this.inertia;if(this._error)throw this._error;return this}async restart(){this.assertActive(),this._setEpoch(Te),this._refresh(),await this.await()}update(e,t=!1){if(this.assertActive(),this._config=e,this.state!==2){this._error=void 0,this._setEpoch(Te),this._refresh();return}return e=this._resolveConfig(e),this.context.waterfall(this,`internal/update`,e,t,()=>(this.config=e,this._error=void 0,this.restart()))}};function De(e){return e&&typeof e==`object`&&typeof e.apply==`function`}function Oe(e,t){return function(n,r){if(r.kind===`class`)Object.hasOwn(n,`inject`)||(l(n,`inject`,Object.create(Object.getPrototypeOf(n).inject??null)),l(n.inject,y.checkProto,!0)),n.inject[e]=t;else if(r.kind===`method`){let i=(n[y.metadata]??={}).inject??=Object.create(null);i[e]=t,r.addInitializer(function(){let e=this[y.tracker]?.property;(this[y.initHooks]??=[]).push(()=>{this.ctx.inject(i,t=>n.call(e?ee(this,{[e]:t}):this))})})}else throw Error(`@Inject() can only be used on class or class methods`)}}(function(e){function t(e,n=Object.create(null)){if(!e)return n;if(Array.isArray(e))for(let t of e)n[t]=null;else if(Reflect.has(e,y.checkProto)){Object.assign(n,t(Object.getPrototypeOf(e)));for(let t of Object.keys(e))n[t]=e[t]??null}else for(let t of Object.keys(e))n[t]=e[t]??null;return n}e.resolve=t})(Oe||={});var ke=class{ctx;_counter=0;_internal=new Map;constructor(e){this.ctx=e,l(this,y.tracker,{property:`ctx`,noShadow:!0})}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e){try{if(typeof e==`function`)return e;if(De(e))return e.apply}catch{}}get(e){let t=this.resolve(e);return t&&this._internal.get(t)}has(e){let t=this.resolve(e);return!!t&&this._internal.has(t)}delete(e){let t=this.resolve(e),n=t&&this._internal.get(t);if(n){this._internal.delete(t);for(let e of n.fibers)e.dispose();return n}}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}inject(e,t){return this.plugin({inject:e,apply:t,name:t.name})}plugin(e,t,n=oe()){let r=this.resolve(e);if(!r)throw Error(`invalid plugin, expect function or object with an "apply" method, received `+typeof e);this.ctx.fiber.assertActive();let i=this._internal.get(r);if(!i){let t=e.name;t===`apply`&&(t=void 0),i={name:t,callback:r,fibers:new v,Config:e.Config},this._internal.set(r,i)}let a=new Ee(this.ctx,t,Oe.resolve(e.inject),i,n),o=Object.create(a);return o.then=(e,t)=>a.await().then(e,t),o}},Ae=class e{static effect=y.effect;static filter=y.filter;static isolate=y.isolate;static intercept=y.intercept;static is(t){return!!t?.[e.is]}static{e.is[Symbol.toPrimitive]=()=>Symbol.for(`cordis.is`),e.prototype[e.is]=!0}constructor(){this[y.isolate]=Object.create(null),this[y.intercept]=Object.create(null);let e=new Proxy(this,ve.handler);return this.root=e,this.baseUrl=void 0,this.fiber=new Ee(e,{},Object.create(null),null,()=>[]),this.reflect=new ve(e),this.registry=new ke(e),this.events=new ce(e),this.logger=new me(e),this.fiber._disposables.clear(),e}[Symbol.for(`nodejs.util.inspect.custom`)](){return`Context <${this.fiber.name}>`}extend(e={}){let t=Reflect.getOwnPropertyDescriptor(this,y.shadow)?.value,n=Object.create(E(this,this));for(let t of Reflect.ownKeys(e))Object.defineProperty(n,t,Reflect.getOwnPropertyDescriptor(e,t));return t?Object.assign(Object.create(n),{[y.shadow]:t}):n}isolate(e,t){let n=Object.create(this[y.isolate]);return n[e]=t??Symbol(e),this.extend({[y.isolate]:n})}intercept(e,t){let n=Object.create(this[y.intercept]);return n[e]=t,this.extend({[y.intercept]:n})}};(class e{ctx;static init=y.init;static check=y.check;static config=y.config;static invoke=y.invoke;static extend=y.extend;static tracker=y.tracker;static resolveConfig=y.resolveConfig;name;constructor(e,t){this.ctx=e,t??=this.constructor.provide;let n=this,r={associate:t,property:`ctx`};return n[y.invoke]&&(n=ie(t,C(Object.getPrototypeOf(this),Function.prototype),r)),n.ctx=e,n.name=t,l(n,y.tracker,r),n.ctx.reflect.provide(t,n,this[y.check]),n}[y.filter](e){return e[y.isolate][this.name]===this.ctx[y.isolate][this.name]}[y.extend](t){let n;return n=this[e.invoke]?ie(this.name,this,this[y.tracker]):Object.create(this),Object.assign(n,t)}[y.resolveConfig](e,t){let n=this.ctx[Ae.intercept],r=[];for(;this.name in n;)Object.hasOwn(n,this.name)&&r.unshift(n[this.name]),n=Object.getPrototypeOf(n);return e&&r.unshift(e),t&&r.push(t),this.Config?.merge?this.Config.merge(...r):Object.assign({},...r)}static[Symbol.hasInstance](e){if(!e)return!1;let t=e.constructor;for(;t;){if(t=t.prototype?.constructor,t===this)return!0;t&&=Object.getPrototypeOf(t)}return!1}});var je=n(),j=r();function Me(e,t){return e.filter((e,n)=>t[n]?.status===`rejected`)}function M(e,t){return fetch(e,t).then(async e=>{let t=await e.json();if(!e.ok){let n=typeof t==`object`&&t&&`error`in t&&typeof t.error==`string`?t.error:`Request failed with status ${e.status}`;throw Error(n)}return t})}function Ne(){return{getStatus:()=>M(`/api/status`),getSession:()=>M(`/api/session`),getFiles:async()=>(await M(`/api/files`)).items,listWorkspaces:async()=>(await M(`/api/workspaces`)).items,pickDirectory:async()=>(await M(`/api/workspaces/pick`,{method:`POST`})).path,getFileDiff:e=>M(`/api/files/diff?path=${encodeURIComponent(e)}`),commitFiles:(e,t)=>M(`/api/files/commit`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({paths:e,message:t})}),revertFiles:e=>M(`/api/files/revert`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({paths:e,confirm:!0})}),prompt:e=>M(`/api/prompt`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({prompt:e})}),abort:()=>M(`/api/abort`,{method:`POST`}),createSession:e=>M(`/api/session/new`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e?{cwd:e}:{})}),openSession:e=>M(`/api/session/open`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e})}),listSessions:(e=0,t=50,n=!1)=>M(`/api/sessions?page=${e}&pageSize=${t}&includeArchived=${n}`),renameSession:(e,t)=>M(`/api/session/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,name:t})}),deleteSession:e=>M(`/api/session/delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,confirm:!0})}),setSessionMetadata:(e,t)=>M(`/api/session/metadata`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,...t})}),batchSessions:(e,t)=>M(`/api/sessions/batch`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:e,paths:t,confirm:e===`delete`})}),forkSession:(e,t)=>M(`/api/session/fork`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:e,cwd:t})}),importSession:async(e,t,n)=>{let r=await M(`/api/session/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({content:e,filename:t,cwd:n})});return{sessionId:r.sessionId,sessionFile:r.sessionFile,messages:[],entries:[],events:[]}},exportSession:async e=>{let t=await fetch(`/api/session/export?path=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Export failed with status ${t.status}`);return t.blob()},listModels:async()=>(await M(`/api/models`)).items,listProviders:async()=>(await M(`/api/providers`)).items,testProvider:e=>M(`/api/providers/test`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({provider:e})}),refreshProvider:e=>M(`/api/providers/refresh`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({provider:e})}),addProvider:e=>M(`/api/providers/add`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),listPlugins:async()=>(await M(`/api/plugins`)).items,listPluginPanels:async()=>(await M(`/api/plugin-ui`)).items,togglePlugin:(e,t)=>M(`/api/plugins/toggle`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,enabled:t})}),uninstallPlugin:e=>M(`/api/plugins/uninstall`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e})}),listMarketplace:(e=``,t=``,n=0,r=24,i=``)=>M(`/api/marketplace?q=${encodeURIComponent(e)}&capability=${encodeURIComponent(t)}&category=${encodeURIComponent(i)}&page=${n}&pageSize=${r}&sort=recommended`),installMarketplace:e=>M(`/api/marketplace/install`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e})}),listCommands:async()=>(await M(`/api/commands`)).items,selectModel:(e,t)=>M(`/api/model`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({provider:e,model:t})}),getConfig:()=>M(`/api/config`),updateConfig:e=>M(`/api/config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),updateConfigSource:e=>M(`/api/config/source`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({source:e})}),reloadConfig:()=>M(`/api/config/reload`,{method:`POST`}),subscribeEvents:e=>{if(typeof EventSource>`u`)return()=>{};let t=new EventSource(`/api/events`);return t.onmessage=t=>{try{let n=t.data;typeof n==`string`&&e(JSON.parse(n))}catch{}},()=>t.close()}}}function Pe(e,t){let n=Math.max(0,Math.min(t,e.length)),r=Math.max(e.lastIndexOf(` `,n-1),e.lastIndexOf(`
|
|
13
|
+
`,n-1))+1,i=e.slice(r,n),a=i[0];if(a!==`/`&&a!==`@`)return null;let o=i.slice(1);return/\s/.test(o)?null:{kind:a===`/`?`command`:`file`,query:o,start:r,end:n}}function Fe(e,t,n){return{text:`${e.slice(0,t.start)}${n}${e.slice(t.end)}`,caret:t.start+n.length}}function Ie(e){if(e?.type!==`message_update`||typeof e.assistantMessageEvent!=`object`||e.assistantMessageEvent===null)return;let t=e.assistantMessageEvent;if(t.type===`thinking_delta`)return{assistantMessageEvent:t,delta:typeof t.delta==`string`?t.delta:``}}function Le(e){let t=[];for(let n of e){let e=Ie(n),r=t.at(-1),i=Ie(r);if(e&&r&&i){t[t.length-1]={...r,assistantMessageEvent:{...i.assistantMessageEvent,delta:i.delta+e.delta}};continue}t.push(n)}return t}var Re={gfm:!0,breaks:!0},ze=typeof window>`u`?void 0:i(window);function Be(e){let t=a.parse(e,Re);return typeof t==`string`?ze?.sanitize(t,{USE_PROFILES:{html:!0},ALLOWED_TAGS:[`a`,`blockquote`,`br`,`code`,`del`,`em`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`li`,`ol`,`p`,`pre`,`strong`,`ul`],ALLOWED_ATTR:[`href`,`rel`,`target`],FORBID_ATTR:[`style`,`class`,`id`]})??``:``}function Ve({text:e,onMouseUp:t}){return(0,j.jsx)(`div`,{className:`turn-markdown`,dangerouslySetInnerHTML:{__html:Be(e)},onMouseUp:t})}function He(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.map(e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return``;let t=e;return(t.type===void 0||t.type===`text`)&&typeof t.text==`string`?t.text:``}).join(``):``}function Ue(e){let t=e.content;return Array.isArray(t)?t.map(e=>{if(typeof e!=`object`||!e)return``;let t=e;return t.type===`thinking`&&typeof t.thinking==`string`?t.thinking:``}).filter(Boolean).join(`
|
|
14
|
+
|
|
15
|
+
`):``}function We(e){let t=[];for(let n of e){if(n.role===`toolResult`)continue;let e=n.role===`user`?`user`:n.role===`assistant`?`assistant`:void 0;if(!e)continue;let r=He(n),i=e===`assistant`?Ue(n):``;if(!r&&!i)continue;let a=t.at(-1);e===`assistant`&&a?.role===`assistant`?t[t.length-1]={role:e,text:a.text+r,thinking:a.thinking+i}:t.push({role:e,text:r,thinking:i})}return t}var Ge=`[Pi Harness annotations]`,Ke=`[/Pi Harness annotations]`,qe=`
|
|
16
|
+
|
|
17
|
+
提问:`;function Je(e,t){let n=e.flatMap(e=>[`${e.id}. ${e.quote}`,...e.note===``?[]:[` 批注:${e.note}`]]),r=e.map(e=>`Annotation ${e.id}:`).join(`、`);return`${Ge}\n${n.join(`
|
|
18
|
+
`)}\n${Ke}\n\n请逐条回应 ${r}${qe}${t.trim()}`}function Ye(e){let t=e.lastIndexOf(qe);if(t<0)return{question:e,count:0};let n=e.lastIndexOf(Ge,t),r=e.indexOf(Ke,n);if(n<0||r<n)return{question:e,count:0};let i=e.slice(n+24,r).split(`
|
|
19
|
+
`).filter(e=>/^\d+\.\s+/u.test(e)).length;return{question:e.slice(t+5),count:i}}function Xe(e){return`?page=marketplace&plugin=${encodeURIComponent(e)}`}function Ze(e){if(e.get(`page`)===`marketplace`)return e.get(`plugin`)?.trim()||void 0}function Qe(e){return[{id:``,label:`全部`,count:e.reduce((e,t)=>e+t.count,0)},...e]}function $e(e){return e>=1e4?`${(e/1e4).toFixed(1).replace(/\.0$/,``)} 万`:new Intl.NumberFormat(`zh-CN`).format(e)}function et(e){if(e===void 0)return[];let t=[];return e.downloads30d!==void 0&&t.push({label:`近 30 天下载量`,value:$e(e.downloads30d)}),e.quality!==void 0&&t.push({label:`npm 质量分`,value:String(Math.round(e.quality*100))}),e.updatedAt!==void 0&&Number.isFinite(Date.parse(e.updatedAt))&&t.push({label:`npm 更新时间`,value:e.updatedAt.slice(0,10)}),t}var tt=async e=>{let t=[];for(let n=0;;n+=1){let r=await e.listMarketplace(``,``,n,100);if(t.push(...r.items),!r.hasNext||r.items.length===0||t.length>=r.total)return t}},N=8,nt={limit:10,timeoutMs:15e3,responseBytes:2097152,sourceItems:1e3,resultItems:50,panelItems:20,queryCharacters:120},rt=new Set([`source`,`limit`,`timeoutMs`,`latest`,`inventory`,`limits`]),it=new Set([`source`,`generatedAt`,`total`,`query`,`fetchedAt`,`results`]),at=new Set([`total`,`shown`,`truncated`]),ot=new Set([`responseBytes`,`sourceItems`,`resultItems`,`panelItems`,`queryCharacters`,`timeoutMs`]),st=new Set([`id`,`name`,`fullName`,`description`,`htmlUrl`,`homepage`,`npmName`,`stars`,`updatedAt`,`license`,`topics`]),ct=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function lt(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function P(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function ut(e,t){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let n=Object.getOwnPropertyDescriptors(e),r=n.length,i=r!==void 0&&`value`in r?r.value:void 0;if(!Number.isSafeInteger(i)||i<0||i>t||Reflect.ownKeys(n).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)||Number(e)>=i||String(Number(e))!==e))||Object.values(n).some(e=>!(`value`in e)))return;let a=[];for(let e=0;e<i;e+=1){let t=n[String(e)];if(t===void 0||!(`value`in t))return;a.push(t.value)}return a}catch{return}}function dt(e,t,n=!0){if(!(typeof e!=`string`||!n&&e.length===0||ct.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function F(e,t,n){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=t&&e<=n?e:void 0}function ft(e){let t=lt(e,st);if(t===void 0)return;let n=dt(t.fullName,512,!1),r=dt(t.name,256,!1),i=dt(t.htmlUrl,4096,!1),a=dt(t.updatedAt,64),o=F(t.stars,0,2**53-1);if(n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||!/^[^/\s]+\/[^/\s]+$/u.test(n))return;let s;try{s=new URL(i)}catch{return}if(s.protocol===`https:`&&s.hostname.toLowerCase()===`github.com`&&s.username===``&&s.password===``&&s.port===``&&s.search===``&&s.hash===``&&s.pathname.replace(/\/$/u,``).toLowerCase()===`/${n}`.toLowerCase())return{fullName:n,name:r,stars:o,htmlUrl:s.toString(),updatedAt:a}}function pt(e,t){let n=Math.max(0,Math.min(50,Math.trunc(t)));return e.slice(0,64).map(ft).filter(e=>e!==void 0).sort((e,t)=>t.stars-e.stars||e.fullName.localeCompare(t.fullName)).slice(0,n).map((e,t)=>({...e,rank:t+1}))}function mt(e){let t=lt(e,ot);if(t===void 0||!P(t,ot))return;let n=F(t.responseBytes,1,nt.responseBytes),r=F(t.sourceItems,1,nt.sourceItems),i=F(t.resultItems,1,nt.resultItems),a=F(t.panelItems,1,nt.panelItems),o=F(t.queryCharacters,1,nt.queryCharacters),s=F(t.timeoutMs,1e3,6e4);return n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||s===void 0?void 0:{responseBytes:n,sourceItems:r,resultItems:i,panelItems:a,queryCharacters:o,timeoutMs:s}}function ht(){return{source:``,limit:nt.limit,timeoutMs:nt.timeoutMs,latest:null,inventory:{total:0,shown:0,truncated:!1},limits:nt,malformed:!0}}function gt(e){let t=lt(e,rt);if(t===void 0||!P(t,rt))return ht();let n=dt(t.source,2048,!1),r=F(t.limit,1,50),i=F(t.timeoutMs,1e3,6e4),a=mt(t.limits),o=lt(t.inventory,at);if(n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||!P(o,at))return ht();let s=F(o.total,0,a.sourceItems),c=F(o.shown,0,a.panelItems);if(s===void 0||c===void 0||typeof o.truncated!=`boolean`)return ht();let l=t.latest,u=null;if(l!==null){let e=lt(l,it);if(e===void 0||!P(e,it))return ht();let t=dt(e.source,256,!1),n=dt(e.generatedAt,64,!1),r=dt(e.query,a.queryCharacters),i=dt(e.fetchedAt,64,!1),o=F(e.total,0,a.sourceItems),s=ut(e.results,a.panelItems);if(t===void 0||n===void 0||r===void 0||i===void 0||o===void 0||s===void 0)return ht();let c=[];for(let e of s){let t=ft(e);if(t===void 0)return ht();c.push(t)}u={source:t,generatedAt:n,total:o,query:r,fetchedAt:i,results:pt(c,N)}}let d=u?.results??[];return c!==d.length||s<c||u===null&&(s!==0||c!==0)||u!==null&&u.total<d.length?ht():{source:n,limit:r,timeoutMs:i,latest:u,inventory:{total:s,shown:d.length,truncated:o.truncated||s>d.length},limits:a,malformed:!1}}function I(e){if(!(typeof e!=`object`||!e||Array.isArray(e)))try{let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(t===void 0||!(`value`in t))return;r[e]=vt(t)}return r}catch{return}}function _t(e,t=2**53-1){if(Array.isArray(e))try{let n=Object.getPrototypeOf(e);if(n!==Array.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e),i=r.length,a=vt(i);if(typeof a!=`number`||!Number.isSafeInteger(a)||a<0)return;let o=a;if(o>t)return Array.from({length:t},(e,t)=>vt(r[String(t)]));if(Reflect.ownKeys(r).some(e=>e!==`length`&&(typeof e!=`string`||!/^(?:0|[1-9]\d*)$/u.test(e))))return;let s=[];for(let e=0;e<o;e+=1){let t=r[String(e)];if(t===void 0||!(`value`in t))return;s.push(vt(t))}return s}catch{return}}function vt(e){return e!==void 0&&`value`in e?e.value:void 0}var yt={reasonCharacters:1e3,errorCharacters:2e3},bt=new Set([`idle`,`queued`,`running`,`reloaded`,`failed`,`cancelled`]);function xt(e,t){return typeof e==`string`?e.slice(0,t):``}function St(e,t){let n=xt(e,t);return n===``?null:n}function Ct(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function wt(e){let t=I(e)??{},n=I(t.limits)??{},r={reasonCharacters:Ct(n.reasonCharacters,yt.reasonCharacters),errorCharacters:Ct(n.errorCharacters,yt.errorCharacters)},i=typeof t.status==`string`&&bt.has(t.status)?t.status:`idle`;return{status:i,reason:xt(t.reason,r.reasonCharacters),requestedAt:St(t.requestedAt,64),startedAt:St(t.startedAt,64),reloadedAt:St(t.reloadedAt,64),error:St(t.error,r.errorCharacters),busy:i===`queued`||i===`running`,limits:r}}var Tt={fileBytes:262144,pathCharacters:512,pathBytes:512};function Et(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function Dt(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function Ot(e){if(typeof e!=`string`)return{value:void 0,altered:!0};let t=e.replaceAll(/[\p{Cc}\p{Cf}\p{Cs}]+/gu,` `).trim(),n=[...t],r=n.length>Tt.pathCharacters?n.slice(0,Tt.pathCharacters).join(``):t;return r===``||new TextEncoder().encode(r).byteLength>Tt.pathBytes?{value:void 0,altered:!0}:{value:r,altered:r!==e}}function kt(e){let t=Et(e),n=t?.lastFile===null?null:Et(t?.lastFile),r=n===null?void 0:Ot(n?.path),i=n===null?void 0:n?.bytes,a=n===null||n!==void 0&&r?.value!==void 0&&typeof i==`number`&&Number.isSafeInteger(i)&&i>=0&&i<=Tt.fileBytes&&Dt(n,[`path`,`bytes`]);return{lastFile:a&&n!==null&&r?.value!==void 0&&typeof i==`number`?{path:r.value,bytes:i}:null,maxBytes:Tt.fileBytes,truncated:t===void 0||!Dt(t,[`lastFile`,`maxBytes`])||t.maxBytes!==Tt.fileBytes||!a||r?.altered===!0}}var At=[`test`,`build`,`format:check`,`lint`,`typecheck`],jt=12288,Mt=12e4,Nt=100,Pt=6e5,Ft=61e4;function It(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function Lt(e,t){let n=Object.keys(e),r=new Set(t);return n.length===t.length&&n.every(e=>r.has(e))}function Rt(e,t,n){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=t&&e<=n}function zt(e){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return!1;let t=Object.getOwnPropertyDescriptors(e),n=Reflect.ownKeys(t);if(n.length!==At.length+1||n.some(e=>typeof e!=`string`))return!1;let r=Object.getOwnPropertyDescriptor(e,`length`);return r===void 0||!(`value`in r)||r.value!==At.length?!1:At.every((e,n)=>{let r=t[String(n)];return r!==void 0&&`value`in r&&r.value===e})}catch{return!1}}function Bt(e){let t=``;for(let n of e){let e=n.codePointAt(0),r=e===9||e===10||e>=32&&e!==127&&(e<128||e>159)&&!/[\p{Cf}\p{Cs}]/u.test(n);t+=r?n:`�`}return t}function Vt(e){if(typeof e!=`string`)return{value:void 0,altered:!0};let t=e.slice(0,24577),n=Bt(t.replaceAll(/\r\n?/gu,`
|
|
20
|
+
`)),r=0,i=``;for(let e of n){let t=new TextEncoder().encode(e).byteLength;if(r+t>jt)break;r+=t,i+=e}return{value:i,altered:t.length!==e.length||i!==e}}function Ht(e){return e===null?null:typeof e==`string`&&/^SIG[A-Z0-9]{1,24}$/u.test(e)?e:void 0}function Ut(e){if(e===null)return{value:null,altered:!1};let t=It(e);if(t===void 0||!Lt(t,[`script`,`command`,`status`,`exitCode`,`signal`,`durationMs`,`output`,`outputBytes`,`outputTruncated`,`outputSanitized`]))return{value:null,altered:!0};let n=t.script,r=t.status,i=t.exitCode,a=Ht(t.signal),o=Vt(t.output);if(typeof n!=`string`||!At.includes(n)||t.command!==`npm run ${n}`||r!==`passed`&&r!==`failed`&&r!==`timed-out`&&r!==`cancelled`||!Rt(t.durationMs,0,Ft)||!Rt(t.outputBytes,0,2**53-1)||typeof t.outputTruncated!=`boolean`||typeof t.outputSanitized!=`boolean`||a===void 0||o.value===void 0)return{value:null,altered:!0};let s=r===`passed`&&i===0&&a===null||r===`failed`&&(i===null||Rt(i,1,255)&&i!==0&&a===null)||(r===`timed-out`||r===`cancelled`)&&i===null,c=new TextEncoder().encode(o.value).byteLength,l=t.outputTruncated?t.outputBytes>=jt:t.outputBytes<=jt&&(t.outputSanitized||t.outputBytes===c);return!s||!l?{value:null,altered:!0}:{value:{script:n,command:t.command,status:r,exitCode:i,signal:a,durationMs:t.durationMs,output:o.value,outputBytes:t.outputBytes,outputTruncated:t.outputTruncated,outputSanitized:t.outputSanitized},altered:o.altered}}function Wt(e){let t=It(e),n=It(t?.limits),r=Rt(n?.timeoutMs,Nt,Pt)?n.timeoutMs:Mt,i=n!==void 0&&Lt(n,[`timeoutMs`,`outputBytes`])&&n.outputBytes===jt,a=zt(t?.allowedScripts),o=Ut(t?.latest);return{allowedScripts:[...At],latest:o.value,limits:{timeoutMs:r,outputBytes:jt},truncated:t===void 0||!Lt(t,[`allowedScripts`,`latest`,`limits`])||!i||!a||o.altered}}var Gt={sessionIdCharacters:512,errorCharacters:2e3},Kt=1e9;function qt(){return{status:`unknown`,requestedAt:null,startedAt:null,finishedAt:null,error:null}}function Jt(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function L(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0}function R(e){let t=e.sessionId,n=Jt(e.tokens),r=L(e.userMessages),i=L(e.assistantMessages),a=L(e.toolCalls),o=L(e.toolResults),s=L(e.totalMessages),c=L(n?.input),l=L(n?.output),u=L(n?.cacheRead),d=L(n?.cacheWrite),f=L(n?.total),p=e.cost;if(typeof t!=`string`||t.length===0||t.length>Gt.sessionIdCharacters||/[\0\p{Cc}]/u.test(t)||n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||s===void 0||!Number.isSafeInteger(r+i+o)||r+i+o>s||c===void 0||l===void 0||u===void 0||d===void 0||f===void 0||!Number.isSafeInteger(c+l+u+d)||f!==c+l+u+d||typeof p!=`number`||!Number.isFinite(p)||p<0||p>Kt)return;let m=null;if(e.contextUsage!==null){let t=Jt(e.contextUsage),n=t?.tokens,r=L(t?.contextWindow),i=t?.percent,a=n===null||L(n)!==void 0,o=i===null||typeof i==`number`&&Number.isFinite(i)&&i>=0,s=n===null==(i===null),c=typeof n==`number`&&r!==void 0&&r>0?n/r*100:null,l=c===null||typeof i==`number`&&Math.abs(i-c)<=Math.max(1e-9,Math.abs(c)*2**-52*8);if(t===void 0||!a||r===void 0||r<=0||!o||!s||!l)return;m={tokens:n,contextWindow:r,percent:i}}return{sessionId:t,userMessages:r,assistantMessages:i,toolCalls:a,toolResults:o,totalMessages:s,tokens:{input:c,output:l,cacheRead:u,cacheWrite:d,total:f},cost:p,contextUsage:m}}function Yt(e){if(typeof e!=`string`||e.length>64)return null;let t=Date.parse(e);if(!Number.isFinite(t))return null;try{return new Date(t).toISOString()===e?e:null}catch{return null}}function Xt(e){let t=e.status,n=Yt(e.requestedAt),r=Yt(e.startedAt),i=Yt(e.finishedAt),a=e.error,o=e.requestedAt!==void 0,s=e.startedAt!==void 0,c=e.finishedAt!==void 0,l=e.error!==void 0,u=n!==null&&(r===null||Date.parse(n)<=Date.parse(r))&&(i===null||Date.parse(r??n)<=Date.parse(i)),d=typeof a==`string`&&a.length>0&&a.length<=Gt.errorCharacters&&!a.includes(`\0`)?a:null;return t===`idle`&&!o&&!s&&!c&&!l?{status:t,requestedAt:null,startedAt:null,finishedAt:null,error:null}:t===`queued`&&o&&!s&&!c&&!l&&u?{status:t,requestedAt:n,startedAt:null,finishedAt:null,error:null}:t===`running`&&o&&s&&!c&&!l&&u?{status:t,requestedAt:n,startedAt:r,finishedAt:null,error:null}:t===`completed`&&o&&s&&c&&!l&&u?{status:t,requestedAt:n,startedAt:r,finishedAt:i,error:null}:(t===`failed`||t===`cancelled`)&&o&&c&&(!s||r!==null)&&u&&d!==null?{status:t,requestedAt:n,startedAt:r,finishedAt:i,error:d}:qt()}function Zt(e){let t=Jt(e);if(t===void 0)return{report:null,compaction:qt(),malformed:!0,limits:{...Gt}};let n=R(t),r=Jt(t.compaction);if(n===void 0||r===void 0)return{report:null,compaction:qt(),malformed:!0,limits:{...Gt}};let i=Xt(r);return{report:n,compaction:i??qt(),malformed:i===void 0||i.status===`unknown`,limits:{...Gt}}}var Qt=20,z={fileBytes:524288,pathCharacters:4096,documents:100,diagnostics:1e3,panelDiagnostics:50,toolDiagnostics:50,diagnosticMessageCharacters:2e3,statusErrorCharacters:2e3},$t=new Set([`empty`,`map`,`seq`,`scalar`]),en=new Set([`idle`,`running`,`completed`,`failed`,`cancelled`]);function tn(e,t){return typeof e==`string`?e.slice(0,t):``}function B(e,t,n,r){return typeof e==`number`&&Number.isInteger(e)&&e>=t&&e<=n?e:r}function nn(e){let t=I(e);if(t===void 0||typeof t.message!=`string`)return;let n=tn(t.code,128),r=B(t.line,1,z.fileBytes,0),i=B(t.column,1,z.fileBytes,0);return{message:t.message.slice(0,z.diagnosticMessageCharacters),...n===``?{}:{code:n},...r===0?{}:{line:r},...i===0?{}:{column:i}}}function rn(e,t){return(_t(e,t+8)??[]).slice(0,t+8).map(nn).filter(e=>e!==void 0).slice(0,t)}function an(e,t,n,r){let i=I(e)??{},a=B(i.total,n,1e6,t);return{total:a,shown:n,truncated:i.truncated===!0||r||a>n}}function on(e){let t=I(e)??{},n=I(t.limits)??{},r={fileBytes:B(n.fileBytes,1,z.fileBytes,z.fileBytes),pathCharacters:B(n.pathCharacters,1,z.pathCharacters,z.pathCharacters),documents:B(n.documents,1,z.documents,z.documents),diagnostics:B(n.diagnostics,1,z.diagnostics,z.diagnostics),panelDiagnostics:B(n.panelDiagnostics,1,z.panelDiagnostics,z.panelDiagnostics),toolDiagnostics:B(n.toolDiagnostics,1,z.toolDiagnostics,z.toolDiagnostics),diagnosticMessageCharacters:B(n.diagnosticMessageCharacters,1,z.diagnosticMessageCharacters,z.diagnosticMessageCharacters),statusErrorCharacters:B(n.statusErrorCharacters,1,z.statusErrorCharacters,z.statusErrorCharacters)},i=I(t.latest),a=_t(i?.errors,z.diagnostics+8)??[],o=rn(a,Qt),s=_t(i?.warnings,z.diagnostics+8)??[],c=rn(s,Math.max(0,Qt-o.length)),l=B(i?.errorCount,o.length,1e6,a.length),u=B(i?.warningCount,c.length,1e6,s.length),d=I(t.inventory)??{},f=I(t.status)??{},p=typeof f.state==`string`&&en.has(f.state)?f.state:`unknown`,m=tn(f.at,64),h=tn(f.error,r.statusErrorCharacters);return{latest:i===void 0?null:{path:tn(i.path,r.pathCharacters),valid:i.valid===!0,bytes:B(i.bytes,0,r.fileBytes,0),documents:B(i.documents,0,r.documents,0),rootType:typeof i.rootType==`string`&&$t.has(i.rootType)?i.rootType:`unknown`,errorCount:l,warningCount:u,diagnosticsTruncated:i.diagnosticsTruncated===!0||l>o.length||u>c.length||a.length>o.length,errors:o,warnings:c},status:{state:p,...m===``?{}:{at:m},...h===``?{}:{error:h}},inventory:{errors:an(d.errors,l,o.length,a.length>o.length),warnings:an(d.warnings,u,c.length,s.length>c.length)},limits:r}}var sn={responseBytes:524288,panelTextChars:12e3,redirects:3,timeoutMs:2e4},cn=new Set([`latest`,`allowPrivate`,`maxResponseBytes`,`maxPanelTextChars`,`maxRedirects`,`timeoutMs`]),V=new Set([`url`,`finalUrl`,`status`,`contentType`,`bytes`,`truncated`,`previewTruncated`,`text`]),ln=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function un(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function dn(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function fn(e,t,n=!1){if(!(typeof e!=`string`||!n&&e.length===0||ln.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function pn(e,t,n){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=t&&e<=n?e:void 0}function mn(e){let t=pn(e.maxResponseBytes,1,sn.responseBytes),n=pn(e.maxPanelTextChars,1,sn.panelTextChars),r=pn(e.maxRedirects,0,10),i=pn(e.timeoutMs,100,6e4);if(t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0)return{responseBytes:t,panelTextChars:n,redirects:r,timeoutMs:i}}function hn(e,t){if(e===null)return null;let n=un(e,V);if(n===void 0||!dn(n,V))return;let r=fn(n.url,4096),i=fn(n.finalUrl,4096),a=fn(n.contentType,256),o=fn(n.text,sn.responseBytes,!0),s=pn(n.status,100,599),c=pn(n.bytes,0,t.responseBytes);if(r===void 0||i===void 0||a===void 0||o===void 0||s===void 0||c===void 0||typeof n.truncated!=`boolean`||typeof n.previewTruncated!=`boolean`)return;let l=[...o].slice(0,t.panelTextChars).join(``);return{url:r,finalUrl:i,status:s,contentType:a,bytes:c,truncated:n.truncated,previewTruncated:n.previewTruncated||o.length>t.panelTextChars,text:l}}function gn(){return{latest:null,allowPrivate:!1,limits:{...sn},malformed:!0}}function _n(e){let t=un(e,cn);if(t===void 0||!dn(t,cn)||typeof t.allowPrivate!=`boolean`)return gn();let n=mn(t);if(n===void 0)return gn();let r=hn(t.latest,n);return r===void 0?gn():{latest:r,allowPrivate:t.allowPrivate,limits:n,malformed:!1}}var vn=8,yn=256,bn={tabs:20,textPreviewCharacters:12e3,errorCharacters:2e3},xn=new Set([`endpoint`,`connected`,`error`,`tabs`,`inventory`,`limits`,`latest`]),Sn=new Set([`targetId`,`title`,`url`]),Cn=new Set([`total`,`shown`,`truncated`]),wn=new Set([`tabs`,`textPreviewCharacters`,`errorCharacters`]),Tn=new Set([`targetId`,`title`,`url`,`status`,`truncated`,`previewTruncated`,`text`,`clicked`,`screenshot`]),En=new Set([`bytes`,`mimeType`]),Dn=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function On(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function kn(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function An(e,t){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let n=Object.getOwnPropertyDescriptors(e),r=n.length,i=r!==void 0&&`value`in r?r.value:void 0;if(!Number.isSafeInteger(i)||i<0||i>t||Reflect.ownKeys(n).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)||Number(e)>=i||String(Number(e))!==e))||Object.values(n).some(e=>!(`value`in e)))return;let a=[];for(let e=0;e<i;e+=1){let t=n[String(e)];if(t===void 0||!(`value`in t))return;a.push(t.value)}return a}catch{return}}function jn(e,t,n=!0){if(!(typeof e!=`string`||!n&&e.length===0||Dn.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function Mn(e,t,n){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=t&&e<=n?e:void 0}function Nn(e,t){return[...e].slice(0,t).join(``)}function Pn(e){let t=On(e,Sn);if(t===void 0||!kn(t,Sn))return;let n=jn(t.targetId,512,!1),r=jn(t.title,4096),i=jn(t.url,8192);return n===void 0||r===void 0||i===void 0?void 0:{targetId:n,title:r,url:i}}function Fn(e){let t=On(e,En);if(t===void 0||!kn(t,En)||t.mimeType!==`image/png`)return;let n=Mn(t.bytes,0,8388608);return n===void 0?void 0:{bytes:n,mimeType:`image/png`}}function In(e){let t=On(e,wn);if(t===void 0||!kn(t,wn))return;let n=Mn(t.tabs,1,bn.tabs),r=Mn(t.textPreviewCharacters,1,bn.textPreviewCharacters),i=Mn(t.errorCharacters,1,bn.errorCharacters);return n===void 0||r===void 0||i===void 0?void 0:{tabs:n,textPreviewCharacters:r,errorCharacters:i}}function Ln(e,t){if(e===null)return null;let n=On(e,Tn);if(n===void 0||![...Object.keys(n)].every(e=>Tn.has(e)))return;let r=jn(n.targetId,512,!1),i=jn(n.title,4096),a=jn(n.url,8192);if(r===void 0||i===void 0||a===void 0||n.status!==void 0&&jn(n.status,64,!1)===void 0||n.truncated!==void 0&&typeof n.truncated!=`boolean`||n.previewTruncated!==void 0&&typeof n.previewTruncated!=`boolean`||n.clicked!==void 0&&typeof n.clicked!=`boolean`)return;let o=n.text===void 0?void 0:jn(n.text,131072,!0);if(n.text!==void 0&&o===void 0)return;let s=n.screenshot===void 0?void 0:Fn(n.screenshot);if(n.screenshot!==void 0&&s===void 0)return;let c=o===void 0?void 0:Nn(o,t.textPreviewCharacters);return{targetId:r,title:Nn(i,4096),url:Nn(a,8192),...n.status===void 0?{}:{status:Nn(n.status,64)},truncated:n.truncated===!0,previewTruncated:n.previewTruncated===!0||o!==void 0&&o.length>t.textPreviewCharacters,...c===void 0?{}:{text:c},clicked:n.clicked===!0,...s===void 0?{}:{screenshot:s}}}function Rn(){return{endpoint:``,connected:!1,error:`Panel data unavailable`,tabs:[],inventory:{total:0,shown:0,truncated:!1},limits:bn,latest:null,malformed:!0}}function zn(e){let t=On(e,xn);if(t===void 0||!kn(t,xn)||typeof t.connected!=`boolean`)return Rn();let n=jn(t.endpoint,2048,!1),r=t.error===null?null:jn(t.error,bn.errorCharacters,!0),i=In(t.limits),a=An(t.tabs,yn),o=On(t.inventory,Cn);if(n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||!kn(o,Cn))return Rn();let s=[];for(let e of a){let t=Pn(e);if(t===void 0)return Rn();s.push(t)}let c=Mn(o.total,s.length,yn),l=Mn(o.shown,0,i.tabs);if(c===void 0||l===void 0||l!==s.length||s.length>i.tabs||typeof o.truncated!=`boolean`||c<l)return Rn();let u=Ln(t.latest,i);if(u===void 0)return Rn();let d=s.slice(0,vn);return{endpoint:n,connected:t.connected,error:r,tabs:d,inventory:{total:c,shown:d.length,truncated:o.truncated||c>l||s.length>d.length},limits:i,latest:u,malformed:!1}}var Bn=12,Vn=255,Hn=2e3,Un=500,H={capsules:256,directoryEntries:4096,displayLimit:20},Wn=new Set([`capsules`,`inventory`,`lastCleanup`,`lastRemoved`,`limits`]),Gn=new Set([`name`,`bytes`]),Kn=new Set([`total`,`shown`,`truncated`,`displayLimit`]),qn=new Set([`status`,`at`,`requestedKeep`,`removed`,`kept`,`error`]),Jn=new Set([`capsules`,`directoryEntries`]),Yn=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function Xn(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function Zn(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function Qn(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function $n(e,t){if(!(typeof e!=`string`||e.length===0||e!==e.trim()||Yn.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function er(e){if(typeof e!=`string`||e.length>64)return;let t=Date.parse(e);if(Number.isFinite(t))try{return new Date(t).toISOString()===e?e:void 0}catch{return}}function tr(e){let t=$n(e,Vn);return t?.endsWith(`.patch`)===!0&&!t.includes(`/`)&&!t.includes(`\\`)?t:void 0}function nr(e){let t=Xn(e,Gn);if(t===void 0||!Zn(t,Gn))return;let n=tr(t.name),r=Qn(t.bytes,2**53-1);return n===void 0||r===void 0?void 0:{name:n,bytes:r}}function rr(e){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let t=Object.getOwnPropertyDescriptor(e,`length`),n=t!==void 0&&`value`in t?t.value:void 0;if(!Number.isSafeInteger(n)||n<0||n>H.displayLimit)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)||Number(e)>=n||String(Number(e))!==e))||Object.values(r).some(e=>!(`value`in e)))return;let i=[];for(let e=0;e<n;e+=1){let t=r[String(e)],n=nr(t!==void 0&&`value`in t?t.value:void 0);if(n===void 0)return;i.push(n)}return new Set(i.map(e=>e.name)).size===i.length?i:void 0}catch{return}}function ir(e,t){let n=Xn(e,Kn);if(n===void 0||!Zn(n,Kn))return;let r=Qn(n.total,H.capsules),i=Qn(n.shown,H.displayLimit);if(!(r===void 0||i===void 0||i!==t||i>r||n.displayLimit!==H.displayLimit||typeof n.truncated!=`boolean`||n.truncated!==r>i))return{total:r,shown:i,truncated:n.truncated,displayLimit:H.displayLimit}}function ar(e){let t=Xn(e,qn);if(t===void 0)return;let n=t.status,r=er(t.at),i=Qn(t.requestedKeep,H.capsules),a=Qn(t.removed,H.capsules);if(n!==`running`&&n!==`completed`&&n!==`failed`&&n!==`cancelled`||r===void 0||i===void 0||a===void 0)return;let o=new Set([`status`,`at`,`requestedKeep`,`removed`]);if(n===`running`&&Zn(t,o))return{status:n,at:r,requestedKeep:i,removed:a,kept:null,error:null};if(n===`completed`&&Zn(t,new Set([...o,`kept`]))){let e=Qn(t.kept,H.capsules);return e===void 0?void 0:{status:n,at:r,requestedKeep:i,removed:a,kept:e,error:null}}if((n===`failed`||n===`cancelled`)&&Zn(t,new Set([...o,`error`]))){let e=$n(t.error,Hn);return e===void 0?void 0:{status:n,at:r,requestedKeep:i,removed:a,kept:null,error:[...e].slice(0,Un).join(``)}}}function or(e){let t=Xn(e,Jn);return t!==void 0&&Zn(t,Jn)&&t.capsules===H.capsules&&t.directoryEntries===H.directoryEntries}function sr(){return{capsules:[],totalBytes:null,inventory:null,lastCleanup:null,malformed:!0,limits:{capsules:H.capsules,directoryEntries:H.directoryEntries}}}function cr(e){let t=Xn(e,Wn);if(t===void 0||!Zn(t,Wn)||!or(t.limits))return sr();let n=rr(t.capsules);if(n===void 0)return sr();let r=ir(t.inventory,n.length),i=Qn(t.lastRemoved,H.capsules);if(r===void 0||i===void 0)return sr();let a=t.lastCleanup===null?null:ar(t.lastCleanup);if(a===void 0||(a===null?i!==0:a.removed!==i))return sr();let o=n.slice(0,Bn),s=o.reduce((e,t)=>e+t.bytes,0);return Number.isSafeInteger(s)?{capsules:o,totalBytes:s,inventory:{total:r.total,shown:o.length,truncated:r.truncated||n.length>o.length,displayLimit:r.displayLimit},lastCleanup:a,malformed:!1,limits:{capsules:H.capsules,directoryEntries:H.directoryEntries}}:sr()}var lr=(e,t)=>{let n=e.trim().toLowerCase();return!n||t.some(e=>e?.toLowerCase().includes(n))};function ur(e){if(e.get(`page`)===`plugins`)return e.get(`plugin`)?.trim()||void 0}function dr(e,t){return t?{packageLabel:`${e.name} · v${t.version}`,description:t.description,tags:[...t.capabilities,...t.hooks.map(e=>`hook:${e}`)]}:{packageLabel:e.name,description:e.enabled?`由当前运行时加载并启用,能力与 hook 已注册。`:`由当前运行时加载但已停用。`,tags:[`loader`,e.state===`active`?`active`:`state:${e.state}`]}}function fr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pr(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0}function mr(e){if(fr(e)&&!(typeof e.sessionId!=`string`||e.sessionId.trim()===``||e.sessionId.length>512||!pr(e.cost)||!pr(e.sessionCost)||!Number.isSafeInteger(e.tokens)||e.tokens<0||!Number.isSafeInteger(e.messages)||e.messages<0||typeof e.recordedAt!=`string`||!Number.isFinite(Date.parse(e.recordedAt))))return{sessionId:e.sessionId,utcDate:new Date(e.recordedAt).toISOString().slice(0,10),dailyCost:e.cost,sessionCost:e.sessionCost,tokens:e.tokens,messages:e.messages}}function hr(e){let t=fr(e)?e:{};return{dayBasis:`UTC`,entryLimit:Number.isSafeInteger(t.entryLimit)&&t.entryLimit>=1&&t.entryLimit<=2e3?t.entryLimit:null,lastError:typeof t.lastError==`string`&&t.lastError.trim()!==``?t.lastError.slice(0,2048):null,entries:(Array.isArray(t.entries)?t.entries.slice(0,20):[]).map(mr).filter(e=>e!==void 0).slice(0,5)}}var U={declarations:2e3,manifestCharacters:1024,itemCharacters:256,conflictConstraints:64,visibleItems:20,visibleConflicts:6,visibleConstraints:8};function gr(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function _r(e,t){try{if(!Array.isArray(e))return;let n=Object.getOwnPropertyDescriptor(e,`length`);if(n===void 0||!(`value`in n)||!Number.isSafeInteger(n.value)||n.value<0)return;let r=Math.min(n.value,t),i=[];for(let t=0;t<r;t+=1){let n=Object.getOwnPropertyDescriptor(e,String(t));if(n===void 0||!(`value`in n))return;i.push(n.value)}return{values:i,altered:n.value>t}}catch{return}}function vr(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function yr(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function br(e,t){if(typeof e!=`string`)return{value:void 0,altered:!0};let n=e.replaceAll(/[\p{Cc}\p{Cf}\p{Cs}]+/gu,` `).trim(),r=[...n],i=r.length>t?r.slice(0,t).join(``):n;return{value:i===``?void 0:i,altered:i!==e}}function xr(e){let t=_r(e,U.declarations);if(t===void 0)return{values:[],altered:!0};let n=[],r=t.altered;for(let e of t.values){let t=br(e,U.itemCharacters);r||=t.altered,t.value===void 0?r=!0:n.push(t.value)}return{values:n,altered:r}}function Sr(e){let t=_r(e,U.declarations);if(t===void 0)return{values:[],altered:!0};let n=[],r=t.altered;for(let e of t.values){let t=gr(e);if(t===void 0){r=!0;continue}let i=br(t.name,U.itemCharacters),a=_r(t.constraints,U.conflictConstraints);if(i.value===void 0||a===void 0){r=!0;continue}let o=[];r||=i.altered||a.altered||!vr(t,[`name`,`constraints`]);for(let e of a.values){let t=br(e,U.itemCharacters);r||=t.altered,t.value===void 0?r=!0:o.push(t.value)}if(o.length===0){r=!0;continue}o.length>U.visibleConstraints&&(r=!0),n.push({name:i.value,constraints:o.slice(0,U.visibleConstraints)})}return{values:n,altered:r}}function Cr(e){return new Set(e).size===e.length}function wr(e){let t=gr(e),n=t===void 0?void 0:gr(t.report),r=n??{},i=br(r.manifest,U.manifestCharacters),a=xr(r.missing),o=xr(r.optionalMissing),s=xr(r.invalid),c=Sr(r.conflicts),l=Sr(r.unresolved),u=yr(r.declared,U.declarations),d=yr(r.installed,U.declarations),f=a.values.length+o.values.length+s.values.length,p=Cr([...a.values,...o.values])&&Cr([...c.values.map(e=>e.name),...l.values.map(e=>e.name)]),m=!1;u!==void 0&&d!==void 0&&d<=u&&c.values.length<=u&&l.values.length<=u&&(r.ecosystem===`npm`?m=d+f===u:r.ecosystem===`python`&&(m=o.values.length===0&&d+a.values.length===u&&u+s.values.length<=U.declarations));let h=a.values.length+o.values.length+(r.ecosystem===`python`?0:s.values.length),g=m&&u!==void 0?u:Math.min(U.declarations,Math.max(h,c.values.length,l.values.length)),_=m&&d!==void 0?d:0,v=t===void 0||n===void 0||!vr(t,[`report`])||!vr(r,[`manifest`,`ecosystem`,`declared`,`installed`,`scanLimit`,`missing`,`optionalMissing`,`invalid`,`conflicts`,`unresolved`]);return{manifest:i.value??`package.json`,ecosystem:r.ecosystem===`python`?`python`:`npm`,declared:g,installed:_,scanLimit:U.declarations,missingCount:a.values.length,optionalMissingCount:o.values.length,invalidCount:s.values.length,conflictCount:c.values.length,unresolvedCount:l.values.length,missing:a.values.slice(0,U.visibleItems),optionalMissing:o.values.slice(0,U.visibleItems),invalid:s.values.slice(0,U.visibleItems),conflicts:c.values.slice(0,U.visibleConflicts),unresolved:l.values.slice(0,U.visibleConflicts),truncated:v||i.altered||r.ecosystem!==`npm`&&r.ecosystem!==`python`||!m||r.scanLimit!==U.declarations||!p||a.altered||o.altered||s.altered||c.altered||l.altered||a.values.length>U.visibleItems||o.values.length>U.visibleItems||s.values.length>U.visibleItems||c.values.length>U.visibleConflicts||l.values.length>U.visibleConflicts}}var Tr={image:`alpine:3.20`,pull:`never`,network:`none`,rootFilesystem:`read-only`,workspace:`read-only`,memory:`512m`,cpus:1,pids:256,timeoutMs:12e4},Er=new Set([`latest`,`defaults`]),Dr=new Set([`image`,`command`,`write`,`exitCode`,`status`,`output`]),Or=new Set(Object.keys(Tr)),kr=128,Ar=4096,jr=16384,Mr=12e3,Nr=16,Pr=256,Fr=4e3,Ir=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function Lr(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function Rr(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function zr(e,t){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let n=Object.getOwnPropertyDescriptors(e),r=n.length,i=r!==void 0&&`value`in r?r.value:void 0;if(!Number.isSafeInteger(i)||i<0||i>t||Reflect.ownKeys(n).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)||Number(e)>=i||String(Number(e))!==e))||Object.values(n).some(e=>!(`value`in e)))return;let a=[];for(let e=0;e<i;e+=1){let t=n[String(e)];if(t===void 0||!(`value`in t))return;a.push(t.value)}return a}catch{return}}function Br(e,t,n=!1,r=!1){if(!(typeof e!=`string`||!n&&e.length===0)){for(let t of e)if(Ir.test(t)&&!(r&&(t===` `||t===`
|
|
21
|
+
`||t===`\r`)))return;if(!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}}function Vr(e,t,n){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=t&&e<=n?e:void 0}function Hr(e,t){return[...e].slice(0,t).join(``)}function Ur(e){let t=Lr(e,Dr);if(t===void 0||!Rr(t,Dr))return;let n=Br(t.image,Ar),r=zr(t.command,kr),i=Br(t.output,Mr,!0,!0),a=Vr(t.exitCode,-2147483648,2147483647);if(n===void 0||r===void 0||r.length===0||i===void 0||a===void 0||typeof t.write!=`boolean`||t.status!==`completed`&&t.status!==`failed`&&t.status!==`timed_out`)return;let o=[];for(let e of r){let t=Br(e,jr);if(t===void 0||t.length===0)return;o.push(t)}return{image:Hr(n,512),command:o.slice(0,Nr).map(e=>Hr(e,Pr)),commandCount:o.length,write:t.write,exitCode:a,status:t.status,output:Hr(i,Fr),truncated:n.length>512||o.length>Nr||o.some(e=>e.length>Pr)||i.length>Fr}}function Wr(e){let t=Lr(e,Or);if(!(t===void 0||!Rr(t,Or))){for(let[e,n]of Object.entries(Tr))if(t[e]!==n)return;return{...Tr}}}function Gr(){return{latest:null,defaults:{...Tr},malformed:!0}}function Kr(e){let t=Lr(e,Er);if(t===void 0||!Rr(t,Er))return Gr();let n=Wr(t.defaults);if(n===void 0)return Gr();if(t.latest===null)return{latest:null,defaults:n,malformed:!1};let r=Ur(t.latest);return r===void 0?Gr():{latest:r,defaults:n,malformed:!1}}var qr=50,Jr=64,Yr=2048;function Xr(e){if(typeof e!=`object`||!e)return!1;try{return!Array.isArray(e)}catch{return!1}}function Zr(e,t){if(!(typeof e!=`object`||!e))try{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}catch{return}}function Qr(e,t){return Xr(e)?Zr(e,t):void 0}function $r(e){try{if(!Array.isArray(e))return}catch{return}let t=Zr(e,`length`);return typeof t==`number`&&Number.isSafeInteger(t)&&t>=0?t:void 0}function ei(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:t}function ti(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:t}function ni(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0&&e<=qr?e:qr}function ri(e){if(!Xr(e))return;let t=Qr(e,`source`),n=Qr(e,`message`);if(typeof t!=`string`||typeof n!=`string`)return;let r=Qr(e,`time`),i=typeof r==`string`&&r.length<=64&&Number.isFinite(Date.parse(r))?new Date(r).toISOString():null,a=(t.trim()||`runtime`).replaceAll(`\0`,`�`),o=(n.trim()||`未知错误`).replaceAll(`\0`,`�`);return{value:{time:i,source:a.slice(0,Jr),message:o.slice(0,Yr),occurrences:ti(Qr(e,`occurrences`),1)},truncated:a.length>Jr||o.length>Yr||t.includes(`\0`)||n.includes(`\0`)}}function ii(e){let t=Xr(e)?e:{},n=Qr(t,`failures`),r=$r(n)??0,i=Math.min(r,qr),a=[],o=r>qr;for(let e=0;e<i;e+=1){let t=ri(Zr(n,String(e)));if(t===void 0){o=!0;continue}a.push(t.value),t.truncated&&(o=!0)}let s=ei(Qr(t,`total`),a.length);return{total:s,observed:Math.max(s,ei(Qr(t,`observed`),s)),dropped:ei(Qr(t,`dropped`),0),capacity:ni(Qr(t,`capacity`)),failures:a,truncated:o}}var W={blocks:12,title:256,label:256,value:4e3,totalText:16384},ai=2e3,oi=new Set([`text`,`badge`,`progress`]),si=new Set([`neutral`,`info`,`success`,`warning`,`danger`]);function ci(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function li(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:t}function ui(e){if(!ci(e)||typeof e.type!=`string`||!oi.has(e.type)||typeof e.label!=`string`||e.label.trim()===``||typeof e.tone!=`string`||!si.has(e.tone))return;let t=e.type,n=e.tone;if(t===`progress`)return typeof e.value!=`number`||!Number.isFinite(e.value)||e.value<0||e.value>100?void 0:{type:t,label:e.label.slice(0,W.label),value:e.value,tone:n};if(typeof e.value==`string`)return{type:t,label:e.label.slice(0,W.label),value:e.value.slice(0,ai),tone:n}}function di(e){if(!ci(e)||typeof e.title!=`string`||e.title.trim()===``||!Array.isArray(e.blocks))return null;let t=e.blocks.slice(0,W.blocks).map(ui).filter(e=>e!==void 0),n=typeof e.renderedAt==`string`&&Number.isFinite(Date.parse(e.renderedAt))?new Date(e.renderedAt).toISOString():null;return{title:e.title.slice(0,W.title),renderedAt:n,blocks:t,truncated:e.title.length>W.title||e.blocks.length>W.blocks||t.length!==Math.min(e.blocks.length,W.blocks)||e.blocks.some(e=>ci(e)&&(typeof e.label==`string`&&e.label.length>W.label||typeof e.value==`string`&&e.value.length>ai))}}function fi(e){let t=ci(e)?e:{},n=ci(t.limits)?t.limits:{};return{rendered:li(t.rendered,0),latest:di(t.latest),limits:{blocks:li(n.blocks,W.blocks)||W.blocks,title:li(n.title,W.title)||W.title,label:li(n.label,W.label)||W.label,value:li(n.value,W.value)||W.value,totalText:li(n.totalText,W.totalText)||W.totalText}}}var G={timeoutMs:15e3,capsuleBytes:8388608,inventory:256,directoryEntries:4096,displayLimit:20},pi=2e3;function mi(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function hi(e,t){try{if(!Array.isArray(e))return;let n=Object.getOwnPropertyDescriptor(e,`length`);if(n===void 0||!(`value`in n)||!Number.isSafeInteger(n.value)||n.value<0)return;let r=Math.min(n.value,t),i=[];for(let t=0;t<r;t+=1){let n=Object.getOwnPropertyDescriptor(e,String(t));if(n===void 0||!(`value`in n))return;i.push(n.value)}return{values:i,altered:n.value>t}}catch{return}}function gi(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:t}function _i(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function vi(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function yi(e){if(typeof e==`string`&&!(e.length===0||e.length>255||e!==e.trim()||new TextEncoder().encode(e).byteLength>255||!e.endsWith(`.patch`)||/[/\\\p{Cc}\p{Cf}\p{Cs}]/u.test(e)))return e}function bi(e){if(typeof e!=`string`)return null;let t=e.replaceAll(/[\p{Cc}\p{Cf}]+/gu,` `).trim().slice(0,pi);return t===``?null:t}function xi(e){if(typeof e==`string`)try{return new Date(e).toISOString()===e?e:void 0}catch{return}}function Si(e){let t=mi(e);if(t===void 0||t.action!==`capture`&&t.action!==`restore`||t.status!==`completed`&&t.status!==`failed`&&t.status!==`cancelled`)return null;let n=xi(t.at);if(n===void 0)return null;let r=t.name===void 0?null:yi(t.name);if(t.name!==void 0&&r===void 0||t.status===`completed`&&r===null)return null;let i=bi(t.error),a=_i(t.bytes,G.capsuleBytes),o=_i(t.files,G.capsuleBytes);return t.status===`completed`&&(a===void 0||a===0||o===void 0||o===0)||t.action===`restore`&&t.status===`completed`&&t.restored!==!0||(t.status===`failed`||t.status===`cancelled`)&&i===null||t.status===`completed`&&i!==null?null:{action:t.action,status:t.status,at:n,name:r??null,bytes:a??0,files:o??0,error:i}}function Ci(e){return e.status===`completed`?vi(e,[`action`,`status`,`at`,`name`,`bytes`,`files`,...e.action===`restore`?[`restored`]:[]]):vi(e,[`action`,`status`,`at`,`error`])}function wi(e){let t=mi(e);if(t===void 0)return;let n=yi(t.name),r=_i(t.bytes,G.capsuleBytes);if(n!==void 0&&r!==void 0&&r!==0)return{name:n,bytes:r}}function Ti(e){let t=mi(e),n=t??{},r=hi(n.capsules,G.displayLimit),i=r?.values??[],a=i.map(e=>{let t=mi(e);return{value:wi(e),contractValid:t!==void 0&&vi(t,[`name`,`bytes`])}}),o=a.map(e=>e.value).filter(e=>e!==void 0),s=mi(n.inventory)??{},c=mi(n.limits)??{},l=mi(n.latest),u=Si(n.latest),d=gi(s.total,o.length),f=gi(s.shown,o.length),p=d>=o.length&&d<=G.inventory&&f===o.length&&s.truncated!==void 0&&typeof s.truncated==`boolean`&&s.displayLimit===G.displayLimit&&vi(s,[`total`,`shown`,`truncated`,`displayLimit`]),m=c.capsuleBytes===G.capsuleBytes&&c.inventory===G.inventory&&c.directoryEntries===G.directoryEntries&&vi(c,[`capsuleBytes`,`inventory`,`directoryEntries`]),h=typeof n.timeoutMs==`number`&&Number.isSafeInteger(n.timeoutMs)&&n.timeoutMs>=100&&n.timeoutMs<=6e4?n.timeoutMs:void 0,g=h!==void 0,_=t===void 0||r===void 0||r.altered||a.some(e=>!e.contractValid)||o.length!==i.length||n.latest!==null&&(l===void 0||u===null||!Ci(l))||typeof l?.error==`string`&&l.error!==u?.error||!p||!m||!g||!vi(n,[`latest`,`capsules`,`inventory`,`timeoutMs`,`limits`]);return{latest:u,capsules:o,inventory:{total:p?d:Math.max(o.length,Math.min(G.inventory,d)),shown:o.length,truncated:s.truncated===!0||_,displayLimit:G.displayLimit},timeoutMs:h??G.timeoutMs,limits:{capsuleBytes:G.capsuleBytes,inventory:G.inventory,directoryEntries:G.directoryEntries},truncated:_}}var Ei=new Set([`USED_SKILL`,`SOLVED_BY`,`REQUIRES`,`PATCHES`,`CONFLICTS_WITH`,`RELATED_TO`]),Di={nodes:2e3,relations:5e3,fileBytes:4194304,searchResults:50},Oi=8;function ki(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ai(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:t}function ji(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0?e:t}function Mi(e,t){return typeof e==`string`&&e.trim()!==``?e.trim().slice(0,t):void 0}function Ni(e){return typeof e==`string`&&Number.isFinite(Date.parse(e))?new Date(e).toISOString():null}function Pi(e){if(!ki(e)||typeof e.id!=`string`||e.kind!==`task`&&e.kind!==`skill`&&e.kind!==`event`)return;let t=Mi(e.label,160),n=Mi(e.summary,2e3);if(t!==void 0&&n!==void 0)return{id:e.id.slice(0,160),kind:e.kind,label:t,summary:n,source:Mi(e.source,512)??null,updatedAt:Ni(e.updatedAt)}}function Fi(e){if(!ki(e)||typeof e.relation!=`string`||!Ei.has(e.relation))return;let t=e.relation,n=Mi(e.fromLabel??e.from,160),r=Mi(e.toLabel??e.to,160);if(n!==void 0&&r!==void 0)return{id:Mi(e.id,160)??`relation`,relation:t,fromLabel:n,toLabel:r,createdAt:Ni(e.createdAt)}}function Ii(e){let t=ki(e)?e:{},n=Array.isArray(t.recent)?t.recent:[],r=n.slice(0,Oi),i=r.map(Pi).filter(e=>e!==void 0),a=Array.isArray(t.recentRelations)?t.recentRelations:[],o=a.slice(0,Oi),s=o.map(Fi).filter(e=>e!==void 0),c=ki(t.kinds)?t.kinds:{},l=ki(t.limits)?t.limits:{},u=ki(t.lastSearch)?t.lastSearch:void 0,d=u!==void 0&&Array.isArray(u.nodes)?Math.min(u.nodes.length,Di.searchResults):0,f=u===void 0?void 0:Mi(u.query,160),p=r.some(e=>ki(e)&&[e.label,e.summary,e.source].some((e,t)=>typeof e==`string`&&e.length>[160,2e3,512][t])),m=n.length>Oi||i.length!==r.length||a.length>Oi||s.length!==o.length||p||u!==void 0&&typeof u.query==`string`&&u.query.length>160||u!==void 0&&Array.isArray(u.nodes)&&u.nodes.length>Di.searchResults;return{nodes:Ai(t.nodes,i.length),relations:Ai(t.relations,s.length),kinds:{task:Ai(c.task,0),skill:Ai(c.skill,0),event:Ai(c.event,0)},recent:i,recentRelations:s,lastSearch:u===void 0||f===void 0?null:{query:f,total:Ai(u.total,d),shown:d},limits:{nodes:ji(l.nodes,Di.nodes),relations:ji(l.relations,Di.relations),fileBytes:ji(l.fileBytes,Di.fileBytes),searchResults:ji(l.searchResults,Di.searchResults)},truncated:m}}var Li=50,Ri=2e3,zi=500,K={fileBytes:4194304,depth:128,keysPerFile:5e4,flattenedKeyLength:2048,pathLength:4096,panelKeysPerSide:100},Bi=new Set([`status`,`report`,`limits`]),Vi=new Set([`state`,`at`,`error`]),Hi=new Set([`base`,`target`,`baseKeys`,`targetKeys`,`missing`,`extra`,`missingTotal`,`extraTotal`,`truncated`]),Ui=new Set(Object.keys(K)),Wi=/[\p{Cc}\p{Cf}\p{Cs}]/u;function Gi(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function Ki(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function qi(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function Ji(e,t,n=!1){if(!(typeof e!=`string`||!n&&e.length===0||e!==e.trim()||Wi.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function Yi(e){if(typeof e!=`string`||e.length>64)return;let t=Date.parse(e);if(Number.isFinite(t))try{return new Date(t).toISOString()===e?e:void 0}catch{return}}function Xi(e){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let t=Object.getOwnPropertyDescriptor(e,`length`),n=t!==void 0&&`value`in t?t.value:void 0;if(!Number.isSafeInteger(n)||n<0||n>K.panelKeysPerSide)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)))||Object.values(r).some(e=>!(`value`in e)))return;let i=[];for(let e=0;e<n;e+=1){let t=r[String(e)],n=Ji(t!==void 0&&`value`in t?t.value:void 0,K.flattenedKeyLength,!0);if(n===void 0)return;i.push(n)}return i}catch{return}}function Zi(e){let t=Gi(e,Vi);if(t===void 0)return;if(t.state===`idle`&&Ki(t,new Set([`state`])))return{state:`idle`,at:null,error:null};if(t.state===`running`&&Ki(t,new Set([`state`])))return{state:`running`,at:null,error:null};let n=Yi(t.at);if(t.state===`completed`&&n!==void 0&&Ki(t,new Set([`state`,`at`])))return{state:`completed`,at:n,error:null};if((t.state===`failed`||t.state===`cancelled`)&&n!==void 0&&Ki(t,Vi)){let e=Ji(t.error,Ri);if(e!==void 0)return{state:t.state,at:n,error:[...e].slice(0,zi).join(``)}}}function Qi(e){let t=Gi(e,Hi);if(t===void 0||!Ki(t,Hi))return;let n=Ji(t.base,K.pathLength),r=Ji(t.target,K.pathLength),i=qi(t.baseKeys,K.keysPerFile),a=qi(t.targetKeys,K.keysPerFile),o=Xi(t.missing),s=Xi(t.extra),c=qi(t.missingTotal,K.keysPerFile),l=qi(t.extraTotal,K.keysPerFile);if(n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||s===void 0||c===void 0||l===void 0||typeof t.truncated!=`boolean`)return;let u=Math.min(c,K.panelKeysPerSide),d=Math.min(l,K.panelKeysPerSide),f=u<c||d<l;if(!(o.length!==u||s.length!==d||t.truncated!==f||c>i||l>a||i-c!==a-l||new Set(o).size!==o.length||new Set(s).size!==s.length||o.some(e=>s.includes(e))))return{base:n,target:r,baseKeys:i,targetKeys:a,missing:o.slice(0,Li),extra:s.slice(0,Li),missingTotal:c,extraTotal:l,truncated:f||o.length>Li||s.length>Li}}function $i(e){let t=Gi(e,Ui);return t!==void 0&&Ki(t,Ui)&&Object.entries(K).every(([e,n])=>t[e]===n)}function ea(){return{status:{state:`unknown`,at:null,error:null},report:null,malformed:!0,limits:{...K}}}function ta(e){let t=Gi(e,Bi);if(t===void 0||!Ki(t,Bi)||!$i(t.limits))return ea();let n=Zi(t.status);if(n===void 0)return ea();let r=t.report===null?null:Qi(t.report);return r===void 0||n.state===`idle`&&r!==null||n.state===`completed`&&r===null?ea():{status:n,report:r,malformed:!1,limits:{...K}}}var na=12,ra=8,ia=8,aa=12,oa={responseBytes:1048576,commandArgs:32,argumentBytes:4096,toolArgumentsBytes:65536,toolArgumentDepth:32,requestTimeoutMs:3e4,panelItems:20,inventoryItems:1e3,paginationPages:100,stderrBytes:8192,managedServers:128},sa=new Set([`running`,`stopping`,`stopped`]);function ca(e,t){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.trunc(e):t}function la(e,t){return typeof e==`number`&&Number.isFinite(e)&&e>=t?Math.trunc(e):t}function ua(e,t){return typeof e==`string`&&e.length>0?e.slice(0,t):void 0}function da(e){let t=I(e);if(t===void 0)return;let n=ua(t.name,512);if(n===void 0)return;let r=ua(t.description,500);return{name:n,...r===void 0?{}:{description:r}}}function fa(e){let t=I(e);if(t===void 0)return;let n=ua(t.uri,4096);if(n===void 0)return;let r=ua(t.name,512),i=ua(t.mimeType,256);return{uri:n,...r===void 0?{}:{name:r},...i===void 0?{}:{mimeType:i}}}function pa(e){let t=I(e);if(t===void 0)return;let n=ua(t.name,512);if(n===void 0)return;let r=ua(t.description,500);return{name:n,...r===void 0?{}:{description:r}}}function ma(e){let t=I(e);if(t===void 0)return;let n=ua(t.id,64);if(n!==void 0)return{id:n,status:typeof t.status==`string`&&sa.has(t.status)?t.status:`unknown`,startedAt:typeof t.startedAt==`number`&&Number.isFinite(t.startedAt)&&t.startedAt>=0?Math.trunc(t.startedAt):0}}function ha(e,t,n){let r=_t(e,t+2)??[],i=r.map(n).filter(e=>e!==void 0).slice(0,t);return{values:i,clipped:r.length>t||r.length!==i.length,rawLength:r.length}}function ga(e,t,n){let r=I(e)??{},i=la(r.total,t);return{total:i,shown:t,truncated:r.truncated===!0||n||i>t}}function _a(e){let t=I(e)??{},n=ha(t.tools,na,da),r=ha(t.resources,ra,fa),i=ha(t.prompts,ia,pa),a=ha(t.servers,aa,ma),o=I(t.inventory)??{},s=I(t.limits)??{};return{server:t.server===null?null:ua(t.server,4096)??null,tools:n.values,resources:r.values,prompts:i.values,lastCall:t.lastCall===null?null:ua(t.lastCall,512)??null,servers:a.values,inventory:{tools:ga(o.tools,n.values.length,n.clipped),resources:ga(o.resources,r.values.length,r.clipped),prompts:ga(o.prompts,i.values.length,i.clipped),servers:ga(o.servers,a.values.length,a.clipped)},limits:{responseBytes:ca(s.responseBytes,oa.responseBytes),commandArgs:ca(s.commandArgs,oa.commandArgs),argumentBytes:ca(s.argumentBytes,oa.argumentBytes),toolArgumentsBytes:ca(s.toolArgumentsBytes,oa.toolArgumentsBytes),toolArgumentDepth:ca(s.toolArgumentDepth,oa.toolArgumentDepth),requestTimeoutMs:ca(s.requestTimeoutMs,oa.requestTimeoutMs),panelItems:ca(s.panelItems,oa.panelItems),inventoryItems:ca(s.inventoryItems,oa.inventoryItems),paginationPages:ca(s.paginationPages,oa.paginationPages),stderrBytes:ca(s.stderrBytes,oa.stderrBytes),managedServers:ca(s.managedServers,oa.managedServers)}}}var va={nameCharacters:128,recoveryEntries:1e4,persistenceErrorCharacters:2e3},ya=new Set([`idle`,`focused`,`happy`,`concerned`]),ba=new Set([`session_start`,`agent_start`,`agent_end`,`tool_execution_end`,`feed`,`play`,`set_mood`]);function xa(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function Sa(e,t=0){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:t}function Ca(e,t){return typeof e==`string`?e.slice(0,t):``}function wa(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function Ta(e){let t=I(e)??{},n=I(t.limits)??{},r={nameCharacters:xa(n.nameCharacters,va.nameCharacters),recoveryEntries:xa(n.recoveryEntries,va.recoveryEntries),persistenceErrorCharacters:xa(n.persistenceErrorCharacters,va.persistenceErrorCharacters)},i=I(t.recovery)??{},a=Sa(i.sessionEntries),o=Math.min(a,r.recoveryEntries,Sa(i.scanned)),s=I(t.persistence)??{},c=Sa(s.attempts),l=Ca(t.name,r.nameCharacters),u=typeof t.mood==`string`&&ya.has(t.mood)?t.mood:`idle`,d=typeof t.lastEvent==`string`&&ba.has(t.lastEvent)?t.lastEvent:`session_start`,f=typeof t.energy==`number`&&Number.isSafeInteger(t.energy)&&t.energy>=0&&t.energy<=100?t.energy:80;return{name:l||`Pi`,mood:u,energy:f,interactions:Sa(t.interactions),lastEvent:d,updatedAt:wa(t.updatedAt),recovery:{sessionEntries:a,scanned:o,truncated:i.truncated===!0||a>o,restored:i.restored===!0},persistence:{attempts:c,failures:Math.min(c,Sa(s.failures)),lastError:Ca(s.lastError,r.persistenceErrorCharacters)||null},limits:r}}var q={directoryEntries:4096,sessionBytes:4194304,sessions:100,allowedSessions:500,readConcurrency:8,contentParts:1e3,previewCharacters:500,panelItems:50,toolItems:100,queryCharacters:120,sessionIdCharacters:256,sessionNameCharacters:256,sessionPathCharacters:4096,statusErrorCharacters:2e3};function Ea(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e,t,n=t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=n?e:t}function Da(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:0}function Oa(e,t,n=``){return typeof e==`string`&&e.replaceAll(`\0`,`�`).slice(0,t)||n}function ka(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function Aa(e,t){if(!Ea(e))return{state:`idle`,at:null,error:null};let n=e.state===`running`||e.state===`completed`||e.state===`failed`||e.state===`cancelled`?e.state:`idle`,r=ka(e.at);return(n===`completed`||n===`failed`||n===`cancelled`)&&r===null?{state:`idle`,at:null,error:null}:{state:n,at:r,error:(n===`failed`||n===`cancelled`)&&Oa(e.error,t)||null}}function ja(e){let t=Ea(e)?e:{},n=Ea(t.limits)?t.limits:{},r=J(n.allowedSessions,q.allowedSessions),i={directoryEntries:J(n.directoryEntries,q.directoryEntries),sessionBytes:J(n.sessionBytes,q.sessionBytes),sessions:J(n.sessions,Math.min(q.sessions,r),r),allowedSessions:r,readConcurrency:J(n.readConcurrency,q.readConcurrency),contentParts:J(n.contentParts,q.contentParts),previewCharacters:J(n.previewCharacters,q.previewCharacters),panelItems:J(n.panelItems,q.panelItems),toolItems:J(n.toolItems,q.toolItems),queryCharacters:J(n.queryCharacters,q.queryCharacters),sessionIdCharacters:J(n.sessionIdCharacters,q.sessionIdCharacters),sessionNameCharacters:J(n.sessionNameCharacters,q.sessionNameCharacters),sessionPathCharacters:J(n.sessionPathCharacters,q.sessionPathCharacters),statusErrorCharacters:J(n.statusErrorCharacters,q.statusErrorCharacters)},a=(Array.isArray(t.items)?t.items:[]).slice(0,i.panelItems).map(e=>{let t=Ea(e)?e:{},n=Oa(t.id,i.sessionIdCharacters,`unknown`);return{id:n,path:Oa(t.path,i.sessionPathCharacters),cwd:Oa(t.cwd,i.sessionPathCharacters),name:Oa(t.name,i.sessionNameCharacters,n),modified:ka(t.modified),messageCount:Da(t.messageCount,i.sessionBytes),message:Oa(t.message,i.previewCharacters)}}),o=Ea(t.inventory)?t.inventory:{};return{scans:Da(t.scans,2**53-1),total:Da(t.total,i.sessions),items:a,status:Aa(t.status,i.statusErrorCharacters),inventory:{available:Da(o.available,i.directoryEntries),candidates:Da(o.candidates,i.directoryEntries),scanned:Da(o.scanned,i.sessions),unread:Da(o.unread,i.sessions),shown:Da(o.shown,i.panelItems),truncated:o.truncated===!0,discoveryTruncated:o.discoveryTruncated===!0,scanTruncated:o.scanTruncated===!0,displayTruncated:o.displayTruncated===!0},limits:i}}var Ma={candidates:50,displayCandidates:8,scannedEntries:4096,contentParts:1e3,previewCharacters:500,entryIdCharacters:200,editorTextCharacters:4096,errorCharacters:2e3};function Y(e,t){if(typeof e!=`object`||!e)return;let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}function Na(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function Pa(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:0}function Fa(e,t,n=``){return typeof e==`string`&&e.slice(0,t).replaceAll(`\0`,`�`)||n}function Ia(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function La(e,t){return{entryId:Fa(Y(e,`entryId`),t.entryIdCharacters,`unknown`),text:Fa(Y(e,`text`),t.previewCharacters,`未命名轮次`)}}function Ra(e,t){let n=Y(e,`entryId`),r=Y(e,`text`);if(typeof n!=`string`||typeof r!=`string`)return;let i={entryId:Fa(n,t.entryIdCharacters),text:Fa(r,t.previewCharacters)};return i.entryId===``||i.text===``?void 0:i}function za(e,t){let n=Y(e,`status`),r=n===`queued`||n===`running`||n===`completed`||n===`failed`||n===`cancelled`?n:void 0;return r===void 0?null:{status:r,target:La(Y(e,`target`),t),cancelled:Y(e,`cancelled`)===!0,summarized:Y(e,`summarized`)===!0,editorText:Fa(Y(e,`editorText`),t.editorTextCharacters)||null,error:(r===`failed`||r===`cancelled`)&&Fa(Y(e,`error`),t.errorCharacters)||null,requestedAt:Ia(Y(e,`requestedAt`)),startedAt:Ia(Y(e,`startedAt`)),finishedAt:Ia(Y(e,`finishedAt`))}}function Ba(e){let t=Y(e,`limits`),n={candidates:Na(Y(t,`candidates`),Ma.candidates),displayCandidates:Ma.displayCandidates,scannedEntries:Na(Y(t,`scannedEntries`),Ma.scannedEntries),contentParts:Na(Y(t,`contentParts`),Ma.contentParts),previewCharacters:Na(Y(t,`previewCharacters`),Ma.previewCharacters),entryIdCharacters:Na(Y(t,`entryIdCharacters`),Ma.entryIdCharacters),editorTextCharacters:Na(Y(t,`editorTextCharacters`),Ma.editorTextCharacters),errorCharacters:Na(Y(t,`errorCharacters`),Ma.errorCharacters)},r=Y(e,`candidates`),i=[];if(Array.isArray(r)){let e=Math.max(0,r.length-Math.min(n.candidates,n.displayCandidates));for(let t=e;t<r.length;t+=1){let e=Object.getOwnPropertyDescriptor(r,String(t));if(e===void 0||!(`value`in e))continue;let a=Ra(e.value,n);a!==void 0&&i.push(a)}}let a=Y(e,`inventory`),o=Array.isArray(r)&&r.length>i.length,s=Y(a,`scanTruncated`)===!0,c=Y(a,`candidateTruncated`)===!0;return{candidates:i,inventory:{scannedEntries:Pa(Y(a,`scannedEntries`),n.scannedEntries),shown:Pa(Y(a,`shown`),n.candidates),truncated:Y(a,`truncated`)===!0||s||c||o,scanTruncated:s,candidateTruncated:c,displayTruncated:o},latest:za(Y(e,`latest`),n),limits:n}}var Va={scannedMessages:1e4,jsonDepth:64,jsonNodesPerMessage:1e4,jsonNodesPerAudit:1e5,errorCharacters:2e3,recommendationCharacters:500,displayRecommendations:4,warnPercent:75,maxMessageBytes:65536,messageCount:4294967295};function X(e,t){if(!(typeof e!=`object`||!e))try{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}catch{return}}function Ha(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function Ua(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:0}function Wa(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:null}function Ga(e,t){return typeof e==`string`?e.slice(0,t).replaceAll(`\0`,`�`):``}function Ka(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function qa(e){let t=X(e,`length`);return typeof t==`number`&&Number.isSafeInteger(t)&&t>=0?t:0}function Ja(e,t){let n=X(e,`status`),r=n===`idle`||n===`queued`||n===`running`||n===`completed`||n===`failed`||n===`cancelled`?n:`unknown`;return{status:r,error:(r===`failed`||r===`cancelled`)&&Ga(X(e,`error`),t)||null,requestedAt:Ka(X(e,`requestedAt`)),startedAt:Ka(X(e,`startedAt`)),finishedAt:Ka(X(e,`finishedAt`))}}function Ya(e){let t=X(e,`limits`),n={scannedMessages:Ha(X(t,`scannedMessages`),Va.scannedMessages),jsonDepth:Ha(X(t,`jsonDepth`),Va.jsonDepth),jsonNodesPerMessage:Ha(X(t,`jsonNodesPerMessage`),Va.jsonNodesPerMessage),jsonNodesPerAudit:Ha(X(t,`jsonNodesPerAudit`),Va.jsonNodesPerAudit),errorCharacters:Ha(X(t,`errorCharacters`),Va.errorCharacters),recommendationCharacters:Va.recommendationCharacters,displayRecommendations:Va.displayRecommendations},r=X(e,`status`),i=r===`ok`||r===`warning`?r:`unknown`,a=X(e,`usagePercent`),o=typeof a==`number`&&Number.isFinite(a)&&a>=0?a:null,s=Ua(X(e,`messageCount`),Va.messageCount),c=Ua(X(e,`scannedMessages`),Math.min(s,n.scannedMessages)),l=Ua(X(e,`oversizedMessages`),c),u=Ua(X(e,`uninspectableMessages`),l),d=Ua(X(e,`toolErrors`),c),f=X(e,`warnPercent`),p=typeof f==`number`&&Number.isFinite(f)&&f>=1&&f<=100?f:Va.warnPercent,m=Ha(X(e,`maxMessageBytes`),1048576),h=m===1048576&&X(e,`maxMessageBytes`)!==1048576?Va.maxMessageBytes:m,g=X(e,`recommendations`),_=[],v=!1;if(Array.isArray(g)){let e=qa(g);for(let t=0;t<Math.min(e,n.displayRecommendations);t+=1){let e=Ga(X(g,String(t)),n.recommendationCharacters);if(e===``){v=!0;continue}_.push(e)}v||=e>_.length}return{status:i,usagePercent:o,tokens:Wa(X(e,`tokens`)),contextWindow:Wa(X(e,`contextWindow`)),messageCount:s,scannedMessages:c,messagesTruncated:X(e,`messagesTruncated`)===!0||s>c,oversizedMessages:l,uninspectableMessages:u,toolErrors:d,warnPercent:p,maxMessageBytes:h,recommendations:_,recommendationsTruncated:v,compaction:Ja(X(e,`compaction`),n.errorCharacters),limits:n}}var Xa={scannedMessages:1e4,retainedEvents:50,displayedEvents:6,eventTypeCharacters:128},Za=4294967295,Qa=864e13;function Z(e,t){if(!(typeof e!=`object`||!e))try{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}catch{return}}function $a(e,t=Za){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:0}function eo(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:null}function to(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:null}function no(e){if(typeof e!=`string`)return`unknown`;let t=e.trim().replaceAll(`\0`,`�`);return t===``?`unknown`:t.slice(0,Xa.eventTypeCharacters)}function ro(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=Qa?e:null}function io(e){return Array.isArray(e)?$a(Z(e,`length`),Za):0}function ao(e,t){let n={user:$a(Z(e,`user`),t),assistant:$a(Z(e,`assistant`),t),toolResult:$a(Z(e,`toolResult`),t),system:$a(Z(e,`system`),t),other:$a(Z(e,`other`),t)};return Object.values(n).reduce((e,t)=>e+t,0)===t?n:{user:0,assistant:0,toolResult:0,system:0,other:t}}function oo(e){let t;try{t=io(e)}catch{return{events:[],truncated:!1}}let n=Math.min(t,Xa.retainedEvents),r=[];for(let i=0;i<Math.min(n,Xa.displayedEvents);i+=1){let n=t-i-1,a=Z(e,String(n));r.push({type:no(Z(a,`type`)),at:ro(Z(a,`at`))})}return{events:r,truncated:t>r.length}}function so(e){let t=$a(Z(e,`messages`)),n=$a(Z(e,`scannedMessages`),Math.min(t,Xa.scannedMessages)),r=oo(Z(e,`recentEvents`));return{tokens:eo(Z(e,`tokens`)),contextWindow:eo(Z(e,`contextWindow`)),percent:to(Z(e,`percent`)),messages:t,scannedMessages:n,messagesTruncated:Z(e,`messagesTruncated`)===!0||t>n,events:$a(Z(e,`events`)),compactions:$a(Z(e,`compactions`)),composition:ao(Z(e,`composition`),n),recentEvents:r.events,recentEventsTruncated:r.truncated,limits:Xa}}var co={maxPercent:90,maxRunTokens:1e7,errorCharacters:2e3,streamingUpdateInterval:32,maxCount:4294967295};function lo(e,t){if(!(typeof e!=`object`||!e))try{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&`value`in n?n.value:void 0}catch{return}}function uo(e,t=co.maxCount){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:null}function fo(e){return typeof e!=`string`||e===``?null:e.replaceAll(`\0`,`�`).slice(0,co.errorCharacters)}function po(e){let t=lo(e,`maxPercent`),n=typeof t==`number`&&Number.isFinite(t)&&t>=1&&t<=100?t:co.maxPercent,r=uo(lo(e,`maxRunTokens`),co.maxRunTokens)??0,i=lo(e,`percent`),a=typeof i==`number`&&Number.isFinite(i)&&i>=0?i:null,o=uo(lo(e,`tokens`)),s=uo(lo(e,`contextWindow`)),c=s!==null&&s>0?s:null,l=uo(lo(e,`runTokens`)),u=r>0&&l!==null&&l>=r;return{maxPercent:n,maxRunTokens:r,percent:a,tokens:o,contextWindow:c,runTokens:l,runExceeded:u,exceeded:a!==null&&a>=n||u,aborts:uo(lo(e,`aborts`))??0,lastError:fo(lo(e,`lastError`)),limits:{maxRunTokens:co.maxRunTokens,errorCharacters:co.errorCharacters,streamingUpdateInterval:co.streamingUpdateInterval}}}var mo={packageBytes:262144,packageCharacters:262144,messages:100,messageCharacters:16e3,totalMessageCharacters:64e3,contentParts:1e3,attachments:100,attachmentMarkerCharacters:256,sessionIdCharacters:256,cwdCharacters:4096,modelFieldCharacters:256,previewTextCharacters:1e3,previewListItems:8,duplicateScanEntries:1e4,operationErrorCharacters:2e3};function ho(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function go(e,t){return typeof e==`string`?e.slice(0,t):``}function _o(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function vo(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:null}function yo(e,t,n){let r=I(e)??{},i=e=>(_t(e,n)??[]).slice(0,n).map(e=>go(e,t)).filter(e=>e!==``);return{goal:go(r.goal,t),currentState:go(r.currentState,t),decisions:i(r.decisions),keyFiles:i(r.keyFiles),nextStep:go(r.nextStep,t)}}function bo(e,t){let n=I(e);if(n===void 0)return null;let r=go(n.sessionId,t.sessionIdCharacters),i=go(n.cwd,t.cwdCharacters);if(r===``||i===``)return null;let a,o=I(n.model);if(o!==void 0){let e=go(o.provider,t.modelFieldCharacters),n=go(o.modelId,t.modelFieldCharacters);e!==``&&n!==``&&(a={provider:e,modelId:n})}return{sessionId:r,cwd:i,...a===void 0?{}:{model:a}}}function xo(e,t){let n=I(e);if(n===void 0)return{state:`idle`,operation:null,at:null,error:null};let r=n.state===`idle`||n.state===`running`||n.state===`completed`||n.state===`failed`||n.state===`cancelled`?n.state:`idle`,i=n.operation===`export`||n.operation===`preview`||n.operation===`import`?n.operation:null,a=_o(n.at);return r!==`idle`&&i===null||(r===`completed`||r===`failed`||r===`cancelled`)&&a===null?{state:`idle`,operation:null,at:null,error:null}:{state:r,operation:i,at:a,error:(r===`failed`||r===`cancelled`)&&go(n.error,t)||null}}function So(e){let t=I(e)??{},n=I(t.limits)??{},r=Object.fromEntries(Object.entries(mo).map(([e,t])=>[e,ho(n[e],t)])),i=I(t.latest),a=i?.direction===`export`||i?.direction===`import`?i.direction:void 0,o=go(i?.sessionId,r.sessionIdCharacters),s=vo(i?.messages,r.messages),c=vo(i?.attachments,r.attachments),l=_o(i?.at),u=a===void 0||o===``||s===null||c===null||l===null?null:{direction:a,sessionId:o,messages:s,attachments:c,at:l},d=I(t.latestPreview),f=d!==void 0&&I(d.preview)!==void 0?d:void 0,p=bo(f?.source,r),m=f===void 0?t.currentPreview:f.preview;return{latest:u,source:f===void 0?null:p,preview:yo(m,r.previewTextCharacters,r.previewListItems),previewAt:f===void 0?null:_o(f.at),status:xo(t.status,r.operationErrorCharacters),formatVersion:1,limits:r}}var Co={queryCharacters:120,skillBytes:131072,skills:50,panelReports:20,nameCharacters:64,sourceCharacters:128,pathCharacters:4096,statusErrorCharacters:2e3,findingsPerSkill:6,findingCodeCharacters:64,findingMessageCharacters:256,score:28};function wo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function To(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=1&&e<=t?e:t}function Eo(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:0}function Do(e,t,n=``){return typeof e==`string`&&e.replaceAll(`\0`,`�`).slice(0,t)||n}function Oo(e){if(typeof e!=`string`||e.length>64)return null;try{return new Date(e).toISOString()===e?e:null}catch{return null}}function ko(e,t){if(!wo(e))return{state:`idle`,at:null,error:null};let n=e.state===`running`||e.state===`completed`||e.state===`failed`||e.state===`cancelled`?e.state:`idle`,r=Oo(e.at);return(n===`completed`||n===`failed`||n===`cancelled`)&&r===null?{state:`idle`,at:null,error:null}:{state:n,at:r,error:(n===`failed`||n===`cancelled`)&&Do(e.error,t)||null}}function Ao(e){let t=wo(e)?e:{},n=wo(t.limits)?t.limits:{},r=Object.fromEntries(Object.entries(Co).map(([e,t])=>[e,To(n[e],t)])),i=(Array.isArray(t.reports)?t.reports:[]).slice(0,r.panelReports).map(e=>{let t=wo(e)?e:{},n=t.risk===`safe`||t.risk===`review`||t.risk===`blocked`?t.risk:`review`,i=(Array.isArray(t.findings)?t.findings:[]).slice(0,r.findingsPerSkill).map(e=>{let t=wo(e)?e:{};return{code:Do(t.code,r.findingCodeCharacters,`finding`),severity:t.severity===`high`?`high`:`medium`,message:Do(t.message,r.findingMessageCharacters)}});return{name:Do(t.name,r.nameCharacters,`unknown`),risk:n,score:Eo(t.score,r.score),findings:i,path:Do(t.path,r.pathCharacters),source:Do(t.source,r.sourceCharacters,`unknown`),scannedBytes:Eo(t.scannedBytes,r.skillBytes)}}),a=wo(t.inventory)?t.inventory:{};return{scans:Eo(t.scans,2**53-1),total:Eo(t.total,r.skills),blocked:Eo(t.blocked,r.skills),review:Eo(t.review,r.skills),reports:i,status:ko(t.status,r.statusErrorCharacters),inventory:{available:Eo(a.available,2**53-1),scanned:Eo(a.scanned,r.skills),shown:Eo(a.shown,r.panelReports),truncated:a.truncated===!0,scanTruncated:a.scanTruncated===!0,displayTruncated:a.displayTruncated===!0},limits:r}}var jo=12,Mo=32,No=512,Po=16384,Fo=2e3,Io=500,Lo={timeoutMs:5e3},Ro={queryLength:65536,databaseBytes:268435456,rows:100,columns:128,stringLength:16384,resultBytes:1048576,blobPreviewBytes:256,panelRows:20},zo=new Set([`status`,`timeoutMs`,`latest`,`limits`]),Bo=new Set([`state`,`at`,`error`]),Vo=new Set([`database`,`query`,`columns`,`rows`,`truncated`,`scannedRows`,`rowInventory`]),Ho=new Set([`scanned`,`returned`,`shown`,`truncated`,`displayLimit`]),Uo=new Set([`type`,`bytes`,`previewBase64`,`truncated`]),Wo=new Set(Object.keys(Ro)),Go=/[\p{Cc}\p{Cf}\p{Cs}\u2028\u2029]/u;function Ko(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function qo(e,t){let n=Object.keys(e);return n.length===t.size&&n.every(e=>t.has(e))}function Jo(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function Yo(e,t,n=!1){if(!(typeof e!=`string`||!n&&e.length===0||Go.test(e))&&!([...e].length>t||new TextEncoder().encode(e).byteLength>t))return e}function Xo(e){if(typeof e!=`string`||e.length>64)return;let t=Date.parse(e);if(Number.isFinite(t))try{return new Date(t).toISOString()===e?e:void 0}catch{return}}function Zo(e,t){try{if(!Array.isArray(e)||Object.getPrototypeOf(e)!==Array.prototype)return;let n=Object.getOwnPropertyDescriptor(e,`length`),r=n!==void 0&&`value`in n?n.value:void 0;if(!Number.isSafeInteger(r)||r<0||r>t)return;let i=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(i).some(e=>e!==`length`&&(typeof e!=`string`||!/^\d+$/u.test(e)||Number(e)>=r||String(Number(e))!==e))||Object.values(i).some(e=>!(`value`in e)))return;let a=[];for(let e=0;e<r;e+=1){let t=i[String(e)];if(t===void 0||!(`value`in t))return;a.push(t.value)}return a}catch{return}}function Qo(e){let t=Ko(e,Bo);if(t===void 0)return;if(t.state===`idle`&&qo(t,new Set([`state`])))return{state:`idle`,at:null,error:null};if(t.state===`running`&&qo(t,new Set([`state`])))return{state:`running`,at:null,error:null};let n=Xo(t.at);if(t.state===`completed`&&n!==void 0&&qo(t,new Set([`state`,`at`])))return{state:`completed`,at:n,error:null};if((t.state===`failed`||t.state===`cancelled`)&&n!==void 0&&qo(t,Bo)){let e=Yo(t.error,Fo);if(e!==void 0)return{state:t.state,at:n,error:[...e].slice(0,Io).join(``)}}}function $o(e){if(e===null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`string`)return Yo(e,Po,!0);let t=Ko(e,Uo);if(t===void 0||!qo(t,Uo)||t.type!==`blob`||typeof t.truncated!=`boolean`||typeof t.previewBase64!=`string`||t.previewBase64.length>344||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(t.previewBase64))return;let n=Jo(t.bytes,2**53-1);return n===void 0?void 0:{type:`blob`,bytes:n,previewBase64:t.previewBase64,truncated:t.truncated}}function es(e){let t=Ko(e,Vo);if(t===void 0||!qo(t,Vo))return;let n=Yo(t.database,4096),r=Yo(t.query,Ro.queryLength),i=Zo(t.columns,Ro.columns),a=Zo(t.rows,Ro.panelRows),o=Jo(t.scannedRows,2**53-1),s=Ko(t.rowInventory,Ho);if(n===void 0||r===void 0||i===void 0||a===void 0||o===void 0||s===void 0||!qo(s,Ho)||typeof t.truncated!=`boolean`)return;let c=[];for(let e of i){let t=Yo(e,No);if(t===void 0)return;c.push(t)}if(c.length===0||new Set(c).size!==c.length)return;let l=Jo(s.scanned,2**53-1),u=Jo(s.returned,Ro.panelRows),d=Jo(s.shown,Ro.panelRows);if(l===void 0||u===void 0||d===void 0||l!==o||u!==a.length||d!==u||d>l||s.displayLimit!==Ro.panelRows||typeof s.truncated!=`boolean`)return;let f=[];for(let e of a){let t=Ko(e,new Set(c));if(t===void 0||Object.keys(t).length!==c.length)return;let n=Object.create(null);for(let e of c){let r=$o(t[e]);if(r===void 0)return;n[e]=r}f.push(n)}return{database:n,query:r,columns:c.slice(0,Mo),rows:f.slice(0,jo),rowInventory:{scanned:l,returned:u,shown:f.length,truncated:t.truncated||s.truncated||f.length!==u||c.length>Mo,displayLimit:Ro.panelRows}}}function ts(e){let t=Ko(e,Wo);return t!==void 0&&qo(t,Wo)&&Object.entries(Ro).every(([e,n])=>t[e]===n)}function ns(){return{status:{state:`unknown`,at:null,error:null},timeoutMs:Lo.timeoutMs,latest:null,malformed:!0,limits:{...Ro}}}function rs(e){let t=Ko(e,zo);if(t===void 0||!qo(t,zo))return ns();let n=Jo(t.timeoutMs,3e4);if(n===void 0||n<100||!ts(t.limits))return ns();let r=Qo(t.status);if(r===void 0)return ns();let i=t.latest===null?null:es(t.latest);return i===void 0||r.state===`idle`&&i!==null||r.state===`completed`&&i===null?ns():{status:r,timeoutMs:n,latest:i,malformed:!1,limits:{...Ro}}}var is={members:64,tasks:256,messages:1e3,messageCharacters:4e3,mailboxReadMessages:25,agentTextBytes:32768,stateBytes:8388608,stateScanEntries:1e4,panelMembers:12,panelTasks:20,panelMessages:5},as=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/u,os=new Set([`todo`,`blocked`,`in_progress`,`done`]),ss=new Set([`idle`,`working`]),cs=200,ls=200,us=200,ds=20,fs=20,ps=20;function ms(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function hs(e,t,n=0){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:n}function gs(e,t){return typeof e==`string`?e.replaceAll(/\p{Cc}/gu,`�`).slice(0,t):``}function _s(e){return typeof e==`string`&&as.test(e)?e:void 0}function vs(e){if(!ms(e))return;let t=_s(e.id),n=gs(e.name,cs);if(t!==void 0&&n!==``)return{id:t,name:n,role:gs(e.role,ls)||`协作成员`,status:typeof e.status==`string`&&ss.has(e.status)?e.status:`idle`}}function ys(e){if(!ms(e))return;let t=_s(e.id),n=gs(e.title,us),r=e.assignee===`unassigned`?`unassigned`:_s(e.assignee);if(t!==void 0&&n!==``&&r!==void 0)return{id:t,title:n,assignee:r,status:typeof e.status==`string`&&os.has(e.status)?e.status:`todo`,dependsOn:(Array.isArray(e.dependsOn)?e.dependsOn.slice(0,ds):[]).map(_s).filter(e=>e!==void 0)}}function bs(e){if(!ms(e))return;let t=_s(e.id),n=_s(e.from),r=_s(e.to),i=gs(e.body,is.messageCharacters);if(t===void 0||n===void 0||r===void 0||i===``||typeof e.timestamp!=`string`)return;let a;try{a=new Date(e.timestamp).toISOString()}catch{return}if(a===e.timestamp)return{id:t,from:n,to:r,body:i,timestamp:a,read:e.read===!0}}function xs(e,t){return Array.isArray(e)?e.slice(0,t).map(_s).filter(e=>e!==void 0):[]}function Ss(e){if(!ms(e))return!1;if(!Array.isArray(e.dependsOn))return e.dependsOn!==void 0;let t=e.dependsOn.slice(0,ds);return e.dependsOn.length>t.length||t.some(e=>_s(e)===void 0)}function Cs(e,t,n,r){let i=ms(e)?e:{},a=Math.max(t,hs(i.total,n,t));return{total:a,shown:t,truncated:i.truncated===!0||r||a>t}}function ws(e){let t=ms(e)?e:{},n=Array.isArray(t.members)?t.members:[],r=Array.isArray(t.tasks)?t.tasks:[],i=Array.isArray(t.messages)?t.messages:[],a=n.slice(0,is.panelMembers),o=r.slice(0,is.panelTasks),s=i.slice(0,is.panelMessages),c=a.map(vs).filter(e=>e!==void 0),l=o.map(ys).filter(e=>e!==void 0),u=s.map(bs).filter(e=>e!==void 0),d=xs(t.readyTasks,fs),f=Array.isArray(t.dependencyCycle)?xs(t.dependencyCycle,ps):null,p=t.members!==void 0&&!Array.isArray(t.members)||n.length>a.length||c.length!==a.length,m=t.tasks!==void 0&&!Array.isArray(t.tasks)||r.length>o.length||l.length!==o.length||o.some(Ss)||t.readyTasks!==void 0&&!Array.isArray(t.readyTasks)||Array.isArray(t.readyTasks)&&t.readyTasks.length>d.length||t.dependencyCycle!==void 0&&t.dependencyCycle!==null&&!Array.isArray(t.dependencyCycle)||Array.isArray(t.dependencyCycle)&&t.dependencyCycle.length>(f?.length??0),h=t.messages!==void 0&&!Array.isArray(t.messages)||i.length>s.length||u.length!==s.length,g=p||m||h,_=ms(t.inventory)?t.inventory:{},v=Cs(_.members,c.length,is.members,p),y=Cs(_.tasks,l.length,is.tasks,m),b=ms(_.tasks)?_.tasks:{},x=Math.max(d.length,hs(b.ready,y.total,d.length)),S=ms(_.messages)?_.messages:{},C=Cs(S,u.length,is.messages,h),w=u.filter(e=>!e.read).length,T=hs(S.unread,C.total,w),E=ms(t.history)?t.history:{},ee=hs(E.available,2**53-1),D=hs(E.scanned,ee);return{members:c,tasks:l,messages:u,readyTasks:d,dependencyCycle:f,inventory:{members:v,tasks:{...y,ready:x},messages:{...C,unread:T}},history:{available:ee,scanned:D,truncated:E.truncated===!0,restored:E.restored===!0},limits:is,truncated:g}}var Ts=[`png`,`jpeg`,`jpg`,`gif`,`webp`],Es=new Set(Ts),Ds=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),Os=2e3,ks={imageBytes:10485760,pathCharacters:4096,promptCharacters:4e3,evidenceBytes:524288,agentTextBytes:131072,timeoutMs:18e4,cacheEntries:64},As=1e3,js=3e5;function Ms(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function Ns(e,t){if(typeof e!=`string`)return{value:void 0,altered:!0};let n=e.slice(0,t*2+1).replaceAll(/[\p{Cc}\p{Cf}]+/gu,` `).trim().slice(0,t);return{value:n===``?void 0:n,altered:n!==e}}function Ps(e){if(typeof e==`string`)try{return new Date(e).toISOString()===e?e:void 0}catch{return}}function Fs(e,t=[]){let n=Ms(e);if(n===void 0)return{image:null,altered:e!==null};let r=n.mode===`native`||n.mode===`evidence`?n.mode:void 0,i=Ns(n.path,ks.pathCharacters),a=typeof n.mimeType==`string`&&Ds.has(n.mimeType)?n.mimeType:void 0,o=typeof n.bytes==`number`&&Number.isSafeInteger(n.bytes)&&n.bytes>=0&&n.bytes<=ks.imageBytes?n.bytes:void 0,s=typeof n.cached==`boolean`&&!(r===`native`&&n.cached)?n.cached:void 0,c=Ps(n.at),l=new Set([`mode`,`path`,`mimeType`,`bytes`,`cached`,`at`,...t]),u=i.altered||Object.keys(n).some(e=>!l.has(e));return r===void 0||i.value===void 0||a===void 0||o===void 0||s===void 0||c===void 0?{image:null,altered:!0}:{image:{mode:r,path:i.value,mimeType:a,bytes:o,cached:s,at:c},altered:u}}function Is(e){let t=Ms(e);if(t===void 0)return{status:{state:`idle`},altered:!0};if(t.state===`idle`)return{status:{state:`idle`},altered:Object.keys(t).some(e=>e!==`state`)};if(t.state===`completed`){let e=Fs(t,[`state`]);return e.image===null?{status:{state:`idle`},altered:!0}:{status:{state:`completed`,...e.image},altered:e.altered}}if(t.state!==`running`&&t.state!==`failed`&&t.state!==`cancelled`)return{status:{state:`idle`},altered:!0};let n=t.mode===`native`||t.mode===`evidence`?t.mode:void 0,r=Ns(t.path,ks.pathCharacters),i=Ps(t.at);if(n===void 0||r.value===void 0||i===void 0)return{status:{state:`idle`},altered:!0};if(t.state===`running`){let e=r.altered||Object.keys(t).some(e=>!new Set([`state`,`mode`,`path`,`at`]).has(e));return{status:{state:`running`,mode:n,path:r.value,at:i},altered:e}}let a=Ns(t.error,Os);if(a.value===void 0)return{status:{state:`idle`},altered:!0};let o=r.altered||a.altered||Object.keys(t).some(e=>!new Set([`state`,`mode`,`path`,`at`,`error`]).has(e));return{status:{state:t.state,mode:n,path:r.value,at:i,error:a.value},altered:o}}function Ls(e){try{if(!Array.isArray(e))return!1;let t=Object.getOwnPropertyDescriptor(e,`length`);if(t===void 0||!(`value`in t)||t.value!==Ts.length)return!1;let n=new Set;for(let t=0;t<Ts.length;t+=1){let r=Object.getOwnPropertyDescriptor(e,String(t));if(r===void 0||!(`value`in r)||typeof r.value!=`string`||!Es.has(r.value))return!1;n.add(r.value)}return n.size===Ts.length}catch{return!1}}function Rs(e){let t=Ms(e);if(t===void 0)return{attached:!1,image:null,status:{state:`idle`},supportedTypes:[...Ts],limits:{...ks},truncated:!0};let n=Fs(t.image),r=Is(t.status),i=r.status.state!==`completed`||n.image!==null&&r.status.mode===n.image.mode&&r.status.path===n.image.path&&r.status.mimeType===n.image.mimeType&&r.status.bytes===n.image.bytes&&r.status.cached===n.image.cached&&r.status.at===n.image.at,a=Ms(t.limits),o=a!==void 0&&typeof a.timeoutMs==`number`&&Number.isSafeInteger(a.timeoutMs)&&a.timeoutMs>=As&&a.timeoutMs<=js?a.timeoutMs:ks.timeoutMs,s=[`imageBytes`,`pathCharacters`,`promptCharacters`,`evidenceBytes`,`agentTextBytes`,`cacheEntries`],c=a===void 0||s.some(e=>a[e]!==ks[e])||Object.keys(a).some(e=>![...s,`timeoutMs`].includes(e))||o!==a.timeoutMs,l=n.image!==null,u=new Set([`attached`,`image`,`status`,`supportedTypes`,`limits`]),d=n.altered||r.altered||!i||c||!Ls(t.supportedTypes)||t.attached!==l||Object.keys(t).some(e=>!u.has(e));return{attached:l,image:n.image,status:r.status,supportedTypes:[...Ts],limits:{...ks,timeoutMs:o},truncated:d}}var zs=[`png`,`jpeg`,`jpg`,`gif`,`webp`],Bs=new Set(zs),Vs=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),Q={imageBytes:20971520,headerBytes:262144,pathCharacters:4096,assets:100,imageCandidates:256,scannedEntries:4096,scannedDirectories:512,depth:16,issues:20,issueCharacters:500,agentTextBytes:16384};function Hs(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function Us(e,t){try{if(!Array.isArray(e))return;let n=Object.getOwnPropertyDescriptor(e,`length`);if(n===void 0||!(`value`in n)||!Number.isSafeInteger(n.value)||n.value<0)return;let r=Math.min(n.value,t),i=[];for(let t=0;t<r;t+=1){let n=Object.getOwnPropertyDescriptor(e,String(t));if(n===void 0||!(`value`in n))return;i.push(n.value)}return{values:i,altered:n.value>t}}catch{return}}function Ws(e,t){if(typeof e!=`string`)return{value:void 0,altered:!0};let n=e.slice(0,t*2+1).replaceAll(/[\p{Cc}\p{Cf}]+/gu,` `).trim().slice(0,t);return{value:n===``?void 0:n,altered:n!==e}}function Gs(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function Ks(e){if(typeof e==`string`)try{return new Date(e).toISOString()===e?e:void 0}catch{return}}function qs(e,t){let n=new Set(t);return Object.keys(e).every(e=>n.has(e))}function Js(e){let t=Hs(e);if(t===void 0)return{asset:void 0,altered:!0};let n=Ws(t.path,Q.pathCharacters),r=typeof t.mimeType==`string`&&Vs.has(t.mimeType)?t.mimeType:void 0,i=Gs(t.bytes,Q.imageBytes),a=r===`image/png`?2147483647:r===`image/webp`?16777216:65535,o=t.width===null?null:Gs(t.width,a),s=t.height===null?null:Gs(t.height,a),c=typeof t.headerTruncated==`boolean`?t.headerTruncated:void 0,l=typeof o==`number`&&o>0&&typeof s==`number`&&s>0||o===null&&s===null&&c===!0&&r===`image/jpeg`,u=n.altered||!qs(t,[`path`,`mimeType`,`bytes`,`width`,`height`,`headerTruncated`]);return n.value===void 0||r===void 0||i===void 0||c===void 0||!l?{asset:void 0,altered:!0}:{asset:{path:n.value,mimeType:r,bytes:i,width:o,height:s,headerTruncated:c},altered:u}}function Ys(e){let t=Hs(e);if(t===void 0)return{issue:void 0,altered:!0};let n=Ws(t.path,Q.pathCharacters),r=Ws(t.reason,Q.issueCharacters),i=n.altered||r.altered||!qs(t,[`path`,`reason`]);return n.value===void 0||r.value===void 0?{issue:void 0,altered:!0}:{issue:{path:n.value,reason:r.value},altered:i}}function Xs(e){if(e===null)return{report:null,altered:!1};let t=Hs(e);if(t===void 0)return{report:null,altered:!0};let n=Us(t.assets,Q.assets),r=Us(t.issues,Q.issues);if(n===void 0||r===void 0)return{report:null,altered:!0};let i=[],a=[],o=n.altered||r.altered;for(let e of n.values){let t=Js(e);o||=t.altered,t.asset!==void 0&&i.push(t.asset)}for(let e of r.values){let t=Ys(e);o||=t.altered,t.issue!==void 0&&a.push(t.issue)}let s=Gs(t.inspectedCandidates,Q.imageCandidates),c=Gs(t.scannedEntries,Q.scannedEntries),l=Gs(t.scannedDirectories,Q.scannedDirectories),u=typeof t.truncated==`boolean`?t.truncated:void 0,d=typeof t.issuesTruncated==`boolean`?t.issuesTruncated:void 0,f=s!==void 0&&c!==void 0&&l!==void 0&&s<=c&&i.length<=s&&a.length<=s&&(d===!0||i.length+a.length<=s);return o||=!qs(t,[`assets`,`issues`,`inspectedCandidates`,`scannedEntries`,`scannedDirectories`,`truncated`,`issuesTruncated`]),!f||u===void 0||d===void 0?{report:null,altered:!0}:{report:{assets:i,issues:a,inspectedCandidates:s,scannedEntries:c,scannedDirectories:l,truncated:u,issuesTruncated:d},altered:o}}function Zs(e){let t=Hs(e);if(t===void 0)return{status:{state:`idle`},altered:!0};if(t.state===`idle`)return{status:{state:`idle`},altered:!qs(t,[`state`])};let n=t.operation===`catalog`||t.operation===`info`?t.operation:void 0,r=Ks(t.at),i=t.path===void 0?{value:void 0,altered:!1}:Ws(t.path,Q.pathCharacters),a=n===`catalog`?t.path===void 0:i.value!==void 0;if(n===void 0||r===void 0||!a)return{status:{state:`idle`},altered:!0};let o=i.value;if(t.state===`running`)return{status:{state:`running`,operation:n,...o===void 0?{}:{path:o},at:r},altered:i.altered||!qs(t,[`state`,`operation`,...n===`info`?[`path`]:[],`at`])};if(t.state===`completed`){let e=Gs(t.count,Q.assets);return e===void 0||typeof t.truncated!=`boolean`?{status:{state:`idle`},altered:!0}:{status:{state:`completed`,operation:n,...o===void 0?{}:{path:o},count:e,truncated:t.truncated,at:r},altered:i.altered||!qs(t,[`state`,`operation`,...n===`info`?[`path`]:[],`count`,`truncated`,`at`])}}if(t.state===`failed`||t.state===`cancelled`){let e=Ws(t.error,Q.issueCharacters);return e.value===void 0?{status:{state:`idle`},altered:!0}:{status:{state:t.state,operation:n,...o===void 0?{}:{path:o},error:e.value,at:r},altered:i.altered||e.altered||!qs(t,[`state`,`operation`,...n===`info`?[`path`]:[],`error`,`at`])}}return{status:{state:`idle`},altered:!0}}function Qs(e){let t=Us(e,zs.length);return t===void 0||t.altered||t.values.some(e=>typeof e!=`string`)?!1:new Set(t.values).size===zs.length&&t.values.every(e=>Bs.has(e))}function $s(e){let t=Hs(e);return t===void 0||!qs(t,Object.keys(Q))?!1:Object.entries(Q).every(([e,n])=>t[e]===n)}function ec(e){let t=Hs(e);if(t===void 0)return{status:{state:`idle`},report:null,supportedTypes:[...zs],limits:{...Q},truncated:!0};let n=Zs(t.status),r=Xs(t.report),i=n.status.state!==`completed`||r.report!==null&&n.status.count===r.report.assets.length&&n.status.truncated===r.report.truncated&&(n.status.operation===`catalog`||n.status.path===r.report.assets[0]?.path&&n.status.count===1),a=n.altered||r.altered||!i||!Qs(t.supportedTypes)||!$s(t.limits)||!qs(t,[`status`,`report`,`supportedTypes`,`limits`]);return{status:n.status,report:r.report,supportedTypes:[...zs],limits:{...Q},truncated:a}}var tc={nameCharacters:256,pathCharacters:512,scripts:256,plugins:256,errorCharacters:2e3},nc=1048576,rc=new Set([`generated`,`name`,`scripts`,`plugins`,`lastWrite`,`status`]),ic=new Set([`path`,`bytes`,`overwritten`]),ac=new Set([`state`,`operation`,`at`,`error`]);function oc(e,t){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return;let r=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(r).some(e=>typeof e!=`string`||!t.has(e)))return;let i=Object.create(null);for(let[e,t]of Object.entries(r)){if(!(`value`in t))return;i[e]=t.value}return i}catch{return}}function sc(e,t){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=t?e:void 0}function cc(e){if(typeof e!=`string`||e.length>64)return;let t=Date.parse(e);if(Number.isFinite(t))try{return new Date(t).toISOString()===e?e:void 0}catch{return}}function lc(e){if(!(typeof e!=`string`||e.length===0||[...e].length>tc.nameCharacters)&&!(new TextEncoder().encode(e).byteLength>512||/[\p{Cc}\p{Cf}\p{Cs}]/u.test(e)))return e}function uc(e){if(typeof e!=`string`||e===``||e!==e.trim()||[...e].length>tc.pathCharacters||new TextEncoder().encode(e).byteLength>tc.pathCharacters||/[\\\p{Cc}\p{Cf}\p{Cs}]/u.test(e))return;let t=e.split(`/`);if(t.some(e=>e===``||e===`.`||e===`..`||e!==e.trim()))return;let n=t.at(-1);return n!==void 0&&/^README(?:[._-][^/]*)?\.md$/iu.test(n)?e:void 0}function dc(e){let t=oc(e,ac);if(t===void 0)return;let n=t.state,r=t.operation,i=t.at,a=t.error,o=Object.hasOwn(t,`operation`),s=Object.hasOwn(t,`at`),c=Object.hasOwn(t,`error`);if(n===`idle`&&!o&&!s&&!c)return{state:n,operation:null,at:null,error:null};if(n===`running`&&(r===`report`||r===`write`)&&!s&&!c)return{state:n,operation:r,at:null,error:null};let l=cc(i);if(n===`completed`&&(r===`report`||r===`write`)&&l!==void 0&&!c)return{state:n,operation:r,at:l,error:null};if((n===`failed`||n===`cancelled`)&&(r===`report`||r===`write`)&&l!==void 0&&typeof a==`string`&&a.length>0&&a.length<=tc.errorCharacters&&!/[\p{Cc}\p{Cf}\p{Cs}]/u.test(a))return{state:n,operation:r,at:l,error:a}}function fc(){return{generated:null,lastWrite:null,status:{state:`unknown`,operation:null,at:null,error:null},malformed:!0,limits:{...tc}}}function pc(e){let t=oc(e,rc);if(t===void 0||typeof t.generated!=`boolean`)return fc();let n=dc(t.status);if(n===void 0)return fc();let r=null;if(t.generated){let e=lc(t.name),n=sc(t.scripts,tc.scripts),i=sc(t.plugins,tc.plugins);if(e===void 0||n===void 0||i===void 0)return fc();r={name:e,scripts:n,plugins:i}}else if(Object.hasOwn(t,`name`)||Object.hasOwn(t,`scripts`)||Object.hasOwn(t,`plugins`))return fc();let i=null;if(t.lastWrite!==null){let e=oc(t.lastWrite,ic),n=uc(e?.path),r=sc(e?.bytes,nc),a=e?.overwritten;if(e===void 0||n===void 0||r===void 0||typeof a!=`boolean`)return fc();i={path:n,bytes:r,overwritten:a}}return!t.generated&&i!==null||n.state===`idle`&&(t.generated||i!==null)||n.state===`completed`&&(!t.generated||n.operation===`write`&&i===null)?fc():{generated:r,lastWrite:i,status:n,malformed:!1,limits:{...tc}}}var $=(e,t=`—`)=>{if(e==null||e===``)return t;if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)}catch{return t}},mc=[`button:not([disabled])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`summary`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function hc(e,t,n=!1,r){let i=(0,o.useRef)(null),a=(0,o.useRef)(t),s=(0,o.useRef)(n);return a.current=t,s.current=n,(0,o.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=t instanceof HTMLElement&&t!==document.body&&t!==document.documentElement?t:void 0,o=()=>Array.from(i.current?.querySelectorAll(mc)??[]).filter(e=>!e.hidden&&e.getAttribute(`aria-hidden`)!==`true`&&e.getClientRects().length>0),c=window.requestAnimationFrame(()=>{let e=i.current;!e||e.contains(document.activeElement)||(e.querySelector(`[data-dialog-initial-focus]`)??o()[0])?.focus()}),l=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopImmediatePropagation(),s.current||a.current();return}if(e.key!==`Tab`)return;let t=o();if(!t.length){e.preventDefault(),i.current?.focus();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())};return window.addEventListener(`keydown`,l,!0),()=>{window.cancelAnimationFrame(c),window.removeEventListener(`keydown`,l,!0);let e=n?.isConnected?n:r?document.querySelector(r):void 0;e&&window.requestAnimationFrame(()=>e.focus())}},[e,r]),i}var gc=(e,t)=>e?.cwd??(typeof t?.sessionFile==`string`?t.sessionFile:`未选择工作区`),_c=e=>{let t=$(e.type,``);return t===`file_diff`?`文件差异`:t===`file`?`文件详情`:$(e.summary??e.message??e.toolName??e.type??e.event,`未命名事件`)},vc=e=>[[`context`,`上下文`],[`agent-teams`,`协作`],[`modlens`,`视觉`],[`token-guard`,`预算`],[`git-time-capsule`,`版本控制`],[`dependency-checker`,`工程诊断`],[`at-file`,`文件上下文`],[`test-harness`,`测试`],[`session-insights`,`会话统计`],[`session-compare`,`会话对比`],[`secure-audit`,`安全审计`],[`readme-gen`,`文档生成`],[`i18n-pair`,`国际化`],[`cleaner`,`清理`],[`sql-lens`,`数据库`],[`docker-sandbox`,`沙箱`],[`mcp-client`,`工具协议`],[`mcp-panel`,`MCP 控制台`],[`browser-fetch`,`网页抓取`],[`web-research`,`联网研究`],[`browser-session`,`浏览器会话`],[`yaml-validator`,`配置校验`],[`mock-server`,`接口模拟`],[`cli-notifier`,`桌面通知`],[`obsidian-sync`,`知识库`],[`context-doctor`,`上下文诊断`],[`history-compressor`,`历史压缩`],[`reviewer-bot`,`代码审查`],[`auto-mode`,`安全执行`],[`plan-execute`,`计划执行`],[`plugin-finder`,`插件发现`],[`taskboard`,`任务看板`],[`synapse`,`会话地图`],[`hol-guard`,`安全防护`],[`plugin-radar`,`生态雷达`],[`plugin-stars`,`排行榜`],[`plugin-check`,`插件体检`],[`annotation`,`批注上下文`],[`cost-meter`,`成本账本`],[`undo-savepoint`,`恢复保存点`],[`skill-catalog`,`技能目录`],[`graph-memory`,`知识图谱`],[`memory`,`跨会话记忆`],[`canvas-draw`,`流程图`],[`image-compressor`,`图片压缩`],[`workspace-search`,`工作区检索`],[`prompt-guard`,`提示词防护`],[`code2skill`,`技能打包`],[`tab-manager`,`会话标签`],[`genui`,`结构化界面`],[`anchored-standard`,`轨迹锚定`],[`telemetry-blocker`,`遥测拦截`],[`change-verifier`,`变更门禁`],[`plugin-dev`,`插件开发`],[`openpets`,`桌面伙伴`],[`vision-toolkit`,`视觉素材`],[`session-bridge`,`会话交接`],[`skill-guard`,`Skill 安全`],[`recall-unread`,`会话召回`],[`turn-rewind`,`会话回退`],[`session-export`,`会话导出`],[`session-search`,`会话搜索`],[`session-bookmarks`,`会话书签`],[`llm-verifier`,`模型校验`],[`module-search`,`模块检索`],[`workspace-navigator`,`工作区导航`],[`better-sidebar`,`侧栏概览`],[`archify`,`架构地图`],[`mirage-bridge`,`Mirage 虚拟终端`],[`theme-studio`,`主题`],[`reverse-skill`,`技能隔离`],[`colleague-skill`,`角色交接`],[`prompt-library`,`提示词库`],[`model`,`模型`],[`tool`,`工具`],[`session`,`会话`],[`resource`,`资源`],[`web`,`界面`],[`gateway`,`界面`]].find(([t])=>e.includes(t))?.[1]??`运行时`,yc=e=>{let t=new Map([[`@pi-harness/core/plugins/context`,`Context insights`],[`@pi-harness/core/plugins/agent-teams`,`Agent Teams`],[`@pi-harness/core/plugins/modlens`,`ModLens vision bridge`],[`@pi-harness/core/plugins/token-guard`,`Token Guard`],[`@pi-harness/core/plugins/git-time-capsule`,`Git Time Capsule`],[`@pi-harness/core/plugins/dependency-checker`,`Dependency Checker`],[`@pi-harness/core/plugins/at-file`,`@file context`],[`@pi-harness/core/plugins/fail-logger`,`Failure Logger`],[`@pi-harness/core/plugins/test-harness`,`Test Harness`],[`@pi-harness/core/plugins/session-insights`,`Session Insights`],[`@pi-harness/core/plugins/session-compare`,`Session Compare`],[`@pi-harness/core/plugins/secure-audit`,`Secure Audit`],[`@pi-harness/core/plugins/readme-gen`,`README Generator`],[`@pi-harness/core/plugins/i18n-pair`,`I18n Pair`],[`@pi-harness/core/plugins/cleaner`,`Harness Cleaner`],[`@pi-harness/core/plugins/sql-lens`,`SQL Lens`],[`@pi-harness/core/plugins/docker-sandbox`,`Docker Sandbox`],[`@pi-harness/core/plugins/mcp-client`,`MCP Client`],[`@pi-harness/core/plugins/mcp-panel`,`MCP Console`],[`@pi-harness/core/plugins/browser-fetch`,`Browser Fetch`],[`@pi-harness/core/plugins/web-research`,`Web Research`],[`@pi-harness/core/plugins/browser-session`,`Browser Session`],[`@pi-harness/core/plugins/yaml-validator`,`YAML Validator`],[`@pi-harness/core/plugins/mock-server`,`Mock Server`],[`@pi-harness/core/plugins/cli-notifier`,`CLI Notifier`],[`@pi-harness/core/plugins/obsidian-sync`,`Obsidian Sync`],[`@pi-harness/core/plugins/context-doctor`,`Context Doctor`],[`@pi-harness/core/plugins/history-compressor`,`History Compressor`],[`@pi-harness/core/plugins/reviewer-bot`,`Reviewer Bot`],[`@pi-harness/core/plugins/auto-mode`,`Auto Mode`],[`@pi-harness/core/plugins/plan-execute`,`Plan Execute`],[`@pi-harness/core/plugins/plugin-finder`,`Plugin Finder`],[`@pi-harness/core/plugins/taskboard`,`Taskboard`],[`@pi-harness/core/plugins/synapse`,`Synapse`],[`@pi-harness/core/plugins/hol-guard`,`HOL Guard`],[`@pi-harness/core/plugins/plugin-radar`,`Plugin Radar`],[`@pi-harness/core/plugins/plugin-check`,`Plugin Check`],[`@pi-harness/core/plugins/annotation`,`Annotations`],[`@pi-harness/core/plugins/cost-meter`,`Cost Meter`],[`@pi-harness/core/plugins/undo-savepoint`,`Undo Savepoints`],[`@pi-harness/core/plugins/skill-catalog`,`Skills Catalog`],[`@pi-harness/core/plugins/memory`,`Memory`],[`@pi-harness/core/plugins/graph-memory`,`Graph Memory`],[`@pi-harness/core/plugins/canvas-draw`,`Canvas Draw`],[`@pi-harness/core/plugins/image-compressor`,`Image Compressor`],[`@pi-harness/core/plugins/workspace-search`,`Workspace Search`],[`@pi-harness/core/plugins/prompt-guard`,`Prompt Guard`],[`@pi-harness/core/plugins/code2skill`,`Code2Skill`],[`@pi-harness/core/plugins/tab-manager`,`Session Tabs`],[`@pi-harness/core/plugins/genui`,`GenUI`],[`@pi-harness/core/plugins/anchored-standard`,`Anchored Standard`],[`@pi-harness/core/plugins/telemetry-blocker`,`Telemetry Blocker`],[`@pi-harness/core/plugins/change-verifier`,`Change Verifier`],[`@pi-harness/core/plugins/plugin-dev`,`Plugin Dev`],[`@pi-harness/core/plugins/openpets`,`OpenPets`],[`@pi-harness/core/plugins/vision-toolkit`,`Vision Toolkit`],[`@pi-harness/core/plugins/plugin-stars`,`Plugin Stars`],[`@pi-harness/core/plugins/session-bridge`,`Session Bridge`],[`@pi-harness/core/plugins/skill-guard`,`Skill Guard`],[`@pi-harness/core/plugins/recall-unread`,`Recall Unread`],[`@pi-harness/core/plugins/turn-rewind`,`Turn Rewind`],[`@pi-harness/core/plugins/session-export`,`Session Export`],[`@pi-harness/core/plugins/session-search`,`Session Search`],[`@pi-harness/core/plugins/session-bookmarks`,`Session Bookmarks`],[`@pi-harness/core/plugins/llm-verifier`,`LLM Verifier`],[`@pi-harness/core/plugins/module-search`,`Module Search`],[`@pi-harness/core/plugins/workspace-navigator`,`Workspace Navigator`],[`@pi-harness/core/plugins/better-sidebar`,`Better Sidebar`],[`@pi-harness/core/plugins/archify`,`Architecture Map`],[`@pi-harness/core/plugins/mirage-bridge`,`Mirage Bridge`],[`@pi-harness/core/plugins/theme-studio`,`Theme Studio`],[`@pi-harness/core/plugins/reverse-skill`,`Reverse Skill Firewall`],[`@pi-harness/core/plugins/colleague-skill`,`Colleague Skill`],[`@pi-harness/core/plugins/prompt-library`,`Prompt Library`],[`@pi-harness/core/plugins/runtime-doctor`,`Runtime Doctor`]]).get(e);if(t!==void 0)return t;let n=e.match(/^@[^/]+\/cordis-plugin-(.+)$/i);return n?`官方 · ${n[1]}`:e.toLowerCase().includes(`cordis`)?e.replace(/cordis/gi,`runtime`):e},bc=()=>{if(typeof window>`u`)return{page:`session`,view:`chat`,marketplaceQuery:``,marketplaceCapability:``,marketplaceCategory:``,marketplacePlugin:void 0,installedPlugin:void 0,marketplacePage:0};let e=new URLSearchParams(window.location.search),t=e.get(`page`),n=e.get(`view`),r=e.get(`settings`),i=t===`plugins`||t===`marketplace`?t:`session`,a=n===`trajectory`||n===`files`?n:`chat`,o=r===`providers`||r===`toml`||r===`general`?r:void 0,s=Number.parseInt(e.get(`marketplacePage`)??`0`,10);return{page:i,view:a,settings:o,sessionPath:e.get(`session`)??void 0,marketplaceQuery:e.get(`marketplaceQuery`)??``,marketplaceCapability:e.get(`capability`)??``,marketplaceCategory:e.get(`category`)??``,marketplacePlugin:Ze(e),installedPlugin:ur(e),marketplacePage:Number.isFinite(s)&&s>=0?s:0}};function xc(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=n-864e5,i=new Map;for(let t of e){let e=t.modified??t.created,a=typeof e==`number`?e:typeof e==`string`?Date.parse(e):NaN,o=Number.isFinite(a)&&a>=n?`今天`:Number.isFinite(a)&&a>=r?`昨天`:`更早`;i.set(o,[...i.get(o)??[],t])}return[`今天`,`昨天`,`更早`].flatMap(e=>{let t=i.get(e);return t?.length?[[e,t]]:[]})}function Sc({status:e,workspaces:t,onCreate:n,onStarter:r,onToml:i}){return(0,j.jsxs)(`div`,{className:`new-session-screen`,children:[(0,j.jsx)(`div`,{className:`welcome-kicker`,children:`PI AGENT HARNESS · REAL RUNTIME`}),(0,j.jsxs)(`div`,{className:`welcome-heading`,children:[(0,j.jsx)(`span`,{className:`pi-mark large`,"aria-hidden":`true`,children:(0,j.jsx)(`img`,{src:`/icons/svg/mark-white.svg`,alt:``})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:`开始一个工作会话`}),(0,j.jsx)(`p`,{children:`连接当前工作区,直接让 Pi agent 读取、修改并验证代码。`})]})]}),(0,j.jsx)(`div`,{className:`workspace-picker`,children:t.length?t.map(t=>(0,j.jsxs)(`button`,{className:`workspace-row`,onClick:()=>n(t),type:`button`,children:[(0,j.jsx)(`span`,{className:`workspace-status ${t.current?`live`:`offline`}`,children:t.current?`已连接`:`工作区`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`code`,{children:t.path}),(0,j.jsx)(`small`,{children:t.current&&e?`${t.branch} · ${e.model}`:t.branch})]}),(0,j.jsx)(`span`,{className:`workspace-arrow`,children:`↗`})]},t.path)):(0,j.jsxs)(`div`,{className:`workspace-row is-empty`,children:[(0,j.jsx)(`span`,{className:`workspace-status offline`,children:`加载中`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`code`,{children:e?.cwd??`加载工作区…`}),(0,j.jsx)(`small`,{children:`正在读取 git worktree`})]})]})}),(0,j.jsxs)(`div`,{className:`effective-config`,children:[(0,j.jsx)(`span`,{className:`config-label`,children:`当前运行时`}),(0,j.jsx)(`span`,{children:e?.model??`由运行时提供`}),(0,j.jsx)(`span`,{children:e?`${e.messages} 条消息`:`—`}),(0,j.jsx)(`a`,{href:`#`,onClick:e=>{e.preventDefault(),i()},children:`改配置 ⌘,`})]}),(0,j.jsx)(`div`,{className:`starter-grid`,children:[[`定位问题`,`分析当前仓库并给出根因`],[`修复并测试`,`实现修复并运行相关测试`],[`审查改动`,`只读检查未提交变更`],[`解释代码`,`解释当前文件的关键逻辑`]].map(([e,t])=>(0,j.jsxs)(`button`,{className:`starter-card`,onClick:()=>r(t),type:`button`,children:[(0,j.jsx)(`strong`,{children:e}),(0,j.jsx)(`small`,{children:t})]},e))})]})}function Cc({workspaces:e,onSelect:t,onPickDirectory:n,onClose:r,error:i}){let a=hc(!0,r);return(0,j.jsx)(`div`,{className:`workspace-chooser`,onClick:r,children:(0,j.jsxs)(`div`,{"aria-label":`选择工作区`,"aria-modal":`true`,className:`workspace-chooser-dialog`,onClick:e=>e.stopPropagation(),ref:a,role:`dialog`,tabIndex:-1,children:[(0,j.jsxs)(`div`,{className:`workspace-chooser-heading`,children:[(0,j.jsx)(`strong`,{children:`新建会话`}),(0,j.jsx)(`button`,{"aria-label":`关闭工作区选择`,onClick:r,type:`button`,children:`×`})]}),(0,j.jsx)(`small`,{children:`选择这个会话要使用的工作区`}),i?(0,j.jsx)(`div`,{className:`workspace-chooser-error`,role:`alert`,children:i}):null,(0,j.jsxs)(`button`,{className:`workspace-pick-directory`,"data-dialog-initial-focus":!0,onClick:()=>void n(),type:`button`,children:[(0,j.jsx)(`span`,{children:`打开目录`}),(0,j.jsx)(`small`,{children:`从 Finder 选择一个新的工作目录`})]}),(0,j.jsx)(`div`,{className:`workspace-chooser-divider`,children:(0,j.jsx)(`span`,{children:`或选择已有 worktree`})}),e.length?e.map(e=>(0,j.jsxs)(`button`,{className:`workspace-chooser-row`,onClick:()=>t(e),type:`button`,children:[(0,j.jsx)(`span`,{className:`workspace-status ${e.current?`live`:`offline`}`,children:e.current?`当前`:`worktree`}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:e.name}),(0,j.jsx)(`code`,{children:e.path})]}),(0,j.jsx)(`small`,{children:e.branch})]},e.path)):(0,j.jsx)(`span`,{className:`workspace-chooser-empty`,children:`正在读取 git worktree…`})]})})}function wc({kind:e,name:t,count:n,value:r,busy:i,onChange:a,onClose:o,onConfirm:s}){let c=e===`delete`||e===`batch-delete`,l=e===`rename`?`重命名会话`:e===`archive`?`归档会话`:c?`删除会话`:`会话操作`,u=e===`rename`?`给这个会话一个容易识别的名称。`:e===`archive`?`归档后会从默认列表隐藏,之后仍可在会话工具中恢复。`:`将永久删除${n&&n>1?` ${n} 个会话`:`这个会话`}及其本地记录,此操作不可撤销。`,d=hc(!0,o,i,`.session-menu`);return(0,j.jsx)(`div`,{className:`session-dialog-backdrop`,onClick:()=>{i||o()},children:(0,j.jsxs)(`div`,{"aria-label":l,"aria-modal":`true`,className:`session-dialog`,onClick:e=>e.stopPropagation(),ref:d,role:`dialog`,tabIndex:-1,children:[(0,j.jsxs)(`header`,{className:`session-dialog-header`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:l}),(0,j.jsx)(`small`,{children:u})]}),(0,j.jsx)(`button`,{"aria-label":`关闭`,disabled:i,onClick:o,type:`button`,children:`×`})]}),e===`rename`&&(0,j.jsxs)(`label`,{className:`session-dialog-field`,children:[(0,j.jsx)(`span`,{children:`名称`}),(0,j.jsx)(`input`,{"data-dialog-initial-focus":!0,disabled:i,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&!i&&s(),value:r})]}),t&&e!==`rename`&&(0,j.jsx)(`div`,{className:`session-dialog-target`,children:t}),(0,j.jsxs)(`footer`,{className:`session-dialog-actions`,children:[(0,j.jsx)(`button`,{"data-dialog-initial-focus":e===`rename`?void 0:``,disabled:i,onClick:o,type:`button`,children:`取消`}),(0,j.jsx)(`button`,{className:c?`danger`:`primary`,disabled:i||e===`rename`&&!r.trim(),onClick:s,type:`button`,children:i?`处理中…`:e===`rename`?`保存名称`:e===`archive`?`归档`:`永久删除`})]})]})})}function Tc({title:e,description:t,target:n,confirmLabel:r,busy:i,onClose:a,onConfirm:o}){let s=hc(!0,a,i);return(0,j.jsx)(`div`,{className:`session-dialog-backdrop`,onClick:()=>{i||a()},children:(0,j.jsxs)(`div`,{"aria-label":e,"aria-modal":`true`,className:`session-dialog`,onClick:e=>e.stopPropagation(),ref:s,role:`dialog`,tabIndex:-1,children:[(0,j.jsxs)(`header`,{className:`session-dialog-header`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:e}),(0,j.jsx)(`small`,{children:t})]}),(0,j.jsx)(`button`,{"aria-label":`关闭`,disabled:i,onClick:a,type:`button`,children:`×`})]}),n&&(0,j.jsx)(`div`,{className:`session-dialog-target`,children:n}),(0,j.jsxs)(`footer`,{className:`session-dialog-actions`,children:[(0,j.jsx)(`button`,{"data-dialog-initial-focus":!0,disabled:i,onClick:a,type:`button`,children:`取消`}),(0,j.jsx)(`button`,{className:`danger`,disabled:i,onClick:o,type:`button`,children:i?`处理中…`:r})]})]})})}function Ec({busy:e,position:t,onRename:n,onFork:r,onArchive:i,onDelete:a}){return(0,je.createPortal)((0,j.jsxs)(`div`,{className:`session-row-menu-popover`,"data-session-popover":!0,onClick:e=>e.stopPropagation(),role:`menu`,style:t,children:[(0,j.jsx)(`button`,{autoFocus:!0,disabled:e,onClick:n,role:`menuitem`,type:`button`,children:`重命名`}),(0,j.jsx)(`button`,{disabled:e,onClick:r,role:`menuitem`,type:`button`,children:`复制会话`}),(0,j.jsx)(`button`,{disabled:e,onClick:i,role:`menuitem`,type:`button`,children:`归档会话`}),(0,j.jsx)(`button`,{className:`danger`,disabled:e,onClick:a,role:`menuitem`,type:`button`,children:`删除会话`})]}),document.body)}var Dc=(e,t,n,r)=>{let i=e.getBoundingClientRect(),a=window.innerWidth-i.right-8>=t?i.right+8:Math.max(8,i.left-t-8),o=r===`below`?i.bottom+6:i.top-4;return{left:Math.round(a),top:Math.round(Math.min(Math.max(8,o),Math.max(8,window.innerHeight-n-8)))}};function Oc({message:e}){let t=/No API key found for everyapi/i.test(e),n=t||/No API key found|authentication|未配置认证/i.test(e);return(0,j.jsxs)(`div`,{className:`action-error`,role:`alert`,children:[(0,j.jsxs)(`div`,{className:`action-error-summary`,children:[(0,j.jsx)(`strong`,{children:t?`EveryAPI 认证未注入当前进程`:n?`模型尚未配置认证`:`发送失败`}),(0,j.jsx)(`span`,{children:t?`请用 everyapi use pi-harness 启动,或设置 EVERYAPI_RELAY_KEY 后重启。`:n?`请在设置 → 提供商中配置 API key,然后重试。`:`运行时没有接受这次请求,请重试或查看错误详情。`})]}),(0,j.jsxs)(`details`,{children:[(0,j.jsx)(`summary`,{children:`查看原始错误`}),(0,j.jsx)(`code`,{children:e})]})]})}function kc({text:e}){let t=Ye(e);return(0,j.jsxs)(`div`,{className:`user-bubble`,children:[(0,j.jsx)(`span`,{children:t.question}),t.count>0?(0,j.jsxs)(`span`,{className:`ml-2 inline-flex rounded-md bg-[#edf3fe] px-1.5 py-0.5 text-[10px] text-[#315fb8]`,children:[`批注 ×`,t.count]}):null]})}function Ac({event:e,onClose:t,onCopy:n}){if(!e)return(0,j.jsxs)(`aside`,{className:`details-panel`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`事件详情`}),(0,j.jsx)(`button`,{"aria-label":`关闭事件详情`,onClick:t,type:`button`,children:`×`})]}),(0,j.jsx)(`div`,{className:`details-body`,children:(0,j.jsx)(`div`,{className:`empty-state`,children:`选择轨迹中的事件查看原始数据。`})})]});let r=e.output??e.result??e.message,i=e.type===`file`||e.type===`file_diff`,a=i?[[`来源`,`/api/files`],[`文件`,$(e.path)]]:[[`来源`,$(e.type??e.source,`event`)],[`产生者`,$(e.by??e.source)],[`耗时`,$(e.duration??e.dur)],[`时间`,$(e.timestamp??e.ts??e.time)]];return(0,j.jsxs)(`aside`,{className:`details-panel`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:_c(e)}),(0,j.jsx)(`button`,{"aria-label":i?`关闭文件差异`:`关闭事件详情`,onClick:t,type:`button`,children:`×`})]}),(0,j.jsxs)(`div`,{className:`details-body`,children:[(0,j.jsx)(`div`,{className:`detail-stats ${i?`is-file`:``}`,children:a.map(([e,t])=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`small`,{children:e}),(0,j.jsx)(`b`,{children:t})]},e))}),r!==void 0&&(0,j.jsxs)(`div`,{className:`detail-section`,children:[(0,j.jsx)(`small`,{children:`输出`}),(0,j.jsx)(`pre`,{className:`tool-output`,children:typeof r==`string`?r:JSON.stringify(r,null,2)})]}),(0,j.jsxs)(`div`,{className:`detail-section`,children:[(0,j.jsx)(`small`,{children:i?`数据来源`:`经过的插件`}),(0,j.jsx)(`div`,{className:`detail-plugin`,children:i?`Git workspace · /api/files`:`Runtime loader · event`})]}),(0,j.jsxs)(`div`,{className:`detail-actions`,children:[(0,j.jsx)(`button`,{onClick:n,type:`button`,children:`复制 JSON`}),(0,j.jsx)(`button`,{disabled:!0,title:`当前 API 未提供重放接口`,type:`button`,children:`重放`})]}),(0,j.jsxs)(`details`,{className:`raw-json`,children:[(0,j.jsx)(`summary`,{children:`原始 JSON`}),(0,j.jsx)(`pre`,{className:`raw-json-body`,children:JSON.stringify(e,null,2)})]})]})]})}function jc({events:e,onSelect:t}){let[n,r]=(0,o.useState)(`all`),i=(0,o.useMemo)(()=>{let t=new Map;return e.forEach(e=>{let n=$(e.type,`event`);t.set(n,(t.get(n)??0)+1)}),t},[e]),a=e.filter(e=>n===`all`||$(e.type,`event`)===n);return(0,j.jsxs)(`section`,{className:`view-panel trajectory-view`,children:[(0,j.jsxs)(`div`,{className:`trajectory-summary`,children:[(0,j.jsx)(`span`,{children:`按轮次`}),(0,j.jsxs)(`b`,{children:[e.length,` 个事件`]}),(0,j.jsx)(`div`,{className:`timeline`,children:e.length?e.map((e,t)=>(0,j.jsx)(`span`,{className:`timeline-turn`,children:(0,j.jsx)(`i`,{className:`timeline-strip`,title:_c(e)})},t)):(0,j.jsx)(`span`,{className:`timeline-empty`,children:`等待真实事件…`})})]}),(0,j.jsxs)(`div`,{className:`source-filters`,children:[(0,j.jsxs)(`button`,{className:`filter ${n===`all`?`active`:``}`,onClick:()=>r(`all`),type:`button`,children:[`全部 `,e.length]}),[...i].map(([e,t])=>(0,j.jsxs)(`button`,{className:`filter ${n===e?`active`:``}`,onClick:()=>r(e),type:`button`,children:[e,` `,t]},e))]}),(0,j.jsxs)(`div`,{className:`event-table`,children:[(0,j.jsxs)(`div`,{className:`event-head`,children:[(0,j.jsx)(`span`,{children:`时间`}),(0,j.jsx)(`span`,{children:`来源`}),(0,j.jsx)(`span`,{children:`事件`}),(0,j.jsx)(`span`,{children:`产生者`}),(0,j.jsx)(`span`,{children:`耗时`})]}),a.map((e,n)=>(0,j.jsxs)(`button`,{className:`event-row`,onClick:()=>t(e),type:`button`,children:[(0,j.jsx)(`span`,{children:$(e.timestamp??e.ts??e.time)}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`i`,{className:`event-dot`}),$(e.type,`event`)]}),(0,j.jsx)(`strong`,{children:_c(e)}),(0,j.jsx)(`span`,{children:$(e.by??e.source)}),(0,j.jsx)(`span`,{children:$(e.duration??e.dur)})]},n)),!a.length&&(0,j.jsx)(`div`,{className:`empty-state`,children:`暂无轨迹事件。`})]})]})}function Mc({files:e,api:t,onDiff:n,onRefresh:r}){let i=e.filter(e=>e.status.includes(`A`)||e.status===`??`).length,a=e.filter(e=>e.status.includes(`D`)).length,[s,c]=(0,o.useState)(``),[l,u]=(0,o.useState)(!1),[d,f]=(0,o.useState)(),[p,m]=(0,o.useState)(``),[h,g]=(0,o.useState)(!1),_=()=>{let n=s.trim();!n||l||(u(!0),m(``),t.commitFiles(e.map(e=>e.path),n).then(()=>{c(``),r()}).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>u(!1)))},v=()=>{!e.length||l||(g(!1),u(!0),m(``),t.revertFiles(e.map(e=>e.path)).then(r).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>u(!1)))},y=e=>{l||d||(f(e),m(``),n(e).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>f(void 0)))};return(0,j.jsxs)(`section`,{className:`view-panel files-view`,children:[(0,j.jsxs)(`div`,{className:`files-content`,children:[(0,j.jsxs)(`div`,{className:`files-title`,children:[(0,j.jsx)(`strong`,{children:`本次会话改动`}),(0,j.jsx)(`span`,{children:`由 /api/files 提供`})]}),(0,j.jsx)(`div`,{className:`file-summary`,children:`${e.length} 个文件 · ${i} 个新增 · ${a} 个删除`}),(0,j.jsx)(`div`,{className:`file-list`,children:e.length?e.map(e=>(0,j.jsxs)(`div`,{className:`file-row`,children:[(0,j.jsx)(`b`,{className:`file-kind ${e.label===`untracked`?`new`:``}`,children:e.label}),(0,j.jsx)(`code`,{children:e.path}),(0,j.jsx)(`span`,{className:e.status.includes(`D`)?`del`:`add`,children:e.status}),(0,j.jsx)(`button`,{"aria-label":`${d===e.path?`正在读取`:`查看`}${e.path}的差异`,className:`diff-button`,disabled:l||d!==void 0,onClick:()=>y(e.path),type:`button`,children:d===e.path?`读取中…`:`查看差异`})]},e.path)):(0,j.jsx)(`div`,{className:`empty-state`,children:`工作区没有未提交改动。`})}),e.length>0&&(0,j.jsxs)(`div`,{className:`file-actions`,children:[(0,j.jsx)(`input`,{"aria-label":`提交说明`,onChange:e=>c(e.target.value),placeholder:`提交说明`,value:s}),(0,j.jsx)(`button`,{className:`primary`,disabled:l||!s.trim(),onClick:_,type:`button`,children:l?`处理中…`:`提交这些改动`}),(0,j.jsx)(`button`,{disabled:l,onClick:()=>g(!0),type:`button`,children:`全部撤销`})]}),p&&(0,j.jsx)(`p`,{className:`files-error`,children:p})]}),h&&(0,j.jsx)(Tc,{busy:l,confirmLabel:`确认撤销`,description:`这会丢弃当前工作区的全部未提交改动,此操作不可恢复。`,onClose:()=>g(!1),onConfirm:v,target:`${e.length} 个文件`,title:`撤销全部改动`})]})}function Nc(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??$(e)}catch{return $(e)}}function Pc(e){try{if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return;let n=Object.getOwnPropertyDescriptors(e);if(Reflect.ownKeys(n).some(e=>typeof e!=`string`))return;let r=Object.create(null);for(let[e,t]of Object.entries(n)){if(!(`value`in t))return;r[e]=t.value}return r}catch{return}}function Fc({panel:e,inline:t=!1}){let n=Pc(e.data),r=n?Object.entries(n):[[`内容`,e.data]],i=n&&Array.isArray(n.items)?n.items:[],a=n&&Array.isArray(n.entries)?n.entries:[],o=n&&Array.isArray(n.capabilities)?n.capabilities:[];return(0,j.jsxs)(`div`,{className:`plugin-panel-card ${t?`pt-1`:`rounded-[10px] border border-[#e3e7ee] bg-white p-4 shadow-[0_8px_24px_rgba(27,39,64,0.04)]`}`,children:[(0,j.jsxs)(`header`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-[#edf3fe] font-mono text-[15px] text-[#3565c5]`,children:e.icon??`◈`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`strong`,{className:`block text-[13px] font-semibold text-[#20252b]`,children:e.title}),(0,j.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-[#687381]`,children:e.description??e.pluginId.replace(/cordis/gi,`runtime`)})]})]}),e.error?(0,j.jsx)(`div`,{className:`mt-3 rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[12px] text-[#b42318]`,children:e.error}):e.id===`console-logger-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]`,children:`最近日志`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[20px] font-semibold text-[#20252b]`,children:$(n?.total??0)})]}),(0,j.jsx)(`div`,{className:`max-h-48 overflow-auto rounded-lg border border-[#edf0f3]`,children:i.length?i.map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr] gap-2 border-b border-[#edf0f3] px-3 py-2 last:border-b-0`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:$(n.level??`log`)}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[11px] text-[#30343b]`,children:$(n.source??`runtime`)}),(0,j.jsx)(`span`,{className:`block whitespace-pre-wrap break-words text-[11px] leading-4 text-[#65707b]`,children:Nc(n.args??``)})]})]},`${$(n.time??`log`)}-${t}`)}):(0,j.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#687381]`,children:`暂无日志输出。`})})]}):e.id===`plugin-group-panel`?(0,j.jsx)(`div`,{className:`mt-3 max-h-64 overflow-auto rounded-lg border border-[#edf0f3]`,children:a.length?a.map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[#edf0f3] px-3 py-2 last:border-b-0`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${n.enabled===!1?`bg-[#a0a8b2]`:`bg-[#22c55e]`}`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]`,children:$(n.name??`plugin`)}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:$(n.state??`unknown`)})]},`${$(n.id??`plugin`)}-${t}`)}):(0,j.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#687381]`,children:`暂无插件条目。`})}):e.id===`timer-service-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3 rounded-lg bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]`,children:`服务状态`}),(0,j.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[10px] font-semibold ${n?.registered===!0?`bg-[#e8f8ee] text-[#14733f]`:`bg-[#fff4e5] text-[#8a5a00]`}`,children:n?.registered===!0?`已注册`:`未注册`})]}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.map((e,t)=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:$(e)},`${$(e)}-${t}`))})]}):e.id===`agent-teams-panel`?(()=>{let e=ws(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:[[`成员`,e.inventory.members.total],[`任务`,e.inventory.tasks.total],[`未读消息`,e.inventory.messages.unread],[`可执行任务`,e.inventory.tasks.ready]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),e.dependencyCycle!==null&&e.dependencyCycle.length>1?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[11px] text-[#b42318]`,children:[`依赖循环:`,e.dependencyCycle.join(` → `)]}):null,(0,j.jsx)(`div`,{className:`grid gap-2`,children:e.members.length>0?e.members.map(e=>(0,j.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[#edf0f3] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.status===`working`?`bg-[#22c55e]`:`bg-[#a0a8b2]`}`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-semibold text-[#30343b]`,children:e.name}),(0,j.jsx)(`span`,{className:`truncate text-[10px] text-[#687381]`,children:e.role}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#3565c5]`,children:e.status})]},e.id)):(0,j.jsx)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]`,children:`暂无协作角色。`})}),(0,j.jsx)(`div`,{className:`grid gap-2`,children:e.tasks.length>0?e.tasks.map(e=>(0,j.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[#edf0f3] px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-[11px] text-[#30343b]`,children:e.title}),e.dependsOn.length>0?(0,j.jsxs)(`span`,{className:`mt-0.5 block truncate font-mono text-[9px] text-[#687381]`,children:[`依赖:`,e.dependsOn.join(`, `)]}):null]}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:e.assignee}),(0,j.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[10px] ${e.status===`blocked`?`bg-[#fff4e5] text-[#8a5a00]`:e.status===`done`?`bg-[#e8f8ee] text-[#14733f]`:`bg-[#edf3fe] text-[#3565c5]`}`,children:e.status})]},e.id)):(0,j.jsx)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]`,children:`还没有任务。可让 Agent 使用 team_task 创建。`})}),(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`会话内邮箱备注`}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:[e.inventory.messages.shown,` / `,e.inventory.messages.total]})]}),e.messages.length>0?[...e.messages].reverse().map(e=>(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${e.read?`border-[#edf0f3] bg-white`:`border-[#cfe0ff] bg-[#f4f8ff]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[e.from,` → `,e.to]}),(0,j.jsx)(`span`,{className:`ml-auto`,children:e.read?`已读`:`未读`})]}),(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-[#30343b]`,children:e.body})]},e.id)):(0,j.jsx)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]`,children:`暂无邮箱备注。`})]}),e.truncated||e.inventory.members.truncated||e.inventory.tasks.truncated||e.inventory.messages.truncated?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:`面板按固定安全上限展示;完整计数保留在上方。`}):null,(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`这是当前 Pi 会话的协作账本,不会启动其他 Agent、创建进程或向外部发送消息。`})]})})():e.id===`modlens-panel`?(()=>{let t=Rs(e.data),n=t.status.state===`running`?`正在读取视觉内容`:t.status.state===`failed`?`视觉检查失败`:t.status.state===`cancelled`?`视觉检查已取消`:t.status.state===`completed`?`视觉检查完成`:`等待图片`,r=t.status.state===`idle`?t.image?.mode:t.status.mode,i=t.status.state===`idle`?t.image?.path:t.status.path,a=t.status.state===`failed`?`border-[#f4caca] bg-[#fff5f5]`:t.status.state===`cancelled`?`border-[#f1d7a8] bg-[#fff9ed]`:t.status.state===`running`?`border-[#c9d9f7] bg-[#f4f8ff]`:t.attached?`border-[#b9e6c9] bg-[#f0fbf4]`:`border-[#e3e7ee] bg-[#f6f8fa]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${a}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:n}),(0,j.jsx)(`span`,{className:`rounded-full border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[9px] text-[#3565c5]`,children:r===`native`?`原生直传`:r===`evidence`?`ModLens 证据`:`vision_inspect`})]}),i===void 0?null:(0,j.jsx)(`p`,{className:`mt-2 truncate font-mono text-[10px] text-[#65707b]`,children:i}),t.image===null?t.status.state===`idle`?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:`让 Agent 调用 vision_inspect,并提供工作区内的图片路径。`}):null:(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{children:t.image.mimeType}),(0,j.jsxs)(`span`,{children:[t.image.bytes.toLocaleString(),` bytes`]}),t.image.cached?(0,j.jsx)(`span`,{className:`font-semibold text-[#14733f]`,children:`缓存命中`}):null]}),t.status.state===`failed`||t.status.state===`cancelled`?(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4 text-[#9b2c24]`,children:t.status.error}):null]}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.supportedTypes.map(e=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:e},e))}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 font-mono text-[9px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`image:`,Math.round(t.limits.imageBytes/1048576),`MiB`]}),(0,j.jsxs)(`span`,{children:[`evidence:`,Math.round(t.limits.evidenceBytes/1024),`KiB`]}),(0,j.jsxs)(`span`,{children:[`timeout:`,Math.round(t.limits.timeoutMs/1e3),`s`]}),(0,j.jsxs)(`span`,{children:[`cache:`,t.limits.cacheEntries]})]}),t.truncated?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:`异常面板数据已按固定安全边界丢弃或截断。`}):null,(0,j.jsx)(`p`,{className:`rounded-lg border border-[#dce5f5] bg-[#f7f9fd] px-3 py-2 text-[10px] leading-4 text-[#566273]`,children:`纯文本模型会启动外部 ModLens 引擎,可能使用网络和 provider 配额并产生费用。视觉证据是不可信数据,不构成指令或用户授权。`})]})})():e.id===`vision-toolkit-panel`?(()=>{let t=ec(e.data),n=t.report,r=t.status.state===`running`?t.status.operation===`catalog`?`正在盘点视觉素材`:`正在读取图片元数据`:t.status.state===`failed`?`视觉素材检查失败`:t.status.state===`cancelled`?`视觉素材检查已取消`:t.status.state===`completed`?`视觉素材检查完成`:`等待检查`,i=t.status.state===`failed`?`border-[#f4caca] bg-[#fff5f5]`:t.status.state===`cancelled`?`border-[#f1d7a8] bg-[#fff9ed]`:t.status.state===`running`?`border-[#c9d9f7] bg-[#f4f8ff]`:t.status.state===`completed`?`border-[#b9e6c9] bg-[#f0fbf4]`:`border-[#e3e7ee] bg-[#f6f8fa]`,a=n?.assets.slice(0,20)??[],o=n?.issues.slice(0,10)??[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${i}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:r}),(0,j.jsx)(`span`,{className:`rounded-full border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[9px] text-[#3565c5]`,children:t.status.state===`idle`?`vision_catalog`:t.status.operation===`catalog`?`catalog`:`image info`})]}),t.status.state!==`idle`&&t.status.path!==void 0?(0,j.jsx)(`p`,{className:`mt-2 truncate font-mono text-[10px] text-[#65707b]`,children:t.status.path}):null,t.status.state===`failed`||t.status.state===`cancelled`?(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4 text-[#9b2c24]`,children:t.status.error}):null]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[[`已扫描`,n?.scannedEntries??0],[`候选图片`,n?.inspectedCandidates??0],[`有效素材`,n?.assets.length??0],[`问题`,n?.issues.length??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:e}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[16px] text-[#30343b]`,children:t})]},e))}),a.length>0?(0,j.jsx)(`div`,{className:`max-h-52 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd]`,children:a.map((e,t)=>(0,j.jsxs)(`div`,{className:`border-b border-[#edf0f3] px-3 py-2 last:border-b-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[10px] text-[#30343b]`,title:e.path,children:e.path}),(0,j.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] text-[#3565c5]`,children:e.width===null?`?×?`:`${e.width}×${e.height}`})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 text-[9px] text-[#687381]`,children:[(0,j.jsx)(`span`,{children:e.mimeType}),(0,j.jsxs)(`span`,{children:[e.bytes.toLocaleString(),` B`]}),e.headerTruncated?(0,j.jsx)(`span`,{className:`text-[#8a6200]`,children:`仅扫描前 256 KiB`}):null]})]},`${e.path}-${t}`))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:n===null?`让 Agent 调用 vision_catalog 盘点工作区图片,或调用 vision_image_info 检查单张图片。`:`未发现有效的受支持图片。`}),o.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f1d7a8] bg-[#fff9ed] px-3 py-3`,children:[(0,j.jsxs)(`p`,{className:`text-[10px] font-semibold text-[#8a6200]`,children:[`图片问题(显示 `,o.length,` 条)`]}),(0,j.jsx)(`div`,{className:`mt-2 grid gap-1.5`,children:o.map((e,t)=>(0,j.jsxs)(`p`,{className:`break-words font-mono text-[9px] leading-4 text-[#6f5730]`,children:[e.path,`: `,e.reason]},`${e.path}-${t}`))})]}):null,(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.supportedTypes.map(e=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[9px] text-[#3565c5]`,children:e},e)),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#e3e7ee] bg-[#f6f8fa] px-2 py-1 font-mono text-[9px] text-[#687381]`,children:[`file≤`,Math.round(t.limits.imageBytes/1048576),`MiB`]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#e3e7ee] bg-[#f6f8fa] px-2 py-1 font-mono text-[9px] text-[#687381]`,children:[`assets≤`,t.limits.assets]})]}),t.truncated||n?.truncated===!0||n?.issuesTruncated===!0||n!==null&&(n.assets.length>a.length||n.issues.length>o.length)?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:`面板或扫描结果已按固定安全上限截断;计数与警告会保留可见。`}):null,(0,j.jsx)(`p`,{className:`rounded-lg border border-[#dce5f5] bg-[#f7f9fd] px-3 py-2 text-[10px] leading-4 text-[#566273]`,children:`仅在当前 workspace 内本地读取图片头部,不上传图片、不调用外部视觉服务;这里展示的是元数据,不是完整图像解码结果。`})]})})():e.id===`at-file-panel`?(()=>{let t=kt(e.data);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`最近附加`}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:`file_context`})]}),t.lastFile===null?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:`还没有附加文件。可使用 @file 或让 Agent 调用 file_context。`}):(0,j.jsxs)(`p`,{className:`mt-2 min-w-0 whitespace-normal break-all text-[11px] leading-4 text-[#65707b]`,children:[t.lastFile.path,` · `,t.lastFile.bytes,` bytes`]})]}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-[#687381]`,children:[(0,j.jsx)(`span`,{children:`单文件上限`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[t.maxBytes,` bytes`]})]}),t.truncated?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:`面板数据不完整或已按固定安全上限调整。`}):null]})})():e.id===`git-time-capsule-panel`?(()=>{let e=Ti(n),t=e.latest,r=t?.status===`completed`?`已完成`:t?.status===`cancelled`?`已取消`:`失败`,i=t?.status===`completed`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#147a43]`:t?.status===`cancelled`?`border-[#f1ddb1] bg-[#fff9eb] text-[#996515]`:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${t===null?`border-[#e3e7ee] bg-[#f6f8fa]`:i}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:t?.action===`restore`?`最近撤销`:`最近捕获`}),t===null?(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:`git_snapshot`}):(0,j.jsx)(`span`,{className:`rounded-full border border-current px-2 py-0.5 text-[9px] font-semibold`,children:r})]}),t===null?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-[#687381]`,children:`当前没有撤销胶囊。先产生 unstaged tracked 改动,再让 Agent 调用 git_snapshot。`}):(0,j.jsxs)(`div`,{className:`mt-2 grid gap-1 text-[11px] text-[#65707b]`,children:[t.name===null?null:(0,j.jsx)(`p`,{className:`truncate font-mono text-[10px] text-[#30343b]`,children:t.name}),(0,j.jsxs)(`p`,{children:[t.files,` 个文件 · `,t.bytes,` bytes · `,(0,j.jsx)(`time`,{dateTime:t.at,children:t.at.replace(`T`,` `)})]}),t.error===null?null:(0,j.jsx)(`p`,{className:`break-words text-[#b42318]`,children:t.error})]})]}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`最近胶囊`}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px] text-[#3565c5]`,children:[e.inventory.shown,` / `,e.inventory.total]})]}),e.capsules.length>0?(0,j.jsx)(`div`,{className:`mt-2 max-h-44 overflow-y-auto border-l-2 border-[#cbd8ef] pl-3`,children:e.capsules.map(e=>(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-[#eef1f5] py-1.5 last:border-b-0`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] text-[#30343b]`,children:e.name}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[9px] text-[#687381]`,children:[e.bytes,` B`]})]},e.name))}):(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:`尚未保存 tracked diff。`}),e.inventory.truncated||e.truncated?(0,j.jsxs)(`p`,{className:`mt-2 text-[10px] text-[#996515]`,children:[`列表已按安全上限截断,仅展示最近 `,e.inventory.displayLimit,` 条有效记录。`]}):null]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{className:`rounded-md bg-[#f6f8fa] px-2 py-1.5`,children:[`Git 超时:`,e.timeoutMs,` ms`]}),(0,j.jsxs)(`span`,{className:`rounded-md bg-[#f6f8fa] px-2 py-1.5`,children:[`单胶囊:`,e.limits.capsuleBytes,` B`]})]}),(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`git_snapshot 捕获当前 unstaged tracked 改动;git_restore 会反向应用该 patch。staged 与未跟踪文件不包含在内,恢复必须传入 confirm=true。`})]})})():e.id===`dependency-checker-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=wr(n),t=e.missingCount>0||e.invalidCount>0||e.conflictCount>0,r=e.unresolvedCount>0||e.truncated;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[#65707b]`,children:e.manifest}),(0,j.jsx)(`strong`,{className:`shrink-0 font-mono uppercase text-[#315fb8]`,children:e.ecosystem})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-5`,children:[[`声明`,e.declared],[`已安装`,e.installed],[`问题`,e.missingCount+e.invalidCount],[`可选缺席`,e.optionalMissingCount],[`未决`,e.unresolvedCount]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsx)(`div`,{className:`min-w-0 break-words rounded-lg border px-3 py-3 text-[11px] [overflow-wrap:anywhere] ${t?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:r?`border-[#f3dfab] bg-[#fffaf0] text-[#8a6200]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:e.missingCount||e.invalidCount?`缺失 ${e.missingCount}、无效 ${e.invalidCount}:${[...e.missing,...e.invalid].join(`, `)}`:e.conflictCount?`本地安装存在 ${e.conflictCount} 组声明约束冲突。`:e.unresolvedCount?`${e.unresolvedCount} 组声明约束无法离线判定。`:e.truncated?`报告不完整,无法确认依赖状态。`:`依赖声明与本地安装一致。`}),e.optionalMissingCount>0?(0,j.jsxs)(`div`,{className:`min-w-0 break-words rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-2 text-[10px] text-[#8a6200] [overflow-wrap:anywhere]`,children:[`可选依赖未安装(`,e.optionalMissingCount,`):`,e.optionalMissing.join(`, `)]}):null,e.conflicts.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-3 text-[11px] text-[#8a6200]`,children:[(0,j.jsx)(`strong`,{children:`版本冲突`}),(0,j.jsx)(`ul`,{className:`mt-1 grid gap-1 pl-4`,children:e.conflicts.map((e,t)=>(0,j.jsxs)(`li`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[(0,j.jsx)(`code`,{children:e.name}),`:`,e.constraints.join(` · `)||`—`]},`${e.name}-${t}`))})]}):null,e.unresolved.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-3 text-[11px] text-[#8a6200]`,children:[(0,j.jsx)(`strong`,{children:`未决约束`}),(0,j.jsx)(`ul`,{className:`mt-1 grid gap-1 pl-4`,children:e.unresolved.map((e,t)=>(0,j.jsxs)(`li`,{className:`min-w-0 break-words [overflow-wrap:anywhere]`,children:[(0,j.jsx)(`code`,{children:e.name}),`:`,e.constraints.join(` · `)||`—`]},`${e.name}-${t}`))})]}):null,(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`本地只读扫描 · 上限 `,e.scanLimit,` 项`]}),e.truncated?(0,j.jsx)(`span`,{children:`面板明细已截断`}):null]})]})})()}):e.id===`token-guard-panel`?(()=>{let e=po(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${e.exceeded?`border-[#f4caca] bg-[#fff5f5]`:`border-[#e3eaf8] bg-[#f6f8ff]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`上下文预算`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[12px] text-[#315fb8]`,children:[e.percent===null?`—`:e.percent,`% / `,e.maxPercent,`%`]})]}),(0,j.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-[#dfe8fb]`,children:(0,j.jsx)(`div`,{className:`h-full rounded-full ${e.exceeded?`bg-[#d64545]`:`bg-[#5d8bea]`}`,style:{width:`${Math.min(100,e.percent??0)}%`}})}),(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-[#5d6d82]`,children:[e.tokens===null?`上下文 token 未知`:`${e.tokens.toLocaleString()} / ${e.contextWindow?.toLocaleString()??`—`} tokens`,` · 已请求停止 ${e.aborts} 次`]})]}),(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${e.runExceeded?`border-[#f4caca] bg-[#fff5f5]`:`border-[#e3eaf8] bg-[#f6f8ff]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`单次任务`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[12px] text-[#315fb8]`,children:[e.runTokens===null?`—`:e.runTokens.toLocaleString(),` / `,e.maxRunTokens===0?`—`:e.maxRunTokens.toLocaleString()]})]}),(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#5d6d82]`,children:e.maxRunTokens>0?`按 agent_start 后新增的已结算 token 熔断。`:`未启用绝对 Token 上限。`})]})]}),e.lastError===null?null:(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[10px] leading-4 text-[#b42318]`,children:[`保护器错误:`,e.lastError]})]})})():e.id===`test-harness-panel`?(()=>{let t=Wt(e.data),n=t.latest,r=n?.status===`passed`?`验证通过`:n?.status===`failed`?`验证失败`:n?.status===`timed-out`?`验证超时`:n?.status===`cancelled`?`验证已取消`:`等待验证`,i=n?.status===`passed`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:n?.status===`failed`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:n?.status===`timed-out`||n?.status===`cancelled`?`border-[#f1d7a8] bg-[#fff9ed] text-[#8a6200]`:`border-[#e3e7ee] bg-[#f6f8fa] text-[#687381]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid min-w-0 gap-3`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border px-3 py-3 ${i}`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`break-all font-mono text-[11px] font-semibold text-[#30343b]`,children:n?.command??`npm run test`}),(0,j.jsx)(`span`,{className:`rounded-full border border-current px-2 py-0.5 text-[9px] font-semibold`,children:r})]}),n===null?(0,j.jsx)(`p`,{className:`mt-2 text-[11px] leading-4 text-[#687381]`,children:`还没有执行验证脚本。可让 Agent 调用 run_project_tests。`}):(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`span`,{children:[`exit `,n.exitCode??`—`]}),n.signal===null?null:(0,j.jsx)(`span`,{children:n.signal}),(0,j.jsxs)(`span`,{children:[n.durationMs,` ms`]}),(0,j.jsxs)(`span`,{children:[n.outputBytes.toLocaleString(),` output bytes`]})]})]}),n!==null&&n.output!==``?(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#e3e7ee] bg-[#111318] p-3`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2 text-[9px] text-[#9ba6b2]`,children:[(0,j.jsx)(`span`,{className:`font-semibold uppercase tracking-[0.08em]`,children:`输出末尾`}),(0,j.jsxs)(`span`,{children:[`最多 `,t.limits.outputBytes,` bytes`]})]}),(0,j.jsx)(`pre`,{className:`max-h-52 min-w-0 overflow-auto whitespace-pre-wrap break-all font-mono text-[10px] leading-4 text-[#e6edf3]`,children:n.output})]}):null,n?.outputTruncated||n?.outputSanitized?(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:[n.outputTruncated?`输出只保留最后 12 KiB。`:``,n.outputSanitized?`终端控制字符已清理。`:``]}):null,(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.allowedScripts.map(e=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:e},e))}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1 font-mono text-[9px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`timeout `,t.limits.timeoutMs,` ms`]}),(0,j.jsxs)(`span`,{children:[`output `,t.limits.outputBytes,` bytes`]})]}),t.truncated?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#8a6200]`,children:`面板数据不完整或已按固定安全上限调整。`}):null,(0,j.jsx)(`p`,{className:`rounded-lg border border-[#f1d7a8] bg-[#fff9ed] px-3 py-2 text-[10px] leading-4 text-[#6f5730]`,children:`npm scripts 会执行当前项目定义的代码;仅在可信 workspace 中使用。Test Harness 不是沙箱,也不会把脚本输出当作用户授权。`})]})})():e.id===`session-insights-panel`?(()=>{let t=Zt(e.data),n=t.report;if(n===null)return(0,j.jsx)(`div`,{className:`mt-3 rounded-lg border border-[#f3c4c4] bg-[#fff4f4] px-3 py-3 text-[11px] leading-5 text-[#a23b3b]`,children:`会话统计数据无效,已停止展示指标,避免把损坏数据误报为健康状态。`});let r=n.contextUsage;return(0,j.jsxs)(`div`,{className:`mt-3 grid min-w-0 gap-3`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#e3e7ee] bg-white px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[9px] font-semibold uppercase tracking-[0.08em] text-[#7a8490]`,children:`Session`}),(0,j.jsx)(`p`,{className:`mt-1 min-w-0 break-all font-mono text-[10px] leading-4 text-[#3d4650]`,children:n.sessionId})]}),(0,j.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-2 min-[360px]:grid-cols-3`,children:[[`消息`,n.totalMessages.toLocaleString(`en-US`)],[`工具调用 / 结果`,`${n.toolCalls.toLocaleString(`en-US`)} / ${n.toolResults.toLocaleString(`en-US`)}`],[`成本`,`$${n.cost.toFixed(4)}`]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:e}),(0,j.jsx)(`strong`,{className:`mt-1 block break-all text-[16px] font-semibold text-[#30343b]`,children:t})]},e))}),(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`累计 token`}),(0,j.jsx)(`strong`,{className:`break-all font-mono text-[14px] text-[#315fb8]`,children:n.tokens.total.toLocaleString(`en-US`)})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-wrap gap-x-3 gap-y-1 text-[10px] leading-4 text-[#5d6d82]`,children:[(0,j.jsxs)(`span`,{children:[`输入 `,n.tokens.input.toLocaleString(`en-US`)]}),(0,j.jsxs)(`span`,{children:[`输出 `,n.tokens.output.toLocaleString(`en-US`)]}),(0,j.jsxs)(`span`,{children:[`缓存读取 `,n.tokens.cacheRead.toLocaleString(`en-US`)]}),(0,j.jsxs)(`span`,{children:[`缓存写入 `,n.tokens.cacheWrite.toLocaleString(`en-US`)]})]})]}),(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`当前上下文`}),r===null?null:r.percent===null?(0,j.jsx)(`strong`,{className:`text-[11px] font-semibold text-[#8a6200]`,children:`待下一次模型响应`}):(0,j.jsxs)(`strong`,{className:`font-mono text-[12px] text-[#315fb8]`,children:[r.percent.toFixed(1),`%`]})]}),r===null?(0,j.jsx)(`p`,{className:`mt-2 text-[10px] leading-4 text-[#687381]`,children:`当前模型未提供上下文窗口。`}):r.tokens===null?(0,j.jsxs)(`p`,{className:`mt-2 text-[10px] leading-4 text-[#687381]`,children:[`压缩后 token 暂不可估算 · 上下文窗口 `,r.contextWindow.toLocaleString(`en-US`)]}):(0,j.jsxs)(`p`,{className:`mt-2 text-[10px] leading-4 text-[#687381]`,children:[r.tokens.toLocaleString(`en-US`),` / `,r.contextWindow.toLocaleString(`en-US`),` tokens`]})]}),(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border px-3 py-3 ${{idle:`border-[#e3e7ee] bg-[#f6f8fa] text-[#687381]`,queued:`border-[#f1d7a8] bg-[#fff9ed] text-[#8a6200]`,running:`border-[#cbdaf6] bg-[#f3f7ff] text-[#315fb8]`,completed:`border-[#bfe4cb] bg-[#f1fbf4] text-[#287a43]`,failed:`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`,cancelled:`border-[#f1d7a8] bg-[#fff9ed] text-[#8a6200]`,unknown:`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`}[t.compaction.status]}`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.08em]`,children:`会话压缩`}),(0,j.jsx)(`strong`,{className:`text-[11px] font-semibold`,children:{idle:`尚未请求压缩`,queued:`等待 Agent 空闲`,running:`正在压缩`,completed:`压缩已完成`,failed:`压缩失败`,cancelled:`压缩已取消`,unknown:`压缩状态数据无效`}[t.compaction.status]})]}),t.compaction.error===null?null:(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4`,children:t.compaction.error})]}),t.malformed&&t.compaction.status!==`unknown`?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#a23b3b]`,children:`面板数据不完整或不一致。`}):null]})})():e.id===`session-bridge-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=So(n),t=[[`目标`,e.preview.goal],[`当前状态`,e.preview.currentState],[`下一步`,e.preview.nextStep]],r=[[`关键决策`,e.preview.decisions],[`关键文件`,e.preview.keyFiles]];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3 text-[11px] leading-5 text-[#315fb8]`,children:`预览不会创建目标会话,也不会修改源会话。`}),e.status.state===`failed`||e.status.state===`cancelled`?(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] leading-5 ${e.status.state===`failed`?`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`:`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`}`,children:[e.status.operation===`import`?`导入`:e.status.operation===`export`?`导出`:`预览`,e.status.state===`failed`?`失败`:`已取消`,e.status.error===null?``:`:${e.status.error}`]}):null,t.map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:e}),(0,j.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap break-words text-[11px] leading-5 text-[#30343b]`,children:t||`暂无`})]},e)),(0,j.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:r.map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:$(e)}),t.length>0?(0,j.jsx)(`ul`,{className:`mt-2 grid gap-1 text-[10px] leading-4 text-[#65707b]`,children:t.map((e,t)=>(0,j.jsx)(`li`,{className:`break-words`,children:e},`${e}-${t}`))}):(0,j.jsx)(`p`,{className:`mt-2 text-[10px] text-[#687381]`,children:`暂无`})]},$(e)))}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`格式 v`,e.formatVersion]}),(0,j.jsxs)(`span`,{children:[`最多 `,e.limits.messages,` 条消息`]}),(0,j.jsxs)(`span`,{children:[`正文 `,e.limits.totalMessageCharacters,` 字符`]}),(0,j.jsxs)(`span`,{children:[`附件标记 `,e.limits.attachments,` 个`]}),e.source===null?null:(0,j.jsxs)(`span`,{className:`max-w-full truncate`,children:[`来源 `,e.source.sessionId]}),e.latest===null?null:(0,j.jsx)(`span`,{children:e.latest.direction===`import`?`最近导入`:`最近导出`})]})]})})()}):e.id===`session-compare-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.left&&typeof n.left==`object`&&n?.right&&typeof n.right==`object`?(()=>{let e=n.left,t=n.right;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[[`左侧会话`,e],[`右侧会话`,t]].map(([e,t])=>{let n=t;return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-2 block truncate text-[12px] text-[#30343b]`,children:$(n.name??n.id)}),(0,j.jsx)(`code`,{className:`mt-1 block truncate text-[10px] text-[#315fb8]`,children:$(n.id)}),(0,j.jsxs)(`span`,{className:`mt-1 block text-[10px] text-[#65707b]`,children:[$(n.messageCount,`0`),` 条消息`]})]},$(e))})}),(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`共享`,n.shared??0],[`右侧新增`,Array.isArray(n.added)?n.added.length:0],[`左侧删除`,Array.isArray(n.removed)?n.removed.length:0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsx)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${n.changed===!0?`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:n.changed===!0?`两个会话存在消息差异。`:`两个会话内容一致。`}),Array.isArray(n.added)&&n.added.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:`右侧新增消息`}),(0,j.jsx)(`ul`,{className:`mt-2 grid gap-1 text-[10px] leading-4 text-[#65707b]`,children:n.added.slice(0,4).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`li`,{children:[`[`,$(n.role),`] `,$(n.text)]},`${$(n.role)}-${t}`)})})]}):null]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`执行 session_compare 后显示两个会话的差异。`})}):e.id===`secure-audit-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:[[`扫描文件`,n?.scanned??0],[`严重`,n?.critical??0],[`高风险`,n?.high??0],[`总发现`,n?.total??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-2 py-2 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[16px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsx)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${Number(n?.total??0)>0?`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:Number(n?.total??0)>0?`发现需要人工确认的安全风险。`:`未发现凭据泄露或危险命令。`}),Array.isArray(n?.findings)&&n.findings.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:n.findings.slice(0,6).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=$(n.severity,`medium`);return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`code`,{className:`min-w-0 truncate text-[10px] text-[#315fb8]`,children:$(n.path)}),(0,j.jsx)(`span`,{className:`shrink-0 text-[10px] font-semibold ${r===`critical`?`text-[#b42318]`:`text-[#9a6700]`}`,children:r})]}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] leading-4 text-[#65707b]`,children:[`第 `,$(n.line),` 行 · `,$(n.message)]})]},`${$(n.path)}-${$(n.line)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`运行 security_audit 后显示脱敏结果。`})]}):e.id===`context-doctor-panel`?(()=>{let e=Ya(n),t={idle:`尚未请求`,queued:`已排队`,running:`压缩中`,completed:`已完成`,failed:`失败`,cancelled:`已取消`,unknown:`未知`},r=e.compaction.status===`completed`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:e.compaction.status===`failed`?`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`:e.compaction.status===`cancelled`?`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`:`border-[#dce5f5] bg-[#f6f8ff] text-[#3565c5]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${e.status===`warning`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:e.status===`ok`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:`border-[#e3e7ee] bg-[#f6f8fa] text-[#687381]`}`,children:e.status===`warning`?`需要关注上下文风险。`:e.status===`ok`?`上下文状态正常。`:`上下文状态不可用。`}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[[`占用`,e.usagePercent===null?`—`:`${e.usagePercent}%`],[`超限/不可测`,e.oversizedMessages],[`无法安全检查`,e.uninspectableMessages],[`工具错误`,e.toolErrors]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:e}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:t})]},String(e)))}),e.compaction.status===`idle`||e.compaction.status===`unknown`?null:(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${r}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{children:`最近压缩`}),(0,j.jsx)(`strong`,{children:t[e.compaction.status]})]}),e.compaction.error===null?null:(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4`,children:e.compaction.error})]}),e.recommendations.length>0?(0,j.jsxs)(`ul`,{className:`grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]`,children:[e.recommendations.map((e,t)=>(0,j.jsx)(`li`,{children:e},`${e}-${t}`)),e.recommendationsTruncated?(0,j.jsx)(`li`,{children:`部分建议因浏览器显示上限被省略。`}):null]}):null,(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`扫描 `,e.scannedMessages,` / `,e.messageCount,` 条消息`,e.messagesTruncated?`(已截断)`:``]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`告警阈值 `,e.warnPercent,`%`]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`大消息阈值 `,e.maxMessageBytes,`B`]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`结构预算 `,e.limits.jsonNodesPerAudit,` 节点 / 深度 `,e.limits.jsonDepth]})]})]})})():e.id===`history-compressor-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[11px] text-[#30343b]`,children:n?.enabled===!0?`自动压缩已启用`:`自动压缩已停用`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[11px] text-[#3565c5]`,children:[`阈值 `,$(n?.thresholdPercent??`—`),`%`]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`已压缩`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:$(n?.compactions??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`当前占用`}),(0,j.jsxs)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:[$(n?.lastUsagePercent??`—`),`%`]})]})]}),n?.lastError?(0,j.jsxs)(`p`,{className:`text-[11px] text-[#b42318]`,children:[`最近错误:`,$(n.lastError)]}):null]}):e.id===`session-export-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest;return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:`最近导出`}),(0,j.jsx)(`code`,{className:`mt-2 block truncate text-[11px] text-[#315fb8]`,children:$(e.path??`pi-session.md`)}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] text-[#65707b]`,children:[$(e.messages??0),` 条消息 · `,$(e.bytes??0),` bytes`]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有导出当前会话。`}),(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`导出文件只允许写入当前工作区内的 .md 路径,覆盖已有文件需要显式确认。`})]}):e.id===`session-search-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[n?.query?(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`code`,{className:`min-w-0 truncate text-[11px] text-[#315fb8]`,children:$(n.query)}),(0,j.jsxs)(`strong`,{className:`ml-3 shrink-0 text-[11px] text-[#3565c5]`,children:[$(n.total??0),` 个会话`]})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`输入查询后显示匹配的历史会话。`}),Array.isArray(n?.items)&&n.items.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:n.items.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=Array.isArray(n.hits)?n.hits:[];return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[11px] text-[#30343b]`,children:$(n.name??n.id??`未命名会话`)}),(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[10px] leading-4 text-[#65707b]`,children:r.map(e=>$(typeof e==`object`&&e?e.text??``:e)).join(` | `)})]},`${$(n.id??`session`)}-${t}`)})}):n?.query?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有找到匹配的历史会话。`}):null]}):e.id===`session-bookmarks-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] text-[#65707b]`,children:`当前会话的持久化书签`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[11px] text-[#3565c5]`,children:[$(n?.total??0),` 个书签`]})]}),Array.isArray(n?.bookmarks)&&n.bookmarks.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:n.bookmarks.slice(0,12).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[11px] text-[#30343b]`,children:$(n.label??`未命名书签`)}),(0,j.jsxs)(`code`,{className:`mt-1 block truncate text-[10px] text-[#687381]`,children:[`entry: `,$(n.entryId??`—`)]})]},`${$(n.id??`bookmark`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有标记重要节点。`}),(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`书签独立保存在 agent 目录,不会改写 Pi 原生会话记录。`})]}):e.id===`llm-verifier-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] text-[#65707b]`,children:`校验模型`}),(0,j.jsxs)(`code`,{className:`max-w-[65%] truncate text-[11px] text-[#315fb8]`,children:[$(n?.provider??`—`),`/`,$(n?.model??`—`)]})]}),n?.history&&typeof n.history==`object`?(()=>{let e=n.history,t=e.counts&&typeof e.counts==`object`?e.counts:{};return(0,j.jsxs)(`div`,{className:`grid grid-cols-4 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-2 py-2 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`累计`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[15px] text-[#30343b]`,children:$(e.total??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f0fbf4] px-2 py-2 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#14733f]`,children:`通过`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[15px] text-[#14733f]`,children:$(t.pass??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#fff5f5] px-2 py-2 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#b42318]`,children:`失败`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[15px] text-[#b42318]`,children:$(t.fail??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#fffaf0] px-2 py-2 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#9a6700]`,children:`未知`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[15px] text-[#9a6700]`,children:$(t.unknown??0)})]})]})})():null,n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=$(e.verdict??`unknown`);return(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${t===`pass`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:t===`fail`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`strong`,{className:`uppercase`,children:t}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px]`,children:[$(e.evidenceChars??0),` chars`]})]}),(0,j.jsx)(`p`,{className:`mt-2 leading-4`,children:$(e.rationale??`没有返回校验理由。`)}),(0,j.jsxs)(`p`,{className:`mt-2 truncate text-[10px] opacity-70`,children:[`声明:`,$(e.claim??`—`)]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有执行模型校验。`}),(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`证据按不可信数据处理,输入有长度上限;模型返回非结构化结果时显示 unknown。`})]}):e.id===`module-search-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.matches)?e.matches:[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`code`,{className:`min-w-0 truncate text-[11px] text-[#315fb8]`,children:$(e.query??``)}),(0,j.jsxs)(`strong`,{className:`ml-3 shrink-0 text-[11px] text-[#3565c5]`,children:[$(t.length),` 个结果`]})]}),t.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:t.slice(0,10).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsxs)(`code`,{className:`min-w-0 truncate text-[10px] text-[#315fb8]`,children:[$(n.path??`—`),`:`,$(n.line??`—`)]}),(0,j.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase text-[#687381]`,children:$(n.kind??`symbol`)})]}),(0,j.jsx)(`p`,{className:`mt-1 truncate text-[10px] text-[#65707b]`,children:$(n.name??`未命名符号`)})]},`${$(n.path??`module`)}:${$(n.line??t)}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有找到匹配的模块符号。`}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`扫描 `,$(e.scannedFiles??0),` 个源码文件,跳过依赖和构建目录。`]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`输入符号名后显示模块检索结果。`})}):e.id===`better-sidebar-panel`?(()=>{let e=Array.isArray(n?.changedFiles)?n.changedFiles:[],t=n?.clean===!0;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`code`,{className:`min-w-0 truncate text-[11px] text-[#315fb8]`,children:$(n?.cwd??`当前工作区`)}),(0,j.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] ${t?`bg-[#eaf8f0] text-[#14733f]`:`bg-[#fff0f0] text-[#b42318]`}`,children:t?`clean`:`${$(n?.changedCount??e.length)} 个变更`})]}),(0,j.jsx)(`p`,{className:`mt-2 font-mono text-[10px] text-[#65707b]`,children:$(n?.summary??`等待工作区扫描`)}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] text-[#687381]`,children:[`会话 `,$(n?.sessionId??`—`),` · 目录 `,$(n?.directoryCount??0),` · 文件 `,$(n?.fileCount??0)]})]}),e.length>0?(0,j.jsx)(`div`,{className:`grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`code`,{className:`truncate py-0.5 text-[10px] text-[#65707b]`,children:[$(n.status??`??`),` `,$(n.path??`未命名`)]},`${$(n.path??`file`)}-${t}`)})}):null,n?.truncated===!0?(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`目录摘要已截断,执行 sidebar_overview 获取最新概览。`}):null]})})():e.id===`workspace-navigator-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.nodes)?e.nodes:[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`code`,{className:`min-w-0 truncate text-[11px] text-[#315fb8]`,children:$(e.path??`.`)}),(0,j.jsxs)(`strong`,{className:`ml-3 shrink-0 text-[11px] text-[#3565c5]`,children:[$(t.length),` 个节点`]})]}),t.length>0?(0,j.jsx)(`div`,{className:`grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:t.slice(0,36).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=typeof n.depth==`number`?Math.min(6,Math.max(1,n.depth)):1;return(0,j.jsxs)(`div`,{className:`flex items-center gap-2 truncate py-1 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`span`,{className:`shrink-0 text-[#687381]`,children:[`· `.repeat(r-1),n.kind===`directory`?`▾`:`·`]}),(0,j.jsx)(`code`,{className:`truncate`,children:$(n.name??n.path??`未命名`)})]},`${$(n.path??`node`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`当前目录为空。`}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`目录 `,$(e.directoryCount??0),` 个,文件 `,$(e.fileCount??0),` 个;跳过依赖和构建目录。`]}),n?.git&&typeof n.git==`object`?(()=>{let e=n.git,t=Array.isArray(e.entries)?e.entries:[],r=e.available===!0;return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-medium text-[#253044]`,children:`Git 状态`}),(0,j.jsx)(`span`,{className:`text-[10px] ${r?e.clean===!0?`text-[#14733f]`:`text-[#b42318]`:`text-[#687381]`}`,children:r?e.clean===!0?`clean`:`${t.length} 个变更`:`不可用`})]}),r?(0,j.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-[#65707b]`,children:$(e.branch??`detached HEAD`)}):null,t.length>0?(0,j.jsx)(`div`,{className:`mt-2 grid gap-1`,children:t.slice(0,12).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`code`,{className:`truncate text-[10px] text-[#65707b]`,children:[$(n.status??`??`),` `,$(n.path??`未命名`)]},`${$(n.path??`file`)}-${t}`)})}):null]})})():null]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`执行 workspace_tree 后显示工作区结构。`})}):e.id===`prompt-library-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[Array.isArray(n?.templates)&&n.templates.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:n.templates.slice(0,12).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=Array.isArray(n.tags)?n.tags.filter(e=>typeof e==`string`):[];return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`strong`,{className:`truncate text-[11px] text-[#253044]`,children:$(n.title??`未命名提示词`)}),(0,j.jsx)(`code`,{className:`shrink-0 text-[10px] text-[#687381]`,children:$(n.id??`—`)})]}),(0,j.jsx)(`p`,{className:`mt-2 line-clamp-2 text-[10px] leading-4 text-[#65707b]`,children:$(n.prompt??``)}),r.length>0?(0,j.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:r.slice(0,6).map(e=>(0,j.jsx)(`span`,{className:`rounded bg-[#f6f8ff] px-1.5 py-0.5 text-[9px] text-[#315fb8]`,children:e},e))}):null]},`${$(n.id??`prompt`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有保存的提示词。可让 Agent 调用 prompt_library 保存模板。`}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`共 `,$(n?.total??0),` 个模板,数据跟随当前会话。`]})]}):e.id===`colleague-skill-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=t=>Array.isArray(e[t])?e[t].filter(e=>typeof e==`string`):[],r=t(`constraints`),i=t(`files`),a=t(`acceptance`);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] text-[#65707b]`,children:`交接给`}),(0,j.jsx)(`strong`,{className:`text-[11px] text-[#315fb8]`,children:$(e.toRole)})]}),(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3 text-[11px] text-[#253044]`,children:$(e.objective)}),e.context?(0,j.jsx)(`p`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2 text-[10px] leading-4 text-[#65707b]`,children:$(e.context)}):null,i.length>0?(0,j.jsx)(`div`,{className:`grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:i.slice(0,8).map(e=>(0,j.jsx)(`code`,{className:`truncate text-[10px] text-[#65707b]`,children:e},e))}):null,r.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#fffaf0] px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`text-[10px] text-[#9a6700]`,children:`约束`}),(0,j.jsx)(`ul`,{className:`mt-1 grid gap-1 text-[10px] text-[#65707b]`,children:r.slice(0,8).map((e,t)=>(0,j.jsxs)(`li`,{children:[`• `,e]},`${e}-${t}`))})]}):null,a.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f0fbf4] px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`text-[10px] text-[#14733f]`,children:`验收条件`}),(0,j.jsx)(`ul`,{className:`mt-1 grid gap-1 text-[10px] text-[#65707b]`,children:a.slice(0,8).map((e,t)=>(0,j.jsxs)(`li`,{children:[`• `,e]},`${e}-${t}`))})]}):null,(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`span`,{children:[`约束 `,r.length,` 条`]}),(0,j.jsxs)(`span`,{children:[`验收 `,a.length,` 条`]})]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`执行 colleague_handoff 后显示角色交接包。`})}):e.id===`reverse-skill-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] text-[#65707b]`,children:`复核风险内容`}),(0,j.jsx)(`strong`,{className:`font-mono text-[11px] text-[#3565c5]`,children:n?.allowReviewByDefault===!0?`已允许`:`默认阻断`})]}),n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=$(e.risk??`safe`),r=Array.isArray(e.findings)?e.findings:[];return(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${t===`blocked`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:t===`review`?`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`strong`,{className:`uppercase`,children:t}),(0,j.jsx)(`span`,{className:`font-mono text-[10px]`,children:e.contentIncluded===!0?`可注入`:`已隔离`})]}),(0,j.jsxs)(`p`,{className:`mt-2`,children:[$(e.name??`未命名 Skill`),` · `,$(r.length),` 个风险项`]}),r.length>0?(0,j.jsx)(`p`,{className:`mt-1 text-[10px] opacity-80`,children:r.slice(0,2).map(e=>$(e)).join(`;`)}):null]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`执行 skill_inject 后显示隔离结果。`}),(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`安全内容会被包裹为不可信数据;review 风险默认不注入,blocked 内容永不返回原文。`})]}):e.id===`reviewer-bot-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.latest!==null&&n?.latest!==void 0&&typeof n.latest==`object`?(()=>{let e=n.latest,t=$(e.status??`pass`),r=Array.isArray(e.findings)?e.findings:[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${t===`error`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:t===`warning`?`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:[(0,j.jsx)(`span`,{children:t===`error`?`发现阻断风险`:t===`warning`?`需要关注`:`审查通过`}),(0,j.jsxs)(`strong`,{className:`font-mono`,children:[$(r.length),` findings`]})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`文件`,e.changedFiles??0],[`新增`,e.addedLines??0],[`删除`,e.removedLines??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}),r.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]`,children:r.slice(0,4).map((e,t)=>(0,j.jsx)(`li`,{children:$(typeof e==`object`&&e?e.message??`finding`:e)},t))}):null]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有审查当前改动。可让 Agent 调用 review_changes。`})}):e.id===`auto-mode-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:n?.mode===`confirm`?`确认模式`:`安全模式`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#65707b]`,children:[`超时 `,$(n?.timeoutMs??`—`),` ms`]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`阻断次数`}),(0,j.jsxs)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:[$(n?.blocked??0),` 次`]})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`最近命令`}),(0,j.jsx)(`strong`,{className:`mt-1 block truncate font-mono text-[11px] text-[#30343b]`,children:n?.last&&typeof n.last==`object`?$(n.last.command??`—`):`—`})]})]}),n?.last&&typeof n.last==`object`?(0,j.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]`,children:$(n.last.stdout,``)||$(n.last.stderr??`无输出`)}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未执行命令。Agent 可调用 auto_mode_exec。`})]}):e.id===`plan-execute-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`truncate text-[11px] font-medium text-[#30343b]`,children:n?.title?$(n.title):`尚未创建计划`}),(0,j.jsxs)(`span`,{className:`font-mono text-[11px] text-[#3565c5]`,children:[$(n?.completed??0),` / `,$(n?.total??0)]})]}),Array.isArray(n?.steps)&&n.steps.length>0?(0,j.jsx)(`ol`,{className:`grid gap-1.5`,children:n.steps.map((e,t)=>{let n=e&&typeof e==`object`?e:{},r=$(n.status??`pending`);return(0,j.jsxs)(`li`,{className:`flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 rounded-full ${r===`done`?`bg-[#32a35a]`:r===`in_progress`?`bg-[#3565c5]`:r===`skipped`?`bg-[#a0a7b0]`:`bg-[#d7dce2]`}`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate ${r===`done`?`text-[#14733f]`:`text-[#30343b]`}`,children:$(n.title??`步骤`)}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:r})]},$(n.id??t))})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 plan_create 创建执行计划。`})]}):e.id===`plugin-stars-panel`?(()=>{let e=gt(n);if(e.malformed)return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`Plugin Stars 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新加载排行榜。`})]});let t=e.latest,r=t?.results??[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`社区排行榜`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#65707b]`,children:[`结果上限 `,e.limit]})]}),t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 plugin_stars_search 拉取并筛选社区排行榜。`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-[#65707b]`,children:[(0,j.jsxs)(`span`,{children:[`查询:`,t.query||`全部`]}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[`显示 `,e.inventory.shown,`/`,e.inventory.total]})]}),r.length>0?(0,j.jsx)(`ol`,{className:`grid gap-1.5`,children:r.map(e=>(0,j.jsxs)(`li`,{className:`flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`span`,{className:`w-5 shrink-0 text-center font-mono text-[10px] text-[#9a6700]`,children:[`#`,e.rank]}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`a`,{className:`block truncate font-mono text-[11px] text-[#315fb8] hover:underline`,href:e.htmlUrl,rel:`noreferrer`,target:`_blank`,children:e.fullName}),(0,j.jsxs)(`span`,{className:`block truncate text-[10px] text-[#687381]`,children:[`更新于 `,e.updatedAt||`未知`]})]}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-[#8a5a00]`,children:[`★ `,e.stars.toLocaleString()]})]},e.fullName))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有找到匹配的社区插件。`}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`来源:`,t.source||`dsh-plugin-stars`,` · 仅展示公开仓库信息,不会自动安装。`]})]})]})})():e.id===`plugin-finder-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`只读 Registry 搜索`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#65707b]`,children:[`关键词 `,$(n?.keyword??`pi-harness`),` · 上限 `,$(n?.limit??`—`)]})]}),n?.query?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-[#65707b]`,children:[(0,j.jsxs)(`span`,{children:[`查询:`,$(n.query)]}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[$(n.total??0),` 个结果`]})]}),Array.isArray(n?.results)&&n.results.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:n.results.slice(0,5).map((e,t)=>{let n=e&&typeof e==`object`?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`strong`,{className:`truncate font-mono text-[11px] text-[#30343b]`,children:$(n.name??`未知插件`)}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:[`v`,$(n.version??`—`)]})]}),(0,j.jsx)(`p`,{className:`mt-1 truncate text-[10px] text-[#687381]`,children:$(n.description,``)})]},`${$(n.name??`plugin`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有找到匹配插件。`})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 plugin_search 搜索 npm Registry。`})]}):e.id===`memory-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`跨会话记忆`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[$(n?.count??0),` 条`]})]}),Array.isArray(n?.memories)&&n.memories.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:n.memories.slice(0,5).map((e,t)=>{let n=e&&typeof e==`object`?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`block truncate font-mono text-[11px] text-[#30343b]`,children:$(n.key??`未知键`)}),(0,j.jsx)(`p`,{className:`mt-1 truncate text-[10px] text-[#687381]`,children:$(n.value,``)})]},`${$(n.key??`memory`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未保存记忆。Agent 可调用 memory_set 明确写入。`})]}):e.id===`graph-memory-panel`?(()=>{let e=Ii(n),t=e.kinds,r=e.recent,i=e.recentRelations;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`任务`,t.task??0,`bg-[#3565c5]`],[`技能`,t.skill??0,`bg-[#22a06b]`],[`事件`,t.event??0,`bg-[#d97706]`]].map(([e,t,n])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${$(n)}`}),$(e)]}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`本地关系图`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[e.nodes,` 节点 · `,e.relations,` 关系`]})]}),r.length>0?(0,j.jsxs)(`ul`,{className:`grid gap-1.5`,children:[(0,j.jsxs)(`li`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:[`最近节点 `,Math.min(r.length,5),` / `,e.nodes]}),r.slice(0,5).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=n.kind===`task`||n.kind===`skill`||n.kind===`event`?n.kind:`unknown`;return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] font-semibold ${r===`task`?`bg-[#edf3fe] text-[#315fb8]`:r===`skill`?`bg-[#eaf8f0] text-[#14733f]`:r===`event`?`bg-[#fff4e5] text-[#a15c00]`:`bg-[#f2f3f5] text-[#65707b]`}`,children:r===`task`?`任务`:r===`skill`?`技能`:r===`event`?`事件`:`未知`}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:$(n.label??`未命名节点`)})]}),(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[10px] leading-4 text-[#65707b]`,children:$(n.summary,``)}),n.source?(0,j.jsxs)(`p`,{className:`mt-1 truncate font-mono text-[9px] text-[#687381]`,children:[`来源:`,$(n.source)]}):null]},`${$(n.id??`node`)}-${t}`)})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未记录图记忆。Agent 可调用 graph_memory_record 创建任务、技能或事件节点。`}),i.length>0?(0,j.jsxs)(`div`,{className:`grid gap-1 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-2`,children:[(0,j.jsxs)(`span`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:[`最近关系 `,Math.min(i.length,3),` / `,e.relations]}),i.slice(0,3).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[9px] text-[#65707b]`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:$(n.fromLabel??n.from??`节点`)}),(0,j.jsxs)(`span`,{className:`shrink-0 text-[#3565c5]`,children:[`—`,$(n.relation??`RELATED_TO`),`→`]}),(0,j.jsx)(`span`,{className:`truncate`,children:$(n.toLabel??n.to??`节点`)})]},`${$(n.id??`relation`)}-${t}`)})]}):null,e.lastSearch===null?null:(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 truncate text-[#65707b]`,children:[`最近搜索:`,e.lastSearch.query]}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[#3565c5]`,children:[e.lastSearch.shown,` / `,e.lastSearch.total]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 font-mono text-[9px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`节点 ≤ `,e.limits.nodes]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`关系 ≤ `,e.limits.relations]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`文件 ≤ `,e.limits.fileBytes,` B`]})]}),e.truncated?(0,j.jsx)(`p`,{className:`text-[10px] text-[#996515]`,children:`面板内容已按安全显示上限截断。`}):null]})})():e.id===`taskboard-panel`?(()=>{let e=n?.counts!==null&&typeof n?.counts==`object`?n.counts:{},t=Array.isArray(n?.recent)?n.recent:[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`当前工作区任务`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[$(n?.total??0),` 个`]})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[[`待办`,`todo`,`bg-[#edf3fe] text-[#315fb8]`],[`进行中`,`in_progress`,`bg-[#fff4e5] text-[#a15c00]`],[`待验收`,`in_review`,`bg-[#f0edff] text-[#6b4fc3]`],[`已完成`,`done`,`bg-[#eaf8f0] text-[#14733f]`]].map(([t,n,r])=>(0,j.jsx)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{children:t}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 ${r}`,children:$(e[n]??0)})]})},n))}),t.length>0?(0,j.jsxs)(`ul`,{className:`grid gap-1.5`,children:[(0,j.jsxs)(`li`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:[`最近任务 `,Math.min(t.length,5),` / `,$(n?.total??t.length)]}),t.slice(0,5).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=typeof n.status==`string`?n.status:`unknown`,i=typeof n.priority==`string`?n.priority:`medium`,a=r===`backlog`?`待规划`:r===`todo`?`待办`:r===`in_progress`?`进行中`:r===`in_review`?`待验收`:r===`blocked`?`阻塞`:r===`canceled`?`已取消`:r===`done`?`已完成`:`未知`,o=r===`done`?`bg-[#eaf8f0] text-[#14733f]`:r===`blocked`||r===`canceled`?`bg-[#fff5f5] text-[#b42318]`:r===`unknown`?`bg-[#f2f3f5] text-[#65707b]`:`bg-[#edf3fe] text-[#315fb8]`;return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-[#3565c5]`,children:$(n.key??`PIH-?`)}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:$(n.title??`未命名任务`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] ${o}`,children:a})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[9px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`优先级 `,i]}),n.dueDate?(0,j.jsxs)(`span`,{children:[`截止 `,$(n.dueDate)]}):null]})]},`${$(n.id??`task`)}-${t}`)})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未创建任务。Agent 可调用 taskboard_create 创建带稳定编号的任务。`})]})})():e.id===`skill-catalog-panel`?(()=>{let e=Array.isArray(n?.skills)?n.skills:[],t=Array.isArray(n?.mcpServers)?n.mcpServers:[],r=Array.isArray(n?.diagnostics)?n.diagnostics:[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`Skills`}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#315fb8]`,children:$(n?.skillCount??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`MCP 服务器`}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#315fb8]`,children:$(n?.mcpCount??0)})]})]}),e.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:$(n.name,`未命名技能`)}),(0,j.jsx)(`span`,{className:`rounded bg-[#f2f3f5] px-1.5 py-0.5 text-[9px] text-[#65707b]`,children:$(n.scope,`unknown`)})]}),(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[10px] text-[#687381]`,children:$(n.description,`无描述`)})]},`${$(n.name??`skill`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`当前运行时没有加载 Skill。`}),t.length>0?(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold text-[#65707b]`,children:`MCP 状态`}),(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:t.slice(0,6).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=n.status===`running`;return(0,j.jsxs)(`li`,{className:`flex items-center justify-between rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[#65707b]`,children:$(n.id,`未命名服务器`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 ${r?`bg-[#eaf8f0] text-[#14733f]`:`bg-[#f2f3f5] text-[#65707b]`}`,children:$(n.status,`unknown`)})]},`${$(n.id??`server`)}-${t}`)})})]}):null,r.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#fff0c2] bg-[#fffaf0] px-3 py-2 text-[10px] text-[#8a5a00]`,children:[`资源诊断:`,r.length,` 条警告`]}):null,(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`只读查看 runtime 已加载的 Skill 与 MCP 状态;配置写入仍由各自插件负责。`})]})})():e.id===`cost-meter-panel`?(()=>{let e=typeof n?.budget==`number`?n.budget:null,t=typeof n?.budgetPercent==`number`?n.budgetPercent:null,r=hr(n),i=t!==null&&t>=100?`text-[#b42318]`:t!==null&&t>=80?`text-[#a15c00]`:`text-[#14733f]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`今日(UTC)`,`$${Number(n?.todayCost??0).toFixed(4)}`],[`当前会话`,`$${Number(n?.sessionCost??0).toFixed(4)}`],[`累计`,`$${Number(n?.lifetimeCost??0).toFixed(4)}`]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[15px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`每日预算(UTC)`}),(0,j.jsx)(`strong`,{className:i,children:e===null?`未设置`:`$${e.toFixed(4)} · ${t?.toFixed(2)??`0.00`}%`})]}),e===null?null:(0,j.jsx)(`div`,{className:`mt-2 h-1.5 overflow-hidden rounded-full bg-[#dfe8f7]`,children:(0,j.jsx)(`div`,{className:`h-full ${t!==null&&t>=100?`bg-[#d64545]`:`bg-[#4c83e8]`}`,style:{width:`${Math.min(100,t??0)}%`}})})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[r.dayBasis,` 日账本`]}),(0,j.jsxs)(`span`,{className:`rounded bg-[#f6f8fa] px-2 py-1`,children:[`账本上限 `,r.entryLimit??`—`,` 条`]})]}),r.lastError===null?null:(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f0c8c4] bg-[#fff5f4] px-3 py-2 text-[10px] text-[#b42318]`,children:[`最近写入错误:`,r.lastError]}),r.entries.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:r.entries.map((e,t)=>(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[#65707b]`,children:e.sessionId}),(0,j.jsxs)(`strong`,{className:`shrink-0 font-mono text-[#30343b]`,children:[`$`,e.dailyCost.toFixed(4),` 当日增量`]})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[#7a8490]`,children:[(0,j.jsxs)(`span`,{children:[`UTC `,e.utcDate]}),(0,j.jsxs)(`span`,{children:[`会话累计 $`,e.sessionCost.toFixed(4)]}),(0,j.jsxs)(`span`,{children:[e.tokens,` tokens`]}),(0,j.jsxs)(`span`,{children:[e.messages,` 消息`]})]})]},`${e.sessionId}-${e.utcDate}-${t}`))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未记录已完成会话。Agent 可调用 cost_report 的 refresh 操作写入账本。`}),(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`仅记录运行时报告的实际成本,不内置或猜测模型价格。`})]})})():e.id===`undo-savepoint-panel`?(()=>{let e=Array.isArray(n?.savepoints)?n.savepoints:[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`保存点`}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#315fb8]`,children:$(n?.count??e.length)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`跟踪路径`}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#315fb8]`,children:$(Array.isArray(n?.trackedPaths)?n.trackedPaths.length:0)})]})]}),e.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:e.slice(0,6).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsx)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`code`,{className:`font-mono text-[10px] text-[#3565c5]`,children:$(n.id,`unknown`)}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:$(n.reason,`manual savepoint`)}),(0,j.jsxs)(`span`,{className:`text-[9px] text-[#687381]`,children:[$(n.fileCount,`0`),` 文件`]})]})},`${$(n.id??`savepoint`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未创建保存点。修改配置或插件代码前,让 Agent 调用 undo_savepoint 的 save 操作。`}),(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`恢复操作要求 confirm=true;敏感文件、二进制文件和依赖目录不会进入保存点。`})]})})():e.id===`annotation-panel`?(()=>{let e=Array.isArray(n?.annotations)?n.annotations:[],t=typeof n?.lastPrompt==`string`?n.lastPrompt:``;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`待发送批注`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[$(n?.count??0),` 条`]})]}),e.length>0?(0,j.jsx)(`ol`,{className:`grid gap-1.5`,children:e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-start gap-2 text-[10px]`,children:[(0,j.jsxs)(`span`,{className:`rounded bg-[#edf3fe] px-1.5 py-0.5 font-mono text-[#315fb8]`,children:[`#`,$(n.id??t+1)]}),(0,j.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap text-[#30343b]`,children:$(n.quote,``)})]}),n.note?(0,j.jsx)(`p`,{className:`mt-1 pl-8 text-[10px] text-[#687381]`,children:$(n.note)}):null]},`${$(n.id??t)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未收集批注。Agent 可调用 annotation_manage 的 add 操作记录回复片段。`}),t?(0,j.jsxs)(`details`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`summary`,{className:`cursor-pointer text-[#65707b]`,children:`最近生成的提问上下文`}),(0,j.jsx)(`pre`,{className:`mt-2 max-h-40 overflow-auto whitespace-pre-wrap text-[10px] text-[#30343b]`,children:t})]}):null,(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`批注按编号累积;生成上下文不会改写原会话消息。`})]})})():e.id===`runtime-doctor-panel`?(()=>{let e=$(n?.status??`unknown`),t=Array.isArray(n?.checks)?n.checks:[],r=Array.isArray(n?.recommendations)?n.recommendations:[],i=e===`ok`?`bg-[#eaf8f0] text-[#14733f]`:e===`warning`?`bg-[#fff7e8] text-[#a15c00]`:`bg-[#fff0f0] text-[#b42318]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`text-[11px] text-[#65707b]`,children:`运行时边界检查`}),(0,j.jsx)(`span`,{className:`rounded px-2 py-0.5 font-mono text-[10px] uppercase ${i}`,children:e})]}),(0,j.jsx)(`div`,{className:`grid gap-1.5`,children:t.map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=$(n.status??`unknown`),i=r===`ok`?`bg-[#eaf8f0] text-[#14733f]`:r===`warning`?`bg-[#fff7e8] text-[#a15c00]`:`bg-[#fff0f0] text-[#b42318]`;return(0,j.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${r===`ok`?`bg-[#22c55e]`:r===`warning`?`bg-[#e6a21a]`:`bg-[#d64545]`}`}),(0,j.jsx)(`code`,{className:`w-20 shrink-0 text-[#65707b]`,children:$(n.id??`check`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[#30343b]`,children:$(n.detail??`—`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono ${i}`,children:r})]},`${$(n.id??`check`)}-${t}`)})}),r.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-2 text-[10px] text-[#8a6200]`,children:[(0,j.jsx)(`strong`,{children:`建议`}),(0,j.jsx)(`ul`,{className:`mt-1 grid gap-1 pl-4`,children:r.slice(0,5).map((e,t)=>(0,j.jsx)(`li`,{children:$(e)},`${$(e)}-${t}`))})]}):null]})})():e.id===`plugin-check-panel`?(()=>{let e=n?.latest!==null&&typeof n?.latest==`object`?n.latest:void 0,t=e?.checks!==null&&typeof e?.checks==`object`?e.checks:void 0,r=Array.isArray(e?.errors)?e.errors:[],i=Array.isArray(e?.warnings)?e.warnings:[],a=Array.isArray(e?.reports)?e.reports:[],o=Array.isArray(e?.checks)?e.checks:[],s=$(e?.verdict??`—`),c=s===`pass`?`bg-[#eaf8f0] text-[#14733f]`:s===`warn`?`bg-[#fff7e8] text-[#a15c00]`:`bg-[#fff0f0] text-[#b42318]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e?.scanned===void 0?e?.verdict===void 0?o.length>0?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px] text-[#65707b]`,children:[`检查清单:`,o.length,` 项`]}):null:(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f8fafc] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`truncate text-[#65707b]`,children:$(e.repo??`当前插件`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono ${c}`,children:s})]}):(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`目录扫描`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#3565c5]`,children:[$(e.scanned),` 个仓库`]})]}),t?(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`通过`,t.passed??0],[`失败`,t.failed??0],[`警告`,t.warned??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}):null,a.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:a.slice(0,6).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=$(n.verdict??`—`);return(0,j.jsxs)(`li`,{className:`flex items-center justify-between rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[#65707b]`,children:$(n.repo??`未知仓库`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 ${r===`pass`?`bg-[#eaf8f0] text-[#14733f]`:r===`warn`?`bg-[#fff7e8] text-[#a15c00]`:`bg-[#fff0f0] text-[#b42318]`}`,children:r})]},`${$(n.repo??`repo`)}-${t}`)})}):r.length>0||i.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:[...r,...i].slice(0,5).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`strong`,{className:`font-mono text-[#b42318]`,children:$(n.code??`issue`)}),(0,j.jsx)(`p`,{className:`mt-1 text-[#65707b]`,children:$(n.message,``)})]},`${$(n.code??`issue`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未检查插件。Agent 可调用 plugin_check 执行 check、scan 或 schema。`}),(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`只读检查,不修改、不构建被检仓库。`})]})})():e.id===`plugin-radar-panel`?(()=>{let e=Array.isArray(n?.results)?n.results:[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`GitHub DSH 生态`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[$(n?.total??0),` 个仓库 · `,Array.isArray(n?.sources)?n.sources.length:0,` 个来源`]})]}),n?.query?(0,j.jsxs)(`div`,{className:`text-[11px] text-[#65707b]`,children:[`查询:`,$(n.query)]}):null,e.length>0?(0,j.jsx)(`ol`,{className:`grid gap-1.5`,children:e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=Array.isArray(n.topics)?n.topics.filter(e=>typeof e==`string`).slice(0,3):[],i=typeof n.url==`string`?n.url:void 0;return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-4 shrink-0 text-right font-mono text-[10px] text-[#687381]`,children:t+1}),i?(0,j.jsx)(`a`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-[#315fb8] hover:underline`,href:i,rel:`noreferrer`,target:`_blank`,children:$(n.fullName??n.name??`未知仓库`)}):(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]`,children:$(n.fullName??n.name??`未知仓库`)}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-[#a15c00]`,children:[`★ `,$(n.stars??0)]})]}),(0,j.jsx)(`p`,{className:`mt-1 truncate pl-6 text-[10px] text-[#65707b]`,children:$(n.description,`暂无描述`)}),(0,j.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-2 pl-6 text-[9px] text-[#687381]`,children:[n.language?(0,j.jsx)(`span`,{children:$(n.language)}):null,n.updatedAt?(0,j.jsxs)(`span`,{className:`font-mono`,children:[`更新 `,$(n.updatedAt)]}):null,r.length>0?(0,j.jsx)(`span`,{className:`truncate`,children:r.map(e=>`#${e}`).join(` `)}):null]})]},`${$(n.fullName??`repo`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未搜索插件。Agent 可调用 plugin_radar_search 从 GitHub 发现 DSH 插件。`}),(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`只读 GitHub 搜索,按 Star 降序;不会安装、执行或修改第三方仓库。`})]})})():e.id===`hol-guard-panel`?(()=>{let e=Array.isArray(n?.receipts)?n.receipts:[],t=n?.latest!==null&&typeof n?.latest==`object`?n.latest:void 0,r=e=>e===`blocked`?`已阻断`:e===`review`?`需复核`:`安全`,i=e=>e===`blocked`?`bg-[#fff0f0] text-[#b42318]`:e===`review`?`bg-[#fff7e8] text-[#a15c00]`:`bg-[#eaf8f0] text-[#14733f]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`已阻断`,n?.blocked??0],[`需复核`,n?.review??0],[`安全`,n?.safe??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}),t?(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] px-3 py-2 text-[10px] ${i(t.risk)}`,children:[(0,j.jsxs)(`span`,{children:[`最近一次:`,$(t.source,`unknown`)]}),(0,j.jsxs)(`strong`,{children:[r(t.risk),` · `,$(t.findings&&Array.isArray(t.findings)?t.findings.length:0),` 项`]})]}):null,e.length>0?(0,j.jsxs)(`ul`,{className:`grid gap-1.5`,children:[(0,j.jsx)(`li`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:`最近风险摘要`}),e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{},a=Array.isArray(n.findings)?n.findings:[];return(0,j.jsxs)(`li`,{className:`flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 ${i(n.risk)}`,children:r(n.risk)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[#65707b]`,children:$(n.source,`unknown`)}),(0,j.jsxs)(`span`,{className:`text-[#687381]`,children:[a.length,` 项`]})]},`${$(n.source)}-${t}`)})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`尚未收到工具调用。Agent 可调用 hol_guard_scan 预检命令或文本。`}),(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`仅保存风险摘要和计数,不保存命令、路径或凭据原文;当前模式为审计。`})]})})():e.id===`synapse-panel`?(()=>{let e=Array.isArray(n?.nodes)?n.nodes:[],t=Array.isArray(n?.edges)?n.edges:[],r=new Map(e.filter(e=>typeof e==`object`&&!!e).map(e=>[$(e.id),e]));return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`会话`,n?.nodes??0],[`分支`,n?.edges??0],[`孤儿`,n?.orphanCount??0]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}),n?.activeSessionId?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#b9d0ff] bg-[#f1f6ff] px-3 py-2 text-[10px] text-[#315fb8]`,children:[`当前会话:`,(0,j.jsx)(`code`,{className:`font-mono`,children:$(n.activeSessionId)})]}):null,e.length>0?(0,j.jsxs)(`ul`,{className:`grid gap-1.5`,children:[(0,j.jsxs)(`li`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:[`最近会话 `,Math.min(e.length,8),` / `,e.length]}),e.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border px-3 py-2 ${n.active===!0?`border-[#b9d0ff] bg-[#f7faff]`:`border-[#edf0f3] bg-white`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${n.active===!0?`bg-[#3565c5]`:`bg-[#c4ccd6]`}`}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:$(n.label??n.sessionId??`未命名会话`)}),(0,j.jsxs)(`span`,{className:`font-mono text-[9px] text-[#687381]`,children:[$(n.messageCount??0),` 条消息`]})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[9px] text-[#687381]`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:$(n.cwd??`未知工作区`)}),(0,j.jsxs)(`span`,{children:[$(n.branchCount??0),` 个分支`]})]})]},`${$(n.id??`session`)}-${t}`)})]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`当前工作区还没有可投影的持久化会话。`}),t.length>0?(0,j.jsxs)(`div`,{className:`grid gap-1 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`text-[9px] uppercase tracking-[0.08em] text-[#687381]`,children:`Fork 关系`}),t.slice(0,5).map((e,t)=>{let n=typeof e==`object`&&e?e:{},i=r.get($(n.from)),a=r.get($(n.to));return(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 font-mono text-[9px] text-[#65707b]`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:$(i?.label??n.from)}),(0,j.jsx)(`span`,{className:`shrink-0 text-[#3565c5]`,children:`→ fork →`}),(0,j.jsx)(`span`,{className:`truncate`,children:$(a?.label??n.to)})]},`${$(n.from)}-${$(n.to)}-${t}`)})]}):null,(0,j.jsx)(`div`,{className:`text-[10px] text-[#687381]`,children:`数据来源:Pi 原生 JSONL 会话;Agent 可调用 synapse_session_map 刷新。`})]})})():e.id===`archify-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.components)?e.components:[],r=Array.isArray(e.dependencies)?e.dependencies:[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`组件`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:$(t.length)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`外部依赖`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:$(r.length)})]})]}),(0,j.jsx)(`div`,{className:`grid gap-1.5`,children:t.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-[#3565c5]`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[#30343b]`,children:$(n.path??`组件`)}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:[$(n.files??0),` files`]})]},`${$(n.path??`component`)}-${t}`)})}),r.length>0?(0,j.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.slice(0,12).map((e,t)=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-[#f6f8ff] px-2 py-1 font-mono text-[10px] text-[#315fb8]`,children:$(e)},`${$(e)}-${t}`))}):null,(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]`,children:$(e.mermaid,``)}),e.truncated===!0?(0,j.jsx)(`p`,{className:`text-[10px] text-[#8a5a00]`,children:`扫描达到节点上限,架构图可能不完整。`}):null]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 architecture_map 生成当前工作区架构图。`})}):e.id===`canvas-draw-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`Mermaid 流程图`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[$(n?.nodeCount??0),` 节点 · `,$(n?.edgeCount??0),` 连线`]})]}),n?.latest&&typeof n.latest==`object`?(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]`,children:$(n.latest.mermaid,``)}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 canvas_draw 生成流程图源码。`})]}):e.id===`image-compressor-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`PNG 无损压缩`}),(0,j.jsx)(`span`,{className:`font-mono text-[#65707b]`,children:`上限 32 MiB`})]}),n?.last&&typeof n.last==`object`?(()=>{let e=n.last;return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3 text-[11px] text-[#14733f]`,children:[$(e.inputPath??`图片`),` → `,$(e.outputPath??`输出`),`,节省 `,$(e.savedBytes??0),` bytes`]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 image_compress,写入前必须 confirm=true。`})]}):e.id===`workspace-search-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`font-medium text-[#30343b]`,children:`工作区文本检索`}),(0,j.jsxs)(`span`,{className:`font-mono text-[#3565c5]`,children:[$(n?.matchCount??0),` 个匹配`]})]}),n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.matches)?e.matches:[];return t.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1.5`,children:t.slice(0,5).map((e,t)=>{let n=e&&typeof e==`object`?e:{};return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`strong`,{className:`block truncate font-mono text-[10px] text-[#3565c5]`,children:[$(n.path??`未知文件`),`:`,$(n.line??`?`)]}),(0,j.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-[#65707b]`,children:$(n.text,``)})]},`${$(n.path??`match`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有找到匹配内容。`})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 workspace_search 检索当前工作区。`})]}):e.id===`recall-unread-panel`?(()=>{let e=ja(n),t=e.items.slice(0,8);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e.status.state===`failed`||e.status.state===`cancelled`?(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] leading-5 ${e.status.state===`failed`?`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`:`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`}`,children:[`扫描`,e.status.state===`failed`?`失败`:`已取消`,e.status.error===null?``:`:${e.status.error}`]}):null,(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`候选`,e.inventory.candidates],[`已扫描`,e.inventory.scanned],[`未回答`,e.total]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block font-mono text-[17px] text-[#30343b]`,children:$(t)})]},$(e)))}),t.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:t.map((e,t)=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:e.name}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[9px] text-[#687381]`,children:[e.messageCount,` 条消息`]})]}),(0,j.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap break-words text-[10px] leading-4 text-[#65707b]`,children:e.message})]},`${e.id}-${t}`))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有以未回答用户消息结束的会话。`}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`已扫描 `,e.inventory.scanned,`/`,e.inventory.available,` 个会话文件,界面显示 `,t.length,`/`,e.inventory.unread,` `,`个;只读扫描,不会修改会话。`,e.inventory.truncated?` 部分结果因发现、扫描或展示上限被截断。`:``]})]})})():e.id===`turn-rewind-panel`?(()=>{let e=Ba(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e.latest===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有执行回退操作。`}):(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${{queued:`border-[#dce5f5] bg-[#f6f8ff] text-[#3565c5]`,running:`border-[#dce5f5] bg-[#f6f8ff] text-[#3565c5]`,completed:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`,failed:`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`,cancelled:`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`}[e.latest.status]}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.08em]`,children:`最近操作`}),(0,j.jsx)(`span`,{className:`rounded-full bg-white/70 px-2 py-1 text-[10px] font-semibold`,children:{queued:`已排队`,running:`执行中`,completed:`已回退`,failed:`失败`,cancelled:`已取消`}[e.latest.status]})]}),(0,j.jsx)(`p`,{className:`mt-2 line-clamp-2 text-[11px] leading-4 text-[#30343b]`,children:e.latest.target.text}),e.latest.error===null?null:(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4`,children:e.latest.error}),e.latest.summarized?(0,j.jsx)(`p`,{className:`mt-2 text-[10px] leading-4`,children:`已请求分支摘要;该选项可能调用模型并产生费用。`}):null]}),(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]`,children:`可回退轮次`}),e.candidates.length>0?e.candidates.map((t,n)=>(0,j.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`mt-0.5 font-mono text-[10px] text-[#3565c5]`,children:e.candidates.length-n}),(0,j.jsx)(`span`,{className:`line-clamp-2 min-w-0 flex-1 text-[11px] leading-4 text-[#65707b]`,children:t.text})]},`${t.entryId}-${n}`)):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-3 text-[11px] text-[#687381]`,children:`当前会话还没有可回退的用户轮次。`})]}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`已检查当前分支 `,e.inventory.scannedEntries,` 个条目;后端保留 `,e.inventory.shown,` 个候选,界面显示 `,e.candidates.length,` 个。`,e.inventory.truncated?` 部分结果因扫描、候选或显示上限被截断。`:``]})]})})():e.id===`skill-guard-panel`?(()=>{let e=Ao(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e.status.state===`failed`||e.status.state===`cancelled`?(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] leading-5 ${e.status.state===`failed`?`border-[#f3c4c4] bg-[#fff4f4] text-[#a23b3b]`:`border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]`}`,children:[`扫描`,e.status.state===`failed`?`失败`:`已取消`,e.status.error===null?``:`:${e.status.error}`]}):null,(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`已扫描`,e.total],[`高风险`,e.blocked],[`待复核`,e.review]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsx)(`div`,{className:`grid gap-2`,children:e.reports.length>0?e.reports.slice(0,8).map((e,t)=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e.risk===`blocked`?`bg-[#d64545]`:e.risk===`review`?`bg-[#e0a11a]`:`bg-[#22a06b]`}`}),(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate text-[11px] text-[#30343b]`,children:e.name}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:e.risk===`blocked`?`高风险`:e.risk===`review`?`复核`:`安全`})]}),e.findings.length>0?(0,j.jsx)(`p`,{className:`mt-1 truncate text-[10px] text-[#65707b]`,children:e.findings.map(e=>e.code).join(` · `)}):null]},`${e.name}-${t}`)):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`暂无 Skill 扫描结果,可让 Agent 调用 skill_guard_scan。`})}),(0,j.jsxs)(`p`,{className:`text-[10px] text-[#687381]`,children:[`已扫描 `,e.inventory.scanned,`/`,e.inventory.available,` 个入口,面板显示 `,Math.min(e.reports.length,8),` 个;风险等级仅供审计,不会禁用 Skill。`]})]})})():e.id===`prompt-guard-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${n?.risk===`blocked`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:n?.risk===`review`?`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:[(0,j.jsx)(`span`,{children:n?.risk===`blocked`?`高风险,需阻断`:n?.risk===`review`?`需要人工复核`:`未发现风险`}),(0,j.jsxs)(`strong`,{className:`font-mono`,children:[$(n?.scans??0),` 次扫描`]})]}),n?.latest&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.findings)?e.findings:[];return t.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]`,children:t.slice(0,4).map((e,t)=>{let n=e&&typeof e==`object`?e:{};return(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`strong`,{className:`font-mono text-[#30343b]`,children:$(n.code??`finding`)}),`:`,$(n.message,``)]},`${$(n.code??`finding`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`最近一次扫描未发现风险。`})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`Agent 可调用 prompt_guard_scan 检查不可信文本。`})]}):e.id===`code2skill-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`已生成技能`}),(0,j.jsx)(`strong`,{className:`font-mono text-[12px] text-[#315fb8]`,children:$(n?.generated??0)})]}),n?.latest!==null&&n?.latest!==void 0&&typeof n.latest==`object`?(0,j.jsxs)(`p`,{className:`mt-2 truncate text-[11px] text-[#65707b]`,children:[$(n.latest.slug??`skill`),` ·`,` `,$(Array.isArray(n.latest.files)?n.latest.files.length:0),` `,`个参考文件`]}):(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:`还没有生成技能。可让 Agent 调用 skill_pack_create。`})]}),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`输出目录:项目 .pi/skills/<name>,包含 SKILL.md 和原始参考文件。`})]}):e.id===`genui-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(()=>{let e=fi(n),t={neutral:`border-[#e3e7ee] bg-[#f6f8fa] text-[#65707b]`,info:`border-[#d9e4f7] bg-[#f6f8ff] text-[#315fb8]`,success:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`,warning:`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`,danger:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`};return e.latest===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有结构化卡片。可让 Agent 调用 genui_render。`}):(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-3 text-[11px]`,children:[(0,j.jsx)(`strong`,{className:`min-w-0 break-words text-[#30343b]`,children:e.latest.title}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-[#687381]`,children:[e.rendered,` 次`]})]}),e.latest.blocks.map((e,n)=>e.type===`progress`?(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${t[e.tone]}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:e.label}),(0,j.jsxs)(`strong`,{className:`shrink-0`,children:[e.value,`%`]})]}),(0,j.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-white/70`,children:(0,j.jsx)(`div`,{className:`h-full rounded-full bg-current`,style:{width:`${e.value}%`}})})]},`${e.label}-${n}`):e.type===`text`?(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 text-[11px] ${t[e.tone]}`,children:[(0,j.jsx)(`strong`,{className:`block text-[10px]`,children:e.label}),(0,j.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words leading-4`,children:e.value})]},`${e.label}-${n}`):(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-[11px] ${t[e.tone]}`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words`,children:e.label}),(0,j.jsx)(`strong`,{className:`min-w-0 break-words text-right`,children:e.value})]},`${e.label}-${n}`)),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`最多 `,e.limits.blocks,` 块`]}),(0,j.jsxs)(`span`,{children:[`总文本上限 `,e.limits.totalText,` 字符`]}),e.latest.renderedAt===null?null:(0,j.jsxs)(`span`,{children:[e.latest.renderedAt.slice(11,19),` UTC`]}),e.latest.truncated?(0,j.jsx)(`span`,{children:`面板明细已截断`}):null]})]})})(),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`仅渲染结构化文本、徽标和进度块;HTML 与脚本按普通文本显示。`})]}):e.id===`anchored-standard-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(()=>{let e=Array.isArray(n?.violations)?n.violations:[],t=n?.status===`violated`;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${t?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`}`,children:[(0,j.jsx)(`span`,{children:t?`轨迹存在违规`:n?.status===`anchored`?`运行已锚定`:`等待 Agent 运行`}),(0,j.jsxs)(`strong`,{className:`font-mono`,children:[$(n?.events??0),` 事件`]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`工具调用 `,(0,j.jsx)(`strong`,{className:`ml-1 text-[#30343b]`,children:$(n?.toolCalls??0)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`违规项 `,(0,j.jsx)(`strong`,{className:`ml-1 text-[#30343b]`,children:$(e.length)})]})]}),e.length>0?(0,j.jsx)(`ul`,{className:`grid gap-1 rounded-lg border border-[#f4caca] bg-[#fffafa] px-3 py-2 text-[10px] text-[#b42318]`,children:e.slice(0,4).map((e,t)=>(0,j.jsx)(`li`,{children:$(e&&typeof e==`object`?e.message??`违规`:e)},`${$(e)}-${t}`))}):null]})})(),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`可让 Agent 调用 trajectory_anchor_check 审计当前执行轨迹。`})]}):e.id===`telemetry-blocker-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3 text-[11px] text-[#14733f]`,children:[(0,j.jsx)(`span`,{children:`遥测已关闭`}),(0,j.jsxs)(`strong`,{className:`font-mono`,children:[`拦截 `,$(n?.blocked??0),` 次`]})]}),(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[10px] text-[#65707b]`,children:Array.isArray(n?.names)&&n.names.length>0?`事件名:${n.names.slice(0,8).map(String).join(`、`)}`:`尚未收到遥测事件。`}),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`只记录事件名和计数,不保留事件属性,也不会发起网络请求。`})]}):e.id===`plugin-dev-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=wt(n),t={idle:{label:`等待重载`,style:`border-[#e3e7ee] bg-[#f6f8fa] text-[#65707b]`},queued:{label:`等待当前运行结束`,style:`border-[#d9e4f7] bg-[#f6f8ff] text-[#315fb8]`},running:{label:`正在重载会话资源`,style:`border-[#d9e4f7] bg-[#f6f8ff] text-[#315fb8]`},reloaded:{label:`会话资源已重载`,style:`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`},failed:{label:`会话资源重载失败`,style:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`},cancelled:{label:`会话资源重载已取消`,style:`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`}}[e.status];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${t.style}`,children:[(0,j.jsx)(`span`,{children:t.label}),(0,j.jsx)(`strong`,{className:`font-mono`,children:e.status})]}),(0,j.jsx)(`p`,{className:`break-words text-[10px] text-[#687381]`,children:e.reason||`修改本地扩展后调用 plugin_dev_reload`}),e.error===null?null:(0,j.jsx)(`p`,{className:`break-words rounded-lg bg-[#fff5f5] px-3 py-2 text-[10px] text-[#b42318]`,children:e.error}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`原因上限 `,e.limits.reasonCharacters,` 字符`]}),(0,j.jsxs)(`span`,{children:[`错误上限 `,e.limits.errorCharacters,` 字符`]}),e.reloadedAt===null?null:(0,j.jsxs)(`span`,{children:[e.reloadedAt.slice(11,19),` UTC`]})]})]})})()}):e.id===`openpets-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=Ta(n),t={idle:`休息`,focused:`专注`,happy:`开心`,concerned:`担心`}[e.mood];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[#e3e7ee] bg-[#f8fafc] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-[#dceaff] text-[20px] text-[#3565c5]`,children:`◉`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[13px] text-[#30343b]`,children:e.name}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:e.lastEvent})]}),(0,j.jsx)(`span`,{className:`rounded-full bg-[#edf3fe] px-2 py-1 text-[10px] text-[#3565c5]`,children:t})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`能量 `,(0,j.jsxs)(`strong`,{className:`ml-1 text-[#30343b]`,children:[e.energy,`%`]})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`互动 `,(0,j.jsx)(`strong`,{className:`ml-1 text-[#30343b]`,children:e.interactions})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`恢复扫描 `,e.recovery.scanned,` / `,e.recovery.sessionEntries]}),(0,j.jsx)(`span`,{children:e.recovery.restored?`已恢复状态`:`使用初始状态`}),(0,j.jsxs)(`span`,{children:[`持久化 `,e.persistence.attempts-e.persistence.failures,` / `,e.persistence.attempts]}),e.updatedAt===null?null:(0,j.jsxs)(`span`,{children:[e.updatedAt.slice(11,19),` UTC`]})]}),e.persistence.lastError===null?null:(0,j.jsx)(`p`,{className:`break-words rounded-lg bg-[#fff5f5] px-3 py-2 text-[10px] text-[#b42318]`,children:e.persistence.lastError}),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`根据真实 Pi 会话事件自动反应,也可让 Agent 调用 pet_react 进行互动。`})]})})()}):e.id===`change-verifier-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[n?.latest!==null&&n?.latest!==void 0&&typeof n.latest==`object`?(()=>{let e=n.latest,t=e.tests&&typeof e.tests==`object`?e.tests:{},r=e.review&&typeof e.review==`object`?e.review:{},i=$(e.status??`fail`);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${i===`pass`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:i===`warning`?`border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]`:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`}`,children:[(0,j.jsx)(`span`,{children:i===`pass`?`门禁通过`:i===`warning`?`门禁有警告`:`门禁失败`}),(0,j.jsxs)(`strong`,{className:`font-mono`,children:[$(n.runs??0),` 次`]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] text-[#65707b]`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`测试 exit `,(0,j.jsx)(`strong`,{className:`ml-1 text-[#30343b]`,children:$(t.exitCode??`—`)})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[`审查 `,(0,j.jsx)(`strong`,{className:`ml-1 text-[#30343b]`,children:$(r.status??`—`)})]})]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有执行发布门禁。可让 Agent 调用 verify_change_gate。`}),(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`复用 run_project_tests 和 review_changes,不重复实现测试或审查逻辑。`})]}):e.id===`readme-gen-panel`?(()=>{let e=pc(n);if(e.malformed)return(0,j.jsx)(`div`,{className:`mt-3 rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] leading-5 text-[#b42318]`,children:`README 面板数据无效,暂不展示生成或写入结果。`});let t=e.status.state===`idle`?`等待生成`:e.status.state===`running`?e.status.operation===`write`?`正在写入`:`正在生成`:e.status.state===`completed`?e.status.operation===`write`?`写入已完成`:`草稿已生成`:e.status.state===`failed`?e.status.operation===`write`?`写入失败`:`生成失败`:e.status.operation===`write`?`写入已取消`:`生成已取消`,r=e.status.state===`failed`||e.status.state===`cancelled`?`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`:e.status.state===`completed`?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:`border-[#dce5f5] bg-[#f6f8ff] text-[#315fb8]`;return(0,j.jsxs)(`div`,{className:`mt-3 grid min-w-0 gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 rounded-lg border px-3 py-2 text-[10px] ${r}`,children:[(0,j.jsx)(`strong`,{className:`font-semibold`,children:t}),e.status.at===null?null:(0,j.jsxs)(`time`,{className:`shrink-0 font-mono`,children:[e.status.at.slice(11,19),` UTC`]})]}),e.generated===null?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] leading-5 text-[#687381]`,children:[`还没有生成 README 草稿。让 Agent 调用 `,(0,j.jsx)(`code`,{className:`font-mono text-[#3565c5]`,children:`readme_report`}),` 先检查内容。`]}):(0,j.jsxs)(`div`,{className:`min-w-0 border-l-2 border-[#7aa2e8] bg-[#f8faff] px-3 py-3`,children:[(0,j.jsx)(`p`,{className:`break-all text-[12px] font-semibold leading-5 text-[#20252b]`,children:e.generated.name}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] text-[#687381]`,children:[e.generated.scripts,` 个脚本 · `,e.generated.plugins,` 个运行时插件`]})]}),e.lastWrite===null?null:(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#dce5f5] bg-white px-3 py-2 text-[#315fb8]`,children:[(0,j.jsx)(`p`,{className:`break-all font-mono text-[10px] leading-4`,children:e.lastWrite.path}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] text-[#687381]`,children:[new Intl.NumberFormat(`en-US`).format(e.lastWrite.bytes),` bytes · `,e.lastWrite.overwritten?`已覆盖`:`新文件`]})]}),e.status.error===null?null:(0,j.jsx)(`p`,{className:`break-words rounded-lg bg-[#fff5f5] px-3 py-2 text-[10px] leading-4 text-[#b42318]`,children:e.status.error}),(0,j.jsxs)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:[`写入需要 `,(0,j.jsx)(`code`,{className:`font-mono`,children:`confirm=true`}),`;覆盖已有 README 还需要 `,(0,j.jsx)(`code`,{className:`font-mono`,children:`overwrite=true`}),`。`]})]})})():e.id===`sql-lens-panel`?(()=>{let e=rs(n);if(e.malformed)return(0,j.jsxs)(`div`,{className:`mt-3 rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`SQL Lens 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新加载后再查询。`})]});let t=e.latest,r=e.status.state===`running`?`查询中`:e.status.state===`completed`?`已完成`:e.status.state===`failed`?`查询失败`:e.status.state===`cancelled`?`已取消`:`等待查询`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{className:`rounded-full border border-[#dce5f5] bg-[#f6f8fa] px-2 py-1 font-semibold text-[#3565c5]`,children:r}),e.status.at===null?null:(0,j.jsx)(`time`,{className:`font-mono`,children:new Date(e.status.at).toLocaleString()})]}),e.status.error===null?null:(0,j.jsx)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[10px] leading-4 text-[#b42318]`,children:e.status.error}),t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有查询数据库。可让 Agent 调用 sql_readonly。`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[#30343b]`,title:t.database,children:t.database}),(0,j.jsxs)(`strong`,{className:`shrink-0 font-mono text-[12px] text-[#3565c5]`,children:[t.rowInventory.returned,` rows`]})]}),(0,j.jsx)(`code`,{className:`mt-2 block max-h-16 overflow-auto whitespace-pre-wrap break-words text-[10px] leading-4 text-[#687381]`,children:t.query})]}),(0,j.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]`,children:JSON.stringify(t.rows,null,2)}),t.rowInventory.truncated?(0,j.jsxs)(`p`,{className:`text-[10px] text-[#9a6700]`,children:[`面板显示 `,t.rowInventory.shown,` / `,t.rowInventory.returned,` 行;查询共扫描 `,t.rowInventory.scanned,` `,`行,结果已按安全边界截断。`]}):null]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 font-mono text-[10px] text-[#3565c5]`,children:[(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`timeout:`,e.timeoutMs,`ms`]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`rows:`,e.limits.rows]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`result:`,Math.round(e.limits.resultBytes/1024),`KiB`]})]})]})})():e.id===`theme-studio-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px] text-[#30343b]`,children:$(n?.label??`Light`)}),(0,j.jsx)(`p`,{className:`mt-1 truncate text-[10px] text-[#65707b]`,children:$(n?.description??``)})]}),(0,j.jsx)(`span`,{className:`shrink-0 rounded-full bg-[#edf3fe] px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:$(n?.theme??`light`)})]}),Array.isArray(n?.presets)?(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:n.presets.map((e,t)=>{let r=typeof e==`object`&&e?e:{},i=r.id===n.theme;return(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-2 ${i?`border-[#9bbcff] bg-[#f6f8ff]`:`border-[#edf0f3] bg-white`}`,children:[(0,j.jsx)(`strong`,{className:`block text-[11px] text-[#30343b]`,children:$(r.label??r.id??`主题`)}),(0,j.jsx)(`span`,{className:`mt-1 block truncate text-[10px] text-[#687381]`,children:$(r.description??``)})]},`${$(r.id??`theme`)}-${t}`)})}):null,(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#687381]`,children:`可让 Agent 调用 theme_set 切换预设;选择会保存到当前 session,并由 React 根节点应用 token。`})]}):e.id===`mirage-bridge-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${n?.available===!0?`border-[#b9e6c9] bg-[#f0fbf4]`:n?.available===!1?`border-[#f3dfab] bg-[#fffaf0]`:`border-[#e3e7ee] bg-[#f6f8fa]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`官方 Mirage CLI`}),(0,j.jsx)(`strong`,{className:`text-[11px] ${n?.available===!0?`text-[#14733f]`:n?.available===!1?`text-[#9a6700]`:`text-[#687381]`}`,children:n?.available===!0?`已连接`:n?.available===!1?`未检测到`:`未检查`})]}),(0,j.jsx)(`p`,{className:`mt-2 truncate font-mono text-[10px] text-[#65707b]`,children:$(n?.version??n?.executable??`mirage`)}),(0,j.jsxs)(`p`,{className:`mt-1 text-[11px] text-[#65707b]`,children:[`虚拟工作区:`,$(n?.workspaceId??`未配置`)]})]}),n?.lastRun&&typeof n.lastRun==`object`?(()=>{let e=n.lastRun;return(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${e.exitCode===0?`border-[#b9e6c9] bg-[#f0fbf4]`:`border-[#f4caca] bg-[#fff5f5]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[10px] text-[#30343b]`,children:$(e.command??``)}),(0,j.jsxs)(`strong`,{className:`shrink-0 text-[11px] ${e.exitCode===0?`text-[#14733f]`:`text-[#b42318]`}`,children:[`exit `,$(e.exitCode??`—`)]})]}),(0,j.jsxs)(`p`,{className:`mt-1 text-[10px] text-[#65707b]`,children:[`耗时 `,$(e.durationMs??0),` ms`]})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`先调用 mirage_doctor 检查 CLI,再调用 mirage_execute。`}),n?.lastError?(0,j.jsx)(`p`,{className:`text-[10px] leading-4 text-[#9a6700]`,children:$(n.lastError)}):null]}):e.id===`docker-sandbox-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=Kr(n);if(e.malformed)return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`Docker Sandbox 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新加载后再运行。`})]});let t=e.latest,r=t?.status===`completed`&&t.exitCode===0;return(0,j.jsxs)(j.Fragment,{children:[t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有沙箱运行。仅使用本地镜像,默认无网络、工作区只读。`}):(0,j.jsxs)(`div`,{className:`rounded-lg border px-3 py-3 ${r?`border-[#b9e6c9] bg-[#f0fbf4]`:`border-[#f4caca] bg-[#fff5f5]`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[#30343b]`,children:t.image}),(0,j.jsx)(`strong`,{className:`shrink-0 font-mono text-[12px] ${r?`text-[#14733f]`:`text-[#b42318]`}`,children:t.status===`timed_out`?`超时`:`exit ${t.exitCode}`})]}),(0,j.jsx)(`p`,{className:`mt-2 break-all font-mono text-[10px] leading-4 text-[#65707b]`,children:t.command.map(e=>JSON.stringify(e)).join(` `)}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{children:t.write?`工作区可写(已确认)`:`工作区只读`}),(0,j.jsxs)(`span`,{children:[t.commandCount,` 个 argv 参数`]}),t.truncated?(0,j.jsx)(`span`,{children:`面板明细已截断`}):null]}),t.output?(0,j.jsx)(`pre`,{className:`mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-md bg-white/70 px-2 py-2 text-[10px] leading-4 text-[#4c5663]`,children:t.output}):null]}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[[`image:${e.defaults.image}`,`image`],[`pull:${e.defaults.pull}`,`pull`],[`network:${e.defaults.network}`,`network`],[`rootfs:${e.defaults.rootFilesystem}`,`rootfs`],[`workspace:${e.defaults.workspace}`,`workspace`],[`memory:${e.defaults.memory}`,`memory`],[`cpus:${e.defaults.cpus}`,`cpus`],[`pids:${e.defaults.pids}`,`pids`],[`timeout:${e.defaults.timeoutMs}ms`,`timeout`]].map(([e,t])=>(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:e},t))})]})})()}):e.id===`yaml-validator-panel`?(()=>{let e=on(n),t=e.latest;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e.status.state===`failed`||e.status.state===`cancelled`?(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[11px] text-[#b42318]`,children:[`最近一次校验`,e.status.state===`cancelled`?`已取消`:`失败`,`。`,e.status.error??``]}):null,t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有校验 YAML。可让 Agent 调用 yaml_validate。`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${t.valid?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`}`,children:t.valid?`YAML 语法有效。`:`发现 ${t.errorCount} 个语法错误。`}),(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`文档`,t.documents],[`错误`,t.errorCount],[`警告`,t.warningCount]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:e}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:t})]},e))}),!t.valid&&t.errors.length>0?(0,j.jsx)(`pre`,{className:`max-h-32 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-[#f4caca] bg-[#fffafa] p-3 text-[10px] leading-4 text-[#b42318]`,children:t.errors.map(e=>`${e.line??`?`}:${e.column??`?`} ${e.message}`).join(`
|
|
22
|
+
`)}):null,t.diagnosticsTruncated?(0,j.jsx)(`p`,{className:`text-[10px] text-[#8a5a00]`,children:`诊断预览已截断,完整计数保留在摘要中。`}):null]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:[`max:`,Math.round(e.limits.fileBytes/1024),`KiB · read-only`]})]})})():e.id===`browser-session-panel`?(()=>{let e=zn(n);if(e.malformed)return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`Browser Session 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新连接后再试。`})]});let t=e.tabs,r=e.latest,i=r?.screenshot?`已截图`:r?.clicked===!0?`已点击`:r?.status===`read`||typeof r?.text==`string`?`已读取`:r?.status===`navigated`?`已导航`:void 0;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[#30343b]`,children:e.endpoint||`本地浏览器未连接`}),(0,j.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[10px] font-semibold ${e.connected?`bg-[#e8f8ee] text-[#14733f]`:`bg-[#fff4e5] text-[#8a5a00]`}`,children:e.connected?`已连接`:`未连接`})]}),(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:[`Chrome DevTools Protocol · 显示 `,e.inventory.shown,`/`,e.inventory.total,` 个可调试页面`]}),e.connected?null:(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-[#b42318]`,children:[`请使用 remote-debugging-port 启动 Chrome。`,e.error??``]})]}),i?(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`text-[#65707b]`,children:`最近动作`}),(0,j.jsx)(`strong`,{className:`font-mono text-[#315fb8]`,children:i})]}):null,r?.text===void 0?null:(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-3`,children:[(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words text-[10px] leading-4 text-[#4c5663]`,children:r.text}),r.previewTruncated?(0,j.jsx)(`p`,{className:`mt-2 text-[10px] text-[#8a5a00]`,children:`面板正文预览已截断。`}):null]}),r?.screenshot===void 0?null:(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[10px] text-[#315fb8]`,children:[`截图元数据:`,r.screenshot.mimeType,` · `,r.screenshot.bytes.toLocaleString(),` bytes`]}),t.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:t.map(e=>(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-2`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[11px] text-[#30343b]`,children:e.title}),(0,j.jsx)(`span`,{className:`mt-1 block truncate font-mono text-[10px] text-[#687381]`,children:e.url})]},e.targetId))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`没有可调试的浏览器页面。`}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]`,children:`tabs`}),(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]`,children:`read`}),(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]`,children:`click`}),(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]`,children:`screenshot`})]})]})})():e.id===`mcp-client-panel`?(()=>{let e=_a(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[#30343b]`,children:$(e.server??`尚未连接 MCP 服务器`)}),(0,j.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 font-mono text-[10px] text-[#3565c5]`,children:[(0,j.jsxs)(`span`,{children:[e.inventory.tools.total,` 工具`]}),(0,j.jsx)(`span`,{className:`text-[#687381]`,children:`·`}),(0,j.jsxs)(`span`,{children:[e.inventory.resources.total,` 资源`]}),(0,j.jsx)(`span`,{className:`text-[#687381]`,children:`·`}),(0,j.jsxs)(`span`,{children:[e.inventory.prompts.total,` 提示`]})]})]}),(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:e.lastCall===null?`使用 mcp_list_tools 发现 stdio 工具。`:`最近调用:${e.lastCall}`})]}),e.tools.length>0?(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.tools.map((e,t)=>(0,j.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,title:e.description,children:e.name},`${e.name}-${t}`))}):null,e.resources.length>0?(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-[#687381]`,children:`资源`}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.resources.map((e,t)=>(0,j.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#65707b]`,title:e.uri,children:e.name??e.uri},`${e.uri}-${t}`))})]}):null,e.prompts.length>0?(0,j.jsxs)(`div`,{className:`grid gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em] text-[#687381]`,children:`提示模板`}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.prompts.map((e,t)=>(0,j.jsx)(`span`,{className:`max-w-full truncate rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#65707b]`,title:e.description,children:e.name},`${e.name}-${t}`))})]}):null,e.servers.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:e.servers.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[#30343b]`,children:e.id}),(0,j.jsx)(`span`,{className:e.status===`running`?`text-[#14733f]`:`text-[#687381]`,children:e.status})]},`${e.id}-${t}`))}):null,e.inventory.tools.truncated||e.inventory.resources.truncated||e.inventory.prompts.truncated||e.inventory.servers.truncated?(0,j.jsx)(`p`,{className:`text-[10px] text-[#687381]`,children:`面板仅显示受限预览;完整清单请使用对应 MCP 列表工具。`}):null,(0,j.jsxs)(`p`,{className:`font-mono text-[9px] text-[#8a94a1]`,children:[`响应上限 `,Math.round(e.limits.responseBytes/1024),` KiB · 请求超时 `,Math.round(e.limits.requestTimeoutMs/1e3),` 秒`]})]})})():e.id===`mcp-panel`?(()=>{let e=Array.isArray(n?.servers)?n.servers:[];return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[e.length>0?(0,j.jsx)(`ul`,{className:`grid gap-2`,children:e.map((e,t)=>{let n=typeof e==`object`&&e?e:{},r=n.status===`running`;return(0,j.jsxs)(`li`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`strong`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]`,children:$(n.id,`未命名服务器`)}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] ${r?`bg-[#eaf8f0] text-[#14733f]`:`bg-[#fff5f5] text-[#b42318]`}`,children:$(n.status,`unknown`)})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[10px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[$(n.toolCount,`0`),` 个桥接工具`]}),(0,j.jsx)(`span`,{children:`·`}),(0,j.jsx)(`span`,{children:$(n.statusSource,`runtime`)})]})]},`${$(n.id??`server`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`当前没有 MCP 服务器快照。`}),(0,j.jsxs)(`div`,{className:`text-[10px] text-[#687381]`,children:[`只读读取官方 MCP bridge 状态;健康建议通过 mcp_panel 的 health 操作查看。`,n?.writesEnabled===!0?` 已启用 profile patch 写入:${$(n.patchPath)}`:` profile patch 写入未配置,apply 会被拒绝。`]})]})})():e.id===`mock-server-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[11px] text-[#30343b]`,children:n?.running===!0?`运行中`:`未启动`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[11px] text-[#3565c5]`,children:[$(n?.routes??0),` 路由`]})]}),n?.url?(0,j.jsx)(`code`,{className:`rounded-md bg-white px-3 py-2 text-[10px] text-[#65707b]`,children:$(n.url)}):null,n?.lastRequest?(0,j.jsxs)(`p`,{className:`text-[11px] text-[#687381]`,children:[`最近请求:`,$(n.lastRequest)]}):null]}):e.id===`cli-notifier-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[11px] text-[#30343b]`,children:n?.enabled===!0?`已启用`:`已停用`}),(0,j.jsxs)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:[$(n?.platform??`unknown`),` · `,$(n?.timeoutMs??1e4),`ms`]})]}),Array.isArray(n?.notifications)&&n.notifications.length>0?(0,j.jsx)(`div`,{className:`grid gap-2`,children:n.notifications.slice(0,5).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`strong`,{className:`text-[#30343b]`,children:$(n.title??`Pi Harness`)}),(0,j.jsx)(`span`,{className:n.delivered===!0?`text-[#14733f]`:`text-[#b42318]`,children:n.delivered===!0?`已送达`:`未送达`})]}),(0,j.jsx)(`span`,{className:`mt-1 block text-[#65707b]`,children:$(n.message,``)}),n.delivered!==!0&&n.reason?(0,j.jsx)(`span`,{className:`mt-1 block break-words text-[#b42318]`,children:$(n.reason)}):null]},`${$(n.time??`notification`)}-${t}`)})}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有发送通知。`})]}):e.id===`obsidian-sync-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[11px] text-[#30343b]`,children:n?.configured===!0?`已配置`:`未配置 vault`}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#687381]`,children:`Markdown`})]}),n?.vaultPath?(0,j.jsx)(`code`,{className:`truncate rounded-md bg-white px-3 py-2 text-[10px] text-[#65707b]`,children:$(n.vaultPath)}):null,n?.last!==null&&n?.last!==void 0&&typeof n.last==`object`?(0,j.jsxs)(`p`,{className:`text-[11px] text-[#687381]`,children:[`最近写入:`,$(n.last.relativePath??`note.md`)]}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有同步笔记。`})]}):e.id===`web-research-panel`?(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3 text-[11px]`,children:[(0,j.jsx)(`span`,{className:`text-[#315fb8]`,children:n?.keyless===!0?`Firecrawl 匿名模式`:`Firecrawl 已认证`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[#315fb8]`,children:[`最多 `,$(n?.maxResults??8),` 条`]})]}),n?.latest!==null&&n?.latest!==void 0&&typeof n.latest==`object`?(()=>{let e=n.latest,t=Array.isArray(e.items)?e.items:[];return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[11px]`,children:[(0,j.jsx)(`strong`,{className:`truncate text-[#30343b]`,children:$(e.query??`网页搜索`)}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[#687381]`,children:[`前 `,Math.min(8,t.length),` / 共 `,t.length]})]}),(0,j.jsx)(`div`,{className:`grid gap-2`,children:t.slice(0,8).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`a`,{className:`rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 transition-colors hover:border-[#bdd0f5] hover:bg-[#fbfdff]`,href:$(n.url,``),rel:`noreferrer`,target:`_blank`,children:[(0,j.jsx)(`strong`,{className:`block truncate text-[11px] text-[#30343b]`,children:$(n.title??n.url??`来源`)}),(0,j.jsx)(`span`,{className:`mt-1 block truncate font-mono text-[10px] text-[#3565c5]`,children:$(n.source??n.url,``)}),n.snippet?(0,j.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[10px] leading-4 text-[#65707b]`,children:$(n.snippet)}):null]},`${$(n.url??`source`)}-${t}`)})})]})})():(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有联网搜索。可让 Agent 调用 web_search;单页读取使用 read_page。`}),(0,j.jsxs)(`p`,{className:`text-[10px] text-[#687381]`,children:[`搜索词会发送到 Firecrawl;页面读取`,n?.readPageAvailable===!0?`已复用本地 Browser Fetch`:`需要启用 Browser Fetch`,`。`]})]}):e.id===`browser-fetch-panel`?(()=>{let e=_n(n);if(e.malformed)return(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`Browser Fetch 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新加载后再抓取。`})]});let t=e.latest;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有抓取网页。默认阻止本地和私有网络目标。`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[11px] text-[#30343b]`,children:$(t.finalUrl||t.url||`page`)}),(0,j.jsxs)(`strong`,{className:`font-mono text-[12px] text-[#14733f]`,children:[`HTTP `,$(t.status||`—`)]})]}),(0,j.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]`,children:$(t.text,``)}),t.previewTruncated||t.truncated?(0,j.jsxs)(`p`,{className:`text-[10px] text-[#9a6700]`,children:[t.truncated?`响应正文已达到抓取上限;`:``,t.previewTruncated?`面板仅显示有界预览。`:``]}):null]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:[`max:`,$(Math.round(e.limits.responseBytes/1024)),`KiB`]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:[`timeout:`,$(e.limits.timeoutMs),`ms`]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:[`redirects:`,$(e.limits.redirects)]}),(0,j.jsx)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:`scripts:disabled`}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:[`private:`,$(e.allowPrivate?`allowed`:`blocked`)]})]})]})})():e.id===`i18n-pair-panel`?(()=>{let e=ta(n),t=e.report,r=t!==null&&t.missingTotal===0&&t.extraTotal===0,i=e.status.state===`unknown`?`数据异常`:e.status.state===`running`?`检查中`:e.status.state===`failed`?`检查失败`:e.status.state===`cancelled`?`已取消`:e.status.state===`completed`?`已完成`:`等待检查`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[10px] text-[#687381]`,children:[(0,j.jsx)(`span`,{className:`rounded-full border border-[#dce5f5] bg-[#f6f8fa] px-2 py-1 font-semibold text-[#3565c5]`,children:i}),e.status.at===null?null:(0,j.jsx)(`time`,{className:`font-mono`,children:new Date(e.status.at).toLocaleString()})]}),e.status.error===null?null:(0,j.jsx)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[10px] leading-4 text-[#b42318]`,children:e.status.error}),e.malformed?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[10px] leading-4 text-[#b42318]`,children:`面板数据不完整或不可信,未显示语言包统计。`}):null,t===null?(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`还没有检查语言包。可让 Agent 调用 i18n_check。`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`rounded-lg border px-3 py-3 text-[11px] ${r?`border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]`:`border-[#f4caca] bg-[#fff5f5] text-[#b42318]`}`,children:r?`语言包键完全一致。`:`缺失 ${t.missingTotal} 个,额外 ${t.extraTotal} 个。`}),(0,j.jsxs)(`div`,{className:`grid gap-2 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-3 font-mono text-[10px]`,children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-[3rem_minmax(0,1fr)] gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[#687381]`,children:`基准`}),(0,j.jsx)(`span`,{className:`truncate text-[#30343b]`,title:t.base,children:t.base})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-[3rem_minmax(0,1fr)] gap-2`,children:[(0,j.jsx)(`span`,{className:`text-[#687381]`,children:`目标`}),(0,j.jsx)(`span`,{className:`truncate text-[#30343b]`,title:t.target,children:t.target})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`基准键`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:t.baseKeys})]}),(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:`目标键`}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] text-[#30343b]`,children:t.targetKeys})]})]}),t.missing.length>0||t.extra.length>0?(0,j.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[{label:`缺失 · ${t.missingTotal}`,keys:t.missing,tone:`text-[#b42318]`},{label:`额外 · ${t.extraTotal}`,keys:t.extra,tone:`text-[#9a6700]`}].map(e=>(0,j.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3`,children:[(0,j.jsx)(`strong`,{className:`text-[10px] ${e.tone}`,children:e.label}),(0,j.jsx)(`ul`,{className:`mt-2 max-h-36 space-y-1 overflow-auto font-mono text-[10px] text-[#30343b]`,children:e.keys.map((e,t)=>(0,j.jsx)(`li`,{className:`truncate`,title:e,children:e},`${e}-${t}`))})]},e.label))}):null,t.truncated?(0,j.jsx)(`p`,{className:`text-[10px] text-[#9a6700]`,children:`面板仅显示有界键列表;完整结果保留在工具调用详情中。`}):null]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-2 font-mono text-[10px] text-[#3565c5]`,children:[(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`file:`,Math.round(e.limits.fileBytes/1048576),`MiB`]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`depth:`,e.limits.depth]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`keys:`,e.limits.keysPerFile]})]})]})})():e.id===`cleaner-panel`?(()=>{let e=cr(n);if(e.malformed||e.inventory===null)return(0,j.jsxs)(`div`,{className:`mt-3 rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-3 text-[11px] text-[#b42318]`,children:[(0,j.jsx)(`strong`,{className:`block text-[12px]`,children:`Cleaner 面板数据异常`}),(0,j.jsx)(`span`,{className:`mt-1 block`,children:`面板数据不完整或不可信,请重新加载后再执行清理。`})]});let t=e.inventory,r=e.lastCleanup,i=r?.status===`running`?`清理中`:r?.status===`completed`?`已完成`:r?.status===`cancelled`?`已取消`:r?.status===`failed`?`清理失败`:`尚未清理`;return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`Git 胶囊库存`}),(0,j.jsxs)(`strong`,{className:`font-mono text-[12px] text-[#3565c5]`,children:[t.total,` 个`]})]}),(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#687381]`,children:`仅清理 agent 数据目录中的 .patch 胶囊,必须显式 confirm=true。`}),(0,j.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 font-mono text-[10px] text-[#3565c5]`,children:[(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`capsules:`,e.limits.capsules]}),(0,j.jsxs)(`span`,{className:`rounded-md border border-[#dce5f5] bg-white px-2 py-1`,children:[`scan:`,e.limits.directoryEntries]})]})]}),r===null?null:(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[10px]`,children:[(0,j.jsx)(`strong`,{className:r.status===`failed`?`text-[#b42318]`:`text-[#30343b]`,children:i}),r.at===null?null:(0,j.jsx)(`time`,{className:`font-mono text-[#687381]`,children:new Date(r.at).toLocaleString()})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex gap-4 text-[11px] text-[#687381]`,children:[(0,j.jsxs)(`span`,{children:[`已删 `,(0,j.jsx)(`strong`,{className:`font-mono text-[#30343b]`,children:r.removed})]}),(0,j.jsxs)(`span`,{children:[`保留 `,(0,j.jsx)(`strong`,{className:`font-mono text-[#30343b]`,children:r.kept??`—`})]}),(0,j.jsxs)(`span`,{children:[`请求保留 `,(0,j.jsx)(`strong`,{className:`font-mono text-[#30343b]`,children:r.requestedKeep})]})]}),r.error===null?null:(0,j.jsx)(`p`,{className:`mt-2 break-words text-[10px] leading-4 text-[#b42318]`,children:r.error})]}),e.capsules.length>0?(0,j.jsx)(`div`,{className:`max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd]`,children:e.capsules.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[#edf0f3] px-3 py-2 last:border-b-0`,children:[(0,j.jsx)(`span`,{className:`truncate font-mono text-[10px] text-[#30343b]`,title:e.name,children:e.name}),(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[9px] text-[#687381]`,children:[e.bytes.toLocaleString(),` B`]})]},`${e.name}-${t}`))}):(0,j.jsx)(`div`,{className:`rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]`,children:`当前没有可清理的 Git 胶囊。`}),t.truncated?(0,j.jsxs)(`p`,{className:`text-[10px] text-[#9a6700]`,children:[`面板显示 `,t.shown,` / `,t.total,` 个条目;清理工具仍按完整的有界库存执行。`]}):null]})})():e.id===`fail-logger-panel`?(0,j.jsx)(`div`,{className:`mt-3 grid gap-3`,children:(()=>{let e=ii(n);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#fff5f5] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#7f1d1d]`,children:`聚合后的失败记录`}),(0,j.jsx)(`strong`,{className:`font-mono text-[17px] text-[#b42318]`,children:e.total})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 text-[10px] text-[#8b4a4a]`,children:[(0,j.jsxs)(`span`,{children:[`观测 `,e.observed,` 次`]}),(0,j.jsxs)(`span`,{children:[`容量 `,e.total,` / `,e.capacity]}),e.dropped>0?(0,j.jsxs)(`span`,{children:[`已淘汰 `,e.dropped,` 条旧记录`]}):null,e.truncated?(0,j.jsx)(`span`,{children:`面板明细已截断`}):null]})]}),(0,j.jsx)(`div`,{className:`max-h-56 overflow-auto rounded-lg border border-[#edf0f3]`,children:e.failures.length>0?e.failures.map((e,t)=>(0,j.jsxs)(`div`,{className:`border-b border-[#edf0f3] px-3 py-2 last:border-b-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#b42318]`,children:e.source}),(0,j.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 font-mono text-[9px] text-[#8a94a0]`,children:[e.occurrences>1?(0,j.jsxs)(`strong`,{className:`text-[#b42318]`,children:[`×`,e.occurrences]}):null,e.time===null?`时间未知`:`${e.time.slice(11,19)} UTC`]})]}),(0,j.jsx)(`p`,{className:`mt-1 break-words text-[11px] leading-4 text-[#65707b]`,children:e.message})]},`${e.time??`failure`}-${t}`)):(0,j.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#687381]`,children:`暂无失败记录。`})})]})})()}):e.id===`context-insight-panel`?(()=>{let e=so(n);return(0,j.jsxs)(`div`,{className:`mt-3 grid gap-3`,children:[(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.08em] text-[#5d6d82]`,children:`上下文占用`}),(0,j.jsx)(`strong`,{className:`text-[13px] font-semibold text-[#315fb8]`,children:e.percent===null?`—`:`${e.percent}%`})]}),(0,j.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-[#dfe8fb]`,children:(0,j.jsx)(`div`,{className:`h-full rounded-full bg-[#5d8bea] transition-[width] duration-300`,style:{width:`${Math.min(100,e.percent??0)}%`}})}),(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-[#5d6d82]`,children:[e.tokens===null?`令牌数未知`:`${e.tokens.toLocaleString()} tokens`,e.contextWindow===null?``:` / ${e.contextWindow.toLocaleString()} 上限`]})]}),(0,j.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`消息`,e.messages],[`事件`,e.events],[`压缩`,e.compactions]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-1 block text-[17px] font-semibold text-[#30343b]`,children:$(t)})]},$(e)))}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`消息组成`}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:e.messagesTruncated?`最近 ${e.scannedMessages} / ${e.messages} 条`:`全部 ${e.scannedMessages} 条`})]}),(0,j.jsx)(`div`,{className:`mt-2 grid grid-cols-5 gap-1.5`,children:[[`用户`,e.composition.user],[`助手`,e.composition.assistant],[`工具`,e.composition.toolResult],[`系统`,e.composition.system],[`其他`,e.composition.other]].map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded bg-[#f6f8fa] px-2 py-1.5 text-center`,children:[(0,j.jsx)(`span`,{className:`block text-[10px] text-[#687381]`,children:$(e)}),(0,j.jsx)(`strong`,{className:`mt-0.5 block font-mono text-[13px] text-[#30343b]`,children:$(t)})]},$(e)))})]}),(0,j.jsxs)(`div`,{className:`rounded-lg border border-[#edf0f3] bg-white px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-semibold text-[#30343b]`,children:`最近上下文事件`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-[#687381]`,children:[`显示 `,e.limits.displayedEvents,` / 保留 `,e.limits.retainedEvents,` 条`]})]}),(0,j.jsx)(`div`,{className:`mt-2 max-h-28 overflow-auto`,children:e.recentEvents.length>0?e.recentEvents.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#f0f2f5] py-1.5 last:border-b-0`,children:[(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-[#5d6d82]`,children:e.type}),(0,j.jsx)(`span`,{className:`text-[10px] text-[#687381]`,children:e.at===null?`—`:new Date(e.at).toLocaleTimeString()})]},`${e.type}-${e.at??`unknown`}-${t}`)):(0,j.jsx)(`div`,{className:`py-2 text-[11px] text-[#687381]`,children:`暂无上下文事件。`})}),e.recentEventsTruncated?(0,j.jsx)(`p`,{className:`mt-2 text-[10px] text-[#687381]`,children:`更早事件已按浏览器显示上限省略。`}):null]})]})})():(0,j.jsx)(`div`,{className:`mt-3 grid gap-2`,children:r.map(([e,t])=>(0,j.jsxs)(`div`,{className:`rounded-lg bg-[#f6f8fa] px-3 py-2`,children:[(0,j.jsx)(`span`,{className:`block font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]`,children:e}),(0,j.jsx)(`pre`,{className:`mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-words text-[12px] leading-5 text-[#30343b]`,children:Nc(t)})]},e))})]})}function Ic({pluginName:e,busy:t,error:n,onCancel:r,onConfirm:i}){let a=hc(!0,r,t);return(0,j.jsx)(`div`,{className:`plugin-confirm-backdrop`,onClick:()=>{t||r()},children:(0,j.jsxs)(`div`,{"aria-label":`确认卸载插件`,"aria-modal":`true`,className:`plugin-confirm-dialog`,onClick:e=>e.stopPropagation(),ref:a,role:`dialog`,tabIndex:-1,children:[(0,j.jsx)(`header`,{children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`卸载插件?`}),(0,j.jsx)(`small`,{children:`将从运行配置中移除,之后可以从插件市场重新安装。`})]})}),(0,j.jsx)(`code`,{children:e}),n&&(0,j.jsx)(`p`,{className:`plugin-confirm-error`,role:`alert`,children:n}),(0,j.jsxs)(`footer`,{children:[(0,j.jsx)(`button`,{"data-dialog-initial-focus":!0,disabled:t,onClick:r,type:`button`,children:`取消`}),(0,j.jsx)(`button`,{className:`danger`,disabled:t,onClick:i,type:`button`,children:t?`卸载中…`:`确认卸载`})]})]})})}function Lc({label:e,categories:t,activeCategory:n,onChange:r}){let i=(0,o.useRef)(null),[a,s]=(0,o.useState)(!1),[c,l]=(0,o.useState)(!1),u=(0,o.useCallback)(()=>{let e=i.current;if(!e)return;let t=Math.max(0,e.scrollWidth-e.clientWidth);s(e.scrollLeft>1),l(e.scrollLeft<t-1)},[]);(0,o.useEffect)(()=>{let e=i.current;if(!e)return;u();let t=typeof ResizeObserver>`u`?void 0:new ResizeObserver(u);return t?.observe(e),window.addEventListener(`resize`,u),()=>{t?.disconnect(),window.removeEventListener(`resize`,u)}},[t,u]);let d=e=>{let t=i.current;t&&t.scrollBy({behavior:`smooth`,left:e*Math.max(180,t.clientWidth*.72)})};return(0,j.jsxs)(`div`,{className:`marketplace-categories-shell ${a?`can-scroll-left`:``} ${c?`can-scroll-right`:``}`,children:[a&&(0,j.jsx)(`button`,{"aria-label":`向左查看更多分类`,className:`marketplace-category-scroll previous`,onClick:()=>d(-1),type:`button`,children:`‹`}),(0,j.jsx)(`nav`,{"aria-label":e,className:`marketplace-categories`,onScroll:u,ref:i,children:t.map(e=>{let t=n===e.id;return(0,j.jsxs)(`button`,{"aria-pressed":t,className:`marketplace-category ${t?`active`:``}`,onClick:()=>r(e.id),type:`button`,children:[(0,j.jsx)(`span`,{children:e.label}),(0,j.jsx)(`span`,{className:t?`font-mono text-[10px] text-[#3565c5]`:`font-mono text-[10px] text-[#687381]`,children:e.count})]},e.id||`all`)})}),c&&(0,j.jsx)(`button`,{"aria-label":`向右查看更多分类`,className:`marketplace-category-scroll next`,onClick:()=>d(1),type:`button`,children:`›`})]})}function Rc({plugins:e,panels:t,catalog:n,onMarketplace:r,onOpenDetail:i,onToml:a,onToggle:s,onUninstall:c}){let l=(0,o.useMemo)(()=>new Map(n.map(e=>[e.packageName,e])),[n]),u=(0,o.useMemo)(()=>new Set(t.map(e=>e.pluginId)),[t]),d=(0,o.useMemo)(()=>e.filter(e=>e.removable||u.has(e.name)),[u,e]),[f,p]=(0,o.useState)(``),[m,h]=(0,o.useState)(``),[g,_]=(0,o.useState)(),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(),S=(0,o.useRef)(null),C=(0,o.useMemo)(()=>{let e=new Map;for(let t of d){let n=l.get(t.name)?.category??t.category??{id:`other`,label:`其他`},r=e.get(n.id);e.set(n.id,{...n,count:(r?.count??0)+1})}return Qe([...e.values()].sort((e,t)=>t.count-e.count||e.label.localeCompare(t.label,`zh-CN`)))},[l,d]),w=(0,o.useMemo)(()=>d.filter(e=>{let t=l.get(e.name),n=t?.category??e.category??{id:`other`,label:`其他`};if(m&&n.id!==m)return!1;let r=[e.name,t?.name,yc(e.name),t?.category.label,...t?.capabilities??[],e.category?.label,vc(e.name)];return lr(f,r)}),[l,m,d,f]);(0,o.useEffect)(()=>{S.current?.scrollTo({top:0})},[m,f]),(0,o.useEffect)(()=>{m&&!C.some(e=>e.id===m)&&h(``)},[m,C]);let T=async(e,t)=>{y(``),_(e.id);try{return await t(e),!0}catch(e){return y(e instanceof Error?e.message:String(e)),!1}finally{_(void 0)}};return(0,j.jsx)(`section`,{className:`view-panel plugins-view`,children:(0,j.jsxs)(`div`,{className:`plugins-page`,children:[(0,j.jsxs)(`div`,{className:`subnav`,children:[(0,j.jsxs)(`div`,{"aria-label":`插件目录`,className:`segmented`,children:[(0,j.jsx)(`button`,{"aria-pressed":`true`,className:`active`,type:`button`,children:`已安装`}),(0,j.jsx)(`button`,{"aria-pressed":`false`,onClick:r,type:`button`,children:`插件市场`})]}),(0,j.jsx)(`span`,{children:`已安装插件`}),(0,j.jsx)(`a`,{href:`#`,onClick:e=>{e.preventDefault(),a()},children:`查看运行配置`})]}),(0,j.jsxs)(`div`,{className:`plugins-toolbar`,children:[(0,j.jsx)(`input`,{"aria-label":`搜索已安装插件`,onChange:e=>p(e.target.value),placeholder:`搜索名称、包名或能力…`,type:`search`,value:f}),(0,j.jsxs)(`span`,{"aria-live":`polite`,children:[f.trim()||m?`${w.length} / ${d.length}`:`${d.length}`,` 个插件`]})]}),(0,j.jsx)(Lc,{activeCategory:m,categories:C,label:`已安装插件分类`,onChange:h}),(0,j.jsxs)(`div`,{className:`plugins-scroll`,ref:S,children:[(0,j.jsxs)(`div`,{className:`plugins-list`,children:[w.map(e=>{let t=l.get(e.name),n=t?.category.label??e.category?.label,r=vc(e.name),a=t?.name??yc(e.name),o=dr(e,t);return(0,j.jsxs)(`article`,{className:`catalog-card plugin-card`,children:[(0,j.jsxs)(`div`,{className:`plugin-card-head`,children:[(0,j.jsx)(`span`,{className:`plugin-icon`,children:`◈`}),(0,j.jsx)(`div`,{className:`plugin-copy`,children:(0,j.jsxs)(`div`,{className:`plugin-heading`,children:[(0,j.jsxs)(`div`,{className:`plugin-title`,children:[(0,j.jsx)(`strong`,{children:a}),(0,j.jsx)(`span`,{className:`plugin-state ${e.enabled?`active`:``}`,children:e.enabled?`运行中`:`已停用`}),n&&(0,j.jsx)(`span`,{className:`capability`,children:n}),n!==r&&(0,j.jsx)(`span`,{className:`capability`,children:r})]}),(0,j.jsx)(`div`,{className:`plugin-actions`,children:e.removable?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{"aria-label":`${e.enabled?`停用`:`启用`} ${a}`,"aria-pressed":e.enabled,className:`plugin-switch-button`,disabled:g!==void 0,onClick:()=>void T(e,e=>s(e)),type:`button`,children:(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`switch ${e.enabled?`on`:``}`,children:(0,j.jsx)(`i`,{})})}),(0,j.jsx)(`button`,{className:`plugin-uninstall`,disabled:g!==void 0,onClick:()=>{y(``),x(e)},type:`button`,children:`卸载`})]}):(0,j.jsx)(`span`,{className:`switch ${e.enabled?`on`:``}`,children:(0,j.jsx)(`i`,{})})})]})})]}),(0,j.jsxs)(`div`,{className:`plugin-card-body`,children:[(0,j.jsx)(`code`,{className:`plugin-package`,children:o.packageLabel}),(0,j.jsx)(`p`,{className:`plugin-description`,children:o.description}),(0,j.jsx)(`div`,{className:`hook-list`,children:o.tags.map((e,t)=>(0,j.jsx)(`span`,{children:e},`${e}-${t}`))})]}),(0,j.jsxs)(`footer`,{className:`plugin-card-footer`,children:[(0,j.jsx)(`button`,{"aria-label":`查看 ${a} 详情`,className:`plugin-detail-link`,onClick:()=>i(e),type:`button`,children:`查看详情 →`}),u.has(e.name)?(0,j.jsx)(`span`,{children:`实时面板`}):null]})]},e.id)}),d.length?w.length?null:(0,j.jsx)(`div`,{className:`empty-state`,children:`没有匹配当前搜索与分类条件的已安装插件。`}):(0,j.jsx)(`div`,{className:`empty-state`,children:`还没有安装可管理的插件。去插件市场安装一个吧。`})]}),v&&(0,j.jsx)(`p`,{className:`plugin-action-error`,children:v}),t.length>d.length&&(0,j.jsxs)(`section`,{className:`mt-4 border-t border-[#e3e7ee] pt-4`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between gap-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`其他插件面板`}),(0,j.jsx)(`p`,{className:`mt-1 text-[12px] text-[#687381]`,children:`由已启用插件提供的实时状态。`})]}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]`,children:`LIVE`})]}),(0,j.jsx)(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:t.filter(e=>!d.some(t=>t.name===e.pluginId)).map(e=>(0,j.jsx)(Fc,{panel:e},e.id))})]})]}),b&&(0,j.jsx)(Ic,{busy:g!==void 0,error:v,onCancel:()=>x(void 0),onConfirm:()=>void T(b,c).then(e=>{e&&x(void 0)}),pluginName:l.get(b.name)?.name??yc(b.name)})]})})}function zc({plugin:e,panel:t,metadata:n,onBack:r,onToggle:i,onUninstall:a}){let[s,c]=(0,o.useState)(),[l,u]=(0,o.useState)(``),[d,f]=(0,o.useState)(!1),p=n?.name??yc(e.name),m=async(e,t)=>{u(``),c(e);try{return await t(),!0}catch(e){return u(e instanceof Error?e.message:String(e)),!1}finally{c(void 0)}};return(0,j.jsxs)(`section`,{className:`marketplace-page flex min-w-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,j.jsxs)(`div`,{className:`subnav plugin-detail-subnav`,children:[(0,j.jsx)(`a`,{href:`?page=plugins`,onClick:e=>{e.preventDefault(),r()},children:`← 已安装插件`}),(0,j.jsx)(`span`,{children:`插件详情`})]}),(0,j.jsxs)(`div`,{className:`plugin-detail-content`,children:[(0,j.jsxs)(`header`,{className:`border-b border-[#e3e7ee] pb-7`,children:[(0,j.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`rounded px-2 py-1 font-mono text-[10px] ${e.enabled?`bg-[#e6faed] text-[#14733f]`:`bg-[#eef0f3] text-[#687381]`}`,children:e.enabled?`运行中`:`已停用`}),(0,j.jsx)(`span`,{className:`rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]`,children:n?.category.label??e.category?.label??`运行时插件`}),(0,j.jsx)(`span`,{className:`rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:vc(e.name)})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:`mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]`,children:`PLUGIN DETAIL`}),(0,j.jsx)(`h1`,{className:`text-3xl font-semibold tracking-[-0.03em] text-[#20252b]`,children:p}),(0,j.jsxs)(`code`,{className:`mt-3 block break-all text-[12px] text-[#687381]`,children:[e.name,n?` · v${n.version}`:``]})]}),e.removable?(0,j.jsxs)(`div`,{className:`plugin-detail-actions`,children:[(0,j.jsx)(`button`,{className:`plugin-detail-action`,disabled:s!==void 0,onClick:()=>void m(`toggle`,()=>i(e)),type:`button`,children:s===`toggle`?`处理中…`:e.enabled?`停用插件`:`启用插件`}),(0,j.jsx)(`button`,{className:`plugin-detail-action danger`,disabled:s!==void 0,onClick:()=>{u(``),f(!0)},type:`button`,children:`卸载插件`})]}):(0,j.jsx)(`span`,{className:`rounded-full bg-[#eef0f3] px-3 py-1.5 text-[11px] text-[#687381]`,children:`内置组件`})]}),(0,j.jsx)(`p`,{className:`mt-5 max-w-3xl text-[14px] leading-7 text-[#59636e]`,children:n?.description??(e.enabled?`由当前运行时加载并启用,能力与 hook 已注册。`:`插件保留在运行配置中,但当前处于停用状态。`)}),l&&(0,j.jsxs)(`p`,{className:`mt-3 text-[12px] text-[#b42318]`,role:`alert`,children:[`操作失败:`,l]})]}),(0,j.jsxs)(`div`,{className:`grid gap-4 py-6 lg:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`插件能力`}),(0,j.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:(n?.capabilities.length?n.capabilities:[vc(e.name)]).map(e=>(0,j.jsx)(`span`,{className:`rounded-md bg-[#f1f4f9] px-2 py-1 font-mono text-[11px] text-[#61666b]`,children:e},e))})]}),n?.hooks.length?(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`扩展点`}),(0,j.jsx)(`div`,{className:`mt-4 space-y-2`,children:n.hooks.map(e=>(0,j.jsx)(`div`,{className:`rounded-md bg-[#f8f9fb] px-3 py-2 font-mono text-[11px] text-[#61666b]`,children:e},e))})]}):null,(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`实时详情`}),(0,j.jsx)(`p`,{className:`mt-1 text-[12px] text-[#687381]`,children:`当前本机会话中的插件运行状态。`})]}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.1em] text-[#687381]`,children:`LIVE`})]}),t?(0,j.jsx)(Fc,{inline:!0,panel:t}):(0,j.jsx)(`div`,{className:`empty-state`,children:`这个插件暂未提供实时面板。`})]})]}),(0,j.jsxs)(`aside`,{className:`h-fit rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`插件信息`}),(0,j.jsxs)(`dl`,{className:`mt-4 divide-y divide-[#eef0f3] text-[12px]`,children:[(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`运行状态`}),(0,j.jsx)(`dd`,{className:`font-mono text-[#3b424b]`,children:e.state})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`配置标识`}),(0,j.jsx)(`dd`,{className:`max-w-[150px] break-all text-right font-mono text-[#3b424b]`,children:e.id})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`分类`}),(0,j.jsx)(`dd`,{className:`text-right text-[#3b424b]`,children:e.category?.label??`运行时插件`})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`管理方式`}),(0,j.jsx)(`dd`,{className:`text-right text-[#3b424b]`,children:e.removable?`可配置`:`随运行时加载`})]}),n?(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`版本`}),(0,j.jsx)(`dd`,{className:`font-mono text-[#3b424b]`,children:n.version})]}):null]}),n?(0,j.jsx)(`a`,{className:`mt-4 block border-t border-[#eef0f3] pt-4 text-[12px] text-[#3565c5]`,href:n.repository,rel:`noreferrer`,target:`_blank`,children:`查看源码 ↗`}):null]})]})]})]}),d?(0,j.jsx)(Ic,{busy:s===`uninstall`,error:l,onCancel:()=>f(!1),onConfirm:()=>void m(`uninstall`,()=>a(e)).then(e=>{e&&f(!1)}),pluginName:p}):null]})}function Bc({plugins:e,capabilities:t,categories:n,total:r,page:i,hasNext:a,query:s,capabilityFilter:c,categoryFilter:l,onQueryChange:u,onCapabilityChange:d,onCategoryChange:f,onPageChange:p,onOpenDetail:m,onBack:h,onToml:g,installedPackages:_,onInstall:v}){let[y,b]=(0,o.useState)(),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)(``),T=(0,o.useMemo)(()=>Qe(n),[n]),E=async e=>{S(``),w(``),b(e.id);try{(await v(e)).restartRequired===!0&&w(`已写入 profile,重启 Pi Harness 后生效。`)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(void 0)}};return(0,j.jsx)(`section`,{className:`marketplace-page flex min-w-0 flex-1 flex-col`,children:(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsxs)(`div`,{className:`subnav`,children:[(0,j.jsxs)(`div`,{"aria-label":`插件目录`,className:`segmented`,children:[(0,j.jsx)(`button`,{"aria-pressed":`false`,onClick:h,type:`button`,children:`已安装`}),(0,j.jsx)(`button`,{"aria-pressed":`true`,className:`active`,type:`button`,children:`插件市场`})]}),(0,j.jsx)(`span`,{children:`已审核插件目录`}),(0,j.jsx)(`a`,{href:`#`,onClick:e=>{e.preventDefault(),g()},children:`查看运行配置`})]}),(0,j.jsxs)(`div`,{className:`marketplace-toolbar`,children:[(0,j.jsx)(`input`,{className:`marketplace-search`,"aria-label":`搜索插件`,onChange:e=>u(e.target.value),placeholder:`搜索名称、包名、能力…`,value:s}),(0,j.jsxs)(`select`,{className:`marketplace-filter`,"aria-label":`按能力筛选`,onChange:e=>d(e.target.value),value:c,children:[(0,j.jsx)(`option`,{value:``,children:`全部能力`}),t.map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))]}),(0,j.jsxs)(`span`,{className:`marketplace-count`,children:[r,` 个已审核条目 · 推荐排序`]})]}),(0,j.jsx)(Lc,{activeCategory:l,categories:T,label:`插件分类`,onChange:f}),(0,j.jsxs)(`div`,{className:`marketplace-scroll`,children:[(0,j.jsxs)(`div`,{className:`marketplace-grid`,children:[e.map(e=>(0,j.jsxs)(`article`,{className:`catalog-card marketplace-card`,children:[(0,j.jsxs)(`header`,{className:`marketplace-card-head`,children:[(0,j.jsx)(`div`,{className:`marketplace-card-mark`,children:`◈`}),(0,j.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,j.jsx)(`strong`,{className:`marketplace-title`,children:e.name}),(0,j.jsx)(`span`,{className:e.status===`verified`?`rounded bg-[#e6faed] px-1.5 py-px font-mono text-[10px] text-[#14733f]`:`rounded bg-[#fff5e7] px-1.5 py-px font-mono text-[10px] text-[#9a6700]`,children:e.status===`verified`?`已验证`:`实验性`}),(0,j.jsx)(`span`,{className:e.source===`official`?`rounded bg-[#e4edfd] px-1.5 py-px font-mono text-[10px] text-[#3565c5]`:`rounded bg-[#fef5e7] px-1.5 py-px font-mono text-[10px] text-[#9a6700]`,children:e.source===`official`?`官方`:`社区`}),(0,j.jsx)(`span`,{className:`rounded bg-[#f2edff] px-1.5 py-px text-[10px] text-[#6d4bc3]`,children:e.category.label})]})})]}),(0,j.jsxs)(`div`,{className:`marketplace-card-body`,children:[(0,j.jsxs)(`code`,{className:`marketplace-package`,children:[yc(e.packageName),` · v`,e.version]}),(0,j.jsx)(`p`,{className:`marketplace-description`,children:e.description}),(0,j.jsxs)(`div`,{className:`marketplace-tags`,children:[e.capabilities.map(e=>(0,j.jsx)(`span`,{className:`rounded bg-[#f1f4f9] px-1.5 py-px font-mono text-[10px] text-[#61666b]`,children:e},e)),e.hooks.map(e=>(0,j.jsxs)(`span`,{className:`rounded bg-[#f1f4f9] px-1.5 py-px font-mono text-[10px] text-[#61666b]`,children:[`hook:`,e]},`hook:${e}`))]}),e.statistics&&(0,j.jsx)(`div`,{className:`marketplace-statistics mt-3 grid grid-cols-3 divide-x divide-[#e3e7ee] rounded-md border border-[#e3e7ee] bg-[#f8f9fb]`,children:et(e.statistics).map(e=>(0,j.jsxs)(`span`,{className:`min-w-0 px-2 py-1.5`,title:`${e.label} ${e.value}`,children:[(0,j.jsx)(`small`,{className:`block truncate text-[9px] text-[#687381]`,children:e.label}),(0,j.jsx)(`strong`,{className:`mt-0.5 block truncate font-mono text-[10px] font-medium text-[#3b424b]`,children:e.value})]},e.label))})]}),(0,j.jsxs)(`footer`,{className:`marketplace-card-footer`,children:[(0,j.jsxs)(`span`,{children:[e.author,` · `,e.license]}),(0,j.jsx)(`a`,{href:Xe(e.id),onClick:t=>{t.preventDefault(),m(e)},children:`查看详情 →`}),(0,j.jsx)(`a`,{href:e.repository,target:`_blank`,rel:`noreferrer`,children:`查看源码 ↗`}),(0,j.jsx)(`button`,{disabled:_.has(e.packageName)||y!==void 0,onClick:()=>void E(e),type:`button`,children:_.has(e.packageName)?`已安装`:y===e.id?`安装中…`:`安装`})]})]},e.id)),!e.length&&(0,j.jsx)(`div`,{className:`empty-state`,children:`没有匹配的插件。`})]}),C&&(0,j.jsx)(`p`,{className:`mt-2 text-[11px] text-[#3565c5]`,children:C}),x&&(0,j.jsxs)(`p`,{className:`mt-2 text-[11px] text-[#b42318]`,children:[`安装失败:`,x]}),(0,j.jsxs)(`div`,{className:`marketplace-pagination`,children:[(0,j.jsx)(`button`,{className:`marketplace-pagination-button`,disabled:i===0,onClick:()=>p(i-1),type:`button`,children:`上一页`}),(0,j.jsxs)(`span`,{children:[`第 `,i+1,` 页`]}),(0,j.jsx)(`button`,{className:`marketplace-pagination-button`,disabled:!a,onClick:()=>p(i+1),type:`button`,children:`下一页`})]}),(0,j.jsxs)(`div`,{className:`marketplace-contribute mt-3 flex items-center gap-2.5 rounded-[10px] border border-dashed border-[#b8ccf5] bg-[#f8f9ff] p-2.5 text-[11.5px] text-[#687381]`,children:[(0,j.jsx)(`strong`,{className:`text-[12px] text-[#0f1115]`,children:`你有一个 Pi Harness 插件?`}),(0,j.jsx)(`span`,{children:`在 entries 目录新增一个元数据文件,附测试和 README 后提交 PR;审核通过后会出现在这里。`}),(0,j.jsx)(`a`,{className:`ml-auto flex-none text-[#3565c5]`,href:`https://github.com/pi-harness/pi-harness/blob/main/docs/plugin-marketplace.md`,target:`_blank`,rel:`noreferrer`,children:`查看贡献规范 ↗`})]})]})]})})}function Vc({plugin:e,installed:t,onInstall:n,onBack:r}){let[i,a]=(0,o.useState)(!1),[s,c]=(0,o.useState)(``),[l,u]=(0,o.useState)(``),d=async()=>{c(``),u(``),a(!0);try{(await n(e)).restartRequired===!0&&u(`已写入 profile,重启 Pi Harness 后生效。`)}catch(e){c(e instanceof Error?e.message:String(e))}finally{a(!1)}};return(0,j.jsx)(`section`,{className:`marketplace-page flex min-w-0 flex-1 flex-col`,children:(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,j.jsxs)(`div`,{className:`subnav plugin-detail-subnav`,children:[(0,j.jsx)(`a`,{href:`?page=marketplace`,onClick:e=>{e.preventDefault(),r()},children:`← 插件市场`}),(0,j.jsx)(`span`,{children:`插件详情`})]}),(0,j.jsxs)(`div`,{className:`plugin-detail-content`,children:[(0,j.jsxs)(`header`,{className:`border-b border-[#e3e7ee] pb-7`,children:[(0,j.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]`,children:e.source===`official`?`官方插件`:`社区插件`}),(0,j.jsx)(`span`,{className:`rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]`,children:e.category.label}),(0,j.jsx)(`span`,{className:e.status===`verified`?`rounded bg-[#e6faed] px-2 py-1 font-mono text-[10px] text-[#14733f]`:`rounded bg-[#fff5e7] px-2 py-1 font-mono text-[10px] text-[#9a6700]`,children:e.status===`verified`?`已验证`:`实验性`})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`p`,{className:`mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]`,children:`PLUGIN DETAIL`}),(0,j.jsx)(`h1`,{className:`text-3xl font-semibold tracking-[-0.03em] text-[#20252b]`,children:e.name}),(0,j.jsxs)(`code`,{className:`mt-3 block break-all text-[12px] text-[#687381]`,children:[e.packageName,` · v`,e.version]})]}),(0,j.jsx)(`div`,{className:`plugin-detail-actions`,children:(0,j.jsx)(`button`,{className:`plugin-detail-action primary`,disabled:t||i,onClick:()=>void d(),type:`button`,children:t?`已安装`:i?`安装中…`:`安装插件`})})]}),(0,j.jsx)(`p`,{className:`mt-5 max-w-3xl text-[14px] leading-7 text-[#59636e]`,children:e.description}),l&&(0,j.jsx)(`p`,{className:`mt-3 text-[12px] text-[#3565c5]`,children:l}),s&&(0,j.jsxs)(`p`,{className:`mt-3 text-[12px] text-[#b42318]`,children:[`安装失败:`,s]})]}),(0,j.jsxs)(`div`,{className:`grid gap-4 py-6 lg:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`插件能力`}),(0,j.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.capabilities.map(e=>(0,j.jsx)(`span`,{className:`rounded-md bg-[#f1f4f9] px-2 py-1 font-mono text-[11px] text-[#61666b]`,children:e},e))})]}),(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`扩展点`}),(0,j.jsx)(`div`,{className:`mt-4 space-y-2`,children:e.hooks.map(e=>(0,j.jsx)(`div`,{className:`rounded-md bg-[#f8f9fb] px-3 py-2 font-mono text-[11px] text-[#61666b]`,children:e},e))})]}),(0,j.jsxs)(`section`,{className:`rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`运行配置`}),(0,j.jsx)(`p`,{className:`mt-1 text-[12px] text-[#687381]`,children:`安装后会写入当前运行 profile。`}),(0,j.jsx)(`pre`,{className:`mt-4 overflow-auto rounded-lg bg-[#f7f8fa] p-4 text-[11px] leading-6 text-[#3b424b]`,children:(0,j.jsx)(`code`,{children:JSON.stringify(e.profile,null,2)})})]})]}),(0,j.jsxs)(`aside`,{className:`h-fit rounded-[10px] border border-[#e3e7ee] bg-white p-5`,children:[(0,j.jsx)(`h2`,{className:`text-[13px] font-semibold text-[#20252b]`,children:`插件信息`}),(0,j.jsxs)(`dl`,{className:`mt-4 divide-y divide-[#eef0f3] text-[12px]`,children:[(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`作者`}),(0,j.jsx)(`dd`,{className:`text-right text-[#3b424b]`,children:e.author})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`许可证`}),(0,j.jsx)(`dd`,{className:`font-mono text-[#3b424b]`,children:e.license})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`分类`}),(0,j.jsx)(`dd`,{className:`text-right text-[#3b424b]`,children:e.category.label})]}),(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:`版本`}),(0,j.jsx)(`dd`,{className:`font-mono text-[#3b424b]`,children:e.version})]}),et(e.statistics).map(e=>(0,j.jsxs)(`div`,{className:`flex justify-between gap-4 py-3`,children:[(0,j.jsx)(`dt`,{className:`text-[#687381]`,children:e.label}),(0,j.jsx)(`dd`,{className:`font-mono text-[#3b424b]`,children:e.value})]},e.label))]}),(0,j.jsx)(`a`,{className:`mt-4 block border-t border-[#eef0f3] pt-4 text-[12px] text-[#3565c5]`,href:e.repository,target:`_blank`,rel:`noreferrer`,children:`查看源码 ↗`})]})]})]})]})})}function Hc({data:e,api:t,tab:n,onTab:r,onClose:i,onRefresh:a}){let s=e.status,[c,l]=(0,o.useState)({}),[u,d]=(0,o.useState)({}),[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)({provider:``,name:``,baseUrl:``,api:`openai-completions`,apiKey:``,model:``}),[g,_]=(0,o.useState)(),[v,y]=(0,o.useState)(`form`),[b,x]=(0,o.useState)(``),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(``),E=e.plugins.some(e=>e.name.endsWith(`/cli-notifier`)&&e.enabled),ee=hc(f,()=>p(!1),u.__add);(0,o.useEffect)(()=>{(n===`general`||n===`toml`)&&(T(`读取中…`),t.getConfig().then(e=>{_(e),x(e.source),T(``)}).catch(e=>T(e instanceof Error?e.message:String(e))))},[t,n]);let D=(e,n)=>{C(!0),T(n),t.updateConfig(e).then(e=>{_(e),x(e.source)}).then(()=>T(`已保存`)).catch(e=>T(e instanceof Error?e.message:String(e))).finally(()=>C(!1))},O=(e,n)=>{u[e]||(d(t=>({...t,[e]:!0})),l(t=>({...t,[e]:n===`test`?`测试中…`:`刷新中…`})),n===`test`?t.testProvider(e).then(t=>{let n=t.auth,r=n&&typeof n==`object`&&`label`in n&&typeof n.label==`string`?n.label:void 0;l(n=>({...n,[e]:t.reachable?`连接正常`:r??`未检测到认证`}))}).catch(t=>l(n=>({...n,[e]:t instanceof Error?t.message:String(t)}))).finally(()=>d(t=>({...t,[e]:!1}))):t.refreshProvider(e).then(t=>l(n=>({...n,[e]:`${t.models.length} 个模型已刷新`}))).catch(t=>l(n=>({...n,[e]:t instanceof Error?t.message:String(t)}))).finally(()=>d(t=>({...t,[e]:!1}))))};return(0,j.jsx)(`section`,{className:`view-panel settings-page`,children:(0,j.jsxs)(`div`,{className:`settings-dialog`,children:[(0,j.jsx)(`nav`,{"aria-label":`设置分类`,className:`settings-top-tabs`,children:[`general`,`providers`,`toml`].map(t=>(0,j.jsx)(`button`,{"aria-pressed":n===t,className:`settings-tab ${n===t?`active`:``}`,onClick:()=>r(t),type:`button`,children:t===`general`?`通用`:t===`providers`?`提供商 ${e.providers.length}`:`运行配置`},t))}),(0,j.jsxs)(`section`,{children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`button`,{className:`settings-back`,onClick:i,type:`button`,children:`← 返回会话`}),(0,j.jsxs)(`div`,{className:`settings-header-copy`,children:[(0,j.jsx)(`strong`,{children:n===`general`?`通用`:n===`providers`?`提供商`:`运行配置`}),(0,j.jsx)(`small`,{children:n===`toml`?`配置即代码,改完重载`:`运行时状态与快捷键`})]})]}),(0,j.jsxs)(`div`,{className:`settings-body`,children:[n===`general`&&(0,j.jsxs)(j.Fragment,{children:[[[`工作目录`,s?.cwd],[`agent 目录`,s?.agentDir],[`会话`,s?`${s.sessionId} · ${s.messages} 条消息`:`—`],[`快捷键`,`⌘K 命令 · ⌘, 设置 · ⌃C 中断`],[`权限策略`,`当前 API 未提供修改接口`]].map(([e,t])=>(0,j.jsx)(`div`,{className:`general-row`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:e}),(0,j.jsx)(`small`,{children:$(t)})]})},e)),(0,j.jsxs)(`div`,{className:`general-row`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`任务结束提醒插件`}),(0,j.jsx)(`small`,{children:`由 CLI Notifier 提供,具体目标在插件配置中管理`})]}),(0,j.jsx)(`span`,{className:`setting-status ${E?`on`:``}`,children:E?`已加载`:`未加载`})]}),(0,j.jsxs)(`div`,{className:`general-row`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`自动压缩上下文`}),(0,j.jsx)(`small`,{children:`接近上下文上限时自动整理历史消息,可在运行配置中修改`}),!g&&w&&w!==`读取中…`?(0,j.jsxs)(`small`,{className:`setting-error`,role:`alert`,children:[`配置读取失败:`,w]}):null]}),(0,j.jsx)(`span`,{className:`setting-status ${g?.settings.compaction.enabled?`on`:``}`,children:g?g.settings.compaction.enabled?`已开启`:`已关闭`:w===`读取中…`?`读取中`:`不可用`})]})]}),n===`providers`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`provider-add-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`已启用提供商`}),(0,j.jsx)(`small`,{children:`模型列表只显示当前会话和已配置提供商。`})]}),(0,j.jsx)(`button`,{className:`primary`,onClick:()=>p(!0),type:`button`,children:`添加提供商`})]}),f&&(0,j.jsx)(`div`,{className:`provider-add-overlay`,onClick:()=>{u.__add||p(!1)},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),u.__add||p(!1))},children:(0,j.jsxs)(`div`,{"aria-busy":u.__add,"aria-label":`添加提供商`,"aria-modal":`true`,className:`provider-add-modal`,onClick:e=>e.stopPropagation(),ref:ee,role:`dialog`,tabIndex:-1,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`添加自定义提供商`}),(0,j.jsx)(`small`,{children:`注册 OpenAI 兼容接口,凭据只提交到本机 Pi runtime。`})]}),(0,j.jsx)(`button`,{"aria-label":`关闭添加提供商`,disabled:u.__add,onClick:()=>p(!1),type:`button`,children:`×`})]}),(0,j.jsxs)(`form`,{className:`provider-add-form`,onSubmit:e=>{e.preventDefault(),!(!m.provider||!m.baseUrl||!m.apiKey||!m.model)&&(d(e=>({...e,__add:!0})),l(e=>({...e,__add:`添加中…`})),t.addProvider(m).then(async()=>{h({provider:``,name:``,baseUrl:``,api:`openai-completions`,apiKey:``,model:``}),l(e=>({...e,__add:`已添加`})),await a(),p(!1)}).catch(e=>l(t=>({...t,__add:e instanceof Error?e.message:String(e)}))).finally(()=>d(e=>({...e,__add:!1}))))},children:[(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`提供商 ID`}),(0,j.jsx)(`input`,{"aria-label":`提供商 ID`,"data-dialog-initial-focus":!0,maxLength:64,minLength:2,pattern:`[a-z0-9][a-z0-9._-]{1,63}`,placeholder:`例如 openrouter`,required:!0,value:m.provider,onChange:e=>h(t=>({...t,provider:e.target.value}))})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`显示名称`}),(0,j.jsx)(`input`,{"aria-label":`提供商名称`,placeholder:`可选`,value:m.name,onChange:e=>h(t=>({...t,name:e.target.value}))})]}),(0,j.jsxs)(`label`,{className:`provider-add-wide`,children:[(0,j.jsx)(`span`,{children:`接口地址`}),(0,j.jsx)(`input`,{"aria-label":`接口地址`,placeholder:`https://api.example.com/v1`,required:!0,type:`url`,value:m.baseUrl,onChange:e=>h(t=>({...t,baseUrl:e.target.value}))})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`模型 ID`}),(0,j.jsx)(`input`,{"aria-label":`模型 ID`,placeholder:`例如 gpt-4o`,required:!0,value:m.model,onChange:e=>h(t=>({...t,model:e.target.value}))})]}),(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:`协议`}),(0,j.jsxs)(`select`,{"aria-label":`协议`,value:m.api,onChange:e=>h(t=>({...t,api:e.target.value})),children:[(0,j.jsx)(`option`,{value:`openai-completions`,children:`OpenAI Completions`}),(0,j.jsx)(`option`,{value:`openai-responses`,children:`OpenAI Responses`})]})]}),(0,j.jsxs)(`label`,{className:`provider-add-wide`,children:[(0,j.jsx)(`span`,{children:`API key`}),(0,j.jsx)(`input`,{"aria-label":`API key`,placeholder:`只在本机提交,不会回显`,required:!0,type:`password`,value:m.apiKey,onChange:e=>h(t=>({...t,apiKey:e.target.value}))})]}),(0,j.jsxs)(`div`,{className:`provider-add-actions`,children:[(0,j.jsx)(`button`,{className:`primary`,disabled:u.__add,type:`submit`,children:u.__add?`添加中…`:`添加提供商`}),c.__add&&(0,j.jsx)(`small`,{"aria-live":`polite`,children:c.__add})]})]})]})}),(0,j.jsx)(`small`,{children:`已启用提供商 · /api/providers`}),e.providers.length?e.providers.map(e=>(0,j.jsxs)(`article`,{className:`provider-card`,children:[(0,j.jsxs)(`div`,{className:`provider-head`,children:[(0,j.jsx)(`span`,{className:`provider-dot`,children:`●`}),(0,j.jsx)(`strong`,{children:e.name}),(0,j.jsx)(`span`,{className:`provider-state`,children:e.active?`当前会话`:e.auth?.configured===!0?`已配置`:`未配置`})]}),(0,j.jsxs)(`div`,{className:`provider-field`,children:[(0,j.jsx)(`code`,{children:`provider`}),(0,j.jsx)(`input`,{"aria-label":`${e.name} 提供商 ID`,disabled:!0,value:e.provider,readOnly:!0})]}),(0,j.jsxs)(`div`,{className:`provider-field`,children:[(0,j.jsx)(`code`,{children:`model`}),(0,j.jsxs)(`div`,{className:`provider-model-value`,title:e.models.map(e=>e.id).join(`, `)||`暂无模型`,children:[(0,j.jsx)(`span`,{children:e.activeModel?`${e.activeModel.provider}/${e.activeModel.id}`:`未选择模型`}),e.models.length>0&&(0,j.jsxs)(`details`,{className:`provider-models-details`,children:[(0,j.jsxs)(`summary`,{children:[`查看 `,e.models.length,` 个模型`]}),(0,j.jsx)(`div`,{className:`model-chips`,children:e.models.map(e=>(0,j.jsx)(`span`,{children:e.id},e.id))})]})]})]}),(0,j.jsxs)(`div`,{className:`provider-field`,children:[(0,j.jsx)(`code`,{children:`api_key`}),(0,j.jsx)(`input`,{"aria-label":`${e.name} API key 状态`,disabled:!0,value:`不会在浏览器显示`,readOnly:!0})]}),(0,j.jsxs)(`div`,{className:`provider-footer`,children:[(0,j.jsxs)(`code`,{children:[e.models.length,` 个模型`]}),(0,j.jsx)(`button`,{disabled:u[e.provider],onClick:()=>O(e.provider,`test`),type:`button`,children:u[e.provider]&&c[e.provider]===`测试中…`?`测试中…`:`测试连接`}),(0,j.jsx)(`button`,{className:`link-button`,disabled:u[e.provider],onClick:()=>O(e.provider,`refresh`),type:`button`,children:u[e.provider]&&c[e.provider]===`刷新中…`?`刷新中…`:`拉取模型`})]}),c[e.provider]&&(0,j.jsx)(`small`,{"aria-live":`polite`,className:`provider-result`,children:c[e.provider]})]},e.provider)):(0,j.jsx)(`div`,{className:`empty-state`,children:`运行时没有注册提供商。`})]}),n===`toml`&&(0,j.jsxs)(`div`,{className:`config-editor`,children:[(0,j.jsxs)(`div`,{className:`toml-toolbar`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`运行时配置`}),(0,j.jsx)(`span`,{children:g?.path??`~/.pi/agent/settings.json`})]}),(0,j.jsx)(`button`,{className:v===`form`?`active`:``,onClick:()=>y(`form`),type:`button`,children:`表单`}),(0,j.jsx)(`button`,{className:v===`source`?`active`:``,onClick:()=>y(`source`),type:`button`,children:`源码`}),(0,j.jsx)(`button`,{className:`primary`,disabled:S,onClick:()=>{C(!0),T(`重载中…`),t.reloadConfig().then(_).then(()=>T(`已从磁盘重载`)).catch(e=>T(e instanceof Error?e.message:String(e))).finally(()=>C(!1))},type:`button`,children:`重载`})]}),w&&(0,j.jsx)(`div`,{"aria-live":`polite`,className:`config-state ${w.includes(`失败`)||w.includes(`Error`)?`error`:``}`,children:w}),g?v===`source`?(0,j.jsxs)(`div`,{className:`config-source-editor`,children:[(0,j.jsx)(`textarea`,{"aria-label":`settings.json 源码`,className:`config-source`,onChange:e=>x(e.target.value),spellCheck:!1,value:b}),(0,j.jsxs)(`div`,{className:`config-source-actions`,children:[(0,j.jsx)(`small`,{children:`完整 JSON 配置,可编辑未知字段;保存前会校验语法。`}),(0,j.jsx)(`button`,{className:`primary`,disabled:S||!b.trim(),onClick:()=>{C(!0),T(`保存源码…`),t.updateConfigSource(b).then(e=>{_(e),x(e.source),T(`已保存源码`)}).catch(e=>T(e instanceof Error?e.message:String(e))).finally(()=>C(!1))},type:`button`,children:`保存源码`})]})]}):(0,j.jsxs)(`div`,{className:`config-sections`,children:[(0,j.jsxs)(`section`,{className:`config-section`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`模型默认值`}),(0,j.jsx)(`small`,{children:`新会话启动时使用的模型和思考级别`})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`提供商`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({defaultProvider:e.target.value},`保存提供商…`),value:g.settings.defaultProvider??``,children:[(0,j.jsx)(`option`,{value:``,children:`跟随运行时`}),e.providers.map(e=>(0,j.jsx)(`option`,{value:e.provider,children:e.name},e.provider))]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`模型`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({defaultModel:e.target.value},`保存模型…`),value:g.settings.defaultModel??``,children:[(0,j.jsx)(`option`,{value:``,children:`跟随提供商`}),e.models.map(e=>(0,j.jsxs)(`option`,{value:e.id,children:[e.provider,`/`,e.name]},`${e.provider}/${e.id}`))]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`思考级别`}),(0,j.jsx)(`select`,{disabled:S,onChange:e=>D({defaultThinkingLevel:e.target.value},`保存思考级别…`),value:g.settings.defaultThinkingLevel??`medium`,children:[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`].map(e=>(0,j.jsx)(`option`,{value:e,children:e},e))})]})]}),(0,j.jsxs)(`section`,{className:`config-section`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`运行策略`}),(0,j.jsx)(`small`,{children:`消息队列和网络传输行为`})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`传输方式`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({transport:e.target.value},`保存传输方式…`),value:g.settings.transport,children:[(0,j.jsx)(`option`,{value:`auto`,children:`自动`}),(0,j.jsx)(`option`,{value:`sse`,children:`SSE`}),(0,j.jsx)(`option`,{value:`websocket`,children:`WebSocket`})]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`Steering 消息`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({steeringMode:e.target.value},`保存队列策略…`),value:g.settings.steeringMode,children:[(0,j.jsx)(`option`,{value:`one-at-a-time`,children:`逐条发送`}),(0,j.jsx)(`option`,{value:`all`,children:`一次发送全部`})]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`Follow-up 消息`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({followUpMode:e.target.value},`保存跟进策略…`),value:g.settings.followUpMode,children:[(0,j.jsx)(`option`,{value:`one-at-a-time`,children:`逐条发送`}),(0,j.jsx)(`option`,{value:`all`,children:`一次发送全部`})]})]})]}),(0,j.jsxs)(`section`,{className:`config-section`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`上下文与显示`}),(0,j.jsx)(`small`,{children:`控制思考内容和自动压缩`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`隐藏思考正文`}),(0,j.jsx)(`small`,{children:`只显示可展开的思考摘要`})]}),(0,j.jsx)(`input`,{checked:g.settings.hideThinkingBlock,disabled:S,onChange:e=>D({hideThinkingBlock:e.target.checked},`保存显示设置…`),type:`checkbox`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`自动压缩上下文`}),(0,j.jsx)(`small`,{children:`接近上下文上限时自动整理历史消息`})]}),(0,j.jsx)(`input`,{checked:g.settings.compaction.enabled,disabled:S,onChange:e=>D({compaction:{...g.settings.compaction,enabled:e.target.checked}},`保存压缩设置…`),type:`checkbox`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`自动重试`}),(0,j.jsx)(`small`,{children:`临时网络错误时自动重试请求`})]}),(0,j.jsx)(`input`,{checked:g.settings.retry.enabled,disabled:S,onChange:e=>D({retry:{...g.settings.retry,enabled:e.target.checked}},`保存重试设置…`),type:`checkbox`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`显示图片`}),(0,j.jsx)(`small`,{children:`允许模型响应中的图片渲染`})]}),(0,j.jsx)(`input`,{checked:g.settings.terminal.showImages,disabled:S,onChange:e=>D({terminal:{...g.settings.terminal,showImages:e.target.checked}},`保存图片设置…`),type:`checkbox`})]})]}),(0,j.jsxs)(`section`,{className:`config-section`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`终端与导航`}),(0,j.jsx)(`small`,{children:`控制命令行界面和消息渲染行为`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`安静启动`}),(0,j.jsx)(`small`,{children:`启动时隐藏版本和更新提示`})]}),(0,j.jsx)(`input`,{checked:g.settings.advanced.quietStartup,disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,quietStartup:e.target.checked}},`保存启动设置…`),type:`checkbox`})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`项目可信策略`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,projectTrust:e.target.value}},`保存信任策略…`),value:g.settings.advanced.projectTrust,children:[(0,j.jsx)(`option`,{value:`ask`,children:`每次询问`}),(0,j.jsx)(`option`,{value:`always`,children:`始终信任`}),(0,j.jsx)(`option`,{value:`never`,children:`从不信任`})]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`Mermaid 渲染`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,mermaid:e.target.value}},`保存 Mermaid 设置…`),value:g.settings.advanced.mermaid,children:[(0,j.jsx)(`option`,{value:`off`,children:`关闭`}),(0,j.jsx)(`option`,{value:`final`,children:`完成后渲染`}),(0,j.jsx)(`option`,{value:`streaming`,children:`流式渲染`})]})]}),(0,j.jsxs)(`label`,{className:`config-field`,children:[(0,j.jsx)(`span`,{children:`双击 Escape`}),(0,j.jsxs)(`select`,{disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,doubleEscapeAction:e.target.value}},`保存快捷键设置…`),value:g.settings.advanced.doubleEscapeAction,children:[(0,j.jsx)(`option`,{value:`tree`,children:`打开会话树`}),(0,j.jsx)(`option`,{value:`fork`,children:`创建分支`}),(0,j.jsx)(`option`,{value:`none`,children:`不执行`})]})]})]}),(0,j.jsxs)(`section`,{className:`config-section`,children:[(0,j.jsxs)(`header`,{children:[(0,j.jsx)(`strong`,{children:`诊断与隐私`}),(0,j.jsx)(`small`,{children:`控制缓存提示和匿名数据上报`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`显示缓存未命中`}),(0,j.jsx)(`small`,{children:`在消息中显示模型缓存诊断`})]}),(0,j.jsx)(`input`,{checked:g.settings.advanced.showCacheMissNotices,disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,showCacheMissNotices:e.target.checked}},`保存诊断设置…`),type:`checkbox`})]}),(0,j.jsxs)(`label`,{className:`config-toggle`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`安装遥测`}),(0,j.jsx)(`small`,{children:`发送匿名安装和版本统计`})]}),(0,j.jsx)(`input`,{checked:g.settings.advanced.enableInstallTelemetry,disabled:S,onChange:e=>D({advanced:{...g.settings.advanced,enableInstallTelemetry:e.target.checked}},`保存隐私设置…`),type:`checkbox`})]})]})]}):(0,j.jsx)(`div`,{className:`empty-state`,children:`正在读取运行时配置…`})]})]})]})]})})}var Uc=(e,t)=>{let n=t.trim().toLowerCase();return e.filter(e=>`${e.invocationName} ${e.description??``}`.toLowerCase().includes(n))};function Wc({commands:e,query:t,activeIndex:n,onActiveIndexChange:r,onUse:i}){let a=Uc(e,t),o=e=>{let t=a[e];t&&i(`/${t.invocationName}`)};return(0,j.jsx)(`div`,{"aria-label":`命令面板`,className:`command-palette`,id:`command-menu`,role:`listbox`,children:(0,j.jsxs)(`div`,{className:`palette-group`,children:[(0,j.jsxs)(`small`,{children:[`COMMANDS `,(0,j.jsx)(`span`,{children:`· RUNTIME REGISTRY`})]}),a.length?a.map((e,t)=>{let i=`/${e.invocationName}`;return(0,j.jsxs)(`button`,{"aria-selected":t===n,onClick:()=>o(t),onMouseEnter:()=>r(t),role:`option`,type:`button`,children:[(0,j.jsx)(`code`,{children:i}),(0,j.jsx)(`span`,{children:e.description??e.source??`由当前运行时注册`})]},`${e.invocationName}:${e.source??`runtime`}`)}):(0,j.jsx)(`div`,{className:`empty-state`,children:e.length?`没有匹配的命令。`:`当前运行时没有可用的命令注册清单。`})]})})}function Gc({kind:e,commands:t,files:n,query:r,activeIndex:i,onActiveIndexChange:a,onUse:o}){let s=e===`command`?Uc(t,r).slice(0,12):n.filter(e=>`${e.path} ${e.label} ${e.status}`.toLowerCase().includes(r.trim().toLowerCase())).slice(0,12);return(0,j.jsxs)(`div`,{"aria-label":e===`command`?`命令补全`:`文件补全`,className:`prompt-completion`,"data-prompt-completion":!0,id:`prompt-completion-list`,role:`listbox`,children:[(0,j.jsx)(`small`,{children:e===`command`?`命令`:`文件`}),s.length?s.slice(0,12).map((t,n)=>{let r=e===`command`?`/${t.invocationName}`:`@${t.path}`,s=e===`command`?t.description??t.source??`由当前运行时注册`:t.status;return(0,j.jsxs)(`button`,{"aria-selected":n===i,id:`prompt-completion-option-${n}`,onClick:()=>o(r),onMouseEnter:()=>a(n),role:`option`,type:`button`,children:[(0,j.jsx)(`strong`,{children:r}),(0,j.jsx)(`span`,{children:s})]},`${e}:${r}`)}):(0,j.jsx)(`span`,{className:`prompt-completion-empty`,children:`没有匹配项`})]})}function Kc({commands:e,sessions:t,files:n,onClose:r,onUse:i,onOpenSession:a,onOpenFile:s}){let[c,l]=(0,o.useState)(``),[u,d]=(0,o.useState)(0),f=hc(!0,r),p=c.trim().toLowerCase(),m=e=>!p||e.toLowerCase().includes(p),h=[...e.filter(e=>m(`${e.invocationName} ${e.description??``}`)).map(e=>({kind:`command`,command:e})),...t.filter(e=>m(`${$(e.name,``)} ${$(e.firstMessage,``)} ${$(e.sessionId,``)}`)).map(e=>({kind:`session`,session:e})),...n.filter(e=>m(`${e.path} ${e.label} ${e.status}`)).map(e=>({kind:`file`,file:e}))],g=h.length?Math.min(u,h.length-1):-1,_=g>=0?`global-search-option-${g}`:void 0;(0,o.useEffect)(()=>d(0),[c]);let v=e=>{e&&(e.kind===`command`?i(`/${e.command.invocationName}`):e.kind===`session`?a(e.session):s(e.file),r())};return(0,j.jsx)(`div`,{className:`global-search`,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,j.jsxs)(`div`,{"aria-label":`全局搜索`,"aria-modal":`true`,className:`global-search-dialog`,ref:f,role:`dialog`,tabIndex:-1,children:[(0,j.jsxs)(`div`,{className:`global-search-heading`,children:[(0,j.jsx)(`strong`,{children:`全局搜索`}),(0,j.jsx)(`small`,{children:`命令 · 会话 · 文件`}),(0,j.jsx)(`button`,{"aria-label":`关闭全局搜索`,onClick:r,type:`button`,children:`×`})]}),(0,j.jsx)(`input`,{"aria-activedescendant":_,"aria-autocomplete":`list`,"aria-controls":`global-search-results`,"aria-expanded":`true`,"aria-label":`全局搜索`,"data-dialog-initial-focus":!0,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),r()):e.key===`ArrowDown`&&h.length?(e.preventDefault(),d(e=>(e+1)%h.length)):e.key===`ArrowUp`&&h.length?(e.preventDefault(),d(e=>(e-1+h.length)%h.length)):e.key===`Enter`&&(e.preventDefault(),v(h[g]))},placeholder:`搜索命令、会话或文件`,role:`combobox`,value:c}),(0,j.jsx)(`div`,{className:`global-search-results`,id:`global-search-results`,role:`listbox`,children:h.length?[`command`,`session`,`file`].map(e=>{let t=h.filter(t=>t.kind===e);if(!t.length)return null;let n=e===`command`?`命令`:e===`session`?`会话`:`文件`;return(0,j.jsxs)(`section`,{"aria-label":n,className:`global-search-group`,role:`group`,children:[(0,j.jsx)(`small`,{"aria-hidden":`true`,children:n}),t.map(e=>{let t=h.indexOf(e),n=e.kind===`command`?`/${e.command.invocationName}`:e.kind===`session`?$(e.session.name??e.session.firstMessage??e.session.sessionId,`未命名会话`):e.file.label,r=e.kind===`command`?e.command.description??e.command.source??`由当前运行时注册`:e.kind===`session`?`${$(e.session.messageCount,`0`)} 条消息`:`${e.file.path} · ${e.file.status}`;return(0,j.jsxs)(`button`,{"aria-selected":t===g,id:`global-search-option-${t}`,onClick:()=>v(e),onMouseEnter:()=>d(t),role:`option`,type:`button`,children:[(0,j.jsx)(`strong`,{children:n}),(0,j.jsx)(`span`,{children:r})]},`${e.kind}:${n}:${t}`)})]},e)}):(0,j.jsx)(`div`,{className:`empty-state`,children:`没有匹配的命令、会话或文件。`})})]})})}function qc({api:e=Ne(),appVersion:t}){let n=(0,o.useMemo)(bc,[]),[r,i]=(0,o.useState)({sessions:[],files:[],models:[],providers:[],plugins:[],pluginPanels:[],marketplace:[],marketplaceCapabilities:[],marketplaceCategories:[],marketplaceTotal:0,marketplacePage:0,marketplaceHasNext:!1,commands:[],workspaces:[]}),[a,s]=(0,o.useState)(n.view),[c,l]=(0,o.useState)(n.page),[u,d]=(0,o.useState)(n.settings),[f,p]=(0,o.useState)(),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(``),[b,x]=(0,o.useState)(0),[S,C]=(0,o.useState)(!1),[w,T]=(0,o.useState)(),[E,ee]=(0,o.useState)(),[D,O]=(0,o.useState)(!1),[te,ne]=(0,o.useState)(),[re,ie]=(0,o.useState)(!1),[ae,k]=(0,o.useState)(),[oe,se]=(0,o.useState)(),[ce,le]=(0,o.useState)(``),[ue,de]=(0,o.useState)(!1),[fe,pe]=(0,o.useState)(``),[me,he]=(0,o.useState)(),[ge,_e]=(0,o.useState)(n.sessionPath),ve=(0,o.useRef)(n.sessionPath),ye=(0,o.useRef)(!1),[A,be]=(0,o.useState)(``),[xe,Se]=(0,o.useState)([]),[Ce,we]=(0,o.useState)(``),[Te,Ee]=(0,o.useState)(``),[De,Oe]=(0,o.useState)(``),ke=(0,o.useRef)(null),[Ae,M]=(0,o.useState)(n.marketplaceQuery),[Ie,Re]=(0,o.useState)(n.marketplaceCapability),[ze,Be]=(0,o.useState)(n.marketplaceCategory),[Ue,Ge]=(0,o.useState)(n.marketplacePlugin),[Ke,qe]=(0,o.useState)(),[Ye,Xe]=(0,o.useState)(n.marketplacePlugin!==void 0),[Ze,Qe]=(0,o.useState)(``),[$e,et]=(0,o.useState)([]),[N,nt]=(0,o.useState)(n.installedPlugin),[rt,it]=(0,o.useState)(),[at,ot]=(0,o.useState)(n.marketplacePage),[st,ct]=(0,o.useState)(!0),[lt,P]=(0,o.useState)(``),[ut,dt]=(0,o.useState)(!1),[F,ft]=(0,o.useState)(``),[pt,mt]=(0,o.useState)(!1),[ht,gt]=(0,o.useState)(!1),[I,_t]=(0,o.useState)(0),[vt,yt]=(0,o.useState)(0),[bt,xt]=(0,o.useState)(!1),[St,Ct]=(0,o.useState)(new Set),wt=(0,o.useRef)(null),Tt=(0,o.useRef)(null),[Et,Dt]=(0,o.useState)(),Ot=(0,o.useRef)(null),kt=(0,o.useRef)(null),At=(0,o.useRef)(!0),jt=(0,o.useRef)(void 0),Mt=(0,o.useRef)(!1),[Nt,Pt]=(0,o.useState)(0),[Ft,It]=(0,o.useState)(!1),[Lt,Rt]=(0,o.useState)(0),[zt,Bt]=(0,o.useState)(!0),[Vt,Ht]=(0,o.useState)([]);(0,o.useEffect)(()=>{let t=!1;return tt(e).then(e=>{t||et(e)}).catch(()=>{t||et([])}),()=>{t=!0}},[e]),(0,o.useEffect)(()=>{!ge&&r.session?.sessionFile&&_e(r.session.sessionFile)},[r.session?.sessionFile,ge]);let Ut=(0,o.useMemo)(()=>Pe(A,Nt),[A,Nt]),Wt=(0,o.useMemo)(()=>Ut?Ut.kind===`command`?Uc(r.commands,Ut.query).slice(0,12):r.files.filter(e=>`${e.path} ${e.label} ${e.status}`.toLowerCase().includes(Ut.query.trim().toLowerCase())).slice(0,12):[],[r.commands,r.files,Ut]),Gt=!!(Ut&&!Ft&&Wt.length),Kt=Math.min(Lt,Math.max(Wt.length-1,0)),qt=(0,o.useMemo)(()=>new Set(r.plugins.filter(e=>e.removable).map(e=>e.name)),[r.plugins]),Jt=!ue&&!!(me||r.status?.cwd||r.workspaces.find(e=>e.current)?.path||r.session),L=(0,o.useMemo)(()=>{let e=new Set(r.pluginPanels.map(e=>e.pluginId));return r.plugins.filter(t=>t.removable||e.has(t.name)).length},[r.pluginPanels,r.plugins]);(0,o.useEffect)(()=>{Rt(0)},[Ut?.kind,Ut?.query]),(0,o.useEffect)(()=>{if(!S&&!D)return;let e=e=>{e.target instanceof Element&&e.target.closest(`[data-session-popover]`)||(C(!1),T(void 0),ee(void 0),O(!1),ne(void 0),se(void 0))},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),C(!1),T(void 0),ee(void 0),O(!1),ne(void 0),se(void 0),Tt.current?.focus())},n=()=>{C(!1),T(void 0),ee(void 0),O(!1),ne(void 0),se(void 0)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),document.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t),document.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[S,D]),(0,o.useEffect)(()=>{if(!m&&!Gt)return;let e=e=>{let t=e.target instanceof Element?e.target:void 0;m&&!t?.closest(`[data-command-palette]`)&&(h(!1),y(``)),Gt&&!t?.closest(`[data-prompt-completion]`)&&It(!0)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[m,Gt]),(0,o.useEffect)(()=>{let e=e=>{if(e instanceof KeyboardEvent&&e.key!==`Escape`)return;let t=e.target instanceof Element?e.target:void 0;document.querySelectorAll(`details.provider-models-details[open]`).forEach(n=>{e instanceof PointerEvent&&t&&n.contains(t)||(n.removeAttribute(`open`),e instanceof KeyboardEvent&&n.querySelector(`summary`)?.focus())})};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[]),(0,o.useEffect)(()=>{if(typeof window>`u`)return;let e=new URLSearchParams(window.location.search);e.set(`page`,c),a===`chat`?e.delete(`view`):e.set(`view`,a),u?e.set(`settings`,u):e.delete(`settings`),ge?e.set(`session`,ge):e.delete(`session`),Ae?e.set(`marketplaceQuery`,Ae):e.delete(`marketplaceQuery`),Ie?e.set(`capability`,Ie):e.delete(`capability`),ze?e.set(`category`,ze):e.delete(`category`),c===`plugins`&&N?e.set(`plugin`,N):c===`marketplace`&&Ue?e.set(`plugin`,Ue):e.delete(`plugin`),at>0?e.set(`marketplacePage`,String(at)):e.delete(`marketplacePage`);let t=e.toString();window.history.replaceState(null,``,`${window.location.pathname}${t?`?${t}`:``}${window.location.hash}`)},[N,Ie,ze,at,Ue,Ae,c,ge,u,a]),(0,o.useEffect)(()=>{let e=()=>{let e=bc();h(!1),_(!1),C(!1),p(void 0),l(e.page),s(e.view),d(e.settings),_e(e.sessionPath),M(e.marketplaceQuery),Re(e.marketplaceCapability),Be(e.marketplaceCategory),ot(e.marketplacePage),nt(e.installedPlugin),Ge(e.marketplacePlugin)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,o.useEffect)(()=>{if(Ue===void 0){qe(void 0),Xe(!1),Qe(``);return}let t=r.marketplace.find(e=>e.id===Ue);if(t!==void 0){qe(t),Xe(!1),Qe(``);return}let n=!1;return qe(void 0),Xe(!0),Qe(``),e.listMarketplace(``,``,0,100).then(e=>{if(n)return;let t=e.items.find(e=>e.id===Ue);t===void 0?Qe(`没有找到这个市场插件,它可能已下架。`):qe(t)}).catch(e=>{n||Qe(e instanceof Error?e.message:String(e))}).finally(()=>{n||Xe(!1)}),()=>{n=!0}},[e,r.marketplace,Ue]),(0,o.useEffect)(()=>{if(N===void 0){it(void 0);return}let t=!1;return it(void 0),e.listMarketplace(``,``,0,100).then(e=>{t||it(e.items.find(e=>e.packageName===N))}).catch(()=>{t||it(void 0)}),()=>{t=!0}},[e,N]);let R=(0,o.useCallback)(async()=>{let t=await Promise.allSettled([e.getStatus(),e.getSession(),e.listSessions(I,30,ht),e.getFiles(),e.listModels(),e.listProviders(),e.listPlugins(),e.listPluginPanels(),e.listMarketplace(Ae,Ie,at,24,ze),e.listCommands(),e.listWorkspaces()]),[n,r,a,o,s,c,l,u,d,f,p]=t;Ht(Me([`运行状态`,`当前会话`,`会话列表`,`文件`,`模型`,`提供商`,`插件`,`插件面板`,`插件市场`,`命令`,`工作区`],t)),Bt(!1),i(e=>({status:n.status===`fulfilled`?n.value:e.status,session:r.status===`fulfilled`?r.value:e.session,sessions:a.status===`fulfilled`?a.value.items:e.sessions,files:o.status===`fulfilled`?o.value:e.files,models:s.status===`fulfilled`?s.value:e.models,providers:c.status===`fulfilled`?c.value:e.providers,plugins:l.status===`fulfilled`?l.value:e.plugins,pluginPanels:u.status===`fulfilled`?u.value:e.pluginPanels,marketplace:d.status===`fulfilled`?d.value.items:e.marketplace,marketplaceCapabilities:d.status===`fulfilled`?d.value.capabilities:e.marketplaceCapabilities,marketplaceCategories:d.status===`fulfilled`?d.value.categories:e.marketplaceCategories,marketplaceTotal:d.status===`fulfilled`?d.value.total:e.marketplaceTotal,marketplacePage:d.status===`fulfilled`?d.value.page:e.marketplacePage,marketplaceHasNext:d.status===`fulfilled`?d.value.hasNext:e.marketplaceHasNext,commands:f.status===`fulfilled`?f.value:e.commands,workspaces:p.status===`fulfilled`?p.value:e.workspaces})),a.status===`fulfilled`&&(yt(a.value.total),xt(a.value.hasNext))},[e,ht,Ie,ze,at,Ae,I]),Yt=(0,o.useCallback)(()=>{Mt.current=!0,jt.current===void 0&&(jt.current=window.setTimeout(()=>{jt.current=void 0,Mt.current&&(Mt.current=!1,R())},100))},[R]),Xt=(0,o.useCallback)(e=>{Yt();let t=e.event;if(typeof t!=`object`||!t)return;let n=t;if(n.type===`turn_start`){Dt({thinking:``,text:``});return}if(n.type!==`message_update`||typeof n.assistantMessageEvent!=`object`||n.assistantMessageEvent===null)return;let r=n.assistantMessageEvent,i=r.type;if(i!==`thinking_delta`&&i!==`text_delta`)return;let a=typeof r.delta==`string`?r.delta:``;a&&Dt(e=>({thinking:(e?.thinking??``)+(i===`thinking_delta`?a:``),text:(e?.text??``)+(i===`text_delta`?a:``)}))},[Yt]),Zt=(0,o.useCallback)(async t=>{P(``),pe(``);try{let n=await e.createSession(t?.path);n.sessionFile&&_e(n.sessionFile),d(void 0),h(!1),_(!1),p(void 0),de(!1),he(t?.path),y(``),l(`session`),s(`chat`),C(!1),await R()}catch(e){let n=e instanceof Error?e.message:String(e);t?pe(n):P(n)}},[e,R]),Qt=()=>{P(``),pe(``),he(void 0),de(!0)},z=(0,o.useCallback)(async()=>{try{let t=await e.pickDirectory(),n=t.split(/[\\/]/).filter(Boolean).pop()??t;await Zt({path:t,branch:`directory`,current:!1,name:n})}catch(e){pe(e instanceof Error?e.message:String(e))}},[e,Zt]),$t=(0,o.useCallback)(async()=>{await z()},[z]);(0,o.useEffect)(()=>{R();let t=e.subscribeEvents(Xt),n=window.setInterval(()=>void R(),5e3);return()=>{t(),window.clearInterval(n),jt.current!==void 0&&(window.clearTimeout(jt.current),jt.current=void 0)}},[e,Xt,R]),(0,o.useEffect)(()=>{r.status?.status!==`running`&&Dt(void 0)},[r.status?.status]),(0,o.useEffect)(()=>{let t=ve.current;if(!t||ye.current||r.sessions.length===0)return;ye.current=!0;let n=r.sessions.find(e=>e.path===t);if(!n||typeof n.path!=`string`){_e(void 0);return}r.session?.sessionFile!==n.path&&e.openSession(n.path).then(R).catch(e=>P(e instanceof Error?e.message:String(e)))},[e,r.session?.sessionFile,r.sessions,R]),(0,o.useEffect)(()=>{if(x(0),!m)return;let e=window.requestAnimationFrame(()=>ke.current?.focus());return()=>window.cancelAnimationFrame(e)},[m,v]),(0,o.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(ae){k(void 0);return}if(g){_(!1);return}if(m){h(!1),y(``);return}if(f!==void 0){p(void 0);return}h(!1),C(!1),O(!1),de(!1),d(void 0)}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),h(!1),_(!0)),(e.metaKey||e.ctrlKey)&&e.key===`,`&&(e.preventDefault(),h(!1),_(!1),p(void 0),d(`general`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,f,g,ae]);let en=r.session?.events??[],tn=(0,o.useMemo)(()=>Le(en),[en]);(0,o.useEffect)(()=>{if(!At.current)return;let e=window.requestAnimationFrame(()=>{let e=kt.current;e&&(e.scrollTop=e.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[r.session?.messages.length,r.status?.events,F,ut]);let B=r.sessions.filter(e=>!De||$(e.name??e.firstMessage,`未命名会话`).toLowerCase().includes(De.toLowerCase())),nn=t=>{t.preventDefault();let n=A.trim(),r=xe.length>0?Je(xe,n):n;!r||ut||(be(``),P(``),ft(r),Dt(void 0),At.current=!0,dt(!0),e.prompt(r).then(async()=>{Se([]),await R()}).catch(e=>P(e instanceof Error?e.message:String(e))).finally(()=>ft(``)).finally(()=>dt(!1)))},rn=()=>{window.requestAnimationFrame(()=>{let e=window.getSelection()?.toString().trim()??``;e.length>0&&we(e.slice(0,4e3))})},an=()=>{let e=Ce.trim();e&&(Se(t=>[...t,{id:t.length===0?1:Math.max(...t.map(e=>e.id))+1,quote:e,note:Te.trim()}]),we(``),Ee(``))},on=()=>{let e=Ot.current,t=e?.selectionStart??A.length,n=Pe(A,t),r=t;if(n?.kind!==`command`){let e=`${t>0&&!/\s/.test(A[t-1]??``)?` `:``}/`,n=`${A.slice(0,t)}${e}${A.slice(t)}`;r=t+e.length,be(n)}Pt(r),It(!1),Rt(0),window.requestAnimationFrame(()=>{e?.focus(),e?.setSelectionRange(r,r)})},sn=t=>{let n=typeof t.path==`string`?t.path:``;n&&(d(void 0),h(!1),_(!1),l(`session`),s(`chat`),p(void 0),_e(n),e.openSession(n).then(R).catch(e=>P(e instanceof Error?e.message:String(e))))},cn=async e=>{if(!pt){mt(!0),P(``);try{await e(),await R(),Ct(new Set),C(!1),T(void 0),ee(void 0),O(!1),ne(void 0),se(void 0),ie(!1),k(void 0)}catch(e){P(e instanceof Error?e.message:String(e))}finally{mt(!1)}}},V=r.session?.sessionFile,ln=e=>{Ct(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},un=(e,t,n)=>{if(S&&w===e){dn(),se(void 0);return}O(!1),ne(void 0),Tt.current=n,le(t??``),se({name:t||`未命名会话`,path:e}),T(e),ee(Dc(n,142,190,`beside`)),C(!0)},dn=()=>{C(!1),T(void 0),ee(void 0)},fn=e=>{let t=new URLSearchParams(window.location.search);t.set(`page`,`plugins`),t.delete(`settings`),e?t.set(`plugin`,e):t.delete(`plugin`);let n=t.toString();window.history.pushState(null,``,`${window.location.pathname}${n?`?${n}`:``}${window.location.hash}`),d(void 0),p(void 0),h(!1),_(!1),C(!1),T(void 0),l(`plugins`),nt(e),Ge(void 0)},pn=e=>{let t=new URLSearchParams(window.location.search);t.set(`page`,`marketplace`),t.delete(`settings`),e?t.set(`plugin`,e):t.delete(`plugin`);let n=t.toString();window.history.pushState(null,``,`${window.location.pathname}${n?`?${n}`:``}${window.location.hash}`),d(void 0),p(void 0),h(!1),_(!1),C(!1),T(void 0),l(`marketplace`),nt(void 0),Ge(e)},mn=N===void 0?void 0:r.plugins.find(e=>e.name===N),hn=N===void 0?void 0:r.pluginPanels.find(e=>e.pluginId===N),gn=u?(0,j.jsx)(Hc,{api:e,data:r,tab:u,onTab:d,onRefresh:R,onClose:()=>{d(void 0),l(`session`),s(`chat`),p(void 0)}}):c===`plugins`&&N&&mn?(0,j.jsx)(zc,{metadata:rt,onBack:()=>fn(void 0),onToggle:async t=>{await e.togglePlugin(t.id,!t.enabled),await R()},onUninstall:async t=>{await e.uninstallPlugin(t.id);let n=await e.listPlugins();i(e=>({...e,plugins:n.filter(e=>e.id!==t.id)})),fn(void 0)},panel:hn,plugin:mn}):c===`plugins`&&N?(0,j.jsxs)(`section`,{className:`view-panel min-w-0 overflow-auto bg-[#f8f9fb]`,children:[(0,j.jsxs)(`div`,{className:`subnav plugin-detail-subnav bg-white`,children:[(0,j.jsx)(`a`,{href:`?page=plugins`,onClick:e=>{e.preventDefault(),fn(void 0)},children:`← 已安装插件`}),(0,j.jsx)(`span`,{children:`插件详情`})]}),(0,j.jsx)(`div`,{className:`empty-state`,children:r.status?`没有找到这个已安装插件,它可能已被移除。`:`正在读取插件详情…`})]}):c===`plugins`?(0,j.jsx)(Rc,{plugins:r.plugins,panels:r.pluginPanels,catalog:$e.length?$e:r.marketplace,onMarketplace:()=>pn(void 0),onOpenDetail:e=>fn(e.name),onToml:()=>{p(void 0),d(`toml`)},onToggle:async t=>{await e.togglePlugin(t.id,!t.enabled),await R()},onUninstall:async t=>{await e.uninstallPlugin(t.id);let n=await e.listPlugins();i(e=>({...e,plugins:n.filter(e=>e.id!==t.id)}))}}):c===`marketplace`?Ue&&Ke?.id===Ue?(0,j.jsx)(Vc,{plugin:Ke,installed:qt.has(Ke.packageName),onBack:()=>pn(void 0),onInstall:async t=>{let n=await e.installMarketplace(t.id);return await R(),n}}):Ue?(0,j.jsx)(`section`,{className:`marketplace-page flex min-w-0 flex-1 flex-col`,children:(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,j.jsxs)(`div`,{className:`subnav plugin-detail-subnav`,children:[(0,j.jsx)(`a`,{href:`?page=marketplace`,onClick:e=>{e.preventDefault(),pn(void 0)},children:`← 插件市场`}),(0,j.jsx)(`span`,{children:`插件详情`})]}),(0,j.jsx)(`div`,{className:`empty-state`,children:Ye?`正在读取插件详情…`:Ze||`没有找到这个市场插件,它可能已下架。`})]})}):(0,j.jsx)(Bc,{plugins:r.marketplace,capabilities:r.marketplaceCapabilities,categories:r.marketplaceCategories,total:r.marketplaceTotal,page:r.marketplacePage,hasNext:r.marketplaceHasNext,query:Ae,capabilityFilter:Ie,categoryFilter:ze,onQueryChange:e=>{M(e),ot(0)},onCapabilityChange:e=>{Re(e),ot(0)},onCategoryChange:e=>{Be(e),ot(0)},onOpenDetail:e=>pn(e.id),onPageChange:ot,onBack:()=>fn(void 0),onToml:()=>{p(void 0),d(`toml`)},installedPackages:qt,onInstall:async t=>{let n=await e.installMarketplace(t.id);return await R(),n}}):a===`chat`?(0,j.jsxs)(`section`,{className:`view-panel chat-view`,children:[(0,j.jsxs)(`div`,{className:`chat-scroll ${r.session?.messages.length?``:`is-empty`}`,onScroll:e=>{let t=e.currentTarget;At.current=t.scrollHeight-t.scrollTop-t.clientHeight<120},ref:kt,children:[r.session?.messages.length?We(r.session.messages).map((e,t)=>(0,j.jsx)(`article`,{className:`turn ${e.role===`user`?`user`:`text`}`,children:e.role===`user`?(0,j.jsx)(kc,{text:e.text}):(0,j.jsxs)(j.Fragment,{children:[e.thinking&&(0,j.jsxs)(`details`,{className:`reasoning message-reasoning`,children:[(0,j.jsx)(`summary`,{className:`reasoning-head`,children:`思考`}),(0,j.jsx)(`div`,{className:`reasoning-body`,children:(0,j.jsx)(Ve,{text:e.thinking})})]}),e.text&&(0,j.jsx)(Ve,{onMouseUp:rn,text:e.text})]})},t)):(0,j.jsx)(Sc,{status:r.status,workspaces:r.workspaces,onCreate:e=>void Zt(e),onStarter:be,onToml:()=>{p(void 0),d(`toml`)}}),Et&&r.status?.status===`running`&&(0,j.jsxs)(`article`,{className:`turn text streaming-turn`,"aria-live":`polite`,children:[Et.thinking&&(0,j.jsxs)(`details`,{className:`reasoning message-reasoning`,children:[(0,j.jsx)(`summary`,{className:`reasoning-head`,children:`思考中…`}),(0,j.jsx)(`div`,{className:`reasoning-body`,children:(0,j.jsx)(Ve,{text:Et.thinking})})]}),!Et.thinking&&!Et.text&&(0,j.jsx)(`div`,{className:`streaming-placeholder`,children:`正在生成…`}),Et.text&&(0,j.jsx)(Ve,{onMouseUp:rn,text:Et.text})]}),F&&!r.session?.messages.some(e=>e.role===`user`&&He(e)===F)&&(0,j.jsx)(`article`,{className:`turn user pending-turn`,children:(0,j.jsx)(kc,{text:F})})]}),(0,j.jsxs)(`div`,{className:`composer-wrap`,children:[(0,j.jsx)(`div`,{className:`context-shell`,children:(0,j.jsxs)(`div`,{className:`context-line`,children:[(0,j.jsx)(`span`,{className:`context-label`,children:`实时上下文`}),(0,j.jsxs)(`div`,{className:`context-metrics`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`b`,{children:r.status?.messages??0}),` 条消息`]}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`b`,{children:r.status?.events??en.length}),` 个事件`]}),(0,j.jsx)(`span`,{children:(0,j.jsx)(`b`,{children:$(r.status?.model)})})]})]})}),(0,j.jsxs)(`div`,{className:`composer-stack`,children:[lt&&(0,j.jsx)(Oc,{message:lt}),Ce?(0,j.jsxs)(`div`,{"aria-label":`添加批注`,className:`rounded-lg border border-[#cdddf8] bg-[#f6f8ff] px-3 py-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,j.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded bg-[#dce9ff] px-1.5 py-0.5 text-[10px] text-[#315fb8]`,children:`选中片段`}),(0,j.jsx)(`p`,{className:`max-h-16 flex-1 overflow-auto whitespace-pre-wrap text-[11px] text-[#30343b]`,children:Ce}),(0,j.jsx)(`button`,{"aria-label":`取消批注`,className:`text-[12px] text-[#687381]`,onClick:()=>we(``),type:`button`,children:`×`})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,j.jsx)(`input`,{"aria-label":`批注备注`,className:`min-w-0 flex-1 rounded-md border border-[#dce5f5] bg-white px-2 py-1.5 text-[11px] outline-none`,onChange:e=>Ee(e.target.value),placeholder:`备注(可选)`,value:Te}),(0,j.jsx)(`button`,{className:`rounded-md bg-[#3565c5] px-3 py-1.5 text-[11px] font-medium text-white`,onClick:an,type:`button`,children:`加入批注`})]})]}):null,xe.length>0?(0,j.jsxs)(`div`,{className:`flex items-center gap-2 overflow-x-auto text-[10px]`,children:[(0,j.jsxs)(`span`,{className:`shrink-0 rounded-md bg-[#edf3fe] px-2 py-1 font-medium text-[#315fb8]`,children:[`批注 ×`,xe.length]}),xe.map(e=>(0,j.jsxs)(`button`,{className:`max-w-48 shrink-0 truncate rounded-md border border-[#dce5f5] bg-white px-2 py-1 text-left text-[#65707b]`,onClick:()=>Se(t=>t.filter(t=>t.id!==e.id)),title:`点击移除批注`,type:`button`,children:[`#`,e.id,` `,e.quote]},e.id)),(0,j.jsx)(`button`,{className:`shrink-0 text-[#687381]`,onClick:()=>Se([]),type:`button`,children:`清空`})]}):null,(0,j.jsxs)(`form`,{className:`composer`,onSubmit:nn,children:[(0,j.jsx)(`textarea`,{"aria-activedescendant":Gt?`prompt-completion-option-${Kt}`:void 0,"aria-autocomplete":`list`,"aria-controls":Gt?`prompt-completion-list`:void 0,"aria-expanded":Gt,"aria-haspopup":`listbox`,"aria-label":`Prompt`,onChange:e=>{be(e.target.value),Pt(e.currentTarget.selectionStart??e.target.value.length),It(!1),e.currentTarget.style.height=`auto`,e.currentTarget.style.height=`${Math.min(e.currentTarget.scrollHeight,180)}px`},onKeyDown:e=>{let t=e.currentTarget.selectionStart??A.length,n=Pe(e.currentTarget.value,t),i=n?n.kind===`command`?Uc(r.commands,n.query).slice(0,12):r.files.filter(e=>`${e.path} ${e.label} ${e.status}`.toLowerCase().includes(n.query.trim().toLowerCase())).slice(0,12):[],a=!!(n&&!Ft&&i.length);if(a&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),Rt(t=>(t+(e.key===`ArrowDown`?1:-1)+i.length)%i.length);return}if(a&&(e.key===`Enter`||e.key===`Tab`)){e.preventDefault();let t=i[Math.min(Lt,i.length-1)];if(t&&n){let r=n.kind===`command`?`/${t.invocationName}`:`@${t.path}`,i=Fe(e.currentTarget.value,n,`${r} `);be(i.text),Pt(i.caret),It(!1),requestAnimationFrame(()=>{let e=Ot.current;e?.focus(),e?.setSelectionRange(i.caret,i.caret)})}return}if(e.key===`Escape`&&n&&!Ft){e.preventDefault(),It(!0);return}(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},onClick:()=>{Jt||de(!0)},onFocus:e=>{Jt||(e.currentTarget.blur(),de(!0))},placeholder:Jt?`描述要做的改动,⌘↵ 发送;@ 引用文件,/ 调用命令`:`先选择工作区,再描述要做的改动`,readOnly:!Jt,ref:Ot,rows:2,"data-prompt-completion":!0,value:A}),Gt&&Ut&&(0,j.jsx)(Gc,{activeIndex:Kt,commands:r.commands,files:r.files,kind:Ut.kind,onActiveIndexChange:Rt,onUse:e=>{let t=Fe(A,Ut,`${e} `);be(t.text),Pt(t.caret),It(!1),requestAnimationFrame(()=>{let e=Ot.current;e?.focus(),e?.setSelectionRange(t.caret,t.caret)})},query:Ut.query}),(0,j.jsxs)(`div`,{className:`composer-tools`,children:[(0,j.jsx)(`select`,{"aria-label":`模型`,disabled:!r.models.length||ut,value:r.status?.model??``,onChange:t=>{let[n,...r]=t.target.value.split(`/`),i=r.join(`/`);!n||!i||(P(``),e.selectModel(n,i).then(R).catch(e=>P(e instanceof Error?e.message:String(e))))},children:r.models.length?r.models.map(e=>(0,j.jsx)(`option`,{value:`${e.provider}/${e.id}`,children:e.name===e.id?`${e.provider}/${e.id}`:`${e.name} (${e.provider})`},`${e.provider}/${e.id}`)):(0,j.jsx)(`option`,{value:``,children:`暂无可用模型`})}),(0,j.jsxs)(`button`,{className:`tool-chip`,onClick:()=>ct(e=>!e),type:`button`,children:[`● `,st?`改动前询问`:`自动允许`]}),(0,j.jsx)(`button`,{className:`tool-chip`,onClick:on,type:`button`,children:`/ 命令`}),(0,j.jsx)(`span`,{className:`composer-hint`,children:`⌘↵ 发送 · ⌘K 命令 · ⌃C 中断`}),(0,j.jsx)(`button`,{"aria-label":ut?`发送中`:`发送消息`,className:`send-button`,disabled:ut||!A.trim(),title:ut?`正在发送`:`发送消息(⌘↵)`,type:`submit`,children:ut?`…`:`↑`})]})]})]})]})]}):a===`trajectory`?(0,j.jsx)(jc,{events:tn,onSelect:p}):(0,j.jsx)(Mc,{api:e,files:r.files,onDiff:async t=>{let n=await e.getFileDiff(t);p({type:`file_diff`,path:n.path,output:n.diff||`没有可显示的差异(工作区可能已更新)。`})},onRefresh:()=>void R()}),_n=xc(B),vn=!!(r.session&&!De&&!B.some(e=>e.sessionId===r.session?.sessionId)),yn=Uc(r.commands,v),bn=r.pluginPanels.find(e=>e.id===`better-sidebar-panel`),xn=bn?.data!==null&&typeof bn?.data==`object`&&!Array.isArray(bn?.data)?bn.data:void 0,Sn=r.pluginPanels.find(e=>e.id===`theme-studio-panel`),Cn=Sn?.data!==null&&typeof Sn?.data==`object`&&!Array.isArray(Sn?.data)?Sn.data:void 0,wn=(0,o.useMemo)(()=>{if(!Cn?.tokens||typeof Cn.tokens!=`object`||Array.isArray(Cn.tokens))return;let e=Object.entries(Cn.tokens).filter(([e,t])=>e.startsWith(`--`)&&typeof t==`string`);return e.length?Object.fromEntries(e):void 0},[Cn]),Tn=typeof Cn?.theme==`string`?Cn.theme:void 0,En=e=>{be(e),h(!1),y(``)};return(0,j.jsxs)(`div`,{className:`app-frame`,"data-theme":Tn,style:wn,children:[(0,j.jsxs)(`aside`,{className:`sidebar`,children:[(0,j.jsxs)(`header`,{className:`brand-row`,children:[(0,j.jsx)(`span`,{className:`pi-mark`,"aria-hidden":`true`,children:(0,j.jsx)(`img`,{src:`/icons/svg/mark-white.svg`,alt:``})}),(0,j.jsx)(`strong`,{children:`pi harness`}),t?(0,j.jsx)(`span`,{className:`version`,children:t}):null]}),(0,j.jsxs)(`div`,{className:`sidebar-actions`,children:[(0,j.jsx)(`button`,{className:`new-session`,onClick:Qt,type:`button`,"aria-expanded":ue,children:`+ 新建会话`}),(0,j.jsxs)(`div`,{className:`session-search`,"data-command-palette":!0,children:[(0,j.jsx)(`input`,{"aria-controls":m?`command-menu`:void 0,"aria-expanded":m,"aria-label":m?`搜索命令`:`搜索会话`,onChange:e=>{let t=e.target.value;if(!m&&t.startsWith(`/`)){h(!0),y(t.slice(1));return}m?y(t.replace(/^\/\s?/,``)):Oe(t)},onKeyDown:e=>{m&&(e.key===`ArrowDown`&&yn.length?(e.preventDefault(),x(e=>(e+1)%yn.length)):e.key===`ArrowUp`&&yn.length?(e.preventDefault(),x(e=>(e-1+yn.length)%yn.length)):e.key===`Enter`&&yn.length&&(e.preventDefault(),En(`/${yn[b]?.invocationName??``}`)))},placeholder:m?`输入命令名称或描述`:`搜索会话 · ⌘K 命令`,ref:ke,type:`search`,value:m?`/${v}`:De}),m&&(0,j.jsx)(Wc,{activeIndex:b,commands:r.commands,onActiveIndexChange:x,onUse:En,query:v})]}),(0,j.jsx)(`input`,{accept:`.jsonl,application/json,application/x-ndjson`,"aria-label":`导入会话文件`,hidden:!0,onChange:t=>{let n=t.currentTarget.files?.[0];t.currentTarget.value=``,n&&cn(async()=>{let t=await e.importSession(await n.text(),n.name);t.sessionFile&&_e(t.sessionFile)})},ref:wt,type:`file`})]}),(0,j.jsxs)(`div`,{className:`session-list-toolbar`,children:[(0,j.jsxs)(`div`,{className:`session-list-title`,children:[(0,j.jsx)(`strong`,{children:`会话`}),(0,j.jsx)(`span`,{children:vt||r.sessions.length})]}),(0,j.jsxs)(`div`,{className:`session-list-tools`,children:[(0,j.jsx)(`button`,{"aria-pressed":re,className:`session-tool-button ${re?`active`:``}`,onClick:()=>{ie(!re),Ct(new Set),O(!1),dn()},type:`button`,children:re?`完成`:`选择`}),(0,j.jsxs)(`div`,{className:`session-tools-wrap`,"data-session-popover":!0,children:[(0,j.jsx)(`button`,{"aria-expanded":D,"aria-haspopup":`menu`,"aria-label":`会话工具`,className:`session-tool-button icon`,onClick:e=>{dn(),Tt.current=e.currentTarget,se(void 0),D?(O(!1),ne(void 0)):(ne(Dc(e.currentTarget,150,190,`below`)),O(!0))},type:`button`,children:`⋯`}),D&&te&&(0,je.createPortal)((0,j.jsxs)(`div`,{className:`session-tools-popover`,"data-session-popover":!0,role:`menu`,style:te,children:[(0,j.jsx)(`button`,{autoFocus:!0,onClick:()=>window.location.reload(),role:`menuitem`,type:`button`,children:`刷新列表`}),(0,j.jsx)(`button`,{onClick:()=>{O(!1),ne(void 0),wt.current?.click()},role:`menuitem`,type:`button`,children:`导入会话`}),(0,j.jsx)(`button`,{disabled:!V||pt,onClick:()=>{V&&cn(async()=>{let t=await e.exportSession(V),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`${r.session?.sessionId??`session`}.jsonl`,n.click(),URL.revokeObjectURL(n.href)})},role:`menuitem`,type:`button`,children:`导出当前会话`}),(0,j.jsx)(`button`,{onClick:()=>{gt(e=>!e),O(!1),ne(void 0),R()},role:`menuitem`,type:`button`,children:ht?`隐藏归档会话`:`显示归档会话`})]}),document.body)]})]})]}),re&&St.size>0&&(0,j.jsxs)(`div`,{className:`session-batch-bar`,children:[(0,j.jsxs)(`span`,{children:[St.size,` 个已选择`]}),(0,j.jsx)(`button`,{onClick:()=>void cn(()=>e.batchSessions(`archive`,[...St]).then(()=>void 0)),type:`button`,children:`归档`}),(0,j.jsx)(`button`,{onClick:()=>void cn(()=>e.batchSessions(`pin`,[...St]).then(()=>void 0)),type:`button`,children:`置顶`}),(0,j.jsx)(`button`,{className:`danger`,onClick:()=>{se(void 0),k(`batch-delete`)},type:`button`,children:`删除`})]}),(0,j.jsxs)(`div`,{className:`sidebar-scroll`,children:[vn&&r.session&&(0,j.jsxs)(`div`,{className:`session-group`,children:[(0,j.jsx)(`div`,{className:`group-label`,children:`当前`}),(0,j.jsxs)(`div`,{className:`session-row-wrap current-session-row`,children:[re&&(0,j.jsx)(`input`,{"aria-label":`选择当前会话`,checked:V?St.has(V):!1,onChange:()=>V&&ln(V),type:`checkbox`}),(0,j.jsxs)(`button`,{className:`session-row active`,onClick:()=>{d(void 0),h(!1),_(!1),l(`session`),s(`chat`),p(void 0),C(!1),R()},type:`button`,children:[(0,j.jsx)(`span`,{className:`session-dot ok`}),(0,j.jsxs)(`span`,{className:`session-copy`,children:[(0,j.jsx)(`strong`,{children:r.session.messages.length?r.session.sessionId.slice(0,12):`新会话`}),(0,j.jsxs)(`small`,{children:[r.session.messages.length,` 条消息`]})]})]}),!re&&V&&(0,j.jsx)(`button`,{"aria-expanded":S&&w===V,"aria-haspopup":`menu`,"aria-label":`当前会话操作`,className:`session-row-more`,"data-session-popover":!0,onClick:e=>un(V,r.session?.messages.length?r.session?.sessionId.slice(0,12):`新会话`,e.currentTarget),type:`button`,children:`⋯`}),!re&&V&&w===V&&S&&E&&(0,j.jsx)(Ec,{busy:pt,position:E,onArchive:()=>{dn(),k(`archive`)},onDelete:()=>{dn(),k(`delete`)},onFork:()=>void cn(async()=>{let t=await e.forkSession(V);t.sessionFile&&(_e(t.sessionFile),await e.openSession(t.sessionFile))}),onRename:()=>{dn(),k(`rename`)}})]})]}),_n.length?_n.map(([t,n])=>(0,j.jsxs)(`div`,{className:`session-group`,children:[(0,j.jsx)(`div`,{className:`group-label`,children:t}),n.map((t,n)=>(0,j.jsxs)(`div`,{className:`session-row-wrap`,children:[re&&(0,j.jsx)(`input`,{"aria-label":`选择会话 ${$(t.name??t.firstMessage,`未命名会话`)}`,checked:typeof t.path==`string`&&St.has(t.path),onChange:()=>{typeof t.path==`string`&&ln(t.path)},type:`checkbox`}),(0,j.jsxs)(`button`,{className:`session-row ${t.sessionId===r.session?.sessionId?`active`:``}`,onClick:()=>sn(t),type:`button`,children:[(0,j.jsx)(`span`,{className:`session-dot ok`}),(0,j.jsxs)(`span`,{className:`session-copy`,children:[(0,j.jsx)(`strong`,{children:$(t.name??t.firstMessage,`未命名会话`)}),(0,j.jsxs)(`small`,{children:[$(t.messageCount,`0`),` 条消息`,t.pinned===!0?` · 已置顶`:``,t.archived===!0?` · 已归档`:``]})]})]}),!re&&typeof t.path==`string`&&(0,j.jsx)(`button`,{"aria-expanded":S&&w===t.path,"aria-haspopup":`menu`,"aria-label":`会话操作 ${$(t.name??t.firstMessage,`未命名会话`)}`,className:`session-row-more`,"data-session-popover":!0,onClick:e=>{e.stopPropagation(),un(t.path,$(t.name??t.firstMessage,``),e.currentTarget)},type:`button`,children:`⋯`}),!re&&typeof t.path==`string`&&w===t.path&&S&&E&&(0,j.jsx)(Ec,{busy:pt,position:E,onArchive:()=>{dn(),k(`archive`)},onDelete:()=>{dn(),k(`delete`)},onFork:()=>void cn(async()=>{let n=await e.forkSession(t.path);n.sessionFile&&(_e(n.sessionFile),await e.openSession(n.sessionFile))}),onRename:()=>{dn(),k(`rename`)}})]},n))]},t)):vn?null:(0,j.jsx)(`div`,{className:`empty-state`,children:`暂无已保存会话`}),vt>30&&(0,j.jsxs)(`div`,{className:`session-pagination`,children:[(0,j.jsx)(`button`,{disabled:I===0,onClick:()=>_t(e=>Math.max(0,e-1)),type:`button`,children:`上一页`}),(0,j.jsxs)(`span`,{children:[I+1,` / `,Math.max(1,Math.ceil(vt/30))]}),(0,j.jsx)(`button`,{disabled:!bt,onClick:()=>_t(e=>e+1),type:`button`,children:`下一页`})]}),xn&&(0,j.jsxs)(`section`,{"aria-label":`工作区概览`,className:`mx-3 mt-3 rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,j.jsx)(`strong`,{className:`text-[11px] font-semibold text-[#253044]`,children:`工作区概览`}),(0,j.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[9px] ${xn.clean===!0?`bg-[#eaf8f0] text-[#14733f]`:`bg-[#fff0f0] text-[#b42318]`}`,children:xn.clean===!0?`clean`:`${$(xn.changedCount??0)} 变更`})]}),(0,j.jsx)(`code`,{className:`mt-2 block truncate text-[10px] text-[#315fb8]`,children:$(xn.cwd??`当前工作区`)}),(0,j.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-[#65707b]`,children:$(xn.branch??`非 Git 工作区`)}),Array.isArray(xn.changedFiles)&&xn.changedFiles.length>0?(0,j.jsx)(`div`,{className:`mt-2 grid gap-1 border-t border-[#dce5f5] pt-2`,children:xn.changedFiles.slice(0,3).map((e,t)=>{let n=typeof e==`object`&&e?e:{};return(0,j.jsxs)(`code`,{className:`truncate text-[9px] text-[#65707b]`,children:[$(n.status??`??`),` `,$(n.path??`未命名`)]},`${$(n.path??`file`)}-${t}`)})}):null]})]}),(0,j.jsxs)(`footer`,{className:`sidebar-footer`,children:[(0,j.jsxs)(`div`,{className:`runtime-cells`,children:[(0,j.jsxs)(`span`,{children:[`model `,(0,j.jsx)(`b`,{children:$(r.status?.model)})]}),(0,j.jsxs)(`span`,{children:[`msgs `,(0,j.jsx)(`b`,{children:r.status?.messages??0})]}),(0,j.jsxs)(`span`,{children:[`status `,(0,j.jsx)(`b`,{children:$(r.status?.status,`connecting`)})]})]}),(0,j.jsx)(`button`,{"aria-label":`搜索会话、文件和命令`,className:`sidebar-link compact-session-search`,onClick:()=>{h(!1),O(!1),dn(),_(!0)},title:`搜索会话、文件和命令`,type:`button`,children:`⌕`}),(0,j.jsx)(`button`,{"aria-label":`新建会话`,className:`sidebar-link compact-new-session`,onClick:Qt,title:`新建会话`,type:`button`,children:`+`}),(0,j.jsxs)(`button`,{"aria-label":`插件,已安装 ${L} 个`,className:`sidebar-link ${c===`plugins`||c===`marketplace`?`active`:``}`,onClick:()=>fn(void 0),title:`插件 · ${L} 个`,type:`button`,children:[`◈ `,(0,j.jsx)(`span`,{children:`插件`}),(0,j.jsx)(`b`,{children:L})]}),(0,j.jsxs)(`button`,{"aria-label":`设置`,className:`sidebar-link ${u?`active`:``}`,onClick:()=>{h(!1),_(!1),C(!1),T(void 0),p(void 0),d(`general`)},title:`设置`,type:`button`,children:[`⚙ `,(0,j.jsx)(`span`,{children:`设置`})]})]})]}),(0,j.jsxs)(`section`,{className:`main-pane`,children:[(0,j.jsxs)(`header`,{className:`main-header ${!u&&c===`session`?`session-track`:``}`,children:[(0,j.jsxs)(`div`,{className:`active-heading`,children:[(0,j.jsx)(`strong`,{children:u?`设置`:c===`plugins`?N?`插件详情`:`运行时插件`:c===`marketplace`?Ue?`插件详情`:`插件市场`:r.session?.messages.length?r.session.sessionId.slice(0,12):`新会话`}),(0,j.jsx)(`small`,{children:u?`运行时状态与配置`:c===`plugins`?N?rt?.name??yc(N):`已安装插件`:c===`marketplace`?Ue?Ke?.name??Ue:`官方与社区 · 已审核目录`:gc(r.status,r.session)})]}),(0,j.jsx)(`div`,{className:`header-spacer`}),r.status?.status===`running`&&(0,j.jsxs)(`div`,{className:`run-indicator running`,children:[(0,j.jsx)(`span`,{className:`run-dot`}),(0,j.jsx)(`span`,{children:`运行中 · Pi agent`}),(0,j.jsx)(`button`,{className:`stop-button`,onClick:()=>{P(``),e.abort().then(R).catch(e=>P(e instanceof Error?e.message:String(e)))},type:`button`,children:`停止`})]}),!u&&c===`session`&&(0,j.jsx)(`div`,{"aria-label":`会话视图`,className:`view-tabs`,children:[`chat`,`trajectory`,`files`].map(e=>(0,j.jsx)(`button`,{"aria-pressed":a===e,className:`view-tab ${a===e?`active`:``}`,onClick:()=>{s(e),p(void 0)},type:`button`,children:e===`chat`?`对话`:e===`trajectory`?`轨迹`:`产出`},e))}),!u&&c===`session`&&(0,j.jsx)(`span`,{"aria-hidden":`true`,className:`header-divider`}),!u&&c===`session`&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`session-menu-wrap`,"data-session-popover":!0,children:[(0,j.jsx)(`button`,{"aria-expanded":S&&!w,"aria-haspopup":`menu`,className:`session-menu`,onClick:e=>{let t=S&&!w;T(void 0),ee(void 0),Tt.current=e.currentTarget,se(!t&&V?{name:r.session?.sessionId?.slice(0,12)||`当前会话`,path:V}:void 0),C(!t)},type:`button`,"aria-label":`会话操作`,children:`⋯`}),S&&!w&&(0,j.jsxs)(`div`,{className:`session-menu-popover compact-session-menu`,role:`menu`,children:[(0,j.jsxs)(`button`,{className:`session-action`,disabled:!V||pt,onClick:()=>{le(r.session?.sessionId?.slice(0,12)??``),k(`rename`),C(!1)},role:`menuitem`,type:`button`,children:[(0,j.jsx)(`strong`,{children:`重命名`}),(0,j.jsx)(`small`,{children:`设置一个容易识别的名称`})]}),(0,j.jsxs)(`button`,{className:`session-action`,disabled:!V||pt,onClick:()=>void cn(async()=>{let t=await e.forkSession(V);t.sessionFile&&(_e(t.sessionFile),await e.openSession(t.sessionFile))}),role:`menuitem`,type:`button`,children:[(0,j.jsx)(`strong`,{children:`复制会话`}),(0,j.jsx)(`small`,{children:`复制上下文并打开副本`})]}),(0,j.jsxs)(`button`,{className:`session-action`,disabled:!V||pt,onClick:()=>{C(!1),k(`archive`)},role:`menuitem`,type:`button`,children:[(0,j.jsx)(`strong`,{children:`归档会话`}),(0,j.jsx)(`small`,{children:`从默认列表隐藏`})]}),(0,j.jsxs)(`button`,{className:`session-action danger`,disabled:!V||pt,onClick:()=>{C(!1),k(`delete`)},role:`menuitem`,type:`button`,children:[(0,j.jsx)(`strong`,{children:`删除会话`}),(0,j.jsx)(`small`,{children:`永久删除本地记录`})]})]})]}),(0,j.jsxs)(`button`,{"aria-label":f===void 0?`打开详情`:`关闭详情`,"aria-pressed":f!==void 0,className:`details-toggle`,onClick:()=>p(f?void 0:{}),type:`button`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`◨`}),` `,(0,j.jsx)(`span`,{className:`details-toggle-label`,children:`详情`})]})]})]}),Vt.length>0&&(0,j.jsxs)(`div`,{"aria-live":`polite`,className:`refresh-warning`,role:`status`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`部分数据刷新失败`}),Vt.join(`、`),`可能为空或显示上次结果。`]}),(0,j.jsx)(`button`,{onClick:()=>void R(),type:`button`,children:`重试`})]}),(0,j.jsx)(`div`,{className:`view-host`,children:zt?(0,j.jsxs)(`div`,{"aria-live":`polite`,className:`initial-loading`,role:`status`,children:[(0,j.jsx)(`span`,{"aria-hidden":`true`}),`正在连接 Pi runtime…`]}):gn})]}),!u&&c===`session`&&f!==void 0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{"aria-label":`关闭详情`,className:`details-backdrop`,onClick:()=>p(void 0),type:`button`}),(0,j.jsx)(Ac,{event:Object.keys(f).length?f:void 0,onClose:()=>p(void 0),onCopy:()=>void navigator.clipboard?.writeText(JSON.stringify(f,null,2))})]}),g&&(0,j.jsx)(Kc,{commands:r.commands,files:r.files,onClose:()=>_(!1),onOpenFile:e=>{l(`session`),s(`files`),p({type:`file`,path:e.path,status:e.status})},onOpenSession:sn,onUse:be,sessions:r.sessions}),ue&&(0,j.jsx)(Cc,{error:fe,onClose:()=>de(!1),onPickDirectory:$t,onSelect:e=>void Zt(e),workspaces:r.workspaces}),ae&&(0,j.jsx)(wc,{busy:pt,count:ae===`batch-delete`?St.size:void 0,kind:ae,name:ae===`rename`||ae===`batch-delete`?void 0:oe?.name??$(r.session?.sessionId,`当前会话`),onChange:le,onClose:()=>{k(void 0),se(void 0)},onConfirm:()=>{let t=oe?.path??V;ae===`rename`&&t?cn(()=>e.renameSession(t,ce.trim()).then(()=>void 0)):ae===`archive`&&t?cn(async()=>{await e.setSessionMetadata(t,{archived:!0})}):ae===`delete`&&t?cn(async()=>{await e.deleteSession(t)}):ae===`batch-delete`&&cn(()=>e.batchSessions(`delete`,[...St]).then(()=>void 0))},value:ce})]})}var Jc=class{context;root;version;#e;constructor(e,t={}){this.root=e,this.version=t.version,this.context=new Ae}run(){this.context.provide(`clientRoot`,this.root),this.context.provide(`clientApi`,Ne()),this.#e=(0,s.createRoot)(this.root),this.#e.render((0,o.createElement)(qc,{api:this.context.clientApi,appVersion:this.version}))}async dispose(){this.#e?.unmount(),await this.context.fiber.dispose()}},Yc=document.getElementById(`root`);if(!(Yc instanceof HTMLElement))throw Error(`Pi Harness web app is missing #root`);var Xc=new Jc(Yc,{version:`0.1.15`});try{Xc.run()}catch(e){Yc.textContent=e instanceof Error?e.message:String(e)}
|