@pi-harness/pi-harness 0.1.13 → 0.1.14

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 (1333) hide show
  1. package/README.md +678 -2
  2. package/apps/web/dist/assets/index-BVI_IS-R.css +2 -0
  3. package/apps/web/dist/assets/index-C98SJjJd.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/core/dist/atomic-write.d.ts +8 -0
  93. package/node_modules/@pi-harness/core/dist/atomic-write.d.ts.map +1 -0
  94. package/node_modules/@pi-harness/core/dist/atomic-write.js +40 -0
  95. package/node_modules/@pi-harness/core/dist/atomic-write.js.map +1 -0
  96. package/node_modules/@pi-harness/core/dist/boot.d.ts.map +1 -1
  97. package/node_modules/@pi-harness/core/dist/boot.js +132 -10
  98. package/node_modules/@pi-harness/core/dist/boot.js.map +1 -1
  99. package/node_modules/@pi-harness/core/dist/bounded-file.d.ts +7 -0
  100. package/node_modules/@pi-harness/core/dist/bounded-file.d.ts.map +1 -0
  101. package/node_modules/@pi-harness/core/dist/bounded-file.js +50 -0
  102. package/node_modules/@pi-harness/core/dist/bounded-file.js.map +1 -0
  103. package/node_modules/@pi-harness/core/dist/config.d.ts +2 -0
  104. package/node_modules/@pi-harness/core/dist/config.d.ts.map +1 -1
  105. package/node_modules/@pi-harness/core/dist/config.js +21 -0
  106. package/node_modules/@pi-harness/core/dist/config.js.map +1 -1
  107. package/node_modules/@pi-harness/core/dist/cordis-timer.d.ts +15 -0
  108. package/node_modules/@pi-harness/core/dist/cordis-timer.d.ts.map +1 -0
  109. package/node_modules/@pi-harness/core/dist/cordis-timer.js +99 -0
  110. package/node_modules/@pi-harness/core/dist/cordis-timer.js.map +1 -0
  111. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts +5 -1
  112. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.d.ts.map +1 -1
  113. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js +986 -105
  114. package/node_modules/@pi-harness/core/dist/plugins/agent-teams.js.map +1 -1
  115. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts +1 -0
  116. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.d.ts.map +1 -1
  117. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js +39 -11
  118. package/node_modules/@pi-harness/core/dist/plugins/anchored-standard.js.map +1 -1
  119. package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts +1 -0
  120. package/node_modules/@pi-harness/core/dist/plugins/annotation.d.ts.map +1 -1
  121. package/node_modules/@pi-harness/core/dist/plugins/annotation.js +35 -17
  122. package/node_modules/@pi-harness/core/dist/plugins/annotation.js.map +1 -1
  123. package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts +1 -0
  124. package/node_modules/@pi-harness/core/dist/plugins/archify.d.ts.map +1 -1
  125. package/node_modules/@pi-harness/core/dist/plugins/archify.js +69 -22
  126. package/node_modules/@pi-harness/core/dist/plugins/archify.js.map +1 -1
  127. package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts +5 -1
  128. package/node_modules/@pi-harness/core/dist/plugins/at-file.d.ts.map +1 -1
  129. package/node_modules/@pi-harness/core/dist/plugins/at-file.js +120 -29
  130. package/node_modules/@pi-harness/core/dist/plugins/at-file.js.map +1 -1
  131. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.d.ts.map +1 -1
  132. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js +89 -20
  133. package/node_modules/@pi-harness/core/dist/plugins/auto-mode.js.map +1 -1
  134. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts +1 -0
  135. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.d.ts.map +1 -1
  136. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js +14 -4
  137. package/node_modules/@pi-harness/core/dist/plugins/better-sidebar.js.map +1 -1
  138. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts +1 -0
  139. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.d.ts.map +1 -1
  140. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js +288 -96
  141. package/node_modules/@pi-harness/core/dist/plugins/browser-fetch.js.map +1 -1
  142. package/node_modules/@pi-harness/core/dist/plugins/browser-session.d.ts.map +1 -1
  143. package/node_modules/@pi-harness/core/dist/plugins/browser-session.js +445 -106
  144. package/node_modules/@pi-harness/core/dist/plugins/browser-session.js.map +1 -1
  145. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts +1 -0
  146. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.d.ts.map +1 -1
  147. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js +71 -19
  148. package/node_modules/@pi-harness/core/dist/plugins/canvas-draw.js.map +1 -1
  149. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts +1 -0
  150. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.d.ts.map +1 -1
  151. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js +30 -9
  152. package/node_modules/@pi-harness/core/dist/plugins/change-verifier.js.map +1 -1
  153. package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts +5 -1
  154. package/node_modules/@pi-harness/core/dist/plugins/cleaner.d.ts.map +1 -1
  155. package/node_modules/@pi-harness/core/dist/plugins/cleaner.js +337 -40
  156. package/node_modules/@pi-harness/core/dist/plugins/cleaner.js.map +1 -1
  157. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts +2 -1
  158. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.d.ts.map +1 -1
  159. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js +99 -42
  160. package/node_modules/@pi-harness/core/dist/plugins/cli-notifier.js.map +1 -1
  161. package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts +1 -0
  162. package/node_modules/@pi-harness/core/dist/plugins/code2skill.d.ts.map +1 -1
  163. package/node_modules/@pi-harness/core/dist/plugins/code2skill.js +178 -38
  164. package/node_modules/@pi-harness/core/dist/plugins/code2skill.js.map +1 -1
  165. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts +2 -1
  166. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.d.ts.map +1 -1
  167. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js +79 -49
  168. package/node_modules/@pi-harness/core/dist/plugins/colleague-skill.js.map +1 -1
  169. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts +6 -1
  170. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.d.ts.map +1 -1
  171. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js +403 -39
  172. package/node_modules/@pi-harness/core/dist/plugins/context-doctor.js.map +1 -1
  173. package/node_modules/@pi-harness/core/dist/plugins/context.d.ts +1 -0
  174. package/node_modules/@pi-harness/core/dist/plugins/context.d.ts.map +1 -1
  175. package/node_modules/@pi-harness/core/dist/plugins/context.js +169 -42
  176. package/node_modules/@pi-harness/core/dist/plugins/context.js.map +1 -1
  177. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts +4 -0
  178. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.d.ts.map +1 -1
  179. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js +319 -93
  180. package/node_modules/@pi-harness/core/dist/plugins/cost-meter.js.map +1 -1
  181. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts +11 -2
  182. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.d.ts.map +1 -1
  183. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js +463 -114
  184. package/node_modules/@pi-harness/core/dist/plugins/dependency-checker.js.map +1 -1
  185. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts +1 -0
  186. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.d.ts.map +1 -1
  187. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js +322 -80
  188. package/node_modules/@pi-harness/core/dist/plugins/docker-sandbox.js.map +1 -1
  189. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts +1 -0
  190. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.d.ts.map +1 -1
  191. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js +187 -20
  192. package/node_modules/@pi-harness/core/dist/plugins/fail-logger.js.map +1 -1
  193. package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts +1 -0
  194. package/node_modules/@pi-harness/core/dist/plugins/genui.d.ts.map +1 -1
  195. package/node_modules/@pi-harness/core/dist/plugins/genui.js +103 -38
  196. package/node_modules/@pi-harness/core/dist/plugins/genui.js.map +1 -1
  197. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts +8 -2
  198. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.d.ts.map +1 -1
  199. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js +400 -54
  200. package/node_modules/@pi-harness/core/dist/plugins/git-time-capsule.js.map +1 -1
  201. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.d.ts.map +1 -1
  202. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js +329 -42
  203. package/node_modules/@pi-harness/core/dist/plugins/graph-memory.js.map +1 -1
  204. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.d.ts.map +1 -1
  205. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js +31 -12
  206. package/node_modules/@pi-harness/core/dist/plugins/history-compressor.js.map +1 -1
  207. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.d.ts.map +1 -1
  208. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js +33 -13
  209. package/node_modules/@pi-harness/core/dist/plugins/hol-guard.js.map +1 -1
  210. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts +5 -1
  211. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.d.ts.map +1 -1
  212. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js +308 -52
  213. package/node_modules/@pi-harness/core/dist/plugins/i18n-pair.js.map +1 -1
  214. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts +7 -0
  215. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.d.ts.map +1 -1
  216. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js +98 -25
  217. package/node_modules/@pi-harness/core/dist/plugins/image-compressor.js.map +1 -1
  218. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.d.ts.map +1 -1
  219. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js +21 -11
  220. package/node_modules/@pi-harness/core/dist/plugins/llm-verifier.js.map +1 -1
  221. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.d.ts.map +1 -1
  222. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js +986 -232
  223. package/node_modules/@pi-harness/core/dist/plugins/mcp-client.js.map +1 -1
  224. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.d.ts.map +1 -1
  225. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js +30 -16
  226. package/node_modules/@pi-harness/core/dist/plugins/mcp-panel.js.map +1 -1
  227. package/node_modules/@pi-harness/core/dist/plugins/memory.d.ts.map +1 -1
  228. package/node_modules/@pi-harness/core/dist/plugins/memory.js +292 -59
  229. package/node_modules/@pi-harness/core/dist/plugins/memory.js.map +1 -1
  230. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.d.ts.map +1 -1
  231. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js +20 -10
  232. package/node_modules/@pi-harness/core/dist/plugins/mirage-bridge.js.map +1 -1
  233. package/node_modules/@pi-harness/core/dist/plugins/mock-server.d.ts.map +1 -1
  234. package/node_modules/@pi-harness/core/dist/plugins/mock-server.js +85 -54
  235. package/node_modules/@pi-harness/core/dist/plugins/mock-server.js.map +1 -1
  236. package/node_modules/@pi-harness/core/dist/plugins/model.d.ts +3 -0
  237. package/node_modules/@pi-harness/core/dist/plugins/model.d.ts.map +1 -1
  238. package/node_modules/@pi-harness/core/dist/plugins/model.js +3 -0
  239. package/node_modules/@pi-harness/core/dist/plugins/model.js.map +1 -1
  240. package/node_modules/@pi-harness/core/dist/plugins/models.d.ts.map +1 -1
  241. package/node_modules/@pi-harness/core/dist/plugins/models.js +10 -2
  242. package/node_modules/@pi-harness/core/dist/plugins/models.js.map +1 -1
  243. package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts +8 -1
  244. package/node_modules/@pi-harness/core/dist/plugins/modlens.d.ts.map +1 -1
  245. package/node_modules/@pi-harness/core/dist/plugins/modlens.js +438 -31
  246. package/node_modules/@pi-harness/core/dist/plugins/modlens.js.map +1 -1
  247. package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts +1 -0
  248. package/node_modules/@pi-harness/core/dist/plugins/module-search.d.ts.map +1 -1
  249. package/node_modules/@pi-harness/core/dist/plugins/module-search.js +35 -16
  250. package/node_modules/@pi-harness/core/dist/plugins/module-search.js.map +1 -1
  251. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.d.ts.map +1 -1
  252. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js +20 -11
  253. package/node_modules/@pi-harness/core/dist/plugins/obsidian-sync.js.map +1 -1
  254. package/node_modules/@pi-harness/core/dist/plugins/openpets.d.ts.map +1 -1
  255. package/node_modules/@pi-harness/core/dist/plugins/openpets.js +203 -44
  256. package/node_modules/@pi-harness/core/dist/plugins/openpets.js.map +1 -1
  257. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts +4 -1
  258. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.d.ts.map +1 -1
  259. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js +42 -21
  260. package/node_modules/@pi-harness/core/dist/plugins/plan-execute.js.map +1 -1
  261. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts +12 -3
  262. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.d.ts.map +1 -1
  263. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js +83 -12
  264. package/node_modules/@pi-harness/core/dist/plugins/plugin-check.js.map +1 -1
  265. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts +1 -0
  266. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.d.ts.map +1 -1
  267. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js +156 -23
  268. package/node_modules/@pi-harness/core/dist/plugins/plugin-dev.js.map +1 -1
  269. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts +1 -0
  270. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.d.ts.map +1 -1
  271. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js +131 -13
  272. package/node_modules/@pi-harness/core/dist/plugins/plugin-finder.js.map +1 -1
  273. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts +4 -0
  274. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.d.ts.map +1 -1
  275. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js +137 -36
  276. package/node_modules/@pi-harness/core/dist/plugins/plugin-radar.js.map +1 -1
  277. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.d.ts.map +1 -1
  278. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js +282 -81
  279. package/node_modules/@pi-harness/core/dist/plugins/plugin-stars.js.map +1 -1
  280. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts +1 -0
  281. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.d.ts.map +1 -1
  282. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js +60 -9
  283. package/node_modules/@pi-harness/core/dist/plugins/prompt-guard.js.map +1 -1
  284. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts +1 -0
  285. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.d.ts.map +1 -1
  286. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js +4 -1
  287. package/node_modules/@pi-harness/core/dist/plugins/prompt-library.js.map +1 -1
  288. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts +6 -2
  289. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.d.ts.map +1 -1
  290. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js +514 -73
  291. package/node_modules/@pi-harness/core/dist/plugins/readme-gen.js.map +1 -1
  292. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts +1 -1
  293. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.d.ts.map +1 -1
  294. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js +411 -68
  295. package/node_modules/@pi-harness/core/dist/plugins/recall-unread.js.map +1 -1
  296. package/node_modules/@pi-harness/core/dist/plugins/resources.d.ts.map +1 -1
  297. package/node_modules/@pi-harness/core/dist/plugins/resources.js +66 -3
  298. package/node_modules/@pi-harness/core/dist/plugins/resources.js.map +1 -1
  299. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.d.ts.map +1 -1
  300. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js +2 -1
  301. package/node_modules/@pi-harness/core/dist/plugins/reverse-skill.js.map +1 -1
  302. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts +1 -0
  303. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.d.ts.map +1 -1
  304. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js +35 -16
  305. package/node_modules/@pi-harness/core/dist/plugins/reviewer-bot.js.map +1 -1
  306. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts +1 -0
  307. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.d.ts.map +1 -1
  308. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js +4 -1
  309. package/node_modules/@pi-harness/core/dist/plugins/runtime-doctor.js.map +1 -1
  310. package/node_modules/@pi-harness/core/dist/plugins/runtime.d.ts.map +1 -1
  311. package/node_modules/@pi-harness/core/dist/plugins/runtime.js +104 -70
  312. package/node_modules/@pi-harness/core/dist/plugins/runtime.js.map +1 -1
  313. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts +1 -0
  314. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.d.ts.map +1 -1
  315. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js +30 -12
  316. package/node_modules/@pi-harness/core/dist/plugins/secure-audit.js.map +1 -1
  317. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts +1 -0
  318. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.d.ts.map +1 -1
  319. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js +4 -1
  320. package/node_modules/@pi-harness/core/dist/plugins/session-bookmarks.js.map +1 -1
  321. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts +1 -0
  322. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.d.ts.map +1 -1
  323. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js +401 -88
  324. package/node_modules/@pi-harness/core/dist/plugins/session-bridge.js.map +1 -1
  325. package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts +1 -0
  326. package/node_modules/@pi-harness/core/dist/plugins/session-compare.d.ts.map +1 -1
  327. package/node_modules/@pi-harness/core/dist/plugins/session-compare.js +4 -1
  328. package/node_modules/@pi-harness/core/dist/plugins/session-compare.js.map +1 -1
  329. package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts +1 -0
  330. package/node_modules/@pi-harness/core/dist/plugins/session-export.d.ts.map +1 -1
  331. package/node_modules/@pi-harness/core/dist/plugins/session-export.js +6 -6
  332. package/node_modules/@pi-harness/core/dist/plugins/session-export.js.map +1 -1
  333. package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts +37 -1
  334. package/node_modules/@pi-harness/core/dist/plugins/session-insights.d.ts.map +1 -1
  335. package/node_modules/@pi-harness/core/dist/plugins/session-insights.js +406 -21
  336. package/node_modules/@pi-harness/core/dist/plugins/session-insights.js.map +1 -1
  337. package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts +1 -0
  338. package/node_modules/@pi-harness/core/dist/plugins/session-search.d.ts.map +1 -1
  339. package/node_modules/@pi-harness/core/dist/plugins/session-search.js +4 -1
  340. package/node_modules/@pi-harness/core/dist/plugins/session-search.js.map +1 -1
  341. package/node_modules/@pi-harness/core/dist/plugins/session.d.ts.map +1 -1
  342. package/node_modules/@pi-harness/core/dist/plugins/session.js +8 -1
  343. package/node_modules/@pi-harness/core/dist/plugins/session.js.map +1 -1
  344. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts +1 -0
  345. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.d.ts.map +1 -1
  346. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js +6 -5
  347. package/node_modules/@pi-harness/core/dist/plugins/skill-catalog.js.map +1 -1
  348. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts +2 -1
  349. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.d.ts.map +1 -1
  350. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js +241 -61
  351. package/node_modules/@pi-harness/core/dist/plugins/skill-guard.js.map +1 -1
  352. package/node_modules/@pi-harness/core/dist/plugins/sql-lens-worker.d.ts +2 -0
  353. package/node_modules/@pi-harness/core/dist/plugins/sql-lens-worker.d.ts.map +1 -0
  354. package/node_modules/@pi-harness/core/dist/plugins/sql-lens-worker.js +206 -0
  355. package/node_modules/@pi-harness/core/dist/plugins/sql-lens-worker.js.map +1 -0
  356. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts +7 -1
  357. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.d.ts.map +1 -1
  358. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js +301 -68
  359. package/node_modules/@pi-harness/core/dist/plugins/sql-lens.js.map +1 -1
  360. package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts +3 -0
  361. package/node_modules/@pi-harness/core/dist/plugins/stdio.d.ts.map +1 -1
  362. package/node_modules/@pi-harness/core/dist/plugins/stdio.js +62 -4
  363. package/node_modules/@pi-harness/core/dist/plugins/stdio.js.map +1 -1
  364. package/node_modules/@pi-harness/core/dist/plugins/synapse.d.ts.map +1 -1
  365. package/node_modules/@pi-harness/core/dist/plugins/synapse.js +17 -9
  366. package/node_modules/@pi-harness/core/dist/plugins/synapse.js.map +1 -1
  367. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts +1 -0
  368. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.d.ts.map +1 -1
  369. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js +167 -62
  370. package/node_modules/@pi-harness/core/dist/plugins/tab-manager.js.map +1 -1
  371. package/node_modules/@pi-harness/core/dist/plugins/taskboard.d.ts.map +1 -1
  372. package/node_modules/@pi-harness/core/dist/plugins/taskboard.js +50 -22
  373. package/node_modules/@pi-harness/core/dist/plugins/taskboard.js.map +1 -1
  374. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts +4 -1
  375. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.d.ts.map +1 -1
  376. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js +30 -11
  377. package/node_modules/@pi-harness/core/dist/plugins/telemetry-blocker.js.map +1 -1
  378. package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts +7 -1
  379. package/node_modules/@pi-harness/core/dist/plugins/test-harness.d.ts.map +1 -1
  380. package/node_modules/@pi-harness/core/dist/plugins/test-harness.js +255 -43
  381. package/node_modules/@pi-harness/core/dist/plugins/test-harness.js.map +1 -1
  382. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.d.ts.map +1 -1
  383. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js +4 -2
  384. package/node_modules/@pi-harness/core/dist/plugins/theme-studio.js.map +1 -1
  385. package/node_modules/@pi-harness/core/dist/plugins/token-guard.d.ts.map +1 -1
  386. package/node_modules/@pi-harness/core/dist/plugins/token-guard.js +164 -32
  387. package/node_modules/@pi-harness/core/dist/plugins/token-guard.js.map +1 -1
  388. package/node_modules/@pi-harness/core/dist/plugins/tools.d.ts.map +1 -1
  389. package/node_modules/@pi-harness/core/dist/plugins/tools.js +4 -1
  390. package/node_modules/@pi-harness/core/dist/plugins/tools.js.map +1 -1
  391. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts +17 -0
  392. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.d.ts.map +1 -1
  393. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js +340 -36
  394. package/node_modules/@pi-harness/core/dist/plugins/turn-rewind.js.map +1 -1
  395. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.d.ts.map +1 -1
  396. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js +157 -51
  397. package/node_modules/@pi-harness/core/dist/plugins/undo-savepoint.js.map +1 -1
  398. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts +22 -3
  399. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.d.ts.map +1 -1
  400. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js +389 -66
  401. package/node_modules/@pi-harness/core/dist/plugins/vision-toolkit.js.map +1 -1
  402. package/node_modules/@pi-harness/core/dist/plugins/web-research.d.ts.map +1 -1
  403. package/node_modules/@pi-harness/core/dist/plugins/web-research.js +13 -4
  404. package/node_modules/@pi-harness/core/dist/plugins/web-research.js.map +1 -1
  405. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts +8 -2
  406. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.d.ts.map +1 -1
  407. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js +28 -10
  408. package/node_modules/@pi-harness/core/dist/plugins/workspace-navigator.js.map +1 -1
  409. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts +7 -0
  410. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.d.ts.map +1 -1
  411. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js +67 -34
  412. package/node_modules/@pi-harness/core/dist/plugins/workspace-search.js.map +1 -1
  413. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts +1 -0
  414. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.d.ts.map +1 -1
  415. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js +156 -47
  416. package/node_modules/@pi-harness/core/dist/plugins/yaml-validator.js.map +1 -1
  417. package/node_modules/@pi-harness/core/dist/runtime.d.ts.map +1 -1
  418. package/node_modules/@pi-harness/core/dist/runtime.js +8 -3
  419. package/node_modules/@pi-harness/core/dist/runtime.js.map +1 -1
  420. package/node_modules/@pi-harness/core/dist/services.d.ts.map +1 -1
  421. package/node_modules/@pi-harness/core/dist/services.js +22 -2
  422. package/node_modules/@pi-harness/core/dist/services.js.map +1 -1
  423. package/node_modules/@pi-harness/core/dist/stdio.d.ts +1 -0
  424. package/node_modules/@pi-harness/core/dist/stdio.d.ts.map +1 -1
  425. package/node_modules/@pi-harness/core/dist/stdio.js +241 -25
  426. package/node_modules/@pi-harness/core/dist/stdio.js.map +1 -1
  427. package/node_modules/@pi-harness/core/dist/workspace-path.d.ts +1 -0
  428. package/node_modules/@pi-harness/core/dist/workspace-path.d.ts.map +1 -1
  429. package/node_modules/@pi-harness/core/dist/workspace-path.js +9 -0
  430. package/node_modules/@pi-harness/core/dist/workspace-path.js.map +1 -1
  431. package/node_modules/@pi-harness/core/package.json +1 -1
  432. package/node_modules/@pi-harness/core/profiles/default/cordis.yml +4 -2
  433. package/node_modules/@pi-harness/host-webserver/package.json +1 -1
  434. package/node_modules/@pi-harness/web-app/package.json +1 -1
  435. package/package.json +12 -7
  436. package/packages/api-gateway/dist/index.d.ts.map +1 -1
  437. package/packages/api-gateway/dist/index.js +97 -9
  438. package/packages/api-gateway/dist/index.js.map +1 -1
  439. package/packages/api-gateway/dist/marketplace-entries/official/agent-teams.json +6 -6
  440. package/packages/api-gateway/dist/marketplace-entries/official/anchored-standard.json +1 -1
  441. package/packages/api-gateway/dist/marketplace-entries/official/annotation.json +1 -2
  442. package/packages/api-gateway/dist/marketplace-entries/official/archify.json +1 -1
  443. package/packages/api-gateway/dist/marketplace-entries/official/at-file.json +11 -5
  444. package/packages/api-gateway/dist/marketplace-entries/official/auto-mode.json +1 -1
  445. package/packages/api-gateway/dist/marketplace-entries/official/better-sidebar.json +1 -1
  446. package/packages/api-gateway/dist/marketplace-entries/official/browser-fetch.json +12 -5
  447. package/packages/api-gateway/dist/marketplace-entries/official/browser-session.json +14 -8
  448. package/packages/api-gateway/dist/marketplace-entries/official/canvas-draw.json +3 -4
  449. package/packages/api-gateway/dist/marketplace-entries/official/change-verifier.json +1 -1
  450. package/packages/api-gateway/dist/marketplace-entries/official/cleaner.json +11 -6
  451. package/packages/api-gateway/dist/marketplace-entries/official/cli-notifier.json +5 -5
  452. package/packages/api-gateway/dist/marketplace-entries/official/code2skill.json +5 -5
  453. package/packages/api-gateway/dist/marketplace-entries/official/colleague-skill.json +1 -2
  454. package/packages/api-gateway/dist/marketplace-entries/official/context-doctor.json +12 -7
  455. package/packages/api-gateway/dist/marketplace-entries/official/context.json +10 -5
  456. package/packages/api-gateway/dist/marketplace-entries/official/cordis-group.json +2 -2
  457. package/packages/api-gateway/dist/marketplace-entries/official/cordis-logger-console.json +4 -4
  458. package/packages/api-gateway/dist/marketplace-entries/official/cordis-timer.json +3 -3
  459. package/packages/api-gateway/dist/marketplace-entries/official/cost-meter.json +9 -6
  460. package/packages/api-gateway/dist/marketplace-entries/official/dependency-checker.json +13 -10
  461. package/packages/api-gateway/dist/marketplace-entries/official/docker-sandbox.json +10 -5
  462. package/packages/api-gateway/dist/marketplace-entries/official/fail-logger.json +11 -6
  463. package/packages/api-gateway/dist/marketplace-entries/official/genui.json +7 -5
  464. package/packages/api-gateway/dist/marketplace-entries/official/git-time-capsule.json +13 -8
  465. package/packages/api-gateway/dist/marketplace-entries/official/graph-memory.json +13 -7
  466. package/packages/api-gateway/dist/marketplace-entries/official/history-compressor.json +1 -1
  467. package/packages/api-gateway/dist/marketplace-entries/official/hol-guard.json +1 -1
  468. package/packages/api-gateway/dist/marketplace-entries/official/i18n-pair.json +9 -6
  469. package/packages/api-gateway/dist/marketplace-entries/official/image-compressor.json +1 -1
  470. package/packages/api-gateway/dist/marketplace-entries/official/llm-verifier.json +1 -1
  471. package/packages/api-gateway/dist/marketplace-entries/official/mcp-client.json +12 -7
  472. package/packages/api-gateway/dist/marketplace-entries/official/mcp-panel.json +1 -1
  473. package/packages/api-gateway/dist/marketplace-entries/official/memory.json +1 -1
  474. package/packages/api-gateway/dist/marketplace-entries/official/mirage-bridge.json +1 -1
  475. package/packages/api-gateway/dist/marketplace-entries/official/mock-server.json +1 -1
  476. package/packages/api-gateway/dist/marketplace-entries/official/modlens.json +4 -4
  477. package/packages/api-gateway/dist/marketplace-entries/official/module-search.json +1 -1
  478. package/packages/api-gateway/dist/marketplace-entries/official/obsidian-sync.json +1 -1
  479. package/packages/api-gateway/dist/marketplace-entries/official/openpets.json +9 -5
  480. package/packages/api-gateway/dist/marketplace-entries/official/plan-execute.json +1 -1
  481. package/packages/api-gateway/dist/marketplace-entries/official/plugin-check.json +1 -1
  482. package/packages/api-gateway/dist/marketplace-entries/official/plugin-dev.json +8 -6
  483. package/packages/api-gateway/dist/marketplace-entries/official/plugin-finder.json +1 -1
  484. package/packages/api-gateway/dist/marketplace-entries/official/plugin-radar.json +1 -1
  485. package/packages/api-gateway/dist/marketplace-entries/official/plugin-stars.json +15 -7
  486. package/packages/api-gateway/dist/marketplace-entries/official/prompt-guard.json +1 -1
  487. package/packages/api-gateway/dist/marketplace-entries/official/prompt-library.json +1 -1
  488. package/packages/api-gateway/dist/marketplace-entries/official/readme-gen.json +12 -8
  489. package/packages/api-gateway/dist/marketplace-entries/official/recall-unread.json +11 -6
  490. package/packages/api-gateway/dist/marketplace-entries/official/reverse-skill.json +1 -1
  491. package/packages/api-gateway/dist/marketplace-entries/official/reviewer-bot.json +1 -1
  492. package/packages/api-gateway/dist/marketplace-entries/official/runtime-doctor.json +1 -1
  493. package/packages/api-gateway/dist/marketplace-entries/official/secure-audit.json +1 -1
  494. package/packages/api-gateway/dist/marketplace-entries/official/session-bookmarks.json +1 -1
  495. package/packages/api-gateway/dist/marketplace-entries/official/session-bridge.json +13 -8
  496. package/packages/api-gateway/dist/marketplace-entries/official/session-compare.json +1 -1
  497. package/packages/api-gateway/dist/marketplace-entries/official/session-export.json +1 -1
  498. package/packages/api-gateway/dist/marketplace-entries/official/session-insights.json +12 -6
  499. package/packages/api-gateway/dist/marketplace-entries/official/session-search.json +1 -1
  500. package/packages/api-gateway/dist/marketplace-entries/official/skill-catalog.json +1 -1
  501. package/packages/api-gateway/dist/marketplace-entries/official/skill-guard.json +9 -5
  502. package/packages/api-gateway/dist/marketplace-entries/official/sql-lens.json +13 -7
  503. package/packages/api-gateway/dist/marketplace-entries/official/synapse.json +1 -1
  504. package/packages/api-gateway/dist/marketplace-entries/official/tab-manager.json +1 -1
  505. package/packages/api-gateway/dist/marketplace-entries/official/taskboard.json +1 -1
  506. package/packages/api-gateway/dist/marketplace-entries/official/telemetry-blocker.json +1 -1
  507. package/packages/api-gateway/dist/marketplace-entries/official/test-harness.json +14 -7
  508. package/packages/api-gateway/dist/marketplace-entries/official/theme-studio.json +1 -1
  509. package/packages/api-gateway/dist/marketplace-entries/official/token-guard.json +12 -6
  510. package/packages/api-gateway/dist/marketplace-entries/official/turn-rewind.json +11 -6
  511. package/packages/api-gateway/dist/marketplace-entries/official/undo-savepoint.json +1 -1
  512. package/packages/api-gateway/dist/marketplace-entries/official/vision-toolkit.json +8 -5
  513. package/packages/api-gateway/dist/marketplace-entries/official/web-research.json +1 -1
  514. package/packages/api-gateway/dist/marketplace-entries/official/workspace-navigator.json +1 -1
  515. package/packages/api-gateway/dist/marketplace-entries/official/workspace-search.json +1 -1
  516. package/packages/api-gateway/dist/marketplace-entries/official/yaml-validator.json +8 -5
  517. package/packages/api-gateway/package.json +1 -1
  518. package/packages/api-gateway/src/index.ts +90 -9
  519. package/packages/api-gateway/src/marketplace-entries/official/agent-teams.json +6 -6
  520. package/packages/api-gateway/src/marketplace-entries/official/anchored-standard.json +1 -1
  521. package/packages/api-gateway/src/marketplace-entries/official/annotation.json +1 -2
  522. package/packages/api-gateway/src/marketplace-entries/official/archify.json +1 -1
  523. package/packages/api-gateway/src/marketplace-entries/official/at-file.json +11 -5
  524. package/packages/api-gateway/src/marketplace-entries/official/auto-mode.json +1 -1
  525. package/packages/api-gateway/src/marketplace-entries/official/better-sidebar.json +1 -1
  526. package/packages/api-gateway/src/marketplace-entries/official/browser-fetch.json +12 -5
  527. package/packages/api-gateway/src/marketplace-entries/official/browser-session.json +14 -8
  528. package/packages/api-gateway/src/marketplace-entries/official/canvas-draw.json +3 -4
  529. package/packages/api-gateway/src/marketplace-entries/official/change-verifier.json +1 -1
  530. package/packages/api-gateway/src/marketplace-entries/official/cleaner.json +11 -6
  531. package/packages/api-gateway/src/marketplace-entries/official/cli-notifier.json +5 -5
  532. package/packages/api-gateway/src/marketplace-entries/official/code2skill.json +5 -5
  533. package/packages/api-gateway/src/marketplace-entries/official/colleague-skill.json +1 -2
  534. package/packages/api-gateway/src/marketplace-entries/official/context-doctor.json +12 -7
  535. package/packages/api-gateway/src/marketplace-entries/official/context.json +10 -5
  536. package/packages/api-gateway/src/marketplace-entries/official/cordis-group.json +2 -2
  537. package/packages/api-gateway/src/marketplace-entries/official/cordis-logger-console.json +4 -4
  538. package/packages/api-gateway/src/marketplace-entries/official/cordis-timer.json +3 -3
  539. package/packages/api-gateway/src/marketplace-entries/official/cost-meter.json +9 -6
  540. package/packages/api-gateway/src/marketplace-entries/official/dependency-checker.json +13 -10
  541. package/packages/api-gateway/src/marketplace-entries/official/docker-sandbox.json +10 -5
  542. package/packages/api-gateway/src/marketplace-entries/official/fail-logger.json +11 -6
  543. package/packages/api-gateway/src/marketplace-entries/official/genui.json +7 -5
  544. package/packages/api-gateway/src/marketplace-entries/official/git-time-capsule.json +13 -8
  545. package/packages/api-gateway/src/marketplace-entries/official/graph-memory.json +13 -7
  546. package/packages/api-gateway/src/marketplace-entries/official/history-compressor.json +1 -1
  547. package/packages/api-gateway/src/marketplace-entries/official/hol-guard.json +1 -1
  548. package/packages/api-gateway/src/marketplace-entries/official/i18n-pair.json +9 -6
  549. package/packages/api-gateway/src/marketplace-entries/official/image-compressor.json +1 -1
  550. package/packages/api-gateway/src/marketplace-entries/official/llm-verifier.json +1 -1
  551. package/packages/api-gateway/src/marketplace-entries/official/mcp-client.json +12 -7
  552. package/packages/api-gateway/src/marketplace-entries/official/mcp-panel.json +1 -1
  553. package/packages/api-gateway/src/marketplace-entries/official/memory.json +1 -1
  554. package/packages/api-gateway/src/marketplace-entries/official/mirage-bridge.json +1 -1
  555. package/packages/api-gateway/src/marketplace-entries/official/mock-server.json +1 -1
  556. package/packages/api-gateway/src/marketplace-entries/official/modlens.json +4 -4
  557. package/packages/api-gateway/src/marketplace-entries/official/module-search.json +1 -1
  558. package/packages/api-gateway/src/marketplace-entries/official/obsidian-sync.json +1 -1
  559. package/packages/api-gateway/src/marketplace-entries/official/openpets.json +9 -5
  560. package/packages/api-gateway/src/marketplace-entries/official/plan-execute.json +1 -1
  561. package/packages/api-gateway/src/marketplace-entries/official/plugin-check.json +1 -1
  562. package/packages/api-gateway/src/marketplace-entries/official/plugin-dev.json +8 -6
  563. package/packages/api-gateway/src/marketplace-entries/official/plugin-finder.json +1 -1
  564. package/packages/api-gateway/src/marketplace-entries/official/plugin-radar.json +1 -1
  565. package/packages/api-gateway/src/marketplace-entries/official/plugin-stars.json +15 -7
  566. package/packages/api-gateway/src/marketplace-entries/official/prompt-guard.json +1 -1
  567. package/packages/api-gateway/src/marketplace-entries/official/prompt-library.json +1 -1
  568. package/packages/api-gateway/src/marketplace-entries/official/readme-gen.json +12 -8
  569. package/packages/api-gateway/src/marketplace-entries/official/recall-unread.json +11 -6
  570. package/packages/api-gateway/src/marketplace-entries/official/reverse-skill.json +1 -1
  571. package/packages/api-gateway/src/marketplace-entries/official/reviewer-bot.json +1 -1
  572. package/packages/api-gateway/src/marketplace-entries/official/runtime-doctor.json +1 -1
  573. package/packages/api-gateway/src/marketplace-entries/official/secure-audit.json +1 -1
  574. package/packages/api-gateway/src/marketplace-entries/official/session-bookmarks.json +1 -1
  575. package/packages/api-gateway/src/marketplace-entries/official/session-bridge.json +13 -8
  576. package/packages/api-gateway/src/marketplace-entries/official/session-compare.json +1 -1
  577. package/packages/api-gateway/src/marketplace-entries/official/session-export.json +1 -1
  578. package/packages/api-gateway/src/marketplace-entries/official/session-insights.json +12 -6
  579. package/packages/api-gateway/src/marketplace-entries/official/session-search.json +1 -1
  580. package/packages/api-gateway/src/marketplace-entries/official/skill-catalog.json +1 -1
  581. package/packages/api-gateway/src/marketplace-entries/official/skill-guard.json +9 -5
  582. package/packages/api-gateway/src/marketplace-entries/official/sql-lens.json +13 -7
  583. package/packages/api-gateway/src/marketplace-entries/official/synapse.json +1 -1
  584. package/packages/api-gateway/src/marketplace-entries/official/tab-manager.json +1 -1
  585. package/packages/api-gateway/src/marketplace-entries/official/taskboard.json +1 -1
  586. package/packages/api-gateway/src/marketplace-entries/official/telemetry-blocker.json +1 -1
  587. package/packages/api-gateway/src/marketplace-entries/official/test-harness.json +14 -7
  588. package/packages/api-gateway/src/marketplace-entries/official/theme-studio.json +1 -1
  589. package/packages/api-gateway/src/marketplace-entries/official/token-guard.json +12 -6
  590. package/packages/api-gateway/src/marketplace-entries/official/turn-rewind.json +11 -6
  591. package/packages/api-gateway/src/marketplace-entries/official/undo-savepoint.json +1 -1
  592. package/packages/api-gateway/src/marketplace-entries/official/vision-toolkit.json +8 -5
  593. package/packages/api-gateway/src/marketplace-entries/official/web-research.json +1 -1
  594. package/packages/api-gateway/src/marketplace-entries/official/workspace-navigator.json +1 -1
  595. package/packages/api-gateway/src/marketplace-entries/official/workspace-search.json +1 -1
  596. package/packages/api-gateway/src/marketplace-entries/official/yaml-validator.json +8 -5
  597. package/packages/api-gateway/test/index.test.ts +1594 -2
  598. package/packages/api-gateway/test/marketplace.test.ts +389 -2
  599. package/packages/api-gateway/test/release-package.test.ts +1 -0
  600. package/packages/bundle-web-app/package.json +1 -1
  601. package/packages/cli/dist/node-stdio.d.ts.map +1 -1
  602. package/packages/cli/dist/node-stdio.js +83 -20
  603. package/packages/cli/dist/node-stdio.js.map +1 -1
  604. package/packages/cli/package.json +1 -1
  605. package/packages/cli/src/node-stdio.ts +77 -20
  606. package/packages/cli/test/node-stdio.test.ts +118 -2
  607. package/packages/client-web/dist/agent-teams-view.d.ts +70 -0
  608. package/packages/client-web/dist/agent-teams-view.d.ts.map +1 -0
  609. package/packages/client-web/dist/agent-teams-view.js +159 -0
  610. package/packages/client-web/dist/agent-teams-view.js.map +1 -0
  611. package/packages/client-web/dist/at-file-view.d.ts +10 -0
  612. package/packages/client-web/dist/at-file-view.d.ts.map +1 -0
  613. package/packages/client-web/dist/at-file-view.js +65 -0
  614. package/packages/client-web/dist/at-file-view.js.map +1 -0
  615. package/packages/client-web/dist/browser-fetch-view.d.ts +22 -0
  616. package/packages/client-web/dist/browser-fetch-view.d.ts.map +1 -0
  617. package/packages/client-web/dist/browser-fetch-view.js +101 -0
  618. package/packages/client-web/dist/browser-fetch-view.js.map +1 -0
  619. package/packages/client-web/dist/browser-session-view.d.ts +32 -0
  620. package/packages/client-web/dist/browser-session-view.d.ts.map +1 -1
  621. package/packages/client-web/dist/browser-session-view.js +206 -3
  622. package/packages/client-web/dist/browser-session-view.js.map +1 -1
  623. package/packages/client-web/dist/cleaner-view.d.ts +29 -0
  624. package/packages/client-web/dist/cleaner-view.d.ts.map +1 -0
  625. package/packages/client-web/dist/cleaner-view.js +191 -0
  626. package/packages/client-web/dist/cleaner-view.js.map +1 -0
  627. package/packages/client-web/dist/context-doctor-view.d.ts +35 -0
  628. package/packages/client-web/dist/context-doctor-view.d.ts.map +1 -0
  629. package/packages/client-web/dist/context-doctor-view.js +129 -0
  630. package/packages/client-web/dist/context-doctor-view.js.map +1 -0
  631. package/packages/client-web/dist/context-insights-view.d.ts +31 -0
  632. package/packages/client-web/dist/context-insights-view.d.ts.map +1 -0
  633. package/packages/client-web/dist/context-insights-view.js +90 -0
  634. package/packages/client-web/dist/context-insights-view.js.map +1 -0
  635. package/packages/client-web/dist/cost-meter-view.d.ts +16 -0
  636. package/packages/client-web/dist/cost-meter-view.d.ts.map +1 -0
  637. package/packages/client-web/dist/cost-meter-view.js +43 -0
  638. package/packages/client-web/dist/cost-meter-view.js.map +1 -0
  639. package/packages/client-web/dist/dependency-checker-view.d.ts +24 -0
  640. package/packages/client-web/dist/dependency-checker-view.d.ts.map +1 -0
  641. package/packages/client-web/dist/dependency-checker-view.js +195 -0
  642. package/packages/client-web/dist/dependency-checker-view.js.map +1 -0
  643. package/packages/client-web/dist/docker-sandbox-view.d.ts +28 -0
  644. package/packages/client-web/dist/docker-sandbox-view.d.ts.map +1 -0
  645. package/packages/client-web/dist/docker-sandbox-view.js +152 -0
  646. package/packages/client-web/dist/docker-sandbox-view.js.map +1 -0
  647. package/packages/client-web/dist/fail-logger-view.d.ts +16 -0
  648. package/packages/client-web/dist/fail-logger-view.d.ts.map +1 -0
  649. package/packages/client-web/dist/fail-logger-view.js +97 -0
  650. package/packages/client-web/dist/fail-logger-view.js.map +1 -0
  651. package/packages/client-web/dist/genui-view.d.ts +28 -0
  652. package/packages/client-web/dist/genui-view.d.ts.map +1 -0
  653. package/packages/client-web/dist/genui-view.js +62 -0
  654. package/packages/client-web/dist/genui-view.js.map +1 -0
  655. package/packages/client-web/dist/git-time-capsule-view.d.ts +31 -0
  656. package/packages/client-web/dist/git-time-capsule-view.d.ts.map +1 -0
  657. package/packages/client-web/dist/git-time-capsule-view.js +203 -0
  658. package/packages/client-web/dist/git-time-capsule-view.js.map +1 -0
  659. package/packages/client-web/dist/graph-memory-view.d.ts +39 -0
  660. package/packages/client-web/dist/graph-memory-view.d.ts.map +1 -0
  661. package/packages/client-web/dist/graph-memory-view.js +82 -0
  662. package/packages/client-web/dist/graph-memory-view.js.map +1 -0
  663. package/packages/client-web/dist/i18n-pair-view.d.ts +32 -0
  664. package/packages/client-web/dist/i18n-pair-view.d.ts.map +1 -0
  665. package/packages/client-web/dist/i18n-pair-view.js +182 -0
  666. package/packages/client-web/dist/i18n-pair-view.js.map +1 -0
  667. package/packages/client-web/dist/mcp-client-view.d.ts +58 -0
  668. package/packages/client-web/dist/mcp-client-view.d.ts.map +1 -0
  669. package/packages/client-web/dist/mcp-client-view.js +121 -0
  670. package/packages/client-web/dist/mcp-client-view.js.map +1 -0
  671. package/packages/client-web/dist/modlens-view.d.ts +43 -0
  672. package/packages/client-web/dist/modlens-view.d.ts.map +1 -0
  673. package/packages/client-web/dist/modlens-view.js +176 -0
  674. package/packages/client-web/dist/modlens-view.js.map +1 -0
  675. package/packages/client-web/dist/openpets-view.d.ts +26 -0
  676. package/packages/client-web/dist/openpets-view.d.ts.map +1 -0
  677. package/packages/client-web/dist/openpets-view.js +62 -0
  678. package/packages/client-web/dist/openpets-view.js.map +1 -0
  679. package/packages/client-web/dist/panel-safe.d.ts +5 -0
  680. package/packages/client-web/dist/panel-safe.d.ts.map +1 -0
  681. package/packages/client-web/dist/panel-safe.js +58 -0
  682. package/packages/client-web/dist/panel-safe.js.map +1 -0
  683. package/packages/client-web/dist/plugin-dev-view.d.ts +15 -0
  684. package/packages/client-web/dist/plugin-dev-view.d.ts.map +1 -0
  685. package/packages/client-web/dist/plugin-dev-view.js +33 -0
  686. package/packages/client-web/dist/plugin-dev-view.js.map +1 -0
  687. package/packages/client-web/dist/plugin-stars-view.d.ts +28 -0
  688. package/packages/client-web/dist/plugin-stars-view.d.ts.map +1 -1
  689. package/packages/client-web/dist/plugin-stars-view.js +209 -1
  690. package/packages/client-web/dist/plugin-stars-view.js.map +1 -1
  691. package/packages/client-web/dist/react-room.d.ts +5 -1
  692. package/packages/client-web/dist/react-room.d.ts.map +1 -1
  693. package/packages/client-web/dist/react-room.js +463 -219
  694. package/packages/client-web/dist/react-room.js.map +1 -1
  695. package/packages/client-web/dist/readme-gen-view.d.ts +30 -0
  696. package/packages/client-web/dist/readme-gen-view.d.ts.map +1 -0
  697. package/packages/client-web/dist/readme-gen-view.js +134 -0
  698. package/packages/client-web/dist/readme-gen-view.js.map +1 -0
  699. package/packages/client-web/dist/recall-unread-view.d.ts +46 -0
  700. package/packages/client-web/dist/recall-unread-view.d.ts.map +1 -0
  701. package/packages/client-web/dist/recall-unread-view.js +104 -0
  702. package/packages/client-web/dist/recall-unread-view.js.map +1 -0
  703. package/packages/client-web/dist/session-bridge-view.d.ts +50 -0
  704. package/packages/client-web/dist/session-bridge-view.d.ts.map +1 -0
  705. package/packages/client-web/dist/session-bridge-view.js +113 -0
  706. package/packages/client-web/dist/session-bridge-view.js.map +1 -0
  707. package/packages/client-web/dist/session-insights-view.d.ts +40 -0
  708. package/packages/client-web/dist/session-insights-view.d.ts.map +1 -0
  709. package/packages/client-web/dist/session-insights-view.js +157 -0
  710. package/packages/client-web/dist/session-insights-view.js.map +1 -0
  711. package/packages/client-web/dist/skill-guard-view.d.ts +47 -0
  712. package/packages/client-web/dist/skill-guard-view.d.ts.map +1 -0
  713. package/packages/client-web/dist/skill-guard-view.js +93 -0
  714. package/packages/client-web/dist/skill-guard-view.js.map +1 -0
  715. package/packages/client-web/dist/sql-lens-view.d.ts +37 -0
  716. package/packages/client-web/dist/sql-lens-view.d.ts.map +1 -0
  717. package/packages/client-web/dist/sql-lens-view.js +235 -0
  718. package/packages/client-web/dist/sql-lens-view.js.map +1 -0
  719. package/packages/client-web/dist/test-harness-view.d.ts +24 -0
  720. package/packages/client-web/dist/test-harness-view.d.ts.map +1 -0
  721. package/packages/client-web/dist/test-harness-view.js +149 -0
  722. package/packages/client-web/dist/test-harness-view.js.map +1 -0
  723. package/packages/client-web/dist/token-guard-view.d.ts +19 -0
  724. package/packages/client-web/dist/token-guard-view.d.ts.map +1 -0
  725. package/packages/client-web/dist/token-guard-view.js +56 -0
  726. package/packages/client-web/dist/token-guard-view.js.map +1 -0
  727. package/packages/client-web/dist/turn-rewind-view.d.ts +41 -0
  728. package/packages/client-web/dist/turn-rewind-view.d.ts.map +1 -0
  729. package/packages/client-web/dist/turn-rewind-view.js +117 -0
  730. package/packages/client-web/dist/turn-rewind-view.js.map +1 -0
  731. package/packages/client-web/dist/vision-toolkit-view.d.ts +66 -0
  732. package/packages/client-web/dist/vision-toolkit-view.d.ts.map +1 -0
  733. package/packages/client-web/dist/vision-toolkit-view.js +238 -0
  734. package/packages/client-web/dist/vision-toolkit-view.js.map +1 -0
  735. package/packages/client-web/dist/yaml-validator-view.d.ts +52 -0
  736. package/packages/client-web/dist/yaml-validator-view.d.ts.map +1 -0
  737. package/packages/client-web/dist/yaml-validator-view.js +96 -0
  738. package/packages/client-web/dist/yaml-validator-view.js.map +1 -0
  739. package/packages/client-web/package.json +1 -1
  740. package/packages/client-web/src/agent-teams-view.ts +189 -0
  741. package/packages/client-web/src/at-file-view.ts +69 -0
  742. package/packages/client-web/src/browser-fetch-view.ts +114 -0
  743. package/packages/client-web/src/browser-session-view.ts +222 -3
  744. package/packages/client-web/src/cleaner-view.ts +207 -0
  745. package/packages/client-web/src/context-doctor-view.ts +140 -0
  746. package/packages/client-web/src/context-insights-view.ts +125 -0
  747. package/packages/client-web/src/cost-meter-view.ts +63 -0
  748. package/packages/client-web/src/dependency-checker-view.ts +215 -0
  749. package/packages/client-web/src/docker-sandbox-view.ts +177 -0
  750. package/packages/client-web/src/fail-logger-view.ts +112 -0
  751. package/packages/client-web/src/genui-view.ts +88 -0
  752. package/packages/client-web/src/git-time-capsule-view.ts +215 -0
  753. package/packages/client-web/src/graph-memory-view.ts +91 -0
  754. package/packages/client-web/src/i18n-pair-view.ts +194 -0
  755. package/packages/client-web/src/mcp-client-view.ts +122 -0
  756. package/packages/client-web/src/modlens-view.ts +210 -0
  757. package/packages/client-web/src/openpets-view.ts +67 -0
  758. package/packages/client-web/src/panel-safe.ts +47 -0
  759. package/packages/client-web/src/plugin-dev-view.ts +39 -0
  760. package/packages/client-web/src/plugin-stars-view.ts +239 -1
  761. package/packages/client-web/src/react-room.tsx +1770 -900
  762. package/packages/client-web/src/readme-gen-view.ts +145 -0
  763. package/packages/client-web/src/recall-unread-view.ts +105 -0
  764. package/packages/client-web/src/session-bridge-view.ts +118 -0
  765. package/packages/client-web/src/session-insights-view.ts +205 -0
  766. package/packages/client-web/src/skill-guard-view.ts +94 -0
  767. package/packages/client-web/src/sql-lens-view.ts +247 -0
  768. package/packages/client-web/src/test-harness-view.ts +170 -0
  769. package/packages/client-web/src/token-guard-view.ts +75 -0
  770. package/packages/client-web/src/turn-rewind-view.ts +120 -0
  771. package/packages/client-web/src/vision-toolkit-view.ts +280 -0
  772. package/packages/client-web/src/yaml-validator-view.ts +102 -0
  773. package/packages/client-web/test/agent-teams-view.test.ts +198 -0
  774. package/packages/client-web/test/at-file-panel.test.ts +76 -0
  775. package/packages/client-web/test/browser-fetch-panel.test.ts +44 -0
  776. package/packages/client-web/test/browser-fetch-view.test.ts +89 -0
  777. package/packages/client-web/test/browser-session-panel.test.ts +55 -0
  778. package/packages/client-web/test/browser-session-view.test.ts +99 -1
  779. package/packages/client-web/test/cleaner-panel.test.ts +66 -0
  780. package/packages/client-web/test/cleaner-view.test.ts +143 -0
  781. package/packages/client-web/test/context-doctor-view.test.ts +169 -0
  782. package/packages/client-web/test/context-insights-view.test.ts +120 -0
  783. package/packages/client-web/test/cost-meter-view.test.ts +53 -0
  784. package/packages/client-web/test/dependency-checker-panel.test.ts +51 -0
  785. package/packages/client-web/test/dependency-checker-view.test.ts +266 -0
  786. package/packages/client-web/test/docker-sandbox-panel.test.ts +44 -0
  787. package/packages/client-web/test/docker-sandbox-view.test.ts +127 -0
  788. package/packages/client-web/test/fail-logger-view.test.ts +155 -0
  789. package/packages/client-web/test/genui-view.test.ts +55 -0
  790. package/packages/client-web/test/git-time-capsule-view.test.ts +252 -0
  791. package/packages/client-web/test/graph-memory-view.test.ts +67 -0
  792. package/packages/client-web/test/i18n-pair-panel.test.ts +72 -0
  793. package/packages/client-web/test/i18n-pair-view.test.ts +164 -0
  794. package/packages/client-web/test/mcp-client-view.test.ts +106 -0
  795. package/packages/client-web/test/modlens-view.test.ts +198 -0
  796. package/packages/client-web/test/openpets-view.test.ts +57 -0
  797. package/packages/client-web/test/plugin-dev-view.test.ts +63 -0
  798. package/packages/client-web/test/plugin-stars-panel.test.ts +44 -0
  799. package/packages/client-web/test/plugin-stars-view.test.ts +88 -1
  800. package/packages/client-web/test/readme-gen-panel.test.ts +81 -0
  801. package/packages/client-web/test/readme-gen-view.test.ts +91 -0
  802. package/packages/client-web/test/recall-unread-view.test.ts +153 -0
  803. package/packages/client-web/test/session-bridge-view.test.ts +102 -0
  804. package/packages/client-web/test/session-insights-panel.test.ts +85 -0
  805. package/packages/client-web/test/session-insights-view.test.ts +152 -0
  806. package/packages/client-web/test/skill-guard-view.test.ts +138 -0
  807. package/packages/client-web/test/sql-lens-panel.test.ts +52 -0
  808. package/packages/client-web/test/sql-lens-view.test.ts +134 -0
  809. package/packages/client-web/test/test-harness-panel.test.ts +228 -0
  810. package/packages/client-web/test/token-guard-view.test.ts +93 -0
  811. package/packages/client-web/test/turn-rewind-view.test.ts +159 -0
  812. package/packages/client-web/test/vision-toolkit-view.test.ts +152 -0
  813. package/packages/client-web/test/yaml-validator-view.test.ts +100 -0
  814. package/packages/core/dist/atomic-write.d.ts +8 -0
  815. package/packages/core/dist/atomic-write.d.ts.map +1 -0
  816. package/packages/core/dist/atomic-write.js +40 -0
  817. package/packages/core/dist/atomic-write.js.map +1 -0
  818. package/packages/core/dist/boot.d.ts.map +1 -1
  819. package/packages/core/dist/boot.js +132 -10
  820. package/packages/core/dist/boot.js.map +1 -1
  821. package/packages/core/dist/bounded-file.d.ts +7 -0
  822. package/packages/core/dist/bounded-file.d.ts.map +1 -0
  823. package/packages/core/dist/bounded-file.js +50 -0
  824. package/packages/core/dist/bounded-file.js.map +1 -0
  825. package/packages/core/dist/config.d.ts +2 -0
  826. package/packages/core/dist/config.d.ts.map +1 -1
  827. package/packages/core/dist/config.js +21 -0
  828. package/packages/core/dist/config.js.map +1 -1
  829. package/packages/core/dist/cordis-timer.d.ts +15 -0
  830. package/packages/core/dist/cordis-timer.d.ts.map +1 -0
  831. package/packages/core/dist/cordis-timer.js +99 -0
  832. package/packages/core/dist/cordis-timer.js.map +1 -0
  833. package/packages/core/dist/plugins/agent-teams.d.ts +5 -1
  834. package/packages/core/dist/plugins/agent-teams.d.ts.map +1 -1
  835. package/packages/core/dist/plugins/agent-teams.js +986 -105
  836. package/packages/core/dist/plugins/agent-teams.js.map +1 -1
  837. package/packages/core/dist/plugins/anchored-standard.d.ts +1 -0
  838. package/packages/core/dist/plugins/anchored-standard.d.ts.map +1 -1
  839. package/packages/core/dist/plugins/anchored-standard.js +39 -11
  840. package/packages/core/dist/plugins/anchored-standard.js.map +1 -1
  841. package/packages/core/dist/plugins/annotation.d.ts +1 -0
  842. package/packages/core/dist/plugins/annotation.d.ts.map +1 -1
  843. package/packages/core/dist/plugins/annotation.js +35 -17
  844. package/packages/core/dist/plugins/annotation.js.map +1 -1
  845. package/packages/core/dist/plugins/archify.d.ts +1 -0
  846. package/packages/core/dist/plugins/archify.d.ts.map +1 -1
  847. package/packages/core/dist/plugins/archify.js +69 -22
  848. package/packages/core/dist/plugins/archify.js.map +1 -1
  849. package/packages/core/dist/plugins/at-file.d.ts +5 -1
  850. package/packages/core/dist/plugins/at-file.d.ts.map +1 -1
  851. package/packages/core/dist/plugins/at-file.js +120 -29
  852. package/packages/core/dist/plugins/at-file.js.map +1 -1
  853. package/packages/core/dist/plugins/auto-mode.d.ts.map +1 -1
  854. package/packages/core/dist/plugins/auto-mode.js +89 -20
  855. package/packages/core/dist/plugins/auto-mode.js.map +1 -1
  856. package/packages/core/dist/plugins/better-sidebar.d.ts +1 -0
  857. package/packages/core/dist/plugins/better-sidebar.d.ts.map +1 -1
  858. package/packages/core/dist/plugins/better-sidebar.js +14 -4
  859. package/packages/core/dist/plugins/better-sidebar.js.map +1 -1
  860. package/packages/core/dist/plugins/browser-fetch.d.ts +1 -0
  861. package/packages/core/dist/plugins/browser-fetch.d.ts.map +1 -1
  862. package/packages/core/dist/plugins/browser-fetch.js +288 -96
  863. package/packages/core/dist/plugins/browser-fetch.js.map +1 -1
  864. package/packages/core/dist/plugins/browser-session.d.ts.map +1 -1
  865. package/packages/core/dist/plugins/browser-session.js +445 -106
  866. package/packages/core/dist/plugins/browser-session.js.map +1 -1
  867. package/packages/core/dist/plugins/canvas-draw.d.ts +1 -0
  868. package/packages/core/dist/plugins/canvas-draw.d.ts.map +1 -1
  869. package/packages/core/dist/plugins/canvas-draw.js +71 -19
  870. package/packages/core/dist/plugins/canvas-draw.js.map +1 -1
  871. package/packages/core/dist/plugins/change-verifier.d.ts +1 -0
  872. package/packages/core/dist/plugins/change-verifier.d.ts.map +1 -1
  873. package/packages/core/dist/plugins/change-verifier.js +30 -9
  874. package/packages/core/dist/plugins/change-verifier.js.map +1 -1
  875. package/packages/core/dist/plugins/cleaner.d.ts +5 -1
  876. package/packages/core/dist/plugins/cleaner.d.ts.map +1 -1
  877. package/packages/core/dist/plugins/cleaner.js +337 -40
  878. package/packages/core/dist/plugins/cleaner.js.map +1 -1
  879. package/packages/core/dist/plugins/cli-notifier.d.ts +2 -1
  880. package/packages/core/dist/plugins/cli-notifier.d.ts.map +1 -1
  881. package/packages/core/dist/plugins/cli-notifier.js +99 -42
  882. package/packages/core/dist/plugins/cli-notifier.js.map +1 -1
  883. package/packages/core/dist/plugins/code2skill.d.ts +1 -0
  884. package/packages/core/dist/plugins/code2skill.d.ts.map +1 -1
  885. package/packages/core/dist/plugins/code2skill.js +178 -38
  886. package/packages/core/dist/plugins/code2skill.js.map +1 -1
  887. package/packages/core/dist/plugins/colleague-skill.d.ts +2 -1
  888. package/packages/core/dist/plugins/colleague-skill.d.ts.map +1 -1
  889. package/packages/core/dist/plugins/colleague-skill.js +79 -49
  890. package/packages/core/dist/plugins/colleague-skill.js.map +1 -1
  891. package/packages/core/dist/plugins/context-doctor.d.ts +6 -1
  892. package/packages/core/dist/plugins/context-doctor.d.ts.map +1 -1
  893. package/packages/core/dist/plugins/context-doctor.js +403 -39
  894. package/packages/core/dist/plugins/context-doctor.js.map +1 -1
  895. package/packages/core/dist/plugins/context.d.ts +1 -0
  896. package/packages/core/dist/plugins/context.d.ts.map +1 -1
  897. package/packages/core/dist/plugins/context.js +169 -42
  898. package/packages/core/dist/plugins/context.js.map +1 -1
  899. package/packages/core/dist/plugins/cost-meter.d.ts +4 -0
  900. package/packages/core/dist/plugins/cost-meter.d.ts.map +1 -1
  901. package/packages/core/dist/plugins/cost-meter.js +319 -93
  902. package/packages/core/dist/plugins/cost-meter.js.map +1 -1
  903. package/packages/core/dist/plugins/dependency-checker.d.ts +11 -2
  904. package/packages/core/dist/plugins/dependency-checker.d.ts.map +1 -1
  905. package/packages/core/dist/plugins/dependency-checker.js +463 -114
  906. package/packages/core/dist/plugins/dependency-checker.js.map +1 -1
  907. package/packages/core/dist/plugins/docker-sandbox.d.ts +1 -0
  908. package/packages/core/dist/plugins/docker-sandbox.d.ts.map +1 -1
  909. package/packages/core/dist/plugins/docker-sandbox.js +322 -80
  910. package/packages/core/dist/plugins/docker-sandbox.js.map +1 -1
  911. package/packages/core/dist/plugins/fail-logger.d.ts +1 -0
  912. package/packages/core/dist/plugins/fail-logger.d.ts.map +1 -1
  913. package/packages/core/dist/plugins/fail-logger.js +187 -20
  914. package/packages/core/dist/plugins/fail-logger.js.map +1 -1
  915. package/packages/core/dist/plugins/genui.d.ts +1 -0
  916. package/packages/core/dist/plugins/genui.d.ts.map +1 -1
  917. package/packages/core/dist/plugins/genui.js +103 -38
  918. package/packages/core/dist/plugins/genui.js.map +1 -1
  919. package/packages/core/dist/plugins/git-time-capsule.d.ts +8 -2
  920. package/packages/core/dist/plugins/git-time-capsule.d.ts.map +1 -1
  921. package/packages/core/dist/plugins/git-time-capsule.js +400 -54
  922. package/packages/core/dist/plugins/git-time-capsule.js.map +1 -1
  923. package/packages/core/dist/plugins/graph-memory.d.ts.map +1 -1
  924. package/packages/core/dist/plugins/graph-memory.js +329 -42
  925. package/packages/core/dist/plugins/graph-memory.js.map +1 -1
  926. package/packages/core/dist/plugins/history-compressor.d.ts.map +1 -1
  927. package/packages/core/dist/plugins/history-compressor.js +31 -12
  928. package/packages/core/dist/plugins/history-compressor.js.map +1 -1
  929. package/packages/core/dist/plugins/hol-guard.d.ts.map +1 -1
  930. package/packages/core/dist/plugins/hol-guard.js +33 -13
  931. package/packages/core/dist/plugins/hol-guard.js.map +1 -1
  932. package/packages/core/dist/plugins/i18n-pair.d.ts +5 -1
  933. package/packages/core/dist/plugins/i18n-pair.d.ts.map +1 -1
  934. package/packages/core/dist/plugins/i18n-pair.js +308 -52
  935. package/packages/core/dist/plugins/i18n-pair.js.map +1 -1
  936. package/packages/core/dist/plugins/image-compressor.d.ts +7 -0
  937. package/packages/core/dist/plugins/image-compressor.d.ts.map +1 -1
  938. package/packages/core/dist/plugins/image-compressor.js +98 -25
  939. package/packages/core/dist/plugins/image-compressor.js.map +1 -1
  940. package/packages/core/dist/plugins/llm-verifier.d.ts.map +1 -1
  941. package/packages/core/dist/plugins/llm-verifier.js +21 -11
  942. package/packages/core/dist/plugins/llm-verifier.js.map +1 -1
  943. package/packages/core/dist/plugins/mcp-client.d.ts.map +1 -1
  944. package/packages/core/dist/plugins/mcp-client.js +986 -232
  945. package/packages/core/dist/plugins/mcp-client.js.map +1 -1
  946. package/packages/core/dist/plugins/mcp-panel.d.ts.map +1 -1
  947. package/packages/core/dist/plugins/mcp-panel.js +30 -16
  948. package/packages/core/dist/plugins/mcp-panel.js.map +1 -1
  949. package/packages/core/dist/plugins/memory.d.ts.map +1 -1
  950. package/packages/core/dist/plugins/memory.js +292 -59
  951. package/packages/core/dist/plugins/memory.js.map +1 -1
  952. package/packages/core/dist/plugins/mirage-bridge.d.ts.map +1 -1
  953. package/packages/core/dist/plugins/mirage-bridge.js +20 -10
  954. package/packages/core/dist/plugins/mirage-bridge.js.map +1 -1
  955. package/packages/core/dist/plugins/mock-server.d.ts.map +1 -1
  956. package/packages/core/dist/plugins/mock-server.js +85 -54
  957. package/packages/core/dist/plugins/mock-server.js.map +1 -1
  958. package/packages/core/dist/plugins/model.d.ts +3 -0
  959. package/packages/core/dist/plugins/model.d.ts.map +1 -1
  960. package/packages/core/dist/plugins/model.js +3 -0
  961. package/packages/core/dist/plugins/model.js.map +1 -1
  962. package/packages/core/dist/plugins/models.d.ts.map +1 -1
  963. package/packages/core/dist/plugins/models.js +10 -2
  964. package/packages/core/dist/plugins/models.js.map +1 -1
  965. package/packages/core/dist/plugins/modlens.d.ts +8 -1
  966. package/packages/core/dist/plugins/modlens.d.ts.map +1 -1
  967. package/packages/core/dist/plugins/modlens.js +438 -31
  968. package/packages/core/dist/plugins/modlens.js.map +1 -1
  969. package/packages/core/dist/plugins/module-search.d.ts +1 -0
  970. package/packages/core/dist/plugins/module-search.d.ts.map +1 -1
  971. package/packages/core/dist/plugins/module-search.js +35 -16
  972. package/packages/core/dist/plugins/module-search.js.map +1 -1
  973. package/packages/core/dist/plugins/obsidian-sync.d.ts.map +1 -1
  974. package/packages/core/dist/plugins/obsidian-sync.js +20 -11
  975. package/packages/core/dist/plugins/obsidian-sync.js.map +1 -1
  976. package/packages/core/dist/plugins/openpets.d.ts.map +1 -1
  977. package/packages/core/dist/plugins/openpets.js +203 -44
  978. package/packages/core/dist/plugins/openpets.js.map +1 -1
  979. package/packages/core/dist/plugins/plan-execute.d.ts +4 -1
  980. package/packages/core/dist/plugins/plan-execute.d.ts.map +1 -1
  981. package/packages/core/dist/plugins/plan-execute.js +42 -21
  982. package/packages/core/dist/plugins/plan-execute.js.map +1 -1
  983. package/packages/core/dist/plugins/plugin-check.d.ts +12 -3
  984. package/packages/core/dist/plugins/plugin-check.d.ts.map +1 -1
  985. package/packages/core/dist/plugins/plugin-check.js +83 -12
  986. package/packages/core/dist/plugins/plugin-check.js.map +1 -1
  987. package/packages/core/dist/plugins/plugin-dev.d.ts +1 -0
  988. package/packages/core/dist/plugins/plugin-dev.d.ts.map +1 -1
  989. package/packages/core/dist/plugins/plugin-dev.js +156 -23
  990. package/packages/core/dist/plugins/plugin-dev.js.map +1 -1
  991. package/packages/core/dist/plugins/plugin-finder.d.ts +1 -0
  992. package/packages/core/dist/plugins/plugin-finder.d.ts.map +1 -1
  993. package/packages/core/dist/plugins/plugin-finder.js +131 -13
  994. package/packages/core/dist/plugins/plugin-finder.js.map +1 -1
  995. package/packages/core/dist/plugins/plugin-radar.d.ts +4 -0
  996. package/packages/core/dist/plugins/plugin-radar.d.ts.map +1 -1
  997. package/packages/core/dist/plugins/plugin-radar.js +137 -36
  998. package/packages/core/dist/plugins/plugin-radar.js.map +1 -1
  999. package/packages/core/dist/plugins/plugin-stars.d.ts.map +1 -1
  1000. package/packages/core/dist/plugins/plugin-stars.js +282 -81
  1001. package/packages/core/dist/plugins/plugin-stars.js.map +1 -1
  1002. package/packages/core/dist/plugins/prompt-guard.d.ts +1 -0
  1003. package/packages/core/dist/plugins/prompt-guard.d.ts.map +1 -1
  1004. package/packages/core/dist/plugins/prompt-guard.js +60 -9
  1005. package/packages/core/dist/plugins/prompt-guard.js.map +1 -1
  1006. package/packages/core/dist/plugins/prompt-library.d.ts +1 -0
  1007. package/packages/core/dist/plugins/prompt-library.d.ts.map +1 -1
  1008. package/packages/core/dist/plugins/prompt-library.js +4 -1
  1009. package/packages/core/dist/plugins/prompt-library.js.map +1 -1
  1010. package/packages/core/dist/plugins/readme-gen.d.ts +6 -2
  1011. package/packages/core/dist/plugins/readme-gen.d.ts.map +1 -1
  1012. package/packages/core/dist/plugins/readme-gen.js +514 -73
  1013. package/packages/core/dist/plugins/readme-gen.js.map +1 -1
  1014. package/packages/core/dist/plugins/recall-unread.d.ts +1 -1
  1015. package/packages/core/dist/plugins/recall-unread.d.ts.map +1 -1
  1016. package/packages/core/dist/plugins/recall-unread.js +411 -68
  1017. package/packages/core/dist/plugins/recall-unread.js.map +1 -1
  1018. package/packages/core/dist/plugins/resources.d.ts.map +1 -1
  1019. package/packages/core/dist/plugins/resources.js +66 -3
  1020. package/packages/core/dist/plugins/resources.js.map +1 -1
  1021. package/packages/core/dist/plugins/reverse-skill.d.ts.map +1 -1
  1022. package/packages/core/dist/plugins/reverse-skill.js +2 -1
  1023. package/packages/core/dist/plugins/reverse-skill.js.map +1 -1
  1024. package/packages/core/dist/plugins/reviewer-bot.d.ts +1 -0
  1025. package/packages/core/dist/plugins/reviewer-bot.d.ts.map +1 -1
  1026. package/packages/core/dist/plugins/reviewer-bot.js +35 -16
  1027. package/packages/core/dist/plugins/reviewer-bot.js.map +1 -1
  1028. package/packages/core/dist/plugins/runtime-doctor.d.ts +1 -0
  1029. package/packages/core/dist/plugins/runtime-doctor.d.ts.map +1 -1
  1030. package/packages/core/dist/plugins/runtime-doctor.js +4 -1
  1031. package/packages/core/dist/plugins/runtime-doctor.js.map +1 -1
  1032. package/packages/core/dist/plugins/runtime.d.ts.map +1 -1
  1033. package/packages/core/dist/plugins/runtime.js +104 -70
  1034. package/packages/core/dist/plugins/runtime.js.map +1 -1
  1035. package/packages/core/dist/plugins/secure-audit.d.ts +1 -0
  1036. package/packages/core/dist/plugins/secure-audit.d.ts.map +1 -1
  1037. package/packages/core/dist/plugins/secure-audit.js +30 -12
  1038. package/packages/core/dist/plugins/secure-audit.js.map +1 -1
  1039. package/packages/core/dist/plugins/session-bookmarks.d.ts +1 -0
  1040. package/packages/core/dist/plugins/session-bookmarks.d.ts.map +1 -1
  1041. package/packages/core/dist/plugins/session-bookmarks.js +4 -1
  1042. package/packages/core/dist/plugins/session-bookmarks.js.map +1 -1
  1043. package/packages/core/dist/plugins/session-bridge.d.ts +1 -0
  1044. package/packages/core/dist/plugins/session-bridge.d.ts.map +1 -1
  1045. package/packages/core/dist/plugins/session-bridge.js +401 -88
  1046. package/packages/core/dist/plugins/session-bridge.js.map +1 -1
  1047. package/packages/core/dist/plugins/session-compare.d.ts +1 -0
  1048. package/packages/core/dist/plugins/session-compare.d.ts.map +1 -1
  1049. package/packages/core/dist/plugins/session-compare.js +4 -1
  1050. package/packages/core/dist/plugins/session-compare.js.map +1 -1
  1051. package/packages/core/dist/plugins/session-export.d.ts +1 -0
  1052. package/packages/core/dist/plugins/session-export.d.ts.map +1 -1
  1053. package/packages/core/dist/plugins/session-export.js +6 -6
  1054. package/packages/core/dist/plugins/session-export.js.map +1 -1
  1055. package/packages/core/dist/plugins/session-insights.d.ts +37 -1
  1056. package/packages/core/dist/plugins/session-insights.d.ts.map +1 -1
  1057. package/packages/core/dist/plugins/session-insights.js +406 -21
  1058. package/packages/core/dist/plugins/session-insights.js.map +1 -1
  1059. package/packages/core/dist/plugins/session-search.d.ts +1 -0
  1060. package/packages/core/dist/plugins/session-search.d.ts.map +1 -1
  1061. package/packages/core/dist/plugins/session-search.js +4 -1
  1062. package/packages/core/dist/plugins/session-search.js.map +1 -1
  1063. package/packages/core/dist/plugins/session.d.ts.map +1 -1
  1064. package/packages/core/dist/plugins/session.js +8 -1
  1065. package/packages/core/dist/plugins/session.js.map +1 -1
  1066. package/packages/core/dist/plugins/skill-catalog.d.ts +1 -0
  1067. package/packages/core/dist/plugins/skill-catalog.d.ts.map +1 -1
  1068. package/packages/core/dist/plugins/skill-catalog.js +6 -5
  1069. package/packages/core/dist/plugins/skill-catalog.js.map +1 -1
  1070. package/packages/core/dist/plugins/skill-guard.d.ts +2 -1
  1071. package/packages/core/dist/plugins/skill-guard.d.ts.map +1 -1
  1072. package/packages/core/dist/plugins/skill-guard.js +241 -61
  1073. package/packages/core/dist/plugins/skill-guard.js.map +1 -1
  1074. package/packages/core/dist/plugins/sql-lens-worker.d.ts +2 -0
  1075. package/packages/core/dist/plugins/sql-lens-worker.d.ts.map +1 -0
  1076. package/packages/core/dist/plugins/sql-lens-worker.js +206 -0
  1077. package/packages/core/dist/plugins/sql-lens-worker.js.map +1 -0
  1078. package/packages/core/dist/plugins/sql-lens.d.ts +7 -1
  1079. package/packages/core/dist/plugins/sql-lens.d.ts.map +1 -1
  1080. package/packages/core/dist/plugins/sql-lens.js +301 -68
  1081. package/packages/core/dist/plugins/sql-lens.js.map +1 -1
  1082. package/packages/core/dist/plugins/stdio.d.ts +3 -0
  1083. package/packages/core/dist/plugins/stdio.d.ts.map +1 -1
  1084. package/packages/core/dist/plugins/stdio.js +62 -4
  1085. package/packages/core/dist/plugins/stdio.js.map +1 -1
  1086. package/packages/core/dist/plugins/synapse.d.ts.map +1 -1
  1087. package/packages/core/dist/plugins/synapse.js +17 -9
  1088. package/packages/core/dist/plugins/synapse.js.map +1 -1
  1089. package/packages/core/dist/plugins/tab-manager.d.ts +1 -0
  1090. package/packages/core/dist/plugins/tab-manager.d.ts.map +1 -1
  1091. package/packages/core/dist/plugins/tab-manager.js +167 -62
  1092. package/packages/core/dist/plugins/tab-manager.js.map +1 -1
  1093. package/packages/core/dist/plugins/taskboard.d.ts.map +1 -1
  1094. package/packages/core/dist/plugins/taskboard.js +50 -22
  1095. package/packages/core/dist/plugins/taskboard.js.map +1 -1
  1096. package/packages/core/dist/plugins/telemetry-blocker.d.ts +4 -1
  1097. package/packages/core/dist/plugins/telemetry-blocker.d.ts.map +1 -1
  1098. package/packages/core/dist/plugins/telemetry-blocker.js +30 -11
  1099. package/packages/core/dist/plugins/telemetry-blocker.js.map +1 -1
  1100. package/packages/core/dist/plugins/test-harness.d.ts +7 -1
  1101. package/packages/core/dist/plugins/test-harness.d.ts.map +1 -1
  1102. package/packages/core/dist/plugins/test-harness.js +255 -43
  1103. package/packages/core/dist/plugins/test-harness.js.map +1 -1
  1104. package/packages/core/dist/plugins/theme-studio.d.ts.map +1 -1
  1105. package/packages/core/dist/plugins/theme-studio.js +4 -2
  1106. package/packages/core/dist/plugins/theme-studio.js.map +1 -1
  1107. package/packages/core/dist/plugins/token-guard.d.ts.map +1 -1
  1108. package/packages/core/dist/plugins/token-guard.js +164 -32
  1109. package/packages/core/dist/plugins/token-guard.js.map +1 -1
  1110. package/packages/core/dist/plugins/tools.d.ts.map +1 -1
  1111. package/packages/core/dist/plugins/tools.js +4 -1
  1112. package/packages/core/dist/plugins/tools.js.map +1 -1
  1113. package/packages/core/dist/plugins/turn-rewind.d.ts +17 -0
  1114. package/packages/core/dist/plugins/turn-rewind.d.ts.map +1 -1
  1115. package/packages/core/dist/plugins/turn-rewind.js +340 -36
  1116. package/packages/core/dist/plugins/turn-rewind.js.map +1 -1
  1117. package/packages/core/dist/plugins/undo-savepoint.d.ts.map +1 -1
  1118. package/packages/core/dist/plugins/undo-savepoint.js +157 -51
  1119. package/packages/core/dist/plugins/undo-savepoint.js.map +1 -1
  1120. package/packages/core/dist/plugins/vision-toolkit.d.ts +22 -3
  1121. package/packages/core/dist/plugins/vision-toolkit.d.ts.map +1 -1
  1122. package/packages/core/dist/plugins/vision-toolkit.js +389 -66
  1123. package/packages/core/dist/plugins/vision-toolkit.js.map +1 -1
  1124. package/packages/core/dist/plugins/web-research.d.ts.map +1 -1
  1125. package/packages/core/dist/plugins/web-research.js +13 -4
  1126. package/packages/core/dist/plugins/web-research.js.map +1 -1
  1127. package/packages/core/dist/plugins/workspace-navigator.d.ts +8 -2
  1128. package/packages/core/dist/plugins/workspace-navigator.d.ts.map +1 -1
  1129. package/packages/core/dist/plugins/workspace-navigator.js +28 -10
  1130. package/packages/core/dist/plugins/workspace-navigator.js.map +1 -1
  1131. package/packages/core/dist/plugins/workspace-search.d.ts +7 -0
  1132. package/packages/core/dist/plugins/workspace-search.d.ts.map +1 -1
  1133. package/packages/core/dist/plugins/workspace-search.js +67 -34
  1134. package/packages/core/dist/plugins/workspace-search.js.map +1 -1
  1135. package/packages/core/dist/plugins/yaml-validator.d.ts +1 -0
  1136. package/packages/core/dist/plugins/yaml-validator.d.ts.map +1 -1
  1137. package/packages/core/dist/plugins/yaml-validator.js +156 -47
  1138. package/packages/core/dist/plugins/yaml-validator.js.map +1 -1
  1139. package/packages/core/dist/runtime.d.ts.map +1 -1
  1140. package/packages/core/dist/runtime.js +8 -3
  1141. package/packages/core/dist/runtime.js.map +1 -1
  1142. package/packages/core/dist/services.d.ts.map +1 -1
  1143. package/packages/core/dist/services.js +22 -2
  1144. package/packages/core/dist/services.js.map +1 -1
  1145. package/packages/core/dist/stdio.d.ts +1 -0
  1146. package/packages/core/dist/stdio.d.ts.map +1 -1
  1147. package/packages/core/dist/stdio.js +241 -25
  1148. package/packages/core/dist/stdio.js.map +1 -1
  1149. package/packages/core/dist/workspace-path.d.ts +1 -0
  1150. package/packages/core/dist/workspace-path.d.ts.map +1 -1
  1151. package/packages/core/dist/workspace-path.js +9 -0
  1152. package/packages/core/dist/workspace-path.js.map +1 -1
  1153. package/packages/core/package.json +1 -1
  1154. package/packages/core/profiles/default/cordis.yml +4 -2
  1155. package/packages/core/src/atomic-write.ts +45 -0
  1156. package/packages/core/src/boot.ts +123 -11
  1157. package/packages/core/src/bounded-file.ts +41 -0
  1158. package/packages/core/src/config.ts +18 -0
  1159. package/packages/core/src/cordis-timer.ts +107 -0
  1160. package/packages/core/src/plugins/agent-teams.ts +1003 -103
  1161. package/packages/core/src/plugins/anchored-standard.ts +41 -14
  1162. package/packages/core/src/plugins/annotation.ts +36 -19
  1163. package/packages/core/src/plugins/archify.ts +80 -33
  1164. package/packages/core/src/plugins/at-file.ts +110 -26
  1165. package/packages/core/src/plugins/auto-mode.ts +91 -24
  1166. package/packages/core/src/plugins/better-sidebar.ts +15 -4
  1167. package/packages/core/src/plugins/browser-fetch.ts +286 -95
  1168. package/packages/core/src/plugins/browser-session.ts +421 -102
  1169. package/packages/core/src/plugins/canvas-draw.ts +74 -21
  1170. package/packages/core/src/plugins/change-verifier.ts +33 -9
  1171. package/packages/core/src/plugins/cleaner.ts +339 -37
  1172. package/packages/core/src/plugins/cli-notifier.ts +110 -41
  1173. package/packages/core/src/plugins/code2skill.ts +175 -34
  1174. package/packages/core/src/plugins/colleague-skill.ts +72 -47
  1175. package/packages/core/src/plugins/context-doctor.ts +410 -40
  1176. package/packages/core/src/plugins/context.ts +164 -39
  1177. package/packages/core/src/plugins/cost-meter.ts +360 -113
  1178. package/packages/core/src/plugins/dependency-checker.ts +456 -119
  1179. package/packages/core/src/plugins/docker-sandbox.ts +312 -76
  1180. package/packages/core/src/plugins/fail-logger.ts +169 -18
  1181. package/packages/core/src/plugins/genui.ts +104 -42
  1182. package/packages/core/src/plugins/git-time-capsule.ts +424 -55
  1183. package/packages/core/src/plugins/graph-memory.ts +333 -60
  1184. package/packages/core/src/plugins/history-compressor.ts +29 -12
  1185. package/packages/core/src/plugins/hol-guard.ts +31 -13
  1186. package/packages/core/src/plugins/i18n-pair.ts +296 -52
  1187. package/packages/core/src/plugins/image-compressor.ts +98 -25
  1188. package/packages/core/src/plugins/llm-verifier.ts +39 -21
  1189. package/packages/core/src/plugins/mcp-client.ts +1069 -249
  1190. package/packages/core/src/plugins/mcp-panel.ts +37 -21
  1191. package/packages/core/src/plugins/memory.ts +262 -57
  1192. package/packages/core/src/plugins/mirage-bridge.ts +22 -10
  1193. package/packages/core/src/plugins/mock-server.ts +91 -60
  1194. package/packages/core/src/plugins/model.ts +4 -0
  1195. package/packages/core/src/plugins/models.ts +10 -2
  1196. package/packages/core/src/plugins/modlens.ts +463 -29
  1197. package/packages/core/src/plugins/module-search.ts +40 -19
  1198. package/packages/core/src/plugins/obsidian-sync.ts +26 -15
  1199. package/packages/core/src/plugins/openpets.ts +193 -42
  1200. package/packages/core/src/plugins/plan-execute.ts +49 -21
  1201. package/packages/core/src/plugins/plugin-check.ts +100 -16
  1202. package/packages/core/src/plugins/plugin-dev.ts +167 -23
  1203. package/packages/core/src/plugins/plugin-finder.ts +119 -12
  1204. package/packages/core/src/plugins/plugin-radar.ts +130 -39
  1205. package/packages/core/src/plugins/plugin-stars.ts +252 -80
  1206. package/packages/core/src/plugins/prompt-guard.ts +51 -12
  1207. package/packages/core/src/plugins/prompt-library.ts +14 -8
  1208. package/packages/core/src/plugins/readme-gen.ts +476 -79
  1209. package/packages/core/src/plugins/recall-unread.ts +412 -68
  1210. package/packages/core/src/plugins/resources.ts +70 -2
  1211. package/packages/core/src/plugins/reverse-skill.ts +9 -5
  1212. package/packages/core/src/plugins/reviewer-bot.ts +34 -16
  1213. package/packages/core/src/plugins/runtime-doctor.ts +4 -1
  1214. package/packages/core/src/plugins/runtime.ts +98 -68
  1215. package/packages/core/src/plugins/secure-audit.ts +33 -12
  1216. package/packages/core/src/plugins/session-bookmarks.ts +12 -6
  1217. package/packages/core/src/plugins/session-bridge.ts +404 -89
  1218. package/packages/core/src/plugins/session-compare.ts +10 -4
  1219. package/packages/core/src/plugins/session-export.ts +12 -9
  1220. package/packages/core/src/plugins/session-insights.ts +454 -31
  1221. package/packages/core/src/plugins/session-search.ts +4 -1
  1222. package/packages/core/src/plugins/session.ts +8 -1
  1223. package/packages/core/src/plugins/skill-catalog.ts +13 -8
  1224. package/packages/core/src/plugins/skill-guard.ts +254 -61
  1225. package/packages/core/src/plugins/sql-lens-worker.ts +202 -0
  1226. package/packages/core/src/plugins/sql-lens.ts +323 -71
  1227. package/packages/core/src/plugins/stdio.ts +58 -3
  1228. package/packages/core/src/plugins/synapse.ts +16 -9
  1229. package/packages/core/src/plugins/tab-manager.ts +163 -65
  1230. package/packages/core/src/plugins/taskboard.ts +81 -47
  1231. package/packages/core/src/plugins/telemetry-blocker.ts +27 -11
  1232. package/packages/core/src/plugins/test-harness.ts +275 -42
  1233. package/packages/core/src/plugins/theme-studio.ts +7 -2
  1234. package/packages/core/src/plugins/token-guard.ts +171 -31
  1235. package/packages/core/src/plugins/tools.ts +4 -1
  1236. package/packages/core/src/plugins/turn-rewind.ts +351 -37
  1237. package/packages/core/src/plugins/undo-savepoint.ts +160 -59
  1238. package/packages/core/src/plugins/vision-toolkit.ts +420 -63
  1239. package/packages/core/src/plugins/web-research.ts +19 -7
  1240. package/packages/core/src/plugins/workspace-navigator.ts +39 -14
  1241. package/packages/core/src/plugins/workspace-search.ts +75 -37
  1242. package/packages/core/src/plugins/yaml-validator.ts +165 -46
  1243. package/packages/core/src/runtime.ts +8 -2
  1244. package/packages/core/src/services.ts +22 -2
  1245. package/packages/core/src/stdio.ts +220 -25
  1246. package/packages/core/src/workspace-path.ts +10 -0
  1247. package/packages/core/test/agent-teams.test.ts +495 -2
  1248. package/packages/core/test/anchored-standard.test.ts +60 -0
  1249. package/packages/core/test/annotation.test.ts +69 -0
  1250. package/packages/core/test/archify.test.ts +212 -1
  1251. package/packages/core/test/at-file.test.ts +666 -0
  1252. package/packages/core/test/atomic-write.test.ts +52 -0
  1253. package/packages/core/test/auto-mode.test.ts +629 -0
  1254. package/packages/core/test/better-sidebar.test.ts +108 -1
  1255. package/packages/core/test/boot.test.ts +129 -1
  1256. package/packages/core/test/bounded-file.test.ts +55 -0
  1257. package/packages/core/test/browser-fetch-rebinding.test.ts +93 -0
  1258. package/packages/core/test/browser-fetch.test.ts +844 -0
  1259. package/packages/core/test/browser-session.test.ts +1236 -0
  1260. package/packages/core/test/canvas-draw.test.ts +164 -0
  1261. package/packages/core/test/change-verifier.test.ts +200 -0
  1262. package/packages/core/test/cleaner.test.ts +316 -0
  1263. package/packages/core/test/cli-notifier.test.ts +235 -0
  1264. package/packages/core/test/code2skill.test.ts +264 -0
  1265. package/packages/core/test/colleague-skill.test.ts +167 -0
  1266. package/packages/core/test/config.test.ts +8 -0
  1267. package/packages/core/test/context-doctor.test.ts +597 -2
  1268. package/packages/core/test/context-insights.test.ts +396 -0
  1269. package/packages/core/test/cordis-timer.test.ts +147 -0
  1270. package/packages/core/test/cost-meter.test.ts +362 -0
  1271. package/packages/core/test/dependency-checker.test.ts +576 -3
  1272. package/packages/core/test/docker-sandbox.test.ts +170 -0
  1273. package/packages/core/test/fail-logger.test.ts +363 -0
  1274. package/packages/core/test/genui.test.ts +162 -0
  1275. package/packages/core/test/git-time-capsule.test.ts +1364 -3
  1276. package/packages/core/test/graph-memory.test.ts +508 -0
  1277. package/packages/core/test/history-compressor.test.ts +47 -0
  1278. package/packages/core/test/hol-guard.test.ts +61 -0
  1279. package/packages/core/test/i18n-pair.test.ts +367 -0
  1280. package/packages/core/test/image-compressor.test.ts +59 -0
  1281. package/packages/core/test/llm-verifier.test.ts +4 -0
  1282. package/packages/core/test/mcp-client.test.ts +1037 -0
  1283. package/packages/core/test/mcp-panel.test.ts +91 -0
  1284. package/packages/core/test/memory.test.ts +125 -0
  1285. package/packages/core/test/mirage-bridge.test.ts +4 -0
  1286. package/packages/core/test/mock-server.test.ts +63 -0
  1287. package/packages/core/test/model.test.ts +62 -0
  1288. package/packages/core/test/models.test.ts +85 -0
  1289. package/packages/core/test/modlens.test.ts +615 -0
  1290. package/packages/core/test/module-search.test.ts +20 -0
  1291. package/packages/core/test/obsidian-sync.test.ts +57 -0
  1292. package/packages/core/test/openpets.test.ts +273 -0
  1293. package/packages/core/test/plan-execute.test.ts +86 -0
  1294. package/packages/core/test/plugin-dev.test.ts +246 -0
  1295. package/packages/core/test/plugin-finder.test.ts +105 -0
  1296. package/packages/core/test/plugin-radar.test.ts +87 -0
  1297. package/packages/core/test/plugin-stars.test.ts +429 -4
  1298. package/packages/core/test/profiles.integration.test.ts +451 -2
  1299. package/packages/core/test/prompt-guard.test.ts +78 -0
  1300. package/packages/core/test/readme-gen.test.ts +403 -3
  1301. package/packages/core/test/recall-unread.test.ts +559 -2
  1302. package/packages/core/test/registry.test.ts +16 -0
  1303. package/packages/core/test/resources.test.ts +310 -0
  1304. package/packages/core/test/reviewer-bot.test.ts +55 -0
  1305. package/packages/core/test/runtime-fixture.ts +10 -1
  1306. package/packages/core/test/runtime.test.ts +155 -2
  1307. package/packages/core/test/secure-audit.test.ts +14 -1
  1308. package/packages/core/test/services.test.ts +2772 -117
  1309. package/packages/core/test/session-bridge.test.ts +309 -1
  1310. package/packages/core/test/session-insights.test.ts +486 -0
  1311. package/packages/core/test/session.test.ts +153 -0
  1312. package/packages/core/test/skill-guard.test.ts +261 -2
  1313. package/packages/core/test/sql-lens.test.ts +244 -0
  1314. package/packages/core/test/stdio-args.test.ts +484 -1
  1315. package/packages/core/test/stdio.test.ts +159 -0
  1316. package/packages/core/test/synapse.test.ts +67 -0
  1317. package/packages/core/test/tab-manager.test.ts +58 -0
  1318. package/packages/core/test/taskboard.test.ts +73 -0
  1319. package/packages/core/test/telemetry-blocker.test.ts +61 -0
  1320. package/packages/core/test/test-harness.test.ts +297 -0
  1321. package/packages/core/test/token-guard.test.ts +362 -1
  1322. package/packages/core/test/tools.test.ts +118 -0
  1323. package/packages/core/test/turn-rewind.test.ts +532 -2
  1324. package/packages/core/test/undo-savepoint.test.ts +222 -0
  1325. package/packages/core/test/vision-toolkit.test.ts +480 -7
  1326. package/packages/core/test/web-research.test.ts +63 -0
  1327. package/packages/core/test/workspace-git-status.test.ts +19 -2
  1328. package/packages/core/test/workspace-navigator.test.ts +11 -1
  1329. package/packages/core/test/workspace-search.test.ts +88 -0
  1330. package/packages/core/test/yaml-validator.test.ts +195 -0
  1331. package/packages/host-webserver/package.json +1 -1
  1332. package/apps/web/dist/assets/index-C_AdODuM.js +0 -20
  1333. package/apps/web/dist/assets/index-De8Rm01Z.css +0 -2
