@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.
Files changed (1245) hide show
  1. package/README.md +682 -4
  2. package/apps/web/dist/assets/index-BVI_IS-R.css +2 -0
  3. package/apps/web/dist/assets/index-BZQRoR8H.js +22 -0
  4. package/apps/web/dist/index.html +2 -2
  5. package/apps/web/package.json +6 -6
  6. package/node_modules/@pi-harness/api-gateway/dist/index.d.ts.map +1 -1
  7. package/node_modules/@pi-harness/api-gateway/dist/index.js +97 -9
  8. package/node_modules/@pi-harness/api-gateway/dist/index.js.map +1 -1
  9. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/agent-teams.json +6 -6
  10. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/anchored-standard.json +1 -1
  11. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/annotation.json +1 -2
  12. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/archify.json +1 -1
  13. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/at-file.json +11 -5
  14. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/auto-mode.json +1 -1
  15. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/better-sidebar.json +1 -1
  16. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-fetch.json +12 -5
  17. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/browser-session.json +14 -8
  18. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/canvas-draw.json +3 -4
  19. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/change-verifier.json +1 -1
  20. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cleaner.json +11 -6
  21. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cli-notifier.json +5 -5
  22. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
  23. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/colleague-skill.json +1 -2
  24. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context-doctor.json +12 -7
  25. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/context.json +10 -5
  26. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-group.json +2 -2
  27. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +4 -4
  28. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cordis-timer.json +3 -3
  29. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/cost-meter.json +9 -6
  30. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/dependency-checker.json +13 -10
  31. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +10 -5
  32. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/fail-logger.json +11 -6
  33. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/genui.json +7 -5
  34. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +13 -8
  35. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/graph-memory.json +13 -7
  36. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/history-compressor.json +1 -1
  37. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/hol-guard.json +1 -1
  38. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/i18n-pair.json +9 -6
  39. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/image-compressor.json +1 -1
  40. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/llm-verifier.json +1 -1
  41. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-client.json +12 -7
  42. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mcp-panel.json +1 -1
  43. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/memory.json +1 -1
  44. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +1 -1
  45. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/mock-server.json +1 -1
  46. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/modlens.json +4 -4
  47. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/module-search.json +1 -1
  48. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +1 -1
  49. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/openpets.json +9 -5
  50. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plan-execute.json +1 -1
  51. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-check.json +1 -1
  52. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-dev.json +8 -6
  53. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-finder.json +1 -1
  54. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-radar.json +1 -1
  55. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/plugin-stars.json +15 -7
  56. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-guard.json +1 -1
  57. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/prompt-library.json +1 -1
  58. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/readme-gen.json +12 -8
  59. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/recall-unread.json +11 -6
  60. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reverse-skill.json +1 -1
  61. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +1 -1
  62. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +1 -1
  63. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/secure-audit.json +1 -1
  64. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +1 -1
  65. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-bridge.json +13 -8
  66. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-compare.json +1 -1
  67. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-export.json +1 -1
  68. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-insights.json +12 -6
  69. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/session-search.json +1 -1
  70. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-catalog.json +1 -1
  71. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/skill-guard.json +9 -5
  72. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/sql-lens.json +13 -7
  73. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/synapse.json +1 -1
  74. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/tab-manager.json +1 -1
  75. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/taskboard.json +1 -1
  76. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +1 -1
  77. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/test-harness.json +14 -7
  78. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/theme-studio.json +1 -1
  79. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/token-guard.json +12 -6
  80. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/turn-rewind.json +11 -6
  81. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +1 -1
  82. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +8 -5
  83. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/web-research.json +1 -1
  84. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +1 -1
  85. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/workspace-search.json +1 -1
  86. package/node_modules/@pi-harness/api-gateway/dist/marketplace-entries/official/yaml-validator.json +8 -5
  87. package/node_modules/@pi-harness/api-gateway/package.json +1 -1
  88. package/node_modules/@pi-harness/cli/dist/node-stdio.d.ts.map +1 -1
  89. package/node_modules/@pi-harness/cli/dist/node-stdio.js +83 -20
  90. package/node_modules/@pi-harness/cli/dist/node-stdio.js.map +1 -1
  91. package/node_modules/@pi-harness/cli/package.json +1 -1
  92. package/node_modules/@pi-harness/host-webserver/package.json +1 -1
  93. package/node_modules/@pi-harness/web-app/package.json +1 -1
  94. package/package.json +16 -9
  95. package/packages/api-gateway/dist/index.d.ts.map +1 -1
  96. package/packages/api-gateway/dist/index.js +97 -9
  97. package/packages/api-gateway/dist/index.js.map +1 -1
  98. package/packages/api-gateway/dist/marketplace-entries/official/agent-teams.json +6 -6
  99. package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +1 -1
  100. package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +1 -2
  101. package/packages/api-gateway/dist/marketplace-entries/official/archify.json +1 -1
  102. package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +11 -5
  103. package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +1 -1
  104. package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +1 -1
  105. package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +12 -5
  106. package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +14 -8
  107. package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +3 -4
  108. package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +1 -1
  109. package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +11 -6
  110. package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +5 -5
  111. package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
  112. package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +1 -2
  113. package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +12 -7
  114. package/packages/api-gateway/dist/marketplace-entries/official/context.json +10 -5
  115. package/packages/api-gateway/dist/marketplace-entries/official/cordis-group.json +2 -2
  116. package/packages/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +4 -4
  117. package/packages/api-gateway/dist/marketplace-entries/official/cordis-timer.json +3 -3
  118. package/packages/api-gateway/dist/marketplace-entries/official/cost-meter.json +9 -6
  119. package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +13 -10
  120. package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +10 -5
  121. package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +11 -6
  122. package/packages/api-gateway/dist/marketplace-entries/official/genui.json +7 -5
  123. package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +13 -8
  124. package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +13 -7
  125. package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +1 -1
  126. package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +1 -1
  127. package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +9 -6
  128. package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +1 -1
  129. package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +1 -1
  130. package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +12 -7
  131. package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +1 -1
  132. package/packages/api-gateway/dist/marketplace-entries/official/memory.json +1 -1
  133. package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +1 -1
  134. package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +1 -1
  135. package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +4 -4
  136. package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +1 -1
  137. package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +1 -1
  138. package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +9 -5
  139. package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +1 -1
  140. package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +1 -1
  141. package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +8 -6
  142. package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +1 -1
  143. package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +1 -1
  144. package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +15 -7
  145. package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +1 -1
  146. package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +1 -1
  147. package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +12 -8
  148. package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +11 -6
  149. package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +1 -1
  150. package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +1 -1
  151. package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +1 -1
  152. package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +1 -1
  153. package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +1 -1
  154. package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +13 -8
  155. package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +1 -1
  156. package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +1 -1
  157. package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +12 -6
  158. package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +1 -1
  159. package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +1 -1
  160. package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +9 -5
  161. package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +13 -7
  162. package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +1 -1
  163. package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +1 -1
  164. package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +1 -1
  165. package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +1 -1
  166. package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +14 -7
  167. package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +1 -1
  168. package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +12 -6
  169. package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +11 -6
  170. package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +1 -1
  171. package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +8 -5
  172. package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +1 -1
  173. package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +1 -1
  174. package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +1 -1
  175. package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +8 -5
  176. package/packages/api-gateway/package.json +1 -1
  177. package/packages/api-gateway/src/index.ts +90 -9
  178. package/packages/api-gateway/src/marketplace-entries/official/agent-teams.json +6 -6
  179. package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +1 -1
  180. package/packages/api-gateway/src/marketplace-entries/official/annotation.json +1 -2
  181. package/packages/api-gateway/src/marketplace-entries/official/archify.json +1 -1
  182. package/packages/api-gateway/src/marketplace-entries/official/at-file.json +11 -5
  183. package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +1 -1
  184. package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +1 -1
  185. package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +12 -5
  186. package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +14 -8
  187. package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +3 -4
  188. package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +1 -1
  189. package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +11 -6
  190. package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +5 -5
  191. package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +5 -5
  192. package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +1 -2
  193. package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +12 -7
  194. package/packages/api-gateway/src/marketplace-entries/official/context.json +10 -5
  195. package/packages/api-gateway/src/marketplace-entries/official/cordis-group.json +2 -2
  196. package/packages/api-gateway/src/marketplace-entries/official/cordis-logger-console.json +4 -4
  197. package/packages/api-gateway/src/marketplace-entries/official/cordis-timer.json +3 -3
  198. package/packages/api-gateway/src/marketplace-entries/official/cost-meter.json +9 -6
  199. package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +13 -10
  200. package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +10 -5
  201. package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +11 -6
  202. package/packages/api-gateway/src/marketplace-entries/official/genui.json +7 -5
  203. package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +13 -8
  204. package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +13 -7
  205. package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +1 -1
  206. package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +1 -1
  207. package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +9 -6
  208. package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +1 -1
  209. package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +1 -1
  210. package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +12 -7
  211. package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +1 -1
  212. package/packages/api-gateway/src/marketplace-entries/official/memory.json +1 -1
  213. package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +1 -1
  214. package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +1 -1
  215. package/packages/api-gateway/src/marketplace-entries/official/modlens.json +4 -4
  216. package/packages/api-gateway/src/marketplace-entries/official/module-search.json +1 -1
  217. package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +1 -1
  218. package/packages/api-gateway/src/marketplace-entries/official/openpets.json +9 -5
  219. package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +1 -1
  220. package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +1 -1
  221. package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +8 -6
  222. package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +1 -1
  223. package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +1 -1
  224. package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +15 -7
  225. package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +1 -1
  226. package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +1 -1
  227. package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +12 -8
  228. package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +11 -6
  229. package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +1 -1
  230. package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +1 -1
  231. package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +1 -1
  232. package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +1 -1
  233. package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +1 -1
  234. package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +13 -8
  235. package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +1 -1
  236. package/packages/api-gateway/src/marketplace-entries/official/session-export.json +1 -1
  237. package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +12 -6
  238. package/packages/api-gateway/src/marketplace-entries/official/session-search.json +1 -1
  239. package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +1 -1
  240. package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +9 -5
  241. package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +13 -7
  242. package/packages/api-gateway/src/marketplace-entries/official/synapse.json +1 -1
  243. package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +1 -1
  244. package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +1 -1
  245. package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +1 -1
  246. package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +14 -7
  247. package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +1 -1
  248. package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +12 -6
  249. package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +11 -6
  250. package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +1 -1
  251. package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +8 -5
  252. package/packages/api-gateway/src/marketplace-entries/official/web-research.json +1 -1
  253. package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +1 -1
  254. package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +1 -1
  255. package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +8 -5
  256. package/packages/api-gateway/test/index.test.ts +1594 -2
  257. package/packages/api-gateway/test/marketplace.test.ts +389 -2
  258. package/packages/api-gateway/test/release-package.test.ts +6 -11
  259. package/packages/api-gateway/test/release-version.test.ts +2 -2
  260. package/packages/bundle-web-app/package.json +1 -1
  261. package/packages/cli/dist/node-stdio.d.ts.map +1 -1
  262. package/packages/cli/dist/node-stdio.js +83 -20
  263. package/packages/cli/dist/node-stdio.js.map +1 -1
  264. package/packages/cli/package.json +1 -1
  265. package/packages/cli/src/node-stdio.ts +77 -20
  266. package/packages/cli/test/node-stdio.test.ts +118 -2
  267. package/packages/host-webserver/package.json +1 -1
  268. package/apps/web/dist/assets/index-C_AdODuM.js +0 -20
  269. package/apps/web/dist/assets/index-De8Rm01Z.css +0 -2
  270. package/node_modules/@pi-harness/core/LICENSE +0 -9
  271. package/node_modules/@pi-harness/core/dist/boot.d.ts +0 -13
  272. package/node_modules/@pi-harness/core/dist/boot.d.ts.map +0 -1
  273. package/node_modules/@pi-harness/core/dist/boot.js +0 -135
  274. package/node_modules/@pi-harness/core/dist/boot.js.map +0 -1
  275. package/node_modules/@pi-harness/core/dist/config.d.ts +0 -2
  276. package/node_modules/@pi-harness/core/dist/config.d.ts.map +0 -1
  277. package/node_modules/@pi-harness/core/dist/config.js +0 -8
  278. package/node_modules/@pi-harness/core/dist/config.js.map +0 -1
  279. package/node_modules/@pi-harness/core/dist/context.d.ts +0 -3
  280. package/node_modules/@pi-harness/core/dist/context.d.ts.map +0 -1
  281. package/node_modules/@pi-harness/core/dist/context.js +0 -2
  282. package/node_modules/@pi-harness/core/dist/context.js.map +0 -1
  283. package/node_modules/@pi-harness/core/dist/http.d.ts +0 -8
  284. package/node_modules/@pi-harness/core/dist/http.d.ts.map +0 -1
  285. package/node_modules/@pi-harness/core/dist/http.js +0 -27
  286. package/node_modules/@pi-harness/core/dist/http.js.map +0 -1
  287. package/node_modules/@pi-harness/core/dist/index.d.ts +0 -9
  288. package/node_modules/@pi-harness/core/dist/index.d.ts.map +0 -1
  289. package/node_modules/@pi-harness/core/dist/index.js +0 -8
  290. package/node_modules/@pi-harness/core/dist/index.js.map +0 -1
  291. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts +0 -17
  292. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts.map +0 -1
  293. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js +0 -298
  294. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js.map +0 -1
  295. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts +0 -14
  296. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts.map +0 -1
  297. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js +0 -84
  298. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js.map +0 -1
  299. package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts +0 -18
  300. package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts.map +0 -1
  301. package/node_modules/@pi-harness/core/dist/plugins/annotation.js +0 -94
  302. package/node_modules/@pi-harness/core/dist/plugins/annotation.js.map +0 -1
  303. package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts +0 -23
  304. package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts.map +0 -1
  305. package/node_modules/@pi-harness/core/dist/plugins/archify.js +0 -98
  306. package/node_modules/@pi-harness/core/dist/plugins/archify.js.map +0 -1
  307. package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts +0 -8
  308. package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts.map +0 -1
  309. package/node_modules/@pi-harness/core/dist/plugins/at-file.js +0 -52
  310. package/node_modules/@pi-harness/core/dist/plugins/at-file.js.map +0 -1
  311. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.d.ts +0 -15
  312. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.d.ts.map +0 -1
  313. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js +0 -114
  314. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js.map +0 -1
  315. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts +0 -37
  316. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts.map +0 -1
  317. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js +0 -89
  318. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js.map +0 -1
  319. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts +0 -14
  320. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts.map +0 -1
  321. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js +0 -167
  322. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js.map +0 -1
  323. package/node_modules/@pi-harness/core/dist/plugins/browser-session.d.ts +0 -14
  324. package/node_modules/@pi-harness/core/dist/plugins/browser-session.d.ts.map +0 -1
  325. package/node_modules/@pi-harness/core/dist/plugins/browser-session.js +0 -265
  326. package/node_modules/@pi-harness/core/dist/plugins/browser-session.js.map +0 -1
  327. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts +0 -8
  328. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts.map +0 -1
  329. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js +0 -88
  330. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js.map +0 -1
  331. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts +0 -8
  332. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts.map +0 -1
  333. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js +0 -67
  334. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js.map +0 -1
  335. package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts +0 -8
  336. package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts.map +0 -1
  337. package/node_modules/@pi-harness/core/dist/plugins/cleaner.js +0 -56
  338. package/node_modules/@pi-harness/core/dist/plugins/cleaner.js.map +0 -1
  339. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts +0 -15
  340. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts.map +0 -1
  341. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js +0 -110
  342. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js.map +0 -1
  343. package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts +0 -8
  344. package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts.map +0 -1
  345. package/node_modules/@pi-harness/core/dist/plugins/code2skill.js +0 -95
  346. package/node_modules/@pi-harness/core/dist/plugins/code2skill.js.map +0 -1
  347. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts +0 -27
  348. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts.map +0 -1
  349. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js +0 -99
  350. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js.map +0 -1
  351. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts +0 -30
  352. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts.map +0 -1
  353. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js +0 -95
  354. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js.map +0 -1
  355. package/node_modules/@pi-harness/core/dist/plugins/context.d.ts +0 -8
  356. package/node_modules/@pi-harness/core/dist/plugins/context.d.ts.map +0 -1
  357. package/node_modules/@pi-harness/core/dist/plugins/context.js +0 -87
  358. package/node_modules/@pi-harness/core/dist/plugins/context.js.map +0 -1
  359. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts +0 -32
  360. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts.map +0 -1
  361. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js +0 -204
  362. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js.map +0 -1
  363. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts +0 -27
  364. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts.map +0 -1
  365. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js +0 -221
  366. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js.map +0 -1
  367. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts +0 -8
  368. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts.map +0 -1
  369. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js +0 -102
  370. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js.map +0 -1
  371. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts +0 -8
  372. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts.map +0 -1
  373. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js +0 -51
  374. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js.map +0 -1
  375. package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts +0 -8
  376. package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts.map +0 -1
  377. package/node_modules/@pi-harness/core/dist/plugins/genui.js +0 -79
  378. package/node_modules/@pi-harness/core/dist/plugins/genui.js.map +0 -1
  379. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts +0 -9
  380. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts.map +0 -1
  381. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js +0 -90
  382. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js.map +0 -1
  383. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.d.ts +0 -16
  384. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.d.ts.map +0 -1
  385. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js +0 -382
  386. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js.map +0 -1
  387. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.d.ts +0 -15
  388. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.d.ts.map +0 -1
  389. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js +0 -80
  390. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js.map +0 -1
  391. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.d.ts +0 -29
  392. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.d.ts.map +0 -1
  393. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js +0 -139
  394. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js.map +0 -1
  395. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts +0 -8
  396. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts.map +0 -1
  397. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js +0 -76
  398. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js.map +0 -1
  399. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts +0 -8
  400. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts.map +0 -1
  401. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js +0 -150
  402. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js.map +0 -1
  403. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.d.ts +0 -42
  404. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.d.ts.map +0 -1
  405. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js +0 -128
  406. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js.map +0 -1
  407. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.d.ts +0 -19
  408. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.d.ts.map +0 -1
  409. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js +0 -534
  410. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js.map +0 -1
  411. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.d.ts +0 -14
  412. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.d.ts.map +0 -1
  413. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js +0 -180
  414. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js.map +0 -1
  415. package/node_modules/@pi-harness/core/dist/plugins/memory.d.ts +0 -15
  416. package/node_modules/@pi-harness/core/dist/plugins/memory.d.ts.map +0 -1
  417. package/node_modules/@pi-harness/core/dist/plugins/memory.js +0 -161
  418. package/node_modules/@pi-harness/core/dist/plugins/memory.js.map +0 -1
  419. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.d.ts +0 -23
  420. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.d.ts.map +0 -1
  421. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js +0 -149
  422. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js.map +0 -1
  423. package/node_modules/@pi-harness/core/dist/plugins/mock-server.d.ts +0 -22
  424. package/node_modules/@pi-harness/core/dist/plugins/mock-server.d.ts.map +0 -1
  425. package/node_modules/@pi-harness/core/dist/plugins/mock-server.js +0 -149
  426. package/node_modules/@pi-harness/core/dist/plugins/mock-server.js.map +0 -1
  427. package/node_modules/@pi-harness/core/dist/plugins/model.d.ts +0 -8
  428. package/node_modules/@pi-harness/core/dist/plugins/model.d.ts.map +0 -1
  429. package/node_modules/@pi-harness/core/dist/plugins/model.js +0 -14
  430. package/node_modules/@pi-harness/core/dist/plugins/model.js.map +0 -1
  431. package/node_modules/@pi-harness/core/dist/plugins/models.d.ts +0 -16
  432. package/node_modules/@pi-harness/core/dist/plugins/models.d.ts.map +0 -1
  433. package/node_modules/@pi-harness/core/dist/plugins/models.js +0 -27
  434. package/node_modules/@pi-harness/core/dist/plugins/models.js.map +0 -1
  435. package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts +0 -8
  436. package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts.map +0 -1
  437. package/node_modules/@pi-harness/core/dist/plugins/modlens.js +0 -63
  438. package/node_modules/@pi-harness/core/dist/plugins/modlens.js.map +0 -1
  439. package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts +0 -27
  440. package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts.map +0 -1
  441. package/node_modules/@pi-harness/core/dist/plugins/module-search.js +0 -174
  442. package/node_modules/@pi-harness/core/dist/plugins/module-search.js.map +0 -1
  443. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.d.ts +0 -14
  444. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.d.ts.map +0 -1
  445. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js +0 -79
  446. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js.map +0 -1
  447. package/node_modules/@pi-harness/core/dist/plugins/openpets.d.ts +0 -14
  448. package/node_modules/@pi-harness/core/dist/plugins/openpets.d.ts.map +0 -1
  449. package/node_modules/@pi-harness/core/dist/plugins/openpets.js +0 -99
  450. package/node_modules/@pi-harness/core/dist/plugins/openpets.js.map +0 -1
  451. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts +0 -8
  452. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts.map +0 -1
  453. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js +0 -70
  454. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js.map +0 -1
  455. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts +0 -38
  456. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts.map +0 -1
  457. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js +0 -227
  458. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js.map +0 -1
  459. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts +0 -8
  460. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts.map +0 -1
  461. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js +0 -44
  462. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js.map +0 -1
  463. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts +0 -16
  464. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts.map +0 -1
  465. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js +0 -98
  466. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js.map +0 -1
  467. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts +0 -29
  468. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts.map +0 -1
  469. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js +0 -146
  470. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js.map +0 -1
  471. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.d.ts +0 -45
  472. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.d.ts.map +0 -1
  473. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js +0 -165
  474. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js.map +0 -1
  475. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts +0 -8
  476. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts.map +0 -1
  477. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js +0 -114
  478. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js.map +0 -1
  479. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts +0 -25
  480. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts.map +0 -1
  481. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js +0 -142
  482. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js.map +0 -1
  483. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts +0 -25
  484. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts.map +0 -1
  485. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js +0 -139
  486. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js.map +0 -1
  487. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts +0 -24
  488. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts.map +0 -1
  489. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js +0 -124
  490. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js.map +0 -1
  491. package/node_modules/@pi-harness/core/dist/plugins/resources.d.ts +0 -19
  492. package/node_modules/@pi-harness/core/dist/plugins/resources.d.ts.map +0 -1
  493. package/node_modules/@pi-harness/core/dist/plugins/resources.js +0 -63
  494. package/node_modules/@pi-harness/core/dist/plugins/resources.js.map +0 -1
  495. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.d.ts +0 -23
  496. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.d.ts.map +0 -1
  497. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js +0 -60
  498. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js.map +0 -1
  499. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts +0 -14
  500. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts.map +0 -1
  501. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js +0 -133
  502. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js.map +0 -1
  503. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts +0 -33
  504. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts.map +0 -1
  505. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js +0 -114
  506. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js.map +0 -1
  507. package/node_modules/@pi-harness/core/dist/plugins/runtime.d.ts +0 -14
  508. package/node_modules/@pi-harness/core/dist/plugins/runtime.d.ts.map +0 -1
  509. package/node_modules/@pi-harness/core/dist/plugins/runtime.js +0 -125
  510. package/node_modules/@pi-harness/core/dist/plugins/runtime.js.map +0 -1
  511. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts +0 -31
  512. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts.map +0 -1
  513. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js +0 -121
  514. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js.map +0 -1
  515. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts +0 -15
  516. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts.map +0 -1
  517. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js +0 -87
  518. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js.map +0 -1
  519. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts +0 -44
  520. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts.map +0 -1
  521. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js +0 -265
  522. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js.map +0 -1
  523. package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts +0 -33
  524. package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts.map +0 -1
  525. package/node_modules/@pi-harness/core/dist/plugins/session-compare.js +0 -150
  526. package/node_modules/@pi-harness/core/dist/plugins/session-compare.js.map +0 -1
  527. package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts +0 -9
  528. package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts.map +0 -1
  529. package/node_modules/@pi-harness/core/dist/plugins/session-export.js +0 -93
  530. package/node_modules/@pi-harness/core/dist/plugins/session-export.js.map +0 -1
  531. package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts +0 -8
  532. package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts.map +0 -1
  533. package/node_modules/@pi-harness/core/dist/plugins/session-insights.js +0 -47
  534. package/node_modules/@pi-harness/core/dist/plugins/session-insights.js.map +0 -1
  535. package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts +0 -20
  536. package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts.map +0 -1
  537. package/node_modules/@pi-harness/core/dist/plugins/session-search.js +0 -122
  538. package/node_modules/@pi-harness/core/dist/plugins/session-search.js.map +0 -1
  539. package/node_modules/@pi-harness/core/dist/plugins/session.d.ts +0 -15
  540. package/node_modules/@pi-harness/core/dist/plugins/session.d.ts.map +0 -1
  541. package/node_modules/@pi-harness/core/dist/plugins/session.js +0 -22
  542. package/node_modules/@pi-harness/core/dist/plugins/session.js.map +0 -1
  543. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts +0 -26
  544. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts.map +0 -1
  545. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js +0 -97
  546. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js.map +0 -1
  547. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts +0 -26
  548. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts.map +0 -1
  549. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js +0 -139
  550. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js.map +0 -1
  551. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts +0 -8
  552. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts.map +0 -1
  553. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js +0 -85
  554. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js.map +0 -1
  555. package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts +0 -8
  556. package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts.map +0 -1
  557. package/node_modules/@pi-harness/core/dist/plugins/stdio.js +0 -22
  558. package/node_modules/@pi-harness/core/dist/plugins/stdio.js.map +0 -1
  559. package/node_modules/@pi-harness/core/dist/plugins/synapse.d.ts +0 -38
  560. package/node_modules/@pi-harness/core/dist/plugins/synapse.d.ts.map +0 -1
  561. package/node_modules/@pi-harness/core/dist/plugins/synapse.js +0 -93
  562. package/node_modules/@pi-harness/core/dist/plugins/synapse.js.map +0 -1
  563. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts +0 -8
  564. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts.map +0 -1
  565. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js +0 -135
  566. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js.map +0 -1
  567. package/node_modules/@pi-harness/core/dist/plugins/taskboard.d.ts +0 -15
  568. package/node_modules/@pi-harness/core/dist/plugins/taskboard.d.ts.map +0 -1
  569. package/node_modules/@pi-harness/core/dist/plugins/taskboard.js +0 -347
  570. package/node_modules/@pi-harness/core/dist/plugins/taskboard.js.map +0 -1
  571. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts +0 -8
  572. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts.map +0 -1
  573. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js +0 -57
  574. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js.map +0 -1
  575. package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts +0 -8
  576. package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts.map +0 -1
  577. package/node_modules/@pi-harness/core/dist/plugins/test-harness.js +0 -64
  578. package/node_modules/@pi-harness/core/dist/plugins/test-harness.js.map +0 -1
  579. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.d.ts +0 -29
  580. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.d.ts.map +0 -1
  581. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js +0 -141
  582. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js.map +0 -1
  583. package/node_modules/@pi-harness/core/dist/plugins/token-guard.d.ts +0 -15
  584. package/node_modules/@pi-harness/core/dist/plugins/token-guard.d.ts.map +0 -1
  585. package/node_modules/@pi-harness/core/dist/plugins/token-guard.js +0 -78
  586. package/node_modules/@pi-harness/core/dist/plugins/token-guard.js.map +0 -1
  587. package/node_modules/@pi-harness/core/dist/plugins/tools.d.ts +0 -13
  588. package/node_modules/@pi-harness/core/dist/plugins/tools.d.ts.map +0 -1
  589. package/node_modules/@pi-harness/core/dist/plugins/tools.js +0 -20
  590. package/node_modules/@pi-harness/core/dist/plugins/tools.js.map +0 -1
  591. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts +0 -19
  592. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts.map +0 -1
  593. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js +0 -74
  594. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js.map +0 -1
  595. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.d.ts +0 -17
  596. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.d.ts.map +0 -1
  597. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js +0 -247
  598. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js.map +0 -1
  599. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts +0 -17
  600. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts.map +0 -1
  601. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js +0 -145
  602. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js.map +0 -1
  603. package/node_modules/@pi-harness/core/dist/plugins/web-research.d.ts +0 -17
  604. package/node_modules/@pi-harness/core/dist/plugins/web-research.d.ts.map +0 -1
  605. package/node_modules/@pi-harness/core/dist/plugins/web-research.js +0 -275
  606. package/node_modules/@pi-harness/core/dist/plugins/web-research.js.map +0 -1
  607. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts +0 -36
  608. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts.map +0 -1
  609. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js +0 -150
  610. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js.map +0 -1
  611. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts +0 -8
  612. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts.map +0 -1
  613. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js +0 -134
  614. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js.map +0 -1
  615. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts +0 -8
  616. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts.map +0 -1
  617. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js +0 -94
  618. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js.map +0 -1
  619. package/node_modules/@pi-harness/core/dist/profile.d.ts +0 -9
  620. package/node_modules/@pi-harness/core/dist/profile.d.ts.map +0 -1
  621. package/node_modules/@pi-harness/core/dist/profile.js +0 -33
  622. package/node_modules/@pi-harness/core/dist/profile.js.map +0 -1
  623. package/node_modules/@pi-harness/core/dist/runtime.d.ts +0 -16
  624. package/node_modules/@pi-harness/core/dist/runtime.d.ts.map +0 -1
  625. package/node_modules/@pi-harness/core/dist/runtime.js +0 -42
  626. package/node_modules/@pi-harness/core/dist/runtime.js.map +0 -1
  627. package/node_modules/@pi-harness/core/dist/services.d.ts +0 -118
  628. package/node_modules/@pi-harness/core/dist/services.d.ts.map +0 -1
  629. package/node_modules/@pi-harness/core/dist/services.js +0 -95
  630. package/node_modules/@pi-harness/core/dist/services.js.map +0 -1
  631. package/node_modules/@pi-harness/core/dist/stdio.d.ts +0 -36
  632. package/node_modules/@pi-harness/core/dist/stdio.d.ts.map +0 -1
  633. package/node_modules/@pi-harness/core/dist/stdio.js +0 -140
  634. package/node_modules/@pi-harness/core/dist/stdio.js.map +0 -1
  635. package/node_modules/@pi-harness/core/dist/workspace-path.d.ts +0 -12
  636. package/node_modules/@pi-harness/core/dist/workspace-path.d.ts.map +0 -1
  637. package/node_modules/@pi-harness/core/dist/workspace-path.js +0 -62
  638. package/node_modules/@pi-harness/core/dist/workspace-path.js.map +0 -1
  639. package/node_modules/@pi-harness/core/package.json +0 -42
  640. package/node_modules/@pi-harness/core/profiles/default/cordis.yml +0 -120
  641. package/node_modules/@pi-harness/core/profiles/development/cordis.yml +0 -47
  642. package/packages/client-web/LICENSE +0 -9
  643. package/packages/client-web/dist/annotation-ui.d.ts +0 -11
  644. package/packages/client-web/dist/annotation-ui.d.ts.map +0 -1
  645. package/packages/client-web/dist/annotation-ui.js +0 -24
  646. package/packages/client-web/dist/annotation-ui.js.map +0 -1
  647. package/packages/client-web/dist/browser-session-view.d.ts +0 -7
  648. package/packages/client-web/dist/browser-session-view.d.ts.map +0 -1
  649. package/packages/client-web/dist/browser-session-view.js +0 -8
  650. package/packages/client-web/dist/browser-session-view.js.map +0 -1
  651. package/packages/client-web/dist/control-room.d.ts +0 -270
  652. package/packages/client-web/dist/control-room.d.ts.map +0 -1
  653. package/packages/client-web/dist/control-room.js +0 -157
  654. package/packages/client-web/dist/control-room.js.map +0 -1
  655. package/packages/client-web/dist/design-contract.d.ts +0 -85
  656. package/packages/client-web/dist/design-contract.d.ts.map +0 -1
  657. package/packages/client-web/dist/design-contract.js +0 -258
  658. package/packages/client-web/dist/design-contract.js.map +0 -1
  659. package/packages/client-web/dist/index.d.ts +0 -20
  660. package/packages/client-web/dist/index.d.ts.map +0 -1
  661. package/packages/client-web/dist/index.js +0 -27
  662. package/packages/client-web/dist/index.js.map +0 -1
  663. package/packages/client-web/dist/markdown.d.ts +0 -5
  664. package/packages/client-web/dist/markdown.d.ts.map +0 -1
  665. package/packages/client-web/dist/markdown.js +0 -20
  666. package/packages/client-web/dist/markdown.js.map +0 -1
  667. package/packages/client-web/dist/marketplace-catalog.d.ts +0 -3
  668. package/packages/client-web/dist/marketplace-catalog.d.ts.map +0 -1
  669. package/packages/client-web/dist/marketplace-catalog.js +0 -10
  670. package/packages/client-web/dist/marketplace-catalog.js.map +0 -1
  671. package/packages/client-web/dist/marketplace-navigation.d.ts +0 -19
  672. package/packages/client-web/dist/marketplace-navigation.d.ts.map +0 -1
  673. package/packages/client-web/dist/marketplace-navigation.js +0 -31
  674. package/packages/client-web/dist/marketplace-navigation.js.map +0 -1
  675. package/packages/client-web/dist/message-content.d.ts +0 -9
  676. package/packages/client-web/dist/message-content.d.ts.map +0 -1
  677. package/packages/client-web/dist/message-content.js +0 -54
  678. package/packages/client-web/dist/message-content.js.map +0 -1
  679. package/packages/client-web/dist/plugin-card.d.ts +0 -8
  680. package/packages/client-web/dist/plugin-card.d.ts.map +0 -1
  681. package/packages/client-web/dist/plugin-card.js +0 -15
  682. package/packages/client-web/dist/plugin-card.js.map +0 -1
  683. package/packages/client-web/dist/plugin-navigation.d.ts +0 -3
  684. package/packages/client-web/dist/plugin-navigation.d.ts.map +0 -1
  685. package/packages/client-web/dist/plugin-navigation.js +0 -10
  686. package/packages/client-web/dist/plugin-navigation.js.map +0 -1
  687. package/packages/client-web/dist/plugin-search.d.ts +0 -2
  688. package/packages/client-web/dist/plugin-search.d.ts.map +0 -1
  689. package/packages/client-web/dist/plugin-search.js +0 -7
  690. package/packages/client-web/dist/plugin-search.js.map +0 -1
  691. package/packages/client-web/dist/plugin-stars-view.d.ts +0 -12
  692. package/packages/client-web/dist/plugin-stars-view.d.ts.map +0 -1
  693. package/packages/client-web/dist/plugin-stars-view.js +0 -8
  694. package/packages/client-web/dist/plugin-stars-view.js.map +0 -1
  695. package/packages/client-web/dist/prompt-completion.d.ts +0 -13
  696. package/packages/client-web/dist/prompt-completion.d.ts.map +0 -1
  697. package/packages/client-web/dist/prompt-completion.js +0 -17
  698. package/packages/client-web/dist/prompt-completion.js.map +0 -1
  699. package/packages/client-web/dist/react-room.d.ts +0 -7
  700. package/packages/client-web/dist/react-room.d.ts.map +0 -1
  701. package/packages/client-web/dist/react-room.js +0 -2600
  702. package/packages/client-web/dist/react-room.js.map +0 -1
  703. package/packages/client-web/dist/runtime-events.d.ts +0 -4
  704. package/packages/client-web/dist/runtime-events.d.ts.map +0 -1
  705. package/packages/client-web/dist/runtime-events.js +0 -29
  706. package/packages/client-web/dist/runtime-events.js.map +0 -1
  707. package/packages/client-web/package.json +0 -42
  708. package/packages/client-web/src/annotation-ui.ts +0 -29
  709. package/packages/client-web/src/browser-session-view.ts +0 -13
  710. package/packages/client-web/src/control-room.ts +0 -359
  711. package/packages/client-web/src/design-contract.ts +0 -334
  712. package/packages/client-web/src/index.ts +0 -34
  713. package/packages/client-web/src/markdown.tsx +0 -22
  714. package/packages/client-web/src/marketplace-catalog.ts +0 -10
  715. package/packages/client-web/src/marketplace-navigation.ts +0 -46
  716. package/packages/client-web/src/message-content.ts +0 -51
  717. package/packages/client-web/src/plugin-card.ts +0 -22
  718. package/packages/client-web/src/plugin-navigation.ts +0 -9
  719. package/packages/client-web/src/plugin-search.ts +0 -5
  720. package/packages/client-web/src/plugin-stars-view.ts +0 -19
  721. package/packages/client-web/src/prompt-completion.ts +0 -24
  722. package/packages/client-web/src/react-room.tsx +0 -7711
  723. package/packages/client-web/src/runtime-events.ts +0 -29
  724. package/packages/client-web/test/annotation-ui.test.ts +0 -21
  725. package/packages/client-web/test/browser-session-view.test.ts +0 -17
  726. package/packages/client-web/test/design-contract.test.ts +0 -69
  727. package/packages/client-web/test/marketplace-catalog.test.ts +0 -52
  728. package/packages/client-web/test/message-content.test.ts +0 -43
  729. package/packages/client-web/test/plugin-card.test.ts +0 -46
  730. package/packages/client-web/test/plugin-navigation.test.ts +0 -14
  731. package/packages/client-web/test/plugin-search.test.ts +0 -22
  732. package/packages/client-web/test/plugin-stars-view.test.ts +0 -20
  733. package/packages/client-web/test/prompt-completion.test.ts +0 -21
  734. package/packages/client-web/test/runtime-events.test.ts +0 -28
  735. package/packages/client-web/tsconfig.build.json +0 -13
  736. package/packages/client-web/tsconfig.json +0 -11
  737. package/packages/core/LICENSE +0 -9
  738. package/packages/core/dist/boot.d.ts +0 -13
  739. package/packages/core/dist/boot.d.ts.map +0 -1
  740. package/packages/core/dist/boot.js +0 -135
  741. package/packages/core/dist/boot.js.map +0 -1
  742. package/packages/core/dist/config.d.ts +0 -2
  743. package/packages/core/dist/config.d.ts.map +0 -1
  744. package/packages/core/dist/config.js +0 -8
  745. package/packages/core/dist/config.js.map +0 -1
  746. package/packages/core/dist/context.d.ts +0 -3
  747. package/packages/core/dist/context.d.ts.map +0 -1
  748. package/packages/core/dist/context.js +0 -2
  749. package/packages/core/dist/context.js.map +0 -1
  750. package/packages/core/dist/http.d.ts +0 -8
  751. package/packages/core/dist/http.d.ts.map +0 -1
  752. package/packages/core/dist/http.js +0 -27
  753. package/packages/core/dist/http.js.map +0 -1
  754. package/packages/core/dist/index.d.ts +0 -9
  755. package/packages/core/dist/index.d.ts.map +0 -1
  756. package/packages/core/dist/index.js +0 -8
  757. package/packages/core/dist/index.js.map +0 -1
  758. package/packages/core/dist/plugins/agent-teams.d.ts +0 -17
  759. package/packages/core/dist/plugins/agent-teams.d.ts.map +0 -1
  760. package/packages/core/dist/plugins/agent-teams.js +0 -298
  761. package/packages/core/dist/plugins/agent-teams.js.map +0 -1
  762. package/packages/core/dist/plugins/anchored-standard.d.ts +0 -14
  763. package/packages/core/dist/plugins/anchored-standard.d.ts.map +0 -1
  764. package/packages/core/dist/plugins/anchored-standard.js +0 -84
  765. package/packages/core/dist/plugins/anchored-standard.js.map +0 -1
  766. package/packages/core/dist/plugins/annotation.d.ts +0 -18
  767. package/packages/core/dist/plugins/annotation.d.ts.map +0 -1
  768. package/packages/core/dist/plugins/annotation.js +0 -94
  769. package/packages/core/dist/plugins/annotation.js.map +0 -1
  770. package/packages/core/dist/plugins/archify.d.ts +0 -23
  771. package/packages/core/dist/plugins/archify.d.ts.map +0 -1
  772. package/packages/core/dist/plugins/archify.js +0 -98
  773. package/packages/core/dist/plugins/archify.js.map +0 -1
  774. package/packages/core/dist/plugins/at-file.d.ts +0 -8
  775. package/packages/core/dist/plugins/at-file.d.ts.map +0 -1
  776. package/packages/core/dist/plugins/at-file.js +0 -52
  777. package/packages/core/dist/plugins/at-file.js.map +0 -1
  778. package/packages/core/dist/plugins/auto-mode.d.ts +0 -15
  779. package/packages/core/dist/plugins/auto-mode.d.ts.map +0 -1
  780. package/packages/core/dist/plugins/auto-mode.js +0 -114
  781. package/packages/core/dist/plugins/auto-mode.js.map +0 -1
  782. package/packages/core/dist/plugins/better-sidebar.d.ts +0 -37
  783. package/packages/core/dist/plugins/better-sidebar.d.ts.map +0 -1
  784. package/packages/core/dist/plugins/better-sidebar.js +0 -89
  785. package/packages/core/dist/plugins/better-sidebar.js.map +0 -1
  786. package/packages/core/dist/plugins/browser-fetch.d.ts +0 -14
  787. package/packages/core/dist/plugins/browser-fetch.d.ts.map +0 -1
  788. package/packages/core/dist/plugins/browser-fetch.js +0 -167
  789. package/packages/core/dist/plugins/browser-fetch.js.map +0 -1
  790. package/packages/core/dist/plugins/browser-session.d.ts +0 -14
  791. package/packages/core/dist/plugins/browser-session.d.ts.map +0 -1
  792. package/packages/core/dist/plugins/browser-session.js +0 -265
  793. package/packages/core/dist/plugins/browser-session.js.map +0 -1
  794. package/packages/core/dist/plugins/canvas-draw.d.ts +0 -8
  795. package/packages/core/dist/plugins/canvas-draw.d.ts.map +0 -1
  796. package/packages/core/dist/plugins/canvas-draw.js +0 -88
  797. package/packages/core/dist/plugins/canvas-draw.js.map +0 -1
  798. package/packages/core/dist/plugins/change-verifier.d.ts +0 -8
  799. package/packages/core/dist/plugins/change-verifier.d.ts.map +0 -1
  800. package/packages/core/dist/plugins/change-verifier.js +0 -67
  801. package/packages/core/dist/plugins/change-verifier.js.map +0 -1
  802. package/packages/core/dist/plugins/cleaner.d.ts +0 -8
  803. package/packages/core/dist/plugins/cleaner.d.ts.map +0 -1
  804. package/packages/core/dist/plugins/cleaner.js +0 -56
  805. package/packages/core/dist/plugins/cleaner.js.map +0 -1
  806. package/packages/core/dist/plugins/cli-notifier.d.ts +0 -15
  807. package/packages/core/dist/plugins/cli-notifier.d.ts.map +0 -1
  808. package/packages/core/dist/plugins/cli-notifier.js +0 -110
  809. package/packages/core/dist/plugins/cli-notifier.js.map +0 -1
  810. package/packages/core/dist/plugins/code2skill.d.ts +0 -8
  811. package/packages/core/dist/plugins/code2skill.d.ts.map +0 -1
  812. package/packages/core/dist/plugins/code2skill.js +0 -95
  813. package/packages/core/dist/plugins/code2skill.js.map +0 -1
  814. package/packages/core/dist/plugins/colleague-skill.d.ts +0 -27
  815. package/packages/core/dist/plugins/colleague-skill.d.ts.map +0 -1
  816. package/packages/core/dist/plugins/colleague-skill.js +0 -99
  817. package/packages/core/dist/plugins/colleague-skill.js.map +0 -1
  818. package/packages/core/dist/plugins/context-doctor.d.ts +0 -30
  819. package/packages/core/dist/plugins/context-doctor.d.ts.map +0 -1
  820. package/packages/core/dist/plugins/context-doctor.js +0 -95
  821. package/packages/core/dist/plugins/context-doctor.js.map +0 -1
  822. package/packages/core/dist/plugins/context.d.ts +0 -8
  823. package/packages/core/dist/plugins/context.d.ts.map +0 -1
  824. package/packages/core/dist/plugins/context.js +0 -87
  825. package/packages/core/dist/plugins/context.js.map +0 -1
  826. package/packages/core/dist/plugins/cost-meter.d.ts +0 -32
  827. package/packages/core/dist/plugins/cost-meter.d.ts.map +0 -1
  828. package/packages/core/dist/plugins/cost-meter.js +0 -204
  829. package/packages/core/dist/plugins/cost-meter.js.map +0 -1
  830. package/packages/core/dist/plugins/dependency-checker.d.ts +0 -27
  831. package/packages/core/dist/plugins/dependency-checker.d.ts.map +0 -1
  832. package/packages/core/dist/plugins/dependency-checker.js +0 -221
  833. package/packages/core/dist/plugins/dependency-checker.js.map +0 -1
  834. package/packages/core/dist/plugins/docker-sandbox.d.ts +0 -8
  835. package/packages/core/dist/plugins/docker-sandbox.d.ts.map +0 -1
  836. package/packages/core/dist/plugins/docker-sandbox.js +0 -102
  837. package/packages/core/dist/plugins/docker-sandbox.js.map +0 -1
  838. package/packages/core/dist/plugins/fail-logger.d.ts +0 -8
  839. package/packages/core/dist/plugins/fail-logger.d.ts.map +0 -1
  840. package/packages/core/dist/plugins/fail-logger.js +0 -51
  841. package/packages/core/dist/plugins/fail-logger.js.map +0 -1
  842. package/packages/core/dist/plugins/genui.d.ts +0 -8
  843. package/packages/core/dist/plugins/genui.d.ts.map +0 -1
  844. package/packages/core/dist/plugins/genui.js +0 -79
  845. package/packages/core/dist/plugins/genui.js.map +0 -1
  846. package/packages/core/dist/plugins/git-time-capsule.d.ts +0 -9
  847. package/packages/core/dist/plugins/git-time-capsule.d.ts.map +0 -1
  848. package/packages/core/dist/plugins/git-time-capsule.js +0 -90
  849. package/packages/core/dist/plugins/git-time-capsule.js.map +0 -1
  850. package/packages/core/dist/plugins/graph-memory.d.ts +0 -16
  851. package/packages/core/dist/plugins/graph-memory.d.ts.map +0 -1
  852. package/packages/core/dist/plugins/graph-memory.js +0 -382
  853. package/packages/core/dist/plugins/graph-memory.js.map +0 -1
  854. package/packages/core/dist/plugins/history-compressor.d.ts +0 -15
  855. package/packages/core/dist/plugins/history-compressor.d.ts.map +0 -1
  856. package/packages/core/dist/plugins/history-compressor.js +0 -80
  857. package/packages/core/dist/plugins/history-compressor.js.map +0 -1
  858. package/packages/core/dist/plugins/hol-guard.d.ts +0 -29
  859. package/packages/core/dist/plugins/hol-guard.d.ts.map +0 -1
  860. package/packages/core/dist/plugins/hol-guard.js +0 -139
  861. package/packages/core/dist/plugins/hol-guard.js.map +0 -1
  862. package/packages/core/dist/plugins/i18n-pair.d.ts +0 -8
  863. package/packages/core/dist/plugins/i18n-pair.d.ts.map +0 -1
  864. package/packages/core/dist/plugins/i18n-pair.js +0 -76
  865. package/packages/core/dist/plugins/i18n-pair.js.map +0 -1
  866. package/packages/core/dist/plugins/image-compressor.d.ts +0 -8
  867. package/packages/core/dist/plugins/image-compressor.d.ts.map +0 -1
  868. package/packages/core/dist/plugins/image-compressor.js +0 -150
  869. package/packages/core/dist/plugins/image-compressor.js.map +0 -1
  870. package/packages/core/dist/plugins/llm-verifier.d.ts +0 -42
  871. package/packages/core/dist/plugins/llm-verifier.d.ts.map +0 -1
  872. package/packages/core/dist/plugins/llm-verifier.js +0 -128
  873. package/packages/core/dist/plugins/llm-verifier.js.map +0 -1
  874. package/packages/core/dist/plugins/mcp-client.d.ts +0 -19
  875. package/packages/core/dist/plugins/mcp-client.d.ts.map +0 -1
  876. package/packages/core/dist/plugins/mcp-client.js +0 -534
  877. package/packages/core/dist/plugins/mcp-client.js.map +0 -1
  878. package/packages/core/dist/plugins/mcp-panel.d.ts +0 -14
  879. package/packages/core/dist/plugins/mcp-panel.d.ts.map +0 -1
  880. package/packages/core/dist/plugins/mcp-panel.js +0 -180
  881. package/packages/core/dist/plugins/mcp-panel.js.map +0 -1
  882. package/packages/core/dist/plugins/memory.d.ts +0 -15
  883. package/packages/core/dist/plugins/memory.d.ts.map +0 -1
  884. package/packages/core/dist/plugins/memory.js +0 -161
  885. package/packages/core/dist/plugins/memory.js.map +0 -1
  886. package/packages/core/dist/plugins/mirage-bridge.d.ts +0 -23
  887. package/packages/core/dist/plugins/mirage-bridge.d.ts.map +0 -1
  888. package/packages/core/dist/plugins/mirage-bridge.js +0 -149
  889. package/packages/core/dist/plugins/mirage-bridge.js.map +0 -1
  890. package/packages/core/dist/plugins/mock-server.d.ts +0 -22
  891. package/packages/core/dist/plugins/mock-server.d.ts.map +0 -1
  892. package/packages/core/dist/plugins/mock-server.js +0 -149
  893. package/packages/core/dist/plugins/mock-server.js.map +0 -1
  894. package/packages/core/dist/plugins/model.d.ts +0 -8
  895. package/packages/core/dist/plugins/model.d.ts.map +0 -1
  896. package/packages/core/dist/plugins/model.js +0 -14
  897. package/packages/core/dist/plugins/model.js.map +0 -1
  898. package/packages/core/dist/plugins/models.d.ts +0 -16
  899. package/packages/core/dist/plugins/models.d.ts.map +0 -1
  900. package/packages/core/dist/plugins/models.js +0 -27
  901. package/packages/core/dist/plugins/models.js.map +0 -1
  902. package/packages/core/dist/plugins/modlens.d.ts +0 -8
  903. package/packages/core/dist/plugins/modlens.d.ts.map +0 -1
  904. package/packages/core/dist/plugins/modlens.js +0 -63
  905. package/packages/core/dist/plugins/modlens.js.map +0 -1
  906. package/packages/core/dist/plugins/module-search.d.ts +0 -27
  907. package/packages/core/dist/plugins/module-search.d.ts.map +0 -1
  908. package/packages/core/dist/plugins/module-search.js +0 -174
  909. package/packages/core/dist/plugins/module-search.js.map +0 -1
  910. package/packages/core/dist/plugins/obsidian-sync.d.ts +0 -14
  911. package/packages/core/dist/plugins/obsidian-sync.d.ts.map +0 -1
  912. package/packages/core/dist/plugins/obsidian-sync.js +0 -79
  913. package/packages/core/dist/plugins/obsidian-sync.js.map +0 -1
  914. package/packages/core/dist/plugins/openpets.d.ts +0 -14
  915. package/packages/core/dist/plugins/openpets.d.ts.map +0 -1
  916. package/packages/core/dist/plugins/openpets.js +0 -99
  917. package/packages/core/dist/plugins/openpets.js.map +0 -1
  918. package/packages/core/dist/plugins/plan-execute.d.ts +0 -8
  919. package/packages/core/dist/plugins/plan-execute.d.ts.map +0 -1
  920. package/packages/core/dist/plugins/plan-execute.js +0 -70
  921. package/packages/core/dist/plugins/plan-execute.js.map +0 -1
  922. package/packages/core/dist/plugins/plugin-check.d.ts +0 -38
  923. package/packages/core/dist/plugins/plugin-check.d.ts.map +0 -1
  924. package/packages/core/dist/plugins/plugin-check.js +0 -227
  925. package/packages/core/dist/plugins/plugin-check.js.map +0 -1
  926. package/packages/core/dist/plugins/plugin-dev.d.ts +0 -8
  927. package/packages/core/dist/plugins/plugin-dev.d.ts.map +0 -1
  928. package/packages/core/dist/plugins/plugin-dev.js +0 -44
  929. package/packages/core/dist/plugins/plugin-dev.js.map +0 -1
  930. package/packages/core/dist/plugins/plugin-finder.d.ts +0 -16
  931. package/packages/core/dist/plugins/plugin-finder.d.ts.map +0 -1
  932. package/packages/core/dist/plugins/plugin-finder.js +0 -98
  933. package/packages/core/dist/plugins/plugin-finder.js.map +0 -1
  934. package/packages/core/dist/plugins/plugin-radar.d.ts +0 -29
  935. package/packages/core/dist/plugins/plugin-radar.d.ts.map +0 -1
  936. package/packages/core/dist/plugins/plugin-radar.js +0 -146
  937. package/packages/core/dist/plugins/plugin-radar.js.map +0 -1
  938. package/packages/core/dist/plugins/plugin-stars.d.ts +0 -45
  939. package/packages/core/dist/plugins/plugin-stars.d.ts.map +0 -1
  940. package/packages/core/dist/plugins/plugin-stars.js +0 -165
  941. package/packages/core/dist/plugins/plugin-stars.js.map +0 -1
  942. package/packages/core/dist/plugins/prompt-guard.d.ts +0 -8
  943. package/packages/core/dist/plugins/prompt-guard.d.ts.map +0 -1
  944. package/packages/core/dist/plugins/prompt-guard.js +0 -114
  945. package/packages/core/dist/plugins/prompt-guard.js.map +0 -1
  946. package/packages/core/dist/plugins/prompt-library.d.ts +0 -25
  947. package/packages/core/dist/plugins/prompt-library.d.ts.map +0 -1
  948. package/packages/core/dist/plugins/prompt-library.js +0 -142
  949. package/packages/core/dist/plugins/prompt-library.js.map +0 -1
  950. package/packages/core/dist/plugins/readme-gen.d.ts +0 -25
  951. package/packages/core/dist/plugins/readme-gen.d.ts.map +0 -1
  952. package/packages/core/dist/plugins/readme-gen.js +0 -139
  953. package/packages/core/dist/plugins/readme-gen.js.map +0 -1
  954. package/packages/core/dist/plugins/recall-unread.d.ts +0 -24
  955. package/packages/core/dist/plugins/recall-unread.d.ts.map +0 -1
  956. package/packages/core/dist/plugins/recall-unread.js +0 -124
  957. package/packages/core/dist/plugins/recall-unread.js.map +0 -1
  958. package/packages/core/dist/plugins/resources.d.ts +0 -19
  959. package/packages/core/dist/plugins/resources.d.ts.map +0 -1
  960. package/packages/core/dist/plugins/resources.js +0 -63
  961. package/packages/core/dist/plugins/resources.js.map +0 -1
  962. package/packages/core/dist/plugins/reverse-skill.d.ts +0 -23
  963. package/packages/core/dist/plugins/reverse-skill.d.ts.map +0 -1
  964. package/packages/core/dist/plugins/reverse-skill.js +0 -60
  965. package/packages/core/dist/plugins/reverse-skill.js.map +0 -1
  966. package/packages/core/dist/plugins/reviewer-bot.d.ts +0 -14
  967. package/packages/core/dist/plugins/reviewer-bot.d.ts.map +0 -1
  968. package/packages/core/dist/plugins/reviewer-bot.js +0 -133
  969. package/packages/core/dist/plugins/reviewer-bot.js.map +0 -1
  970. package/packages/core/dist/plugins/runtime-doctor.d.ts +0 -33
  971. package/packages/core/dist/plugins/runtime-doctor.d.ts.map +0 -1
  972. package/packages/core/dist/plugins/runtime-doctor.js +0 -114
  973. package/packages/core/dist/plugins/runtime-doctor.js.map +0 -1
  974. package/packages/core/dist/plugins/runtime.d.ts +0 -14
  975. package/packages/core/dist/plugins/runtime.d.ts.map +0 -1
  976. package/packages/core/dist/plugins/runtime.js +0 -125
  977. package/packages/core/dist/plugins/runtime.js.map +0 -1
  978. package/packages/core/dist/plugins/secure-audit.d.ts +0 -31
  979. package/packages/core/dist/plugins/secure-audit.d.ts.map +0 -1
  980. package/packages/core/dist/plugins/secure-audit.js +0 -121
  981. package/packages/core/dist/plugins/secure-audit.js.map +0 -1
  982. package/packages/core/dist/plugins/session-bookmarks.d.ts +0 -15
  983. package/packages/core/dist/plugins/session-bookmarks.d.ts.map +0 -1
  984. package/packages/core/dist/plugins/session-bookmarks.js +0 -87
  985. package/packages/core/dist/plugins/session-bookmarks.js.map +0 -1
  986. package/packages/core/dist/plugins/session-bridge.d.ts +0 -44
  987. package/packages/core/dist/plugins/session-bridge.d.ts.map +0 -1
  988. package/packages/core/dist/plugins/session-bridge.js +0 -265
  989. package/packages/core/dist/plugins/session-bridge.js.map +0 -1
  990. package/packages/core/dist/plugins/session-compare.d.ts +0 -33
  991. package/packages/core/dist/plugins/session-compare.d.ts.map +0 -1
  992. package/packages/core/dist/plugins/session-compare.js +0 -150
  993. package/packages/core/dist/plugins/session-compare.js.map +0 -1
  994. package/packages/core/dist/plugins/session-export.d.ts +0 -9
  995. package/packages/core/dist/plugins/session-export.d.ts.map +0 -1
  996. package/packages/core/dist/plugins/session-export.js +0 -93
  997. package/packages/core/dist/plugins/session-export.js.map +0 -1
  998. package/packages/core/dist/plugins/session-insights.d.ts +0 -8
  999. package/packages/core/dist/plugins/session-insights.d.ts.map +0 -1
  1000. package/packages/core/dist/plugins/session-insights.js +0 -47
  1001. package/packages/core/dist/plugins/session-insights.js.map +0 -1
  1002. package/packages/core/dist/plugins/session-search.d.ts +0 -20
  1003. package/packages/core/dist/plugins/session-search.d.ts.map +0 -1
  1004. package/packages/core/dist/plugins/session-search.js +0 -122
  1005. package/packages/core/dist/plugins/session-search.js.map +0 -1
  1006. package/packages/core/dist/plugins/session.d.ts +0 -15
  1007. package/packages/core/dist/plugins/session.d.ts.map +0 -1
  1008. package/packages/core/dist/plugins/session.js +0 -22
  1009. package/packages/core/dist/plugins/session.js.map +0 -1
  1010. package/packages/core/dist/plugins/skill-catalog.d.ts +0 -26
  1011. package/packages/core/dist/plugins/skill-catalog.d.ts.map +0 -1
  1012. package/packages/core/dist/plugins/skill-catalog.js +0 -97
  1013. package/packages/core/dist/plugins/skill-catalog.js.map +0 -1
  1014. package/packages/core/dist/plugins/skill-guard.d.ts +0 -26
  1015. package/packages/core/dist/plugins/skill-guard.d.ts.map +0 -1
  1016. package/packages/core/dist/plugins/skill-guard.js +0 -139
  1017. package/packages/core/dist/plugins/skill-guard.js.map +0 -1
  1018. package/packages/core/dist/plugins/sql-lens.d.ts +0 -8
  1019. package/packages/core/dist/plugins/sql-lens.d.ts.map +0 -1
  1020. package/packages/core/dist/plugins/sql-lens.js +0 -85
  1021. package/packages/core/dist/plugins/sql-lens.js.map +0 -1
  1022. package/packages/core/dist/plugins/stdio.d.ts +0 -8
  1023. package/packages/core/dist/plugins/stdio.d.ts.map +0 -1
  1024. package/packages/core/dist/plugins/stdio.js +0 -22
  1025. package/packages/core/dist/plugins/stdio.js.map +0 -1
  1026. package/packages/core/dist/plugins/synapse.d.ts +0 -38
  1027. package/packages/core/dist/plugins/synapse.d.ts.map +0 -1
  1028. package/packages/core/dist/plugins/synapse.js +0 -93
  1029. package/packages/core/dist/plugins/synapse.js.map +0 -1
  1030. package/packages/core/dist/plugins/tab-manager.d.ts +0 -8
  1031. package/packages/core/dist/plugins/tab-manager.d.ts.map +0 -1
  1032. package/packages/core/dist/plugins/tab-manager.js +0 -135
  1033. package/packages/core/dist/plugins/tab-manager.js.map +0 -1
  1034. package/packages/core/dist/plugins/taskboard.d.ts +0 -15
  1035. package/packages/core/dist/plugins/taskboard.d.ts.map +0 -1
  1036. package/packages/core/dist/plugins/taskboard.js +0 -347
  1037. package/packages/core/dist/plugins/taskboard.js.map +0 -1
  1038. package/packages/core/dist/plugins/telemetry-blocker.d.ts +0 -8
  1039. package/packages/core/dist/plugins/telemetry-blocker.d.ts.map +0 -1
  1040. package/packages/core/dist/plugins/telemetry-blocker.js +0 -57
  1041. package/packages/core/dist/plugins/telemetry-blocker.js.map +0 -1
  1042. package/packages/core/dist/plugins/test-harness.d.ts +0 -8
  1043. package/packages/core/dist/plugins/test-harness.d.ts.map +0 -1
  1044. package/packages/core/dist/plugins/test-harness.js +0 -64
  1045. package/packages/core/dist/plugins/test-harness.js.map +0 -1
  1046. package/packages/core/dist/plugins/theme-studio.d.ts +0 -29
  1047. package/packages/core/dist/plugins/theme-studio.d.ts.map +0 -1
  1048. package/packages/core/dist/plugins/theme-studio.js +0 -141
  1049. package/packages/core/dist/plugins/theme-studio.js.map +0 -1
  1050. package/packages/core/dist/plugins/token-guard.d.ts +0 -15
  1051. package/packages/core/dist/plugins/token-guard.d.ts.map +0 -1
  1052. package/packages/core/dist/plugins/token-guard.js +0 -78
  1053. package/packages/core/dist/plugins/token-guard.js.map +0 -1
  1054. package/packages/core/dist/plugins/tools.d.ts +0 -13
  1055. package/packages/core/dist/plugins/tools.d.ts.map +0 -1
  1056. package/packages/core/dist/plugins/tools.js +0 -20
  1057. package/packages/core/dist/plugins/tools.js.map +0 -1
  1058. package/packages/core/dist/plugins/turn-rewind.d.ts +0 -19
  1059. package/packages/core/dist/plugins/turn-rewind.d.ts.map +0 -1
  1060. package/packages/core/dist/plugins/turn-rewind.js +0 -74
  1061. package/packages/core/dist/plugins/turn-rewind.js.map +0 -1
  1062. package/packages/core/dist/plugins/undo-savepoint.d.ts +0 -17
  1063. package/packages/core/dist/plugins/undo-savepoint.d.ts.map +0 -1
  1064. package/packages/core/dist/plugins/undo-savepoint.js +0 -247
  1065. package/packages/core/dist/plugins/undo-savepoint.js.map +0 -1
  1066. package/packages/core/dist/plugins/vision-toolkit.d.ts +0 -17
  1067. package/packages/core/dist/plugins/vision-toolkit.d.ts.map +0 -1
  1068. package/packages/core/dist/plugins/vision-toolkit.js +0 -145
  1069. package/packages/core/dist/plugins/vision-toolkit.js.map +0 -1
  1070. package/packages/core/dist/plugins/web-research.d.ts +0 -17
  1071. package/packages/core/dist/plugins/web-research.d.ts.map +0 -1
  1072. package/packages/core/dist/plugins/web-research.js +0 -275
  1073. package/packages/core/dist/plugins/web-research.js.map +0 -1
  1074. package/packages/core/dist/plugins/workspace-navigator.d.ts +0 -36
  1075. package/packages/core/dist/plugins/workspace-navigator.d.ts.map +0 -1
  1076. package/packages/core/dist/plugins/workspace-navigator.js +0 -150
  1077. package/packages/core/dist/plugins/workspace-navigator.js.map +0 -1
  1078. package/packages/core/dist/plugins/workspace-search.d.ts +0 -8
  1079. package/packages/core/dist/plugins/workspace-search.d.ts.map +0 -1
  1080. package/packages/core/dist/plugins/workspace-search.js +0 -134
  1081. package/packages/core/dist/plugins/workspace-search.js.map +0 -1
  1082. package/packages/core/dist/plugins/yaml-validator.d.ts +0 -8
  1083. package/packages/core/dist/plugins/yaml-validator.d.ts.map +0 -1
  1084. package/packages/core/dist/plugins/yaml-validator.js +0 -94
  1085. package/packages/core/dist/plugins/yaml-validator.js.map +0 -1
  1086. package/packages/core/dist/profile.d.ts +0 -9
  1087. package/packages/core/dist/profile.d.ts.map +0 -1
  1088. package/packages/core/dist/profile.js +0 -33
  1089. package/packages/core/dist/profile.js.map +0 -1
  1090. package/packages/core/dist/runtime.d.ts +0 -16
  1091. package/packages/core/dist/runtime.d.ts.map +0 -1
  1092. package/packages/core/dist/runtime.js +0 -42
  1093. package/packages/core/dist/runtime.js.map +0 -1
  1094. package/packages/core/dist/services.d.ts +0 -118
  1095. package/packages/core/dist/services.d.ts.map +0 -1
  1096. package/packages/core/dist/services.js +0 -95
  1097. package/packages/core/dist/services.js.map +0 -1
  1098. package/packages/core/dist/stdio.d.ts +0 -36
  1099. package/packages/core/dist/stdio.d.ts.map +0 -1
  1100. package/packages/core/dist/stdio.js +0 -140
  1101. package/packages/core/dist/stdio.js.map +0 -1
  1102. package/packages/core/dist/workspace-path.d.ts +0 -12
  1103. package/packages/core/dist/workspace-path.d.ts.map +0 -1
  1104. package/packages/core/dist/workspace-path.js +0 -62
  1105. package/packages/core/dist/workspace-path.js.map +0 -1
  1106. package/packages/core/package.json +0 -42
  1107. package/packages/core/profiles/default/cordis.yml +0 -120
  1108. package/packages/core/profiles/development/cordis.yml +0 -47
  1109. package/packages/core/src/boot.ts +0 -143
  1110. package/packages/core/src/config.ts +0 -6
  1111. package/packages/core/src/context.ts +0 -3
  1112. package/packages/core/src/http.ts +0 -32
  1113. package/packages/core/src/index.ts +0 -8
  1114. package/packages/core/src/plugins/agent-teams.ts +0 -291
  1115. package/packages/core/src/plugins/anchored-standard.ts +0 -88
  1116. package/packages/core/src/plugins/annotation.ts +0 -106
  1117. package/packages/core/src/plugins/archify.ts +0 -124
  1118. package/packages/core/src/plugins/at-file.ts +0 -54
  1119. package/packages/core/src/plugins/auto-mode.ts +0 -123
  1120. package/packages/core/src/plugins/better-sidebar.ts +0 -117
  1121. package/packages/core/src/plugins/browser-fetch.ts +0 -171
  1122. package/packages/core/src/plugins/browser-session.ts +0 -287
  1123. package/packages/core/src/plugins/canvas-draw.ts +0 -90
  1124. package/packages/core/src/plugins/change-verifier.ts +0 -79
  1125. package/packages/core/src/plugins/cleaner.ts +0 -61
  1126. package/packages/core/src/plugins/cli-notifier.ts +0 -125
  1127. package/packages/core/src/plugins/code2skill.ts +0 -96
  1128. package/packages/core/src/plugins/colleague-skill.ts +0 -122
  1129. package/packages/core/src/plugins/context-doctor.ts +0 -117
  1130. package/packages/core/src/plugins/context.ts +0 -102
  1131. package/packages/core/src/plugins/cost-meter.ts +0 -231
  1132. package/packages/core/src/plugins/dependency-checker.ts +0 -241
  1133. package/packages/core/src/plugins/docker-sandbox.ts +0 -100
  1134. package/packages/core/src/plugins/fail-logger.ts +0 -51
  1135. package/packages/core/src/plugins/genui.ts +0 -88
  1136. package/packages/core/src/plugins/git-time-capsule.ts +0 -97
  1137. package/packages/core/src/plugins/graph-memory.ts +0 -394
  1138. package/packages/core/src/plugins/history-compressor.ts +0 -81
  1139. package/packages/core/src/plugins/hol-guard.ts +0 -153
  1140. package/packages/core/src/plugins/i18n-pair.ts +0 -82
  1141. package/packages/core/src/plugins/image-compressor.ts +0 -144
  1142. package/packages/core/src/plugins/llm-verifier.ts +0 -164
  1143. package/packages/core/src/plugins/mcp-client.ts +0 -559
  1144. package/packages/core/src/plugins/mcp-panel.ts +0 -190
  1145. package/packages/core/src/plugins/memory.ts +0 -176
  1146. package/packages/core/src/plugins/mirage-bridge.ts +0 -179
  1147. package/packages/core/src/plugins/mock-server.ts +0 -158
  1148. package/packages/core/src/plugins/model.ts +0 -14
  1149. package/packages/core/src/plugins/models.ts +0 -35
  1150. package/packages/core/src/plugins/modlens.ts +0 -63
  1151. package/packages/core/src/plugins/module-search.ts +0 -201
  1152. package/packages/core/src/plugins/obsidian-sync.ts +0 -83
  1153. package/packages/core/src/plugins/openpets.ts +0 -109
  1154. package/packages/core/src/plugins/plan-execute.ts +0 -76
  1155. package/packages/core/src/plugins/plugin-check.ts +0 -232
  1156. package/packages/core/src/plugins/plugin-dev.ts +0 -47
  1157. package/packages/core/src/plugins/plugin-finder.ts +0 -108
  1158. package/packages/core/src/plugins/plugin-radar.ts +0 -179
  1159. package/packages/core/src/plugins/plugin-stars.ts +0 -205
  1160. package/packages/core/src/plugins/prompt-guard.ts +0 -122
  1161. package/packages/core/src/plugins/prompt-library.ts +0 -165
  1162. package/packages/core/src/plugins/readme-gen.ts +0 -147
  1163. package/packages/core/src/plugins/recall-unread.ts +0 -142
  1164. package/packages/core/src/plugins/resources.ts +0 -78
  1165. package/packages/core/src/plugins/reverse-skill.ts +0 -79
  1166. package/packages/core/src/plugins/reviewer-bot.ts +0 -146
  1167. package/packages/core/src/plugins/runtime-doctor.ts +0 -137
  1168. package/packages/core/src/plugins/runtime.ts +0 -141
  1169. package/packages/core/src/plugins/secure-audit.ts +0 -146
  1170. package/packages/core/src/plugins/session-bookmarks.ts +0 -89
  1171. package/packages/core/src/plugins/session-bridge.ts +0 -299
  1172. package/packages/core/src/plugins/session-compare.ts +0 -180
  1173. package/packages/core/src/plugins/session-export.ts +0 -99
  1174. package/packages/core/src/plugins/session-insights.ts +0 -47
  1175. package/packages/core/src/plugins/session-search.ts +0 -126
  1176. package/packages/core/src/plugins/session.ts +0 -33
  1177. package/packages/core/src/plugins/skill-catalog.ts +0 -117
  1178. package/packages/core/src/plugins/skill-guard.ts +0 -152
  1179. package/packages/core/src/plugins/sql-lens.ts +0 -92
  1180. package/packages/core/src/plugins/stdio.ts +0 -22
  1181. package/packages/core/src/plugins/synapse.ts +0 -130
  1182. package/packages/core/src/plugins/tab-manager.ts +0 -135
  1183. package/packages/core/src/plugins/taskboard.ts +0 -412
  1184. package/packages/core/src/plugins/telemetry-blocker.ts +0 -62
  1185. package/packages/core/src/plugins/test-harness.ts +0 -67
  1186. package/packages/core/src/plugins/theme-studio.ts +0 -165
  1187. package/packages/core/src/plugins/token-guard.ts +0 -84
  1188. package/packages/core/src/plugins/tools.ts +0 -26
  1189. package/packages/core/src/plugins/turn-rewind.ts +0 -86
  1190. package/packages/core/src/plugins/undo-savepoint.ts +0 -284
  1191. package/packages/core/src/plugins/vision-toolkit.ts +0 -153
  1192. package/packages/core/src/plugins/web-research.ts +0 -289
  1193. package/packages/core/src/plugins/workspace-navigator.ts +0 -164
  1194. package/packages/core/src/plugins/workspace-search.ts +0 -139
  1195. package/packages/core/src/plugins/yaml-validator.ts +0 -97
  1196. package/packages/core/src/profile.ts +0 -37
  1197. package/packages/core/src/runtime.ts +0 -46
  1198. package/packages/core/src/services.ts +0 -212
  1199. package/packages/core/src/stdio.ts +0 -160
  1200. package/packages/core/src/workspace-path.ts +0 -69
  1201. package/packages/core/test/agent-teams.test.ts +0 -24
  1202. package/packages/core/test/archify.test.ts +0 -33
  1203. package/packages/core/test/better-sidebar.test.ts +0 -125
  1204. package/packages/core/test/boot.test.ts +0 -137
  1205. package/packages/core/test/colleague-skill.test.ts +0 -74
  1206. package/packages/core/test/config.test.ts +0 -139
  1207. package/packages/core/test/context-doctor.test.ts +0 -32
  1208. package/packages/core/test/dependency-checker.test.ts +0 -60
  1209. package/packages/core/test/git-time-capsule.test.ts +0 -115
  1210. package/packages/core/test/http.test.ts +0 -36
  1211. package/packages/core/test/llm-verifier.test.ts +0 -72
  1212. package/packages/core/test/mirage-bridge.test.ts +0 -54
  1213. package/packages/core/test/module-search.test.ts +0 -78
  1214. package/packages/core/test/plugin-check.test.ts +0 -16
  1215. package/packages/core/test/plugin-stars.test.ts +0 -55
  1216. package/packages/core/test/profile.test.ts +0 -39
  1217. package/packages/core/test/profiles.integration.test.ts +0 -127
  1218. package/packages/core/test/prompt-library.test.ts +0 -56
  1219. package/packages/core/test/readme-gen.test.ts +0 -45
  1220. package/packages/core/test/recall-unread.test.ts +0 -35
  1221. package/packages/core/test/registry.test.ts +0 -48
  1222. package/packages/core/test/reverse-skill.test.ts +0 -40
  1223. package/packages/core/test/runtime-doctor.test.ts +0 -55
  1224. package/packages/core/test/runtime-fixture.ts +0 -46
  1225. package/packages/core/test/runtime.test.ts +0 -160
  1226. package/packages/core/test/secure-audit.test.ts +0 -16
  1227. package/packages/core/test/services.test.ts +0 -2150
  1228. package/packages/core/test/session-bookmarks.test.ts +0 -62
  1229. package/packages/core/test/session-bridge.test.ts +0 -103
  1230. package/packages/core/test/session-compare.test.ts +0 -94
  1231. package/packages/core/test/session-export.test.ts +0 -54
  1232. package/packages/core/test/session-search.test.ts +0 -30
  1233. package/packages/core/test/skill-catalog.test.ts +0 -18
  1234. package/packages/core/test/skill-guard.test.ts +0 -21
  1235. package/packages/core/test/stdio-args.test.ts +0 -178
  1236. package/packages/core/test/stdio.test.ts +0 -87
  1237. package/packages/core/test/theme-studio.test.ts +0 -39
  1238. package/packages/core/test/token-guard.test.ts +0 -34
  1239. package/packages/core/test/turn-rewind.test.ts +0 -19
  1240. package/packages/core/test/vision-toolkit.test.ts +0 -38
  1241. package/packages/core/test/workspace-git-status.test.ts +0 -37
  1242. package/packages/core/test/workspace-navigator.test.ts +0 -33
  1243. package/packages/core/test/workspace-path.test.ts +0 -34
  1244. package/packages/core/tsconfig.build.json +0 -8
  1245. package/packages/core/tsconfig.json +0 -7
@@ -1,2600 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
- import { createPortal } from "react-dom";
4
- import { createClientApi, failedRefreshLabels, } from "./control-room.js";
5
- import { getPromptCompletion, replacePromptCompletion } from "./prompt-completion.js";
6
- import { compactThinkingEvents } from "./runtime-events.js";
7
- import { MarkdownMessage } from "./markdown.js";
8
- import { messageText, projectChatTurns } from "./message-content.js";
9
- import { formatAnnotationPrompt, parseAnnotationPrompt } from "./annotation-ui.js";
10
- import { marketplaceCategoryTabs, marketplaceDetailPath, marketplaceStatisticItems, readMarketplaceDetailId } from "./marketplace-navigation.js";
11
- import { loadMarketplaceCatalog } from "./marketplace-catalog.js";
12
- import { pluginStarsRows } from "./plugin-stars-view.js";
13
- import { browserSessionTabs } from "./browser-session-view.js";
14
- import { matchesPluginQuery } from "./plugin-search.js";
15
- import { readInstalledPluginDetailId } from "./plugin-navigation.js";
16
- import { installedPluginCardContent } from "./plugin-card.js";
17
- const value = (input, fallback = "—") => {
18
- if (input === undefined || input === null || input === "")
19
- return fallback;
20
- if (typeof input === "string" || typeof input === "number" || typeof input === "boolean" || typeof input === "bigint")
21
- return String(input);
22
- try {
23
- return JSON.stringify(input);
24
- }
25
- catch {
26
- return fallback;
27
- }
28
- };
29
- const dialogFocusSelector = [
30
- "button:not([disabled])",
31
- "a[href]",
32
- "input:not([disabled])",
33
- "select:not([disabled])",
34
- "textarea:not([disabled])",
35
- "summary",
36
- '[tabindex]:not([tabindex="-1"])',
37
- ].join(",");
38
- function useModalFocus(open, onClose, busy = false, returnFocusSelector) {
39
- const dialogRef = useRef(null);
40
- const closeRef = useRef(onClose);
41
- const busyRef = useRef(busy);
42
- closeRef.current = onClose;
43
- busyRef.current = busy;
44
- useEffect(() => {
45
- if (!open)
46
- return;
47
- const activeElement = document.activeElement;
48
- const previous = activeElement instanceof HTMLElement && activeElement !== document.body && activeElement !== document.documentElement ? activeElement : undefined;
49
- const focusable = () => Array.from(dialogRef.current?.querySelectorAll(dialogFocusSelector) ?? []).filter((element) => !element.hidden && element.getAttribute("aria-hidden") !== "true" && element.getClientRects().length > 0);
50
- const frame = window.requestAnimationFrame(() => {
51
- const dialog = dialogRef.current;
52
- if (!dialog || dialog.contains(document.activeElement))
53
- return;
54
- (dialog.querySelector("[data-dialog-initial-focus]") ?? focusable()[0])?.focus();
55
- });
56
- const onKeyDown = (event) => {
57
- if (event.key === "Escape") {
58
- event.preventDefault();
59
- event.stopImmediatePropagation();
60
- if (!busyRef.current)
61
- closeRef.current();
62
- return;
63
- }
64
- if (event.key !== "Tab")
65
- return;
66
- const items = focusable();
67
- if (!items.length) {
68
- event.preventDefault();
69
- dialogRef.current?.focus();
70
- return;
71
- }
72
- const first = items[0];
73
- const last = items.at(-1);
74
- if (event.shiftKey && document.activeElement === first) {
75
- event.preventDefault();
76
- last?.focus();
77
- }
78
- else if (!event.shiftKey && document.activeElement === last) {
79
- event.preventDefault();
80
- first?.focus();
81
- }
82
- };
83
- window.addEventListener("keydown", onKeyDown, true);
84
- return () => {
85
- window.cancelAnimationFrame(frame);
86
- window.removeEventListener("keydown", onKeyDown, true);
87
- const returnFocus = previous?.isConnected ? previous : returnFocusSelector ? document.querySelector(returnFocusSelector) : undefined;
88
- if (returnFocus)
89
- window.requestAnimationFrame(() => returnFocus.focus());
90
- };
91
- }, [open, returnFocusSelector]);
92
- return dialogRef;
93
- }
94
- const sessionSource = (status, session) => status?.cwd ?? (typeof session?.sessionFile === "string" ? session.sessionFile : "未选择工作区");
95
- const eventLabel = (event) => {
96
- const type = value(event.type, "");
97
- if (type === "file_diff")
98
- return "文件差异";
99
- if (type === "file")
100
- return "文件详情";
101
- return value(event.summary ?? event.message ?? event.toolName ?? event.type ?? event.event, "未命名事件");
102
- };
103
- const capability = (name) => {
104
- const entries = [
105
- ["context", "上下文"],
106
- ["agent-teams", "协作"],
107
- ["modlens", "视觉"],
108
- ["token-guard", "预算"],
109
- ["git-time-capsule", "版本控制"],
110
- ["dependency-checker", "工程诊断"],
111
- ["at-file", "文件上下文"],
112
- ["test-harness", "测试"],
113
- ["session-insights", "会话统计"],
114
- ["session-compare", "会话对比"],
115
- ["secure-audit", "安全审计"],
116
- ["readme-gen", "文档生成"],
117
- ["i18n-pair", "国际化"],
118
- ["cleaner", "清理"],
119
- ["sql-lens", "数据库"],
120
- ["docker-sandbox", "沙箱"],
121
- ["mcp-client", "工具协议"],
122
- ["mcp-panel", "MCP 控制台"],
123
- ["browser-fetch", "网页抓取"],
124
- ["web-research", "联网研究"],
125
- ["browser-session", "浏览器会话"],
126
- ["yaml-validator", "配置校验"],
127
- ["mock-server", "接口模拟"],
128
- ["cli-notifier", "桌面通知"],
129
- ["obsidian-sync", "知识库"],
130
- ["context-doctor", "上下文诊断"],
131
- ["history-compressor", "历史压缩"],
132
- ["reviewer-bot", "代码审查"],
133
- ["auto-mode", "安全执行"],
134
- ["plan-execute", "计划执行"],
135
- ["plugin-finder", "插件发现"],
136
- ["taskboard", "任务看板"],
137
- ["synapse", "会话地图"],
138
- ["hol-guard", "安全防护"],
139
- ["plugin-radar", "生态雷达"],
140
- ["plugin-stars", "排行榜"],
141
- ["plugin-check", "插件体检"],
142
- ["annotation", "批注上下文"],
143
- ["cost-meter", "成本账本"],
144
- ["undo-savepoint", "恢复保存点"],
145
- ["skill-catalog", "技能目录"],
146
- ["graph-memory", "知识图谱"],
147
- ["memory", "跨会话记忆"],
148
- ["canvas-draw", "流程图"],
149
- ["image-compressor", "图片压缩"],
150
- ["workspace-search", "工作区检索"],
151
- ["prompt-guard", "提示词防护"],
152
- ["code2skill", "技能打包"],
153
- ["tab-manager", "会话标签"],
154
- ["genui", "结构化界面"],
155
- ["anchored-standard", "轨迹锚定"],
156
- ["telemetry-blocker", "遥测拦截"],
157
- ["change-verifier", "变更门禁"],
158
- ["plugin-dev", "插件开发"],
159
- ["openpets", "桌面伙伴"],
160
- ["vision-toolkit", "视觉素材"],
161
- ["session-bridge", "会话交接"],
162
- ["skill-guard", "Skill 安全"],
163
- ["recall-unread", "会话召回"],
164
- ["turn-rewind", "会话回退"],
165
- ["session-export", "会话导出"],
166
- ["session-search", "会话搜索"],
167
- ["session-bookmarks", "会话书签"],
168
- ["llm-verifier", "模型校验"],
169
- ["module-search", "模块检索"],
170
- ["workspace-navigator", "工作区导航"],
171
- ["better-sidebar", "侧栏概览"],
172
- ["archify", "架构地图"],
173
- ["mirage-bridge", "Mirage 虚拟终端"],
174
- ["theme-studio", "主题"],
175
- ["reverse-skill", "技能隔离"],
176
- ["colleague-skill", "角色交接"],
177
- ["prompt-library", "提示词库"],
178
- ["model", "模型"],
179
- ["tool", "工具"],
180
- ["session", "会话"],
181
- ["resource", "资源"],
182
- ["web", "界面"],
183
- ["gateway", "界面"],
184
- ];
185
- return entries.find(([needle]) => name.includes(needle))?.[1] ?? "运行时";
186
- };
187
- const displayPluginName = (name) => {
188
- const officialName = new Map([
189
- ["@pi-harness/core/plugins/context", "Context insights"],
190
- ["@pi-harness/core/plugins/agent-teams", "Agent Teams"],
191
- ["@pi-harness/core/plugins/modlens", "ModLens vision bridge"],
192
- ["@pi-harness/core/plugins/token-guard", "Token Guard"],
193
- ["@pi-harness/core/plugins/git-time-capsule", "Git Time Capsule"],
194
- ["@pi-harness/core/plugins/dependency-checker", "Dependency Checker"],
195
- ["@pi-harness/core/plugins/at-file", "@file context"],
196
- ["@pi-harness/core/plugins/fail-logger", "Failure Logger"],
197
- ["@pi-harness/core/plugins/test-harness", "Test Harness"],
198
- ["@pi-harness/core/plugins/session-insights", "Session Insights"],
199
- ["@pi-harness/core/plugins/session-compare", "Session Compare"],
200
- ["@pi-harness/core/plugins/secure-audit", "Secure Audit"],
201
- ["@pi-harness/core/plugins/readme-gen", "README Generator"],
202
- ["@pi-harness/core/plugins/i18n-pair", "I18n Pair"],
203
- ["@pi-harness/core/plugins/cleaner", "Harness Cleaner"],
204
- ["@pi-harness/core/plugins/sql-lens", "SQL Lens"],
205
- ["@pi-harness/core/plugins/docker-sandbox", "Docker Sandbox"],
206
- ["@pi-harness/core/plugins/mcp-client", "MCP Client"],
207
- ["@pi-harness/core/plugins/mcp-panel", "MCP Console"],
208
- ["@pi-harness/core/plugins/browser-fetch", "Browser Fetch"],
209
- ["@pi-harness/core/plugins/web-research", "Web Research"],
210
- ["@pi-harness/core/plugins/browser-session", "Browser Session"],
211
- ["@pi-harness/core/plugins/yaml-validator", "YAML Validator"],
212
- ["@pi-harness/core/plugins/mock-server", "Mock Server"],
213
- ["@pi-harness/core/plugins/cli-notifier", "CLI Notifier"],
214
- ["@pi-harness/core/plugins/obsidian-sync", "Obsidian Sync"],
215
- ["@pi-harness/core/plugins/context-doctor", "Context Doctor"],
216
- ["@pi-harness/core/plugins/history-compressor", "History Compressor"],
217
- ["@pi-harness/core/plugins/reviewer-bot", "Reviewer Bot"],
218
- ["@pi-harness/core/plugins/auto-mode", "Auto Mode"],
219
- ["@pi-harness/core/plugins/plan-execute", "Plan Execute"],
220
- ["@pi-harness/core/plugins/plugin-finder", "Plugin Finder"],
221
- ["@pi-harness/core/plugins/taskboard", "Taskboard"],
222
- ["@pi-harness/core/plugins/synapse", "Synapse"],
223
- ["@pi-harness/core/plugins/hol-guard", "HOL Guard"],
224
- ["@pi-harness/core/plugins/plugin-radar", "Plugin Radar"],
225
- ["@pi-harness/core/plugins/plugin-check", "Plugin Check"],
226
- ["@pi-harness/core/plugins/annotation", "Annotations"],
227
- ["@pi-harness/core/plugins/cost-meter", "Cost Meter"],
228
- ["@pi-harness/core/plugins/undo-savepoint", "Undo Savepoints"],
229
- ["@pi-harness/core/plugins/skill-catalog", "Skills Catalog"],
230
- ["@pi-harness/core/plugins/memory", "Memory"],
231
- ["@pi-harness/core/plugins/graph-memory", "Graph Memory"],
232
- ["@pi-harness/core/plugins/canvas-draw", "Canvas Draw"],
233
- ["@pi-harness/core/plugins/image-compressor", "Image Compressor"],
234
- ["@pi-harness/core/plugins/workspace-search", "Workspace Search"],
235
- ["@pi-harness/core/plugins/prompt-guard", "Prompt Guard"],
236
- ["@pi-harness/core/plugins/code2skill", "Code2Skill"],
237
- ["@pi-harness/core/plugins/tab-manager", "Session Tabs"],
238
- ["@pi-harness/core/plugins/genui", "GenUI"],
239
- ["@pi-harness/core/plugins/anchored-standard", "Anchored Standard"],
240
- ["@pi-harness/core/plugins/telemetry-blocker", "Telemetry Blocker"],
241
- ["@pi-harness/core/plugins/change-verifier", "Change Verifier"],
242
- ["@pi-harness/core/plugins/plugin-dev", "Plugin Dev"],
243
- ["@pi-harness/core/plugins/openpets", "OpenPets"],
244
- ["@pi-harness/core/plugins/vision-toolkit", "Vision Toolkit"],
245
- ["@pi-harness/core/plugins/plugin-stars", "Plugin Stars"],
246
- ["@pi-harness/core/plugins/session-bridge", "Session Bridge"],
247
- ["@pi-harness/core/plugins/skill-guard", "Skill Guard"],
248
- ["@pi-harness/core/plugins/recall-unread", "Recall Unread"],
249
- ["@pi-harness/core/plugins/turn-rewind", "Turn Rewind"],
250
- ["@pi-harness/core/plugins/session-export", "Session Export"],
251
- ["@pi-harness/core/plugins/session-search", "Session Search"],
252
- ["@pi-harness/core/plugins/session-bookmarks", "Session Bookmarks"],
253
- ["@pi-harness/core/plugins/llm-verifier", "LLM Verifier"],
254
- ["@pi-harness/core/plugins/module-search", "Module Search"],
255
- ["@pi-harness/core/plugins/workspace-navigator", "Workspace Navigator"],
256
- ["@pi-harness/core/plugins/better-sidebar", "Better Sidebar"],
257
- ["@pi-harness/core/plugins/archify", "Architecture Map"],
258
- ["@pi-harness/core/plugins/mirage-bridge", "Mirage Bridge"],
259
- ["@pi-harness/core/plugins/theme-studio", "Theme Studio"],
260
- ["@pi-harness/core/plugins/reverse-skill", "Reverse Skill Firewall"],
261
- ["@pi-harness/core/plugins/colleague-skill", "Colleague Skill"],
262
- ["@pi-harness/core/plugins/prompt-library", "Prompt Library"],
263
- ["@pi-harness/core/plugins/runtime-doctor", "Runtime Doctor"],
264
- ]).get(name);
265
- if (officialName !== undefined)
266
- return officialName;
267
- const packageMatch = name.match(/^@[^/]+\/cordis-plugin-(.+)$/i);
268
- if (packageMatch)
269
- return `官方 · ${packageMatch[1]}`;
270
- if (name.toLowerCase().includes("cordis"))
271
- return name.replace(/cordis/gi, "runtime");
272
- return name;
273
- };
274
- const readQueryState = () => {
275
- if (typeof window === "undefined")
276
- return {
277
- page: "session",
278
- view: "chat",
279
- marketplaceQuery: "",
280
- marketplaceCapability: "",
281
- marketplaceCategory: "",
282
- marketplacePlugin: undefined,
283
- installedPlugin: undefined,
284
- marketplacePage: 0,
285
- };
286
- const params = new URLSearchParams(window.location.search);
287
- const page = params.get("page");
288
- const view = params.get("view");
289
- const settings = params.get("settings");
290
- const parsedPage = page === "plugins" || page === "marketplace" ? page : "session";
291
- const parsedView = view === "trajectory" || view === "files" ? view : "chat";
292
- const parsedSettings = settings === "providers" || settings === "toml" ? settings : settings === "general" ? settings : undefined;
293
- const pageNumber = Number.parseInt(params.get("marketplacePage") ?? "0", 10);
294
- return {
295
- page: parsedPage,
296
- view: parsedView,
297
- settings: parsedSettings,
298
- sessionPath: params.get("session") ?? undefined,
299
- marketplaceQuery: params.get("marketplaceQuery") ?? "",
300
- marketplaceCapability: params.get("capability") ?? "",
301
- marketplaceCategory: params.get("category") ?? "",
302
- marketplacePlugin: readMarketplaceDetailId(params),
303
- installedPlugin: readInstalledPluginDetailId(params),
304
- marketplacePage: Number.isFinite(pageNumber) && pageNumber >= 0 ? pageNumber : 0,
305
- };
306
- };
307
- function sessionGroups(sessions) {
308
- const now = new Date();
309
- const start = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
310
- const yesterday = start - 86_400_000;
311
- const groups = new Map();
312
- for (const session of sessions) {
313
- const raw = session.modified ?? session.created;
314
- const timestamp = typeof raw === "number" ? raw : typeof raw === "string" ? Date.parse(raw) : Number.NaN;
315
- const label = Number.isFinite(timestamp) && timestamp >= start ? "今天" : Number.isFinite(timestamp) && timestamp >= yesterday ? "昨天" : "更早";
316
- groups.set(label, [...(groups.get(label) ?? []), session]);
317
- }
318
- return ["今天", "昨天", "更早"].flatMap((label) => {
319
- const items = groups.get(label);
320
- return items?.length ? [[label, items]] : [];
321
- });
322
- }
323
- function Workspace({ status, workspaces, onCreate, onStarter, onToml, }) {
324
- const starters = [
325
- ["定位问题", "分析当前仓库并给出根因"],
326
- ["修复并测试", "实现修复并运行相关测试"],
327
- ["审查改动", "只读检查未提交变更"],
328
- ["解释代码", "解释当前文件的关键逻辑"],
329
- ];
330
- return (_jsxs("div", { className: "new-session-screen", children: [_jsx("div", { className: "welcome-kicker", children: "PI AGENT HARNESS \u00B7 REAL RUNTIME" }), _jsxs("div", { className: "welcome-heading", children: [_jsx("span", { className: "pi-mark large", "aria-hidden": "true", children: _jsx("img", { src: "/icons/svg/mark-white.svg", alt: "" }) }), _jsxs("div", { children: [_jsx("h2", { children: "\u5F00\u59CB\u4E00\u4E2A\u5DE5\u4F5C\u4F1A\u8BDD" }), _jsx("p", { children: "\u8FDE\u63A5\u5F53\u524D\u5DE5\u4F5C\u533A\uFF0C\u76F4\u63A5\u8BA9 Pi agent \u8BFB\u53D6\u3001\u4FEE\u6539\u5E76\u9A8C\u8BC1\u4EE3\u7801\u3002" })] })] }), _jsx("div", { className: "workspace-picker", children: workspaces.length ? (workspaces.map((workspace) => (_jsxs("button", { className: "workspace-row", onClick: () => onCreate(workspace), type: "button", children: [_jsx("span", { className: `workspace-status ${workspace.current ? "live" : "offline"}`, children: workspace.current ? "已连接" : "工作区" }), _jsxs("span", { children: [_jsx("code", { children: workspace.path }), _jsx("small", { children: workspace.current && status ? `${workspace.branch} · ${status.model}` : workspace.branch })] }), _jsx("span", { className: "workspace-arrow", children: "\u2197" })] }, workspace.path)))) : (_jsxs("div", { className: "workspace-row is-empty", children: [_jsx("span", { className: "workspace-status offline", children: "\u52A0\u8F7D\u4E2D" }), _jsxs("span", { children: [_jsx("code", { children: status?.cwd ?? "加载工作区…" }), _jsx("small", { children: "\u6B63\u5728\u8BFB\u53D6 git worktree" })] })] })) }), _jsxs("div", { className: "effective-config", children: [_jsx("span", { className: "config-label", children: "\u5F53\u524D\u8FD0\u884C\u65F6" }), _jsx("span", { children: status?.model ?? "由运行时提供" }), _jsx("span", { children: status ? `${status.messages} 条消息` : "—" }), _jsx("a", { href: "#", onClick: (event) => {
331
- event.preventDefault();
332
- onToml();
333
- }, children: "\u6539\u914D\u7F6E \u2318," })] }), _jsx("div", { className: "starter-grid", children: starters.map(([title, prompt]) => (_jsxs("button", { className: "starter-card", onClick: () => onStarter(prompt), type: "button", children: [_jsx("strong", { children: title }), _jsx("small", { children: prompt })] }, title))) })] }));
334
- }
335
- function WorkspaceChooser({ workspaces, onSelect, onPickDirectory, onClose, error, }) {
336
- const dialogRef = useModalFocus(true, onClose);
337
- return (_jsx("div", { className: "workspace-chooser", onClick: onClose, children: _jsxs("div", { "aria-label": "\u9009\u62E9\u5DE5\u4F5C\u533A", "aria-modal": "true", className: "workspace-chooser-dialog", onClick: (event) => event.stopPropagation(), ref: dialogRef, role: "dialog", tabIndex: -1, children: [_jsxs("div", { className: "workspace-chooser-heading", children: [_jsx("strong", { children: "\u65B0\u5EFA\u4F1A\u8BDD" }), _jsx("button", { "aria-label": "\u5173\u95ED\u5DE5\u4F5C\u533A\u9009\u62E9", onClick: onClose, type: "button", children: "\u00D7" })] }), _jsx("small", { children: "\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u8981\u4F7F\u7528\u7684\u5DE5\u4F5C\u533A" }), error ? (_jsx("div", { className: "workspace-chooser-error", role: "alert", children: error })) : null, _jsxs("button", { className: "workspace-pick-directory", "data-dialog-initial-focus": true, onClick: () => void onPickDirectory(), type: "button", children: [_jsx("span", { children: "\u6253\u5F00\u76EE\u5F55" }), _jsx("small", { children: "\u4ECE Finder \u9009\u62E9\u4E00\u4E2A\u65B0\u7684\u5DE5\u4F5C\u76EE\u5F55" })] }), _jsx("div", { className: "workspace-chooser-divider", children: _jsx("span", { children: "\u6216\u9009\u62E9\u5DF2\u6709 worktree" }) }), workspaces.length ? (workspaces.map((workspace) => (_jsxs("button", { className: "workspace-chooser-row", onClick: () => onSelect(workspace), type: "button", children: [_jsx("span", { className: `workspace-status ${workspace.current ? "live" : "offline"}`, children: workspace.current ? "当前" : "worktree" }), _jsxs("span", { children: [_jsx("strong", { children: workspace.name }), _jsx("code", { children: workspace.path })] }), _jsx("small", { children: workspace.branch })] }, workspace.path)))) : (_jsx("span", { className: "workspace-chooser-empty", children: "\u6B63\u5728\u8BFB\u53D6 git worktree\u2026" }))] }) }));
338
- }
339
- function SessionDialog({ kind, name, count, value: draft, busy, onChange, onClose, onConfirm, }) {
340
- const destructive = kind === "delete" || kind === "batch-delete";
341
- const title = kind === "rename" ? "重命名会话" : kind === "archive" ? "归档会话" : destructive ? "删除会话" : "会话操作";
342
- const description = kind === "rename"
343
- ? "给这个会话一个容易识别的名称。"
344
- : kind === "archive"
345
- ? "归档后会从默认列表隐藏,之后仍可在会话工具中恢复。"
346
- : `将永久删除${count && count > 1 ? ` ${count} 个会话` : "这个会话"}及其本地记录,此操作不可撤销。`;
347
- const dialogRef = useModalFocus(true, onClose, busy, ".session-menu");
348
- return (_jsx("div", { className: "session-dialog-backdrop", onClick: () => {
349
- if (!busy)
350
- onClose();
351
- }, children: _jsxs("div", { "aria-label": title, "aria-modal": "true", className: "session-dialog", onClick: (event) => event.stopPropagation(), ref: dialogRef, role: "dialog", tabIndex: -1, children: [_jsxs("header", { className: "session-dialog-header", children: [_jsxs("div", { children: [_jsx("strong", { children: title }), _jsx("small", { children: description })] }), _jsx("button", { "aria-label": "\u5173\u95ED", disabled: busy, onClick: onClose, type: "button", children: "\u00D7" })] }), kind === "rename" && (_jsxs("label", { className: "session-dialog-field", children: [_jsx("span", { children: "\u540D\u79F0" }), _jsx("input", { "data-dialog-initial-focus": true, disabled: busy, onChange: (event) => onChange(event.target.value), onKeyDown: (event) => event.key === "Enter" && !busy && onConfirm(), value: draft })] })), name && kind !== "rename" && _jsx("div", { className: "session-dialog-target", children: name }), _jsxs("footer", { className: "session-dialog-actions", children: [_jsx("button", { "data-dialog-initial-focus": kind !== "rename" ? "" : undefined, disabled: busy, onClick: onClose, type: "button", children: "\u53D6\u6D88" }), _jsx("button", { className: destructive ? "danger" : "primary", disabled: busy || (kind === "rename" && !draft.trim()), onClick: onConfirm, type: "button", children: busy ? "处理中…" : kind === "rename" ? "保存名称" : kind === "archive" ? "归档" : "永久删除" })] })] }) }));
352
- }
353
- function ConfirmDialog({ title, description, target, confirmLabel, busy, onClose, onConfirm, }) {
354
- const dialogRef = useModalFocus(true, onClose, busy);
355
- return (_jsx("div", { className: "session-dialog-backdrop", onClick: () => {
356
- if (!busy)
357
- onClose();
358
- }, children: _jsxs("div", { "aria-label": title, "aria-modal": "true", className: "session-dialog", onClick: (event) => event.stopPropagation(), ref: dialogRef, role: "dialog", tabIndex: -1, children: [_jsxs("header", { className: "session-dialog-header", children: [_jsxs("div", { children: [_jsx("strong", { children: title }), _jsx("small", { children: description })] }), _jsx("button", { "aria-label": "\u5173\u95ED", disabled: busy, onClick: onClose, type: "button", children: "\u00D7" })] }), target && _jsx("div", { className: "session-dialog-target", children: target }), _jsxs("footer", { className: "session-dialog-actions", children: [_jsx("button", { "data-dialog-initial-focus": true, disabled: busy, onClick: onClose, type: "button", children: "\u53D6\u6D88" }), _jsx("button", { className: "danger", disabled: busy, onClick: onConfirm, type: "button", children: busy ? "处理中…" : confirmLabel })] })] }) }));
359
- }
360
- function SessionActionMenu({ busy, position, onRename, onFork, onArchive, onDelete, }) {
361
- return createPortal(_jsxs("div", { className: "session-row-menu-popover", "data-session-popover": true, onClick: (event) => event.stopPropagation(), role: "menu", style: position, children: [_jsx("button", { autoFocus: true, disabled: busy, onClick: onRename, role: "menuitem", type: "button", children: "\u91CD\u547D\u540D" }), _jsx("button", { disabled: busy, onClick: onFork, role: "menuitem", type: "button", children: "\u590D\u5236\u4F1A\u8BDD" }), _jsx("button", { disabled: busy, onClick: onArchive, role: "menuitem", type: "button", children: "\u5F52\u6863\u4F1A\u8BDD" }), _jsx("button", { className: "danger", disabled: busy, onClick: onDelete, role: "menuitem", type: "button", children: "\u5220\u9664\u4F1A\u8BDD" })] }), document.body);
362
- }
363
- const sidebarPopoverPosition = (trigger, width, estimatedHeight, placement) => {
364
- const rect = trigger.getBoundingClientRect();
365
- const gutter = 8;
366
- const spaceOnRight = window.innerWidth - rect.right - gutter;
367
- const left = spaceOnRight >= width ? rect.right + gutter : Math.max(gutter, rect.left - width - gutter);
368
- const preferredTop = placement === "below" ? rect.bottom + 6 : rect.top - 4;
369
- return {
370
- left: Math.round(left),
371
- top: Math.round(Math.min(Math.max(gutter, preferredTop), Math.max(gutter, window.innerHeight - estimatedHeight - gutter))),
372
- };
373
- };
374
- function PromptError({ message }) {
375
- const everyApiAuth = /No API key found for everyapi/i.test(message);
376
- const requiresAuth = everyApiAuth || /No API key found|authentication|未配置认证/i.test(message);
377
- return (_jsxs("div", { className: "action-error", role: "alert", children: [_jsxs("div", { className: "action-error-summary", children: [_jsx("strong", { children: everyApiAuth ? "EveryAPI 认证未注入当前进程" : requiresAuth ? "模型尚未配置认证" : "发送失败" }), _jsx("span", { children: everyApiAuth
378
- ? "请用 everyapi use pi-harness 启动,或设置 EVERYAPI_RELAY_KEY 后重启。"
379
- : requiresAuth
380
- ? "请在设置 → 提供商中配置 API key,然后重试。"
381
- : "运行时没有接受这次请求,请重试或查看错误详情。" })] }), _jsxs("details", { children: [_jsx("summary", { children: "\u67E5\u770B\u539F\u59CB\u9519\u8BEF" }), _jsx("code", { children: message })] })] }));
382
- }
383
- function UserMessageBubble({ text }) {
384
- const parsed = parseAnnotationPrompt(text);
385
- return (_jsxs("div", { className: "user-bubble", children: [_jsx("span", { children: parsed.question }), parsed.count > 0 ? (_jsxs("span", { className: "ml-2 inline-flex rounded-md bg-[#edf3fe] px-1.5 py-0.5 text-[10px] text-[#315fb8]", children: ["\u6279\u6CE8 \u00D7", parsed.count] })) : null] }));
386
- }
387
- function Details({ event, onClose, onCopy }) {
388
- if (!event)
389
- return (_jsxs("aside", { className: "details-panel", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u4E8B\u4EF6\u8BE6\u60C5" }), _jsx("button", { "aria-label": "\u5173\u95ED\u4E8B\u4EF6\u8BE6\u60C5", onClick: onClose, type: "button", children: "\u00D7" })] }), _jsx("div", { className: "details-body", children: _jsx("div", { className: "empty-state", children: "\u9009\u62E9\u8F68\u8FF9\u4E2D\u7684\u4E8B\u4EF6\u67E5\u770B\u539F\u59CB\u6570\u636E\u3002" }) })] }));
390
- const output = event.output ?? event.result ?? event.message;
391
- const fileDetail = event.type === "file" || event.type === "file_diff";
392
- const stats = fileDetail
393
- ? [
394
- ["来源", "/api/files"],
395
- ["文件", value(event.path)],
396
- ]
397
- : [
398
- ["来源", value(event.type ?? event.source, "event")],
399
- ["产生者", value(event.by ?? event.source)],
400
- ["耗时", value(event.duration ?? event.dur)],
401
- ["时间", value(event.timestamp ?? event.ts ?? event.time)],
402
- ];
403
- return (_jsxs("aside", { className: "details-panel", children: [_jsxs("header", { children: [_jsx("strong", { children: eventLabel(event) }), _jsx("button", { "aria-label": fileDetail ? "关闭文件差异" : "关闭事件详情", onClick: onClose, type: "button", children: "\u00D7" })] }), _jsxs("div", { className: "details-body", children: [_jsx("div", { className: `detail-stats ${fileDetail ? "is-file" : ""}`, children: stats.map(([key, item]) => (_jsxs("div", { children: [_jsx("small", { children: key }), _jsx("b", { children: item })] }, key))) }), output !== undefined && (_jsxs("div", { className: "detail-section", children: [_jsx("small", { children: "\u8F93\u51FA" }), _jsx("pre", { className: "tool-output", children: typeof output === "string" ? output : JSON.stringify(output, null, 2) })] })), _jsxs("div", { className: "detail-section", children: [_jsx("small", { children: fileDetail ? "数据来源" : "经过的插件" }), _jsx("div", { className: "detail-plugin", children: fileDetail ? "Git workspace · /api/files" : "Runtime loader · event" })] }), _jsxs("div", { className: "detail-actions", children: [_jsx("button", { onClick: onCopy, type: "button", children: "\u590D\u5236 JSON" }), _jsx("button", { disabled: true, title: "\u5F53\u524D API \u672A\u63D0\u4F9B\u91CD\u653E\u63A5\u53E3", type: "button", children: "\u91CD\u653E" })] }), _jsxs("details", { className: "raw-json", children: [_jsx("summary", { children: "\u539F\u59CB JSON" }), _jsx("pre", { className: "raw-json-body", children: JSON.stringify(event, null, 2) })] })] })] }));
404
- }
405
- function Trajectory({ events, onSelect }) {
406
- const [filter, setFilter] = useState("all");
407
- const counts = useMemo(() => {
408
- const map = new Map();
409
- events.forEach((event) => {
410
- const type = value(event.type, "event");
411
- map.set(type, (map.get(type) ?? 0) + 1);
412
- });
413
- return map;
414
- }, [events]);
415
- const visible = events.filter((event) => filter === "all" || value(event.type, "event") === filter);
416
- return (_jsxs("section", { className: "view-panel trajectory-view", children: [_jsxs("div", { className: "trajectory-summary", children: [_jsx("span", { children: "\u6309\u8F6E\u6B21" }), _jsxs("b", { children: [events.length, " \u4E2A\u4E8B\u4EF6"] }), _jsx("div", { className: "timeline", children: events.length ? (events.map((event, index) => (_jsx("span", { className: "timeline-turn", children: _jsx("i", { className: "timeline-strip", title: eventLabel(event) }) }, index)))) : (_jsx("span", { className: "timeline-empty", children: "\u7B49\u5F85\u771F\u5B9E\u4E8B\u4EF6\u2026" })) })] }), _jsxs("div", { className: "source-filters", children: [_jsxs("button", { className: `filter ${filter === "all" ? "active" : ""}`, onClick: () => setFilter("all"), type: "button", children: ["\u5168\u90E8 ", events.length] }), [...counts].map(([type, count]) => (_jsxs("button", { className: `filter ${filter === type ? "active" : ""}`, onClick: () => setFilter(type), type: "button", children: [type, " ", count] }, type)))] }), _jsxs("div", { className: "event-table", children: [_jsxs("div", { className: "event-head", children: [_jsx("span", { children: "\u65F6\u95F4" }), _jsx("span", { children: "\u6765\u6E90" }), _jsx("span", { children: "\u4E8B\u4EF6" }), _jsx("span", { children: "\u4EA7\u751F\u8005" }), _jsx("span", { children: "\u8017\u65F6" })] }), visible.map((event, index) => (_jsxs("button", { className: "event-row", onClick: () => onSelect(event), type: "button", children: [_jsx("span", { children: value(event.timestamp ?? event.ts ?? event.time) }), _jsxs("span", { children: [_jsx("i", { className: "event-dot" }), value(event.type, "event")] }), _jsx("strong", { children: eventLabel(event) }), _jsx("span", { children: value(event.by ?? event.source) }), _jsx("span", { children: value(event.duration ?? event.dur) })] }, index))), !visible.length && _jsx("div", { className: "empty-state", children: "\u6682\u65E0\u8F68\u8FF9\u4E8B\u4EF6\u3002" })] })] }));
417
- }
418
- function Files({ files, api, onDiff, onRefresh, }) {
419
- const additions = files.filter((file) => file.status.includes("A") || file.status === "??").length;
420
- const deletions = files.filter((file) => file.status.includes("D")).length;
421
- const [message, setMessage] = useState("");
422
- const [busy, setBusy] = useState(false);
423
- const [diffPending, setDiffPending] = useState();
424
- const [error, setError] = useState("");
425
- const [revertConfirmOpen, setRevertConfirmOpen] = useState(false);
426
- const commit = () => {
427
- const text = message.trim();
428
- if (!text || busy)
429
- return;
430
- setBusy(true);
431
- setError("");
432
- void api
433
- .commitFiles(files.map((file) => file.path), text)
434
- .then(() => {
435
- setMessage("");
436
- onRefresh();
437
- })
438
- .catch((cause) => setError(cause instanceof Error ? cause.message : String(cause)))
439
- .finally(() => setBusy(false));
440
- };
441
- const revert = () => {
442
- if (!files.length || busy)
443
- return;
444
- setRevertConfirmOpen(false);
445
- setBusy(true);
446
- setError("");
447
- void api
448
- .revertFiles(files.map((file) => file.path))
449
- .then(onRefresh)
450
- .catch((cause) => setError(cause instanceof Error ? cause.message : String(cause)))
451
- .finally(() => setBusy(false));
452
- };
453
- const openDiff = (path) => {
454
- if (busy || diffPending)
455
- return;
456
- setDiffPending(path);
457
- setError("");
458
- void onDiff(path)
459
- .catch((cause) => setError(cause instanceof Error ? cause.message : String(cause)))
460
- .finally(() => setDiffPending(undefined));
461
- };
462
- return (_jsxs("section", { className: "view-panel files-view", children: [_jsxs("div", { className: "files-content", children: [_jsxs("div", { className: "files-title", children: [_jsx("strong", { children: "\u672C\u6B21\u4F1A\u8BDD\u6539\u52A8" }), _jsx("span", { children: "\u7531 /api/files \u63D0\u4F9B" })] }), _jsx("div", { className: "file-summary", children: `${files.length} 个文件 · ${additions} 个新增 · ${deletions} 个删除` }), _jsx("div", { className: "file-list", children: files.length ? (files.map((file) => (_jsxs("div", { className: "file-row", children: [_jsx("b", { className: `file-kind ${file.label === "untracked" ? "new" : ""}`, children: file.label }), _jsx("code", { children: file.path }), _jsx("span", { className: file.status.includes("D") ? "del" : "add", children: file.status }), _jsx("button", { "aria-label": `${diffPending === file.path ? "正在读取" : "查看"}${file.path}的差异`, className: "diff-button", disabled: busy || diffPending !== undefined, onClick: () => openDiff(file.path), type: "button", children: diffPending === file.path ? "读取中…" : "查看差异" })] }, file.path)))) : (_jsx("div", { className: "empty-state", children: "\u5DE5\u4F5C\u533A\u6CA1\u6709\u672A\u63D0\u4EA4\u6539\u52A8\u3002" })) }), files.length > 0 && (_jsxs("div", { className: "file-actions", children: [_jsx("input", { "aria-label": "\u63D0\u4EA4\u8BF4\u660E", onChange: (event) => setMessage(event.target.value), placeholder: "\u63D0\u4EA4\u8BF4\u660E", value: message }), _jsx("button", { className: "primary", disabled: busy || !message.trim(), onClick: commit, type: "button", children: busy ? "处理中…" : "提交这些改动" }), _jsx("button", { disabled: busy, onClick: () => setRevertConfirmOpen(true), type: "button", children: "\u5168\u90E8\u64A4\u9500" })] })), error && _jsx("p", { className: "files-error", children: error })] }), revertConfirmOpen && (_jsx(ConfirmDialog, { busy: busy, confirmLabel: "\u786E\u8BA4\u64A4\u9500", description: "\u8FD9\u4F1A\u4E22\u5F03\u5F53\u524D\u5DE5\u4F5C\u533A\u7684\u5168\u90E8\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002", onClose: () => setRevertConfirmOpen(false), onConfirm: revert, target: `${files.length} 个文件`, title: "\u64A4\u9500\u5168\u90E8\u6539\u52A8" }))] }));
463
- }
464
- function pluginPanelValue(input) {
465
- if (typeof input === "string")
466
- return input;
467
- try {
468
- return JSON.stringify(input, null, 2) ?? value(input);
469
- }
470
- catch {
471
- return value(input);
472
- }
473
- }
474
- function PluginPanelCard({ panel, inline = false }) {
475
- const data = panel.data !== null && typeof panel.data === "object" && !Array.isArray(panel.data) ? panel.data : undefined;
476
- const entries = data ? Object.entries(data) : [["内容", panel.data]];
477
- const items = data && Array.isArray(data.items) ? data.items : [];
478
- const pluginEntries = data && Array.isArray(data.entries) ? data.entries : [];
479
- const capabilities = data && Array.isArray(data.capabilities) ? data.capabilities : [];
480
- return (_jsxs("div", { className: `plugin-panel-card ${inline ? "pt-1" : "rounded-[10px] border border-[#e3e7ee] bg-white p-4 shadow-[0_8px_24px_rgba(27,39,64,0.04)]"}`, children: [_jsxs("header", { className: "flex items-start gap-3", children: [_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: panel.icon ?? "◈" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("strong", { className: "block text-[13px] font-semibold text-[#20252b]", children: panel.title }), _jsx("p", { className: "mt-1 text-[11px] leading-4 text-[#687381]", children: panel.description ?? panel.pluginId.replace(/cordis/gi, "runtime") })] })] }), panel.error ? (_jsx("div", { className: "mt-3 rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[12px] text-[#b42318]", children: panel.error })) : panel.id === "console-logger-panel" ? (_jsxs("div", { className: "mt-3 grid gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]", children: "\u6700\u8FD1\u65E5\u5FD7" }), _jsx("strong", { className: "mt-1 block text-[20px] font-semibold text-[#20252b]", children: value(data?.total ?? 0) })] }), _jsx("div", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3]", children: items.length ? (items.map((item, index) => {
481
- const message = item !== null && typeof item === "object" ? item : {};
482
- return (_jsxs("div", { className: "grid grid-cols-[auto_1fr] gap-2 border-b border-[#edf0f3] px-3 py-2 last:border-b-0", children: [_jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: value(message.level ?? "log") }), _jsxs("div", { className: "min-w-0", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: value(message.source ?? "runtime") }), _jsx("span", { className: "block whitespace-pre-wrap break-words text-[11px] leading-4 text-[#65707b]", children: pluginPanelValue(message.args ?? "") })] })] }, `${value(message.time ?? "log")}-${index}`));
483
- })) : (_jsx("div", { className: "px-3 py-4 text-[12px] text-[#687381]", children: "\u6682\u65E0\u65E5\u5FD7\u8F93\u51FA\u3002" })) })] })) : panel.id === "plugin-group-panel" ? (_jsx("div", { className: "mt-3 max-h-64 overflow-auto rounded-lg border border-[#edf0f3]", children: pluginEntries.length ? (pluginEntries.map((item, index) => {
484
- const entry = item !== null && typeof item === "object" ? item : {};
485
- return (_jsxs("div", { className: "flex items-center gap-3 border-b border-[#edf0f3] px-3 py-2 last:border-b-0", children: [_jsx("span", { className: `h-2 w-2 shrink-0 rounded-full ${entry.enabled === false ? "bg-[#a0a8b2]" : "bg-[#22c55e]"}` }), _jsx("span", { className: "min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]", children: value(entry.name ?? "plugin") }), _jsx("span", { className: "text-[10px] text-[#687381]", children: value(entry.state ?? "unknown") })] }, `${value(entry.id ?? "plugin")}-${index}`));
486
- })) : (_jsx("div", { className: "px-3 py-4 text-[12px] text-[#687381]", children: "\u6682\u65E0\u63D2\u4EF6\u6761\u76EE\u3002" })) })) : panel.id === "timer-service-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3 rounded-lg bg-[#f6f8fa] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]", children: "\u670D\u52A1\u72B6\u6001" }), _jsx("span", { className: `rounded-full px-2 py-1 text-[10px] font-semibold ${data?.registered === true ? "bg-[#e8f8ee] text-[#14733f]" : "bg-[#fff4e5] text-[#8a5a00]"}`, children: data?.registered === true ? "已注册" : "未注册" })] }), _jsx("div", { className: "flex flex-wrap gap-2", children: capabilities.map((capability, index) => (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: value(capability) }, `${value(capability)}-${index}`))) })] })) : panel.id === "agent-teams-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "grid gap-2 sm:grid-cols-3", children: [capabilities.length > 0
487
- ? capabilities.map((capability, index) => (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 text-center text-[10px] text-[#3565c5]", children: value(capability) }, `${value(capability)}-${index}`)))
488
- : null, _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u6210\u5458" }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(Array.isArray(data?.members) ? data.members.length : 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u4EFB\u52A1" }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(Array.isArray(data?.tasks) ? data.tasks.length : 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u672A\u8BFB\u6D88\u606F" }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(Array.isArray(data?.messages)
489
- ? data.messages.filter((message) => message !== null && typeof message === "object" && message.read !== true)
490
- .length
491
- : 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u53EF\u6267\u884C\u4EFB\u52A1" }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(Array.isArray(data?.readyTasks) ? data.readyTasks.length : 0) })] })] }), Array.isArray(data?.dependencyCycle) && data.dependencyCycle.length > 1 ? (_jsxs("div", { className: "rounded-lg border border-[#f4caca] bg-[#fff5f5] px-3 py-2 text-[11px] text-[#b42318]", children: ["\u4F9D\u8D56\u5FAA\u73AF\uFF1A", data.dependencyCycle.map((item) => value(item)).join(" → ")] })) : null, _jsx("div", { className: "grid gap-2", children: Array.isArray(data?.members) && data.members.length > 0 ? (data.members.map((item, index) => {
492
- const member = item !== null && typeof item === "object" ? item : {};
493
- return (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-[#edf0f3] px-3 py-2", children: [_jsx("span", { className: "h-2 w-2 rounded-full bg-[#22c55e]" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] font-semibold text-[#30343b]", children: value(member.name ?? "成员") }), _jsx("span", { className: "text-[10px] text-[#687381]", children: value(member.role ?? "协作成员") }), _jsx("span", { className: "font-mono text-[10px] text-[#3565c5]", children: value(member.status ?? "idle") })] }, `${value(member.id ?? "member")}-${index}`));
494
- })) : (_jsx("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]", children: "\u6682\u65E0\u534F\u4F5C\u6210\u5458\u3002" })) }), _jsx("div", { className: "grid gap-2", children: Array.isArray(data?.tasks) && data.tasks.length > 0 ? (data.tasks.map((item, index) => {
495
- const task = item !== null && typeof item === "object" ? item : {};
496
- return (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-[#edf0f3] px-3 py-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-[11px] text-[#30343b]", children: value(task.title ?? "未命名任务") }), Array.isArray(task.dependsOn) && task.dependsOn.length > 0 ? (_jsxs("span", { className: "mt-0.5 block truncate font-mono text-[9px] text-[#687381]", children: ["\u4F9D\u8D56\uFF1A", task.dependsOn.join(", ")] })) : null] }), _jsx("span", { className: "text-[10px] text-[#687381]", children: value(task.assignee ?? "unassigned") }), _jsx("span", { className: `rounded-full px-2 py-1 text-[10px] ${task.status === "blocked" ? "bg-[#fff4e5] text-[#8a5a00]" : task.status === "done" ? "bg-[#e8f8ee] text-[#14733f]" : "bg-[#edf3fe] text-[#3565c5]"}`, children: value(task.status ?? "todo") })] }, `${value(task.id ?? "task")}-${index}`));
497
- })) : (_jsx("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u4EFB\u52A1\u3002\u53EF\u8BA9 Agent \u4F7F\u7528 team_task \u521B\u5EFA\u3002" })) }), _jsxs("div", { className: "grid gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u56E2\u961F\u6D88\u606F" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: "durable mailbox" })] }), Array.isArray(data?.messages) && data.messages.length > 0 ? (Array.from(data.messages)
498
- .reverse()
499
- .slice(0, 5)
500
- .map((item, index) => {
501
- const message = item !== null && typeof item === "object" ? item : {};
502
- return (_jsxs("div", { className: `rounded-lg border px-3 py-2 ${message.read === true ? "border-[#edf0f3] bg-white" : "border-[#cfe0ff] bg-[#f4f8ff]"}`, children: [_jsxs("div", { className: "flex items-center gap-2 text-[10px] text-[#687381]", children: [_jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(message.from ?? "unknown"), " \u2192 ", value(message.to ?? "unknown")] }), _jsx("span", { className: "ml-auto", children: message.read === true ? "已读" : "未读" })] }), _jsx("p", { className: "mt-1 whitespace-pre-wrap break-words text-[11px] text-[#30343b]", children: value(message.body ?? "") })] }, `${value(message.id ?? "message")}-${index}`));
503
- })) : (_jsx("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-3 text-[12px] text-[#687381]", children: "\u6682\u65E0\u56E2\u961F\u6D88\u606F\u3002" }))] })] })) : panel.id === "modlens-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: `rounded-lg border px-3 py-3 ${data?.attached === true ? "border-[#b9e6c9] bg-[#f0fbf4]" : "border-[#e3e7ee] bg-[#f6f8fa]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: data?.attached === true ? "图片已附加" : "等待图片" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: "vision_inspect" })] }), data?.image !== null && data?.image !== undefined && typeof data.image === "object" ? (_jsxs("p", { className: "mt-2 truncate text-[11px] text-[#65707b]", children: [value(data.image.path ?? "图片"), " \u00B7 ", value(data.image.bytes ?? 0), " bytes"] })) : (_jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: "\u8C03\u7528 vision_inspect \u5E76\u63D0\u4F9B\u5DE5\u4F5C\u533A\u5185\u56FE\u7247\u8DEF\u5F84\u3002" }))] }), _jsx("div", { className: "flex flex-wrap gap-2", children: capabilities.map((capability, index) => (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: value(capability) }, `${value(capability)}-${index}`))) })] })) : panel.id === "at-file-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u6700\u8FD1\u9644\u52A0" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: "file_context" })] }), data?.lastFile !== null && data?.lastFile !== undefined && typeof data.lastFile === "object" ? (_jsxs("p", { className: "mt-2 truncate text-[11px] text-[#65707b]", children: [value(data.lastFile.path ?? "文件"), " \u00B7 ", value(data.lastFile.bytes ?? 0), " bytes"] })) : (_jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u9644\u52A0\u6587\u4EF6\u3002\u53EF\u4F7F\u7528 @file \u6216\u8BA9 Agent \u8C03\u7528 file_context\u3002" }))] }), _jsxs("div", { className: "flex items-center justify-between text-[11px] text-[#687381]", children: [_jsx("span", { children: "\u5355\u6587\u4EF6\u4E0A\u9650" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data?.maxBytes ?? 0), " bytes"] })] })] })) : panel.id === "git-time-capsule-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u6700\u8FD1\u5FEB\u7167" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: "git_snapshot" })] }), data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? (_jsxs("p", { className: "mt-2 truncate text-[11px] text-[#65707b]", children: [value(data.latest.name ?? "snapshot"), " \u00B7 ", value(data.latest.files ?? 0), " \u4E2A\u6587\u4EF6", data.latest.restored === true ? " · 已恢复" : ""] })) : (_jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u5FEB\u7167\u3002\u4FEE\u6539\u4EE3\u7801\u524D\u8BA9 Agent \u8C03\u7528 git_snapshot\u3002" }))] }), _jsxs("div", { className: "flex items-center justify-between text-[11px] text-[#687381]", children: [_jsx("span", { children: "\u4FDD\u7559\u5FEB\u7167" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(Array.isArray(data?.capsules) ? data.capsules.length : 0), " / 20"] })] }), _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u6062\u590D\u4F1A\u53CD\u5411\u5E94\u7528\u9009\u4E2D\u7684 patch\uFF0C\u5FC5\u987B\u663E\u5F0F\u4F20\u5165 confirm=true\u3002" })] })) : panel.id === "dependency-checker-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: (() => {
504
- const report = data?.report !== null && typeof data?.report === "object" ? data.report : {};
505
- const missing = Array.isArray(report.missing) ? report.missing : [];
506
- const invalid = Array.isArray(report.invalid) ? report.invalid : [];
507
- const conflicts = Array.isArray(report.conflicts) ? report.conflicts : [];
508
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u6E05\u5355\u7C7B\u578B" }), _jsx("strong", { className: "font-mono uppercase text-[#315fb8]", children: value(report.ecosystem ?? "npm") })] }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
509
- ["声明", report.declared ?? 0],
510
- ["已安装", report.installed ?? 0],
511
- ["缺失", missing.length + invalid.length],
512
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${missing.length || invalid.length || conflicts.length ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: missing.length || invalid.length
513
- ? `缺失或无效:${[...missing, ...invalid].map((item) => value(item)).join(", ")}`
514
- : "依赖声明与本地安装一致。" }), conflicts.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-3 text-[11px] text-[#8a6200]", children: [_jsx("strong", { children: "\u7248\u672C\u51B2\u7A81" }), _jsx("ul", { className: "mt-1 grid gap-1 pl-4", children: conflicts.slice(0, 6).map((item, index) => {
515
- const conflict = item !== null && typeof item === "object" ? item : {};
516
- const constraints = Array.isArray(conflict.constraints) ? conflict.constraints.map((constraint) => value(constraint)).join(" · ") : "—";
517
- return (_jsxs("li", { children: [_jsx("code", { children: value(conflict.name ?? "dependency") }), "\uFF1A", constraints] }, `${value(conflict.name ?? "dependency")}-${index}`));
518
- }) })] })) : null] }));
519
- })() })) : panel.id === "token-guard-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: _jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [_jsxs("div", { className: `rounded-lg border px-3 py-3 ${data?.exceeded === true ? "border-[#f4caca] bg-[#fff5f5]" : "border-[#e3eaf8] bg-[#f6f8ff]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u4E0A\u4E0B\u6587\u9884\u7B97" }), _jsxs("strong", { className: "font-mono text-[12px] text-[#315fb8]", children: [value(data?.percent ?? "—"), "% / ", value(data?.maxPercent ?? "—"), "%"] })] }), _jsx("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-[#dfe8fb]", children: _jsx("div", { className: `h-full rounded-full ${data?.exceeded === true ? "bg-[#d64545]" : "bg-[#5d8bea]"}`, style: { width: `${Math.max(0, Math.min(100, typeof data?.percent === "number" ? data.percent : 0))}%` } }) }), _jsx("p", { className: "mt-2 text-[11px] text-[#5d6d82]", children: data?.exceeded === true ? "已达到阈值,运行会被自动停止。" : `自动停止次数:${value(data?.aborts ?? 0)}` })] }), _jsxs("div", { className: `rounded-lg border px-3 py-3 ${data?.runExceeded === true ? "border-[#f4caca] bg-[#fff5f5]" : "border-[#e3eaf8] bg-[#f6f8ff]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u5355\u6B21\u4EFB\u52A1" }), _jsxs("strong", { className: "font-mono text-[12px] text-[#315fb8]", children: [value(data?.runTokens ?? "—"), " / ", value(data?.maxRunTokens || "—")] })] }), _jsx("p", { className: "mt-2 text-[11px] text-[#5d6d82]", children: data?.maxRunTokens ? "按 agent_start 后累计 token 熔断。" : "未启用绝对 Token 上限。" })] })] }) })) : panel.id === "test-harness-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
520
- const run = data.latest;
521
- return (_jsxs("div", { className: `rounded-lg border px-3 py-3 ${run.exitCode === 0 ? "border-[#b9e6c9] bg-[#f0fbf4]" : "border-[#f4caca] bg-[#fff5f5]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "font-mono text-[11px] font-semibold text-[#30343b]", children: value(run.command ?? "npm run test") }), _jsxs("strong", { className: `text-[12px] ${run.exitCode === 0 ? "text-[#14733f]" : "text-[#b42318]"}`, children: ["exit ", value(run.exitCode ?? "—")] })] }), _jsxs("p", { className: "mt-2 text-[11px] text-[#65707b]", children: ["\u8017\u65F6 ", value(run.durationMs ?? 0), " ms"] })] }));
522
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6267\u884C\u9A8C\u8BC1\u811A\u672C\u3002\u53EF\u8BA9 Agent \u8C03\u7528 run_project_tests\u3002" })), _jsx("div", { className: "flex flex-wrap gap-2", children: Array.isArray(data?.allowedScripts)
523
- ? data.allowedScripts.map((script, index) => (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: value(script) }, `${value(script)}-${index}`)))
524
- : null })] })) : panel.id === "session-insights-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: (() => {
525
- const tokens = data?.tokens !== null && typeof data?.tokens === "object" ? data.tokens : {};
526
- const usage = data?.contextUsage !== null && typeof data?.contextUsage === "object" ? data.contextUsage : {};
527
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
528
- ["消息", data?.totalMessages ?? 0],
529
- ["工具调用", data?.toolCalls ?? 0],
530
- ["成本", `$${Number(data?.cost ?? 0).toFixed(4)}`],
531
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u4E0A\u4E0B\u6587" }), _jsxs("strong", { className: "font-mono text-[12px] text-[#315fb8]", children: [value(usage.percent ?? "—"), "%"] })] }), _jsxs("p", { className: "mt-2 text-[11px] text-[#5d6d82]", children: [value(tokens.total ?? 0), " tracked tokens \u00B7 \u8F93\u5165 ", value(tokens.input ?? 0), " \u00B7 \u8F93\u51FA ", value(tokens.output ?? 0)] })] })] }));
532
- })() })) : panel.id === "session-bridge-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: (() => {
533
- const latestPreview = data?.latestPreview !== null && typeof data?.latestPreview === "object"
534
- ? data.latestPreview.preview
535
- : undefined;
536
- const preview = latestPreview ??
537
- (data?.currentPreview !== null && typeof data?.currentPreview === "object" ? data.currentPreview : {});
538
- const sections = [
539
- ["目标", preview.goal],
540
- ["当前状态", preview.currentState],
541
- ["下一步", preview.nextStep],
542
- ];
543
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3 text-[11px] leading-5 text-[#315fb8]", children: "\u9884\u89C8\u4E0D\u4F1A\u521B\u5EFA\u76EE\u6807\u4F1A\u8BDD\uFF0C\u4E5F\u4E0D\u4F1A\u4FEE\u6539\u6E90\u4F1A\u8BDD\u3002" }), sections.map(([label, item]) => (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-3", children: [_jsx("span", { className: "block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: label }), _jsx("p", { className: "mt-2 whitespace-pre-wrap text-[11px] leading-5 text-[#30343b]", children: value(item) })] }, label))), _jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: [
544
- ["关键决策", preview.decisions],
545
- ["关键文件", preview.keyFiles],
546
- ].map(([label, items]) => (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: value(label) }), Array.isArray(items) && items.length > 0 ? (_jsx("ul", { className: "mt-2 grid gap-1 text-[10px] leading-4 text-[#65707b]", children: items.slice(0, 8).map((item, index) => (_jsx("li", { children: value(item) }, `${value(item)}-${index}`))) })) : (_jsx("p", { className: "mt-2 text-[10px] text-[#687381]", children: "\u6682\u65E0" }))] }, value(label)))) })] }));
547
- })() })) : panel.id === "session-compare-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.left && typeof data.left === "object" && data?.right && typeof data.right === "object" ? ((() => {
548
- const left = data.left;
549
- const right = data.right;
550
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: [
551
- ["左侧会话", left],
552
- ["右侧会话", right],
553
- ].map(([label, session]) => {
554
- const item = session;
555
- return (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-2 block truncate text-[12px] text-[#30343b]", children: value(item.name ?? item.id) }), _jsx("code", { className: "mt-1 block truncate text-[10px] text-[#315fb8]", children: value(item.id) }), _jsxs("span", { className: "mt-1 block text-[10px] text-[#65707b]", children: [value(item.messageCount, "0"), " \u6761\u6D88\u606F"] })] }, value(label)));
556
- }) }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
557
- ["共享", data.shared ?? 0],
558
- ["右侧新增", Array.isArray(data.added) ? data.added.length : 0],
559
- ["左侧删除", Array.isArray(data.removed) ? data.removed.length : 0],
560
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${data.changed === true ? "border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: data.changed === true ? "两个会话存在消息差异。" : "两个会话内容一致。" }), Array.isArray(data.added) && data.added.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: "\u53F3\u4FA7\u65B0\u589E\u6D88\u606F" }), _jsx("ul", { className: "mt-2 grid gap-1 text-[10px] leading-4 text-[#65707b]", children: data.added.slice(0, 4).map((item, index) => {
561
- const message = item !== null && typeof item === "object" ? item : {};
562
- return (_jsxs("li", { children: ["[", value(message.role), "] ", value(message.text)] }, `${value(message.role)}-${index}`));
563
- }) })] })) : null] }));
564
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6267\u884C session_compare \u540E\u663E\u793A\u4E24\u4E2A\u4F1A\u8BDD\u7684\u5DEE\u5F02\u3002" })) })) : panel.id === "secure-audit-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-4 gap-2", children: [
565
- ["扫描文件", data?.scanned ?? 0],
566
- ["严重", data?.critical ?? 0],
567
- ["高风险", data?.high ?? 0],
568
- ["总发现", data?.total ?? 0],
569
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-2 py-2 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[16px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${Number(data?.total ?? 0) > 0 ? "border-[#f4d8a8] bg-[#fff9ed] text-[#9a6700]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: Number(data?.total ?? 0) > 0 ? "发现需要人工确认的安全风险。" : "未发现凭据泄露或危险命令。" }), Array.isArray(data?.findings) && data.findings.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.findings.slice(0, 6).map((item, index) => {
570
- const finding = item !== null && typeof item === "object" ? item : {};
571
- const severity = value(finding.severity, "medium");
572
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("code", { className: "min-w-0 truncate text-[10px] text-[#315fb8]", children: value(finding.path) }), _jsx("span", { className: `shrink-0 text-[10px] font-semibold ${severity === "critical" ? "text-[#b42318]" : "text-[#9a6700]"}`, children: severity })] }), _jsxs("p", { className: "mt-1 text-[10px] leading-4 text-[#65707b]", children: ["\u7B2C ", value(finding.line), " \u884C \u00B7 ", value(finding.message)] })] }, `${value(finding.path)}-${value(finding.line)}-${index}`));
573
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD0\u884C security_audit \u540E\u663E\u793A\u8131\u654F\u7ED3\u679C\u3002" }))] })) : panel.id === "context-doctor-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${data?.status === "warning" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: data?.status === "warning" ? "需要关注上下文风险。" : "上下文状态正常。" }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
574
- ["占用", `${value(data?.usagePercent ?? "—")}%`],
575
- ["超大消息", data?.oversizedMessages ?? 0],
576
- ["工具错误", data?.toolErrors ?? 0],
577
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(item) })] }, value(label)))) }), Array.isArray(data?.recommendations) && data.recommendations.length > 0 ? (_jsx("ul", { className: "grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]", children: data.recommendations.slice(0, 4).map((item, index) => (_jsx("li", { children: value(item) }, `${value(item)}-${index}`))) })) : null] })) : panel.id === "history-compressor-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "font-mono text-[11px] text-[#30343b]", children: data?.enabled === true ? "自动压缩已启用" : "自动压缩已停用" }), _jsxs("strong", { className: "font-mono text-[11px] text-[#3565c5]", children: ["\u9608\u503C ", value(data?.thresholdPercent ?? "—"), "%"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u5DF2\u538B\u7F29" }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(data?.compactions ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u5F53\u524D\u5360\u7528" }), _jsxs("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: [value(data?.lastUsagePercent ?? "—"), "%"] })] })] }), data?.lastError ? _jsxs("p", { className: "text-[11px] text-[#b42318]", children: ["\u6700\u8FD1\u9519\u8BEF\uFF1A", value(data.lastError)] }) : null] })) : panel.id === "session-export-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest && typeof data.latest === "object" ? ((() => {
578
- const latest = data.latest;
579
- return (_jsxs("div", { className: "rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "block text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: "\u6700\u8FD1\u5BFC\u51FA" }), _jsx("code", { className: "mt-2 block truncate text-[11px] text-[#315fb8]", children: value(latest.path ?? "pi-session.md") }), _jsxs("p", { className: "mt-1 text-[10px] text-[#65707b]", children: [value(latest.messages ?? 0), " \u6761\u6D88\u606F \u00B7 ", value(latest.bytes ?? 0), " bytes"] })] }));
580
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u5BFC\u51FA\u5F53\u524D\u4F1A\u8BDD\u3002" })), _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u5BFC\u51FA\u6587\u4EF6\u53EA\u5141\u8BB8\u5199\u5165\u5F53\u524D\u5DE5\u4F5C\u533A\u5185\u7684 .md \u8DEF\u5F84\uFF0C\u8986\u76D6\u5DF2\u6709\u6587\u4EF6\u9700\u8981\u663E\u5F0F\u786E\u8BA4\u3002" })] })) : panel.id === "session-search-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.query ? (_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("code", { className: "min-w-0 truncate text-[11px] text-[#315fb8]", children: value(data.query) }), _jsxs("strong", { className: "ml-3 shrink-0 text-[11px] text-[#3565c5]", children: [value(data.total ?? 0), " \u4E2A\u4F1A\u8BDD"] })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8F93\u5165\u67E5\u8BE2\u540E\u663E\u793A\u5339\u914D\u7684\u5386\u53F2\u4F1A\u8BDD\u3002" })), Array.isArray(data?.items) && data.items.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.items.slice(0, 8).map((item, index) => {
581
- const session = item !== null && typeof item === "object" ? item : {};
582
- const hits = Array.isArray(session.hits) ? session.hits : [];
583
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: value(session.name ?? session.id ?? "未命名会话") }), _jsx("p", { className: "mt-1 line-clamp-2 text-[10px] leading-4 text-[#65707b]", children: hits
584
- .map((hit) => (hit !== null && typeof hit === "object" ? value(hit.text ?? "") : value(hit)))
585
- .join(" | ") })] }, `${value(session.id ?? "session")}-${index}`));
586
- }) })) : data?.query ? (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5386\u53F2\u4F1A\u8BDD\u3002" })) : null] })) : panel.id === "session-bookmarks-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "text-[11px] text-[#65707b]", children: "\u5F53\u524D\u4F1A\u8BDD\u7684\u6301\u4E45\u5316\u4E66\u7B7E" }), _jsxs("strong", { className: "font-mono text-[11px] text-[#3565c5]", children: [value(data?.total ?? 0), " \u4E2A\u4E66\u7B7E"] })] }), Array.isArray(data?.bookmarks) && data.bookmarks.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.bookmarks.slice(0, 12).map((item, index) => {
587
- const bookmark = item !== null && typeof item === "object" ? item : {};
588
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: value(bookmark.label ?? "未命名书签") }), _jsxs("code", { className: "mt-1 block truncate text-[10px] text-[#687381]", children: ["entry: ", value(bookmark.entryId ?? "—")] })] }, `${value(bookmark.id ?? "bookmark")}-${index}`));
589
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6807\u8BB0\u91CD\u8981\u8282\u70B9\u3002" })), _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u4E66\u7B7E\u72EC\u7ACB\u4FDD\u5B58\u5728 agent \u76EE\u5F55\uFF0C\u4E0D\u4F1A\u6539\u5199 Pi \u539F\u751F\u4F1A\u8BDD\u8BB0\u5F55\u3002" })] })) : panel.id === "llm-verifier-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "text-[11px] text-[#65707b]", children: "\u6821\u9A8C\u6A21\u578B" }), _jsxs("code", { className: "max-w-[65%] truncate text-[11px] text-[#315fb8]", children: [value(data?.provider ?? "—"), "/", value(data?.model ?? "—")] })] }), data?.history && typeof data.history === "object"
590
- ? (() => {
591
- const history = data.history;
592
- const counts = history.counts && typeof history.counts === "object" ? history.counts : {};
593
- return (_jsxs("div", { className: "grid grid-cols-4 gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-2 py-2 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u7D2F\u8BA1" }), _jsx("strong", { className: "mt-1 block text-[15px] text-[#30343b]", children: value(history.total ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f0fbf4] px-2 py-2 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#14733f]", children: "\u901A\u8FC7" }), _jsx("strong", { className: "mt-1 block text-[15px] text-[#14733f]", children: value(counts.pass ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#fff5f5] px-2 py-2 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#b42318]", children: "\u5931\u8D25" }), _jsx("strong", { className: "mt-1 block text-[15px] text-[#b42318]", children: value(counts.fail ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#fffaf0] px-2 py-2 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#9a6700]", children: "\u672A\u77E5" }), _jsx("strong", { className: "mt-1 block text-[15px] text-[#9a6700]", children: value(counts.unknown ?? 0) })] })] }));
594
- })()
595
- : null, data?.latest && typeof data.latest === "object" ? ((() => {
596
- const latest = data.latest;
597
- const verdict = value(latest.verdict ?? "unknown");
598
- return (_jsxs("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${verdict === "pass" ? "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]" : verdict === "fail" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]"}`, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("strong", { className: "uppercase", children: verdict }), _jsxs("span", { className: "font-mono text-[10px]", children: [value(latest.evidenceChars ?? 0), " chars"] })] }), _jsx("p", { className: "mt-2 leading-4", children: value(latest.rationale ?? "没有返回校验理由。") }), _jsxs("p", { className: "mt-2 truncate text-[10px] opacity-70", children: ["\u58F0\u660E\uFF1A", value(latest.claim ?? "—")] })] }));
599
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6267\u884C\u6A21\u578B\u6821\u9A8C\u3002" })), _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u8BC1\u636E\u6309\u4E0D\u53EF\u4FE1\u6570\u636E\u5904\u7406\uFF0C\u8F93\u5165\u6709\u957F\u5EA6\u4E0A\u9650\uFF1B\u6A21\u578B\u8FD4\u56DE\u975E\u7ED3\u6784\u5316\u7ED3\u679C\u65F6\u663E\u793A unknown\u3002" })] })) : panel.id === "module-search-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest && typeof data.latest === "object" ? ((() => {
600
- const latest = data.latest;
601
- const matches = Array.isArray(latest.matches) ? latest.matches : [];
602
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("code", { className: "min-w-0 truncate text-[11px] text-[#315fb8]", children: value(latest.query ?? "") }), _jsxs("strong", { className: "ml-3 shrink-0 text-[11px] text-[#3565c5]", children: [value(matches.length), " \u4E2A\u7ED3\u679C"] })] }), matches.length > 0 ? (_jsx("div", { className: "grid gap-2", children: matches.slice(0, 10).map((item, index) => {
603
- const match = item !== null && typeof item === "object" ? item : {};
604
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("code", { className: "min-w-0 truncate text-[10px] text-[#315fb8]", children: [value(match.path ?? "—"), ":", value(match.line ?? "—")] }), _jsx("span", { className: "shrink-0 text-[10px] uppercase text-[#687381]", children: value(match.kind ?? "symbol") })] }), _jsx("p", { className: "mt-1 truncate text-[10px] text-[#65707b]", children: value(match.name ?? "未命名符号") })] }, `${value(match.path ?? "module")}:${value(match.line ?? index)}`));
605
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6A21\u5757\u7B26\u53F7\u3002" })), _jsxs("p", { className: "text-[10px] leading-4 text-[#687381]", children: ["\u626B\u63CF ", value(latest.scannedFiles ?? 0), " \u4E2A\u6E90\u7801\u6587\u4EF6\uFF0C\u8DF3\u8FC7\u4F9D\u8D56\u548C\u6784\u5EFA\u76EE\u5F55\u3002"] })] }));
606
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8F93\u5165\u7B26\u53F7\u540D\u540E\u663E\u793A\u6A21\u5757\u68C0\u7D22\u7ED3\u679C\u3002" })) })) : panel.id === "better-sidebar-panel" ? ((() => {
607
- const changedFiles = Array.isArray(data?.changedFiles) ? data.changedFiles : [];
608
- const clean = data?.clean === true;
609
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("code", { className: "min-w-0 truncate text-[11px] text-[#315fb8]", children: value(data?.cwd ?? "当前工作区") }), _jsx("span", { className: `shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] ${clean ? "bg-[#eaf8f0] text-[#14733f]" : "bg-[#fff0f0] text-[#b42318]"}`, children: clean ? "clean" : `${value(data?.changedCount ?? changedFiles.length)} 个变更` })] }), _jsx("p", { className: "mt-2 font-mono text-[10px] text-[#65707b]", children: value(data?.summary ?? "等待工作区扫描") }), _jsxs("p", { className: "mt-1 text-[10px] text-[#687381]", children: ["\u4F1A\u8BDD ", value(data?.sessionId ?? "—"), " \u00B7 \u76EE\u5F55 ", value(data?.directoryCount ?? 0), " \u00B7 \u6587\u4EF6 ", value(data?.fileCount ?? 0)] })] }), changedFiles.length > 0 ? (_jsx("div", { className: "grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: changedFiles.slice(0, 8).map((item, index) => {
610
- const entry = item !== null && typeof item === "object" ? item : {};
611
- return (_jsxs("code", { className: "truncate py-0.5 text-[10px] text-[#65707b]", children: [value(entry.status ?? "??"), " ", value(entry.path ?? "未命名")] }, `${value(entry.path ?? "file")}-${index}`));
612
- }) })) : null, data?.truncated === true ? _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u76EE\u5F55\u6458\u8981\u5DF2\u622A\u65AD\uFF0C\u6267\u884C sidebar_overview \u83B7\u53D6\u6700\u65B0\u6982\u89C8\u3002" }) : null] }));
613
- })()) : panel.id === "workspace-navigator-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest && typeof data.latest === "object" ? ((() => {
614
- const latest = data.latest;
615
- const nodes = Array.isArray(latest.nodes) ? latest.nodes : [];
616
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("code", { className: "min-w-0 truncate text-[11px] text-[#315fb8]", children: value(latest.path ?? ".") }), _jsxs("strong", { className: "ml-3 shrink-0 text-[11px] text-[#3565c5]", children: [value(nodes.length), " \u4E2A\u8282\u70B9"] })] }), nodes.length > 0 ? (_jsx("div", { className: "grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: nodes.slice(0, 36).map((item, index) => {
617
- const node = item !== null && typeof item === "object" ? item : {};
618
- const depth = typeof node.depth === "number" ? Math.min(6, Math.max(1, node.depth)) : 1;
619
- return (_jsxs("div", { className: "flex items-center gap-2 truncate py-1 text-[10px] text-[#65707b]", children: [_jsxs("span", { className: "shrink-0 text-[#687381]", children: ["· ".repeat(depth - 1), node.kind === "directory" ? "▾" : "·"] }), _jsx("code", { className: "truncate", children: value(node.name ?? node.path ?? "未命名") })] }, `${value(node.path ?? "node")}-${index}`));
620
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5F53\u524D\u76EE\u5F55\u4E3A\u7A7A\u3002" })), _jsxs("p", { className: "text-[10px] leading-4 text-[#687381]", children: ["\u76EE\u5F55 ", value(latest.directoryCount ?? 0), " \u4E2A\uFF0C\u6587\u4EF6 ", value(latest.fileCount ?? 0), " \u4E2A\uFF1B\u8DF3\u8FC7\u4F9D\u8D56\u548C\u6784\u5EFA\u76EE\u5F55\u3002"] }), data?.git && typeof data.git === "object"
621
- ? (() => {
622
- const git = data.git;
623
- const entries = Array.isArray(git.entries) ? git.entries : [];
624
- const available = git.available === true;
625
- return (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-[11px] font-medium text-[#253044]", children: "Git \u72B6\u6001" }), _jsx("span", { className: `text-[10px] ${!available ? "text-[#687381]" : git.clean === true ? "text-[#14733f]" : "text-[#b42318]"}`, children: !available ? "不可用" : git.clean === true ? "clean" : `${entries.length} 个变更` })] }), available ? _jsx("p", { className: "mt-1 font-mono text-[10px] text-[#65707b]", children: value(git.branch ?? "detached HEAD") }) : null, entries.length > 0 ? (_jsx("div", { className: "mt-2 grid gap-1", children: entries.slice(0, 12).map((item, index) => {
626
- const entry = item !== null && typeof item === "object" ? item : {};
627
- return (_jsxs("code", { className: "truncate text-[10px] text-[#65707b]", children: [value(entry.status ?? "??"), " ", value(entry.path ?? "未命名")] }, `${value(entry.path ?? "file")}-${index}`));
628
- }) })) : null] }));
629
- })()
630
- : null] }));
631
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6267\u884C workspace_tree \u540E\u663E\u793A\u5DE5\u4F5C\u533A\u7ED3\u6784\u3002" })) })) : panel.id === "prompt-library-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [Array.isArray(data?.templates) && data.templates.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.templates.slice(0, 12).map((item, index) => {
632
- const template = item !== null && typeof item === "object" ? item : {};
633
- const tags = Array.isArray(template.tags) ? template.tags.filter((tag) => typeof tag === "string") : [];
634
- return (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("strong", { className: "truncate text-[11px] text-[#253044]", children: value(template.title ?? "未命名提示词") }), _jsx("code", { className: "shrink-0 text-[10px] text-[#687381]", children: value(template.id ?? "—") })] }), _jsx("p", { className: "mt-2 line-clamp-2 text-[10px] leading-4 text-[#65707b]", children: value(template.prompt ?? "") }), tags.length > 0 ? (_jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: tags.slice(0, 6).map((tag) => (_jsx("span", { className: "rounded bg-[#f6f8ff] px-1.5 py-0.5 text-[9px] text-[#315fb8]", children: tag }, tag))) })) : null] }, `${value(template.id ?? "prompt")}-${index}`));
635
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u4FDD\u5B58\u7684\u63D0\u793A\u8BCD\u3002\u53EF\u8BA9 Agent \u8C03\u7528 prompt_library \u4FDD\u5B58\u6A21\u677F\u3002" })), _jsxs("p", { className: "text-[10px] leading-4 text-[#687381]", children: ["\u5171 ", value(data?.total ?? 0), " \u4E2A\u6A21\u677F\uFF0C\u6570\u636E\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u3002"] })] })) : panel.id === "colleague-skill-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest && typeof data.latest === "object" ? ((() => {
636
- const handoff = data.latest;
637
- const list = (key) => Array.isArray(handoff[key]) ? handoff[key].filter((item) => typeof item === "string") : [];
638
- const constraints = list("constraints");
639
- const files = list("files");
640
- const acceptance = list("acceptance");
641
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "text-[11px] text-[#65707b]", children: "\u4EA4\u63A5\u7ED9" }), _jsx("strong", { className: "text-[11px] text-[#315fb8]", children: value(handoff.toRole) })] }), _jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-3 text-[11px] text-[#253044]", children: value(handoff.objective) }), handoff.context ? _jsx("p", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2 text-[10px] leading-4 text-[#65707b]", children: value(handoff.context) }) : null, files.length > 0 ? (_jsx("div", { className: "grid gap-1 rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: files.slice(0, 8).map((file) => (_jsx("code", { className: "truncate text-[10px] text-[#65707b]", children: file }, file))) })) : null, _jsxs("div", { className: "grid grid-cols-2 gap-2 text-[10px] text-[#65707b]", children: [_jsxs("span", { children: ["\u7EA6\u675F ", constraints.length, " \u6761"] }), _jsxs("span", { children: ["\u9A8C\u6536 ", acceptance.length, " \u6761"] })] })] }));
642
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6267\u884C colleague_handoff \u540E\u663E\u793A\u89D2\u8272\u4EA4\u63A5\u5305\u3002" })) })) : panel.id === "reverse-skill-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsx("span", { className: "text-[11px] text-[#65707b]", children: "\u590D\u6838\u98CE\u9669\u5185\u5BB9" }), _jsx("strong", { className: "font-mono text-[11px] text-[#3565c5]", children: data?.allowReviewByDefault === true ? "已允许" : "默认阻断" })] }), data?.latest && typeof data.latest === "object" ? ((() => {
643
- const latest = data.latest;
644
- const risk = value(latest.risk ?? "safe");
645
- const findings = Array.isArray(latest.findings) ? latest.findings : [];
646
- return (_jsxs("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${risk === "blocked" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : risk === "review" ? "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("strong", { className: "uppercase", children: risk }), _jsx("span", { className: "font-mono text-[10px]", children: latest.contentIncluded === true ? "可注入" : "已隔离" })] }), _jsxs("p", { className: "mt-2", children: [value(latest.name ?? "未命名 Skill"), " \u00B7 ", value(findings.length), " \u4E2A\u98CE\u9669\u9879"] }), findings.length > 0 ? (_jsx("p", { className: "mt-1 text-[10px] opacity-80", children: findings
647
- .slice(0, 2)
648
- .map((item) => value(item))
649
- .join(";") })) : null] }));
650
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6267\u884C skill_inject \u540E\u663E\u793A\u9694\u79BB\u7ED3\u679C\u3002" })), _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u5B89\u5168\u5185\u5BB9\u4F1A\u88AB\u5305\u88F9\u4E3A\u4E0D\u53EF\u4FE1\u6570\u636E\uFF1Breview \u98CE\u9669\u9ED8\u8BA4\u4E0D\u6CE8\u5165\uFF0Cblocked \u5185\u5BB9\u6C38\u4E0D\u8FD4\u56DE\u539F\u6587\u3002" })] })) : panel.id === "reviewer-bot-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
651
- const report = data.latest;
652
- const status = value(report.status ?? "pass");
653
- const findings = Array.isArray(report.findings) ? report.findings : [];
654
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${status === "error" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : status === "warning" ? "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: [_jsx("span", { children: status === "error" ? "发现阻断风险" : status === "warning" ? "需要关注" : "审查通过" }), _jsxs("strong", { className: "font-mono", children: [value(findings.length), " findings"] })] }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
655
- ["文件", report.changedFiles ?? 0],
656
- ["新增", report.addedLines ?? 0],
657
- ["删除", report.removedLines ?? 0],
658
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(item) })] }, value(label)))) }), findings.length > 0 ? (_jsx("ul", { className: "grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]", children: findings.slice(0, 4).map((finding, index) => (_jsx("li", { children: value(typeof finding === "object" && finding !== null ? (finding.message ?? "finding") : finding) }, index))) })) : null] }));
659
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u5BA1\u67E5\u5F53\u524D\u6539\u52A8\u3002\u53EF\u8BA9 Agent \u8C03\u7528 review_changes\u3002" })) })) : panel.id === "auto-mode-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: data?.mode === "confirm" ? "确认模式" : "安全模式" }), _jsxs("span", { className: "font-mono text-[#65707b]", children: ["\u8D85\u65F6 ", value(data?.timeoutMs ?? "—"), " ms"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u963B\u65AD\u6B21\u6570" }), _jsxs("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: [value(data?.blocked ?? 0), " \u6B21"] })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u6700\u8FD1\u547D\u4EE4" }), _jsx("strong", { className: "mt-1 block truncate font-mono text-[11px] text-[#30343b]", children: data?.last && typeof data.last === "object" ? value(data.last.command ?? "—") : "—" })] })] }), data?.last && typeof data.last === "object" ? (_jsx("pre", { className: "max-h-32 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]", children: value(data.last.stdout, "") || value(data.last.stderr ?? "无输出") })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u6267\u884C\u547D\u4EE4\u3002Agent \u53EF\u8C03\u7528 auto_mode_exec\u3002" }))] })) : panel.id === "plan-execute-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "truncate text-[11px] font-medium text-[#30343b]", children: data?.title ? value(data.title) : "尚未创建计划" }), _jsxs("span", { className: "font-mono text-[11px] text-[#3565c5]", children: [value(data?.completed ?? 0), " / ", value(data?.total ?? 0)] })] }), Array.isArray(data?.steps) && data.steps.length > 0 ? (_jsx("ol", { className: "grid gap-1.5", children: data.steps.map((step, index) => {
660
- const item = step && typeof step === "object" ? step : {};
661
- const status = value(item.status ?? "pending");
662
- return (_jsxs("li", { className: "flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[11px]", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${status === "done" ? "bg-[#32a35a]" : status === "in_progress" ? "bg-[#3565c5]" : status === "skipped" ? "bg-[#a0a7b0]" : "bg-[#d7dce2]"}` }), _jsx("span", { className: `min-w-0 flex-1 truncate ${status === "done" ? "text-[#14733f]" : "text-[#30343b]"}`, children: value(item.title ?? "步骤") }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: status })] }, value(item.id ?? index)));
663
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 plan_create \u521B\u5EFA\u6267\u884C\u8BA1\u5212\u3002" }))] })) : panel.id === "plugin-stars-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "\u793E\u533A\u6392\u884C\u699C" }), _jsxs("span", { className: "font-mono text-[#65707b]", children: ["\u4E0A\u9650 ", value(data?.limit ?? "—")] })] }), data?.latest && typeof data.latest === "object" ? ((() => {
664
- const latest = data.latest;
665
- const entries = Array.isArray(latest.results)
666
- ? latest.results.flatMap((entry) => {
667
- if (entry === null || typeof entry !== "object")
668
- return [];
669
- const item = entry;
670
- if (typeof item.fullName !== "string" ||
671
- typeof item.name !== "string" ||
672
- typeof item.stars !== "number" ||
673
- typeof item.htmlUrl !== "string" ||
674
- typeof item.updatedAt !== "string")
675
- return [];
676
- return [{ fullName: item.fullName, name: item.name, stars: item.stars, htmlUrl: item.htmlUrl, updatedAt: item.updatedAt }];
677
- })
678
- : [];
679
- const rows = pluginStarsRows(entries, 8);
680
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between text-[11px] text-[#65707b]", children: [_jsxs("span", { children: ["\u67E5\u8BE2\uFF1A", value(latest.query, "全部")] }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(latest.total ?? rows.length), " \u4E2A\u7ED3\u679C"] })] }), rows.length > 0 ? (_jsx("ol", { className: "grid gap-1.5", children: rows.map((row) => (_jsxs("li", { className: "flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("span", { className: "w-5 shrink-0 text-center font-mono text-[10px] text-[#9a6700]", children: ["#", row.rank] }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("a", { className: "block truncate font-mono text-[11px] text-[#315fb8] hover:underline", href: row.htmlUrl, rel: "noreferrer", target: "_blank", children: row.fullName }), _jsxs("span", { className: "block truncate text-[10px] text-[#687381]", children: ["\u66F4\u65B0\u4E8E ", row.updatedAt || "未知"] })] }), _jsxs("span", { className: "shrink-0 font-mono text-[10px] text-[#8a5a00]", children: ["\u2605 ", row.stars.toLocaleString()] })] }, row.fullName))) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u793E\u533A\u63D2\u4EF6\u3002" })), _jsxs("p", { className: "text-[10px] leading-4 text-[#687381]", children: ["\u6765\u6E90\uFF1A", value(latest.source, "dsh-plugin-stars"), " \u00B7 \u4EC5\u5C55\u793A\u516C\u5F00\u4ED3\u5E93\u4FE1\u606F\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u5B89\u88C5\u3002"] })] }));
681
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 plugin_stars_search \u62C9\u53D6\u5E76\u7B5B\u9009\u793E\u533A\u6392\u884C\u699C\u3002" }))] })) : panel.id === "plugin-finder-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "\u53EA\u8BFB Registry \u641C\u7D22" }), _jsxs("span", { className: "font-mono text-[#65707b]", children: ["\u5173\u952E\u8BCD ", value(data?.keyword ?? "pi-harness"), " \u00B7 \u4E0A\u9650 ", value(data?.limit ?? "—")] })] }), data?.query ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between text-[11px] text-[#65707b]", children: [_jsxs("span", { children: ["\u67E5\u8BE2\uFF1A", value(data.query)] }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data.total ?? 0), " \u4E2A\u7ED3\u679C"] })] }), Array.isArray(data?.results) && data.results.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: data.results.slice(0, 5).map((result, index) => {
682
- const item = result && typeof result === "object" ? result : {};
683
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("strong", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(item.name ?? "未知插件") }), _jsxs("span", { className: "font-mono text-[10px] text-[#687381]", children: ["v", value(item.version ?? "—")] })] }), _jsx("p", { className: "mt-1 truncate text-[10px] text-[#687381]", children: value(item.description, "") })] }, `${value(item.name ?? "plugin")}-${index}`));
684
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u63D2\u4EF6\u3002" }))] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 plugin_search \u641C\u7D22 npm Registry\u3002" }))] })) : panel.id === "memory-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "\u8DE8\u4F1A\u8BDD\u8BB0\u5FC6" }), _jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(data?.count ?? 0), " \u6761"] })] }), Array.isArray(data?.memories) && data.memories.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: data.memories.slice(0, 5).map((memory, index) => {
685
- const item = memory && typeof memory === "object" ? memory : {};
686
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsx("strong", { className: "block truncate font-mono text-[11px] text-[#30343b]", children: value(item.key ?? "未知键") }), _jsx("p", { className: "mt-1 truncate text-[10px] text-[#687381]", children: value(item.value, "") })] }, `${value(item.key ?? "memory")}-${index}`));
687
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u4FDD\u5B58\u8BB0\u5FC6\u3002Agent \u53EF\u8C03\u7528 memory_set \u660E\u786E\u5199\u5165\u3002" }))] })) : panel.id === "graph-memory-panel" ? ((() => {
688
- const kinds = data?.kinds !== null && typeof data?.kinds === "object" ? data.kinds : {};
689
- const recent = Array.isArray(data?.recent) ? data.recent : [];
690
- const recentRelations = Array.isArray(data?.recentRelations) ? data.recentRelations : [];
691
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
692
- ["任务", kinds.task ?? 0, "bg-[#3565c5]"],
693
- ["技能", kinds.skill ?? 0, "bg-[#22a06b]"],
694
- ["事件", kinds.event ?? 0, "bg-[#d97706]"],
695
- ].map(([label, count, color]) => (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-[#687381]", children: [_jsx("span", { className: `h-1.5 w-1.5 rounded-full ${value(color)}` }), value(label)] }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#30343b]", children: value(count) })] }, value(label)))) }), _jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u672C\u5730\u5173\u7CFB\u56FE" }), _jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(data?.nodes ?? 0), " \u8282\u70B9 \u00B7 ", value(data?.relations ?? 0), " \u5173\u7CFB"] })] }), recent.length > 0 ? (_jsxs("ul", { className: "grid gap-1.5", children: [_jsxs("li", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: ["\u6700\u8FD1\u8282\u70B9 ", Math.min(recent.length, 5), " / ", value(data?.nodes ?? recent.length)] }), recent.slice(0, 5).map((entry, index) => {
696
- const item = entry !== null && typeof entry === "object" ? entry : {};
697
- const kind = item.kind === "task" || item.kind === "skill" || item.kind === "event" ? item.kind : "unknown";
698
- const kindLabel = kind === "task" ? "任务" : kind === "skill" ? "技能" : kind === "event" ? "事件" : "未知";
699
- const kindClass = kind === "task"
700
- ? "bg-[#edf3fe] text-[#315fb8]"
701
- : kind === "skill"
702
- ? "bg-[#eaf8f0] text-[#14733f]"
703
- : kind === "event"
704
- ? "bg-[#fff4e5] text-[#a15c00]"
705
- : "bg-[#f2f3f5] text-[#65707b]";
706
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: `rounded px-1.5 py-0.5 text-[9px] font-semibold ${kindClass}`, children: kindLabel }), _jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(item.label ?? "未命名节点") })] }), _jsx("p", { className: "mt-1 line-clamp-2 text-[10px] leading-4 text-[#65707b]", children: value(item.summary, "") }), item.source ? _jsxs("p", { className: "mt-1 truncate font-mono text-[9px] text-[#687381]", children: ["\u6765\u6E90\uFF1A", value(item.source)] }) : null] }, `${value(item.id ?? "node")}-${index}`));
707
- })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u8BB0\u5F55\u56FE\u8BB0\u5FC6\u3002Agent \u53EF\u8C03\u7528 graph_memory_record \u521B\u5EFA\u4EFB\u52A1\u3001\u6280\u80FD\u6216\u4E8B\u4EF6\u8282\u70B9\u3002" })), recentRelations.length > 0 ? (_jsxs("div", { className: "grid gap-1 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-2", children: [_jsxs("span", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: ["\u6700\u8FD1\u5173\u7CFB ", Math.min(recentRelations.length, 3), " / ", value(data?.relations ?? recentRelations.length)] }), recentRelations.slice(0, 3).map((entry, index) => {
708
- const relation = entry !== null && typeof entry === "object" ? entry : {};
709
- return (_jsxs("div", { className: "flex min-w-0 items-center gap-1.5 font-mono text-[9px] text-[#65707b]", children: [_jsx("span", { className: "truncate", children: value(relation.fromLabel ?? relation.from ?? "节点") }), _jsxs("span", { className: "shrink-0 text-[#3565c5]", children: ["\u2014", value(relation.relation ?? "RELATED_TO"), "\u2192"] }), _jsx("span", { className: "truncate", children: value(relation.toLabel ?? relation.to ?? "节点") })] }, `${value(relation.id ?? "relation")}-${index}`));
710
- })] })) : null] }));
711
- })()) : panel.id === "taskboard-panel" ? ((() => {
712
- const counts = data?.counts !== null && typeof data?.counts === "object" ? data.counts : {};
713
- const recent = Array.isArray(data?.recent) ? data.recent : [];
714
- const lanes = [
715
- ["待办", "todo", "bg-[#edf3fe] text-[#315fb8]"],
716
- ["进行中", "in_progress", "bg-[#fff4e5] text-[#a15c00]"],
717
- ["待验收", "in_review", "bg-[#f0edff] text-[#6b4fc3]"],
718
- ["已完成", "done", "bg-[#eaf8f0] text-[#14733f]"],
719
- ];
720
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u5F53\u524D\u5DE5\u4F5C\u533A\u4EFB\u52A1" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data?.total ?? 0), " \u4E2A"] })] }), _jsx("div", { className: "grid grid-cols-2 gap-2", children: lanes.map(([label, key, color]) => (_jsx("div", { className: "rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2", children: _jsxs("div", { className: "flex items-center justify-between text-[10px] text-[#687381]", children: [_jsx("span", { children: label }), _jsx("span", { className: `rounded px-1.5 py-0.5 ${color}`, children: value(counts[key] ?? 0) })] }) }, key))) }), recent.length > 0 ? (_jsxs("ul", { className: "grid gap-1.5", children: [_jsxs("li", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: ["\u6700\u8FD1\u4EFB\u52A1 ", Math.min(recent.length, 5), " / ", value(data?.total ?? recent.length)] }), recent.slice(0, 5).map((entry, index) => {
721
- const task = entry !== null && typeof entry === "object" ? entry : {};
722
- const status = typeof task.status === "string" ? task.status : "unknown";
723
- const priority = typeof task.priority === "string" ? task.priority : "medium";
724
- const statusLabel = status === "backlog"
725
- ? "待规划"
726
- : status === "todo"
727
- ? "待办"
728
- : status === "in_progress"
729
- ? "进行中"
730
- : status === "in_review"
731
- ? "待验收"
732
- : status === "blocked"
733
- ? "阻塞"
734
- : status === "canceled"
735
- ? "已取消"
736
- : status === "done"
737
- ? "已完成"
738
- : "未知";
739
- const statusClass = status === "done"
740
- ? "bg-[#eaf8f0] text-[#14733f]"
741
- : status === "blocked" || status === "canceled"
742
- ? "bg-[#fff5f5] text-[#b42318]"
743
- : status === "unknown"
744
- ? "bg-[#f2f3f5] text-[#65707b]"
745
- : "bg-[#edf3fe] text-[#315fb8]";
746
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "font-mono text-[10px] text-[#3565c5]", children: value(task.key ?? "PIH-?") }), _jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(task.title ?? "未命名任务") }), _jsx("span", { className: `rounded px-1.5 py-0.5 text-[9px] ${statusClass}`, children: statusLabel })] }), _jsxs("div", { className: "mt-1 flex items-center gap-2 text-[9px] text-[#687381]", children: [_jsxs("span", { children: ["\u4F18\u5148\u7EA7 ", priority] }), task.dueDate ? _jsxs("span", { children: ["\u622A\u6B62 ", value(task.dueDate)] }) : null] })] }, `${value(task.id ?? "task")}-${index}`));
747
- })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u521B\u5EFA\u4EFB\u52A1\u3002Agent \u53EF\u8C03\u7528 taskboard_create \u521B\u5EFA\u5E26\u7A33\u5B9A\u7F16\u53F7\u7684\u4EFB\u52A1\u3002" }))] }));
748
- })()) : panel.id === "skill-catalog-panel" ? ((() => {
749
- const skills = Array.isArray(data?.skills) ? data.skills : [];
750
- const servers = Array.isArray(data?.mcpServers) ? data.mcpServers : [];
751
- const diagnostics = Array.isArray(data?.diagnostics) ? data.diagnostics : [];
752
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "Skills" }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#315fb8]", children: value(data?.skillCount ?? 0) })] }), _jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "MCP \u670D\u52A1\u5668" }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#315fb8]", children: value(data?.mcpCount ?? 0) })] })] }), skills.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: skills.slice(0, 8).map((entry, index) => {
753
- const item = entry !== null && typeof entry === "object" ? entry : {};
754
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(item.name, "未命名技能") }), _jsx("span", { className: "rounded bg-[#f2f3f5] px-1.5 py-0.5 text-[9px] text-[#65707b]", children: value(item.scope, "unknown") })] }), _jsx("p", { className: "mt-1 line-clamp-2 text-[10px] text-[#687381]", children: value(item.description, "无描述") })] }, `${value(item.name ?? "skill")}-${index}`));
755
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5F53\u524D\u8FD0\u884C\u65F6\u6CA1\u6709\u52A0\u8F7D Skill\u3002" })), servers.length > 0 ? (_jsxs("div", { children: [_jsx("div", { className: "mb-1 text-[10px] font-semibold text-[#65707b]", children: "MCP \u72B6\u6001" }), _jsx("ul", { className: "grid gap-1.5", children: servers.slice(0, 6).map((entry, index) => {
756
- const item = entry !== null && typeof entry === "object" ? entry : {};
757
- const running = item.status === "running";
758
- return (_jsxs("li", { className: "flex items-center justify-between rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: "truncate font-mono text-[#65707b]", children: value(item.id, "未命名服务器") }), _jsx("span", { className: `rounded px-1.5 py-0.5 ${running ? "bg-[#eaf8f0] text-[#14733f]" : "bg-[#f2f3f5] text-[#65707b]"}`, children: value(item.status, "unknown") })] }, `${value(item.id ?? "server")}-${index}`));
759
- }) })] })) : null, diagnostics.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-[#fff0c2] bg-[#fffaf0] px-3 py-2 text-[10px] text-[#8a5a00]", children: ["\u8D44\u6E90\u8BCA\u65AD\uFF1A", diagnostics.length, " \u6761\u8B66\u544A"] })) : null, _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u53EA\u8BFB\u67E5\u770B runtime \u5DF2\u52A0\u8F7D\u7684 Skill \u4E0E MCP \u72B6\u6001\uFF1B\u914D\u7F6E\u5199\u5165\u4ECD\u7531\u5404\u81EA\u63D2\u4EF6\u8D1F\u8D23\u3002" })] }));
760
- })()) : panel.id === "cost-meter-panel" ? ((() => {
761
- const budget = typeof data?.budget === "number" ? data.budget : null;
762
- const budgetPercent = typeof data?.budgetPercent === "number" ? data.budgetPercent : null;
763
- const entries = Array.isArray(data?.entries) ? data.entries : [];
764
- const budgetClass = budgetPercent !== null && budgetPercent >= 100
765
- ? "text-[#b42318]"
766
- : budgetPercent !== null && budgetPercent >= 80
767
- ? "text-[#a15c00]"
768
- : "text-[#14733f]";
769
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
770
- ["今日", `$${Number(data?.todayCost ?? 0).toFixed(4)}`],
771
- ["当前会话", `$${Number(data?.sessionCost ?? 0).toFixed(4)}`],
772
- ["累计", `$${Number(data?.lifetimeCost ?? 0).toFixed(4)}`],
773
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block font-mono text-[15px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between text-[11px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u6BCF\u65E5\u9884\u7B97" }), _jsx("strong", { className: budgetClass, children: budget === null ? "未设置" : `$${budget.toFixed(4)} · ${budgetPercent?.toFixed(2) ?? "0.00"}%` })] }), budget !== null ? (_jsx("div", { className: "mt-2 h-1.5 overflow-hidden rounded-full bg-[#dfe8f7]", children: _jsx("div", { className: `h-full ${budgetPercent !== null && budgetPercent >= 100 ? "bg-[#d64545]" : "bg-[#4c83e8]"}`, style: { width: `${Math.min(100, budgetPercent ?? 0)}%` } }) })) : null] }), entries.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: entries.slice(0, 5).map((entry, index) => {
774
- const item = entry !== null && typeof entry === "object" ? entry : {};
775
- return (_jsxs("li", { className: "flex items-center justify-between rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: "truncate font-mono text-[#65707b]", children: value(item.sessionId ?? "未知会话") }), _jsxs("strong", { className: "font-mono text-[#30343b]", children: ["$", Number(item.cost ?? 0).toFixed(4)] })] }, `${value(item.sessionId ?? "session")}-${index}`));
776
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u8BB0\u5F55\u5DF2\u5B8C\u6210\u4F1A\u8BDD\u3002Agent \u53EF\u8C03\u7528 cost_report \u7684 refresh \u64CD\u4F5C\u5199\u5165\u8D26\u672C\u3002" })), _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u4EC5\u8BB0\u5F55\u8FD0\u884C\u65F6\u62A5\u544A\u7684\u5B9E\u9645\u6210\u672C\uFF0C\u4E0D\u5185\u7F6E\u6216\u731C\u6D4B\u6A21\u578B\u4EF7\u683C\u3002" })] }));
777
- })()) : panel.id === "undo-savepoint-panel" ? ((() => {
778
- const savepoints = Array.isArray(data?.savepoints) ? data.savepoints : [];
779
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u4FDD\u5B58\u70B9" }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#315fb8]", children: value(data?.count ?? savepoints.length) })] }), _jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u8DDF\u8E2A\u8DEF\u5F84" }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#315fb8]", children: value(Array.isArray(data?.trackedPaths) ? data.trackedPaths.length : 0) })] })] }), savepoints.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: savepoints.slice(0, 6).map((entry, index) => {
780
- const item = entry !== null && typeof entry === "object" ? entry : {};
781
- return (_jsx("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "font-mono text-[10px] text-[#3565c5]", children: value(item.id, "unknown") }), _jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(item.reason, "manual savepoint") }), _jsxs("span", { className: "text-[9px] text-[#687381]", children: [value(item.fileCount, "0"), " \u6587\u4EF6"] })] }) }, `${value(item.id ?? "savepoint")}-${index}`));
782
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u521B\u5EFA\u4FDD\u5B58\u70B9\u3002\u4FEE\u6539\u914D\u7F6E\u6216\u63D2\u4EF6\u4EE3\u7801\u524D\uFF0C\u8BA9 Agent \u8C03\u7528 undo_savepoint \u7684 save \u64CD\u4F5C\u3002" })), _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u6062\u590D\u64CD\u4F5C\u8981\u6C42 confirm=true\uFF1B\u654F\u611F\u6587\u4EF6\u3001\u4E8C\u8FDB\u5236\u6587\u4EF6\u548C\u4F9D\u8D56\u76EE\u5F55\u4E0D\u4F1A\u8FDB\u5165\u4FDD\u5B58\u70B9\u3002" })] }));
783
- })()) : panel.id === "annotation-panel" ? ((() => {
784
- const annotations = Array.isArray(data?.annotations) ? data.annotations : [];
785
- const lastPrompt = typeof data?.lastPrompt === "string" ? data.lastPrompt : "";
786
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u5F85\u53D1\u9001\u6279\u6CE8" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data?.count ?? 0), " \u6761"] })] }), annotations.length > 0 ? (_jsx("ol", { className: "grid gap-1.5", children: annotations.slice(0, 8).map((entry, index) => {
787
- const item = entry !== null && typeof entry === "object" ? entry : {};
788
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-start gap-2 text-[10px]", children: [_jsxs("span", { className: "rounded bg-[#edf3fe] px-1.5 py-0.5 font-mono text-[#315fb8]", children: ["#", value(item.id ?? index + 1)] }), _jsx("p", { className: "min-w-0 flex-1 whitespace-pre-wrap text-[#30343b]", children: value(item.quote, "") })] }), item.note ? _jsx("p", { className: "mt-1 pl-8 text-[10px] text-[#687381]", children: value(item.note) }) : null] }, `${value(item.id ?? index)}-${index}`));
789
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u6536\u96C6\u6279\u6CE8\u3002Agent \u53EF\u8C03\u7528 annotation_manage \u7684 add \u64CD\u4F5C\u8BB0\u5F55\u56DE\u590D\u7247\u6BB5\u3002" })), lastPrompt ? (_jsxs("details", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]", children: [_jsx("summary", { className: "cursor-pointer text-[#65707b]", children: "\u6700\u8FD1\u751F\u6210\u7684\u63D0\u95EE\u4E0A\u4E0B\u6587" }), _jsx("pre", { className: "mt-2 max-h-40 overflow-auto whitespace-pre-wrap text-[10px] text-[#30343b]", children: lastPrompt })] })) : null, _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u6279\u6CE8\u6309\u7F16\u53F7\u7D2F\u79EF\uFF1B\u751F\u6210\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u6539\u5199\u539F\u4F1A\u8BDD\u6D88\u606F\u3002" })] }));
790
- })()) : panel.id === "runtime-doctor-panel" ? ((() => {
791
- const status = value(data?.status ?? "unknown");
792
- const checks = Array.isArray(data?.checks) ? data.checks : [];
793
- const recommendations = Array.isArray(data?.recommendations) ? data.recommendations : [];
794
- const statusClass = status === "ok" ? "bg-[#eaf8f0] text-[#14733f]" : status === "warning" ? "bg-[#fff7e8] text-[#a15c00]" : "bg-[#fff0f0] text-[#b42318]";
795
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2", children: [_jsx("span", { className: "text-[11px] text-[#65707b]", children: "\u8FD0\u884C\u65F6\u8FB9\u754C\u68C0\u67E5" }), _jsx("span", { className: `rounded px-2 py-0.5 font-mono text-[10px] uppercase ${statusClass}`, children: status })] }), _jsx("div", { className: "grid gap-1.5", children: checks.map((entry, index) => {
796
- const check = entry !== null && typeof entry === "object" ? entry : {};
797
- const checkStatus = value(check.status ?? "unknown");
798
- const checkClass = checkStatus === "ok"
799
- ? "bg-[#eaf8f0] text-[#14733f]"
800
- : checkStatus === "warning"
801
- ? "bg-[#fff7e8] text-[#a15c00]"
802
- : "bg-[#fff0f0] text-[#b42318]";
803
- return (_jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${checkStatus === "ok" ? "bg-[#22c55e]" : checkStatus === "warning" ? "bg-[#e6a21a]" : "bg-[#d64545]"}` }), _jsx("code", { className: "w-20 shrink-0 text-[#65707b]", children: value(check.id ?? "check") }), _jsx("span", { className: "min-w-0 flex-1 truncate text-[#30343b]", children: value(check.detail ?? "—") }), _jsx("span", { className: `rounded px-1.5 py-0.5 font-mono ${checkClass}`, children: checkStatus })] }, `${value(check.id ?? "check")}-${index}`));
804
- }) }), recommendations.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-[#f3dfab] bg-[#fffaf0] px-3 py-2 text-[10px] text-[#8a6200]", children: [_jsx("strong", { children: "\u5EFA\u8BAE" }), _jsx("ul", { className: "mt-1 grid gap-1 pl-4", children: recommendations.slice(0, 5).map((item, index) => (_jsx("li", { children: value(item) }, `${value(item)}-${index}`))) })] })) : null] }));
805
- })()) : panel.id === "plugin-check-panel" ? ((() => {
806
- const latest = data?.latest !== null && typeof data?.latest === "object" ? data.latest : undefined;
807
- const checks = latest?.checks !== null && typeof latest?.checks === "object" ? latest.checks : undefined;
808
- const errors = Array.isArray(latest?.errors) ? latest.errors : [];
809
- const warnings = Array.isArray(latest?.warnings) ? latest.warnings : [];
810
- const reports = Array.isArray(latest?.reports) ? latest.reports : [];
811
- const schema = Array.isArray(latest?.checks) ? latest.checks : [];
812
- const verdict = value(latest?.verdict ?? "—");
813
- const verdictClass = verdict === "pass" ? "bg-[#eaf8f0] text-[#14733f]" : verdict === "warn" ? "bg-[#fff7e8] text-[#a15c00]" : "bg-[#fff0f0] text-[#b42318]";
814
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [latest?.scanned !== undefined ? (_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u76EE\u5F55\u626B\u63CF" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(latest.scanned), " \u4E2A\u4ED3\u5E93"] })] })) : latest?.verdict !== undefined ? (_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f8fafc] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "truncate text-[#65707b]", children: value(latest.repo ?? "当前插件") }), _jsx("span", { className: `rounded px-1.5 py-0.5 font-mono ${verdictClass}`, children: verdict })] })) : schema.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px] text-[#65707b]", children: ["\u68C0\u67E5\u6E05\u5355\uFF1A", schema.length, " \u9879"] })) : null, checks ? (_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
815
- ["通过", checks.passed ?? 0],
816
- ["失败", checks.failed ?? 0],
817
- ["警告", checks.warned ?? 0],
818
- ].map(([label, count]) => (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#30343b]", children: value(count) })] }, value(label)))) })) : null, reports.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: reports.slice(0, 6).map((entry, index) => {
819
- const report = entry !== null && typeof entry === "object" ? entry : {};
820
- const state = value(report.verdict ?? "—");
821
- return (_jsxs("li", { className: "flex items-center justify-between rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: "truncate font-mono text-[#65707b]", children: value(report.repo ?? "未知仓库") }), _jsx("span", { className: `rounded px-1.5 py-0.5 ${state === "pass" ? "bg-[#eaf8f0] text-[#14733f]" : state === "warn" ? "bg-[#fff7e8] text-[#a15c00]" : "bg-[#fff0f0] text-[#b42318]"}`, children: state })] }, `${value(report.repo ?? "repo")}-${index}`));
822
- }) })) : errors.length > 0 || warnings.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: [...errors, ...warnings].slice(0, 5).map((entry, index) => {
823
- const item = entry !== null && typeof entry === "object" ? entry : {};
824
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("strong", { className: "font-mono text-[#b42318]", children: value(item.code ?? "issue") }), _jsx("p", { className: "mt-1 text-[#65707b]", children: value(item.message, "") })] }, `${value(item.code ?? "issue")}-${index}`));
825
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u68C0\u67E5\u63D2\u4EF6\u3002Agent \u53EF\u8C03\u7528 plugin_check \u6267\u884C check\u3001scan \u6216 schema\u3002" })), _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u53EA\u8BFB\u68C0\u67E5\uFF0C\u4E0D\u4FEE\u6539\u3001\u4E0D\u6784\u5EFA\u88AB\u68C0\u4ED3\u5E93\u3002" })] }));
826
- })()) : panel.id === "plugin-radar-panel" ? ((() => {
827
- const results = Array.isArray(data?.results) ? data.results : [];
828
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-2 text-[10px]", children: [_jsx("span", { className: "text-[#65707b]", children: "GitHub DSH \u751F\u6001" }), _jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(data?.total ?? 0), " \u4E2A\u4ED3\u5E93 \u00B7 ", Array.isArray(data?.sources) ? data.sources.length : 0, " \u4E2A\u6765\u6E90"] })] }), data?.query ? _jsxs("div", { className: "text-[11px] text-[#65707b]", children: ["\u67E5\u8BE2\uFF1A", value(data.query)] }) : null, results.length > 0 ? (_jsx("ol", { className: "grid gap-1.5", children: results.slice(0, 8).map((entry, index) => {
829
- const item = entry !== null && typeof entry === "object" ? entry : {};
830
- const topics = Array.isArray(item.topics) ? item.topics.filter((topic) => typeof topic === "string").slice(0, 3) : [];
831
- const url = typeof item.url === "string" ? item.url : undefined;
832
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-4 shrink-0 text-right font-mono text-[10px] text-[#687381]", children: index + 1 }), url ? (_jsx("a", { className: "min-w-0 flex-1 truncate font-mono text-[11px] text-[#315fb8] hover:underline", href: url, rel: "noreferrer", target: "_blank", children: value(item.fullName ?? item.name ?? "未知仓库") })) : (_jsx("strong", { className: "min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]", children: value(item.fullName ?? item.name ?? "未知仓库") })), _jsxs("span", { className: "shrink-0 font-mono text-[10px] text-[#a15c00]", children: ["\u2605 ", value(item.stars ?? 0)] })] }), _jsx("p", { className: "mt-1 truncate pl-6 text-[10px] text-[#65707b]", children: value(item.description, "暂无描述") }), _jsxs("div", { className: "mt-1 flex min-w-0 items-center gap-2 pl-6 text-[9px] text-[#687381]", children: [item.language ? _jsx("span", { children: value(item.language) }) : null, item.updatedAt ? _jsxs("span", { className: "font-mono", children: ["\u66F4\u65B0 ", value(item.updatedAt)] }) : null, topics.length > 0 ? _jsx("span", { className: "truncate", children: topics.map((topic) => `#${topic}`).join(" ") }) : null] })] }, `${value(item.fullName ?? "repo")}-${index}`));
833
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u641C\u7D22\u63D2\u4EF6\u3002Agent \u53EF\u8C03\u7528 plugin_radar_search \u4ECE GitHub \u53D1\u73B0 DSH \u63D2\u4EF6\u3002" })), _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u53EA\u8BFB GitHub \u641C\u7D22\uFF0C\u6309 Star \u964D\u5E8F\uFF1B\u4E0D\u4F1A\u5B89\u88C5\u3001\u6267\u884C\u6216\u4FEE\u6539\u7B2C\u4E09\u65B9\u4ED3\u5E93\u3002" })] }));
834
- })()) : panel.id === "hol-guard-panel" ? ((() => {
835
- const receipts = Array.isArray(data?.receipts) ? data.receipts : [];
836
- const latest = data?.latest !== null && typeof data?.latest === "object" ? data.latest : undefined;
837
- const riskLabel = (risk) => (risk === "blocked" ? "已阻断" : risk === "review" ? "需复核" : "安全");
838
- const riskClass = (risk) => risk === "blocked" ? "bg-[#fff0f0] text-[#b42318]" : risk === "review" ? "bg-[#fff7e8] text-[#a15c00]" : "bg-[#eaf8f0] text-[#14733f]";
839
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
840
- ["已阻断", data?.blocked ?? 0],
841
- ["需复核", data?.review ?? 0],
842
- ["安全", data?.safe ?? 0],
843
- ].map(([label, count]) => (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#30343b]", children: value(count) })] }, value(label)))) }), latest ? (_jsxs("div", { className: `flex items-center justify-between rounded-lg border border-[#e3e7ee] px-3 py-2 text-[10px] ${riskClass(latest.risk)}`, children: [_jsxs("span", { children: ["\u6700\u8FD1\u4E00\u6B21\uFF1A", value(latest.source, "unknown")] }), _jsxs("strong", { children: [riskLabel(latest.risk), " \u00B7 ", value(latest.findings && Array.isArray(latest.findings) ? latest.findings.length : 0), " \u9879"] })] })) : null, receipts.length > 0 ? (_jsxs("ul", { className: "grid gap-1.5", children: [_jsx("li", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: "\u6700\u8FD1\u98CE\u9669\u6458\u8981" }), receipts.slice(0, 8).map((entry, index) => {
844
- const receipt = entry !== null && typeof entry === "object" ? entry : {};
845
- const findings = Array.isArray(receipt.findings) ? receipt.findings : [];
846
- return (_jsxs("li", { className: "flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: `rounded px-1.5 py-0.5 ${riskClass(receipt.risk)}`, children: riskLabel(receipt.risk) }), _jsx("span", { className: "min-w-0 flex-1 truncate font-mono text-[#65707b]", children: value(receipt.source, "unknown") }), _jsxs("span", { className: "text-[#687381]", children: [findings.length, " \u9879"] })] }, `${value(receipt.source)}-${index}`));
847
- })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5C1A\u672A\u6536\u5230\u5DE5\u5177\u8C03\u7528\u3002Agent \u53EF\u8C03\u7528 hol_guard_scan \u9884\u68C0\u547D\u4EE4\u6216\u6587\u672C\u3002" })), _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u4EC5\u4FDD\u5B58\u98CE\u9669\u6458\u8981\u548C\u8BA1\u6570\uFF0C\u4E0D\u4FDD\u5B58\u547D\u4EE4\u3001\u8DEF\u5F84\u6216\u51ED\u636E\u539F\u6587\uFF1B\u5F53\u524D\u6A21\u5F0F\u4E3A\u5BA1\u8BA1\u3002" })] }));
848
- })()) : panel.id === "synapse-panel" ? ((() => {
849
- const nodes = Array.isArray(data?.nodes) ? data.nodes : [];
850
- const edges = Array.isArray(data?.edges) ? data.edges : [];
851
- const nodeById = new Map(nodes.filter((entry) => entry !== null && typeof entry === "object").map((entry) => [value(entry.id), entry]));
852
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
853
- ["会话", data?.nodes ?? 0],
854
- ["分支", data?.edges ?? 0],
855
- ["孤儿", data?.orphanCount ?? 0],
856
- ].map(([label, count]) => (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-[#f8fafc] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block font-mono text-[17px] text-[#30343b]", children: value(count) })] }, value(label)))) }), data?.activeSessionId ? (_jsxs("div", { className: "rounded-lg border border-[#b9d0ff] bg-[#f1f6ff] px-3 py-2 text-[10px] text-[#315fb8]", children: ["\u5F53\u524D\u4F1A\u8BDD\uFF1A", _jsx("code", { className: "font-mono", children: value(data.activeSessionId) })] })) : null, nodes.length > 0 ? (_jsxs("ul", { className: "grid gap-1.5", children: [_jsxs("li", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: ["\u6700\u8FD1\u4F1A\u8BDD ", Math.min(nodes.length, 8), " / ", nodes.length] }), nodes.slice(0, 8).map((entry, index) => {
857
- const node = entry !== null && typeof entry === "object" ? entry : {};
858
- return (_jsxs("li", { className: `rounded-lg border px-3 py-2 ${node.active === true ? "border-[#b9d0ff] bg-[#f7faff]" : "border-[#edf0f3] bg-white"}`, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: `h-2 w-2 shrink-0 rounded-full ${node.active === true ? "bg-[#3565c5]" : "bg-[#c4ccd6]"}` }), _jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(node.label ?? node.sessionId ?? "未命名会话") }), _jsxs("span", { className: "font-mono text-[9px] text-[#687381]", children: [value(node.messageCount ?? 0), " \u6761\u6D88\u606F"] })] }), _jsxs("div", { className: "mt-1 flex items-center gap-2 text-[9px] text-[#687381]", children: [_jsx("span", { className: "min-w-0 flex-1 truncate font-mono", children: value(node.cwd ?? "未知工作区") }), _jsxs("span", { children: [value(node.branchCount ?? 0), " \u4E2A\u5206\u652F"] })] })] }, `${value(node.id ?? "session")}-${index}`));
859
- })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5F53\u524D\u5DE5\u4F5C\u533A\u8FD8\u6CA1\u6709\u53EF\u6295\u5F71\u7684\u6301\u4E45\u5316\u4F1A\u8BDD\u3002" })), edges.length > 0 ? (_jsxs("div", { className: "grid gap-1 rounded-lg border border-[#edf0f3] bg-[#fbfcfd] px-3 py-2", children: [_jsx("span", { className: "text-[9px] uppercase tracking-[0.08em] text-[#687381]", children: "Fork \u5173\u7CFB" }), edges.slice(0, 5).map((entry, index) => {
860
- const edge = entry !== null && typeof entry === "object" ? entry : {};
861
- const from = nodeById.get(value(edge.from));
862
- const to = nodeById.get(value(edge.to));
863
- return (_jsxs("div", { className: "flex min-w-0 items-center gap-1.5 font-mono text-[9px] text-[#65707b]", children: [_jsx("span", { className: "truncate", children: value(from?.label ?? edge.from) }), _jsx("span", { className: "shrink-0 text-[#3565c5]", children: "\u2192 fork \u2192" }), _jsx("span", { className: "truncate", children: value(to?.label ?? edge.to) })] }, `${value(edge.from)}-${value(edge.to)}-${index}`));
864
- })] })) : null, _jsx("div", { className: "text-[10px] text-[#687381]", children: "\u6570\u636E\u6765\u6E90\uFF1APi \u539F\u751F JSONL \u4F1A\u8BDD\uFF1BAgent \u53EF\u8C03\u7528 synapse_session_map \u5237\u65B0\u3002" })] }));
865
- })()) : panel.id === "archify-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest && typeof data.latest === "object" ? ((() => {
866
- const report = data.latest;
867
- const components = Array.isArray(report.components) ? report.components : [];
868
- const dependencies = Array.isArray(report.dependencies) ? report.dependencies : [];
869
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u7EC4\u4EF6" }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(components.length) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u5916\u90E8\u4F9D\u8D56" }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(dependencies.length) })] })] }), _jsx("div", { className: "grid gap-1.5", children: components.slice(0, 8).map((entry, index) => {
870
- const component = entry !== null && typeof entry === "object" ? entry : {};
871
- return (_jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2 text-[11px]", children: [_jsx("span", { className: "h-2 w-2 rounded-full bg-[#3565c5]" }), _jsx("span", { className: "min-w-0 flex-1 truncate font-mono text-[#30343b]", children: value(component.path ?? "组件") }), _jsxs("span", { className: "font-mono text-[10px] text-[#687381]", children: [value(component.files ?? 0), " files"] })] }, `${value(component.path ?? "component")}-${index}`));
872
- }) }), dependencies.length > 0 ? (_jsx("div", { className: "flex flex-wrap gap-1.5", children: dependencies.slice(0, 12).map((dependency, index) => (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-[#f6f8ff] px-2 py-1 font-mono text-[10px] text-[#315fb8]", children: value(dependency) }, `${value(dependency)}-${index}`))) })) : null, _jsx("pre", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]", children: value(report.mermaid, "") }), report.truncated === true ? _jsx("p", { className: "text-[10px] text-[#8a5a00]", children: "\u626B\u63CF\u8FBE\u5230\u8282\u70B9\u4E0A\u9650\uFF0C\u67B6\u6784\u56FE\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002" }) : null] }));
873
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 architecture_map \u751F\u6210\u5F53\u524D\u5DE5\u4F5C\u533A\u67B6\u6784\u56FE\u3002" })) })) : panel.id === "canvas-draw-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "Mermaid \u6D41\u7A0B\u56FE" }), _jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(data?.nodeCount ?? 0), " \u8282\u70B9 \u00B7 ", value(data?.edgeCount ?? 0), " \u8FDE\u7EBF"] })] }), data?.latest && typeof data.latest === "object" ? (_jsx("pre", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]", children: value(data.latest.mermaid, "") })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 canvas_draw \u751F\u6210\u6D41\u7A0B\u56FE\u6E90\u7801\u3002" }))] })) : panel.id === "image-compressor-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "PNG \u65E0\u635F\u538B\u7F29" }), _jsx("span", { className: "font-mono text-[#65707b]", children: "\u4E0A\u9650 32 MiB" })] }), data?.last && typeof data.last === "object" ? ((() => {
874
- const report = data.last;
875
- return (_jsxs("div", { className: "rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3 text-[11px] text-[#14733f]", children: [value(report.inputPath ?? "图片"), " \u2192 ", value(report.outputPath ?? "输出"), "\uFF0C\u8282\u7701 ", value(report.savedBytes ?? 0), " bytes"] }));
876
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 image_compress\uFF0C\u5199\u5165\u524D\u5FC5\u987B confirm=true\u3002" }))] })) : panel.id === "workspace-search-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "\u5DE5\u4F5C\u533A\u6587\u672C\u68C0\u7D22" }), _jsxs("span", { className: "font-mono text-[#3565c5]", children: [value(data?.matchCount ?? 0), " \u4E2A\u5339\u914D"] })] }), data?.latest && typeof data.latest === "object" ? ((() => {
877
- const report = data.latest;
878
- const matches = Array.isArray(report.matches) ? report.matches : [];
879
- return matches.length > 0 ? (_jsx("ul", { className: "grid gap-1.5", children: matches.slice(0, 5).map((match, index) => {
880
- const item = match && typeof match === "object" ? match : {};
881
- return (_jsxs("li", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("strong", { className: "block truncate font-mono text-[10px] text-[#3565c5]", children: [value(item.path ?? "未知文件"), ":", value(item.line ?? "?")] }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-[#65707b]", children: value(item.text, "") })] }, `${value(item.path ?? "match")}-${index}`));
882
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u5185\u5BB9\u3002" }));
883
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 workspace_search \u68C0\u7D22\u5F53\u524D\u5DE5\u4F5C\u533A\u3002" }))] })) : panel.id === "recall-unread-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "font-medium text-[#30343b]", children: "\u672A\u56DE\u7B54\u4F1A\u8BDD" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data?.total ?? 0), " \u4E2A"] })] }), Array.isArray(data?.items) && data.items.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.items.slice(0, 8).map((item, index) => {
884
- const session = item !== null && typeof item === "object" ? item : {};
885
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: value(session.name ?? session.id ?? "未命名会话") }), _jsx("p", { className: "mt-1 line-clamp-2 text-[10px] leading-4 text-[#65707b]", children: value(session.message ?? "") })] }, `${value(session.id ?? "session")}-${index}`));
886
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u4EE5\u672A\u56DE\u7B54\u7528\u6237\u6D88\u606F\u7ED3\u675F\u7684\u4F1A\u8BDD\u3002" }))] })) : panel.id === "turn-rewind-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest && typeof data.latest === "object" ? ((() => {
887
- const latest = data.latest;
888
- const target = latest.target !== null && typeof latest.target === "object" ? latest.target : {};
889
- const cancelled = latest.cancelled === true;
890
- return (_jsxs("div", { className: `rounded-lg border px-3 py-3 ${cancelled ? "border-[#f4dfb0] bg-[#fffaf0]" : "border-[#dce5f5] bg-[#f6f8ff]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: "\u6700\u8FD1\u64CD\u4F5C" }), _jsx("span", { className: `rounded-full px-2 py-1 text-[10px] font-semibold ${cancelled ? "bg-[#fff0c7] text-[#9a6700]" : "bg-[#e8f8ee] text-[#14733f]"}`, children: cancelled ? "已取消" : "已回退" })] }), _jsx("p", { className: "mt-2 line-clamp-2 text-[11px] leading-4 text-[#30343b]", children: value(target.text ?? "未命名轮次") })] }));
891
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6267\u884C\u56DE\u9000\u64CD\u4F5C\u3002" })), _jsxs("div", { className: "grid gap-2", children: [_jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.08em] text-[#687381]", children: "\u53EF\u56DE\u9000\u8F6E\u6B21" }), (() => {
892
- const candidates = Array.isArray(data?.candidates) ? data.candidates : [];
893
- return candidates.length > 0 ? (candidates.slice(-8).map((item, index) => {
894
- const candidate = item !== null && typeof item === "object" ? item : {};
895
- return (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsx("span", { className: "mt-0.5 font-mono text-[10px] text-[#3565c5]", children: candidates.length - index }), _jsx("span", { className: "line-clamp-2 min-w-0 flex-1 text-[11px] leading-4 text-[#65707b]", children: value(candidate.text ?? "未命名轮次") })] }, `${value(candidate.entryId ?? "turn")}-${index}`));
896
- })) : (_jsx("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-3 text-[11px] text-[#687381]", children: "\u5F53\u524D\u4F1A\u8BDD\u8FD8\u6CA1\u6709\u53EF\u56DE\u9000\u7684\u7528\u6237\u8F6E\u6B21\u3002" }));
897
- })()] })] })) : panel.id === "skill-guard-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsx("div", { className: "grid grid-cols-3 gap-2", children: [
898
- ["已扫描", data?.total ?? 0],
899
- ["高风险", data?.blocked ?? 0],
900
- ["待复核", data?.review ?? 0],
901
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsx("div", { className: "grid gap-2", children: Array.isArray(data?.reports) && data.reports.length > 0 ? (data.reports.slice(0, 8).map((item, index) => {
902
- const report = item !== null && typeof item === "object" ? item : {};
903
- const risk = report.risk;
904
- const findings = Array.isArray(report.findings) ? report.findings : [];
905
- return (_jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: `h-2 w-2 rounded-full ${risk === "blocked" ? "bg-[#d64545]" : risk === "review" ? "bg-[#e0a11a]" : "bg-[#22a06b]"}` }), _jsx("strong", { className: "min-w-0 flex-1 truncate text-[11px] text-[#30343b]", children: value(report.name ?? "unknown") }), _jsx("span", { className: "text-[10px] text-[#687381]", children: risk === "blocked" ? "阻断" : risk === "review" ? "复核" : "安全" })] }), findings.length > 0 ? (_jsx("p", { className: "mt-1 truncate text-[10px] text-[#65707b]", children: findings
906
- .map((finding) => finding !== null && typeof finding === "object" ? value(finding.code ?? "finding") : value(finding))
907
- .join(" · ") })) : null] }, `${value(report.name ?? "skill")}-${index}`));
908
- })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6682\u65E0 Skill \u626B\u63CF\u7ED3\u679C\uFF0C\u53EF\u8BA9 Agent \u8C03\u7528 skill_guard_scan\u3002" })) })] })) : panel.id === "prompt-guard-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${data?.risk === "blocked" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : data?.risk === "review" ? "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: [_jsx("span", { children: data?.risk === "blocked" ? "高风险,需阻断" : data?.risk === "review" ? "需要人工复核" : "未发现风险" }), _jsxs("strong", { className: "font-mono", children: [value(data?.scans ?? 0), " \u6B21\u626B\u63CF"] })] }), data?.latest && typeof data.latest === "object" ? ((() => {
909
- const report = data.latest;
910
- const findings = Array.isArray(report.findings) ? report.findings : [];
911
- return findings.length > 0 ? (_jsx("ul", { className: "grid gap-1 rounded-lg border border-[#e3e7ee] bg-white px-4 py-3 text-[10px] text-[#65707b]", children: findings.slice(0, 4).map((finding, index) => {
912
- const item = finding && typeof finding === "object" ? finding : {};
913
- return (_jsxs("li", { children: [_jsx("strong", { className: "font-mono text-[#30343b]", children: value(item.code ?? "finding") }), "\uFF1A", value(item.message, "")] }, `${value(item.code ?? "finding")}-${index}`));
914
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6700\u8FD1\u4E00\u6B21\u626B\u63CF\u672A\u53D1\u73B0\u98CE\u9669\u3002" }));
915
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "Agent \u53EF\u8C03\u7528 prompt_guard_scan \u68C0\u67E5\u4E0D\u53EF\u4FE1\u6587\u672C\u3002" }))] })) : panel.id === "code2skill-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u5DF2\u751F\u6210\u6280\u80FD" }), _jsx("strong", { className: "font-mono text-[12px] text-[#315fb8]", children: value(data?.generated ?? 0) })] }), data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? (_jsxs("p", { className: "mt-2 truncate text-[11px] text-[#65707b]", children: [value(data.latest.slug ?? "skill"), " \u00B7", " ", value(Array.isArray(data.latest.files) ? data.latest.files.length : 0), " ", "\u4E2A\u53C2\u8003\u6587\u4EF6"] })) : (_jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u751F\u6210\u6280\u80FD\u3002\u53EF\u8BA9 Agent \u8C03\u7528 skill_pack_create\u3002" }))] }), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u8F93\u51FA\u76EE\u5F55\uFF1A\u9879\u76EE .pi/skills/<name>\uFF0C\u5305\u542B SKILL.md \u548C\u539F\u59CB\u53C2\u8003\u6587\u4EF6\u3002" })] })) : panel.id === "genui-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
916
- const report = data.latest;
917
- const blocks = Array.isArray(report.blocks) ? report.blocks : [];
918
- const toneClass = {
919
- neutral: "border-[#e3e7ee] bg-[#f6f8fa] text-[#65707b]",
920
- info: "border-[#d9e4f7] bg-[#f6f8ff] text-[#315fb8]",
921
- success: "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]",
922
- warning: "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]",
923
- danger: "border-[#f4caca] bg-[#fff5f5] text-[#b42318]",
924
- };
925
- return (_jsxs("div", { className: "grid gap-2", children: [_jsxs("div", { className: "flex items-center justify-between text-[11px]", children: [_jsx("strong", { className: "text-[#30343b]", children: value(report.title ?? "结构化卡片") }), _jsxs("span", { className: "font-mono text-[#687381]", children: [value(data.rendered ?? 0), " \u6B21"] })] }), blocks.map((block, index) => {
926
- const item = block && typeof block === "object" ? block : {};
927
- const tone = value(item.tone ?? "neutral");
928
- const blockValue = item.value;
929
- return item.type === "progress" ? (_jsxs("div", { className: `rounded-lg border px-3 py-2 ${toneClass[tone] ?? toneClass.neutral}`, children: [_jsxs("div", { className: "flex items-center justify-between text-[10px]", children: [_jsx("span", { children: value(item.label ?? "进度") }), _jsxs("strong", { children: [value(blockValue ?? 0), "%"] })] }), _jsx("div", { className: "mt-1 h-1.5 overflow-hidden rounded-full bg-white/70", children: _jsx("div", { className: "h-full rounded-full bg-current", style: { width: `${Math.max(0, Math.min(100, Number(blockValue) || 0))}%` } }) })] }, `${value(item.label)}-${index}`)) : (_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-2 text-[11px] ${toneClass[tone] ?? toneClass.neutral}`, children: [_jsx("span", { className: "text-[#65707b]", children: value(item.label, "") }), _jsx("strong", { children: value(blockValue, "") })] }, `${value(item.label)}-${index}`));
930
- })] }));
931
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u7ED3\u6784\u5316\u5361\u7247\u3002\u53EF\u8BA9 Agent \u8C03\u7528 genui_render\u3002" })), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u4EC5\u6E32\u67D3\u7ED3\u6784\u5316\u6587\u672C\u3001\u5FBD\u6807\u548C\u8FDB\u5EA6\u5757\uFF1BHTML \u4E0E\u811A\u672C\u6309\u666E\u901A\u6587\u672C\u5904\u7406\u3002" })] })) : panel.id === "anchored-standard-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [(() => {
932
- const violations = Array.isArray(data?.violations) ? data.violations : [];
933
- const violated = data?.status === "violated";
934
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${violated ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]"}`, children: [_jsx("span", { children: violated ? "轨迹存在违规" : data?.status === "anchored" ? "运行已锚定" : "等待 Agent 运行" }), _jsxs("strong", { className: "font-mono", children: [value(data?.events ?? 0), " \u4E8B\u4EF6"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 text-[10px] text-[#65707b]", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u5DE5\u5177\u8C03\u7528 ", _jsx("strong", { className: "ml-1 text-[#30343b]", children: value(data?.toolCalls ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u8FDD\u89C4\u9879 ", _jsx("strong", { className: "ml-1 text-[#30343b]", children: value(violations.length) })] })] }), violations.length > 0 ? (_jsx("ul", { className: "grid gap-1 rounded-lg border border-[#f4caca] bg-[#fffafa] px-3 py-2 text-[10px] text-[#b42318]", children: violations.slice(0, 4).map((item, index) => (_jsx("li", { children: value(item && typeof item === "object" ? (item.message ?? "违规") : item) }, `${value(item)}-${index}`))) })) : null] }));
935
- })(), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u53EF\u8BA9 Agent \u8C03\u7528 trajectory_anchor_check \u5BA1\u8BA1\u5F53\u524D\u6267\u884C\u8F68\u8FF9\u3002" })] })) : panel.id === "telemetry-blocker-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3 text-[11px] text-[#14733f]", children: [_jsx("span", { children: "\u9065\u6D4B\u5DF2\u5173\u95ED" }), _jsxs("strong", { className: "font-mono", children: ["\u62E6\u622A ", value(data?.blocked ?? 0), " \u6B21"] })] }), _jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[10px] text-[#65707b]", children: Array.isArray(data?.names) && data.names.length > 0 ? `事件名:${data.names.slice(0, 8).map(String).join("、")}` : "尚未收到遥测事件。" }), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u53EA\u8BB0\u5F55\u4E8B\u4EF6\u540D\u548C\u8BA1\u6570\uFF0C\u4E0D\u4FDD\u7559\u4E8B\u4EF6\u5C5E\u6027\uFF0C\u4E5F\u4E0D\u4F1A\u53D1\u8D77\u7F51\u7EDC\u8BF7\u6C42\u3002" })] })) : panel.id === "plugin-dev-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${data?.status === "reloaded" ? "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]" : data?.status === "failed" ? "border-[#f4caca] bg-[#fff5f5] text-[#b42318]" : "border-[#e3e7ee] bg-[#f6f8fa] text-[#65707b]"}`, children: [_jsx("span", { children: data?.status === "reloaded" ? "插件已重载" : data?.status === "failed" ? "插件重载失败" : "等待重载" }), _jsx("strong", { className: "font-mono", children: value(data?.status ?? "idle") })] }), _jsx("p", { className: "text-[10px] text-[#687381]", children: value(data?.reason ?? "修改本地扩展后调用 plugin_dev_reload") }), data?.error ? _jsx("p", { className: "rounded-lg bg-[#fff5f5] px-3 py-2 text-[10px] text-[#b42318]", children: value(data.error) }) : null] })) : panel.id === "openpets-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-[#e3e7ee] bg-[#f8fafc] px-3 py-3", children: [_jsx("span", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-[#dceaff] text-[20px] text-[#3565c5]", children: "\u25C9" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("strong", { className: "block truncate text-[13px] text-[#30343b]", children: value(data?.name ?? "Pi") }), _jsx("span", { className: "text-[10px] text-[#687381]", children: value(data?.lastEvent ?? "session_start") })] }), _jsx("span", { className: "rounded-full bg-[#edf3fe] px-2 py-1 text-[10px] text-[#3565c5]", children: value(data?.mood ?? "idle") })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 text-[10px] text-[#65707b]", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u80FD\u91CF ", _jsxs("strong", { className: "ml-1 text-[#30343b]", children: [value(data?.energy ?? 0), "%"] })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u4E92\u52A8 ", _jsx("strong", { className: "ml-1 text-[#30343b]", children: value(data?.interactions ?? 0) })] })] }), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u6839\u636E\u771F\u5B9E Pi \u4F1A\u8BDD\u4E8B\u4EF6\u81EA\u52A8\u53CD\u5E94\uFF0C\u4E5F\u53EF\u8BA9 Agent \u8C03\u7528 pet_react \u8FDB\u884C\u4E92\u52A8\u3002" })] })) : panel.id === "change-verifier-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
936
- const report = data.latest;
937
- const tests = report.tests && typeof report.tests === "object" ? report.tests : {};
938
- const review = report.review && typeof report.review === "object" ? report.review : {};
939
- const status = value(report.status ?? "fail");
940
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `flex items-center justify-between rounded-lg border px-3 py-3 text-[11px] ${status === "pass" ? "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]" : status === "warning" ? "border-[#f3dfab] bg-[#fffaf0] text-[#9a6700]" : "border-[#f4caca] bg-[#fff5f5] text-[#b42318]"}`, children: [_jsx("span", { children: status === "pass" ? "门禁通过" : status === "warning" ? "门禁有警告" : "门禁失败" }), _jsxs("strong", { className: "font-mono", children: [value(data.runs ?? 0), " \u6B21"] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2 text-[10px] text-[#65707b]", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u6D4B\u8BD5 exit ", _jsx("strong", { className: "ml-1 text-[#30343b]", children: value(tests.exitCode ?? "—") })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: ["\u5BA1\u67E5 ", _jsx("strong", { className: "ml-1 text-[#30343b]", children: value(review.status ?? "—") })] })] })] }));
941
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6267\u884C\u53D1\u5E03\u95E8\u7981\u3002\u53EF\u8BA9 Agent \u8C03\u7528 verify_change_gate\u3002" })), _jsx("p", { className: "text-[10px] text-[#687381]", children: "\u590D\u7528 run_project_tests \u548C review_changes\uFF0C\u4E0D\u91CD\u590D\u5B9E\u73B0\u6D4B\u8BD5\u6216\u5BA1\u67E5\u903B\u8F91\u3002" })] })) : panel.id === "readme-gen-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.generated === true ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3 text-[11px] text-[#14733f]", children: ["\u5DF2\u751F\u6210 ", value(data.name ?? "项目"), " \u7684 README \u6982\u89C8\uFF1A", value(data.scripts ?? 0), " \u4E2A\u811A\u672C\uFF0C", value(data.plugins ?? 0), " \u4E2A\u8FD0\u884C\u65F6\u63D2\u4EF6\u3002"] }), data.lastWrite && typeof data.lastWrite === "object" ? (_jsxs("div", { className: "rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[11px] text-[#315fb8]", children: ["\u5DF2\u5199\u5165 ", value(data.lastWrite.path ?? "README.generated.md"), " \u00B7", " ", value(data.lastWrite.bytes ?? 0), " bytes", data.lastWrite.overwritten === true ? " · 已覆盖" : " · 新文件"] })) : null, _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u9700\u8981\u843D\u76D8\u65F6\u8C03\u7528 readme_write\uFF0C\u5E76\u663E\u5F0F\u4F20\u5165 confirm=true\uFF1B\u9ED8\u8BA4\u5199\u5165 README.generated.md\u3002" })] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u751F\u6210\u6587\u6863\u3002\u8BA9 Agent \u8C03\u7528 readme_report \u83B7\u53D6 Markdown \u8349\u7A3F\uFF0C\u6216\u8C03\u7528 readme_write \u5199\u5165\u786E\u8BA4\u540E\u7684\u6587\u4EF6\u3002" })) })) : panel.id === "sql-lens-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
942
- const report = data.latest;
943
- const rows = Array.isArray(report.rows) ? report.rows : [];
944
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(report.database ?? "database") }), _jsxs("strong", { className: "font-mono text-[12px] text-[#3565c5]", children: [value(rows.length), " rows"] })] }), _jsx("pre", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]", children: JSON.stringify(rows, null, 2) })] }));
945
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u67E5\u8BE2\u6570\u636E\u5E93\u3002\u53EF\u8BA9 Agent \u8C03\u7528 sql_readonly\u3002" })) })) : panel.id === "theme-studio-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("strong", { className: "block text-[12px] text-[#30343b]", children: value(data?.label ?? "Light") }), _jsx("p", { className: "mt-1 truncate text-[10px] text-[#65707b]", children: value(data?.description ?? "") })] }), _jsx("span", { className: "shrink-0 rounded-full bg-[#edf3fe] px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: value(data?.theme ?? "light") })] }), Array.isArray(data?.presets) ? (_jsx("div", { className: "grid grid-cols-2 gap-2", children: data.presets.map((preset, index) => {
946
- const item = preset !== null && typeof preset === "object" ? preset : {};
947
- const selected = item.id === data.theme;
948
- return (_jsxs("div", { className: `rounded-lg border px-3 py-2 ${selected ? "border-[#9bbcff] bg-[#f6f8ff]" : "border-[#edf0f3] bg-white"}`, children: [_jsx("strong", { className: "block text-[11px] text-[#30343b]", children: value(item.label ?? item.id ?? "主题") }), _jsx("span", { className: "mt-1 block truncate text-[10px] text-[#687381]", children: value(item.description ?? "") })] }, `${value(item.id ?? "theme")}-${index}`));
949
- }) })) : null, _jsx("p", { className: "text-[10px] leading-4 text-[#687381]", children: "\u53EF\u8BA9 Agent \u8C03\u7528 theme_set \u5207\u6362\u9884\u8BBE\uFF1B\u9009\u62E9\u4F1A\u4FDD\u5B58\u5230\u5F53\u524D session\uFF0C\u5E76\u7531 React \u6839\u8282\u70B9\u5E94\u7528 token\u3002" })] })) : panel.id === "mirage-bridge-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: `rounded-lg border px-3 py-3 ${data?.available === true ? "border-[#b9e6c9] bg-[#f0fbf4]" : data?.available === false ? "border-[#f3dfab] bg-[#fffaf0]" : "border-[#e3e7ee] bg-[#f6f8fa]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u5B98\u65B9 Mirage CLI" }), _jsx("strong", { className: `text-[11px] ${data?.available === true ? "text-[#14733f]" : data?.available === false ? "text-[#9a6700]" : "text-[#687381]"}`, children: data?.available === true ? "已连接" : data?.available === false ? "未检测到" : "未检查" })] }), _jsx("p", { className: "mt-2 truncate font-mono text-[10px] text-[#65707b]", children: value(data?.version ?? data?.executable ?? "mirage") }), _jsxs("p", { className: "mt-1 text-[11px] text-[#65707b]", children: ["\u865A\u62DF\u5DE5\u4F5C\u533A\uFF1A", value(data?.workspaceId ?? "未配置")] })] }), data?.lastRun && typeof data.lastRun === "object" ? ((() => {
950
- const run = data.lastRun;
951
- return (_jsxs("div", { className: `rounded-lg border px-3 py-3 ${run.exitCode === 0 ? "border-[#b9e6c9] bg-[#f0fbf4]" : "border-[#f4caca] bg-[#fff5f5]"}`, children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate font-mono text-[10px] text-[#30343b]", children: value(run.command ?? "") }), _jsxs("strong", { className: `shrink-0 text-[11px] ${run.exitCode === 0 ? "text-[#14733f]" : "text-[#b42318]"}`, children: ["exit ", value(run.exitCode ?? "—")] })] }), _jsxs("p", { className: "mt-1 text-[10px] text-[#65707b]", children: ["\u8017\u65F6 ", value(run.durationMs ?? 0), " ms"] })] }));
952
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5148\u8C03\u7528 mirage_doctor \u68C0\u67E5 CLI\uFF0C\u518D\u8C03\u7528 mirage_execute\u3002" })), data?.lastError ? _jsx("p", { className: "text-[10px] leading-4 text-[#9a6700]", children: value(data.lastError) }) : null] })) : panel.id === "docker-sandbox-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
953
- const run = data.latest;
954
- return (_jsxs("div", { className: "rounded-lg border border-[#b9e6c9] bg-[#f0fbf4] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(run.image ?? "image") }), _jsxs("strong", { className: "font-mono text-[12px] text-[#14733f]", children: ["exit ", value(run.exitCode ?? "—")] })] }), _jsx("p", { className: "mt-2 text-[11px] text-[#65707b]", children: Array.isArray(run.command) ? run.command.map((argument) => value(argument)).join(" ") : "argv" })] }));
955
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6C99\u7BB1\u8FD0\u884C\u3002\u9ED8\u8BA4\u65E0\u7F51\u7EDC\u3001\u5DE5\u4F5C\u533A\u53EA\u8BFB\u3002" })), _jsx("div", { className: "flex flex-wrap gap-2", children: data?.defaults !== null && typeof data?.defaults === "object"
956
- ? Object.entries(data.defaults).map(([key, entryValue]) => (_jsxs("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: [key, ":", value(entryValue)] }, key)))
957
- : null })] })) : panel.id === "yaml-validator-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
958
- const report = data.latest;
959
- const errors = Array.isArray(report.errors) ? report.errors : [];
960
- const warnings = Array.isArray(report.warnings) ? report.warnings : [];
961
- const valid = report.valid === true;
962
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${valid ? "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]" : "border-[#f4caca] bg-[#fff5f5] text-[#b42318]"}`, children: valid ? "YAML 语法有效。" : `发现 ${errors.length} 个语法错误。` }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
963
- ["文档", report.documents ?? 0],
964
- ["错误", errors.length],
965
- ["警告", warnings.length],
966
- ].map(([label, entryValue]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(entryValue) })] }, value(label)))) }), !valid && errors.length > 0 ? (_jsx("pre", { className: "max-h-32 overflow-auto rounded-lg border border-[#f4caca] bg-[#fffafa] p-3 text-[10px] leading-4 text-[#b42318]", children: errors
967
- .map((error) => typeof error === "object" && error !== null
968
- ? `${value(error.line ?? "?")}:${value(error.column ?? "?")} ${value(error.message, "")}`
969
- : value(error))
970
- .join("\n") })) : null] }));
971
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6821\u9A8C YAML\u3002\u53EF\u8BA9 Agent \u8C03\u7528 yaml_validate\u3002" })), _jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: "max:512KiB \u00B7 read-only" })] })) : panel.id === "browser-session-panel" ? ((() => {
972
- const tabs = Array.isArray(data?.tabs)
973
- ? browserSessionTabs(data.tabs.flatMap((tab) => {
974
- if (tab === null || typeof tab !== "object")
975
- return [];
976
- const item = tab;
977
- return typeof item.targetId === "string" && typeof item.url === "string"
978
- ? [{ targetId: item.targetId, title: typeof item.title === "string" ? item.title : "", url: item.url }]
979
- : [];
980
- }), 8)
981
- : [];
982
- const latest = data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? data.latest : undefined;
983
- const latestAction = latest?.screenshot
984
- ? "已截图"
985
- : latest?.clicked === true
986
- ? "已点击"
987
- : latest?.text
988
- ? "已读取"
989
- : latest?.status === "navigated"
990
- ? "已导航"
991
- : undefined;
992
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(data?.endpoint ?? "本地浏览器未连接") }), _jsx("span", { className: `rounded-full px-2 py-1 text-[10px] font-semibold ${data?.connected === true ? "bg-[#e8f8ee] text-[#14733f]" : "bg-[#fff4e5] text-[#8a5a00]"}`, children: data?.connected === true ? "已连接" : "未连接" })] }), _jsxs("p", { className: "mt-2 text-[11px] text-[#687381]", children: ["Chrome DevTools Protocol \u00B7 ", tabs.length, " \u4E2A\u53EF\u8C03\u8BD5\u9875\u9762"] }), data?.connected === false ? (_jsxs("p", { className: "mt-2 text-[11px] text-[#b42318]", children: ["\u8BF7\u4F7F\u7528 remote-debugging-port \u542F\u52A8 Chrome\u3002", value(data.error, "")] })) : null] }), latestAction ? (_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-2 text-[11px]", children: [_jsx("span", { className: "text-[#65707b]", children: "\u6700\u8FD1\u52A8\u4F5C" }), _jsx("strong", { className: "font-mono text-[#315fb8]", children: latestAction })] })) : null, tabs.length > 0 ? (_jsx("div", { className: "grid gap-2", children: tabs.map((tab) => (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-2", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: tab.title }), _jsx("span", { className: "mt-1 block truncate font-mono text-[10px] text-[#687381]", children: tab.url })] }, tab.targetId))) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u6CA1\u6709\u53EF\u8C03\u8BD5\u7684\u6D4F\u89C8\u5668\u9875\u9762\u3002" })), _jsxs("div", { className: "flex flex-wrap gap-2 text-[10px] text-[#687381]", children: [_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]", children: "tabs" }), _jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]", children: "read" }), _jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]", children: "click" }), _jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[#3565c5]", children: "screenshot" })] })] }));
993
- })()) : panel.id === "mcp-client-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(data?.server ?? "尚未连接 MCP 服务器") }), _jsxs("div", { className: "flex shrink-0 items-center gap-2 font-mono text-[10px] text-[#3565c5]", children: [_jsxs("span", { children: [value(Array.isArray(data?.tools) ? data.tools.length : 0), " \u5DE5\u5177"] }), _jsx("span", { className: "text-[#687381]", children: "\u00B7" }), _jsxs("span", { children: [value(Array.isArray(data?.resources) ? data.resources.length : 0), " \u8D44\u6E90"] }), _jsx("span", { className: "text-[#687381]", children: "\u00B7" }), _jsxs("span", { children: [value(Array.isArray(data?.prompts) ? data.prompts.length : 0), " \u63D0\u793A"] })] })] }), _jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: data?.lastCall === null || data?.lastCall === undefined ? "使用 mcp_list_tools 发现 stdio 工具。" : `最近调用:${value(data.lastCall)}` })] }), Array.isArray(data?.tools) && data.tools.length > 0 ? (_jsx("div", { className: "flex flex-wrap gap-2", children: data.tools.slice(0, 12).map((tool, index) => {
994
- const item = typeof tool === "object" && tool !== null ? tool : {};
995
- return (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: value(item.name ?? "tool") }, `${value(item.name ?? "tool")}-${index}`));
996
- }) })) : null, Array.isArray(data?.resources) && data.resources.length > 0 ? (_jsxs("div", { className: "grid gap-2", children: [_jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.12em] text-[#687381]", children: "\u8D44\u6E90" }), _jsx("div", { className: "flex flex-wrap gap-2", children: data.resources.slice(0, 8).map((resource, index) => {
997
- const item = typeof resource === "object" && resource !== null ? resource : {};
998
- return (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#65707b]", children: value(item.name ?? item.uri ?? "resource") }, `${value(item.uri ?? "resource")}-${index}`));
999
- }) })] })) : null, Array.isArray(data?.prompts) && data.prompts.length > 0 ? (_jsxs("div", { className: "grid gap-2", children: [_jsx("span", { className: "text-[10px] font-semibold uppercase tracking-[0.12em] text-[#687381]", children: "\u63D0\u793A\u6A21\u677F" }), _jsx("div", { className: "flex flex-wrap gap-2", children: data.prompts.slice(0, 8).map((prompt, index) => {
1000
- const item = typeof prompt === "object" && prompt !== null ? prompt : {};
1001
- return (_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#65707b]", children: value(item.name ?? "prompt") }, `${value(item.name ?? "prompt")}-${index}`));
1002
- }) })] })) : null, Array.isArray(data?.servers) && data.servers.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.servers.map((server, index) => {
1003
- const item = typeof server === "object" && server !== null ? server : {};
1004
- return (_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]", children: [_jsx("span", { className: "font-mono text-[#30343b]", children: value(item.id ?? "server") }), _jsx("span", { className: "text-[#14733f]", children: value(item.status ?? "unknown") })] }, `${value(item.id ?? "server")}-${index}`));
1005
- }) })) : null] })) : panel.id === "mcp-panel" ? ((() => {
1006
- const servers = Array.isArray(data?.servers) ? data.servers : [];
1007
- return (_jsxs("div", { className: "mt-3 grid gap-3", children: [servers.length > 0 ? (_jsx("ul", { className: "grid gap-2", children: servers.map((entry, index) => {
1008
- const server = entry !== null && typeof entry === "object" ? entry : {};
1009
- const healthy = server.status === "running";
1010
- return (_jsxs("li", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("strong", { className: "min-w-0 flex-1 truncate font-mono text-[11px] text-[#30343b]", children: value(server.id, "未命名服务器") }), _jsx("span", { className: `rounded px-1.5 py-0.5 text-[9px] ${healthy ? "bg-[#eaf8f0] text-[#14733f]" : "bg-[#fff5f5] text-[#b42318]"}`, children: value(server.status, "unknown") })] }), _jsxs("div", { className: "mt-1 flex items-center gap-2 text-[10px] text-[#687381]", children: [_jsxs("span", { children: [value(server.toolCount, "0"), " \u4E2A\u6865\u63A5\u5DE5\u5177"] }), _jsx("span", { children: "\u00B7" }), _jsx("span", { children: value(server.statusSource, "runtime") })] })] }, `${value(server.id ?? "server")}-${index}`));
1011
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u5F53\u524D\u6CA1\u6709 MCP \u670D\u52A1\u5668\u5FEB\u7167\u3002" })), _jsxs("div", { className: "text-[10px] text-[#687381]", children: ["\u53EA\u8BFB\u8BFB\u53D6\u5B98\u65B9 MCP bridge \u72B6\u6001\uFF1B\u5065\u5EB7\u5EFA\u8BAE\u901A\u8FC7 mcp_panel \u7684 health \u64CD\u4F5C\u67E5\u770B\u3002", data?.writesEnabled === true ? ` 已启用 profile patch 写入:${value(data.patchPath)}` : " profile patch 写入未配置,apply 会被拒绝。"] })] }));
1012
- })()) : panel.id === "mock-server-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "font-mono text-[11px] text-[#30343b]", children: data?.running === true ? "运行中" : "未启动" }), _jsxs("strong", { className: "font-mono text-[11px] text-[#3565c5]", children: [value(data?.routes ?? 0), " \u8DEF\u7531"] })] }), data?.url ? _jsx("code", { className: "rounded-md bg-white px-3 py-2 text-[10px] text-[#65707b]", children: value(data.url) }) : null, data?.lastRequest ? _jsxs("p", { className: "text-[11px] text-[#687381]", children: ["\u6700\u8FD1\u8BF7\u6C42\uFF1A", value(data.lastRequest)] }) : null] })) : panel.id === "cli-notifier-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "font-mono text-[11px] text-[#30343b]", children: data?.enabled === true ? "已启用" : "已停用" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: value(data?.platform ?? "unknown") })] }), Array.isArray(data?.notifications) && data.notifications.length > 0 ? (_jsx("div", { className: "grid gap-2", children: data.notifications.slice(0, 5).map((notification, index) => {
1013
- const item = typeof notification === "object" && notification !== null ? notification : {};
1014
- return (_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 text-[10px]", children: [_jsx("strong", { className: "block text-[#30343b]", children: value(item.title ?? "Pi Harness") }), _jsx("span", { className: "mt-1 block text-[#65707b]", children: value(item.message, "") })] }, `${value(item.time ?? "notification")}-${index}`));
1015
- }) })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u53D1\u9001\u901A\u77E5\u3002" }))] })) : panel.id === "obsidian-sync-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "font-mono text-[11px] text-[#30343b]", children: data?.configured === true ? "已配置" : "未配置 vault" }), _jsx("span", { className: "font-mono text-[10px] text-[#687381]", children: "Markdown" })] }), data?.vaultPath ? _jsx("code", { className: "truncate rounded-md bg-white px-3 py-2 text-[10px] text-[#65707b]", children: value(data.vaultPath) }) : null, data?.last !== null && data?.last !== undefined && typeof data.last === "object" ? (_jsxs("p", { className: "text-[11px] text-[#687381]", children: ["\u6700\u8FD1\u5199\u5165\uFF1A", value(data.last.relativePath ?? "note.md")] })) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u540C\u6B65\u7B14\u8BB0\u3002" }))] })) : panel.id === "web-research-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3 text-[11px]", children: [_jsx("span", { className: "text-[#315fb8]", children: data?.keyless === true ? "Firecrawl 匿名模式" : "Firecrawl 已认证" }), _jsxs("strong", { className: "font-mono text-[#315fb8]", children: ["\u6700\u591A ", value(data?.maxResults ?? 8), " \u6761"] })] }), data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
1016
- const report = data.latest;
1017
- const items = Array.isArray(report.items) ? report.items : [];
1018
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between gap-3 text-[11px]", children: [_jsx("strong", { className: "truncate text-[#30343b]", children: value(report.query ?? "网页搜索") }), _jsxs("span", { className: "shrink-0 font-mono text-[#687381]", children: ["\u524D ", Math.min(8, items.length), " / \u5171 ", items.length] })] }), _jsx("div", { className: "grid gap-2", children: items.slice(0, 8).map((entry, index) => {
1019
- const item = entry !== null && typeof entry === "object" ? entry : {};
1020
- return (_jsxs("a", { className: "rounded-lg border border-[#e3e7ee] bg-white px-3 py-2 transition-colors hover:border-[#bdd0f5] hover:bg-[#fbfdff]", href: value(item.url, ""), rel: "noreferrer", target: "_blank", children: [_jsx("strong", { className: "block truncate text-[11px] text-[#30343b]", children: value(item.title ?? item.url ?? "来源") }), _jsx("span", { className: "mt-1 block truncate font-mono text-[10px] text-[#3565c5]", children: value(item.source ?? item.url, "") }), item.snippet ? _jsx("span", { className: "mt-1 line-clamp-2 block text-[10px] leading-4 text-[#65707b]", children: value(item.snippet) }) : null] }, `${value(item.url ?? "source")}-${index}`));
1021
- }) })] }));
1022
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u8054\u7F51\u641C\u7D22\u3002\u53EF\u8BA9 Agent \u8C03\u7528 web_search\uFF1B\u5355\u9875\u8BFB\u53D6\u4F7F\u7528 read_page\u3002" })), _jsxs("p", { className: "text-[10px] text-[#687381]", children: ["\u641C\u7D22\u8BCD\u4F1A\u53D1\u9001\u5230 Firecrawl\uFF1B\u9875\u9762\u8BFB\u53D6", data?.readPageAvailable === true ? "已复用本地 Browser Fetch" : "需要启用 Browser Fetch", "\u3002"] })] })) : panel.id === "browser-fetch-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [data?.latest !== null && data?.latest !== undefined && typeof data.latest === "object" ? ((() => {
1023
- const result = data.latest;
1024
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-lg bg-[#f6f8fa] px-3 py-3", children: [_jsx("span", { className: "truncate font-mono text-[11px] text-[#30343b]", children: value(result.finalUrl ?? result.url ?? "page") }), _jsxs("strong", { className: "font-mono text-[12px] text-[#14733f]", children: ["HTTP ", value(result.status ?? "—")] })] }), _jsx("pre", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3] bg-[#fbfcfd] p-3 text-[10px] leading-4 text-[#65707b]", children: value(result.text, "") })] }));
1025
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u6293\u53D6\u7F51\u9875\u3002\u9ED8\u8BA4\u963B\u6B62\u672C\u5730\u548C\u79C1\u6709\u7F51\u7EDC\u76EE\u6807\u3002" })), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: "max:512KiB" }), _jsx("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: "scripts:disabled" }), _jsxs("span", { className: "rounded-md border border-[#dce5f5] bg-white px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: ["private:", value(data?.allowPrivate === true ? "allowed" : "blocked")] })] })] })) : panel.id === "i18n-pair-panel" ? (_jsx("div", { className: "mt-3 grid gap-3", children: data?.report !== null && data?.report !== undefined && typeof data.report === "object" ? ((() => {
1026
- const report = data.report;
1027
- const missing = Array.isArray(report.missing) ? report.missing : [];
1028
- const extra = Array.isArray(report.extra) ? report.extra : [];
1029
- const healthy = missing.length === 0 && extra.length === 0;
1030
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: `rounded-lg border px-3 py-3 text-[11px] ${healthy ? "border-[#b9e6c9] bg-[#f0fbf4] text-[#14733f]" : "border-[#f4caca] bg-[#fff5f5] text-[#b42318]"}`, children: healthy ? "语言包键完全一致。" : `缺失 ${missing.length} 个,额外 ${extra.length} 个。` }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u57FA\u51C6\u952E" }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(report.baseKeys ?? 0) })] }), _jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: "\u76EE\u6807\u952E" }), _jsx("strong", { className: "mt-1 block text-[17px] text-[#30343b]", children: value(report.targetKeys ?? 0) })] })] })] }));
1031
- })()) : (_jsx("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3 text-[11px] text-[#687381]", children: "\u8FD8\u6CA1\u6709\u68C0\u67E5\u8BED\u8A00\u5305\u3002\u53EF\u8BA9 Agent \u8C03\u7528 i18n_check\u3002" })) })) : panel.id === "cleaner-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3e7ee] bg-[#f6f8fa] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u5FEB\u7167\u6E05\u7406" }), _jsxs("strong", { className: "font-mono text-[12px] text-[#3565c5]", children: [value(Array.isArray(data?.capsules) ? data.capsules.length : 0), " \u4E2A"] })] }), _jsx("p", { className: "mt-2 text-[11px] text-[#687381]", children: "\u4EC5\u6E05\u7406 agent \u6570\u636E\u76EE\u5F55\u4E2D\u7684 .patch \u5FEB\u7167\uFF0C\u5FC5\u987B\u663E\u5F0F confirm=true\u3002" })] }), _jsxs("div", { className: "flex items-center justify-between text-[11px] text-[#687381]", children: [_jsx("span", { children: "\u4E0A\u6B21\u6E05\u7406" }), _jsxs("strong", { className: "font-mono text-[#3565c5]", children: [value(data?.lastRemoved ?? 0), " \u4E2A"] })] })] })) : panel.id === "fail-logger-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "flex items-center justify-between rounded-lg bg-[#fff5f5] px-3 py-3", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#7f1d1d]", children: "\u53BB\u91CD\u540E\u7684\u5931\u8D25\u8BB0\u5F55" }), _jsx("strong", { className: "font-mono text-[17px] text-[#b42318]", children: value(data?.total ?? 0) })] }), _jsx("div", { className: "max-h-48 overflow-auto rounded-lg border border-[#edf0f3]", children: Array.isArray(data?.failures) && data.failures.length > 0 ? (data.failures.map((item, index) => {
1032
- const failure = item !== null && typeof item === "object" ? item : {};
1033
- return (_jsxs("div", { className: "grid grid-cols-[auto_1fr] gap-2 border-b border-[#edf0f3] px-3 py-2 last:border-b-0", children: [_jsx("span", { className: "font-mono text-[10px] text-[#b42318]", children: value(failure.source ?? "runtime") }), _jsx("span", { className: "break-words text-[11px] leading-4 text-[#65707b]", children: value(failure.message ?? "未知错误") })] }, `${value(failure.time ?? "failure")}-${index}`));
1034
- })) : (_jsx("div", { className: "px-3 py-4 text-[12px] text-[#687381]", children: "\u6682\u65E0\u5931\u8D25\u8BB0\u5F55\u3002" })) })] })) : panel.id === "context-insight-panel" ? (_jsxs("div", { className: "mt-3 grid gap-3", children: [_jsxs("div", { className: "rounded-lg border border-[#e3eaf8] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.08em] text-[#5d6d82]", children: "\u4E0A\u4E0B\u6587\u5360\u7528" }), _jsx("strong", { className: "text-[13px] font-semibold text-[#315fb8]", children: data?.percent === null || data?.percent === undefined ? "—" : `${value(data.percent)}%` })] }), _jsx("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-[#dfe8fb]", children: _jsx("div", { className: "h-full rounded-full bg-[#5d8bea] transition-[width] duration-300", style: { width: `${Math.max(0, Math.min(100, typeof data?.percent === "number" ? data.percent : 0))}%` } }) }), _jsxs("p", { className: "mt-2 text-[11px] text-[#5d6d82]", children: [data?.tokens === null || data?.tokens === undefined ? "令牌数未知" : `${value(data.tokens)} tokens`, data?.contextWindow === null || data?.contextWindow === undefined ? "" : ` / ${value(data.contextWindow)} 上限`] })] }), _jsx("div", { className: "grid grid-cols-3 gap-2", children: [
1035
- ["消息", data?.messages ?? 0],
1036
- ["事件", data?.events ?? 0],
1037
- ["压缩", data?.compactions ?? 0],
1038
- ].map(([label, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-1 block text-[17px] font-semibold text-[#30343b]", children: value(item) })] }, value(label)))) }), _jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u6D88\u606F\u7EC4\u6210" }), _jsx("span", { className: "text-[10px] text-[#687381]", children: "\u6309\u89D2\u8272\u7EDF\u8BA1" })] }), _jsx("div", { className: "mt-2 grid grid-cols-5 gap-1.5", children: [
1039
- ["用户", data?.composition?.user ?? 0],
1040
- ["助手", data?.composition?.assistant ?? 0],
1041
- ["工具", data?.composition?.toolResult ?? 0],
1042
- ["系统", data?.composition?.system ?? 0],
1043
- ["其他", data?.composition?.other ?? 0],
1044
- ].map(([label, item]) => (_jsxs("div", { className: "rounded bg-[#f6f8fa] px-2 py-1.5 text-center", children: [_jsx("span", { className: "block text-[10px] text-[#687381]", children: value(label) }), _jsx("strong", { className: "mt-0.5 block font-mono text-[13px] text-[#30343b]", children: value(item) })] }, value(label)))) })] }), _jsxs("div", { className: "rounded-lg border border-[#edf0f3] bg-white px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-[11px] font-semibold text-[#30343b]", children: "\u6700\u8FD1\u4E0A\u4E0B\u6587\u4E8B\u4EF6" }), _jsx("span", { className: "text-[10px] text-[#687381]", children: "\u6700\u591A\u4FDD\u7559 50 \u6761" })] }), _jsx("div", { className: "mt-2 max-h-28 overflow-auto", children: Array.isArray(data?.recentEvents) && data.recentEvents.length > 0 ? (data.recentEvents
1045
- .slice(-6)
1046
- .reverse()
1047
- .map((item, index) => {
1048
- const event = item !== null && typeof item === "object" ? item : {};
1049
- return (_jsxs("div", { className: "flex items-center justify-between border-b border-[#f0f2f5] py-1.5 last:border-b-0", children: [_jsx("span", { className: "font-mono text-[10px] text-[#5d6d82]", children: value(event.type, "unknown") }), _jsx("span", { className: "text-[10px] text-[#687381]", children: typeof event.at === "number" ? new Date(event.at).toLocaleTimeString() : "—" })] }, `${value(event.type)}-${value(event.at)}-${index}`));
1050
- })) : (_jsx("div", { className: "py-2 text-[11px] text-[#687381]", children: "\u6682\u65E0\u4E0A\u4E0B\u6587\u4E8B\u4EF6\u3002" })) })] })] })) : (_jsx("div", { className: "mt-3 grid gap-2", children: entries.map(([key, item]) => (_jsxs("div", { className: "rounded-lg bg-[#f6f8fa] px-3 py-2", children: [_jsx("span", { className: "block font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]", children: key }), _jsx("pre", { className: "mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-words text-[12px] leading-5 text-[#30343b]", children: pluginPanelValue(item) })] }, key))) }))] }));
1051
- }
1052
- function PluginUninstallDialog({ pluginName, busy, error, onCancel, onConfirm, }) {
1053
- const dialogRef = useModalFocus(true, onCancel, busy);
1054
- return (_jsx("div", { className: "plugin-confirm-backdrop", onClick: () => {
1055
- if (!busy)
1056
- onCancel();
1057
- }, children: _jsxs("div", { "aria-label": "\u786E\u8BA4\u5378\u8F7D\u63D2\u4EF6", "aria-modal": "true", className: "plugin-confirm-dialog", onClick: (event) => event.stopPropagation(), ref: dialogRef, role: "dialog", tabIndex: -1, children: [_jsx("header", { children: _jsxs("div", { children: [_jsx("strong", { children: "\u5378\u8F7D\u63D2\u4EF6\uFF1F" }), _jsx("small", { children: "\u5C06\u4ECE\u8FD0\u884C\u914D\u7F6E\u4E2D\u79FB\u9664\uFF0C\u4E4B\u540E\u53EF\u4EE5\u4ECE\u63D2\u4EF6\u5E02\u573A\u91CD\u65B0\u5B89\u88C5\u3002" })] }) }), _jsx("code", { children: pluginName }), error && (_jsx("p", { className: "plugin-confirm-error", role: "alert", children: error })), _jsxs("footer", { children: [_jsx("button", { "data-dialog-initial-focus": true, disabled: busy, onClick: onCancel, type: "button", children: "\u53D6\u6D88" }), _jsx("button", { className: "danger", disabled: busy, onClick: onConfirm, type: "button", children: busy ? "卸载中…" : "确认卸载" })] })] }) }));
1058
- }
1059
- function PluginCategoryNav({ label, categories, activeCategory, onChange, }) {
1060
- const navRef = useRef(null);
1061
- const [canScrollLeft, setCanScrollLeft] = useState(false);
1062
- const [canScrollRight, setCanScrollRight] = useState(false);
1063
- const updateScrollState = useCallback(() => {
1064
- const nav = navRef.current;
1065
- if (!nav)
1066
- return;
1067
- const maximum = Math.max(0, nav.scrollWidth - nav.clientWidth);
1068
- setCanScrollLeft(nav.scrollLeft > 1);
1069
- setCanScrollRight(nav.scrollLeft < maximum - 1);
1070
- }, []);
1071
- useEffect(() => {
1072
- const nav = navRef.current;
1073
- if (!nav)
1074
- return;
1075
- updateScrollState();
1076
- const observer = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(updateScrollState);
1077
- observer?.observe(nav);
1078
- window.addEventListener("resize", updateScrollState);
1079
- return () => {
1080
- observer?.disconnect();
1081
- window.removeEventListener("resize", updateScrollState);
1082
- };
1083
- }, [categories, updateScrollState]);
1084
- const scroll = (direction) => {
1085
- const nav = navRef.current;
1086
- if (!nav)
1087
- return;
1088
- nav.scrollBy({ behavior: "smooth", left: direction * Math.max(180, nav.clientWidth * 0.72) });
1089
- };
1090
- return (_jsxs("div", { className: `marketplace-categories-shell ${canScrollLeft ? "can-scroll-left" : ""} ${canScrollRight ? "can-scroll-right" : ""}`, children: [canScrollLeft && (_jsx("button", { "aria-label": "\u5411\u5DE6\u67E5\u770B\u66F4\u591A\u5206\u7C7B", className: "marketplace-category-scroll previous", onClick: () => scroll(-1), type: "button", children: "\u2039" })), _jsx("nav", { "aria-label": label, className: "marketplace-categories", onScroll: updateScrollState, ref: navRef, children: categories.map((category) => {
1091
- const active = activeCategory === category.id;
1092
- return (_jsxs("button", { "aria-pressed": active, className: `marketplace-category ${active ? "active" : ""}`, onClick: () => onChange(category.id), type: "button", children: [_jsx("span", { children: category.label }), _jsx("span", { className: active ? "font-mono text-[10px] text-[#3565c5]" : "font-mono text-[10px] text-[#687381]", children: category.count })] }, category.id || "all"));
1093
- }) }), canScrollRight && (_jsx("button", { "aria-label": "\u5411\u53F3\u67E5\u770B\u66F4\u591A\u5206\u7C7B", className: "marketplace-category-scroll next", onClick: () => scroll(1), type: "button", children: "\u203A" }))] }));
1094
- }
1095
- function Plugins({ plugins, panels, catalog, onMarketplace, onOpenDetail, onToml, onToggle, onUninstall, }) {
1096
- const catalogByPackage = useMemo(() => new Map(catalog.map((plugin) => [plugin.packageName, plugin])), [catalog]);
1097
- const panelPluginIds = useMemo(() => new Set(panels.map((panel) => panel.pluginId)), [panels]);
1098
- const installedPlugins = useMemo(() => plugins.filter((plugin) => plugin.removable || panelPluginIds.has(plugin.name)), [panelPluginIds, plugins]);
1099
- const [query, setQuery] = useState("");
1100
- const [categoryFilter, setCategoryFilter] = useState("");
1101
- const [busyPlugin, setBusyPlugin] = useState();
1102
- const [pluginError, setPluginError] = useState("");
1103
- const [pendingUninstall, setPendingUninstall] = useState();
1104
- const scrollRef = useRef(null);
1105
- const installedCategories = useMemo(() => {
1106
- const counts = new Map();
1107
- for (const plugin of installedPlugins) {
1108
- const category = catalogByPackage.get(plugin.name)?.category ?? plugin.category ?? { id: "other", label: "其他" };
1109
- const current = counts.get(category.id);
1110
- counts.set(category.id, { ...category, count: (current?.count ?? 0) + 1 });
1111
- }
1112
- return marketplaceCategoryTabs([...counts.values()].sort((left, right) => right.count - left.count || left.label.localeCompare(right.label, "zh-CN")));
1113
- }, [catalogByPackage, installedPlugins]);
1114
- const visiblePlugins = useMemo(() => {
1115
- return installedPlugins.filter((plugin) => {
1116
- const metadata = catalogByPackage.get(plugin.name);
1117
- const category = metadata?.category ?? plugin.category ?? { id: "other", label: "其他" };
1118
- if (categoryFilter && category.id !== categoryFilter)
1119
- return false;
1120
- const fields = [
1121
- plugin.name,
1122
- metadata?.name,
1123
- displayPluginName(plugin.name),
1124
- metadata?.category.label,
1125
- ...(metadata?.capabilities ?? []),
1126
- plugin.category?.label,
1127
- capability(plugin.name),
1128
- ];
1129
- return matchesPluginQuery(query, fields);
1130
- });
1131
- }, [catalogByPackage, categoryFilter, installedPlugins, query]);
1132
- useEffect(() => {
1133
- scrollRef.current?.scrollTo({ top: 0 });
1134
- }, [categoryFilter, query]);
1135
- useEffect(() => {
1136
- if (categoryFilter && !installedCategories.some((category) => category.id === categoryFilter))
1137
- setCategoryFilter("");
1138
- }, [categoryFilter, installedCategories]);
1139
- const runPluginAction = async (plugin, action) => {
1140
- setPluginError("");
1141
- setBusyPlugin(plugin.id);
1142
- try {
1143
- await action(plugin);
1144
- return true;
1145
- }
1146
- catch (error) {
1147
- setPluginError(error instanceof Error ? error.message : String(error));
1148
- return false;
1149
- }
1150
- finally {
1151
- setBusyPlugin(undefined);
1152
- }
1153
- };
1154
- return (_jsx("section", { className: "view-panel plugins-view", children: _jsxs("div", { className: "plugins-page", children: [_jsxs("div", { className: "subnav", children: [_jsxs("div", { "aria-label": "\u63D2\u4EF6\u76EE\u5F55", className: "segmented", children: [_jsx("button", { "aria-pressed": "true", className: "active", type: "button", children: "\u5DF2\u5B89\u88C5" }), _jsx("button", { "aria-pressed": "false", onClick: onMarketplace, type: "button", children: "\u63D2\u4EF6\u5E02\u573A" })] }), _jsx("span", { children: "\u5DF2\u5B89\u88C5\u63D2\u4EF6" }), _jsx("a", { href: "#", onClick: (event) => {
1155
- event.preventDefault();
1156
- onToml();
1157
- }, children: "\u67E5\u770B\u8FD0\u884C\u914D\u7F6E" })] }), _jsxs("div", { className: "plugins-toolbar", children: [_jsx("input", { "aria-label": "\u641C\u7D22\u5DF2\u5B89\u88C5\u63D2\u4EF6", onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u5305\u540D\u6216\u80FD\u529B\u2026", type: "search", value: query }), _jsxs("span", { "aria-live": "polite", children: [query.trim() || categoryFilter ? `${visiblePlugins.length} / ${installedPlugins.length}` : `${installedPlugins.length}`, " \u4E2A\u63D2\u4EF6"] })] }), _jsx(PluginCategoryNav, { activeCategory: categoryFilter, categories: installedCategories, label: "\u5DF2\u5B89\u88C5\u63D2\u4EF6\u5206\u7C7B", onChange: setCategoryFilter }), _jsxs("div", { className: "plugins-scroll", ref: scrollRef, children: [_jsxs("div", { className: "plugins-list", children: [visiblePlugins.map((plugin) => {
1158
- const metadata = catalogByPackage.get(plugin.name);
1159
- const categoryLabel = metadata?.category.label ?? plugin.category?.label;
1160
- const capabilityLabel = capability(plugin.name);
1161
- const pluginTitle = metadata?.name ?? displayPluginName(plugin.name);
1162
- const cardContent = installedPluginCardContent(plugin, metadata);
1163
- return (_jsxs("article", { className: "catalog-card plugin-card", children: [_jsxs("div", { className: "plugin-card-head", children: [_jsx("span", { className: "plugin-icon", children: "\u25C8" }), _jsx("div", { className: "plugin-copy", children: _jsxs("div", { className: "plugin-heading", children: [_jsxs("div", { className: "plugin-title", children: [_jsx("strong", { children: pluginTitle }), _jsx("span", { className: `plugin-state ${plugin.enabled ? "active" : ""}`, children: plugin.enabled ? "运行中" : "已停用" }), categoryLabel && _jsx("span", { className: "capability", children: categoryLabel }), categoryLabel !== capabilityLabel && _jsx("span", { className: "capability", children: capabilityLabel })] }), _jsx("div", { className: "plugin-actions", children: plugin.removable ? (_jsxs(_Fragment, { children: [_jsx("button", { "aria-label": `${plugin.enabled ? "停用" : "启用"} ${pluginTitle}`, "aria-pressed": plugin.enabled, className: "plugin-switch-button", disabled: busyPlugin !== undefined, onClick: () => void runPluginAction(plugin, (item) => onToggle(item)), type: "button", children: _jsx("span", { "aria-hidden": "true", className: `switch ${plugin.enabled ? "on" : ""}`, children: _jsx("i", {}) }) }), _jsx("button", { className: "plugin-uninstall", disabled: busyPlugin !== undefined, onClick: () => {
1164
- setPluginError("");
1165
- setPendingUninstall(plugin);
1166
- }, type: "button", children: "\u5378\u8F7D" })] })) : (_jsx("span", { className: `switch ${plugin.enabled ? "on" : ""}`, children: _jsx("i", {}) })) })] }) })] }), _jsxs("div", { className: "plugin-card-body", children: [_jsx("code", { className: "plugin-package", children: cardContent.packageLabel }), _jsx("p", { className: "plugin-description", children: cardContent.description }), _jsx("div", { className: "hook-list", children: cardContent.tags.map((tag, index) => (_jsx("span", { children: tag }, `${tag}-${index}`))) })] }), _jsxs("footer", { className: "plugin-card-footer", children: [_jsx("button", { "aria-label": `查看 ${pluginTitle} 详情`, className: "plugin-detail-link", onClick: () => onOpenDetail(plugin), type: "button", children: "\u67E5\u770B\u8BE6\u60C5 \u2192" }), panelPluginIds.has(plugin.name) ? _jsx("span", { children: "\u5B9E\u65F6\u9762\u677F" }) : null] })] }, plugin.id));
1167
- }), !installedPlugins.length ? (_jsx("div", { className: "empty-state", children: "\u8FD8\u6CA1\u6709\u5B89\u88C5\u53EF\u7BA1\u7406\u7684\u63D2\u4EF6\u3002\u53BB\u63D2\u4EF6\u5E02\u573A\u5B89\u88C5\u4E00\u4E2A\u5427\u3002" })) : !visiblePlugins.length ? (_jsx("div", { className: "empty-state", children: "\u6CA1\u6709\u5339\u914D\u5F53\u524D\u641C\u7D22\u4E0E\u5206\u7C7B\u6761\u4EF6\u7684\u5DF2\u5B89\u88C5\u63D2\u4EF6\u3002" })) : null] }), pluginError && _jsx("p", { className: "plugin-action-error", children: pluginError }), panels.length > installedPlugins.length && (_jsxs("section", { className: "mt-4 border-t border-[#e3e7ee] pt-4", children: [_jsxs("div", { className: "mb-3 flex items-baseline justify-between gap-3", children: [_jsxs("div", { children: [_jsx("strong", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u5176\u4ED6\u63D2\u4EF6\u9762\u677F" }), _jsx("p", { className: "mt-1 text-[12px] text-[#687381]", children: "\u7531\u5DF2\u542F\u7528\u63D2\u4EF6\u63D0\u4F9B\u7684\u5B9E\u65F6\u72B6\u6001\u3002" })] }), _jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.08em] text-[#687381]", children: "LIVE" })] }), _jsx("div", { className: "grid gap-3 xl:grid-cols-2", children: panels
1168
- .filter((panel) => !installedPlugins.some((plugin) => plugin.name === panel.pluginId))
1169
- .map((panel) => (_jsx(PluginPanelCard, { panel: panel }, panel.id))) })] }))] }), pendingUninstall && (_jsx(PluginUninstallDialog, { busy: busyPlugin !== undefined, error: pluginError, onCancel: () => setPendingUninstall(undefined), onConfirm: () => void runPluginAction(pendingUninstall, onUninstall).then((completed) => {
1170
- if (completed)
1171
- setPendingUninstall(undefined);
1172
- }), pluginName: catalogByPackage.get(pendingUninstall.name)?.name ?? displayPluginName(pendingUninstall.name) }))] }) }));
1173
- }
1174
- function InstalledPluginDetail({ plugin, panel, metadata, onBack, onToggle, onUninstall, }) {
1175
- const [busyAction, setBusyAction] = useState();
1176
- const [error, setError] = useState("");
1177
- const [confirmUninstall, setConfirmUninstall] = useState(false);
1178
- const title = metadata?.name ?? displayPluginName(plugin.name);
1179
- const run = async (action, callback) => {
1180
- setError("");
1181
- setBusyAction(action);
1182
- try {
1183
- await callback();
1184
- return true;
1185
- }
1186
- catch (cause) {
1187
- setError(cause instanceof Error ? cause.message : String(cause));
1188
- return false;
1189
- }
1190
- finally {
1191
- setBusyAction(undefined);
1192
- }
1193
- };
1194
- return (_jsxs("section", { className: "marketplace-page flex min-w-0 flex-1 flex-col", children: [_jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [_jsxs("div", { className: "subnav plugin-detail-subnav", children: [_jsx("a", { href: "?page=plugins", onClick: (event) => {
1195
- event.preventDefault();
1196
- onBack();
1197
- }, children: "\u2190 \u5DF2\u5B89\u88C5\u63D2\u4EF6" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsxs("div", { className: "plugin-detail-content", children: [_jsxs("header", { className: "border-b border-[#e3e7ee] pb-7", children: [_jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: `rounded px-2 py-1 font-mono text-[10px] ${plugin.enabled ? "bg-[#e6faed] text-[#14733f]" : "bg-[#eef0f3] text-[#687381]"}`, children: plugin.enabled ? "运行中" : "已停用" }), _jsx("span", { className: "rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]", children: metadata?.category.label ?? plugin.category?.label ?? "运行时插件" }), _jsx("span", { className: "rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: capability(plugin.name) })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]", children: "PLUGIN DETAIL" }), _jsx("h1", { className: "text-3xl font-semibold tracking-[-0.03em] text-[#20252b]", children: title }), _jsxs("code", { className: "mt-3 block break-all text-[12px] text-[#687381]", children: [plugin.name, metadata ? ` · v${metadata.version}` : ""] })] }), plugin.removable ? (_jsxs("div", { className: "plugin-detail-actions", children: [_jsx("button", { className: "plugin-detail-action", disabled: busyAction !== undefined, onClick: () => void run("toggle", () => onToggle(plugin)), type: "button", children: busyAction === "toggle" ? "处理中…" : plugin.enabled ? "停用插件" : "启用插件" }), _jsx("button", { className: "plugin-detail-action danger", disabled: busyAction !== undefined, onClick: () => {
1198
- setError("");
1199
- setConfirmUninstall(true);
1200
- }, type: "button", children: "\u5378\u8F7D\u63D2\u4EF6" })] })) : (_jsx("span", { className: "rounded-full bg-[#eef0f3] px-3 py-1.5 text-[11px] text-[#687381]", children: "\u5185\u7F6E\u7EC4\u4EF6" }))] }), _jsx("p", { className: "mt-5 max-w-3xl text-[14px] leading-7 text-[#59636e]", children: metadata?.description ?? (plugin.enabled ? "由当前运行时加载并启用,能力与 hook 已注册。" : "插件保留在运行配置中,但当前处于停用状态。") }), error && (_jsxs("p", { className: "mt-3 text-[12px] text-[#b42318]", role: "alert", children: ["\u64CD\u4F5C\u5931\u8D25\uFF1A", error] }))] }), _jsxs("div", { className: "grid gap-4 py-6 lg:grid-cols-[minmax(0,1fr)_280px]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u80FD\u529B" }), _jsx("div", { className: "mt-4 flex flex-wrap gap-2", children: (metadata?.capabilities.length ? metadata.capabilities : [capability(plugin.name)]).map((item) => (_jsx("span", { className: "rounded-md bg-[#f1f4f9] px-2 py-1 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] }), metadata?.hooks.length ? (_jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u6269\u5C55\u70B9" }), _jsx("div", { className: "mt-4 space-y-2", children: metadata.hooks.map((item) => (_jsx("div", { className: "rounded-md bg-[#f8f9fb] px-3 py-2 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] })) : null, _jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u5B9E\u65F6\u8BE6\u60C5" }), _jsx("p", { className: "mt-1 text-[12px] text-[#687381]", children: "\u5F53\u524D\u672C\u673A\u4F1A\u8BDD\u4E2D\u7684\u63D2\u4EF6\u8FD0\u884C\u72B6\u6001\u3002" })] }), _jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.1em] text-[#687381]", children: "LIVE" })] }), panel ? _jsx(PluginPanelCard, { inline: true, panel: panel }) : _jsx("div", { className: "empty-state", children: "\u8FD9\u4E2A\u63D2\u4EF6\u6682\u672A\u63D0\u4F9B\u5B9E\u65F6\u9762\u677F\u3002" })] })] }), _jsxs("aside", { className: "h-fit rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u4FE1\u606F" }), _jsxs("dl", { className: "mt-4 divide-y divide-[#eef0f3] text-[12px]", children: [_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u8FD0\u884C\u72B6\u6001" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: plugin.state })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u914D\u7F6E\u6807\u8BC6" }), _jsx("dd", { className: "max-w-[150px] break-all text-right font-mono text-[#3b424b]", children: plugin.id })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u5206\u7C7B" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.category?.label ?? "运行时插件" })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u7BA1\u7406\u65B9\u5F0F" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.removable ? "可配置" : "随运行时加载" })] }), metadata ? (_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u7248\u672C" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: metadata.version })] })) : null] }), metadata ? (_jsx("a", { className: "mt-4 block border-t border-[#eef0f3] pt-4 text-[12px] text-[#3565c5]", href: metadata.repository, rel: "noreferrer", target: "_blank", children: "\u67E5\u770B\u6E90\u7801 \u2197" })) : null] })] })] })] }), confirmUninstall ? (_jsx(PluginUninstallDialog, { busy: busyAction === "uninstall", error: error, onCancel: () => setConfirmUninstall(false), onConfirm: () => void run("uninstall", () => onUninstall(plugin)).then((completed) => {
1201
- if (completed)
1202
- setConfirmUninstall(false);
1203
- }), pluginName: title })) : null] }));
1204
- }
1205
- function Marketplace({ plugins, capabilities, categories, total, page, hasNext, query, capabilityFilter, categoryFilter, onQueryChange, onCapabilityChange, onCategoryChange, onPageChange, onOpenDetail, onBack, onToml, installedPackages, onInstall, }) {
1206
- const [installing, setInstalling] = useState();
1207
- const [installError, setInstallError] = useState("");
1208
- const [installNotice, setInstallNotice] = useState("");
1209
- const categoryTabs = useMemo(() => marketplaceCategoryTabs(categories), [categories]);
1210
- const install = async (plugin) => {
1211
- setInstallError("");
1212
- setInstallNotice("");
1213
- setInstalling(plugin.id);
1214
- try {
1215
- const result = await onInstall(plugin);
1216
- if (result.restartRequired === true)
1217
- setInstallNotice("已写入 profile,重启 Pi Harness 后生效。");
1218
- }
1219
- catch (error) {
1220
- setInstallError(error instanceof Error ? error.message : String(error));
1221
- }
1222
- finally {
1223
- setInstalling(undefined);
1224
- }
1225
- };
1226
- return (_jsx("section", { className: "marketplace-page flex min-w-0 flex-1 flex-col", children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [_jsxs("div", { className: "subnav", children: [_jsxs("div", { "aria-label": "\u63D2\u4EF6\u76EE\u5F55", className: "segmented", children: [_jsx("button", { "aria-pressed": "false", onClick: onBack, type: "button", children: "\u5DF2\u5B89\u88C5" }), _jsx("button", { "aria-pressed": "true", className: "active", type: "button", children: "\u63D2\u4EF6\u5E02\u573A" })] }), _jsx("span", { children: "\u5DF2\u5BA1\u6838\u63D2\u4EF6\u76EE\u5F55" }), _jsx("a", { href: "#", onClick: (event) => {
1227
- event.preventDefault();
1228
- onToml();
1229
- }, children: "\u67E5\u770B\u8FD0\u884C\u914D\u7F6E" })] }), _jsxs("div", { className: "marketplace-toolbar", children: [_jsx("input", { className: "marketplace-search", "aria-label": "\u641C\u7D22\u63D2\u4EF6", onChange: (event) => onQueryChange(event.target.value), placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u5305\u540D\u3001\u80FD\u529B\u2026", value: query }), _jsxs("select", { className: "marketplace-filter", "aria-label": "\u6309\u80FD\u529B\u7B5B\u9009", onChange: (event) => onCapabilityChange(event.target.value), value: capabilityFilter, children: [_jsx("option", { value: "", children: "\u5168\u90E8\u80FD\u529B" }), capabilities.map((item) => (_jsx("option", { value: item, children: item }, item)))] }), _jsxs("span", { className: "marketplace-count", children: [total, " \u4E2A\u5DF2\u5BA1\u6838\u6761\u76EE \u00B7 \u63A8\u8350\u6392\u5E8F"] })] }), _jsx(PluginCategoryNav, { activeCategory: categoryFilter, categories: categoryTabs, label: "\u63D2\u4EF6\u5206\u7C7B", onChange: onCategoryChange }), _jsxs("div", { className: "marketplace-scroll", children: [_jsxs("div", { className: "marketplace-grid", children: [plugins.map((plugin) => (_jsxs("article", { className: "catalog-card marketplace-card", children: [_jsxs("header", { className: "marketplace-card-head", children: [_jsx("div", { className: "marketplace-card-mark", children: "\u25C8" }), _jsx("div", { className: "min-w-0 flex-1", children: _jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx("strong", { className: "marketplace-title", children: plugin.name }), _jsx("span", { className: plugin.status === "verified"
1230
- ? "rounded bg-[#e6faed] px-1.5 py-px font-mono text-[10px] text-[#14733f]"
1231
- : "rounded bg-[#fff5e7] px-1.5 py-px font-mono text-[10px] text-[#9a6700]", children: plugin.status === "verified" ? "已验证" : "实验性" }), _jsx("span", { className: plugin.source === "official"
1232
- ? "rounded bg-[#e4edfd] px-1.5 py-px font-mono text-[10px] text-[#3565c5]"
1233
- : "rounded bg-[#fef5e7] px-1.5 py-px font-mono text-[10px] text-[#9a6700]", children: plugin.source === "official" ? "官方" : "社区" }), _jsx("span", { className: "rounded bg-[#f2edff] px-1.5 py-px text-[10px] text-[#6d4bc3]", children: plugin.category.label })] }) })] }), _jsxs("div", { className: "marketplace-card-body", children: [_jsxs("code", { className: "marketplace-package", children: [displayPluginName(plugin.packageName), " \u00B7 v", plugin.version] }), _jsx("p", { className: "marketplace-description", children: plugin.description }), _jsxs("div", { className: "marketplace-tags", children: [plugin.capabilities.map((item) => (_jsx("span", { className: "rounded bg-[#f1f4f9] px-1.5 py-px font-mono text-[10px] text-[#61666b]", children: item }, item))), plugin.hooks.map((item) => (_jsxs("span", { className: "rounded bg-[#f1f4f9] px-1.5 py-px font-mono text-[10px] text-[#61666b]", children: ["hook:", item] }, `hook:${item}`)))] }), plugin.statistics && (_jsx("div", { className: "marketplace-statistics mt-3 grid grid-cols-3 divide-x divide-[#e3e7ee] rounded-md border border-[#e3e7ee] bg-[#f8f9fb]", children: marketplaceStatisticItems(plugin.statistics).map((item) => (_jsxs("span", { className: "min-w-0 px-2 py-1.5", title: `${item.label} ${item.value}`, children: [_jsx("small", { className: "block truncate text-[9px] text-[#687381]", children: item.label }), _jsx("strong", { className: "mt-0.5 block truncate font-mono text-[10px] font-medium text-[#3b424b]", children: item.value })] }, item.label))) }))] }), _jsxs("footer", { className: "marketplace-card-footer", children: [_jsxs("span", { children: [plugin.author, " \u00B7 ", plugin.license] }), _jsx("a", { href: marketplaceDetailPath(plugin.id), onClick: (event) => {
1234
- event.preventDefault();
1235
- onOpenDetail(plugin);
1236
- }, children: "\u67E5\u770B\u8BE6\u60C5 \u2192" }), _jsx("a", { href: plugin.repository, target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u6E90\u7801 \u2197" }), _jsx("button", { disabled: installedPackages.has(plugin.packageName) || installing !== undefined, onClick: () => void install(plugin), type: "button", children: installedPackages.has(plugin.packageName) ? "已安装" : installing === plugin.id ? "安装中…" : "安装" })] })] }, plugin.id))), !plugins.length && _jsx("div", { className: "empty-state", children: "\u6CA1\u6709\u5339\u914D\u7684\u63D2\u4EF6\u3002" })] }), installNotice && _jsx("p", { className: "mt-2 text-[11px] text-[#3565c5]", children: installNotice }), installError && _jsxs("p", { className: "mt-2 text-[11px] text-[#b42318]", children: ["\u5B89\u88C5\u5931\u8D25\uFF1A", installError] }), _jsxs("div", { className: "marketplace-pagination", children: [_jsx("button", { className: "marketplace-pagination-button", disabled: page === 0, onClick: () => onPageChange(page - 1), type: "button", children: "\u4E0A\u4E00\u9875" }), _jsxs("span", { children: ["\u7B2C ", page + 1, " \u9875"] }), _jsx("button", { className: "marketplace-pagination-button", disabled: !hasNext, onClick: () => onPageChange(page + 1), type: "button", children: "\u4E0B\u4E00\u9875" })] }), _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: [_jsx("strong", { className: "text-[12px] text-[#0f1115]", children: "\u4F60\u6709\u4E00\u4E2A Pi Harness \u63D2\u4EF6\uFF1F" }), _jsx("span", { children: "\u5728 entries \u76EE\u5F55\u65B0\u589E\u4E00\u4E2A\u5143\u6570\u636E\u6587\u4EF6\uFF0C\u9644\u6D4B\u8BD5\u548C README \u540E\u63D0\u4EA4 PR\uFF1B\u5BA1\u6838\u901A\u8FC7\u540E\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" }), _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: "\u67E5\u770B\u8D21\u732E\u89C4\u8303 \u2197" })] })] })] }) }));
1237
- }
1238
- function MarketplaceDetail({ plugin, installed, onInstall, onBack, }) {
1239
- const [busy, setBusy] = useState(false);
1240
- const [error, setError] = useState("");
1241
- const [notice, setNotice] = useState("");
1242
- const install = async () => {
1243
- setError("");
1244
- setNotice("");
1245
- setBusy(true);
1246
- try {
1247
- const result = await onInstall(plugin);
1248
- if (result.restartRequired === true)
1249
- setNotice("已写入 profile,重启 Pi Harness 后生效。");
1250
- }
1251
- catch (cause) {
1252
- setError(cause instanceof Error ? cause.message : String(cause));
1253
- }
1254
- finally {
1255
- setBusy(false);
1256
- }
1257
- };
1258
- return (_jsx("section", { className: "marketplace-page flex min-w-0 flex-1 flex-col", children: _jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [_jsxs("div", { className: "subnav plugin-detail-subnav", children: [_jsx("a", { href: "?page=marketplace", onClick: (event) => {
1259
- event.preventDefault();
1260
- onBack();
1261
- }, children: "\u2190 \u63D2\u4EF6\u5E02\u573A" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsxs("div", { className: "plugin-detail-content", children: [_jsxs("header", { className: "border-b border-[#e3e7ee] pb-7", children: [_jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: plugin.source === "official" ? "官方插件" : "社区插件" }), _jsx("span", { className: "rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]", children: plugin.category.label }), _jsx("span", { className: plugin.status === "verified"
1262
- ? "rounded bg-[#e6faed] px-2 py-1 font-mono text-[10px] text-[#14733f]"
1263
- : "rounded bg-[#fff5e7] px-2 py-1 font-mono text-[10px] text-[#9a6700]", children: plugin.status === "verified" ? "已验证" : "实验性" })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]", children: "PLUGIN DETAIL" }), _jsx("h1", { className: "text-3xl font-semibold tracking-[-0.03em] text-[#20252b]", children: plugin.name }), _jsxs("code", { className: "mt-3 block break-all text-[12px] text-[#687381]", children: [plugin.packageName, " \u00B7 v", plugin.version] })] }), _jsx("div", { className: "plugin-detail-actions", children: _jsx("button", { className: "plugin-detail-action primary", disabled: installed || busy, onClick: () => void install(), type: "button", children: installed ? "已安装" : busy ? "安装中…" : "安装插件" }) })] }), _jsx("p", { className: "mt-5 max-w-3xl text-[14px] leading-7 text-[#59636e]", children: plugin.description }), notice && _jsx("p", { className: "mt-3 text-[12px] text-[#3565c5]", children: notice }), error && _jsxs("p", { className: "mt-3 text-[12px] text-[#b42318]", children: ["\u5B89\u88C5\u5931\u8D25\uFF1A", error] })] }), _jsxs("div", { className: "grid gap-4 py-6 lg:grid-cols-[minmax(0,1fr)_280px]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u80FD\u529B" }), _jsx("div", { className: "mt-4 flex flex-wrap gap-2", children: plugin.capabilities.map((item) => (_jsx("span", { className: "rounded-md bg-[#f1f4f9] px-2 py-1 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] }), _jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u6269\u5C55\u70B9" }), _jsx("div", { className: "mt-4 space-y-2", children: plugin.hooks.map((item) => (_jsx("div", { className: "rounded-md bg-[#f8f9fb] px-3 py-2 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] }), _jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u8FD0\u884C\u914D\u7F6E" }), _jsx("p", { className: "mt-1 text-[12px] text-[#687381]", children: "\u5B89\u88C5\u540E\u4F1A\u5199\u5165\u5F53\u524D\u8FD0\u884C profile\u3002" }), _jsx("pre", { className: "mt-4 overflow-auto rounded-lg bg-[#f7f8fa] p-4 text-[11px] leading-6 text-[#3b424b]", children: _jsx("code", { children: JSON.stringify(plugin.profile, null, 2) }) })] })] }), _jsxs("aside", { className: "h-fit rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u4FE1\u606F" }), _jsxs("dl", { className: "mt-4 divide-y divide-[#eef0f3] text-[12px]", children: [_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u4F5C\u8005" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.author })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u8BB8\u53EF\u8BC1" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: plugin.license })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u5206\u7C7B" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.category.label })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u7248\u672C" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: plugin.version })] }), marketplaceStatisticItems(plugin.statistics).map((item) => (_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: item.label }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: item.value })] }, item.label)))] }), _jsx("a", { className: "mt-4 block border-t border-[#eef0f3] pt-4 text-[12px] text-[#3565c5]", href: plugin.repository, target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u6E90\u7801 \u2197" })] })] })] })] }) }));
1264
- }
1265
- function Settings({ data, api, tab, onTab, onClose, onRefresh, }) {
1266
- const status = data.status;
1267
- const [providerState, setProviderState] = useState({});
1268
- const [providerBusy, setProviderBusy] = useState({});
1269
- const [providerAddOpen, setProviderAddOpen] = useState(false);
1270
- const [providerForm, setProviderForm] = useState({ provider: "", name: "", baseUrl: "", api: "openai-completions", apiKey: "", model: "" });
1271
- const [config, setConfig] = useState();
1272
- const [configMode, setConfigMode] = useState("form");
1273
- const [configSourceDraft, setConfigSourceDraft] = useState("");
1274
- const [configBusy, setConfigBusy] = useState(false);
1275
- const [configState, setConfigState] = useState("");
1276
- const notifierActive = data.plugins.some((plugin) => plugin.name.endsWith("/cli-notifier") && plugin.enabled);
1277
- const providerDialogRef = useModalFocus(providerAddOpen, () => setProviderAddOpen(false), providerBusy.__add);
1278
- useEffect(() => {
1279
- if (tab !== "general" && tab !== "toml")
1280
- return;
1281
- setConfigState("读取中…");
1282
- void api
1283
- .getConfig()
1284
- .then((value) => {
1285
- setConfig(value);
1286
- setConfigSourceDraft(value.source);
1287
- setConfigState("");
1288
- })
1289
- .catch((cause) => setConfigState(cause instanceof Error ? cause.message : String(cause)));
1290
- }, [api, tab]);
1291
- const updateConfig = (input, message) => {
1292
- setConfigBusy(true);
1293
- setConfigState(message);
1294
- void api
1295
- .updateConfig(input)
1296
- .then((value) => {
1297
- setConfig(value);
1298
- setConfigSourceDraft(value.source);
1299
- })
1300
- .then(() => setConfigState("已保存"))
1301
- .catch((cause) => setConfigState(cause instanceof Error ? cause.message : String(cause)))
1302
- .finally(() => setConfigBusy(false));
1303
- };
1304
- const runProviderAction = (provider, action) => {
1305
- if (providerBusy[provider])
1306
- return;
1307
- setProviderBusy((current) => ({ ...current, [provider]: true }));
1308
- setProviderState((current) => ({ ...current, [provider]: action === "test" ? "测试中…" : "刷新中…" }));
1309
- if (action === "test")
1310
- void api
1311
- .testProvider(provider)
1312
- .then((result) => {
1313
- const auth = result.auth;
1314
- const label = auth && typeof auth === "object" && "label" in auth && typeof auth.label === "string" ? auth.label : undefined;
1315
- setProviderState((current) => ({ ...current, [provider]: result.reachable ? "连接正常" : (label ?? "未检测到认证") }));
1316
- })
1317
- .catch((cause) => setProviderState((current) => ({ ...current, [provider]: cause instanceof Error ? cause.message : String(cause) })))
1318
- .finally(() => setProviderBusy((current) => ({ ...current, [provider]: false })));
1319
- else
1320
- void api
1321
- .refreshProvider(provider)
1322
- .then((result) => setProviderState((current) => ({ ...current, [provider]: `${result.models.length} 个模型已刷新` })))
1323
- .catch((cause) => setProviderState((current) => ({ ...current, [provider]: cause instanceof Error ? cause.message : String(cause) })))
1324
- .finally(() => setProviderBusy((current) => ({ ...current, [provider]: false })));
1325
- };
1326
- return (_jsx("section", { className: "view-panel settings-page", children: _jsxs("div", { className: "settings-dialog", children: [_jsx("nav", { "aria-label": "\u8BBE\u7F6E\u5206\u7C7B", className: "settings-top-tabs", children: ["general", "providers", "toml"].map((item) => (_jsx("button", { "aria-pressed": tab === item, className: `settings-tab ${tab === item ? "active" : ""}`, onClick: () => onTab(item), type: "button", children: item === "general" ? "通用" : item === "providers" ? `提供商 ${data.providers.length}` : "运行配置" }, item))) }), _jsxs("section", { children: [_jsxs("header", { children: [_jsx("button", { className: "settings-back", onClick: onClose, type: "button", children: "\u2190 \u8FD4\u56DE\u4F1A\u8BDD" }), _jsxs("div", { className: "settings-header-copy", children: [_jsx("strong", { children: tab === "general" ? "通用" : tab === "providers" ? "提供商" : "运行配置" }), _jsx("small", { children: tab === "toml" ? "配置即代码,改完重载" : "运行时状态与快捷键" })] })] }), _jsxs("div", { className: "settings-body", children: [tab === "general" && (_jsxs(_Fragment, { children: [[
1327
- ["工作目录", status?.cwd],
1328
- ["agent 目录", status?.agentDir],
1329
- ["会话", status ? `${status.sessionId} · ${status.messages} 条消息` : "—"],
1330
- ["快捷键", "⌘K 命令 · ⌘, 设置 · ⌃C 中断"],
1331
- ["权限策略", "当前 API 未提供修改接口"],
1332
- ].map(([key, item]) => (_jsx("div", { className: "general-row", children: _jsxs("div", { children: [_jsx("strong", { children: key }), _jsx("small", { children: value(item) })] }) }, key))), _jsxs("div", { className: "general-row", children: [_jsxs("div", { children: [_jsx("strong", { children: "\u4EFB\u52A1\u7ED3\u675F\u63D0\u9192\u63D2\u4EF6" }), _jsx("small", { children: "\u7531 CLI Notifier \u63D0\u4F9B\uFF0C\u5177\u4F53\u76EE\u6807\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u7BA1\u7406" })] }), _jsx("span", { className: `setting-status ${notifierActive ? "on" : ""}`, children: notifierActive ? "已加载" : "未加载" })] }), _jsxs("div", { className: "general-row", children: [_jsxs("div", { children: [_jsx("strong", { children: "\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587" }), _jsx("small", { children: "\u63A5\u8FD1\u4E0A\u4E0B\u6587\u4E0A\u9650\u65F6\u81EA\u52A8\u6574\u7406\u5386\u53F2\u6D88\u606F\uFF0C\u53EF\u5728\u8FD0\u884C\u914D\u7F6E\u4E2D\u4FEE\u6539" }), !config && configState && configState !== "读取中…" ? (_jsxs("small", { className: "setting-error", role: "alert", children: ["\u914D\u7F6E\u8BFB\u53D6\u5931\u8D25\uFF1A", configState] })) : null] }), _jsx("span", { className: `setting-status ${config?.settings.compaction.enabled ? "on" : ""}`, children: config ? (config.settings.compaction.enabled ? "已开启" : "已关闭") : configState === "读取中…" ? "读取中" : "不可用" })] })] })), tab === "providers" && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "provider-add-head", children: [_jsxs("div", { children: [_jsx("strong", { children: "\u5DF2\u542F\u7528\u63D0\u4F9B\u5546" }), _jsx("small", { children: "\u6A21\u578B\u5217\u8868\u53EA\u663E\u793A\u5F53\u524D\u4F1A\u8BDD\u548C\u5DF2\u914D\u7F6E\u63D0\u4F9B\u5546\u3002" })] }), _jsx("button", { className: "primary", onClick: () => setProviderAddOpen(true), type: "button", children: "\u6DFB\u52A0\u63D0\u4F9B\u5546" })] }), providerAddOpen && (_jsx("div", { className: "provider-add-overlay", onClick: () => {
1333
- if (!providerBusy.__add)
1334
- setProviderAddOpen(false);
1335
- }, onKeyDown: (event) => {
1336
- if (event.key === "Escape") {
1337
- event.stopPropagation();
1338
- if (!providerBusy.__add)
1339
- setProviderAddOpen(false);
1340
- }
1341
- }, children: _jsxs("div", { "aria-busy": providerBusy.__add, "aria-label": "\u6DFB\u52A0\u63D0\u4F9B\u5546", "aria-modal": "true", className: "provider-add-modal", onClick: (event) => event.stopPropagation(), ref: providerDialogRef, role: "dialog", tabIndex: -1, children: [_jsxs("header", { children: [_jsxs("div", { children: [_jsx("strong", { children: "\u6DFB\u52A0\u81EA\u5B9A\u4E49\u63D0\u4F9B\u5546" }), _jsx("small", { children: "\u6CE8\u518C OpenAI \u517C\u5BB9\u63A5\u53E3\uFF0C\u51ED\u636E\u53EA\u63D0\u4EA4\u5230\u672C\u673A Pi runtime\u3002" })] }), _jsx("button", { "aria-label": "\u5173\u95ED\u6DFB\u52A0\u63D0\u4F9B\u5546", disabled: providerBusy.__add, onClick: () => setProviderAddOpen(false), type: "button", children: "\u00D7" })] }), _jsxs("form", { className: "provider-add-form", onSubmit: (event) => {
1342
- event.preventDefault();
1343
- if (!providerForm.provider || !providerForm.baseUrl || !providerForm.apiKey || !providerForm.model)
1344
- return;
1345
- setProviderBusy((current) => ({ ...current, __add: true }));
1346
- setProviderState((current) => ({ ...current, __add: "添加中…" }));
1347
- void api
1348
- .addProvider(providerForm)
1349
- .then(async () => {
1350
- setProviderForm({ provider: "", name: "", baseUrl: "", api: "openai-completions", apiKey: "", model: "" });
1351
- setProviderState((current) => ({ ...current, __add: "已添加" }));
1352
- await onRefresh();
1353
- setProviderAddOpen(false);
1354
- })
1355
- .catch((cause) => setProviderState((current) => ({ ...current, __add: cause instanceof Error ? cause.message : String(cause) })))
1356
- .finally(() => setProviderBusy((current) => ({ ...current, __add: false })));
1357
- }, children: [_jsxs("label", { children: [_jsx("span", { children: "\u63D0\u4F9B\u5546 ID" }), _jsx("input", { "aria-label": "\u63D0\u4F9B\u5546 ID", "data-dialog-initial-focus": true, maxLength: 64, minLength: 2, pattern: "[a-z0-9][a-z0-9._-]{1,63}", placeholder: "\u4F8B\u5982 openrouter", required: true, value: providerForm.provider, onChange: (event) => setProviderForm((current) => ({ ...current, provider: event.target.value })) })] }), _jsxs("label", { children: [_jsx("span", { children: "\u663E\u793A\u540D\u79F0" }), _jsx("input", { "aria-label": "\u63D0\u4F9B\u5546\u540D\u79F0", placeholder: "\u53EF\u9009", value: providerForm.name, onChange: (event) => setProviderForm((current) => ({ ...current, name: event.target.value })) })] }), _jsxs("label", { className: "provider-add-wide", children: [_jsx("span", { children: "\u63A5\u53E3\u5730\u5740" }), _jsx("input", { "aria-label": "\u63A5\u53E3\u5730\u5740", placeholder: "https://api.example.com/v1", required: true, type: "url", value: providerForm.baseUrl, onChange: (event) => setProviderForm((current) => ({ ...current, baseUrl: event.target.value })) })] }), _jsxs("label", { children: [_jsx("span", { children: "\u6A21\u578B ID" }), _jsx("input", { "aria-label": "\u6A21\u578B ID", placeholder: "\u4F8B\u5982 gpt-4o", required: true, value: providerForm.model, onChange: (event) => setProviderForm((current) => ({ ...current, model: event.target.value })) })] }), _jsxs("label", { children: [_jsx("span", { children: "\u534F\u8BAE" }), _jsxs("select", { "aria-label": "\u534F\u8BAE", value: providerForm.api, onChange: (event) => setProviderForm((current) => ({ ...current, api: event.target.value })), children: [_jsx("option", { value: "openai-completions", children: "OpenAI Completions" }), _jsx("option", { value: "openai-responses", children: "OpenAI Responses" })] })] }), _jsxs("label", { className: "provider-add-wide", children: [_jsx("span", { children: "API key" }), _jsx("input", { "aria-label": "API key", placeholder: "\u53EA\u5728\u672C\u673A\u63D0\u4EA4\uFF0C\u4E0D\u4F1A\u56DE\u663E", required: true, type: "password", value: providerForm.apiKey, onChange: (event) => setProviderForm((current) => ({ ...current, apiKey: event.target.value })) })] }), _jsxs("div", { className: "provider-add-actions", children: [_jsx("button", { className: "primary", disabled: providerBusy.__add, type: "submit", children: providerBusy.__add ? "添加中…" : "添加提供商" }), providerState.__add && _jsx("small", { "aria-live": "polite", children: providerState.__add })] })] })] }) })), _jsx("small", { children: "\u5DF2\u542F\u7528\u63D0\u4F9B\u5546 \u00B7 /api/providers" }), data.providers.length ? (data.providers.map((provider) => (_jsxs("article", { className: "provider-card", children: [_jsxs("div", { className: "provider-head", children: [_jsx("span", { className: "provider-dot", children: "\u25CF" }), _jsx("strong", { children: provider.name }), _jsx("span", { className: "provider-state", children: provider.active ? "当前会话" : provider.auth?.configured === true ? "已配置" : "未配置" })] }), _jsxs("div", { className: "provider-field", children: [_jsx("code", { children: "provider" }), _jsx("input", { "aria-label": `${provider.name} 提供商 ID`, disabled: true, value: provider.provider, readOnly: true })] }), _jsxs("div", { className: "provider-field", children: [_jsx("code", { children: "model" }), _jsxs("div", { className: "provider-model-value", title: provider.models.map((model) => model.id).join(", ") || "暂无模型", children: [_jsx("span", { children: provider.activeModel ? `${provider.activeModel.provider}/${provider.activeModel.id}` : "未选择模型" }), provider.models.length > 0 && (_jsxs("details", { className: "provider-models-details", children: [_jsxs("summary", { children: ["\u67E5\u770B ", provider.models.length, " \u4E2A\u6A21\u578B"] }), _jsx("div", { className: "model-chips", children: provider.models.map((model) => (_jsx("span", { children: model.id }, model.id))) })] }))] })] }), _jsxs("div", { className: "provider-field", children: [_jsx("code", { children: "api_key" }), _jsx("input", { "aria-label": `${provider.name} API key 状态`, disabled: true, value: "\u4E0D\u4F1A\u5728\u6D4F\u89C8\u5668\u663E\u793A", readOnly: true })] }), _jsxs("div", { className: "provider-footer", children: [_jsxs("code", { children: [provider.models.length, " \u4E2A\u6A21\u578B"] }), _jsx("button", { disabled: providerBusy[provider.provider], onClick: () => runProviderAction(provider.provider, "test"), type: "button", children: providerBusy[provider.provider] && providerState[provider.provider] === "测试中…" ? "测试中…" : "测试连接" }), _jsx("button", { className: "link-button", disabled: providerBusy[provider.provider], onClick: () => runProviderAction(provider.provider, "refresh"), type: "button", children: providerBusy[provider.provider] && providerState[provider.provider] === "刷新中…" ? "刷新中…" : "拉取模型" })] }), providerState[provider.provider] && (_jsx("small", { "aria-live": "polite", className: "provider-result", children: providerState[provider.provider] }))] }, provider.provider)))) : (_jsx("div", { className: "empty-state", children: "\u8FD0\u884C\u65F6\u6CA1\u6709\u6CE8\u518C\u63D0\u4F9B\u5546\u3002" }))] })), tab === "toml" && (_jsxs("div", { className: "config-editor", children: [_jsxs("div", { className: "toml-toolbar", children: [_jsxs("div", { children: [_jsx("strong", { children: "\u8FD0\u884C\u65F6\u914D\u7F6E" }), _jsx("span", { children: config?.path ?? "~/.pi/agent/settings.json" })] }), _jsx("button", { className: configMode === "form" ? "active" : "", onClick: () => setConfigMode("form"), type: "button", children: "\u8868\u5355" }), _jsx("button", { className: configMode === "source" ? "active" : "", onClick: () => setConfigMode("source"), type: "button", children: "\u6E90\u7801" }), _jsx("button", { className: "primary", disabled: configBusy, onClick: () => {
1358
- setConfigBusy(true);
1359
- setConfigState("重载中…");
1360
- void api
1361
- .reloadConfig()
1362
- .then(setConfig)
1363
- .then(() => setConfigState("已从磁盘重载"))
1364
- .catch((cause) => setConfigState(cause instanceof Error ? cause.message : String(cause)))
1365
- .finally(() => setConfigBusy(false));
1366
- }, type: "button", children: "\u91CD\u8F7D" })] }), configState && (_jsx("div", { "aria-live": "polite", className: `config-state ${configState.includes("失败") || configState.includes("Error") ? "error" : ""}`, children: configState })), config ? (configMode === "source" ? (_jsxs("div", { className: "config-source-editor", children: [_jsx("textarea", { "aria-label": "settings.json \u6E90\u7801", className: "config-source", onChange: (event) => setConfigSourceDraft(event.target.value), spellCheck: false, value: configSourceDraft }), _jsxs("div", { className: "config-source-actions", children: [_jsx("small", { children: "\u5B8C\u6574 JSON \u914D\u7F6E\uFF0C\u53EF\u7F16\u8F91\u672A\u77E5\u5B57\u6BB5\uFF1B\u4FDD\u5B58\u524D\u4F1A\u6821\u9A8C\u8BED\u6CD5\u3002" }), _jsx("button", { className: "primary", disabled: configBusy || !configSourceDraft.trim(), onClick: () => {
1367
- setConfigBusy(true);
1368
- setConfigState("保存源码…");
1369
- void api
1370
- .updateConfigSource(configSourceDraft)
1371
- .then((value) => {
1372
- setConfig(value);
1373
- setConfigSourceDraft(value.source);
1374
- setConfigState("已保存源码");
1375
- })
1376
- .catch((cause) => setConfigState(cause instanceof Error ? cause.message : String(cause)))
1377
- .finally(() => setConfigBusy(false));
1378
- }, type: "button", children: "\u4FDD\u5B58\u6E90\u7801" })] })] })) : (_jsxs("div", { className: "config-sections", children: [_jsxs("section", { className: "config-section", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u6A21\u578B\u9ED8\u8BA4\u503C" }), _jsx("small", { children: "\u65B0\u4F1A\u8BDD\u542F\u52A8\u65F6\u4F7F\u7528\u7684\u6A21\u578B\u548C\u601D\u8003\u7EA7\u522B" })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u63D0\u4F9B\u5546" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ defaultProvider: event.target.value }, "保存提供商…"), value: config.settings.defaultProvider ?? "", children: [_jsx("option", { value: "", children: "\u8DDF\u968F\u8FD0\u884C\u65F6" }), data.providers.map((provider) => (_jsx("option", { value: provider.provider, children: provider.name }, provider.provider)))] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u6A21\u578B" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ defaultModel: event.target.value }, "保存模型…"), value: config.settings.defaultModel ?? "", children: [_jsx("option", { value: "", children: "\u8DDF\u968F\u63D0\u4F9B\u5546" }), data.models.map((model) => (_jsxs("option", { value: model.id, children: [model.provider, "/", model.name] }, `${model.provider}/${model.id}`)))] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u601D\u8003\u7EA7\u522B" }), _jsx("select", { disabled: configBusy, onChange: (event) => updateConfig({ defaultThinkingLevel: event.target.value }, "保存思考级别…"), value: config.settings.defaultThinkingLevel ?? "medium", children: ["off", "minimal", "low", "medium", "high", "xhigh", "max"].map((level) => (_jsx("option", { value: level, children: level }, level))) })] })] }), _jsxs("section", { className: "config-section", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u8FD0\u884C\u7B56\u7565" }), _jsx("small", { children: "\u6D88\u606F\u961F\u5217\u548C\u7F51\u7EDC\u4F20\u8F93\u884C\u4E3A" })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u4F20\u8F93\u65B9\u5F0F" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ transport: event.target.value }, "保存传输方式…"), value: config.settings.transport, children: [_jsx("option", { value: "auto", children: "\u81EA\u52A8" }), _jsx("option", { value: "sse", children: "SSE" }), _jsx("option", { value: "websocket", children: "WebSocket" })] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "Steering \u6D88\u606F" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ steeringMode: event.target.value }, "保存队列策略…"), value: config.settings.steeringMode, children: [_jsx("option", { value: "one-at-a-time", children: "\u9010\u6761\u53D1\u9001" }), _jsx("option", { value: "all", children: "\u4E00\u6B21\u53D1\u9001\u5168\u90E8" })] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "Follow-up \u6D88\u606F" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ followUpMode: event.target.value }, "保存跟进策略…"), value: config.settings.followUpMode, children: [_jsx("option", { value: "one-at-a-time", children: "\u9010\u6761\u53D1\u9001" }), _jsx("option", { value: "all", children: "\u4E00\u6B21\u53D1\u9001\u5168\u90E8" })] })] })] }), _jsxs("section", { className: "config-section", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u4E0A\u4E0B\u6587\u4E0E\u663E\u793A" }), _jsx("small", { children: "\u63A7\u5236\u601D\u8003\u5185\u5BB9\u548C\u81EA\u52A8\u538B\u7F29" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u9690\u85CF\u601D\u8003\u6B63\u6587" }), _jsx("small", { children: "\u53EA\u663E\u793A\u53EF\u5C55\u5F00\u7684\u601D\u8003\u6458\u8981" })] }), _jsx("input", { checked: config.settings.hideThinkingBlock, disabled: configBusy, onChange: (event) => updateConfig({ hideThinkingBlock: event.target.checked }, "保存显示设置…"), type: "checkbox" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u81EA\u52A8\u538B\u7F29\u4E0A\u4E0B\u6587" }), _jsx("small", { children: "\u63A5\u8FD1\u4E0A\u4E0B\u6587\u4E0A\u9650\u65F6\u81EA\u52A8\u6574\u7406\u5386\u53F2\u6D88\u606F" })] }), _jsx("input", { checked: config.settings.compaction.enabled, disabled: configBusy, onChange: (event) => updateConfig({ compaction: { ...config.settings.compaction, enabled: event.target.checked } }, "保存压缩设置…"), type: "checkbox" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u81EA\u52A8\u91CD\u8BD5" }), _jsx("small", { children: "\u4E34\u65F6\u7F51\u7EDC\u9519\u8BEF\u65F6\u81EA\u52A8\u91CD\u8BD5\u8BF7\u6C42" })] }), _jsx("input", { checked: config.settings.retry.enabled, disabled: configBusy, onChange: (event) => updateConfig({ retry: { ...config.settings.retry, enabled: event.target.checked } }, "保存重试设置…"), type: "checkbox" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u663E\u793A\u56FE\u7247" }), _jsx("small", { children: "\u5141\u8BB8\u6A21\u578B\u54CD\u5E94\u4E2D\u7684\u56FE\u7247\u6E32\u67D3" })] }), _jsx("input", { checked: config.settings.terminal.showImages, disabled: configBusy, onChange: (event) => updateConfig({ terminal: { ...config.settings.terminal, showImages: event.target.checked } }, "保存图片设置…"), type: "checkbox" })] })] }), _jsxs("section", { className: "config-section", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u7EC8\u7AEF\u4E0E\u5BFC\u822A" }), _jsx("small", { children: "\u63A7\u5236\u547D\u4EE4\u884C\u754C\u9762\u548C\u6D88\u606F\u6E32\u67D3\u884C\u4E3A" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u5B89\u9759\u542F\u52A8" }), _jsx("small", { children: "\u542F\u52A8\u65F6\u9690\u85CF\u7248\u672C\u548C\u66F4\u65B0\u63D0\u793A" })] }), _jsx("input", { checked: config.settings.advanced.quietStartup, disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, quietStartup: event.target.checked } }, "保存启动设置…"), type: "checkbox" })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u9879\u76EE\u53EF\u4FE1\u7B56\u7565" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, projectTrust: event.target.value } }, "保存信任策略…"), value: config.settings.advanced.projectTrust, children: [_jsx("option", { value: "ask", children: "\u6BCF\u6B21\u8BE2\u95EE" }), _jsx("option", { value: "always", children: "\u59CB\u7EC8\u4FE1\u4EFB" }), _jsx("option", { value: "never", children: "\u4ECE\u4E0D\u4FE1\u4EFB" })] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "Mermaid \u6E32\u67D3" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, mermaid: event.target.value } }, "保存 Mermaid 设置…"), value: config.settings.advanced.mermaid, children: [_jsx("option", { value: "off", children: "\u5173\u95ED" }), _jsx("option", { value: "final", children: "\u5B8C\u6210\u540E\u6E32\u67D3" }), _jsx("option", { value: "streaming", children: "\u6D41\u5F0F\u6E32\u67D3" })] })] }), _jsxs("label", { className: "config-field", children: [_jsx("span", { children: "\u53CC\u51FB Escape" }), _jsxs("select", { disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, doubleEscapeAction: event.target.value } }, "保存快捷键设置…"), value: config.settings.advanced.doubleEscapeAction, children: [_jsx("option", { value: "tree", children: "\u6253\u5F00\u4F1A\u8BDD\u6811" }), _jsx("option", { value: "fork", children: "\u521B\u5EFA\u5206\u652F" }), _jsx("option", { value: "none", children: "\u4E0D\u6267\u884C" })] })] })] }), _jsxs("section", { className: "config-section", children: [_jsxs("header", { children: [_jsx("strong", { children: "\u8BCA\u65AD\u4E0E\u9690\u79C1" }), _jsx("small", { children: "\u63A7\u5236\u7F13\u5B58\u63D0\u793A\u548C\u533F\u540D\u6570\u636E\u4E0A\u62A5" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u663E\u793A\u7F13\u5B58\u672A\u547D\u4E2D" }), _jsx("small", { children: "\u5728\u6D88\u606F\u4E2D\u663E\u793A\u6A21\u578B\u7F13\u5B58\u8BCA\u65AD" })] }), _jsx("input", { checked: config.settings.advanced.showCacheMissNotices, disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, showCacheMissNotices: event.target.checked } }, "保存诊断设置…"), type: "checkbox" })] }), _jsxs("label", { className: "config-toggle", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u5B89\u88C5\u9065\u6D4B" }), _jsx("small", { children: "\u53D1\u9001\u533F\u540D\u5B89\u88C5\u548C\u7248\u672C\u7EDF\u8BA1" })] }), _jsx("input", { checked: config.settings.advanced.enableInstallTelemetry, disabled: configBusy, onChange: (event) => updateConfig({ advanced: { ...config.settings.advanced, enableInstallTelemetry: event.target.checked } }, "保存隐私设置…"), type: "checkbox" })] })] })] }))) : (_jsx("div", { className: "empty-state", children: "\u6B63\u5728\u8BFB\u53D6\u8FD0\u884C\u65F6\u914D\u7F6E\u2026" }))] }))] })] })] }) }));
1379
- }
1380
- const filterCommands = (commands, query) => {
1381
- const normalized = query.trim().toLowerCase();
1382
- return commands.filter((command) => `${command.invocationName} ${command.description ?? ""}`.toLowerCase().includes(normalized));
1383
- };
1384
- function CommandPalette({ commands, query, activeIndex, onActiveIndexChange, onUse, }) {
1385
- const visible = filterCommands(commands, query);
1386
- const execute = (index) => {
1387
- const command = visible[index];
1388
- if (!command)
1389
- return;
1390
- onUse(`/${command.invocationName}`);
1391
- };
1392
- return (_jsx("div", { "aria-label": "\u547D\u4EE4\u9762\u677F", className: "command-palette", id: "command-menu", role: "listbox", children: _jsxs("div", { className: "palette-group", children: [_jsxs("small", { children: ["COMMANDS ", _jsx("span", { children: "\u00B7 RUNTIME REGISTRY" })] }), visible.length ? (visible.map((command, index) => {
1393
- const invocation = `/${command.invocationName}`;
1394
- return (_jsxs("button", { "aria-selected": index === activeIndex, onClick: () => execute(index), onMouseEnter: () => onActiveIndexChange(index), role: "option", type: "button", children: [_jsx("code", { children: invocation }), _jsx("span", { children: command.description ?? command.source ?? "由当前运行时注册" })] }, `${command.invocationName}:${command.source ?? "runtime"}`));
1395
- })) : (_jsx("div", { className: "empty-state", children: commands.length ? "没有匹配的命令。" : "当前运行时没有可用的命令注册清单。" }))] }) }));
1396
- }
1397
- function PromptCompletionPopover({ kind, commands, files, query, activeIndex, onActiveIndexChange, onUse, }) {
1398
- const items = kind === "command"
1399
- ? filterCommands(commands, query).slice(0, 12)
1400
- : files.filter((file) => `${file.path} ${file.label} ${file.status}`.toLowerCase().includes(query.trim().toLowerCase())).slice(0, 12);
1401
- return (_jsxs("div", { "aria-label": kind === "command" ? "命令补全" : "文件补全", className: "prompt-completion", "data-prompt-completion": true, id: "prompt-completion-list", role: "listbox", children: [_jsx("small", { children: kind === "command" ? "命令" : "文件" }), items.length ? (items.slice(0, 12).map((item, index) => {
1402
- const label = kind === "command" ? `/${item.invocationName}` : `@${item.path}`;
1403
- const detail = kind === "command" ? (item.description ?? item.source ?? "由当前运行时注册") : item.status;
1404
- return (_jsxs("button", { "aria-selected": index === activeIndex, id: `prompt-completion-option-${index}`, onClick: () => onUse(label), onMouseEnter: () => onActiveIndexChange(index), role: "option", type: "button", children: [_jsx("strong", { children: label }), _jsx("span", { children: detail })] }, `${kind}:${label}`));
1405
- })) : (_jsx("span", { className: "prompt-completion-empty", children: "\u6CA1\u6709\u5339\u914D\u9879" }))] }));
1406
- }
1407
- function GlobalSearch({ commands, sessions, files, onClose, onUse, onOpenSession, onOpenFile, }) {
1408
- const [query, setQuery] = useState("");
1409
- const [activeIndex, setActiveIndex] = useState(0);
1410
- const dialogRef = useModalFocus(true, onClose);
1411
- const normalized = query.trim().toLowerCase();
1412
- const matches = (text) => !normalized || text.toLowerCase().includes(normalized);
1413
- const items = [
1414
- ...commands
1415
- .filter((command) => matches(`${command.invocationName} ${command.description ?? ""}`))
1416
- .map((command) => ({ kind: "command", command })),
1417
- ...sessions
1418
- .filter((session) => matches(`${value(session.name, "")} ${value(session.firstMessage, "")} ${value(session.sessionId, "")}`))
1419
- .map((session) => ({ kind: "session", session })),
1420
- ...files.filter((file) => matches(`${file.path} ${file.label} ${file.status}`)).map((file) => ({ kind: "file", file })),
1421
- ];
1422
- const selectedIndex = items.length ? Math.min(activeIndex, items.length - 1) : -1;
1423
- const activeItemId = selectedIndex >= 0 ? `global-search-option-${selectedIndex}` : undefined;
1424
- useEffect(() => setActiveIndex(0), [query]);
1425
- const execute = (item) => {
1426
- if (!item)
1427
- return;
1428
- if (item.kind === "command")
1429
- onUse(`/${item.command.invocationName}`);
1430
- else if (item.kind === "session")
1431
- onOpenSession(item.session);
1432
- else
1433
- onOpenFile(item.file);
1434
- onClose();
1435
- };
1436
- return (_jsx("div", { className: "global-search", onClick: (event) => {
1437
- if (event.target === event.currentTarget)
1438
- onClose();
1439
- }, children: _jsxs("div", { "aria-label": "\u5168\u5C40\u641C\u7D22", "aria-modal": "true", className: "global-search-dialog", ref: dialogRef, role: "dialog", tabIndex: -1, children: [_jsxs("div", { className: "global-search-heading", children: [_jsx("strong", { children: "\u5168\u5C40\u641C\u7D22" }), _jsx("small", { children: "\u547D\u4EE4 \u00B7 \u4F1A\u8BDD \u00B7 \u6587\u4EF6" }), _jsx("button", { "aria-label": "\u5173\u95ED\u5168\u5C40\u641C\u7D22", onClick: onClose, type: "button", children: "\u00D7" })] }), _jsx("input", { "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-controls": "global-search-results", "aria-expanded": "true", "aria-label": "\u5168\u5C40\u641C\u7D22", "data-dialog-initial-focus": true, onChange: (event) => setQuery(event.target.value), onKeyDown: (event) => {
1440
- if (event.key === "Escape") {
1441
- event.preventDefault();
1442
- onClose();
1443
- }
1444
- else if (event.key === "ArrowDown" && items.length) {
1445
- event.preventDefault();
1446
- setActiveIndex((index) => (index + 1) % items.length);
1447
- }
1448
- else if (event.key === "ArrowUp" && items.length) {
1449
- event.preventDefault();
1450
- setActiveIndex((index) => (index - 1 + items.length) % items.length);
1451
- }
1452
- else if (event.key === "Enter") {
1453
- event.preventDefault();
1454
- execute(items[selectedIndex]);
1455
- }
1456
- }, placeholder: "\u641C\u7D22\u547D\u4EE4\u3001\u4F1A\u8BDD\u6216\u6587\u4EF6", role: "combobox", value: query }), _jsx("div", { className: "global-search-results", id: "global-search-results", role: "listbox", children: items.length ? (["command", "session", "file"].map((kind) => {
1457
- const group = items.filter((item) => item.kind === kind);
1458
- if (!group.length)
1459
- return null;
1460
- const label = kind === "command" ? "命令" : kind === "session" ? "会话" : "文件";
1461
- return (_jsxs("section", { "aria-label": label, className: "global-search-group", role: "group", children: [_jsx("small", { "aria-hidden": "true", children: label }), group.map((item) => {
1462
- const index = items.indexOf(item);
1463
- const title = item.kind === "command"
1464
- ? `/${item.command.invocationName}`
1465
- : item.kind === "session"
1466
- ? value(item.session.name ?? item.session.firstMessage ?? item.session.sessionId, "未命名会话")
1467
- : item.file.label;
1468
- const detail = item.kind === "command"
1469
- ? (item.command.description ?? item.command.source ?? "由当前运行时注册")
1470
- : item.kind === "session"
1471
- ? `${value(item.session.messageCount, "0")} 条消息`
1472
- : `${item.file.path} · ${item.file.status}`;
1473
- return (_jsxs("button", { "aria-selected": index === selectedIndex, id: `global-search-option-${index}`, onClick: () => execute(item), onMouseEnter: () => setActiveIndex(index), role: "option", type: "button", children: [_jsx("strong", { children: title }), _jsx("span", { children: detail })] }, `${item.kind}:${title}:${index}`));
1474
- })] }, kind));
1475
- })) : (_jsx("div", { className: "empty-state", children: "\u6CA1\u6709\u5339\u914D\u7684\u547D\u4EE4\u3001\u4F1A\u8BDD\u6216\u6587\u4EF6\u3002" })) })] }) }));
1476
- }
1477
- export function ControlRoomView({ api = createClientApi(), appVersion }) {
1478
- const initialQueryState = useMemo(readQueryState, []);
1479
- const [data, setData] = useState({
1480
- sessions: [],
1481
- files: [],
1482
- models: [],
1483
- providers: [],
1484
- plugins: [],
1485
- pluginPanels: [],
1486
- marketplace: [],
1487
- marketplaceCapabilities: [],
1488
- marketplaceCategories: [],
1489
- marketplaceTotal: 0,
1490
- marketplacePage: 0,
1491
- marketplaceHasNext: false,
1492
- commands: [],
1493
- workspaces: [],
1494
- });
1495
- const [view, setView] = useState(initialQueryState.view);
1496
- const [page, setPage] = useState(initialQueryState.page);
1497
- const [settings, setSettings] = useState(initialQueryState.settings);
1498
- const [details, setDetails] = useState();
1499
- const [commandOpen, setCommandOpen] = useState(false);
1500
- const [globalSearchOpen, setGlobalSearchOpen] = useState(false);
1501
- const [commandQuery, setCommandQuery] = useState("");
1502
- const [commandIndex, setCommandIndex] = useState(0);
1503
- const [sessionMenuOpen, setSessionMenuOpen] = useState(false);
1504
- const [sessionMenuPath, setSessionMenuPath] = useState();
1505
- const [sessionMenuPosition, setSessionMenuPosition] = useState();
1506
- const [sessionToolsOpen, setSessionToolsOpen] = useState(false);
1507
- const [sessionToolsPosition, setSessionToolsPosition] = useState();
1508
- const [sessionSelectionMode, setSessionSelectionMode] = useState(false);
1509
- const [sessionDialog, setSessionDialog] = useState();
1510
- const [sessionActionTarget, setSessionActionTarget] = useState();
1511
- const [sessionNameDraft, setSessionNameDraft] = useState("");
1512
- const [workspaceChooserOpen, setWorkspaceChooserOpen] = useState(false);
1513
- const [workspaceError, setWorkspaceError] = useState("");
1514
- const [selectedWorkspacePath, setSelectedWorkspacePath] = useState();
1515
- const [selectedSessionPath, setSelectedSessionPath] = useState(initialQueryState.sessionPath);
1516
- const initialSessionPathRef = useRef(initialQueryState.sessionPath);
1517
- const sessionRestoreAttemptedRef = useRef(false);
1518
- const [draft, setDraft] = useState("");
1519
- const [annotations, setAnnotations] = useState([]);
1520
- const [annotationSelection, setAnnotationSelection] = useState("");
1521
- const [annotationNote, setAnnotationNote] = useState("");
1522
- const [search, setSearch] = useState("");
1523
- const searchInputRef = useRef(null);
1524
- const [marketplaceQuery, setMarketplaceQuery] = useState(initialQueryState.marketplaceQuery);
1525
- const [marketplaceCapability, setMarketplaceCapability] = useState(initialQueryState.marketplaceCapability);
1526
- const [marketplaceCategory, setMarketplaceCategory] = useState(initialQueryState.marketplaceCategory);
1527
- const [marketplacePluginId, setMarketplacePluginId] = useState(initialQueryState.marketplacePlugin);
1528
- const [marketplaceDetail, setMarketplaceDetail] = useState();
1529
- const [marketplaceDetailPending, setMarketplaceDetailPending] = useState(initialQueryState.marketplacePlugin !== undefined);
1530
- const [marketplaceDetailError, setMarketplaceDetailError] = useState("");
1531
- const [marketplaceCatalog, setMarketplaceCatalog] = useState([]);
1532
- const [installedPluginId, setInstalledPluginId] = useState(initialQueryState.installedPlugin);
1533
- const [installedPluginMetadata, setInstalledPluginMetadata] = useState();
1534
- const [marketplacePage, setMarketplacePage] = useState(initialQueryState.marketplacePage);
1535
- const [permission, setPermission] = useState(true);
1536
- const [promptError, setPromptError] = useState("");
1537
- const [promptBusy, setPromptBusy] = useState(false);
1538
- const [pendingPrompt, setPendingPrompt] = useState("");
1539
- const [sessionActionBusy, setSessionActionBusy] = useState(false);
1540
- const [includeArchivedSessions, setIncludeArchivedSessions] = useState(false);
1541
- const [sessionPage, setSessionPage] = useState(0);
1542
- const [sessionTotal, setSessionTotal] = useState(0);
1543
- const [sessionHasNext, setSessionHasNext] = useState(false);
1544
- const [selectedSessionPaths, setSelectedSessionPaths] = useState(new Set());
1545
- const importInputRef = useRef(null);
1546
- const sessionPopoverTriggerRef = useRef(null);
1547
- const [streamingAssistant, setStreamingAssistant] = useState();
1548
- const promptInputRef = useRef(null);
1549
- const chatScrollRef = useRef(null);
1550
- const stickToBottomRef = useRef(true);
1551
- const refreshTimerRef = useRef(undefined);
1552
- const refreshQueuedRef = useRef(false);
1553
- const [promptCaret, setPromptCaret] = useState(0);
1554
- const [promptCompletionSuppressed, setPromptCompletionSuppressed] = useState(false);
1555
- const [promptCompletionIndex, setPromptCompletionIndex] = useState(0);
1556
- const [initialRefreshPending, setInitialRefreshPending] = useState(true);
1557
- const [refreshIssues, setRefreshIssues] = useState([]);
1558
- useEffect(() => {
1559
- let cancelled = false;
1560
- void loadMarketplaceCatalog(api)
1561
- .then((items) => {
1562
- if (!cancelled)
1563
- setMarketplaceCatalog(items);
1564
- })
1565
- .catch(() => {
1566
- if (!cancelled)
1567
- setMarketplaceCatalog([]);
1568
- });
1569
- return () => {
1570
- cancelled = true;
1571
- };
1572
- }, [api]);
1573
- useEffect(() => {
1574
- if (!selectedSessionPath && data.session?.sessionFile)
1575
- setSelectedSessionPath(data.session.sessionFile);
1576
- }, [data.session?.sessionFile, selectedSessionPath]);
1577
- const promptCompletion = useMemo(() => getPromptCompletion(draft, promptCaret), [draft, promptCaret]);
1578
- const promptCompletionItems = useMemo(() => {
1579
- if (!promptCompletion)
1580
- return [];
1581
- return promptCompletion.kind === "command"
1582
- ? filterCommands(data.commands, promptCompletion.query).slice(0, 12)
1583
- : data.files
1584
- .filter((file) => `${file.path} ${file.label} ${file.status}`.toLowerCase().includes(promptCompletion.query.trim().toLowerCase()))
1585
- .slice(0, 12);
1586
- }, [data.commands, data.files, promptCompletion]);
1587
- const promptCompletionOpen = Boolean(promptCompletion && !promptCompletionSuppressed && promptCompletionItems.length);
1588
- const promptCompletionActiveIndex = Math.min(promptCompletionIndex, Math.max(promptCompletionItems.length - 1, 0));
1589
- const installedPackages = useMemo(() => new Set(data.plugins.filter((plugin) => plugin.removable).map((plugin) => plugin.name)), [data.plugins]);
1590
- const workspaceReady = !workspaceChooserOpen && Boolean(selectedWorkspacePath || data.status?.cwd || data.workspaces.find((workspace) => workspace.current)?.path || data.session);
1591
- const installedPluginCount = useMemo(() => {
1592
- const panelPluginIds = new Set(data.pluginPanels.map((panel) => panel.pluginId));
1593
- return data.plugins.filter((plugin) => plugin.removable || panelPluginIds.has(plugin.name)).length;
1594
- }, [data.pluginPanels, data.plugins]);
1595
- useEffect(() => {
1596
- setPromptCompletionIndex(0);
1597
- }, [promptCompletion?.kind, promptCompletion?.query]);
1598
- useEffect(() => {
1599
- if (!sessionMenuOpen && !sessionToolsOpen)
1600
- return;
1601
- const dismissOnPointerDown = (event) => {
1602
- if (event.target instanceof Element && event.target.closest("[data-session-popover]"))
1603
- return;
1604
- setSessionMenuOpen(false);
1605
- setSessionMenuPath(undefined);
1606
- setSessionMenuPosition(undefined);
1607
- setSessionToolsOpen(false);
1608
- setSessionToolsPosition(undefined);
1609
- setSessionActionTarget(undefined);
1610
- };
1611
- const dismissOnEscape = (event) => {
1612
- if (event.key !== "Escape")
1613
- return;
1614
- event.preventDefault();
1615
- event.stopPropagation();
1616
- setSessionMenuOpen(false);
1617
- setSessionMenuPath(undefined);
1618
- setSessionMenuPosition(undefined);
1619
- setSessionToolsOpen(false);
1620
- setSessionToolsPosition(undefined);
1621
- setSessionActionTarget(undefined);
1622
- sessionPopoverTriggerRef.current?.focus();
1623
- };
1624
- const dismissOnViewportChange = () => {
1625
- setSessionMenuOpen(false);
1626
- setSessionMenuPath(undefined);
1627
- setSessionMenuPosition(undefined);
1628
- setSessionToolsOpen(false);
1629
- setSessionToolsPosition(undefined);
1630
- setSessionActionTarget(undefined);
1631
- };
1632
- document.addEventListener("pointerdown", dismissOnPointerDown);
1633
- document.addEventListener("keydown", dismissOnEscape);
1634
- document.addEventListener("scroll", dismissOnViewportChange, true);
1635
- window.addEventListener("resize", dismissOnViewportChange);
1636
- return () => {
1637
- document.removeEventListener("pointerdown", dismissOnPointerDown);
1638
- document.removeEventListener("keydown", dismissOnEscape);
1639
- document.removeEventListener("scroll", dismissOnViewportChange, true);
1640
- window.removeEventListener("resize", dismissOnViewportChange);
1641
- };
1642
- }, [sessionMenuOpen, sessionToolsOpen]);
1643
- useEffect(() => {
1644
- if (!commandOpen && !promptCompletionOpen)
1645
- return;
1646
- const dismissTransientLists = (event) => {
1647
- const target = event.target instanceof Element ? event.target : undefined;
1648
- if (commandOpen && !target?.closest("[data-command-palette]")) {
1649
- setCommandOpen(false);
1650
- setCommandQuery("");
1651
- }
1652
- if (promptCompletionOpen && !target?.closest("[data-prompt-completion]"))
1653
- setPromptCompletionSuppressed(true);
1654
- };
1655
- document.addEventListener("pointerdown", dismissTransientLists);
1656
- return () => document.removeEventListener("pointerdown", dismissTransientLists);
1657
- }, [commandOpen, promptCompletionOpen]);
1658
- useEffect(() => {
1659
- const dismissProviderModels = (event) => {
1660
- if (event instanceof KeyboardEvent && event.key !== "Escape")
1661
- return;
1662
- const target = event.target instanceof Element ? event.target : undefined;
1663
- document.querySelectorAll("details.provider-models-details[open]").forEach((details) => {
1664
- if (event instanceof PointerEvent && target && details.contains(target))
1665
- return;
1666
- details.removeAttribute("open");
1667
- if (event instanceof KeyboardEvent)
1668
- details.querySelector("summary")?.focus();
1669
- });
1670
- };
1671
- document.addEventListener("pointerdown", dismissProviderModels);
1672
- document.addEventListener("keydown", dismissProviderModels);
1673
- return () => {
1674
- document.removeEventListener("pointerdown", dismissProviderModels);
1675
- document.removeEventListener("keydown", dismissProviderModels);
1676
- };
1677
- }, []);
1678
- useEffect(() => {
1679
- if (typeof window === "undefined")
1680
- return;
1681
- const params = new URLSearchParams(window.location.search);
1682
- params.set("page", page);
1683
- if (view === "chat")
1684
- params.delete("view");
1685
- else
1686
- params.set("view", view);
1687
- if (settings)
1688
- params.set("settings", settings);
1689
- else
1690
- params.delete("settings");
1691
- if (selectedSessionPath)
1692
- params.set("session", selectedSessionPath);
1693
- else
1694
- params.delete("session");
1695
- if (marketplaceQuery)
1696
- params.set("marketplaceQuery", marketplaceQuery);
1697
- else
1698
- params.delete("marketplaceQuery");
1699
- if (marketplaceCapability)
1700
- params.set("capability", marketplaceCapability);
1701
- else
1702
- params.delete("capability");
1703
- if (marketplaceCategory)
1704
- params.set("category", marketplaceCategory);
1705
- else
1706
- params.delete("category");
1707
- if (page === "plugins" && installedPluginId)
1708
- params.set("plugin", installedPluginId);
1709
- else if (page === "marketplace" && marketplacePluginId)
1710
- params.set("plugin", marketplacePluginId);
1711
- else
1712
- params.delete("plugin");
1713
- if (marketplacePage > 0)
1714
- params.set("marketplacePage", String(marketplacePage));
1715
- else
1716
- params.delete("marketplacePage");
1717
- const query = params.toString();
1718
- window.history.replaceState(null, "", `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`);
1719
- }, [
1720
- installedPluginId,
1721
- marketplaceCapability,
1722
- marketplaceCategory,
1723
- marketplacePage,
1724
- marketplacePluginId,
1725
- marketplaceQuery,
1726
- page,
1727
- selectedSessionPath,
1728
- settings,
1729
- view,
1730
- ]);
1731
- useEffect(() => {
1732
- const onPopState = () => {
1733
- const next = readQueryState();
1734
- setCommandOpen(false);
1735
- setGlobalSearchOpen(false);
1736
- setSessionMenuOpen(false);
1737
- setDetails(undefined);
1738
- setPage(next.page);
1739
- setView(next.view);
1740
- setSettings(next.settings);
1741
- setSelectedSessionPath(next.sessionPath);
1742
- setMarketplaceQuery(next.marketplaceQuery);
1743
- setMarketplaceCapability(next.marketplaceCapability);
1744
- setMarketplaceCategory(next.marketplaceCategory);
1745
- setMarketplacePage(next.marketplacePage);
1746
- setInstalledPluginId(next.installedPlugin);
1747
- setMarketplacePluginId(next.marketplacePlugin);
1748
- };
1749
- window.addEventListener("popstate", onPopState);
1750
- return () => window.removeEventListener("popstate", onPopState);
1751
- }, []);
1752
- useEffect(() => {
1753
- if (marketplacePluginId === undefined) {
1754
- setMarketplaceDetail(undefined);
1755
- setMarketplaceDetailPending(false);
1756
- setMarketplaceDetailError("");
1757
- return;
1758
- }
1759
- const visible = data.marketplace.find((plugin) => plugin.id === marketplacePluginId);
1760
- if (visible !== undefined) {
1761
- setMarketplaceDetail(visible);
1762
- setMarketplaceDetailPending(false);
1763
- setMarketplaceDetailError("");
1764
- return;
1765
- }
1766
- let cancelled = false;
1767
- setMarketplaceDetail(undefined);
1768
- setMarketplaceDetailPending(true);
1769
- setMarketplaceDetailError("");
1770
- void api
1771
- .listMarketplace("", "", 0, 100)
1772
- .then((result) => {
1773
- if (cancelled)
1774
- return;
1775
- const plugin = result.items.find((item) => item.id === marketplacePluginId);
1776
- if (plugin === undefined)
1777
- setMarketplaceDetailError("没有找到这个市场插件,它可能已下架。");
1778
- else
1779
- setMarketplaceDetail(plugin);
1780
- })
1781
- .catch((cause) => {
1782
- if (!cancelled)
1783
- setMarketplaceDetailError(cause instanceof Error ? cause.message : String(cause));
1784
- })
1785
- .finally(() => {
1786
- if (!cancelled)
1787
- setMarketplaceDetailPending(false);
1788
- });
1789
- return () => {
1790
- cancelled = true;
1791
- };
1792
- }, [api, data.marketplace, marketplacePluginId]);
1793
- useEffect(() => {
1794
- if (installedPluginId === undefined) {
1795
- setInstalledPluginMetadata(undefined);
1796
- return;
1797
- }
1798
- let cancelled = false;
1799
- setInstalledPluginMetadata(undefined);
1800
- void api
1801
- .listMarketplace("", "", 0, 100)
1802
- .then((result) => {
1803
- if (!cancelled)
1804
- setInstalledPluginMetadata(result.items.find((item) => item.packageName === installedPluginId));
1805
- })
1806
- .catch(() => {
1807
- if (!cancelled)
1808
- setInstalledPluginMetadata(undefined);
1809
- });
1810
- return () => {
1811
- cancelled = true;
1812
- };
1813
- }, [api, installedPluginId]);
1814
- const refresh = useCallback(async () => {
1815
- const results = await Promise.allSettled([
1816
- api.getStatus(),
1817
- api.getSession(),
1818
- api.listSessions(sessionPage, 30, includeArchivedSessions),
1819
- api.getFiles(),
1820
- api.listModels(),
1821
- api.listProviders(),
1822
- api.listPlugins(),
1823
- api.listPluginPanels(),
1824
- api.listMarketplace(marketplaceQuery, marketplaceCapability, marketplacePage, 24, marketplaceCategory),
1825
- api.listCommands(),
1826
- api.listWorkspaces(),
1827
- ]);
1828
- const [status, session, sessions, files, models, providers, plugins, pluginPanels, marketplace, commands, workspaces] = results;
1829
- setRefreshIssues(failedRefreshLabels(["运行状态", "当前会话", "会话列表", "文件", "模型", "提供商", "插件", "插件面板", "插件市场", "命令", "工作区"], results));
1830
- setInitialRefreshPending(false);
1831
- setData((current) => ({
1832
- status: status.status === "fulfilled" ? status.value : current.status,
1833
- session: session.status === "fulfilled" ? session.value : current.session,
1834
- sessions: sessions.status === "fulfilled" ? sessions.value.items : current.sessions,
1835
- files: files.status === "fulfilled" ? files.value : current.files,
1836
- models: models.status === "fulfilled" ? models.value : current.models,
1837
- providers: providers.status === "fulfilled" ? providers.value : current.providers,
1838
- plugins: plugins.status === "fulfilled" ? plugins.value : current.plugins,
1839
- pluginPanels: pluginPanels.status === "fulfilled" ? pluginPanels.value : current.pluginPanels,
1840
- marketplace: marketplace.status === "fulfilled" ? marketplace.value.items : current.marketplace,
1841
- marketplaceCapabilities: marketplace.status === "fulfilled" ? marketplace.value.capabilities : current.marketplaceCapabilities,
1842
- marketplaceCategories: marketplace.status === "fulfilled" ? marketplace.value.categories : current.marketplaceCategories,
1843
- marketplaceTotal: marketplace.status === "fulfilled" ? marketplace.value.total : current.marketplaceTotal,
1844
- marketplacePage: marketplace.status === "fulfilled" ? marketplace.value.page : current.marketplacePage,
1845
- marketplaceHasNext: marketplace.status === "fulfilled" ? marketplace.value.hasNext : current.marketplaceHasNext,
1846
- commands: commands.status === "fulfilled" ? commands.value : current.commands,
1847
- workspaces: workspaces.status === "fulfilled" ? workspaces.value : current.workspaces,
1848
- }));
1849
- if (sessions.status === "fulfilled") {
1850
- setSessionTotal(sessions.value.total);
1851
- setSessionHasNext(sessions.value.hasNext);
1852
- }
1853
- }, [api, includeArchivedSessions, marketplaceCapability, marketplaceCategory, marketplacePage, marketplaceQuery, sessionPage]);
1854
- const scheduleRefresh = useCallback(() => {
1855
- refreshQueuedRef.current = true;
1856
- if (refreshTimerRef.current !== undefined)
1857
- return;
1858
- refreshTimerRef.current = window.setTimeout(() => {
1859
- refreshTimerRef.current = undefined;
1860
- if (!refreshQueuedRef.current)
1861
- return;
1862
- refreshQueuedRef.current = false;
1863
- void refresh();
1864
- }, 100);
1865
- }, [refresh]);
1866
- const handleRuntimeEvent = useCallback((payload) => {
1867
- scheduleRefresh();
1868
- const event = payload.event;
1869
- if (typeof event !== "object" || event === null)
1870
- return;
1871
- const runtimeEvent = event;
1872
- if (runtimeEvent.type === "turn_start") {
1873
- setStreamingAssistant({ thinking: "", text: "" });
1874
- return;
1875
- }
1876
- if (runtimeEvent.type !== "message_update" || typeof runtimeEvent.assistantMessageEvent !== "object" || runtimeEvent.assistantMessageEvent === null)
1877
- return;
1878
- const assistantMessageEvent = runtimeEvent.assistantMessageEvent;
1879
- const type = assistantMessageEvent.type;
1880
- if (type !== "thinking_delta" && type !== "text_delta")
1881
- return;
1882
- const delta = typeof assistantMessageEvent.delta === "string" ? assistantMessageEvent.delta : "";
1883
- if (!delta)
1884
- return;
1885
- setStreamingAssistant((current) => ({
1886
- thinking: (current?.thinking ?? "") + (type === "thinking_delta" ? delta : ""),
1887
- text: (current?.text ?? "") + (type === "text_delta" ? delta : ""),
1888
- }));
1889
- }, [scheduleRefresh]);
1890
- const createNewSession = useCallback(async (workspace) => {
1891
- setPromptError("");
1892
- setWorkspaceError("");
1893
- try {
1894
- const created = await api.createSession(workspace?.path);
1895
- if (created.sessionFile)
1896
- setSelectedSessionPath(created.sessionFile);
1897
- setSettings(undefined);
1898
- setCommandOpen(false);
1899
- setGlobalSearchOpen(false);
1900
- setDetails(undefined);
1901
- setWorkspaceChooserOpen(false);
1902
- setSelectedWorkspacePath(workspace?.path);
1903
- setCommandQuery("");
1904
- setPage("session");
1905
- setView("chat");
1906
- setSessionMenuOpen(false);
1907
- await refresh();
1908
- }
1909
- catch (cause) {
1910
- const message = cause instanceof Error ? cause.message : String(cause);
1911
- if (workspace)
1912
- setWorkspaceError(message);
1913
- else
1914
- setPromptError(message);
1915
- }
1916
- }, [api, refresh]);
1917
- const beginNewSession = () => {
1918
- setPromptError("");
1919
- setWorkspaceError("");
1920
- setSelectedWorkspacePath(undefined);
1921
- setWorkspaceChooserOpen(true);
1922
- };
1923
- const pickDirectory = useCallback(async () => {
1924
- try {
1925
- const path = await api.pickDirectory();
1926
- const name = path.split(/[\\/]/).filter(Boolean).pop() ?? path;
1927
- await createNewSession({ path, branch: "directory", current: false, name });
1928
- }
1929
- catch (cause) {
1930
- setWorkspaceError(cause instanceof Error ? cause.message : String(cause));
1931
- }
1932
- }, [api, createNewSession]);
1933
- const openDirectory = useCallback(async () => {
1934
- await pickDirectory();
1935
- }, [pickDirectory]);
1936
- useEffect(() => {
1937
- void refresh();
1938
- const unsubscribe = api.subscribeEvents(handleRuntimeEvent);
1939
- const timer = window.setInterval(() => void refresh(), 5000);
1940
- return () => {
1941
- unsubscribe();
1942
- window.clearInterval(timer);
1943
- if (refreshTimerRef.current !== undefined) {
1944
- window.clearTimeout(refreshTimerRef.current);
1945
- refreshTimerRef.current = undefined;
1946
- }
1947
- };
1948
- }, [api, handleRuntimeEvent, refresh]);
1949
- useEffect(() => {
1950
- if (data.status?.status !== "running")
1951
- setStreamingAssistant(undefined);
1952
- }, [data.status?.status]);
1953
- useEffect(() => {
1954
- const path = initialSessionPathRef.current;
1955
- if (!path || sessionRestoreAttemptedRef.current || data.sessions.length === 0)
1956
- return;
1957
- sessionRestoreAttemptedRef.current = true;
1958
- const target = data.sessions.find((session) => session.path === path);
1959
- if (!target || typeof target.path !== "string") {
1960
- setSelectedSessionPath(undefined);
1961
- return;
1962
- }
1963
- if (data.session?.sessionFile === target.path)
1964
- return;
1965
- void api
1966
- .openSession(target.path)
1967
- .then(refresh)
1968
- .catch((cause) => setPromptError(cause instanceof Error ? cause.message : String(cause)));
1969
- }, [api, data.session?.sessionFile, data.sessions, refresh]);
1970
- useEffect(() => {
1971
- setCommandIndex(0);
1972
- if (!commandOpen)
1973
- return;
1974
- const frame = window.requestAnimationFrame(() => searchInputRef.current?.focus());
1975
- return () => window.cancelAnimationFrame(frame);
1976
- }, [commandOpen, commandQuery]);
1977
- useEffect(() => {
1978
- const onKeyDown = (event) => {
1979
- if (event.key === "Escape") {
1980
- if (sessionDialog) {
1981
- setSessionDialog(undefined);
1982
- return;
1983
- }
1984
- if (globalSearchOpen) {
1985
- setGlobalSearchOpen(false);
1986
- return;
1987
- }
1988
- if (commandOpen) {
1989
- setCommandOpen(false);
1990
- setCommandQuery("");
1991
- return;
1992
- }
1993
- if (details !== undefined) {
1994
- setDetails(undefined);
1995
- return;
1996
- }
1997
- setCommandOpen(false);
1998
- setSessionMenuOpen(false);
1999
- setSessionToolsOpen(false);
2000
- setWorkspaceChooserOpen(false);
2001
- setSettings(undefined);
2002
- }
2003
- if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
2004
- event.preventDefault();
2005
- setCommandOpen(false);
2006
- setGlobalSearchOpen(true);
2007
- }
2008
- if ((event.metaKey || event.ctrlKey) && event.key === ",") {
2009
- event.preventDefault();
2010
- setCommandOpen(false);
2011
- setGlobalSearchOpen(false);
2012
- setDetails(undefined);
2013
- setSettings("general");
2014
- }
2015
- };
2016
- window.addEventListener("keydown", onKeyDown);
2017
- return () => window.removeEventListener("keydown", onKeyDown);
2018
- }, [commandOpen, details, globalSearchOpen, sessionDialog]);
2019
- const events = data.session?.events ?? [];
2020
- const displayEvents = useMemo(() => compactThinkingEvents(events), [events]);
2021
- useEffect(() => {
2022
- if (!stickToBottomRef.current)
2023
- return;
2024
- const frame = window.requestAnimationFrame(() => {
2025
- const element = chatScrollRef.current;
2026
- if (element)
2027
- element.scrollTop = element.scrollHeight;
2028
- });
2029
- return () => window.cancelAnimationFrame(frame);
2030
- }, [data.session?.messages.length, data.status?.events, pendingPrompt, promptBusy]);
2031
- const filteredSessions = data.sessions.filter((session) => !search ||
2032
- value(session.name ?? session.firstMessage, "未命名会话")
2033
- .toLowerCase()
2034
- .includes(search.toLowerCase()));
2035
- const submit = (event) => {
2036
- event.preventDefault();
2037
- const question = draft.trim();
2038
- const prompt = annotations.length > 0 ? formatAnnotationPrompt(annotations, question) : question;
2039
- if (!prompt || promptBusy)
2040
- return;
2041
- setDraft("");
2042
- setPromptError("");
2043
- setPendingPrompt(prompt);
2044
- setStreamingAssistant(undefined);
2045
- stickToBottomRef.current = true;
2046
- setPromptBusy(true);
2047
- void api
2048
- .prompt(prompt)
2049
- .then(async () => {
2050
- setAnnotations([]);
2051
- await refresh();
2052
- })
2053
- .catch((cause) => setPromptError(cause instanceof Error ? cause.message : String(cause)))
2054
- .finally(() => setPendingPrompt(""))
2055
- .finally(() => setPromptBusy(false));
2056
- };
2057
- const captureAnnotationSelection = () => {
2058
- window.requestAnimationFrame(() => {
2059
- const selected = window.getSelection()?.toString().trim() ?? "";
2060
- if (selected.length > 0)
2061
- setAnnotationSelection(selected.slice(0, 4_000));
2062
- });
2063
- };
2064
- const addAnnotation = () => {
2065
- const quote = annotationSelection.trim();
2066
- if (!quote)
2067
- return;
2068
- setAnnotations((current) => [
2069
- ...current,
2070
- { id: current.length === 0 ? 1 : Math.max(...current.map((item) => item.id)) + 1, quote, note: annotationNote.trim() },
2071
- ]);
2072
- setAnnotationSelection("");
2073
- setAnnotationNote("");
2074
- };
2075
- const openCommandCompletion = () => {
2076
- const input = promptInputRef.current;
2077
- const caret = input?.selectionStart ?? draft.length;
2078
- const existing = getPromptCompletion(draft, caret);
2079
- let nextCaret = caret;
2080
- if (existing?.kind !== "command") {
2081
- const separator = caret > 0 && !/\s/.test(draft[caret - 1] ?? "") ? " " : "";
2082
- const insertion = `${separator}/`;
2083
- const nextDraft = `${draft.slice(0, caret)}${insertion}${draft.slice(caret)}`;
2084
- nextCaret = caret + insertion.length;
2085
- setDraft(nextDraft);
2086
- }
2087
- setPromptCaret(nextCaret);
2088
- setPromptCompletionSuppressed(false);
2089
- setPromptCompletionIndex(0);
2090
- window.requestAnimationFrame(() => {
2091
- input?.focus();
2092
- input?.setSelectionRange(nextCaret, nextCaret);
2093
- });
2094
- };
2095
- const openSession = (session) => {
2096
- const path = typeof session.path === "string" ? session.path : "";
2097
- if (!path)
2098
- return;
2099
- setSettings(undefined);
2100
- setCommandOpen(false);
2101
- setGlobalSearchOpen(false);
2102
- setPage("session");
2103
- setView("chat");
2104
- setDetails(undefined);
2105
- setSelectedSessionPath(path);
2106
- void api
2107
- .openSession(path)
2108
- .then(refresh)
2109
- .catch((cause) => setPromptError(cause instanceof Error ? cause.message : String(cause)));
2110
- };
2111
- const sessionAction = async (action) => {
2112
- if (sessionActionBusy)
2113
- return;
2114
- setSessionActionBusy(true);
2115
- setPromptError("");
2116
- try {
2117
- await action();
2118
- await refresh();
2119
- setSelectedSessionPaths(new Set());
2120
- setSessionMenuOpen(false);
2121
- setSessionMenuPath(undefined);
2122
- setSessionMenuPosition(undefined);
2123
- setSessionToolsOpen(false);
2124
- setSessionToolsPosition(undefined);
2125
- setSessionActionTarget(undefined);
2126
- setSessionSelectionMode(false);
2127
- setSessionDialog(undefined);
2128
- }
2129
- catch (cause) {
2130
- setPromptError(cause instanceof Error ? cause.message : String(cause));
2131
- }
2132
- finally {
2133
- setSessionActionBusy(false);
2134
- }
2135
- };
2136
- const activeSessionPath = data.session?.sessionFile;
2137
- const toggleSessionSelection = (path) => {
2138
- setSelectedSessionPaths((current) => {
2139
- const next = new Set(current);
2140
- if (next.has(path))
2141
- next.delete(path);
2142
- else
2143
- next.add(path);
2144
- return next;
2145
- });
2146
- };
2147
- const openSessionMenu = (path, name, trigger) => {
2148
- if (sessionMenuOpen && sessionMenuPath === path) {
2149
- closeSessionMenu();
2150
- setSessionActionTarget(undefined);
2151
- return;
2152
- }
2153
- setSessionToolsOpen(false);
2154
- setSessionToolsPosition(undefined);
2155
- sessionPopoverTriggerRef.current = trigger;
2156
- setSessionNameDraft(name ?? "");
2157
- setSessionActionTarget({ name: name || "未命名会话", path });
2158
- setSessionMenuPath(path);
2159
- setSessionMenuPosition(sidebarPopoverPosition(trigger, 142, 190, "beside"));
2160
- setSessionMenuOpen(true);
2161
- };
2162
- const closeSessionMenu = () => {
2163
- setSessionMenuOpen(false);
2164
- setSessionMenuPath(undefined);
2165
- setSessionMenuPosition(undefined);
2166
- };
2167
- const pushInstalledPluginRoute = (pluginId) => {
2168
- const params = new URLSearchParams(window.location.search);
2169
- params.set("page", "plugins");
2170
- params.delete("settings");
2171
- if (pluginId)
2172
- params.set("plugin", pluginId);
2173
- else
2174
- params.delete("plugin");
2175
- const query = params.toString();
2176
- window.history.pushState(null, "", `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`);
2177
- setSettings(undefined);
2178
- setDetails(undefined);
2179
- setCommandOpen(false);
2180
- setGlobalSearchOpen(false);
2181
- setSessionMenuOpen(false);
2182
- setSessionMenuPath(undefined);
2183
- setPage("plugins");
2184
- setInstalledPluginId(pluginId);
2185
- setMarketplacePluginId(undefined);
2186
- };
2187
- const pushMarketplacePluginRoute = (pluginId) => {
2188
- const params = new URLSearchParams(window.location.search);
2189
- params.set("page", "marketplace");
2190
- params.delete("settings");
2191
- if (pluginId)
2192
- params.set("plugin", pluginId);
2193
- else
2194
- params.delete("plugin");
2195
- const query = params.toString();
2196
- window.history.pushState(null, "", `${window.location.pathname}${query ? `?${query}` : ""}${window.location.hash}`);
2197
- setSettings(undefined);
2198
- setDetails(undefined);
2199
- setCommandOpen(false);
2200
- setGlobalSearchOpen(false);
2201
- setSessionMenuOpen(false);
2202
- setSessionMenuPath(undefined);
2203
- setPage("marketplace");
2204
- setInstalledPluginId(undefined);
2205
- setMarketplacePluginId(pluginId);
2206
- };
2207
- const installedPlugin = installedPluginId === undefined ? undefined : data.plugins.find((plugin) => plugin.name === installedPluginId);
2208
- const installedPluginPanel = installedPluginId === undefined ? undefined : data.pluginPanels.find((panel) => panel.pluginId === installedPluginId);
2209
- const content = settings ? (_jsx(Settings, { api: api, data: data, tab: settings, onTab: setSettings, onRefresh: refresh, onClose: () => {
2210
- setSettings(undefined);
2211
- setPage("session");
2212
- setView("chat");
2213
- setDetails(undefined);
2214
- } })) : page === "plugins" && installedPluginId && installedPlugin ? (_jsx(InstalledPluginDetail, { metadata: installedPluginMetadata, onBack: () => pushInstalledPluginRoute(undefined), onToggle: async (plugin) => {
2215
- await api.togglePlugin(plugin.id, !plugin.enabled);
2216
- await refresh();
2217
- }, onUninstall: async (plugin) => {
2218
- await api.uninstallPlugin(plugin.id);
2219
- const plugins = await api.listPlugins();
2220
- setData((current) => ({ ...current, plugins: plugins.filter((item) => item.id !== plugin.id) }));
2221
- pushInstalledPluginRoute(undefined);
2222
- }, panel: installedPluginPanel, plugin: installedPlugin })) : page === "plugins" && installedPluginId ? (_jsxs("section", { className: "view-panel min-w-0 overflow-auto bg-[#f8f9fb]", children: [_jsxs("div", { className: "subnav plugin-detail-subnav bg-white", children: [_jsx("a", { href: "?page=plugins", onClick: (event) => {
2223
- event.preventDefault();
2224
- pushInstalledPluginRoute(undefined);
2225
- }, children: "\u2190 \u5DF2\u5B89\u88C5\u63D2\u4EF6" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsx("div", { className: "empty-state", children: data.status ? "没有找到这个已安装插件,它可能已被移除。" : "正在读取插件详情…" })] })) : page === "plugins" ? (_jsx(Plugins, { plugins: data.plugins, panels: data.pluginPanels, catalog: marketplaceCatalog.length ? marketplaceCatalog : data.marketplace, onMarketplace: () => pushMarketplacePluginRoute(undefined), onOpenDetail: (plugin) => pushInstalledPluginRoute(plugin.name), onToml: () => {
2226
- setDetails(undefined);
2227
- setSettings("toml");
2228
- }, onToggle: async (plugin) => {
2229
- await api.togglePlugin(plugin.id, !plugin.enabled);
2230
- await refresh();
2231
- }, onUninstall: async (plugin) => {
2232
- await api.uninstallPlugin(plugin.id);
2233
- const plugins = await api.listPlugins();
2234
- setData((current) => ({ ...current, plugins: plugins.filter((item) => item.id !== plugin.id) }));
2235
- } })) : page === "marketplace" ? (marketplacePluginId && marketplaceDetail?.id === marketplacePluginId ? (_jsx(MarketplaceDetail, { plugin: marketplaceDetail, installed: installedPackages.has(marketplaceDetail.packageName), onBack: () => pushMarketplacePluginRoute(undefined), onInstall: async (plugin) => {
2236
- const result = await api.installMarketplace(plugin.id);
2237
- await refresh();
2238
- return result;
2239
- } })) : marketplacePluginId ? (_jsx("section", { className: "marketplace-page flex min-w-0 flex-1 flex-col", children: _jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [_jsxs("div", { className: "subnav plugin-detail-subnav", children: [_jsx("a", { href: "?page=marketplace", onClick: (event) => {
2240
- event.preventDefault();
2241
- pushMarketplacePluginRoute(undefined);
2242
- }, children: "\u2190 \u63D2\u4EF6\u5E02\u573A" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsx("div", { className: "empty-state", children: marketplaceDetailPending ? "正在读取插件详情…" : marketplaceDetailError || "没有找到这个市场插件,它可能已下架。" })] }) })) : (_jsx(Marketplace, { plugins: data.marketplace, capabilities: data.marketplaceCapabilities, categories: data.marketplaceCategories, total: data.marketplaceTotal, page: data.marketplacePage, hasNext: data.marketplaceHasNext, query: marketplaceQuery, capabilityFilter: marketplaceCapability, categoryFilter: marketplaceCategory, onQueryChange: (value) => {
2243
- setMarketplaceQuery(value);
2244
- setMarketplacePage(0);
2245
- }, onCapabilityChange: (value) => {
2246
- setMarketplaceCapability(value);
2247
- setMarketplacePage(0);
2248
- }, onCategoryChange: (value) => {
2249
- setMarketplaceCategory(value);
2250
- setMarketplacePage(0);
2251
- }, onOpenDetail: (plugin) => pushMarketplacePluginRoute(plugin.id), onPageChange: setMarketplacePage, onBack: () => pushInstalledPluginRoute(undefined), onToml: () => {
2252
- setDetails(undefined);
2253
- setSettings("toml");
2254
- }, installedPackages: installedPackages, onInstall: async (plugin) => {
2255
- const result = await api.installMarketplace(plugin.id);
2256
- await refresh();
2257
- return result;
2258
- } }))) : view === "chat" ? (_jsxs("section", { className: "view-panel chat-view", children: [_jsxs("div", { className: `chat-scroll ${data.session?.messages.length ? "" : "is-empty"}`, onScroll: (event) => {
2259
- const element = event.currentTarget;
2260
- stickToBottomRef.current = element.scrollHeight - element.scrollTop - element.clientHeight < 120;
2261
- }, ref: chatScrollRef, children: [data.session?.messages.length ? (projectChatTurns(data.session.messages).map((turn, index) => {
2262
- return (_jsx("article", { className: `turn ${turn.role === "user" ? "user" : "text"}`, children: turn.role === "user" ? (_jsx(UserMessageBubble, { text: turn.text })) : (_jsxs(_Fragment, { children: [turn.thinking && (_jsxs("details", { className: "reasoning message-reasoning", children: [_jsx("summary", { className: "reasoning-head", children: "\u601D\u8003" }), _jsx("div", { className: "reasoning-body", children: _jsx(MarkdownMessage, { text: turn.thinking }) })] })), turn.text && _jsx(MarkdownMessage, { onMouseUp: captureAnnotationSelection, text: turn.text })] })) }, index));
2263
- })) : (_jsx(Workspace, { status: data.status, workspaces: data.workspaces, onCreate: (workspace) => void createNewSession(workspace), onStarter: setDraft, onToml: () => {
2264
- setDetails(undefined);
2265
- setSettings("toml");
2266
- } })), streamingAssistant && data.status?.status === "running" && (_jsxs("article", { className: "turn text streaming-turn", "aria-live": "polite", children: [streamingAssistant.thinking && (_jsxs("details", { className: "reasoning message-reasoning", children: [_jsx("summary", { className: "reasoning-head", children: "\u601D\u8003\u4E2D\u2026" }), _jsx("div", { className: "reasoning-body", children: _jsx(MarkdownMessage, { text: streamingAssistant.thinking }) })] })), !streamingAssistant.thinking && !streamingAssistant.text && _jsx("div", { className: "streaming-placeholder", children: "\u6B63\u5728\u751F\u6210\u2026" }), streamingAssistant.text && _jsx(MarkdownMessage, { onMouseUp: captureAnnotationSelection, text: streamingAssistant.text })] })), pendingPrompt && !data.session?.messages.some((message) => message.role === "user" && messageText(message) === pendingPrompt) && (_jsx("article", { className: "turn user pending-turn", children: _jsx(UserMessageBubble, { text: pendingPrompt }) }))] }), _jsxs("div", { className: "composer-wrap", children: [_jsx("div", { className: "context-shell", children: _jsxs("div", { className: "context-line", children: [_jsx("span", { className: "context-label", children: "\u5B9E\u65F6\u4E0A\u4E0B\u6587" }), _jsxs("div", { className: "context-metrics", children: [_jsxs("span", { children: [_jsx("b", { children: data.status?.messages ?? 0 }), " \u6761\u6D88\u606F"] }), _jsxs("span", { children: [_jsx("b", { children: data.status?.events ?? events.length }), " \u4E2A\u4E8B\u4EF6"] }), _jsx("span", { children: _jsx("b", { children: value(data.status?.model) }) })] })] }) }), _jsxs("div", { className: "composer-stack", children: [promptError && _jsx(PromptError, { message: promptError }), annotationSelection ? (_jsxs("div", { "aria-label": "\u6DFB\u52A0\u6279\u6CE8", className: "rounded-lg border border-[#cdddf8] bg-[#f6f8ff] px-3 py-2", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 shrink-0 rounded bg-[#dce9ff] px-1.5 py-0.5 text-[10px] text-[#315fb8]", children: "\u9009\u4E2D\u7247\u6BB5" }), _jsx("p", { className: "max-h-16 flex-1 overflow-auto whitespace-pre-wrap text-[11px] text-[#30343b]", children: annotationSelection }), _jsx("button", { "aria-label": "\u53D6\u6D88\u6279\u6CE8", className: "text-[12px] text-[#687381]", onClick: () => setAnnotationSelection(""), type: "button", children: "\u00D7" })] }), _jsxs("div", { className: "mt-2 flex items-center gap-2", children: [_jsx("input", { "aria-label": "\u6279\u6CE8\u5907\u6CE8", className: "min-w-0 flex-1 rounded-md border border-[#dce5f5] bg-white px-2 py-1.5 text-[11px] outline-none", onChange: (event) => setAnnotationNote(event.target.value), placeholder: "\u5907\u6CE8\uFF08\u53EF\u9009\uFF09", value: annotationNote }), _jsx("button", { className: "rounded-md bg-[#3565c5] px-3 py-1.5 text-[11px] font-medium text-white", onClick: addAnnotation, type: "button", children: "\u52A0\u5165\u6279\u6CE8" })] })] })) : null, annotations.length > 0 ? (_jsxs("div", { className: "flex items-center gap-2 overflow-x-auto text-[10px]", children: [_jsxs("span", { className: "shrink-0 rounded-md bg-[#edf3fe] px-2 py-1 font-medium text-[#315fb8]", children: ["\u6279\u6CE8 \u00D7", annotations.length] }), annotations.map((annotation) => (_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: () => setAnnotations((current) => current.filter((item) => item.id !== annotation.id)), title: "\u70B9\u51FB\u79FB\u9664\u6279\u6CE8", type: "button", children: ["#", annotation.id, " ", annotation.quote] }, annotation.id))), _jsx("button", { className: "shrink-0 text-[#687381]", onClick: () => setAnnotations([]), type: "button", children: "\u6E05\u7A7A" })] })) : null, _jsxs("form", { className: "composer", onSubmit: submit, children: [_jsx("textarea", { "aria-activedescendant": promptCompletionOpen ? `prompt-completion-option-${promptCompletionActiveIndex}` : undefined, "aria-autocomplete": "list", "aria-controls": promptCompletionOpen ? "prompt-completion-list" : undefined, "aria-expanded": promptCompletionOpen, "aria-haspopup": "listbox", "aria-label": "Prompt", onChange: (event) => {
2267
- setDraft(event.target.value);
2268
- setPromptCaret(event.currentTarget.selectionStart ?? event.target.value.length);
2269
- setPromptCompletionSuppressed(false);
2270
- event.currentTarget.style.height = "auto";
2271
- event.currentTarget.style.height = `${Math.min(event.currentTarget.scrollHeight, 180)}px`;
2272
- }, onKeyDown: (event) => {
2273
- const caret = event.currentTarget.selectionStart ?? draft.length;
2274
- const completion = getPromptCompletion(event.currentTarget.value, caret);
2275
- const items = completion
2276
- ? completion.kind === "command"
2277
- ? filterCommands(data.commands, completion.query).slice(0, 12)
2278
- : data.files
2279
- .filter((file) => `${file.path} ${file.label} ${file.status}`.toLowerCase().includes(completion.query.trim().toLowerCase()))
2280
- .slice(0, 12)
2281
- : [];
2282
- const popupOpen = Boolean(completion && !promptCompletionSuppressed && items.length);
2283
- if (popupOpen && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
2284
- event.preventDefault();
2285
- setPromptCompletionIndex((index) => (index + (event.key === "ArrowDown" ? 1 : -1) + items.length) % items.length);
2286
- return;
2287
- }
2288
- if (popupOpen && (event.key === "Enter" || event.key === "Tab")) {
2289
- event.preventDefault();
2290
- const item = items[Math.min(promptCompletionIndex, items.length - 1)];
2291
- if (item && completion) {
2292
- const value = completion.kind === "command" ? `/${item.invocationName}` : `@${item.path}`;
2293
- const replacement = replacePromptCompletion(event.currentTarget.value, completion, `${value} `);
2294
- setDraft(replacement.text);
2295
- setPromptCaret(replacement.caret);
2296
- setPromptCompletionSuppressed(false);
2297
- requestAnimationFrame(() => {
2298
- const input = promptInputRef.current;
2299
- input?.focus();
2300
- input?.setSelectionRange(replacement.caret, replacement.caret);
2301
- });
2302
- }
2303
- return;
2304
- }
2305
- if (event.key === "Escape" && completion && !promptCompletionSuppressed) {
2306
- event.preventDefault();
2307
- setPromptCompletionSuppressed(true);
2308
- return;
2309
- }
2310
- if ((event.metaKey || event.ctrlKey) && event.key === "Enter") {
2311
- event.preventDefault();
2312
- event.currentTarget.form?.requestSubmit();
2313
- }
2314
- }, onClick: () => {
2315
- if (!workspaceReady)
2316
- setWorkspaceChooserOpen(true);
2317
- }, onFocus: (event) => {
2318
- if (!workspaceReady) {
2319
- event.currentTarget.blur();
2320
- setWorkspaceChooserOpen(true);
2321
- }
2322
- }, placeholder: workspaceReady ? "描述要做的改动,⌘↵ 发送;@ 引用文件,/ 调用命令" : "先选择工作区,再描述要做的改动", readOnly: !workspaceReady, ref: promptInputRef, rows: 2, "data-prompt-completion": true, value: draft }), promptCompletionOpen && promptCompletion && (_jsx(PromptCompletionPopover, { activeIndex: promptCompletionActiveIndex, commands: data.commands, files: data.files, kind: promptCompletion.kind, onActiveIndexChange: setPromptCompletionIndex, onUse: (value) => {
2323
- const replacement = replacePromptCompletion(draft, promptCompletion, `${value} `);
2324
- setDraft(replacement.text);
2325
- setPromptCaret(replacement.caret);
2326
- setPromptCompletionSuppressed(false);
2327
- requestAnimationFrame(() => {
2328
- const input = promptInputRef.current;
2329
- input?.focus();
2330
- input?.setSelectionRange(replacement.caret, replacement.caret);
2331
- });
2332
- }, query: promptCompletion.query })), _jsxs("div", { className: "composer-tools", children: [_jsx("select", { "aria-label": "\u6A21\u578B", disabled: !data.models.length || promptBusy, value: data.status?.model ?? "", onChange: (event) => {
2333
- const [provider, ...modelParts] = event.target.value.split("/");
2334
- const model = modelParts.join("/");
2335
- if (!provider || !model)
2336
- return;
2337
- setPromptError("");
2338
- void api
2339
- .selectModel(provider, model)
2340
- .then(refresh)
2341
- .catch((cause) => setPromptError(cause instanceof Error ? cause.message : String(cause)));
2342
- }, children: data.models.length ? (data.models.map((model) => (_jsx("option", { value: `${model.provider}/${model.id}`, children: model.name === model.id ? `${model.provider}/${model.id}` : `${model.name} (${model.provider})` }, `${model.provider}/${model.id}`)))) : (_jsx("option", { value: "", children: "\u6682\u65E0\u53EF\u7528\u6A21\u578B" })) }), _jsxs("button", { className: "tool-chip", onClick: () => setPermission((current) => !current), type: "button", children: ["\u25CF ", permission ? "改动前询问" : "自动允许"] }), _jsx("button", { className: "tool-chip", onClick: openCommandCompletion, type: "button", children: "\uFF0F \u547D\u4EE4" }), _jsx("span", { className: "composer-hint", children: "\u2318\u21B5 \u53D1\u9001 \u00B7 \u2318K \u547D\u4EE4 \u00B7 \u2303C \u4E2D\u65AD" }), _jsx("button", { "aria-label": promptBusy ? "发送中" : "发送消息", className: "send-button", disabled: promptBusy || !draft.trim(), title: promptBusy ? "正在发送" : "发送消息(⌘↵)", type: "submit", children: promptBusy ? "…" : "↑" })] })] })] })] })] })) : view === "trajectory" ? (_jsx(Trajectory, { events: displayEvents, onSelect: setDetails })) : (_jsx(Files, { api: api, files: data.files, onDiff: async (file) => {
2343
- const diff = await api.getFileDiff(file);
2344
- setDetails({
2345
- type: "file_diff",
2346
- path: diff.path,
2347
- output: diff.diff || "没有可显示的差异(工作区可能已更新)。",
2348
- });
2349
- }, onRefresh: () => void refresh() }));
2350
- const groups = sessionGroups(filteredSessions);
2351
- const showCurrentSession = Boolean(data.session && !search && !filteredSessions.some((session) => session.sessionId === data.session?.sessionId));
2352
- const visibleCommands = filterCommands(data.commands, commandQuery);
2353
- const betterSidebarPanel = data.pluginPanels.find((panel) => panel.id === "better-sidebar-panel");
2354
- const betterSidebarData = betterSidebarPanel?.data !== null && typeof betterSidebarPanel?.data === "object" && !Array.isArray(betterSidebarPanel?.data)
2355
- ? betterSidebarPanel.data
2356
- : undefined;
2357
- const themeStudioPanel = data.pluginPanels.find((panel) => panel.id === "theme-studio-panel");
2358
- const themeStudioData = themeStudioPanel?.data !== null && typeof themeStudioPanel?.data === "object" && !Array.isArray(themeStudioPanel?.data)
2359
- ? themeStudioPanel.data
2360
- : undefined;
2361
- const themeStyle = useMemo(() => {
2362
- if (!themeStudioData?.tokens || typeof themeStudioData.tokens !== "object" || Array.isArray(themeStudioData.tokens))
2363
- return undefined;
2364
- const tokens = Object.entries(themeStudioData.tokens).filter(([key, token]) => key.startsWith("--") && typeof token === "string");
2365
- return tokens.length ? Object.fromEntries(tokens) : undefined;
2366
- }, [themeStudioData]);
2367
- const activeTheme = typeof themeStudioData?.theme === "string" ? themeStudioData.theme : undefined;
2368
- const useCommand = (value) => {
2369
- setDraft(value);
2370
- setCommandOpen(false);
2371
- setCommandQuery("");
2372
- };
2373
- return (_jsxs("div", { className: "app-frame", "data-theme": activeTheme, style: themeStyle, children: [_jsxs("aside", { className: "sidebar", children: [_jsxs("header", { className: "brand-row", children: [_jsx("span", { className: "pi-mark", "aria-hidden": "true", children: _jsx("img", { src: "/icons/svg/mark-white.svg", alt: "" }) }), _jsx("strong", { children: "pi harness" }), appVersion ? _jsx("span", { className: "version", children: appVersion }) : null] }), _jsxs("div", { className: "sidebar-actions", children: [_jsx("button", { className: "new-session", onClick: beginNewSession, type: "button", "aria-expanded": workspaceChooserOpen, children: "\uFF0B \u65B0\u5EFA\u4F1A\u8BDD" }), _jsxs("div", { className: "session-search", "data-command-palette": true, children: [_jsx("input", { "aria-controls": commandOpen ? "command-menu" : undefined, "aria-expanded": commandOpen, "aria-label": commandOpen ? "搜索命令" : "搜索会话", onChange: (event) => {
2374
- const next = event.target.value;
2375
- if (!commandOpen && next.startsWith("/")) {
2376
- setCommandOpen(true);
2377
- setCommandQuery(next.slice(1));
2378
- return;
2379
- }
2380
- if (commandOpen)
2381
- setCommandQuery(next.replace(/^\/\s?/, ""));
2382
- else
2383
- setSearch(next);
2384
- }, onKeyDown: (event) => {
2385
- if (!commandOpen)
2386
- return;
2387
- if (event.key === "ArrowDown" && visibleCommands.length) {
2388
- event.preventDefault();
2389
- setCommandIndex((index) => (index + 1) % visibleCommands.length);
2390
- }
2391
- else if (event.key === "ArrowUp" && visibleCommands.length) {
2392
- event.preventDefault();
2393
- setCommandIndex((index) => (index - 1 + visibleCommands.length) % visibleCommands.length);
2394
- }
2395
- else if (event.key === "Enter" && visibleCommands.length) {
2396
- event.preventDefault();
2397
- useCommand(`/${visibleCommands[commandIndex]?.invocationName ?? ""}`);
2398
- }
2399
- }, placeholder: commandOpen ? "输入命令名称或描述" : "搜索会话 · ⌘K 命令", ref: searchInputRef, type: "search", value: commandOpen ? `/${commandQuery}` : search }), commandOpen && (_jsx(CommandPalette, { activeIndex: commandIndex, commands: data.commands, onActiveIndexChange: setCommandIndex, onUse: useCommand, query: commandQuery }))] }), _jsx("input", { accept: ".jsonl,application/json,application/x-ndjson", "aria-label": "\u5BFC\u5165\u4F1A\u8BDD\u6587\u4EF6", hidden: true, onChange: (event) => {
2400
- const file = event.currentTarget.files?.[0];
2401
- event.currentTarget.value = "";
2402
- if (!file)
2403
- return;
2404
- void sessionAction(async () => {
2405
- const imported = await api.importSession(await file.text(), file.name);
2406
- if (imported.sessionFile)
2407
- setSelectedSessionPath(imported.sessionFile);
2408
- });
2409
- }, ref: importInputRef, type: "file" })] }), _jsxs("div", { className: "session-list-toolbar", children: [_jsxs("div", { className: "session-list-title", children: [_jsx("strong", { children: "\u4F1A\u8BDD" }), _jsx("span", { children: sessionTotal || data.sessions.length })] }), _jsxs("div", { className: "session-list-tools", children: [_jsx("button", { "aria-pressed": sessionSelectionMode, className: `session-tool-button ${sessionSelectionMode ? "active" : ""}`, onClick: () => {
2410
- setSessionSelectionMode(!sessionSelectionMode);
2411
- setSelectedSessionPaths(new Set());
2412
- setSessionToolsOpen(false);
2413
- closeSessionMenu();
2414
- }, type: "button", children: sessionSelectionMode ? "完成" : "选择" }), _jsxs("div", { className: "session-tools-wrap", "data-session-popover": true, children: [_jsx("button", { "aria-expanded": sessionToolsOpen, "aria-haspopup": "menu", "aria-label": "\u4F1A\u8BDD\u5DE5\u5177", className: "session-tool-button icon", onClick: (event) => {
2415
- closeSessionMenu();
2416
- sessionPopoverTriggerRef.current = event.currentTarget;
2417
- setSessionActionTarget(undefined);
2418
- if (sessionToolsOpen) {
2419
- setSessionToolsOpen(false);
2420
- setSessionToolsPosition(undefined);
2421
- }
2422
- else {
2423
- setSessionToolsPosition(sidebarPopoverPosition(event.currentTarget, 150, 190, "below"));
2424
- setSessionToolsOpen(true);
2425
- }
2426
- }, type: "button", children: "\u22EF" }), sessionToolsOpen &&
2427
- sessionToolsPosition &&
2428
- createPortal(_jsxs("div", { className: "session-tools-popover", "data-session-popover": true, role: "menu", style: sessionToolsPosition, children: [_jsx("button", { autoFocus: true, onClick: () => window.location.reload(), role: "menuitem", type: "button", children: "\u5237\u65B0\u5217\u8868" }), _jsx("button", { onClick: () => {
2429
- setSessionToolsOpen(false);
2430
- setSessionToolsPosition(undefined);
2431
- importInputRef.current?.click();
2432
- }, role: "menuitem", type: "button", children: "\u5BFC\u5165\u4F1A\u8BDD" }), _jsx("button", { disabled: !activeSessionPath || sessionActionBusy, onClick: () => {
2433
- if (!activeSessionPath)
2434
- return;
2435
- void sessionAction(async () => {
2436
- const blob = await api.exportSession(activeSessionPath);
2437
- const link = document.createElement("a");
2438
- link.href = URL.createObjectURL(blob);
2439
- link.download = `${data.session?.sessionId ?? "session"}.jsonl`;
2440
- link.click();
2441
- URL.revokeObjectURL(link.href);
2442
- });
2443
- }, role: "menuitem", type: "button", children: "\u5BFC\u51FA\u5F53\u524D\u4F1A\u8BDD" }), _jsx("button", { onClick: () => {
2444
- setIncludeArchivedSessions((current) => !current);
2445
- setSessionToolsOpen(false);
2446
- setSessionToolsPosition(undefined);
2447
- void refresh();
2448
- }, role: "menuitem", type: "button", children: includeArchivedSessions ? "隐藏归档会话" : "显示归档会话" })] }), document.body)] })] })] }), sessionSelectionMode && selectedSessionPaths.size > 0 && (_jsxs("div", { className: "session-batch-bar", children: [_jsxs("span", { children: [selectedSessionPaths.size, " \u4E2A\u5DF2\u9009\u62E9"] }), _jsx("button", { onClick: () => void sessionAction(() => api.batchSessions("archive", [...selectedSessionPaths]).then(() => undefined)), type: "button", children: "\u5F52\u6863" }), _jsx("button", { onClick: () => void sessionAction(() => api.batchSessions("pin", [...selectedSessionPaths]).then(() => undefined)), type: "button", children: "\u7F6E\u9876" }), _jsx("button", { className: "danger", onClick: () => {
2449
- setSessionActionTarget(undefined);
2450
- setSessionDialog("batch-delete");
2451
- }, type: "button", children: "\u5220\u9664" })] })), _jsxs("div", { className: "sidebar-scroll", children: [showCurrentSession && data.session && (_jsxs("div", { className: "session-group", children: [_jsx("div", { className: "group-label", children: "\u5F53\u524D" }), _jsxs("div", { className: "session-row-wrap current-session-row", children: [sessionSelectionMode && (_jsx("input", { "aria-label": "\u9009\u62E9\u5F53\u524D\u4F1A\u8BDD", checked: activeSessionPath ? selectedSessionPaths.has(activeSessionPath) : false, onChange: () => activeSessionPath && toggleSessionSelection(activeSessionPath), type: "checkbox" })), _jsxs("button", { className: "session-row active", onClick: () => {
2452
- setSettings(undefined);
2453
- setCommandOpen(false);
2454
- setGlobalSearchOpen(false);
2455
- setPage("session");
2456
- setView("chat");
2457
- setDetails(undefined);
2458
- setSessionMenuOpen(false);
2459
- void refresh();
2460
- }, type: "button", children: [_jsx("span", { className: "session-dot ok" }), _jsxs("span", { className: "session-copy", children: [_jsx("strong", { children: data.session.messages.length ? data.session.sessionId.slice(0, 12) : "新会话" }), _jsxs("small", { children: [data.session.messages.length, " \u6761\u6D88\u606F"] })] })] }), !sessionSelectionMode && activeSessionPath && (_jsx("button", { "aria-expanded": sessionMenuOpen && sessionMenuPath === activeSessionPath, "aria-haspopup": "menu", "aria-label": "\u5F53\u524D\u4F1A\u8BDD\u64CD\u4F5C", className: "session-row-more", "data-session-popover": true, onClick: (event) => openSessionMenu(activeSessionPath, data.session?.messages.length ? data.session?.sessionId.slice(0, 12) : "新会话", event.currentTarget), type: "button", children: "\u22EF" })), !sessionSelectionMode && activeSessionPath && sessionMenuPath === activeSessionPath && sessionMenuOpen && sessionMenuPosition && (_jsx(SessionActionMenu, { busy: sessionActionBusy, position: sessionMenuPosition, onArchive: () => {
2461
- closeSessionMenu();
2462
- setSessionDialog("archive");
2463
- }, onDelete: () => {
2464
- closeSessionMenu();
2465
- setSessionDialog("delete");
2466
- }, onFork: () => void sessionAction(async () => {
2467
- const result = await api.forkSession(activeSessionPath);
2468
- if (result.sessionFile) {
2469
- setSelectedSessionPath(result.sessionFile);
2470
- await api.openSession(result.sessionFile);
2471
- }
2472
- }), onRename: () => {
2473
- closeSessionMenu();
2474
- setSessionDialog("rename");
2475
- } }))] })] })), groups.length ? (groups.map(([label, sessions]) => (_jsxs("div", { className: "session-group", children: [_jsx("div", { className: "group-label", children: label }), sessions.map((session, index) => (_jsxs("div", { className: "session-row-wrap", children: [sessionSelectionMode && (_jsx("input", { "aria-label": `选择会话 ${value(session.name ?? session.firstMessage, "未命名会话")}`, checked: typeof session.path === "string" && selectedSessionPaths.has(session.path), onChange: () => {
2476
- if (typeof session.path === "string")
2477
- toggleSessionSelection(session.path);
2478
- }, type: "checkbox" })), _jsxs("button", { className: `session-row ${session.sessionId === data.session?.sessionId ? "active" : ""}`, onClick: () => openSession(session), type: "button", children: [_jsx("span", { className: "session-dot ok" }), _jsxs("span", { className: "session-copy", children: [_jsx("strong", { children: value(session.name ?? session.firstMessage, "未命名会话") }), _jsxs("small", { children: [value(session.messageCount, "0"), " \u6761\u6D88\u606F", session.pinned === true ? " · 已置顶" : "", session.archived === true ? " · 已归档" : ""] })] })] }), !sessionSelectionMode && typeof session.path === "string" && (_jsx("button", { "aria-expanded": sessionMenuOpen && sessionMenuPath === session.path, "aria-haspopup": "menu", "aria-label": `会话操作 ${value(session.name ?? session.firstMessage, "未命名会话")}`, className: "session-row-more", "data-session-popover": true, onClick: (event) => {
2479
- event.stopPropagation();
2480
- openSessionMenu(session.path, value(session.name ?? session.firstMessage, ""), event.currentTarget);
2481
- }, type: "button", children: "\u22EF" })), !sessionSelectionMode &&
2482
- typeof session.path === "string" &&
2483
- sessionMenuPath === session.path &&
2484
- sessionMenuOpen &&
2485
- sessionMenuPosition && (_jsx(SessionActionMenu, { busy: sessionActionBusy, position: sessionMenuPosition, onArchive: () => {
2486
- closeSessionMenu();
2487
- setSessionDialog("archive");
2488
- }, onDelete: () => {
2489
- closeSessionMenu();
2490
- setSessionDialog("delete");
2491
- }, onFork: () => void sessionAction(async () => {
2492
- const result = await api.forkSession(session.path);
2493
- if (result.sessionFile) {
2494
- setSelectedSessionPath(result.sessionFile);
2495
- await api.openSession(result.sessionFile);
2496
- }
2497
- }), onRename: () => {
2498
- closeSessionMenu();
2499
- setSessionDialog("rename");
2500
- } }))] }, index)))] }, label)))) : !showCurrentSession ? (_jsx("div", { className: "empty-state", children: "\u6682\u65E0\u5DF2\u4FDD\u5B58\u4F1A\u8BDD" })) : null, sessionTotal > 30 && (_jsxs("div", { className: "session-pagination", children: [_jsx("button", { disabled: sessionPage === 0, onClick: () => setSessionPage((page) => Math.max(0, page - 1)), type: "button", children: "\u4E0A\u4E00\u9875" }), _jsxs("span", { children: [sessionPage + 1, " / ", Math.max(1, Math.ceil(sessionTotal / 30))] }), _jsx("button", { disabled: !sessionHasNext, onClick: () => setSessionPage((page) => page + 1), type: "button", children: "\u4E0B\u4E00\u9875" })] })), betterSidebarData && (_jsxs("section", { "aria-label": "\u5DE5\u4F5C\u533A\u6982\u89C8", className: "mx-3 mt-3 rounded-lg border border-[#dce5f5] bg-[#f6f8ff] px-3 py-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("strong", { className: "text-[11px] font-semibold text-[#253044]", children: "\u5DE5\u4F5C\u533A\u6982\u89C8" }), _jsx("span", { className: `rounded px-1.5 py-0.5 font-mono text-[9px] ${betterSidebarData.clean === true ? "bg-[#eaf8f0] text-[#14733f]" : "bg-[#fff0f0] text-[#b42318]"}`, children: betterSidebarData.clean === true ? "clean" : `${value(betterSidebarData.changedCount ?? 0)} 变更` })] }), _jsx("code", { className: "mt-2 block truncate text-[10px] text-[#315fb8]", children: value(betterSidebarData.cwd ?? "当前工作区") }), _jsx("p", { className: "mt-1 truncate font-mono text-[10px] text-[#65707b]", children: value(betterSidebarData.branch ?? "非 Git 工作区") }), Array.isArray(betterSidebarData.changedFiles) && betterSidebarData.changedFiles.length > 0 ? (_jsx("div", { className: "mt-2 grid gap-1 border-t border-[#dce5f5] pt-2", children: betterSidebarData.changedFiles.slice(0, 3).map((item, index) => {
2501
- const file = item !== null && typeof item === "object" ? item : {};
2502
- return (_jsxs("code", { className: "truncate text-[9px] text-[#65707b]", children: [value(file.status ?? "??"), " ", value(file.path ?? "未命名")] }, `${value(file.path ?? "file")}-${index}`));
2503
- }) })) : null] }))] }), _jsxs("footer", { className: "sidebar-footer", children: [_jsxs("div", { className: "runtime-cells", children: [_jsxs("span", { children: ["model ", _jsx("b", { children: value(data.status?.model) })] }), _jsxs("span", { children: ["msgs ", _jsx("b", { children: data.status?.messages ?? 0 })] }), _jsxs("span", { children: ["status ", _jsx("b", { children: value(data.status?.status, "connecting") })] })] }), _jsx("button", { "aria-label": "\u641C\u7D22\u4F1A\u8BDD\u3001\u6587\u4EF6\u548C\u547D\u4EE4", className: "sidebar-link compact-session-search", onClick: () => {
2504
- setCommandOpen(false);
2505
- setSessionToolsOpen(false);
2506
- closeSessionMenu();
2507
- setGlobalSearchOpen(true);
2508
- }, title: "\u641C\u7D22\u4F1A\u8BDD\u3001\u6587\u4EF6\u548C\u547D\u4EE4", type: "button", children: "\u2315" }), _jsx("button", { "aria-label": "\u65B0\u5EFA\u4F1A\u8BDD", className: "sidebar-link compact-new-session", onClick: beginNewSession, title: "\u65B0\u5EFA\u4F1A\u8BDD", type: "button", children: "\uFF0B" }), _jsxs("button", { "aria-label": `插件,已安装 ${installedPluginCount} 个`, className: `sidebar-link ${page === "plugins" || page === "marketplace" ? "active" : ""}`, onClick: () => pushInstalledPluginRoute(undefined), title: `插件 · ${installedPluginCount} 个`, type: "button", children: ["\u25C8 ", _jsx("span", { children: "\u63D2\u4EF6" }), _jsx("b", { children: installedPluginCount })] }), _jsxs("button", { "aria-label": "\u8BBE\u7F6E", className: `sidebar-link ${settings ? "active" : ""}`, onClick: () => {
2509
- setCommandOpen(false);
2510
- setGlobalSearchOpen(false);
2511
- setSessionMenuOpen(false);
2512
- setSessionMenuPath(undefined);
2513
- setDetails(undefined);
2514
- setSettings("general");
2515
- }, title: "\u8BBE\u7F6E", type: "button", children: ["\u2699 ", _jsx("span", { children: "\u8BBE\u7F6E" })] })] })] }), _jsxs("section", { className: "main-pane", children: [_jsxs("header", { className: `main-header ${!settings && page === "session" ? "session-track" : ""}`, children: [_jsxs("div", { className: "active-heading", children: [_jsx("strong", { children: settings
2516
- ? "设置"
2517
- : page === "plugins"
2518
- ? installedPluginId
2519
- ? "插件详情"
2520
- : "运行时插件"
2521
- : page === "marketplace"
2522
- ? marketplacePluginId
2523
- ? "插件详情"
2524
- : "插件市场"
2525
- : data.session?.messages.length
2526
- ? data.session.sessionId.slice(0, 12)
2527
- : "新会话" }), _jsx("small", { children: settings
2528
- ? "运行时状态与配置"
2529
- : page === "plugins"
2530
- ? installedPluginId
2531
- ? (installedPluginMetadata?.name ?? displayPluginName(installedPluginId))
2532
- : "已安装插件"
2533
- : page === "marketplace"
2534
- ? marketplacePluginId
2535
- ? (marketplaceDetail?.name ?? marketplacePluginId)
2536
- : "官方与社区 · 已审核目录"
2537
- : sessionSource(data.status, data.session) })] }), _jsx("div", { className: "header-spacer" }), data.status?.status === "running" && (_jsxs("div", { className: "run-indicator running", children: [_jsx("span", { className: "run-dot" }), _jsx("span", { children: "\u8FD0\u884C\u4E2D \u00B7 Pi agent" }), _jsx("button", { className: "stop-button", onClick: () => {
2538
- setPromptError("");
2539
- void api
2540
- .abort()
2541
- .then(refresh)
2542
- .catch((cause) => setPromptError(cause instanceof Error ? cause.message : String(cause)));
2543
- }, type: "button", children: "\u505C\u6B62" })] })), !settings && page === "session" && (_jsx("div", { "aria-label": "\u4F1A\u8BDD\u89C6\u56FE", className: "view-tabs", children: ["chat", "trajectory", "files"].map((item) => (_jsx("button", { "aria-pressed": view === item, className: `view-tab ${view === item ? "active" : ""}`, onClick: () => {
2544
- setView(item);
2545
- setDetails(undefined);
2546
- }, type: "button", children: item === "chat" ? "对话" : item === "trajectory" ? "轨迹" : "产出" }, item))) })), !settings && page === "session" && _jsx("span", { "aria-hidden": "true", className: "header-divider" }), !settings && page === "session" && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "session-menu-wrap", "data-session-popover": true, children: [_jsx("button", { "aria-expanded": sessionMenuOpen && !sessionMenuPath, "aria-haspopup": "menu", className: "session-menu", onClick: (event) => {
2547
- const closeCurrentMenu = sessionMenuOpen && !sessionMenuPath;
2548
- setSessionMenuPath(undefined);
2549
- setSessionMenuPosition(undefined);
2550
- sessionPopoverTriggerRef.current = event.currentTarget;
2551
- setSessionActionTarget(!closeCurrentMenu && activeSessionPath
2552
- ? { name: data.session?.sessionId?.slice(0, 12) || "当前会话", path: activeSessionPath }
2553
- : undefined);
2554
- setSessionMenuOpen(!closeCurrentMenu);
2555
- }, type: "button", "aria-label": "\u4F1A\u8BDD\u64CD\u4F5C", children: "\u22EF" }), sessionMenuOpen && !sessionMenuPath && (_jsxs("div", { className: "session-menu-popover compact-session-menu", role: "menu", children: [_jsxs("button", { className: "session-action", disabled: !activeSessionPath || sessionActionBusy, onClick: () => {
2556
- setSessionNameDraft(data.session?.sessionId?.slice(0, 12) ?? "");
2557
- setSessionDialog("rename");
2558
- setSessionMenuOpen(false);
2559
- }, role: "menuitem", type: "button", children: [_jsx("strong", { children: "\u91CD\u547D\u540D" }), _jsx("small", { children: "\u8BBE\u7F6E\u4E00\u4E2A\u5BB9\u6613\u8BC6\u522B\u7684\u540D\u79F0" })] }), _jsxs("button", { className: "session-action", disabled: !activeSessionPath || sessionActionBusy, onClick: () => void sessionAction(async () => {
2560
- const result = await api.forkSession(activeSessionPath);
2561
- if (result.sessionFile) {
2562
- setSelectedSessionPath(result.sessionFile);
2563
- await api.openSession(result.sessionFile);
2564
- }
2565
- }), role: "menuitem", type: "button", children: [_jsx("strong", { children: "\u590D\u5236\u4F1A\u8BDD" }), _jsx("small", { children: "\u590D\u5236\u4E0A\u4E0B\u6587\u5E76\u6253\u5F00\u526F\u672C" })] }), _jsxs("button", { className: "session-action", disabled: !activeSessionPath || sessionActionBusy, onClick: () => {
2566
- setSessionMenuOpen(false);
2567
- setSessionDialog("archive");
2568
- }, role: "menuitem", type: "button", children: [_jsx("strong", { children: "\u5F52\u6863\u4F1A\u8BDD" }), _jsx("small", { children: "\u4ECE\u9ED8\u8BA4\u5217\u8868\u9690\u85CF" })] }), _jsxs("button", { className: "session-action danger", disabled: !activeSessionPath || sessionActionBusy, onClick: () => {
2569
- setSessionMenuOpen(false);
2570
- setSessionDialog("delete");
2571
- }, role: "menuitem", type: "button", children: [_jsx("strong", { children: "\u5220\u9664\u4F1A\u8BDD" }), _jsx("small", { children: "\u6C38\u4E45\u5220\u9664\u672C\u5730\u8BB0\u5F55" })] })] }))] }), _jsxs("button", { "aria-label": details !== undefined ? "关闭详情" : "打开详情", "aria-pressed": details !== undefined, className: "details-toggle", onClick: () => setDetails(details ? undefined : {}), type: "button", children: [_jsx("span", { "aria-hidden": "true", children: "\u25E8" }), " ", _jsx("span", { className: "details-toggle-label", children: "\u8BE6\u60C5" })] })] }))] }), refreshIssues.length > 0 && (_jsxs("div", { "aria-live": "polite", className: "refresh-warning", role: "status", children: [_jsxs("span", { children: [_jsx("strong", { children: "\u90E8\u5206\u6570\u636E\u5237\u65B0\u5931\u8D25" }), refreshIssues.join("、"), "\u53EF\u80FD\u4E3A\u7A7A\u6216\u663E\u793A\u4E0A\u6B21\u7ED3\u679C\u3002"] }), _jsx("button", { onClick: () => void refresh(), type: "button", children: "\u91CD\u8BD5" })] })), _jsx("div", { className: "view-host", children: initialRefreshPending ? (_jsxs("div", { "aria-live": "polite", className: "initial-loading", role: "status", children: [_jsx("span", { "aria-hidden": "true" }), "\u6B63\u5728\u8FDE\u63A5 Pi runtime\u2026"] })) : (content) })] }), !settings && page === "session" && details !== undefined && (_jsxs(_Fragment, { children: [_jsx("button", { "aria-label": "\u5173\u95ED\u8BE6\u60C5", className: "details-backdrop", onClick: () => setDetails(undefined), type: "button" }), _jsx(Details, { event: Object.keys(details).length ? details : undefined, onClose: () => setDetails(undefined), onCopy: () => void navigator.clipboard?.writeText(JSON.stringify(details, null, 2)) })] })), globalSearchOpen && (_jsx(GlobalSearch, { commands: data.commands, files: data.files, onClose: () => setGlobalSearchOpen(false), onOpenFile: (file) => {
2572
- setPage("session");
2573
- setView("files");
2574
- setDetails({ type: "file", path: file.path, status: file.status });
2575
- }, onOpenSession: openSession, onUse: setDraft, sessions: data.sessions })), workspaceChooserOpen && (_jsx(WorkspaceChooser, { error: workspaceError, onClose: () => setWorkspaceChooserOpen(false), onPickDirectory: openDirectory, onSelect: (workspace) => void createNewSession(workspace), workspaces: data.workspaces })), sessionDialog && (_jsx(SessionDialog, { busy: sessionActionBusy, count: sessionDialog === "batch-delete" ? selectedSessionPaths.size : undefined, kind: sessionDialog, name: sessionDialog === "rename" || sessionDialog === "batch-delete"
2576
- ? undefined
2577
- : (sessionActionTarget?.name ?? value(data.session?.sessionId, "当前会话")), onChange: setSessionNameDraft, onClose: () => {
2578
- setSessionDialog(undefined);
2579
- setSessionActionTarget(undefined);
2580
- }, onConfirm: () => {
2581
- const targetPath = sessionActionTarget?.path ?? activeSessionPath;
2582
- if (sessionDialog === "rename" && targetPath) {
2583
- void sessionAction(() => api.renameSession(targetPath, sessionNameDraft.trim()).then(() => undefined));
2584
- }
2585
- else if (sessionDialog === "archive" && targetPath) {
2586
- void sessionAction(async () => {
2587
- await api.setSessionMetadata(targetPath, { archived: true });
2588
- });
2589
- }
2590
- else if (sessionDialog === "delete" && targetPath) {
2591
- void sessionAction(async () => {
2592
- await api.deleteSession(targetPath);
2593
- });
2594
- }
2595
- else if (sessionDialog === "batch-delete") {
2596
- void sessionAction(() => api.batchSessions("delete", [...selectedSessionPaths]).then(() => undefined));
2597
- }
2598
- }, value: sessionNameDraft }))] }));
2599
- }
2600
- //# sourceMappingURL=react-room.js.map