@@ -1,28 +1,470 @@
1
1
  import { spawn } from "node:child_process";
2
- import { basename } from "node:path";
3
2
  import z from "@deepseek-ai/schemastery";
4
3
  import { Type } from "@earendil-works/pi-ai";
5
4
  import { defineTool } from "@earendil-works/pi-coding-agent";
5
+ import packageMetadata from "../../package.json" with { type: "json" };
6
+ import { assertKnownConfigKeys } from "../config.js";
6
7
  export const Config = z.object({
7
8
  servers: z.array(z.object({ id: z.string(), command: z.array(z.string()), autoStart: z.boolean().default(false) })).default([]),
8
9
  });
9
10
  const shellCommands = new Set(["sh", "bash", "zsh", "fish", "cmd", "powershell", "pwsh"]);
10
11
  const maxCommandArgs = 32;
11
12
  const maxArgumentBytes = 4096;
13
+ const maxToolArgumentsBytes = 64 * 1024;
14
+ const maxToolArgumentDepth = 32;
15
+ const maxResponseBytes = 1024 * 1024;
16
+ const maxInventoryItems = 1000;
17
+ const maxPaginationPages = 100;
18
+ const maxManagedServers = 128;
19
+ const maxStderrBytes = 8192;
12
20
  const requestTimeoutMs = 30_000;
21
+ const maxPanelItems = 20;
22
+ const clientVersion = packageMetadata.version;
23
+ const disposedMessage = "MCP client plugin disposed";
24
+ const connectionParameterNames = new Set(["command", "serverId"]);
25
+ const callParameterNames = new Set(["command", "serverId", "name", "arguments"]);
26
+ const stopParameterNames = new Set(["serverId"]);
27
+ const readResourceParameterNames = new Set(["command", "serverId", "uri"]);
28
+ const noParameterNames = new Set();
29
+ const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
30
+ function decodeFrame(value) {
31
+ try {
32
+ return utf8Decoder.decode(value);
33
+ }
34
+ catch (error) {
35
+ throw new Error("MCP server response must contain valid UTF-8", { cause: error });
36
+ }
37
+ }
38
+ function inspectParameters(value, allowed) {
39
+ if (value === null || typeof value !== "object" || Array.isArray(value))
40
+ throw new Error("MCP parameters must be an object");
41
+ try {
42
+ const prototype = Object.getPrototypeOf(value);
43
+ if (prototype !== Object.prototype && prototype !== null)
44
+ throw new Error("MCP parameters must be a plain object");
45
+ const descriptors = Object.getOwnPropertyDescriptors(value);
46
+ if (Reflect.ownKeys(descriptors).some((key) => typeof key !== "string" || !allowed.has(key)))
47
+ throw new Error("MCP parameters contain an unknown property");
48
+ if (Object.values(descriptors).some((descriptor) => !("value" in descriptor)))
49
+ throw new Error("MCP parameters must use data properties");
50
+ return Object.fromEntries(Object.entries(descriptors).map(([key, descriptor]) => [key, descriptor.value]));
51
+ }
52
+ catch (error) {
53
+ if (error instanceof Error &&
54
+ /^(?:MCP parameters must be a plain object|MCP parameters contain an unknown property|MCP parameters must use data properties)$/u.test(error.message))
55
+ throw error;
56
+ throw new Error("MCP parameters must be an accessible plain object", { cause: error });
57
+ }
58
+ }
59
+ function optionalString(value, field) {
60
+ if (value === undefined)
61
+ return undefined;
62
+ if (typeof value !== "string")
63
+ throw new Error(`MCP ${field} must be a string`);
64
+ return value;
65
+ }
66
+ function requiredString(value, field) {
67
+ const result = optionalString(value, field);
68
+ if (result === undefined)
69
+ throw new Error(`MCP ${field} is required`);
70
+ return result;
71
+ }
72
+ function serverIdValue(value, required = false) {
73
+ const result = optionalString(value, "serverId");
74
+ if (result === undefined) {
75
+ if (required)
76
+ throw new Error("MCP serverId is required");
77
+ return undefined;
78
+ }
79
+ if (!/^[a-z0-9][a-z0-9_-]{0,63}$/iu.test(result))
80
+ throw new Error("MCP serverId must use 1-64 letters, numbers, _ or -");
81
+ return result;
82
+ }
83
+ function boundedInput(value, field, maximum) {
84
+ if (value.includes("\0"))
85
+ throw new Error(`MCP ${field} must not contain NUL characters`);
86
+ if (value.length === 0 || value.length > maximum)
87
+ throw new Error(`MCP ${field} must contain 1-${maximum} characters`);
88
+ return value;
89
+ }
90
+ function rejectAmbiguousTarget(command, serverId) {
91
+ if (command !== undefined && serverId !== undefined)
92
+ throw new Error("Provide either command or serverId, not both");
93
+ }
94
+ function optionalCommand(value) {
95
+ if (value === undefined)
96
+ return undefined;
97
+ if (!Array.isArray(value))
98
+ throw new Error("MCP command must be an array of strings");
99
+ const descriptors = Object.getOwnPropertyDescriptors(value);
100
+ const length = descriptors.length?.value;
101
+ if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0)
102
+ throw new Error("MCP command must be a dense array of string data properties");
103
+ const result = [];
104
+ for (let index = 0; index < length; index += 1) {
105
+ const descriptor = descriptors[String(index)];
106
+ if (descriptor === undefined || !("value" in descriptor) || typeof descriptor.value !== "string")
107
+ throw new Error("MCP command must be a dense array of string data properties");
108
+ result.push(descriptor.value);
109
+ }
110
+ if (Reflect.ownKeys(descriptors).some((key) => typeof key !== "string" || (key !== "length" && !/^(0|[1-9]\d*)$/u.test(key))))
111
+ throw new Error("MCP command contains an unknown property");
112
+ return result;
113
+ }
114
+ function jsonObject(value) {
115
+ if (value === undefined)
116
+ return {};
117
+ if (value === null || typeof value !== "object" || Array.isArray(value))
118
+ throw new Error("MCP arguments must be a JSON object");
119
+ const result = cloneJsonValue(value, new Set(), 0);
120
+ if (Buffer.byteLength(JSON.stringify(result), "utf8") > maxToolArgumentsBytes)
121
+ throw new Error("MCP arguments cannot exceed 64 KiB");
122
+ return result;
123
+ }
124
+ function promptArguments(value) {
125
+ const result = jsonObject(value);
126
+ if (Object.values(result).some((item) => typeof item !== "string"))
127
+ throw new Error("MCP prompt arguments must contain string values");
128
+ return result;
129
+ }
130
+ function cloneJsonValue(value, ancestors, depth) {
131
+ if (value === null || typeof value === "string" || typeof value === "boolean")
132
+ return value;
133
+ if (typeof value === "number") {
134
+ if (!Number.isFinite(value))
135
+ throw new Error("MCP arguments must contain finite JSON numbers");
136
+ return value;
137
+ }
138
+ if (typeof value !== "object")
139
+ throw new Error("MCP arguments must contain only JSON values");
140
+ if (depth > maxToolArgumentDepth)
141
+ throw new Error(`MCP arguments cannot exceed ${maxToolArgumentDepth} levels of nesting`);
142
+ if (ancestors.has(value))
143
+ throw new Error("MCP arguments must not contain circular references");
144
+ ancestors.add(value);
145
+ try {
146
+ const descriptors = Object.getOwnPropertyDescriptors(value);
147
+ if (Object.values(descriptors).some((descriptor) => !("value" in descriptor)))
148
+ throw new Error("MCP arguments must use data properties");
149
+ if (Reflect.ownKeys(descriptors).some((key) => typeof key !== "string"))
150
+ throw new Error("MCP arguments cannot contain symbol properties");
151
+ if (Array.isArray(value)) {
152
+ const length = descriptors.length?.value;
153
+ if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0)
154
+ throw new Error("MCP argument arrays must be dense");
155
+ const result = [];
156
+ for (let index = 0; index < length; index += 1) {
157
+ const descriptor = descriptors[String(index)];
158
+ if (descriptor === undefined || !("value" in descriptor))
159
+ throw new Error("MCP argument arrays must be dense");
160
+ result.push(cloneJsonValue(descriptor.value, ancestors, depth + 1));
161
+ }
162
+ if (Object.keys(descriptors).some((key) => key !== "length" && !/^(0|[1-9]\d*)$/u.test(key)))
163
+ throw new Error("MCP argument arrays contain an unknown property");
164
+ return result;
165
+ }
166
+ const result = {};
167
+ for (const [key, descriptor] of Object.entries(descriptors)) {
168
+ if (descriptor.enumerable !== true)
169
+ continue;
170
+ result[key] = cloneJsonValue(descriptor.value, ancestors, depth + 1);
171
+ }
172
+ return result;
173
+ }
174
+ finally {
175
+ ancestors.delete(value);
176
+ }
177
+ }
178
+ function executionSignal(signal, lifecycle) {
179
+ return signal === undefined ? lifecycle : AbortSignal.any([signal, lifecycle]);
180
+ }
181
+ function clone(value) {
182
+ return structuredClone(value);
183
+ }
184
+ function appendByteTail(current, chunk, maximum) {
185
+ const combined = Buffer.concat([current, chunk]);
186
+ return combined.byteLength <= maximum ? combined : combined.subarray(combined.byteLength - maximum);
187
+ }
188
+ function toolInventory(value) {
189
+ if (!Array.isArray(value))
190
+ throw new Error("MCP server returned an invalid MCP tools inventory");
191
+ if (value.length > maxInventoryItems)
192
+ throw new Error(`MCP remote inventory cannot exceed ${maxInventoryItems} items`);
193
+ return value.map((item) => {
194
+ if (item === null || typeof item !== "object" || Array.isArray(item))
195
+ throw new Error("MCP server returned an invalid MCP tool descriptor");
196
+ const raw = item;
197
+ if (typeof raw.name !== "string" || raw.name.length === 0 || raw.name.length > 512 || raw.name.includes("\0"))
198
+ throw new Error("MCP server returned an invalid MCP tool descriptor");
199
+ if (raw.description !== undefined && (typeof raw.description !== "string" || raw.description.length > 8192))
200
+ throw new Error("MCP server returned an invalid MCP tool descriptor");
201
+ if (raw.inputSchema === null || typeof raw.inputSchema !== "object" || Array.isArray(raw.inputSchema))
202
+ throw new Error("MCP server returned an invalid MCP tool descriptor");
203
+ return {
204
+ name: raw.name,
205
+ ...(raw.description === undefined ? {} : { description: raw.description }),
206
+ inputSchema: clone(raw.inputSchema),
207
+ };
208
+ });
209
+ }
210
+ function resourceInventory(value) {
211
+ if (!Array.isArray(value))
212
+ throw new Error("MCP server returned an invalid MCP resources inventory");
213
+ if (value.length > maxInventoryItems)
214
+ throw new Error(`MCP remote inventory cannot exceed ${maxInventoryItems} items`);
215
+ return value.map((item) => {
216
+ if (item === null || typeof item !== "object" || Array.isArray(item))
217
+ throw new Error("MCP server returned an invalid MCP resource descriptor");
218
+ const raw = item;
219
+ if (typeof raw.uri !== "string" || raw.uri.length === 0 || raw.uri.length > 4096 || raw.uri.includes("\0"))
220
+ throw new Error("MCP server returned an invalid MCP resource descriptor");
221
+ if (typeof raw.name !== "string" || raw.name.length === 0 || raw.name.length > 512 || raw.name.includes("\0"))
222
+ throw new Error("MCP server returned an invalid MCP resource descriptor");
223
+ if (raw.description !== undefined && (typeof raw.description !== "string" || raw.description.length > 8192))
224
+ throw new Error("MCP server returned an invalid MCP resource descriptor");
225
+ if (raw.mimeType !== undefined && (typeof raw.mimeType !== "string" || raw.mimeType.length > 256))
226
+ throw new Error("MCP server returned an invalid MCP resource descriptor");
227
+ return {
228
+ uri: raw.uri,
229
+ name: raw.name,
230
+ ...(raw.description === undefined ? {} : { description: raw.description }),
231
+ ...(raw.mimeType === undefined ? {} : { mimeType: raw.mimeType }),
232
+ };
233
+ });
234
+ }
235
+ function promptInventory(value) {
236
+ if (!Array.isArray(value))
237
+ throw new Error("MCP server returned an invalid MCP prompts inventory");
238
+ if (value.length > maxInventoryItems)
239
+ throw new Error(`MCP remote inventory cannot exceed ${maxInventoryItems} items`);
240
+ return value.map((item) => {
241
+ if (item === null || typeof item !== "object" || Array.isArray(item))
242
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
243
+ const raw = item;
244
+ if (typeof raw.name !== "string" || raw.name.length === 0 || raw.name.length > 512 || raw.name.includes("\0"))
245
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
246
+ if (raw.description !== undefined && (typeof raw.description !== "string" || raw.description.length > 8192))
247
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
248
+ if (raw.arguments !== undefined && !Array.isArray(raw.arguments))
249
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
250
+ if (Array.isArray(raw.arguments) && raw.arguments.length > 128)
251
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
252
+ const argumentsValue = Array.isArray(raw.arguments)
253
+ ? raw.arguments.map((argument) => {
254
+ if (argument === null || typeof argument !== "object" || Array.isArray(argument))
255
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
256
+ const candidate = argument;
257
+ if (typeof candidate.name !== "string" || candidate.name.length === 0 || candidate.name.length > 512)
258
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
259
+ if (candidate.description !== undefined && (typeof candidate.description !== "string" || candidate.description.length > 8192))
260
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
261
+ if (candidate.required !== undefined && typeof candidate.required !== "boolean")
262
+ throw new Error("MCP server returned an invalid MCP prompt descriptor");
263
+ return {
264
+ name: candidate.name,
265
+ ...(candidate.description === undefined ? {} : { description: candidate.description }),
266
+ ...(candidate.required === undefined ? {} : { required: candidate.required }),
267
+ };
268
+ })
269
+ : undefined;
270
+ return {
271
+ name: raw.name,
272
+ ...(raw.description === undefined ? {} : { description: raw.description }),
273
+ ...(argumentsValue === undefined ? {} : { arguments: argumentsValue }),
274
+ };
275
+ });
276
+ }
277
+ function paginationCursor(value) {
278
+ if (value === undefined)
279
+ return undefined;
280
+ if (typeof value !== "string" || value.length === 0 || value.length > 4096 || value.includes("\0"))
281
+ throw new Error("MCP server returned an invalid pagination cursor");
282
+ return value;
283
+ }
284
+ async function paginatedInventory(method, field, requestPage, validate) {
285
+ const result = [];
286
+ const seenCursors = new Set();
287
+ let cursor;
288
+ for (let page = 0; page < maxPaginationPages; page += 1) {
289
+ const response = await requestPage(cursor === undefined ? undefined : { cursor });
290
+ const pageItems = validate(response[field]);
291
+ if (result.length + pageItems.length > maxInventoryItems)
292
+ throw new Error(`MCP remote inventory cannot exceed ${maxInventoryItems} items`);
293
+ result.push(...pageItems);
294
+ const nextCursor = paginationCursor(response.nextCursor);
295
+ if (nextCursor === undefined)
296
+ return result;
297
+ if (seenCursors.has(nextCursor))
298
+ throw new Error(`MCP server repeated a pagination cursor for ${method}`);
299
+ seenCursors.add(nextCursor);
300
+ cursor = nextCursor;
301
+ }
302
+ throw new Error(`MCP ${method} pagination cannot exceed ${maxPaginationPages} pages`);
303
+ }
304
+ function requiredRemoteString(value, message, maximum = maxResponseBytes) {
305
+ if (typeof value !== "string" || value.length > maximum || value.includes("\0"))
306
+ throw new Error(message);
307
+ return value;
308
+ }
309
+ function base64RemoteString(value, message) {
310
+ const result = requiredRemoteString(value, message);
311
+ if (!/^(?:[A-Za-z\d+/]{4})*(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/u.test(result))
312
+ throw new Error(message);
313
+ return result;
314
+ }
315
+ function toolResultContent(result) {
316
+ if (!Array.isArray(result.content) || result.content.length > maxInventoryItems)
317
+ throw new Error("MCP server returned invalid MCP tool result content");
318
+ if (result.isError !== undefined && typeof result.isError !== "boolean")
319
+ throw new Error("MCP server returned invalid MCP tool result content");
320
+ return result.content.map((item) => {
321
+ if (item === null || typeof item !== "object" || Array.isArray(item))
322
+ throw new Error("MCP server returned invalid MCP tool result content");
323
+ const raw = item;
324
+ if (raw.type === "text") {
325
+ return { type: "text", text: requiredRemoteString(raw.text, "MCP server returned invalid MCP tool result content") };
326
+ }
327
+ if (raw.type === "image") {
328
+ const data = base64RemoteString(raw.data, "MCP server returned invalid MCP tool result content");
329
+ const mimeType = requiredRemoteString(raw.mimeType, "MCP server returned invalid MCP tool result content", 256);
330
+ if (!mimeType.startsWith("image/"))
331
+ throw new Error("MCP server returned invalid MCP tool result content");
332
+ return { type: "image", data, mimeType };
333
+ }
334
+ if (raw.type === "audio") {
335
+ const mimeType = requiredRemoteString(raw.mimeType, "MCP server returned invalid MCP tool result content", 256);
336
+ base64RemoteString(raw.data, "MCP server returned invalid MCP tool result content");
337
+ return { type: "text", text: `[MCP audio content omitted: ${mimeType}]` };
338
+ }
339
+ if (raw.type === "resource") {
340
+ if (raw.resource === null || typeof raw.resource !== "object" || Array.isArray(raw.resource))
341
+ throw new Error("MCP server returned invalid MCP tool result content");
342
+ const resource = raw.resource;
343
+ const uri = requiredRemoteString(resource.uri, "MCP server returned invalid MCP tool result content", 4096);
344
+ if (typeof resource.text === "string")
345
+ return { type: "text", text: resource.text };
346
+ if (typeof resource.blob === "string") {
347
+ const blob = base64RemoteString(resource.blob, "MCP server returned invalid MCP tool result content");
348
+ const mimeType = resource.mimeType === undefined ? undefined : requiredRemoteString(resource.mimeType, "MCP server returned invalid MCP tool result content", 256);
349
+ return mimeType?.startsWith("image/") === true
350
+ ? { type: "image", data: blob, mimeType }
351
+ : { type: "text", text: `[MCP binary resource omitted: ${uri} (${mimeType ?? "unknown MIME type"})]` };
352
+ }
353
+ throw new Error("MCP server returned invalid MCP tool result content");
354
+ }
355
+ if (raw.type === "resource_link") {
356
+ const uri = requiredRemoteString(raw.uri, "MCP server returned invalid MCP tool result content", 4096);
357
+ const name = raw.name === undefined ? uri : requiredRemoteString(raw.name, "MCP server returned invalid MCP tool result content", 512);
358
+ return { type: "text", text: `[MCP resource: ${name} — ${uri}]` };
359
+ }
360
+ throw new Error("MCP server returned invalid MCP tool result content");
361
+ });
362
+ }
363
+ function validateInitializeResult(result) {
364
+ if (result.protocolVersion !== "2025-06-18" ||
365
+ result.capabilities === null ||
366
+ typeof result.capabilities !== "object" ||
367
+ Array.isArray(result.capabilities) ||
368
+ result.serverInfo === null ||
369
+ typeof result.serverInfo !== "object" ||
370
+ Array.isArray(result.serverInfo))
371
+ throw new Error("MCP server returned an invalid MCP initialize result");
372
+ const serverInfo = result.serverInfo;
373
+ if (typeof serverInfo.name !== "string" ||
374
+ serverInfo.name.length === 0 ||
375
+ serverInfo.name.length > 512 ||
376
+ typeof serverInfo.version !== "string" ||
377
+ serverInfo.version.length === 0 ||
378
+ serverInfo.version.length > 512 ||
379
+ (result.instructions !== undefined && (typeof result.instructions !== "string" || result.instructions.length > 65_536)))
380
+ throw new Error("MCP server returned an invalid MCP initialize result");
381
+ }
382
+ function resourceResultContent(result) {
383
+ if (!Array.isArray(result.contents) || result.contents.length > maxInventoryItems)
384
+ throw new Error("MCP server returned invalid MCP resource contents");
385
+ return result.contents.map((item) => {
386
+ if (item === null || typeof item !== "object" || Array.isArray(item))
387
+ throw new Error("MCP server returned invalid MCP resource contents");
388
+ const raw = item;
389
+ const uri = requiredRemoteString(raw.uri, "MCP server returned invalid MCP resource contents", 4096);
390
+ if (typeof raw.text === "string")
391
+ return { type: "text", text: raw.text };
392
+ if (typeof raw.blob === "string") {
393
+ const blob = base64RemoteString(raw.blob, "MCP server returned invalid MCP resource contents");
394
+ const mimeType = raw.mimeType === undefined ? undefined : requiredRemoteString(raw.mimeType, "MCP server returned invalid MCP resource contents", 256);
395
+ return mimeType?.startsWith("image/") === true
396
+ ? { type: "image", data: blob, mimeType }
397
+ : { type: "text", text: `[MCP binary resource omitted: ${uri} (${mimeType ?? "unknown MIME type"})]` };
398
+ }
399
+ throw new Error("MCP server returned invalid MCP resource contents");
400
+ });
401
+ }
402
+ function promptResultContent(result) {
403
+ if (result.description !== undefined && (typeof result.description !== "string" || result.description.length > 8192))
404
+ throw new Error("MCP server returned invalid MCP prompt messages");
405
+ if (!Array.isArray(result.messages) || result.messages.length > maxInventoryItems)
406
+ throw new Error("MCP server returned invalid MCP prompt messages");
407
+ return result.messages.flatMap((item) => {
408
+ if (item === null || typeof item !== "object" || Array.isArray(item))
409
+ throw new Error("MCP server returned invalid MCP prompt messages");
410
+ const raw = item;
411
+ const role = raw.role;
412
+ if (role !== "user" && role !== "assistant")
413
+ throw new Error("MCP server returned invalid MCP prompt messages");
414
+ const normalized = toolResultContent({ content: [raw.content] });
415
+ return normalized.flatMap((content) => content.type === "text" ? [{ type: "text", text: `[${role}]\n${content.text}` }] : [{ type: "text", text: `[${role}]` }, content]);
416
+ });
417
+ }
13
418
  function validateCommand(command) {
14
419
  if (command.length === 0)
15
420
  throw new Error("MCP server command cannot be empty");
16
421
  if (command.length > maxCommandArgs)
17
422
  throw new Error(`MCP server command cannot exceed ${maxCommandArgs} arguments`);
423
+ if (command.some((part) => part.includes("\0")))
424
+ throw new Error("MCP server command arguments must not contain NUL characters");
18
425
  if (command.some((part) => part.length === 0 || Buffer.byteLength(part) > maxArgumentBytes))
19
426
  throw new Error("MCP server command contains an invalid argument");
20
- if (shellCommands.has(basename(command[0] ?? "").toLowerCase()))
427
+ const executable = executableName(command)
428
+ .toLowerCase()
429
+ .replace(/\.(?:exe|cmd|bat|com)$/u, "");
430
+ if (shellCommands.has(executable))
21
431
  throw new Error("MCP shell wrappers are not allowed; pass an executable argv directly");
22
432
  }
433
+ function executableName(command) {
434
+ return (command[0] ?? "").replaceAll("\\", "/").split("/").pop() ?? "";
435
+ }
436
+ function serverLabel(command) {
437
+ const count = Math.max(0, command.length - 1);
438
+ return `${executableName(command)}${count === 0 ? "" : ` (+${count} ${count === 1 ? "arg" : "args"})`}`;
439
+ }
23
440
  function encodeMessage(message) {
24
- const payload = Buffer.from(JSON.stringify(message), "utf8");
25
- return Buffer.concat([Buffer.from(`Content-Length: ${payload.byteLength}\r\n\r\n`, "ascii"), payload]);
441
+ return Buffer.from(`${JSON.stringify(message)}\n`, "utf8");
442
+ }
443
+ function waitForChildClose(child, timeoutMs) {
444
+ if (child.exitCode !== null || child.signalCode !== null)
445
+ return Promise.resolve(true);
446
+ return new Promise((resolve) => {
447
+ const onClose = () => finish(true);
448
+ const timer = setTimeout(() => finish(false), timeoutMs);
449
+ timer.unref();
450
+ const finish = (closed) => {
451
+ clearTimeout(timer);
452
+ child.off("close", onClose);
453
+ resolve(closed);
454
+ };
455
+ child.once("close", onClose);
456
+ });
457
+ }
458
+ async function terminateChild(child) {
459
+ if (!child.stdin.destroyed && !child.stdin.writableEnded)
460
+ child.stdin.end();
461
+ if (child.exitCode !== null || child.signalCode !== null)
462
+ return;
463
+ child.kill("SIGTERM");
464
+ if (await waitForChildClose(child, 250))
465
+ return;
466
+ child.kill("SIGKILL");
467
+ await waitForChildClose(child, 500);
26
468
  }
27
469
  function parseFrames(buffer) {
28
470
  const messages = [];
@@ -37,10 +479,12 @@ function parseFrames(buffer) {
37
479
  if (match === null)
38
480
  throw new Error("MCP server returned an invalid Content-Length header");
39
481
  const length = Number(match[1]);
482
+ if (!Number.isSafeInteger(length) || length > maxResponseBytes)
483
+ throw new Error("MCP server response exceeded the 1 MiB limit");
40
484
  const bodyStart = separator + 4;
41
485
  if (rest.length < bodyStart + length)
42
486
  break;
43
- const body = rest.subarray(bodyStart, bodyStart + length).toString("utf8");
487
+ const body = decodeFrame(rest.subarray(bodyStart, bodyStart + length));
44
488
  const message = JSON.parse(body);
45
489
  if (typeof message === "object" && message !== null)
46
490
  messages.push(message);
@@ -50,7 +494,7 @@ function parseFrames(buffer) {
50
494
  const newline = rest.indexOf(10);
51
495
  if (newline < 0)
52
496
  break;
53
- const line = rest.subarray(0, newline).toString("utf8").trim();
497
+ const line = decodeFrame(rest.subarray(0, newline)).trim();
54
498
  rest = rest.subarray(newline + 1);
55
499
  if (line === "")
56
500
  continue;
@@ -65,81 +509,201 @@ function parseFrames(buffer) {
65
509
  }
66
510
  return { messages, rest };
67
511
  }
68
- async function request(child, id, method, params) {
512
+ function cancellationError(method, reason) {
513
+ if (reason instanceof Error && reason.message === disposedMessage)
514
+ return reason;
515
+ return new Error(`MCP request was cancelled: ${method}${reason instanceof Error ? ` (${reason.message})` : ""}`, { cause: reason });
516
+ }
517
+ function withCancellation(operation, signal, method) {
518
+ if (signal === undefined)
519
+ return operation;
520
+ if (signal.aborted)
521
+ return Promise.reject(cancellationError(method, signal.reason));
69
522
  return new Promise((resolve, reject) => {
70
- let buffer = Buffer.alloc(0);
71
- const timer = setTimeout(() => {
72
- cleanup();
73
- reject(new Error(`MCP request timed out: ${method}`));
74
- }, requestTimeoutMs);
75
- const onData = (chunk) => {
76
- buffer = Buffer.concat([buffer, chunk]);
77
- let parsed;
523
+ const onAbort = () => {
524
+ signal.removeEventListener("abort", onAbort);
525
+ reject(cancellationError(method, signal.reason));
526
+ };
527
+ signal.addEventListener("abort", onAbort, { once: true });
528
+ void operation.then((value) => {
529
+ signal.removeEventListener("abort", onAbort);
530
+ resolve(value);
531
+ }, (error) => {
532
+ signal.removeEventListener("abort", onAbort);
533
+ reject(error instanceof Error ? error : new Error("MCP operation failed", { cause: error }));
534
+ });
535
+ });
536
+ }
537
+ const stdioRouters = new WeakMap();
538
+ function responseResult(message) {
539
+ const hasError = Object.hasOwn(message, "error");
540
+ const hasResult = Object.hasOwn(message, "result");
541
+ if (message.jsonrpc !== "2.0" || hasError === hasResult)
542
+ throw new Error("MCP server returned an invalid JSON-RPC response");
543
+ if (hasError) {
544
+ if (typeof message.error !== "object" || message.error === null || Array.isArray(message.error))
545
+ throw new Error("MCP server returned an invalid JSON-RPC response");
546
+ const errorMessage = message.error.message;
547
+ const errorCode = message.error.code;
548
+ if (typeof errorMessage !== "string" || typeof errorCode !== "number" || !Number.isInteger(errorCode))
549
+ throw new Error("MCP server returned an invalid JSON-RPC response");
550
+ throw new Error(errorMessage);
551
+ }
552
+ if (typeof message.result !== "object" || message.result === null || Array.isArray(message.result))
553
+ throw new Error("MCP server returned an invalid response");
554
+ return message.result;
555
+ }
556
+ function stdioRouter(child) {
557
+ const existing = stdioRouters.get(child);
558
+ if (existing !== undefined)
559
+ return existing;
560
+ const router = { buffer: Buffer.alloc(0), pending: new Map() };
561
+ const fail = (error) => {
562
+ if (router.terminalError !== undefined)
563
+ return;
564
+ router.terminalError = error;
565
+ router.buffer = Buffer.alloc(0);
566
+ child.stdout.off("data", onData);
567
+ child.off("error", onError);
568
+ child.off("close", onClose);
569
+ for (const request of [...router.pending.values()])
570
+ request.reject(error);
571
+ };
572
+ const onData = (chunk) => {
573
+ for (const request of [...router.pending.values()]) {
574
+ request.receivedBytes += chunk.byteLength;
575
+ if (request.receivedBytes > maxResponseBytes)
576
+ request.reject(new Error("MCP server response exceeded the 1 MiB limit"));
577
+ }
578
+ if (router.buffer.byteLength + chunk.byteLength > maxResponseBytes) {
579
+ fail(new Error("MCP server response exceeded the 1 MiB limit"));
580
+ return;
581
+ }
582
+ const buffer = router.buffer.byteLength === 0 ? chunk : Buffer.concat([router.buffer, chunk]);
583
+ let parsed;
584
+ try {
585
+ parsed = parseFrames(buffer);
586
+ }
587
+ catch (error) {
588
+ fail(error instanceof Error ? error : new Error("Failed to parse MCP response", { cause: error }));
589
+ return;
590
+ }
591
+ router.buffer = parsed.rest.byteLength === 0 ? Buffer.alloc(0) : Buffer.from(parsed.rest);
592
+ for (const message of parsed.messages) {
593
+ if (typeof message.id !== "number")
594
+ continue;
595
+ const request = router.pending.get(message.id);
596
+ if (request === undefined)
597
+ continue;
78
598
  try {
79
- parsed = parseFrames(buffer);
599
+ request.resolve(responseResult(message));
80
600
  }
81
601
  catch (error) {
82
- cleanup();
83
- reject(error instanceof Error ? error : new Error("Failed to parse MCP response", { cause: error }));
84
- return;
602
+ request.reject(error instanceof Error ? error : new Error("Failed to validate MCP response", { cause: error }));
85
603
  }
86
- buffer = parsed.rest;
87
- for (const message of parsed.messages) {
88
- if (message.id !== id)
89
- continue;
90
- cleanup();
91
- if (typeof message.error === "object" && message.error !== null) {
92
- const errorMessage = message.error.message;
93
- reject(new Error(typeof errorMessage === "string" ? errorMessage : "MCP request failed"));
94
- }
95
- else if (typeof message.result === "object" && message.result !== null)
96
- resolve(message.result);
97
- else
98
- reject(new Error("MCP server returned an invalid response"));
604
+ }
605
+ };
606
+ const onError = (error) => fail(error);
607
+ const onClose = (code) => fail(new Error(`MCP server exited before responding${code === null ? "" : ` (code ${code})`}`));
608
+ child.stdout.on("data", onData);
609
+ child.once("error", onError);
610
+ child.once("close", onClose);
611
+ stdioRouters.set(child, router);
612
+ return router;
613
+ }
614
+ async function request(child, id, method, params, signal) {
615
+ if (signal?.aborted === true)
616
+ throw cancellationError(method, signal.reason);
617
+ return new Promise((resolve, reject) => {
618
+ const router = stdioRouter(child);
619
+ if (router.terminalError !== undefined) {
620
+ reject(router.terminalError);
621
+ return;
622
+ }
623
+ if (router.pending.has(id)) {
624
+ reject(new Error(`MCP request id is already pending: ${id}`));
625
+ return;
626
+ }
627
+ let settled = false;
628
+ let sent = false;
629
+ const sendCancellation = (reason) => {
630
+ if (!sent || method === "initialize" || child.stdin.destroyed || child.stdin.writableEnded)
99
631
  return;
632
+ try {
633
+ child.stdin.write(encodeMessage({ jsonrpc: "2.0", method: "notifications/cancelled", params: { requestId: id, reason } }), () => undefined);
634
+ }
635
+ catch {
636
+ // The original timeout or cancellation remains the actionable error.
100
637
  }
101
638
  };
102
- const onError = (error) => {
103
- cleanup();
104
- reject(error);
105
- };
106
- const onClose = (code) => {
107
- cleanup();
108
- reject(new Error(`MCP server exited before responding${code === null ? "" : ` (code ${code})`}`));
639
+ const timer = setTimeout(() => {
640
+ sendCancellation(`MCP request timed out: ${method}`);
641
+ rejectRequest(new Error(`MCP request timed out: ${method}`));
642
+ }, requestTimeoutMs);
643
+ timer.unref();
644
+ const onAbort = () => {
645
+ sendCancellation(signal?.reason instanceof Error ? signal.reason.message : "MCP client request cancelled");
646
+ rejectRequest(cancellationError(method, signal?.reason));
109
647
  };
110
648
  const cleanup = () => {
111
649
  clearTimeout(timer);
112
- child.stdout.off("data", onData);
113
- child.off("error", onError);
114
- child.off("close", onClose);
650
+ router.pending.delete(id);
651
+ signal?.removeEventListener("abort", onAbort);
115
652
  };
116
- child.stdout.on("data", onData);
117
- child.once("error", onError);
118
- child.once("close", onClose);
119
- child.stdin.write(encodeMessage({ jsonrpc: "2.0", id, method, ...(params === undefined ? {} : { params }) }));
653
+ const resolveRequest = (value) => {
654
+ if (settled)
655
+ return;
656
+ settled = true;
657
+ cleanup();
658
+ resolve(value);
659
+ };
660
+ const rejectRequest = (error) => {
661
+ if (settled)
662
+ return;
663
+ settled = true;
664
+ cleanup();
665
+ reject(error);
666
+ };
667
+ router.pending.set(id, { receivedBytes: 0, resolve: resolveRequest, reject: rejectRequest });
668
+ signal?.addEventListener("abort", onAbort, { once: true });
669
+ try {
670
+ child.stdin.write(encodeMessage({ jsonrpc: "2.0", id, method, ...(params === undefined ? {} : { params }) }), (error) => {
671
+ if (error === null || error === undefined)
672
+ return;
673
+ rejectRequest(error);
674
+ });
675
+ sent = true;
676
+ }
677
+ catch (error) {
678
+ rejectRequest(error instanceof Error ? error : new Error("Failed to write MCP request", { cause: error }));
679
+ }
120
680
  });
121
681
  }
122
- async function withServer(command, cwd, callback) {
682
+ async function withServer(command, cwd, callback, signal) {
123
683
  validateCommand(command);
684
+ if (signal?.aborted === true)
685
+ throw cancellationError("initialize", signal.reason);
124
686
  const child = spawn(command[0], command.slice(1), { cwd, shell: false, stdio: ["pipe", "pipe", "pipe"] });
125
- let stderr = "";
126
- child.stderr.setEncoding("utf8");
687
+ let stderr = Buffer.alloc(0);
127
688
  child.stderr.on("data", (chunk) => {
128
- stderr = `${stderr}${chunk}`.slice(-8_000);
689
+ stderr = appendByteTail(stderr, chunk, maxStderrBytes);
129
690
  });
130
691
  try {
131
- await request(child, 1, "initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "pi-harness", version: "0.1.2" } });
692
+ const initializeResult = await request(child, 1, "initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "pi-harness", version: clientVersion } }, signal);
693
+ validateInitializeResult(initializeResult);
132
694
  child.stdin.write(encodeMessage({ jsonrpc: "2.0", method: "notifications/initialized" }));
133
695
  return await callback(child);
134
696
  }
135
697
  catch (error) {
136
- if (error instanceof Error && stderr.trim() !== "")
137
- throw new Error(`${error.message}: ${stderr.trim()}`, { cause: error });
698
+ if (error instanceof Error && error.message === disposedMessage)
699
+ throw error;
700
+ const stderrText = stderr.toString("utf8").trim();
701
+ if (error instanceof Error && stderrText !== "")
702
+ throw new Error(`${error.message}: ${stderrText}`, { cause: error });
138
703
  throw error;
139
704
  }
140
705
  finally {
141
- child.stdin.end();
142
- child.kill();
706
+ await terminateChild(child);
143
707
  }
144
708
  }
145
709
  export default {
@@ -147,28 +711,70 @@ export default {
147
711
  inject: ["piHarnessLaunch", "piPluginUi", "piTools"],
148
712
  Config,
149
713
  async apply(context, config) {
714
+ assertKnownConfigKeys("pi-mcp-client", config, ["servers"]);
715
+ const lifecycle = new AbortController();
150
716
  let latest;
717
+ let latestKey;
718
+ const previousFor = (key) => (latestKey === key ? latest : undefined);
719
+ const publishLatest = (key, value) => {
720
+ latestKey = key;
721
+ latest = clone(value);
722
+ return clone(value);
723
+ };
151
724
  const servers = new Map();
725
+ const startingServers = new Set();
726
+ const unregisters = [];
727
+ const registerTool = (definition) => {
728
+ try {
729
+ const unregister = context.piTools.register(definition);
730
+ unregisters.push(unregister);
731
+ return unregister;
732
+ }
733
+ catch (error) {
734
+ for (const unregister of unregisters.splice(0).reverse())
735
+ unregister();
736
+ lifecycle.abort(new Error("MCP client plugin activation failed", { cause: error }));
737
+ throw error;
738
+ }
739
+ };
152
740
  const configured = new Map();
153
- for (const definition of config.servers ?? []) {
154
- if (definition.id.trim() === "")
155
- throw new Error("Configured MCP server id cannot be empty");
156
- if (configured.has(definition.id))
157
- throw new Error(`Configured MCP server id is duplicated: ${definition.id}`);
741
+ const definitions = config.servers ?? [];
742
+ if (definitions.length > maxManagedServers)
743
+ throw new Error(`MCP configured inventory cannot exceed ${maxManagedServers} servers`);
744
+ for (const definition of definitions) {
745
+ const id = serverIdValue(definition.id, true);
746
+ if (configured.has(id))
747
+ throw new Error(`Configured MCP server id is duplicated: ${id}`);
158
748
  validateCommand(definition.command);
159
- configured.set(definition.id, { id: definition.id, command: [...definition.command], autoStart: definition.autoStart === true });
749
+ configured.set(id, { id, command: [...definition.command], autoStart: definition.autoStart === true });
160
750
  }
161
751
  let nextServerId = 1;
162
- const startServer = async (command, requestedId) => {
752
+ const startServer = async (command, requestedId, signal) => {
163
753
  validateCommand(command);
164
- const id = requestedId ?? `mcp-${nextServerId++}`;
754
+ let id = requestedId;
755
+ if (id === undefined) {
756
+ do
757
+ id = `mcp-${nextServerId++}`;
758
+ while (configured.has(id) || servers.has(id) || startingServers.has(id));
759
+ }
165
760
  if (servers.has(id))
166
761
  throw new Error(`MCP server is already running: ${id}`);
167
- const child = spawn(command[0], command.slice(1), { cwd: context.piHarnessLaunch.cwd, shell: false, stdio: ["pipe", "pipe", "pipe"] });
168
- let stderr = "";
169
- child.stderr.setEncoding("utf8");
762
+ if (startingServers.has(id))
763
+ throw new Error(`MCP server is already starting: ${id}`);
764
+ if (servers.size + startingServers.size >= maxManagedServers)
765
+ throw new Error(`MCP client cannot manage more than ${maxManagedServers} running servers`);
766
+ startingServers.add(id);
767
+ let child;
768
+ try {
769
+ child = spawn(command[0], command.slice(1), { cwd: context.piHarnessLaunch.cwd, shell: false, stdio: ["pipe", "pipe", "pipe"] });
770
+ }
771
+ catch (error) {
772
+ startingServers.delete(id);
773
+ throw error;
774
+ }
775
+ let stderr = Buffer.alloc(0);
170
776
  child.stderr.on("data", (chunk) => {
171
- stderr = `${stderr}${chunk}`.slice(-8_000);
777
+ stderr = appendByteTail(stderr, chunk, maxStderrBytes);
172
778
  });
173
779
  const server = {
174
780
  id,
@@ -178,42 +784,57 @@ export default {
178
784
  nextRequestId: 2,
179
785
  queue: Promise.resolve(),
180
786
  startedAt: Date.now(),
787
+ lifecycle: new AbortController(),
181
788
  };
182
789
  child.once("close", () => {
183
790
  server.status = "stopping";
791
+ server.lifecycle.abort(new Error(`MCP server exited: ${server.id}`));
184
792
  servers.delete(server.id);
185
793
  });
186
794
  try {
187
- await request(child, 1, "initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "pi-harness", version: "0.1.2" } });
188
- child.stdin.write(encodeMessage({ jsonrpc: "2.0", method: "notifications/initialized" }));
795
+ const initializeResult = await request(child, 1, "initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "pi-harness", version: clientVersion } }, signal);
796
+ validateInitializeResult(initializeResult);
797
+ if (child.exitCode !== null || child.signalCode !== null)
798
+ throw new Error(`MCP server exited during initialization: ${id}`);
189
799
  servers.set(server.id, server);
800
+ child.stdin.write(encodeMessage({ jsonrpc: "2.0", method: "notifications/initialized" }));
190
801
  return server;
191
802
  }
192
803
  catch (error) {
193
- child.stdin.end();
194
- child.kill();
195
- if (error instanceof Error && stderr.trim() !== "")
196
- throw new Error(`${error.message}: ${stderr.trim()}`, { cause: error });
804
+ servers.delete(server.id);
805
+ await terminateChild(child);
806
+ if (error instanceof Error && error.message === disposedMessage)
807
+ throw error;
808
+ const stderrText = stderr.toString("utf8").trim();
809
+ if (error instanceof Error && stderrText !== "")
810
+ throw new Error(`${error.message}: ${stderrText}`, { cause: error });
197
811
  throw error;
198
812
  }
813
+ finally {
814
+ startingServers.delete(id);
815
+ }
199
816
  };
200
- const stopServer = async (serverId) => {
817
+ const stopServer = (serverId, signal) => {
201
818
  const server = servers.get(serverId);
202
819
  if (server === undefined)
203
820
  throw new Error(`MCP server is not running: ${serverId}`);
204
821
  server.status = "stopping";
205
- await server.queue;
206
- servers.delete(server.id);
207
- server.child.stdin.end();
208
- server.child.kill();
209
- return true;
822
+ server.lifecycle.abort(new Error(`MCP server stopped: ${server.id}`));
823
+ const operation = (async () => {
824
+ await server.queue;
825
+ servers.delete(server.id);
826
+ await terminateChild(server.child);
827
+ return true;
828
+ })();
829
+ return withCancellation(operation, signal, "server/stop");
210
830
  };
211
- const requestManaged = (server, method, params) => {
831
+ const requestManaged = (server, method, params, signal) => {
212
832
  if (server.status !== "running")
213
833
  throw new Error(`MCP server is not running: ${server.id}`);
214
- const task = server.queue.then(() => request(server.child, server.nextRequestId++, method, params));
834
+ const requestSignal = signal === undefined ? server.lifecycle.signal : AbortSignal.any([signal, server.lifecycle.signal]);
835
+ const task = server.queue.then(() => request(server.child, server.nextRequestId++, method, params, requestSignal));
215
836
  server.queue = task.then(() => undefined, () => undefined);
216
- return task;
837
+ return withCancellation(task, requestSignal, method);
217
838
  };
218
839
  const getServer = (serverId) => {
219
840
  const server = servers.get(serverId);
@@ -227,99 +848,165 @@ export default {
227
848
  throw new Error(`Configured MCP server is not found: ${serverId}`);
228
849
  return [...definition.command];
229
850
  };
230
- const list = async (command, serverId) => {
851
+ const statusSnapshot = () => {
852
+ const running = [...servers.values()].map((server) => ({
853
+ id: server.id,
854
+ executable: executableName(server.command),
855
+ argumentCount: Math.max(0, server.command.length - 1),
856
+ status: server.status,
857
+ startedAt: server.startedAt,
858
+ }));
859
+ const active = new Set(running.map((server) => server.id));
860
+ return [
861
+ ...running,
862
+ ...[...configured.values()]
863
+ .filter((definition) => !active.has(definition.id))
864
+ .map((definition) => ({
865
+ id: definition.id,
866
+ executable: executableName(definition.command),
867
+ argumentCount: Math.max(0, definition.command.length - 1),
868
+ status: "stopped",
869
+ startedAt: 0,
870
+ })),
871
+ ];
872
+ };
873
+ const list = async (command, serverId, signal) => {
874
+ rejectAmbiguousTarget(command, serverId);
231
875
  if (serverId !== undefined) {
232
876
  const managed = getServer(serverId);
233
- const result = await requestManaged(managed, "tools/list");
234
- const tools = Array.isArray(result.tools)
235
- ? result.tools.filter((tool) => typeof tool === "object" && tool !== null && typeof tool.name === "string")
236
- : [];
237
- latest = { server: managed.command.join(" "), tools, resources: latest?.resources ?? [], prompts: latest?.prompts ?? [] };
238
- return latest;
877
+ const tools = await paginatedInventory("tools/list", "tools", (params) => requestManaged(managed, "tools/list", params, signal), toolInventory);
878
+ const key = `managed:${managed.id}`;
879
+ const server = serverLabel(managed.command);
880
+ const previous = previousFor(key);
881
+ const next = { server, tools, resources: previous?.resources ?? [], prompts: previous?.prompts ?? [] };
882
+ return publishLatest(key, next);
239
883
  }
240
884
  if (command === undefined)
241
885
  throw new Error("Provide command or serverId to list MCP tools");
242
886
  return withServer(command, context.piHarnessLaunch.cwd, async (child) => {
243
- const result = await request(child, 2, "tools/list");
244
- const tools = Array.isArray(result.tools)
245
- ? result.tools.filter((tool) => typeof tool === "object" && tool !== null && typeof tool.name === "string")
246
- : [];
247
- latest = { server: command.join(" "), tools, resources: latest?.resources ?? [], prompts: latest?.prompts ?? [] };
248
- return latest;
249
- });
887
+ let requestId = 2;
888
+ const tools = await paginatedInventory("tools/list", "tools", (params) => request(child, requestId++, "tools/list", params, signal), toolInventory);
889
+ const key = `command:${JSON.stringify(command)}`;
890
+ const server = serverLabel(command);
891
+ const previous = previousFor(key);
892
+ const next = { server, tools, resources: previous?.resources ?? [], prompts: previous?.prompts ?? [] };
893
+ return publishLatest(key, next);
894
+ }, signal);
250
895
  };
251
- const call = async (command, serverId, name, args) => {
896
+ const call = async (command, serverId, name, args, signal) => {
897
+ rejectAmbiguousTarget(command, serverId);
898
+ boundedInput(name, "tool name", 512);
252
899
  if (serverId !== undefined) {
253
900
  const managed = getServer(serverId);
254
- const result = (await requestManaged(managed, "tools/call", { name, arguments: args }));
255
- latest = {
256
- server: managed.command.join(" "),
257
- tools: latest?.tools ?? [],
258
- resources: latest?.resources ?? [],
259
- prompts: latest?.prompts ?? [],
901
+ const result = (await requestManaged(managed, "tools/call", { name, arguments: args }, signal));
902
+ toolResultContent(result);
903
+ const key = `managed:${managed.id}`;
904
+ const server = serverLabel(managed.command);
905
+ const previous = previousFor(key);
906
+ publishLatest(key, {
907
+ server,
908
+ tools: previous?.tools ?? [],
909
+ resources: previous?.resources ?? [],
910
+ prompts: previous?.prompts ?? [],
260
911
  lastCall: name,
261
- };
912
+ });
262
913
  return result;
263
914
  }
264
915
  if (command === undefined)
265
916
  throw new Error("Provide command or serverId to call an MCP tool");
266
917
  return withServer(command, context.piHarnessLaunch.cwd, async (child) => {
267
- const result = (await request(child, 2, "tools/call", { name, arguments: args }));
268
- latest = { server: command.join(" "), tools: latest?.tools ?? [], resources: latest?.resources ?? [], prompts: latest?.prompts ?? [], lastCall: name };
918
+ const result = (await request(child, 2, "tools/call", { name, arguments: args }, signal));
919
+ toolResultContent(result);
920
+ const key = `command:${JSON.stringify(command)}`;
921
+ const server = serverLabel(command);
922
+ const previous = previousFor(key);
923
+ publishLatest(key, {
924
+ server,
925
+ tools: previous?.tools ?? [],
926
+ resources: previous?.resources ?? [],
927
+ prompts: previous?.prompts ?? [],
928
+ lastCall: name,
929
+ });
269
930
  return result;
270
- });
931
+ }, signal);
271
932
  };
272
- const requestOneShot = async (command, method, params) => withServer(command, context.piHarnessLaunch.cwd, async (child) => request(child, 2, method, params));
933
+ const requestOneShot = async (command, method, params, signal) => withServer(command, context.piHarnessLaunch.cwd, async (child) => request(child, 2, method, params, signal), signal);
273
934
  const requireCommand = (command, message) => {
274
935
  if (command === undefined)
275
936
  throw new Error(message);
276
937
  return command;
277
938
  };
278
- const resources = async (command, serverId) => {
279
- const result = serverId === undefined
280
- ? await requestOneShot(requireCommand(command, "Provide command or serverId to list MCP resources"), "resources/list")
281
- : await requestManaged(getServer(serverId), "resources/list");
282
- const items = Array.isArray(result.resources)
283
- ? result.resources.filter((item) => typeof item === "object" && item !== null && typeof item.uri === "string")
284
- : [];
285
- latest = {
286
- server: serverId === undefined ? (command ?? []).join(" ") : getServer(serverId).command.join(" "),
287
- tools: latest?.tools ?? [],
939
+ const resources = async (command, serverId, signal) => {
940
+ rejectAmbiguousTarget(command, serverId);
941
+ let items;
942
+ let selectedCommand;
943
+ if (serverId === undefined) {
944
+ selectedCommand = requireCommand(command, "Provide command or serverId to list MCP resources");
945
+ items = await withServer(selectedCommand, context.piHarnessLaunch.cwd, async (child) => {
946
+ let requestId = 2;
947
+ return paginatedInventory("resources/list", "resources", (params) => request(child, requestId++, "resources/list", params, signal), resourceInventory);
948
+ }, signal);
949
+ }
950
+ else {
951
+ const managed = getServer(serverId);
952
+ selectedCommand = managed.command;
953
+ items = await paginatedInventory("resources/list", "resources", (params) => requestManaged(managed, "resources/list", params, signal), resourceInventory);
954
+ }
955
+ const key = serverId === undefined ? `command:${JSON.stringify(selectedCommand)}` : `managed:${serverId}`;
956
+ const server = serverLabel(selectedCommand);
957
+ const previous = previousFor(key);
958
+ const next = {
959
+ server,
960
+ tools: previous?.tools ?? [],
288
961
  resources: items,
289
- prompts: latest?.prompts ?? [],
962
+ prompts: previous?.prompts ?? [],
290
963
  };
291
- return items;
964
+ publishLatest(key, next);
965
+ return clone(items);
292
966
  };
293
- const readResource = async (command, serverId, uri) => {
294
- if (uri.length === 0 || uri.length > 4096)
295
- throw new Error("MCP resource URI must be between 1 and 4096 characters");
967
+ const readResource = async (command, serverId, uri, signal) => {
968
+ rejectAmbiguousTarget(command, serverId);
969
+ boundedInput(uri, "resource URI", 4096);
296
970
  return serverId === undefined
297
- ? requestOneShot(requireCommand(command, "Provide command or serverId to read an MCP resource"), "resources/read", { uri })
298
- : requestManaged(getServer(serverId), "resources/read", { uri });
971
+ ? requestOneShot(requireCommand(command, "Provide command or serverId to read an MCP resource"), "resources/read", { uri }, signal)
972
+ : requestManaged(getServer(serverId), "resources/read", { uri }, signal);
299
973
  };
300
- const prompts = async (command, serverId) => {
301
- const result = serverId === undefined
302
- ? await requestOneShot(requireCommand(command, "Provide command or serverId to list MCP prompts"), "prompts/list")
303
- : await requestManaged(getServer(serverId), "prompts/list");
304
- const items = Array.isArray(result.prompts)
305
- ? result.prompts.filter((item) => typeof item === "object" && item !== null && typeof item.name === "string")
306
- : [];
307
- latest = {
308
- server: serverId === undefined ? (command ?? []).join(" ") : getServer(serverId).command.join(" "),
309
- tools: latest?.tools ?? [],
310
- resources: latest?.resources ?? [],
974
+ const prompts = async (command, serverId, signal) => {
975
+ rejectAmbiguousTarget(command, serverId);
976
+ let items;
977
+ let selectedCommand;
978
+ if (serverId === undefined) {
979
+ selectedCommand = requireCommand(command, "Provide command or serverId to list MCP prompts");
980
+ items = await withServer(selectedCommand, context.piHarnessLaunch.cwd, async (child) => {
981
+ let requestId = 2;
982
+ return paginatedInventory("prompts/list", "prompts", (params) => request(child, requestId++, "prompts/list", params, signal), promptInventory);
983
+ }, signal);
984
+ }
985
+ else {
986
+ const managed = getServer(serverId);
987
+ selectedCommand = managed.command;
988
+ items = await paginatedInventory("prompts/list", "prompts", (params) => requestManaged(managed, "prompts/list", params, signal), promptInventory);
989
+ }
990
+ const key = serverId === undefined ? `command:${JSON.stringify(selectedCommand)}` : `managed:${serverId}`;
991
+ const server = serverLabel(selectedCommand);
992
+ const previous = previousFor(key);
993
+ const next = {
994
+ server,
995
+ tools: previous?.tools ?? [],
996
+ resources: previous?.resources ?? [],
311
997
  prompts: items,
312
998
  };
313
- return items;
999
+ publishLatest(key, next);
1000
+ return clone(items);
314
1001
  };
315
- const getPrompt = async (command, serverId, name, args) => {
316
- if (name.length === 0 || name.length > 512)
317
- throw new Error("MCP prompt name must be between 1 and 512 characters");
1002
+ const getPrompt = async (command, serverId, name, args, signal) => {
1003
+ rejectAmbiguousTarget(command, serverId);
1004
+ boundedInput(name, "prompt name", 512);
318
1005
  return serverId === undefined
319
- ? requestOneShot(requireCommand(command, "Provide command or serverId to get an MCP prompt"), "prompts/get", { name, arguments: args })
320
- : requestManaged(getServer(serverId), "prompts/get", { name, arguments: args });
1006
+ ? requestOneShot(requireCommand(command, "Provide command or serverId to get an MCP prompt"), "prompts/get", { name, arguments: args }, signal)
1007
+ : requestManaged(getServer(serverId), "prompts/get", { name, arguments: args }, signal);
321
1008
  };
322
- const unregisterList = context.piTools.register(defineTool({
1009
+ const unregisterList = registerTool(defineTool({
323
1010
  name: "mcp_list_tools",
324
1011
  label: "MCP list tools",
325
1012
  description: "Start an MCP stdio server and list its available tools.",
@@ -327,9 +1014,13 @@ export default {
327
1014
  parameters: Type.Object({
328
1015
  command: Type.Optional(Type.Array(Type.String(), { description: "MCP server executable and arguments; shell wrappers are rejected" })),
329
1016
  serverId: Type.Optional(Type.String({ description: "A configured or running MCP server id" })),
330
- }),
331
- async execute(_toolCallId, params) {
332
- const result = await list(params.command, params.serverId);
1017
+ }, { additionalProperties: false }),
1018
+ executionMode: "sequential",
1019
+ async execute(_toolCallId, params, signal) {
1020
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1021
+ operationSignal.throwIfAborted();
1022
+ const raw = inspectParameters(params, connectionParameterNames);
1023
+ const result = await list(optionalCommand(raw.command), serverIdValue(raw.serverId), operationSignal);
333
1024
  return {
334
1025
  content: [
335
1026
  { type: "text", text: result.tools.map((tool) => `${tool.name}: ${tool.description ?? ""}`).join("\n") || "MCP server returned no tools." },
@@ -338,7 +1029,7 @@ export default {
338
1029
  };
339
1030
  },
340
1031
  }));
341
- const unregisterCall = context.piTools.register(defineTool({
1032
+ const unregisterCall = registerTool(defineTool({
342
1033
  name: "mcp_call",
343
1034
  label: "MCP call tool",
344
1035
  description: "Call a named tool on an MCP stdio server with a JSON object of arguments.",
@@ -348,14 +1039,17 @@ export default {
348
1039
  serverId: Type.Optional(Type.String()),
349
1040
  name: Type.String(),
350
1041
  arguments: Type.Optional(Type.Record(Type.String(), Type.Any())),
351
- }),
352
- async execute(_toolCallId, params) {
353
- const result = await call(params.command, params.serverId, params.name, params.arguments ?? {});
354
- const content = Array.isArray(result.content) ? result.content : [{ type: "text", text: JSON.stringify(result) }];
355
- return { content: content, details: result };
1042
+ }, { additionalProperties: false }),
1043
+ executionMode: "sequential",
1044
+ async execute(_toolCallId, params, signal) {
1045
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1046
+ operationSignal.throwIfAborted();
1047
+ const raw = inspectParameters(params, callParameterNames);
1048
+ const result = await call(optionalCommand(raw.command), serverIdValue(raw.serverId), requiredString(raw.name, "tool name"), jsonObject(raw.arguments), operationSignal);
1049
+ return { content: toolResultContent(result), details: clone(result) };
356
1050
  },
357
1051
  }));
358
- const unregisterStart = context.piTools.register(defineTool({
1052
+ const unregisterStart = registerTool(defineTool({
359
1053
  name: "mcp_server_start",
360
1054
  label: "MCP server start",
361
1055
  description: "Start and initialize a persistent MCP stdio server managed by Pi Harness.",
@@ -363,103 +1057,120 @@ export default {
363
1057
  parameters: Type.Object({
364
1058
  command: Type.Optional(Type.Array(Type.String(), { description: "MCP server executable and arguments; shell wrappers are rejected" })),
365
1059
  serverId: Type.Optional(Type.String({ description: "Configured server id or a running server id" })),
366
- }),
367
- async execute(_toolCallId, params) {
368
- const command = params.command ?? (params.serverId === undefined ? undefined : configuredCommand(params.serverId));
1060
+ }, { additionalProperties: false }),
1061
+ executionMode: "sequential",
1062
+ async execute(_toolCallId, params, signal) {
1063
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1064
+ operationSignal.throwIfAborted();
1065
+ const raw = inspectParameters(params, connectionParameterNames);
1066
+ const serverId = serverIdValue(raw.serverId);
1067
+ const command = optionalCommand(raw.command) ?? (serverId === undefined ? undefined : configuredCommand(serverId));
369
1068
  if (command === undefined)
370
1069
  throw new Error("Provide command or configured serverId to start an MCP server");
371
- const server = await startServer(command, params.serverId);
1070
+ const server = await startServer(command, serverId, operationSignal);
372
1071
  return {
373
1072
  content: [{ type: "text", text: `MCP server ${server.id} is running.` }],
374
- details: { serverId: server.id, command: server.command, status: server.status },
1073
+ details: { serverId: server.id, command: [...server.command], status: server.status },
375
1074
  };
376
1075
  },
377
1076
  }));
378
- const unregisterStatus = context.piTools.register(defineTool({
1077
+ const unregisterStatus = registerTool(defineTool({
379
1078
  name: "mcp_server_status",
380
1079
  label: "MCP server status",
381
1080
  description: "List persistent MCP stdio servers managed by Pi Harness.",
382
1081
  promptSnippet: "inspect running MCP server status",
383
- parameters: Type.Object({}),
384
- execute() {
385
- const running = [...servers.values()].map((server) => ({
386
- id: server.id,
387
- command: server.command,
388
- status: server.status,
389
- startedAt: server.startedAt,
390
- }));
391
- const active = new Set(running.map((server) => server.id));
392
- const snapshot = [
393
- ...running,
394
- ...[...configured.values()]
395
- .filter((definition) => !active.has(definition.id))
396
- .map((definition) => ({ id: definition.id, command: definition.command, status: "stopped", startedAt: 0 })),
397
- ];
398
- return Promise.resolve({
399
- content: [
400
- {
401
- type: "text",
402
- text: snapshot.length === 0
403
- ? "No MCP servers are running."
404
- : snapshot.map((server) => `${server.id}: ${server.status} (${server.command.join(" ")})`).join("\n"),
405
- },
406
- ],
407
- details: { servers: snapshot },
1082
+ parameters: Type.Object({}, { additionalProperties: false }),
1083
+ executionMode: "sequential",
1084
+ execute(_toolCallId, params, signal) {
1085
+ return Promise.resolve().then(() => {
1086
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1087
+ operationSignal.throwIfAborted();
1088
+ inspectParameters(params, noParameterNames);
1089
+ const snapshot = statusSnapshot();
1090
+ return {
1091
+ content: [
1092
+ {
1093
+ type: "text",
1094
+ text: snapshot.length === 0
1095
+ ? "No MCP servers are running."
1096
+ : snapshot
1097
+ .map((server) => `${server.id}: ${server.status} (${server.executable}, ${server.argumentCount} argument${server.argumentCount === 1 ? "" : "s"})`)
1098
+ .join("\n"),
1099
+ },
1100
+ ],
1101
+ details: { servers: snapshot },
1102
+ };
408
1103
  });
409
1104
  },
410
1105
  }));
411
- const unregisterStop = context.piTools.register(defineTool({
1106
+ const unregisterStop = registerTool(defineTool({
412
1107
  name: "mcp_server_stop",
413
1108
  label: "MCP server stop",
414
1109
  description: "Stop a persistent MCP stdio server and remove it from the managed set.",
415
1110
  promptSnippet: "stop a persistent MCP stdio server",
416
- parameters: Type.Object({ serverId: Type.String() }),
417
- async execute(_toolCallId, params) {
418
- const stopped = await stopServer(params.serverId);
419
- return { content: [{ type: "text", text: `MCP server ${params.serverId} stopped.` }], details: { serverId: params.serverId, stopped } };
1111
+ parameters: Type.Object({ serverId: Type.String() }, { additionalProperties: false }),
1112
+ executionMode: "sequential",
1113
+ async execute(_toolCallId, params, signal) {
1114
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1115
+ operationSignal.throwIfAborted();
1116
+ const raw = inspectParameters(params, stopParameterNames);
1117
+ const serverId = serverIdValue(raw.serverId, true);
1118
+ const stopped = await stopServer(serverId, operationSignal);
1119
+ return { content: [{ type: "text", text: `MCP server ${serverId} stopped.` }], details: { serverId, stopped } };
420
1120
  },
421
1121
  }));
422
- const unregisterListResources = context.piTools.register(defineTool({
1122
+ const unregisterListResources = registerTool(defineTool({
423
1123
  name: "mcp_list_resources",
424
1124
  label: "MCP list resources",
425
1125
  description: "List resources exposed by an MCP server.",
426
1126
  promptSnippet: "list resources exposed by an MCP server",
427
- parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()) }),
428
- async execute(_toolCallId, params) {
429
- const items = await resources(params.command, params.serverId);
1127
+ parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()) }, { additionalProperties: false }),
1128
+ executionMode: "sequential",
1129
+ async execute(_toolCallId, params, signal) {
1130
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1131
+ operationSignal.throwIfAborted();
1132
+ const raw = inspectParameters(params, connectionParameterNames);
1133
+ const items = await resources(optionalCommand(raw.command), serverIdValue(raw.serverId), operationSignal);
430
1134
  return {
431
1135
  content: [{ type: "text", text: items.map((item) => `${item.uri} ${item.name ?? ""}`).join("\n") || "MCP server returned no resources." }],
432
1136
  details: { resources: items },
433
1137
  };
434
1138
  },
435
1139
  }));
436
- const unregisterReadResource = context.piTools.register(defineTool({
1140
+ const unregisterReadResource = registerTool(defineTool({
437
1141
  name: "mcp_read_resource",
438
1142
  label: "MCP read resource",
439
1143
  description: "Read one resource exposed by an MCP server.",
440
1144
  promptSnippet: "read a resource exposed by an MCP server",
441
- parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()), uri: Type.String() }),
442
- async execute(_toolCallId, params) {
443
- const result = await readResource(params.command, params.serverId, params.uri);
444
- const contents = Array.isArray(result.contents) ? result.contents : [{ type: "text", text: JSON.stringify(result) }];
445
- return { content: contents, details: result };
1145
+ parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()), uri: Type.String() }, { additionalProperties: false }),
1146
+ executionMode: "sequential",
1147
+ async execute(_toolCallId, params, signal) {
1148
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1149
+ operationSignal.throwIfAborted();
1150
+ const raw = inspectParameters(params, readResourceParameterNames);
1151
+ const result = await readResource(optionalCommand(raw.command), serverIdValue(raw.serverId), requiredString(raw.uri, "resource URI"), operationSignal);
1152
+ return { content: resourceResultContent(result), details: clone(result) };
446
1153
  },
447
1154
  }));
448
- const unregisterListPrompts = context.piTools.register(defineTool({
1155
+ const unregisterListPrompts = registerTool(defineTool({
449
1156
  name: "mcp_list_prompts",
450
1157
  label: "MCP list prompts",
451
1158
  description: "List prompt templates exposed by an MCP server.",
452
1159
  promptSnippet: "list prompt templates exposed by an MCP server",
453
- parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()) }),
454
- async execute(_toolCallId, params) {
455
- const items = await prompts(params.command, params.serverId);
1160
+ parameters: Type.Object({ command: Type.Optional(Type.Array(Type.String())), serverId: Type.Optional(Type.String()) }, { additionalProperties: false }),
1161
+ executionMode: "sequential",
1162
+ async execute(_toolCallId, params, signal) {
1163
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1164
+ operationSignal.throwIfAborted();
1165
+ const raw = inspectParameters(params, connectionParameterNames);
1166
+ const items = await prompts(optionalCommand(raw.command), serverIdValue(raw.serverId), operationSignal);
456
1167
  return {
457
1168
  content: [{ type: "text", text: items.map((item) => `${item.name}: ${item.description ?? ""}`).join("\n") || "MCP server returned no prompts." }],
458
1169
  details: { prompts: items },
459
1170
  };
460
1171
  },
461
1172
  }));
462
- const unregisterGetPrompt = context.piTools.register(defineTool({
1173
+ const unregisterGetPrompt = registerTool(defineTool({
463
1174
  name: "mcp_get_prompt",
464
1175
  label: "MCP get prompt",
465
1176
  description: "Render a prompt template exposed by an MCP server.",
@@ -468,18 +1179,21 @@ export default {
468
1179
  command: Type.Optional(Type.Array(Type.String())),
469
1180
  serverId: Type.Optional(Type.String()),
470
1181
  name: Type.String(),
471
- arguments: Type.Optional(Type.Record(Type.String(), Type.Any())),
472
- }),
473
- async execute(_toolCallId, params) {
474
- const result = await getPrompt(params.command, params.serverId, params.name, params.arguments ?? {});
475
- const content = Array.isArray(result.messages) ? result.messages : [{ type: "text", text: JSON.stringify(result) }];
476
- return { content: content, details: result };
1182
+ arguments: Type.Optional(Type.Record(Type.String(), Type.String())),
1183
+ }, { additionalProperties: false }),
1184
+ executionMode: "sequential",
1185
+ async execute(_toolCallId, params, signal) {
1186
+ const operationSignal = executionSignal(signal, lifecycle.signal);
1187
+ operationSignal.throwIfAborted();
1188
+ const raw = inspectParameters(params, callParameterNames);
1189
+ const result = await getPrompt(optionalCommand(raw.command), serverIdValue(raw.serverId), requiredString(raw.name, "prompt name"), promptArguments(raw.arguments), operationSignal);
1190
+ return { content: promptResultContent(result), details: clone(result) };
477
1191
  },
478
1192
  }));
479
1193
  const serverSnapshot = () => {
480
1194
  const running = [...servers.values()].map((server) => ({
481
1195
  id: server.id,
482
- command: [...server.command],
1196
+ command: [executableName(server.command)],
483
1197
  status: server.status,
484
1198
  startedAt: server.startedAt,
485
1199
  }));
@@ -488,26 +1202,65 @@ export default {
488
1202
  ...running,
489
1203
  ...[...configured.values()]
490
1204
  .filter((definition) => !active.has(definition.id))
491
- .map((definition) => ({ id: definition.id, command: [...definition.command], status: "stopped", startedAt: 0 })),
1205
+ .map((definition) => ({ id: definition.id, command: [executableName(definition.command)], status: "stopped", startedAt: 0 })),
492
1206
  ];
493
1207
  };
494
1208
  context.provide("piMcp", { snapshot: () => ({ servers: serverSnapshot() }) });
495
- const disposePanel = context.piPluginUi.register({
496
- id: "mcp-client-panel",
497
- pluginId: "@pi-harness/core/plugins/mcp-client",
498
- title: "MCP Client",
499
- description: "通过 stdio JSON-RPC 连接外部 MCP 工具服务器。",
500
- icon: "",
501
- read: () => ({
502
- server: latest?.server ?? null,
503
- tools: latest?.tools ?? [],
504
- resources: latest?.resources ?? [],
505
- prompts: latest?.prompts ?? [],
506
- lastCall: latest?.lastCall ?? null,
507
- servers: serverSnapshot(),
508
- }),
509
- });
510
- context.effect(() => () => {
1209
+ let disposePanel;
1210
+ try {
1211
+ disposePanel = context.piPluginUi.register({
1212
+ id: "mcp-client-panel",
1213
+ pluginId: "@pi-harness/core/plugins/mcp-client",
1214
+ title: "MCP Client",
1215
+ description: "通过 stdio JSON-RPC 连接外部 MCP 工具服务器。",
1216
+ icon: "⌘",
1217
+ read: () => {
1218
+ const tools = latest?.tools ?? [];
1219
+ const resources = latest?.resources ?? [];
1220
+ const prompts = latest?.prompts ?? [];
1221
+ const serverStatuses = statusSnapshot();
1222
+ return clone({
1223
+ server: latest?.server ?? null,
1224
+ tools: tools.slice(0, maxPanelItems),
1225
+ resources: resources.slice(0, maxPanelItems),
1226
+ prompts: prompts.slice(0, maxPanelItems),
1227
+ lastCall: latest?.lastCall ?? null,
1228
+ servers: serverStatuses.slice(0, maxPanelItems),
1229
+ inventory: {
1230
+ tools: { total: tools.length, shown: Math.min(tools.length, maxPanelItems), truncated: tools.length > maxPanelItems },
1231
+ resources: { total: resources.length, shown: Math.min(resources.length, maxPanelItems), truncated: resources.length > maxPanelItems },
1232
+ prompts: { total: prompts.length, shown: Math.min(prompts.length, maxPanelItems), truncated: prompts.length > maxPanelItems },
1233
+ servers: {
1234
+ total: serverStatuses.length,
1235
+ shown: Math.min(serverStatuses.length, maxPanelItems),
1236
+ truncated: serverStatuses.length > maxPanelItems,
1237
+ },
1238
+ },
1239
+ limits: {
1240
+ responseBytes: maxResponseBytes,
1241
+ commandArgs: maxCommandArgs,
1242
+ argumentBytes: maxArgumentBytes,
1243
+ toolArgumentsBytes: maxToolArgumentsBytes,
1244
+ toolArgumentDepth: maxToolArgumentDepth,
1245
+ requestTimeoutMs,
1246
+ panelItems: maxPanelItems,
1247
+ inventoryItems: maxInventoryItems,
1248
+ paginationPages: maxPaginationPages,
1249
+ stderrBytes: maxStderrBytes,
1250
+ managedServers: maxManagedServers,
1251
+ },
1252
+ });
1253
+ },
1254
+ });
1255
+ }
1256
+ catch (error) {
1257
+ for (const unregister of unregisters.splice(0).reverse())
1258
+ unregister();
1259
+ lifecycle.abort(new Error("MCP client plugin activation failed", { cause: error }));
1260
+ throw error;
1261
+ }
1262
+ context.effect(() => async () => {
1263
+ lifecycle.abort(new Error(disposedMessage));
511
1264
  unregisterList();
512
1265
  unregisterCall();
513
1266
  unregisterStart();
@@ -517,17 +1270,18 @@ export default {
517
1270
  unregisterReadResource();
518
1271
  unregisterListPrompts();
519
1272
  unregisterGetPrompt();
520
- for (const server of servers.values()) {
1273
+ const running = [...servers.values()];
1274
+ for (const server of running) {
521
1275
  server.status = "stopping";
522
- server.child.stdin.end();
523
- server.child.kill();
1276
+ server.lifecycle.abort(new Error(disposedMessage));
524
1277
  }
525
1278
  servers.clear();
526
1279
  disposePanel();
1280
+ await Promise.all(running.map(async (server) => terminateChild(server.child)));
527
1281
  });
528
1282
  for (const definition of configured.values()) {
529
1283
  if (definition.autoStart === true)
530
- await startServer(definition.command, definition.id);
1284
+ await startServer(definition.command, definition.id, lifecycle.signal);
531
1285
  }
532
1286
  },
533
1287
  };