@geminilight/mindos 0.6.52 → 0.6.54

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 (529) hide show
  1. package/README.md +27 -5
  2. package/README_zh.md +27 -5
  3. package/_standalone/.mindos-build-version +1 -1
  4. package/_standalone/.next/BUILD_ID +1 -1
  5. package/_standalone/.next/app-path-routes-manifest.json +17 -14
  6. package/_standalone/.next/build-manifest.json +3 -3
  7. package/_standalone/.next/cache/.previewinfo +1 -1
  8. package/_standalone/.next/cache/.rscinfo +1 -1
  9. package/_standalone/.next/cache/config.json +3 -3
  10. package/_standalone/.next/prerender-manifest.json +3 -3
  11. package/_standalone/.next/react-loadable-manifest.json +18 -2
  12. package/_standalone/.next/routes-manifest.json +18 -0
  13. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  14. package/_standalone/.next/server/app/_global-error/page.js +1 -1
  15. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  16. package/_standalone/.next/server/app/_global-error.html +2 -2
  17. package/_standalone/.next/server/app/_global-error.rsc +2 -2
  18. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  19. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  20. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  21. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  22. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  23. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  24. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  25. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  26. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  27. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  28. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  29. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  30. package/_standalone/.next/server/app/agents/page.js +3 -3
  31. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  32. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  33. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  37. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  39. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  40. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  41. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  42. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  43. package/_standalone/.next/server/app/api/ask/route.js +44 -16
  44. package/_standalone/.next/server/app/api/ask/route.js.nft.json +1 -1
  45. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  46. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  47. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  48. package/_standalone/.next/server/app/api/backlinks/route.js.nft.json +1 -1
  49. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/bootstrap/route.js.nft.json +1 -1
  51. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  52. package/_standalone/.next/server/app/api/changes/route.js.nft.json +1 -1
  53. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  54. package/_standalone/.next/server/app/api/export/route.js +2 -2
  55. package/_standalone/.next/server/app/api/export/route.js.nft.json +1 -1
  56. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  58. package/_standalone/.next/server/app/api/file/import/route.js.nft.json +1 -1
  59. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/file/raw/route.js +1 -0
  61. package/_standalone/.next/server/app/api/file/raw/route.js.nft.json +1 -0
  62. package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -0
  63. package/_standalone/.next/server/app/api/file/route.js +1 -1
  64. package/_standalone/.next/server/app/api/file/route.js.nft.json +1 -1
  65. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  66. package/_standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  67. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  68. package/_standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  69. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  70. package/_standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
  71. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  72. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/inbox/route.js +1 -1
  74. package/_standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
  75. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/init/route.js.nft.json +1 -1
  77. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/mcp/agents/route.js.nft.json +1 -1
  79. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  81. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/api/mcp/status/route.js +1 -1
  84. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  85. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  86. package/_standalone/.next/server/app/api/monitoring/route.js.nft.json +1 -1
  87. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  88. package/_standalone/.next/server/app/api/recent-files/route.js.nft.json +1 -1
  89. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  90. package/_standalone/.next/server/app/api/restart/route.js +1 -1
  91. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  92. package/_standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  93. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  94. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  95. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  96. package/_standalone/.next/server/app/api/settings/route.js +1 -1
  97. package/_standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
  98. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  99. package/_standalone/.next/server/app/api/settings/test-key/route.js +1 -1
  100. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  101. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  102. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  103. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  104. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  105. package/_standalone/.next/server/app/api/setup/route.js +1 -1
  106. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  107. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  108. package/_standalone/.next/server/app/api/sync/route.js +1 -1
  109. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  110. package/_standalone/.next/server/app/api/tree-version/route.js.nft.json +1 -1
  111. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  112. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  113. package/_standalone/.next/server/app/api/update/route.js +1 -1
  114. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  115. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  116. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  117. package/_standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
  118. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  119. package/_standalone/.next/server/app/changes/page.js +2 -2
  120. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  121. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  122. package/_standalone/.next/server/app/echo/[segment]/page.js +3 -3
  123. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  124. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  125. package/_standalone/.next/server/app/echo/page.js +1 -1
  126. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  127. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  128. package/_standalone/.next/server/app/explore/page.js +2 -2
  129. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  130. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  131. package/_standalone/.next/server/app/help/page.js +2 -2
  132. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  133. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  134. package/_standalone/.next/server/app/inbox/history/page.js +2 -0
  135. package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -0
  136. package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -0
  137. package/_standalone/.next/server/app/login/page.js +2 -2
  138. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  139. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  140. package/_standalone/.next/server/app/page.js +3 -3
  141. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  142. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  143. package/_standalone/.next/server/app/setup/page.js +2 -2
  144. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  145. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  146. package/_standalone/.next/server/app/trash/page.js +3 -3
  147. package/_standalone/.next/server/app/trash/page.js.nft.json +1 -1
  148. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  149. package/_standalone/.next/server/app/view/[...path]/page.js +3 -3
  150. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  151. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  152. package/_standalone/.next/server/app/wiki/page.js +2 -0
  153. package/_standalone/.next/server/app/wiki/page.js.nft.json +1 -0
  154. package/_standalone/.next/server/app/wiki/page_client-reference-manifest.js +1 -0
  155. package/_standalone/.next/server/app-paths-manifest.json +17 -14
  156. package/_standalone/.next/server/chunks/2190.js +2 -2
  157. package/_standalone/.next/server/chunks/2364.js +2 -0
  158. package/_standalone/.next/server/chunks/357.js +1 -0
  159. package/_standalone/.next/server/chunks/530.js +219 -0
  160. package/_standalone/.next/server/chunks/6054.js +52 -0
  161. package/_standalone/.next/server/chunks/6539.js +1 -1
  162. package/_standalone/.next/server/chunks/8388.js +2 -2
  163. package/_standalone/.next/server/chunks/953.js +4 -4
  164. package/_standalone/.next/server/middleware-build-manifest.js +1 -1
  165. package/_standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  166. package/_standalone/.next/server/next-font-manifest.js +1 -1
  167. package/_standalone/.next/server/next-font-manifest.json +1 -1
  168. package/_standalone/.next/server/pages/500.html +2 -2
  169. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  170. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  171. package/_standalone/.next/static/2hrwFOLEOZhHQHfrIt-Dw/_buildManifest.js +1 -0
  172. package/_standalone/.next/static/chunks/1053-2874859f7caefa0f.js +29 -0
  173. package/_standalone/.next/static/chunks/178-105779afb62d36d9.js +1 -0
  174. package/_standalone/.next/static/chunks/1814.b08e9fb85dd3b13c.js +1 -0
  175. package/_standalone/.next/static/chunks/{1880-3ec02adc80531825.js → 1880-7abf971bcfd2389b.js} +2 -2
  176. package/_standalone/.next/static/chunks/{3160-83a7e0b94414b3ac.js → 2218-d54538000574ffef.js} +1 -1
  177. package/_standalone/.next/static/chunks/254-32719a9bea2e74f0.js +1 -0
  178. package/_standalone/.next/static/chunks/362.a77be2f206db7b19.js +1 -0
  179. package/_standalone/.next/static/chunks/4237-ffc6e7c15d4007b6.js +1 -0
  180. package/_standalone/.next/static/chunks/7035-2af69391c7b1ad95.js +1 -0
  181. package/_standalone/.next/static/chunks/7322-d67d05067544864c.js +1 -0
  182. package/_standalone/.next/static/chunks/{6926-4af497b83952fa87.js → 8409-de5726a4a278d28f.js} +1 -1
  183. package/_standalone/.next/static/chunks/8753-ea9db680b0f70f25.js +1 -0
  184. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/{route-b07a5983e85bc5e3.js → route-e240db6d5049d336.js} +1 -1
  185. package/_standalone/.next/static/chunks/app/_global-error/{page-b07a5983e85bc5e3.js → page-e240db6d5049d336.js} +1 -1
  186. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-f006a70f6889eb56.js +1 -0
  187. package/_standalone/.next/static/chunks/app/agents/page-bd522e428e3acb78.js +5 -0
  188. package/_standalone/.next/static/chunks/app/api/a2a/agents/{route-b07a5983e85bc5e3.js → route-e240db6d5049d336.js} +1 -1
  189. package/_standalone/.next/static/chunks/app/api/a2a/delegations/{route-b07a5983e85bc5e3.js → route-e240db6d5049d336.js} +1 -1
  190. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-e240db6d5049d336.js +1 -0
  191. package/_standalone/.next/static/chunks/app/api/a2a/route-e240db6d5049d336.js +1 -0
  192. package/_standalone/.next/static/chunks/app/api/acp/config/route-e240db6d5049d336.js +1 -0
  193. package/_standalone/.next/static/chunks/app/api/acp/detect/route-e240db6d5049d336.js +1 -0
  194. package/_standalone/.next/static/chunks/app/api/acp/install/route-e240db6d5049d336.js +1 -0
  195. package/_standalone/.next/static/chunks/app/api/acp/registry/route-e240db6d5049d336.js +1 -0
  196. package/_standalone/.next/static/chunks/app/api/acp/session/route-e240db6d5049d336.js +1 -0
  197. package/_standalone/.next/static/chunks/app/api/agent-activity/route-e240db6d5049d336.js +1 -0
  198. package/_standalone/.next/static/chunks/app/api/ask/route-e240db6d5049d336.js +1 -0
  199. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-e240db6d5049d336.js +1 -0
  200. package/_standalone/.next/static/chunks/app/api/auth/route-e240db6d5049d336.js +1 -0
  201. package/_standalone/.next/static/chunks/app/api/backlinks/route-e240db6d5049d336.js +1 -0
  202. package/_standalone/.next/static/chunks/app/api/bootstrap/route-e240db6d5049d336.js +1 -0
  203. package/_standalone/.next/static/chunks/app/api/changes/route-e240db6d5049d336.js +1 -0
  204. package/_standalone/.next/static/chunks/app/api/export/route-e240db6d5049d336.js +1 -0
  205. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-e240db6d5049d336.js +1 -0
  206. package/_standalone/.next/static/chunks/app/api/file/import/route-e240db6d5049d336.js +1 -0
  207. package/_standalone/.next/static/chunks/app/api/file/raw/route-e240db6d5049d336.js +1 -0
  208. package/_standalone/.next/static/chunks/app/api/file/route-e240db6d5049d336.js +1 -0
  209. package/_standalone/.next/static/chunks/app/api/files/route-e240db6d5049d336.js +1 -0
  210. package/_standalone/.next/static/chunks/app/api/git/route-e240db6d5049d336.js +1 -0
  211. package/_standalone/.next/static/chunks/app/api/graph/route-e240db6d5049d336.js +1 -0
  212. package/_standalone/.next/static/chunks/app/api/health/route-e240db6d5049d336.js +1 -0
  213. package/_standalone/.next/static/chunks/app/api/inbox/route-e240db6d5049d336.js +1 -0
  214. package/_standalone/.next/static/chunks/app/api/init/route-e240db6d5049d336.js +1 -0
  215. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-e240db6d5049d336.js +1 -0
  216. package/_standalone/.next/static/chunks/app/api/mcp/install/route-e240db6d5049d336.js +1 -0
  217. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-e240db6d5049d336.js +1 -0
  218. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-e240db6d5049d336.js +1 -0
  219. package/_standalone/.next/static/chunks/app/api/mcp/status/route-e240db6d5049d336.js +1 -0
  220. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-e240db6d5049d336.js +1 -0
  221. package/_standalone/.next/static/chunks/app/api/monitoring/route-e240db6d5049d336.js +1 -0
  222. package/_standalone/.next/static/chunks/app/api/recent-files/route-e240db6d5049d336.js +1 -0
  223. package/_standalone/.next/static/chunks/app/api/restart/route-e240db6d5049d336.js +1 -0
  224. package/_standalone/.next/static/chunks/app/api/search/route-e240db6d5049d336.js +1 -0
  225. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-e240db6d5049d336.js +1 -0
  226. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-e240db6d5049d336.js +1 -0
  227. package/_standalone/.next/static/chunks/app/api/settings/route-e240db6d5049d336.js +1 -0
  228. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-e240db6d5049d336.js +1 -0
  229. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-e240db6d5049d336.js +1 -0
  230. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-e240db6d5049d336.js +1 -0
  231. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-e240db6d5049d336.js +1 -0
  232. package/_standalone/.next/static/chunks/app/api/setup/ls/route-e240db6d5049d336.js +1 -0
  233. package/_standalone/.next/static/chunks/app/api/setup/route-e240db6d5049d336.js +1 -0
  234. package/_standalone/.next/static/chunks/app/api/skills/route-e240db6d5049d336.js +1 -0
  235. package/_standalone/.next/static/chunks/app/api/sync/route-e240db6d5049d336.js +1 -0
  236. package/_standalone/.next/static/chunks/app/api/tree-version/route-e240db6d5049d336.js +1 -0
  237. package/_standalone/.next/static/chunks/app/api/uninstall/route-e240db6d5049d336.js +1 -0
  238. package/_standalone/.next/static/chunks/app/api/update/route-e240db6d5049d336.js +1 -0
  239. package/_standalone/.next/static/chunks/app/api/update-check/route-e240db6d5049d336.js +1 -0
  240. package/_standalone/.next/static/chunks/app/api/update-status/route-e240db6d5049d336.js +1 -0
  241. package/_standalone/.next/static/chunks/app/api/workflows/route-e240db6d5049d336.js +1 -0
  242. package/_standalone/.next/static/chunks/app/changes/page-5a72144d1080a699.js +1 -0
  243. package/_standalone/.next/static/chunks/app/echo/[segment]/{page-88df174dd64b2c76.js → page-6710da1f581b2854.js} +2 -2
  244. package/_standalone/.next/static/chunks/app/echo/page-e240db6d5049d336.js +1 -0
  245. package/_standalone/.next/static/chunks/app/explore/{page-5eb2835e9e3ab4bb.js → page-d3d99308146c2240.js} +1 -1
  246. package/_standalone/.next/static/chunks/app/global-error-c37d50db6128ec01.js +1 -0
  247. package/_standalone/.next/static/chunks/app/help/page-222df603080b5fab.js +1 -0
  248. package/_standalone/.next/static/chunks/app/inbox/history/page-07819cf95cb0805f.js +1 -0
  249. package/_standalone/.next/static/chunks/app/layout-8eacff5813458190.js +186 -0
  250. package/_standalone/.next/static/chunks/app/loading-e240db6d5049d336.js +1 -0
  251. package/_standalone/.next/static/chunks/app/login/{page-24236460fa7c11d0.js → page-0eeef685052869a6.js} +1 -1
  252. package/_standalone/.next/static/chunks/app/page-5a6c9455efe8a0df.js +7 -0
  253. package/_standalone/.next/static/chunks/app/setup/{page-99f40e9337388cda.js → page-9a81fa4d82c6351b.js} +1 -1
  254. package/_standalone/.next/static/chunks/app/trash/page-72d0ae3649ac4b6c.js +1 -0
  255. package/_standalone/.next/static/chunks/app/view/[...path]/loading-e240db6d5049d336.js +1 -0
  256. package/_standalone/.next/static/chunks/app/view/[...path]/not-found-fc04c2bd4f35bc6f.js +1 -0
  257. package/_standalone/.next/static/chunks/app/view/[...path]/page-e8699f96589c0979.js +12 -0
  258. package/_standalone/.next/static/chunks/app/wiki/page-d492256a93f0b8bc.js +1 -0
  259. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-e240db6d5049d336.js +1 -0
  260. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-e240db6d5049d336.js +1 -0
  261. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-e240db6d5049d336.js +1 -0
  262. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-e240db6d5049d336.js +1 -0
  263. package/_standalone/.next/static/chunks/{webpack-bbd44cbc83dc0aa4.js → webpack-73c9da80c6c1ebfe.js} +1 -1
  264. package/_standalone/.next/static/css/66f8a81e4eda06d4.css +1 -0
  265. package/_standalone/.next/static/css/a4a2b71142b311af.css +31 -0
  266. package/_standalone/.next/trace +64 -64
  267. package/_standalone/.next/types/routes.d.ts +5 -2
  268. package/_standalone/.next/types/validator.ts +27 -0
  269. package/_standalone/__tests__/agents/agents-content-dashboard.test.tsx +1 -0
  270. package/_standalone/__tests__/agents/agents-content-model.test.ts +13 -0
  271. package/_standalone/__tests__/core/inbox.test.ts +168 -0
  272. package/_standalone/__tests__/core/sync.test.ts +37 -0
  273. package/_standalone/__tests__/panels/agents-panel-hub.test.tsx +1 -0
  274. package/_standalone/app/globals.css +29 -3
  275. package/_standalone/components/ActivityBar.tsx +9 -9
  276. package/_standalone/components/AskFab.tsx +1 -1
  277. package/_standalone/components/Backlinks.tsx +1 -1
  278. package/_standalone/components/Breadcrumb.tsx +1 -1
  279. package/_standalone/components/CreateSpaceModal.tsx +1 -1
  280. package/_standalone/components/EchoSpotlight.tsx +14 -10
  281. package/_standalone/components/Editor.tsx +1 -1
  282. package/_standalone/components/ExportModal.tsx +3 -3
  283. package/_standalone/components/FileTree.tsx +6 -11
  284. package/_standalone/components/GuideCard.tsx +1 -1
  285. package/_standalone/components/ImportModal.tsx +1 -2
  286. package/_standalone/components/KeyboardShortcuts.tsx +1 -1
  287. package/_standalone/components/MarkdownEditor.tsx +1 -1
  288. package/_standalone/components/OnboardingView.tsx +2 -2
  289. package/_standalone/components/OrganizeToast.tsx +3 -1
  290. package/_standalone/components/Panel.tsx +27 -6
  291. package/_standalone/components/Sidebar.tsx +1 -1
  292. package/_standalone/components/SidebarLayout.tsx +30 -7
  293. package/_standalone/components/SystemPulse.tsx +16 -16
  294. package/_standalone/components/agents/AgentsOverviewSection.tsx +18 -92
  295. package/_standalone/components/agents/AgentsPanelA2aTab.tsx +67 -66
  296. package/_standalone/components/agents/AgentsPrimitives.tsx +1 -1
  297. package/_standalone/components/agents/RecentActivityFeed.tsx +6 -6
  298. package/_standalone/components/agents/SkillDetailPopover.tsx +1 -1
  299. package/_standalone/components/ask/AskHeader.tsx +1 -1
  300. package/_standalone/components/echo/EchoHero.tsx +1 -1
  301. package/_standalone/components/echo/EchoPageSections.tsx +1 -1
  302. package/_standalone/components/explore/UseCaseCard.tsx +1 -1
  303. package/_standalone/components/home/InboxSection.tsx +262 -54
  304. package/_standalone/components/panels/AgentsPanel.tsx +4 -3
  305. package/_standalone/components/panels/AgentsPanelAgentDetail.tsx +1 -1
  306. package/_standalone/components/panels/AgentsPanelHubNav.tsx +10 -6
  307. package/_standalone/components/panels/PanelHeader.tsx +1 -1
  308. package/_standalone/components/renderers/audio/AudioRenderer.tsx +79 -0
  309. package/_standalone/components/renderers/image/ImageRenderer.tsx +203 -0
  310. package/_standalone/components/renderers/pdf/PdfRenderer.tsx +57 -0
  311. package/_standalone/components/renderers/video/VideoRenderer.tsx +91 -0
  312. package/_standalone/components/settings/McpTab.tsx +154 -28
  313. package/_standalone/components/settings/PluginsTab.tsx +1 -1
  314. package/_standalone/components/settings/SettingsContent.tsx +41 -7
  315. package/_standalone/components/settings/types.ts +7 -1
  316. package/_standalone/components/walkthrough/WalkthroughOverlay.tsx +40 -11
  317. package/_standalone/components/walkthrough/WalkthroughTooltip.tsx +1 -1
  318. package/_standalone/hooks/useAiOrganize.ts +14 -1
  319. package/_standalone/lib/organize-history.ts +6 -0
  320. package/_standalone/lib/stores/walkthrough-store.ts +33 -1
  321. package/_standalone/tsconfig.tsbuildinfo +1 -1
  322. package/app/app/api/ask/route.ts +193 -3
  323. package/app/app/api/file/raw/route.ts +121 -0
  324. package/app/app/api/file/route.ts +21 -0
  325. package/app/app/api/inbox/route.ts +38 -2
  326. package/app/app/api/mcp/status/route.ts +1 -0
  327. package/app/app/api/restart/route.ts +26 -21
  328. package/app/app/api/settings/route.ts +13 -0
  329. package/app/app/api/setup/route.ts +11 -1
  330. package/app/app/api/sync/route.ts +36 -13
  331. package/app/app/api/update/route.ts +24 -10
  332. package/app/app/global-error.tsx +3 -3
  333. package/app/app/globals.css +29 -3
  334. package/app/app/inbox/history/page.tsx +250 -0
  335. package/app/app/layout.tsx +5 -11
  336. package/app/app/login/page.tsx +1 -1
  337. package/app/app/view/[...path]/ViewPageClient.tsx +15 -10
  338. package/app/app/view/[...path]/not-found.tsx +1 -1
  339. package/app/app/view/[...path]/page.tsx +32 -1
  340. package/app/app/wiki/page.tsx +58 -0
  341. package/app/components/ActivityBar.tsx +9 -9
  342. package/app/components/AskFab.tsx +1 -1
  343. package/app/components/Backlinks.tsx +1 -1
  344. package/app/components/Breadcrumb.tsx +1 -1
  345. package/app/components/CreateSpaceModal.tsx +1 -1
  346. package/app/components/DirView.tsx +2 -2
  347. package/app/components/EchoSpotlight.tsx +14 -10
  348. package/app/components/Editor.tsx +1 -1
  349. package/app/components/ExportModal.tsx +3 -3
  350. package/app/components/FileTree.tsx +6 -11
  351. package/app/components/GuideCard.tsx +1 -1
  352. package/app/components/HomeContent.tsx +50 -39
  353. package/app/components/ImportModal.tsx +1 -2
  354. package/app/components/KeyboardShortcuts.tsx +1 -1
  355. package/app/components/MarkdownEditor.tsx +1 -1
  356. package/app/components/OnboardingView.tsx +2 -2
  357. package/app/components/OrganizeToast.tsx +3 -1
  358. package/app/components/Panel.tsx +27 -6
  359. package/app/components/Sidebar.tsx +1 -1
  360. package/app/components/SidebarLayout.tsx +30 -7
  361. package/app/components/SystemPulse.tsx +16 -16
  362. package/app/components/TrashPageClient.tsx +8 -6
  363. package/app/components/UpdateOverlay.tsx +1 -1
  364. package/app/components/WikiHomeContent.tsx +273 -0
  365. package/app/components/agents/AgentDetailContent.tsx +5 -5
  366. package/app/components/agents/AgentsContentPage.tsx +14 -3
  367. package/app/components/agents/AgentsOverviewSection.tsx +18 -92
  368. package/app/components/agents/AgentsPanelA2aTab.tsx +67 -66
  369. package/app/components/agents/AgentsPrimitives.tsx +1 -1
  370. package/app/components/agents/RecentActivityFeed.tsx +6 -6
  371. package/app/components/agents/SkillDetailPopover.tsx +1 -1
  372. package/app/components/agents/agents-content-model.ts +4 -1
  373. package/app/components/ask/AskHeader.tsx +1 -1
  374. package/app/components/changes/ChangesContentPage.tsx +10 -6
  375. package/app/components/echo/EchoHero.tsx +1 -1
  376. package/app/components/echo/EchoPageSections.tsx +1 -1
  377. package/app/components/explore/ExploreContent.tsx +1 -1
  378. package/app/components/explore/UseCaseCard.tsx +1 -1
  379. package/app/components/help/HelpContent.tsx +3 -3
  380. package/app/components/home/InboxSection.tsx +262 -54
  381. package/app/components/panels/AgentsPanel.tsx +4 -3
  382. package/app/components/panels/AgentsPanelAgentDetail.tsx +1 -1
  383. package/app/components/panels/AgentsPanelHubNav.tsx +10 -6
  384. package/app/components/panels/PanelHeader.tsx +1 -1
  385. package/app/components/renderers/audio/AudioRenderer.tsx +79 -0
  386. package/app/components/renderers/audio/manifest.ts +17 -0
  387. package/app/components/renderers/image/ImageRenderer.tsx +203 -0
  388. package/app/components/renderers/image/manifest.ts +17 -0
  389. package/app/components/renderers/pdf/PdfRenderer.tsx +57 -0
  390. package/app/components/renderers/pdf/manifest.ts +15 -0
  391. package/app/components/renderers/video/VideoRenderer.tsx +91 -0
  392. package/app/components/renderers/video/manifest.ts +17 -0
  393. package/app/components/settings/McpTab.tsx +154 -28
  394. package/app/components/settings/PluginsTab.tsx +1 -1
  395. package/app/components/settings/SettingsContent.tsx +41 -7
  396. package/app/components/settings/types.ts +7 -1
  397. package/app/components/setup/index.tsx +4 -3
  398. package/app/components/walkthrough/WalkthroughOverlay.tsx +40 -11
  399. package/app/components/walkthrough/WalkthroughTooltip.tsx +1 -1
  400. package/app/hooks/useAiOrganize.ts +14 -1
  401. package/app/lib/agent/model.ts +2 -1
  402. package/app/lib/core/inbox.ts +131 -2
  403. package/app/lib/core/pdf-text.ts +28 -0
  404. package/app/lib/core/search-index.ts +29 -5
  405. package/app/lib/core/tree.ts +6 -1
  406. package/app/lib/fs.ts +31 -3
  407. package/app/lib/i18n/modules/ai-chat.ts +42 -0
  408. package/app/lib/i18n/modules/knowledge.ts +30 -0
  409. package/app/lib/i18n/modules/navigation.ts +4 -2
  410. package/app/lib/i18n/modules/panels.ts +22 -4
  411. package/app/lib/i18n/modules/settings.ts +26 -0
  412. package/app/lib/organize-history.ts +6 -0
  413. package/app/lib/renderers/index.ts +5 -1
  414. package/app/lib/settings.ts +60 -0
  415. package/app/lib/stores/walkthrough-store.ts +33 -1
  416. package/bin/commands/doctor.js +12 -6
  417. package/bin/commands/file.js +7 -4
  418. package/bin/commands/logs.js +39 -4
  419. package/bin/commands/onboard.js +1 -1
  420. package/bin/commands/open.js +6 -1
  421. package/bin/commands/space.js +7 -4
  422. package/bin/commands/update.js +31 -29
  423. package/bin/lib/build.js +19 -8
  424. package/bin/lib/clean-env.js +38 -0
  425. package/bin/lib/cli-shim.js +67 -2
  426. package/bin/lib/config.js +4 -5
  427. package/bin/lib/gateway.js +51 -27
  428. package/bin/lib/jsonc.js +7 -2
  429. package/bin/lib/mcp-agents.js +26 -5
  430. package/bin/lib/path-expand.js +6 -3
  431. package/bin/lib/port.js +5 -1
  432. package/bin/lib/stop.js +98 -41
  433. package/bin/lib/sync.js +1 -1
  434. package/package.json +1 -1
  435. package/scripts/setup.js +7 -5
  436. package/_standalone/.next/server/chunks/2673.js +0 -52
  437. package/_standalone/.next/server/chunks/5648.js +0 -2
  438. package/_standalone/.next/server/chunks/8408.js +0 -219
  439. package/_standalone/.next/static/IiTZbEzZo8l5MSUxlDwKp/_buildManifest.js +0 -1
  440. package/_standalone/.next/static/chunks/1053-c519cb347faa75e2.js +0 -29
  441. package/_standalone/.next/static/chunks/1814.72f7fe7c61e2b647.js +0 -1
  442. package/_standalone/.next/static/chunks/362.4c226d7887d5f696.js +0 -1
  443. package/_standalone/.next/static/chunks/6357-c645842834c0d4cd.js +0 -1
  444. package/_standalone/.next/static/chunks/6981-3d7dcac2d12a5670.js +0 -1
  445. package/_standalone/.next/static/chunks/7035-032641fb6f4e07b2.js +0 -1
  446. package/_standalone/.next/static/chunks/7144-5febf62f1a79fe64.js +0 -1
  447. package/_standalone/.next/static/chunks/9602-423291fdb36396d1.js +0 -1
  448. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-074d6aafc2606561.js +0 -1
  449. package/_standalone/.next/static/chunks/app/agents/page-710d8c80fa86e93e.js +0 -5
  450. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-b07a5983e85bc5e3.js +0 -1
  451. package/_standalone/.next/static/chunks/app/api/a2a/route-b07a5983e85bc5e3.js +0 -1
  452. package/_standalone/.next/static/chunks/app/api/acp/config/route-b07a5983e85bc5e3.js +0 -1
  453. package/_standalone/.next/static/chunks/app/api/acp/detect/route-b07a5983e85bc5e3.js +0 -1
  454. package/_standalone/.next/static/chunks/app/api/acp/install/route-b07a5983e85bc5e3.js +0 -1
  455. package/_standalone/.next/static/chunks/app/api/acp/registry/route-b07a5983e85bc5e3.js +0 -1
  456. package/_standalone/.next/static/chunks/app/api/acp/session/route-b07a5983e85bc5e3.js +0 -1
  457. package/_standalone/.next/static/chunks/app/api/agent-activity/route-b07a5983e85bc5e3.js +0 -1
  458. package/_standalone/.next/static/chunks/app/api/ask/route-b07a5983e85bc5e3.js +0 -1
  459. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-b07a5983e85bc5e3.js +0 -1
  460. package/_standalone/.next/static/chunks/app/api/auth/route-b07a5983e85bc5e3.js +0 -1
  461. package/_standalone/.next/static/chunks/app/api/backlinks/route-b07a5983e85bc5e3.js +0 -1
  462. package/_standalone/.next/static/chunks/app/api/bootstrap/route-b07a5983e85bc5e3.js +0 -1
  463. package/_standalone/.next/static/chunks/app/api/changes/route-b07a5983e85bc5e3.js +0 -1
  464. package/_standalone/.next/static/chunks/app/api/export/route-b07a5983e85bc5e3.js +0 -1
  465. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-b07a5983e85bc5e3.js +0 -1
  466. package/_standalone/.next/static/chunks/app/api/file/import/route-b07a5983e85bc5e3.js +0 -1
  467. package/_standalone/.next/static/chunks/app/api/file/route-b07a5983e85bc5e3.js +0 -1
  468. package/_standalone/.next/static/chunks/app/api/files/route-b07a5983e85bc5e3.js +0 -1
  469. package/_standalone/.next/static/chunks/app/api/git/route-b07a5983e85bc5e3.js +0 -1
  470. package/_standalone/.next/static/chunks/app/api/graph/route-b07a5983e85bc5e3.js +0 -1
  471. package/_standalone/.next/static/chunks/app/api/health/route-b07a5983e85bc5e3.js +0 -1
  472. package/_standalone/.next/static/chunks/app/api/inbox/route-b07a5983e85bc5e3.js +0 -1
  473. package/_standalone/.next/static/chunks/app/api/init/route-b07a5983e85bc5e3.js +0 -1
  474. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-b07a5983e85bc5e3.js +0 -1
  475. package/_standalone/.next/static/chunks/app/api/mcp/install/route-b07a5983e85bc5e3.js +0 -1
  476. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-b07a5983e85bc5e3.js +0 -1
  477. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-b07a5983e85bc5e3.js +0 -1
  478. package/_standalone/.next/static/chunks/app/api/mcp/status/route-b07a5983e85bc5e3.js +0 -1
  479. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-b07a5983e85bc5e3.js +0 -1
  480. package/_standalone/.next/static/chunks/app/api/monitoring/route-b07a5983e85bc5e3.js +0 -1
  481. package/_standalone/.next/static/chunks/app/api/recent-files/route-b07a5983e85bc5e3.js +0 -1
  482. package/_standalone/.next/static/chunks/app/api/restart/route-b07a5983e85bc5e3.js +0 -1
  483. package/_standalone/.next/static/chunks/app/api/search/route-b07a5983e85bc5e3.js +0 -1
  484. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-b07a5983e85bc5e3.js +0 -1
  485. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-b07a5983e85bc5e3.js +0 -1
  486. package/_standalone/.next/static/chunks/app/api/settings/route-b07a5983e85bc5e3.js +0 -1
  487. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-b07a5983e85bc5e3.js +0 -1
  488. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-b07a5983e85bc5e3.js +0 -1
  489. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-b07a5983e85bc5e3.js +0 -1
  490. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-b07a5983e85bc5e3.js +0 -1
  491. package/_standalone/.next/static/chunks/app/api/setup/ls/route-b07a5983e85bc5e3.js +0 -1
  492. package/_standalone/.next/static/chunks/app/api/setup/route-b07a5983e85bc5e3.js +0 -1
  493. package/_standalone/.next/static/chunks/app/api/skills/route-b07a5983e85bc5e3.js +0 -1
  494. package/_standalone/.next/static/chunks/app/api/sync/route-b07a5983e85bc5e3.js +0 -1
  495. package/_standalone/.next/static/chunks/app/api/tree-version/route-b07a5983e85bc5e3.js +0 -1
  496. package/_standalone/.next/static/chunks/app/api/uninstall/route-b07a5983e85bc5e3.js +0 -1
  497. package/_standalone/.next/static/chunks/app/api/update/route-b07a5983e85bc5e3.js +0 -1
  498. package/_standalone/.next/static/chunks/app/api/update-check/route-b07a5983e85bc5e3.js +0 -1
  499. package/_standalone/.next/static/chunks/app/api/update-status/route-b07a5983e85bc5e3.js +0 -1
  500. package/_standalone/.next/static/chunks/app/api/workflows/route-b07a5983e85bc5e3.js +0 -1
  501. package/_standalone/.next/static/chunks/app/changes/page-350992cf5091bc5b.js +0 -1
  502. package/_standalone/.next/static/chunks/app/echo/page-b07a5983e85bc5e3.js +0 -1
  503. package/_standalone/.next/static/chunks/app/global-error-e1ad0e18236ba26c.js +0 -1
  504. package/_standalone/.next/static/chunks/app/help/page-2325d25b6846ca07.js +0 -1
  505. package/_standalone/.next/static/chunks/app/layout-e706f9a963b177ba.js +0 -186
  506. package/_standalone/.next/static/chunks/app/loading-b07a5983e85bc5e3.js +0 -1
  507. package/_standalone/.next/static/chunks/app/page-2595175820acfd65.js +0 -7
  508. package/_standalone/.next/static/chunks/app/trash/page-61c6210fac1e9710.js +0 -1
  509. package/_standalone/.next/static/chunks/app/view/[...path]/loading-b07a5983e85bc5e3.js +0 -1
  510. package/_standalone/.next/static/chunks/app/view/[...path]/not-found-61474670d6bb6116.js +0 -1
  511. package/_standalone/.next/static/chunks/app/view/[...path]/page-798359c36f10ef8d.js +0 -12
  512. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-b07a5983e85bc5e3.js +0 -1
  513. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-b07a5983e85bc5e3.js +0 -1
  514. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-b07a5983e85bc5e3.js +0 -1
  515. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b07a5983e85bc5e3.js +0 -1
  516. package/_standalone/.next/static/css/bbf51803eade6c50.css +0 -31
  517. package/_standalone/.next/static/css/ef1151f74f00d91a.css +0 -1
  518. package/_standalone/lib/i18n/generated/explore-i18n.generated.ts +0 -138
  519. package/_standalone/lib/i18n/index.ts +0 -38
  520. package/_standalone/lib/i18n/modules/ai-chat.ts +0 -237
  521. package/_standalone/lib/i18n/modules/common.ts +0 -71
  522. package/_standalone/lib/i18n/modules/features.ts +0 -153
  523. package/_standalone/lib/i18n/modules/knowledge.ts +0 -727
  524. package/_standalone/lib/i18n/modules/navigation.ts +0 -157
  525. package/_standalone/lib/i18n/modules/onboarding.ts +0 -445
  526. package/_standalone/lib/i18n/modules/panels.ts +0 -1255
  527. package/_standalone/lib/i18n/modules/settings.ts +0 -889
  528. package/_standalone/lib/i18n.ts +0 -3
  529. /package/_standalone/.next/static/{IiTZbEzZo8l5MSUxlDwKp → 2hrwFOLEOZhHQHfrIt-Dw}/_ssgManifest.js +0 -0
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { existsSync, readdirSync, statSync, mkdirSync, writeFileSync, rmSync, renameSync } from 'node:fs';
10
- import { resolve, basename } from 'node:path';
10
+ import { resolve, basename, relative, sep } from 'node:path';
11
11
  import { bold, dim, cyan, green, red, yellow } from '../lib/colors.js';
12
12
  import { loadConfig } from '../lib/config.js';
13
13
  import { output, isJsonMode, EXIT } from '../lib/command.js';
@@ -93,9 +93,12 @@ function countFiles(dir) {
93
93
 
94
94
  function resolvePath(root, relPath) {
95
95
  const full = relPath ? resolve(root, relPath) : root;
96
- if (full !== root && !full.startsWith(root + '/')) {
97
- console.error(red(`Access denied: path outside knowledge base`));
98
- process.exit(EXIT.ERROR);
96
+ if (full !== root) {
97
+ const rel = relative(root, full);
98
+ if (rel === '..' || rel.startsWith(`..${sep}`) || rel.startsWith('../')) {
99
+ console.error(red(`Access denied: path outside knowledge base`));
100
+ process.exit(EXIT.ERROR);
101
+ }
99
102
  }
100
103
  if (!existsSync(full)) {
101
104
  console.error(red(`Not found: ${relPath || '(root)'}`));
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { execSync, spawn as nodeSpawn } from 'node:child_process';
8
- import { existsSync, readFileSync, writeFileSync, rmSync } from 'node:fs';
8
+ import { existsSync, readFileSync, writeFileSync, rmSync, realpathSync } from 'node:fs';
9
9
  import { dirname, resolve } from 'node:path';
10
10
 
11
11
  import { ROOT, BUILD_STAMP, CONFIG_PATH, LOG_PATH } from '../lib/constants.js';
@@ -15,6 +15,8 @@ import { EXIT } from '../lib/command.js';
15
15
  import { stopMindos } from '../lib/stop.js';
16
16
  import { getLocalIP } from '../lib/startup.js';
17
17
  import { isPortInUse } from '../lib/port.js';
18
+ import { cleanEnvForRestart } from '../lib/clean-env.js';
19
+ import { stripBom } from '../lib/jsonc.js';
18
20
 
19
21
  /**
20
22
  * Dynamically resolve the new ROOT after `npm install -g`.
@@ -22,27 +24,16 @@ import { isPortInUse } from '../lib/port.js';
22
24
  */
23
25
  function getUpdatedRoot() {
24
26
  try {
25
- const mindosBin = execSync('which mindos', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
27
+ const whichCmd = process.platform === 'win32' ? 'where mindos' : 'which mindos';
28
+ const mindosBin = execSync(whichCmd, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim().split(/\r?\n/)[0];
26
29
  if (mindosBin) {
27
- // mindos bin is usually at <root>/bin/cli.js or a symlink to it
28
30
  let cliPath;
29
- try {
30
- cliPath = execSync(`readlink -f "${mindosBin}"`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
31
- } catch {
32
- try {
33
- cliPath = execSync(`realpath "${mindosBin}"`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
34
- } catch {
35
- cliPath = mindosBin;
36
- }
37
- }
31
+ try { cliPath = realpathSync(mindosBin); } catch { cliPath = mindosBin; }
38
32
  if (cliPath) {
39
- // cliPath is like /path/to/node_modules/@geminilight/mindos/bin/cli.js
40
- // ROOT is /path/to/node_modules/@geminilight/mindos
41
33
  return resolve(dirname(cliPath), '..');
42
34
  }
43
35
  }
44
36
  } catch {}
45
- // Fallback to static ROOT
46
37
  return ROOT;
47
38
  }
48
39
 
@@ -84,7 +75,7 @@ function buildIfNeeded(newRoot) {
84
75
  }
85
76
  const nextDir = resolve(newRoot, 'app', '.next');
86
77
  if (existsSync(nextDir)) {
87
- execInherited(`rm -rf "${nextDir}"`, newRoot);
78
+ rmSync(nextDir, { recursive: true, force: true });
88
79
  }
89
80
  execInherited('node scripts/gen-renderer-index.js', newRoot);
90
81
  execInherited(`${newNextBin} build`, resolve(newRoot, 'app'));
@@ -175,12 +166,12 @@ export const run = async () => {
175
166
  writeUpdateStatus('restarting', vOpts);
176
167
  await gateway.runGatewayCommand('install');
177
168
  const updateConfig = (() => {
178
- try { return JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')); } catch { return {}; }
169
+ try { return JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8'))); } catch { return {}; }
179
170
  })();
180
171
  const webPort = updateConfig.port ?? 3456;
181
172
  const mcpPort = updateConfig.mcpPort ?? 8781;
182
173
  console.log(dim(' (Waiting for Web UI to come back up — first run after update includes a rebuild...)'));
183
- const ready = await gateway.waitForHttp(Number(webPort), { retries: 450, intervalMs: 2000, label: 'Web UI', logFile: LOG_PATH });
174
+ const ready = await gateway.waitForHttp(Number(webPort), { retries: 450, intervalMs: 2000, label: 'Web UI', logFile: LOG_PATH, expectedVersion: newVersion });
184
175
  if (ready) {
185
176
  const localIP = getLocalIP();
186
177
  console.log(`\n${'─'.repeat(53)}`);
@@ -204,7 +195,7 @@ export const run = async () => {
204
195
  // (e.g. user started via `mindos start`, or GUI triggered this update).
205
196
  // If so, stop it and restart from the NEW installation path.
206
197
  const updateConfig = (() => {
207
- try { return JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')); } catch { return {}; }
198
+ try { return JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8'))); } catch { return {}; }
208
199
  })();
209
200
  const webPort = Number(updateConfig.port ?? 3456);
210
201
  const mcpPort = Number(updateConfig.mcpPort ?? 8781);
@@ -214,13 +205,29 @@ export const run = async () => {
214
205
  if (wasRunning) {
215
206
  console.log(cyan('\n MindOS is running — restarting to apply the new version...'));
216
207
  stopMindos();
217
- // Wait for ports to free (up to 15s)
218
- const deadline = Date.now() + 15_000;
208
+ // Wait for ports to free (up to 20s) with stabilization check.
209
+ // After first "free" reading, wait 1s and check again to avoid
210
+ // false negatives from TCP TIME_WAIT flickering.
211
+ const deadline = Date.now() + 20_000;
212
+ let portsFree = false;
219
213
  while (Date.now() < deadline) {
220
214
  const busy = await isPortInUse(webPort) || await isPortInUse(mcpPort);
221
- if (!busy) break;
215
+ if (!busy) {
216
+ // Stabilization: wait 1s, then double-check
217
+ await new Promise((r) => setTimeout(r, 1000));
218
+ const stillFree = !(await isPortInUse(webPort)) && !(await isPortInUse(mcpPort));
219
+ if (stillFree) { portsFree = true; break; }
220
+ }
222
221
  await new Promise((r) => setTimeout(r, 500));
223
222
  }
223
+ if (!portsFree) {
224
+ console.log(yellow(' ⚠ Ports not fully released, force-killing remaining processes...'));
225
+ // Last resort: import killByPort and SIGKILL anything on these ports
226
+ const stopLib = await import('../lib/stop.js');
227
+ stopLib.killByPort(webPort);
228
+ stopLib.killByPort(mcpPort);
229
+ await new Promise((r) => setTimeout(r, 2000));
230
+ }
224
231
 
225
232
  // Stage 3: Rebuild
226
233
  writeUpdateStatus('rebuilding', vOpts);
@@ -237,12 +244,7 @@ export const run = async () => {
237
244
  // (`mindos start` has its own build-on-startup logic)
238
245
  writeUpdateStatus('restarting', vOpts);
239
246
  const newCliPath = resolve(updatedRoot, 'bin', 'cli.js');
240
- const childEnv = { ...process.env };
241
- delete childEnv.MINDOS_WEB_PORT;
242
- delete childEnv.MINDOS_MCP_PORT;
243
- delete childEnv.MIND_ROOT;
244
- delete childEnv.AUTH_TOKEN;
245
- delete childEnv.WEB_PASSWORD;
247
+ const childEnv = cleanEnvForRestart();
246
248
  const child = nodeSpawn(
247
249
  process.execPath, [newCliPath, 'start'],
248
250
  { detached: true, stdio: 'ignore', env: childEnv },
@@ -250,7 +252,7 @@ export const run = async () => {
250
252
  child.unref();
251
253
 
252
254
  console.log(dim(' (Waiting for Web UI to come back up...)'));
253
- const ready = await gateway.waitForHttp(webPort, { retries: 180, intervalMs: 2000, label: 'Web UI', logFile: LOG_PATH });
255
+ const ready = await gateway.waitForHttp(webPort, { retries: 180, intervalMs: 2000, label: 'Web UI', logFile: LOG_PATH, expectedVersion: newVersion });
254
256
  if (ready) {
255
257
  const localIP = getLocalIP();
256
258
  console.log(`\n${'─'.repeat(53)}`);
package/bin/lib/build.js CHANGED
@@ -118,13 +118,19 @@ export function ensureAppDeps({ force = false } = {}) {
118
118
  } catch {
119
119
  console.error(red('\n\u2718 npm not found in PATH.\n'));
120
120
  console.error(' MindOS needs npm to install its app dependencies on first run.');
121
- console.error(' This usually means Node.js is installed via a version manager (nvm, fnm, volta, etc.)');
122
- console.error(' that only loads in interactive shells, but not in /bin/sh.\n');
123
- console.error(' Fix: add your Node.js bin directory to a profile that /bin/sh reads (~/.profile).');
124
- console.error(' Example:');
125
- console.error(dim(' echo \'export PATH="$HOME/.nvm/versions/node/$(node --version)/bin:$PATH"\' >> ~/.profile'));
126
- console.error(dim(' source ~/.profile\n'));
127
- console.error(' Then run `mindos start` again.\n');
121
+ if (process.platform === 'win32') {
122
+ console.error(' Ensure Node.js is installed and added to your system PATH.\n');
123
+ console.error(' Fix: reinstall Node.js from https://nodejs.org (the installer adds it to PATH).');
124
+ console.error(' Then open a new terminal and run `mindos start` again.\n');
125
+ } else {
126
+ console.error(' This usually means Node.js is installed via a version manager (nvm, fnm, volta, etc.)');
127
+ console.error(' that only loads in interactive shells, but not in /bin/sh.\n');
128
+ console.error(' Fix: add your Node.js bin directory to a profile that /bin/sh reads (~/.profile).');
129
+ console.error(' Example:');
130
+ console.error(dim(' echo \'export PATH="$HOME/.nvm/versions/node/$(node --version)/bin:$PATH"\' >> ~/.profile'));
131
+ console.error(dim(' source ~/.profile\n'));
132
+ console.error(' Then run `mindos start` again.\n');
133
+ }
128
134
  process.exit(1);
129
135
  }
130
136
 
@@ -142,7 +148,12 @@ export function ensureAppDeps({ force = false } = {}) {
142
148
  run('npm install --no-workspaces', resolve(ROOT, 'app'));
143
149
  if (!verifyDeps()) {
144
150
  console.error(red('\n✘ Failed to install dependencies after retry.\n'));
145
- console.error(' Try manually: cd ' + resolve(ROOT, 'app') + ' && rm -rf node_modules && npm install');
151
+ const appDir = resolve(ROOT, 'app');
152
+ if (process.platform === 'win32') {
153
+ console.error(` Try manually: cd "${appDir}" && rmdir /s /q node_modules && npm install`);
154
+ } else {
155
+ console.error(` Try manually: cd ${appDir} && rm -rf node_modules && npm install`);
156
+ }
146
157
  process.exit(1);
147
158
  }
148
159
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Create a clean environment for spawning a new MindOS process.
3
+ *
4
+ * During `mindos update`, the old process inherits env vars like
5
+ * MINDOS_PROJECT_ROOT, MINDOS_CLI_PATH etc. that point to the OLD
6
+ * installation path. If these leak into the child process, the "new"
7
+ * server starts from the old code — the infamous "fake update" bug.
8
+ *
9
+ * This helper strips ALL MINDOS_*/MIND_* prefixed variables plus
10
+ * a curated denylist of other vars that can cause stale-path issues.
11
+ */
12
+
13
+ /** Env var prefixes that must be stripped for a clean restart */
14
+ const STRIP_PREFIXES = ['MINDOS_', 'MIND_'];
15
+
16
+ /** Additional specific vars to strip (not prefix-matched) */
17
+ const STRIP_EXACT = [
18
+ 'AUTH_TOKEN',
19
+ 'WEB_PASSWORD',
20
+ 'NODE_OPTIONS', // may contain --inspect or old module paths
21
+ ];
22
+
23
+ /**
24
+ * Return a copy of `process.env` with all MindOS-related vars removed.
25
+ * The new child process will re-derive paths from its own ROOT constant.
26
+ */
27
+ export function cleanEnvForRestart(baseEnv = process.env) {
28
+ const cleaned = { ...baseEnv };
29
+ for (const key of Object.keys(cleaned)) {
30
+ if (STRIP_PREFIXES.some(p => key.startsWith(p))) {
31
+ delete cleaned[key];
32
+ }
33
+ }
34
+ for (const key of STRIP_EXACT) {
35
+ delete cleaned[key];
36
+ }
37
+ return cleaned;
38
+ }
@@ -66,6 +66,65 @@ exit 127
66
66
  try { chmodSync(shimPath(), 0o755); } catch { /* ignore */ }
67
67
  }
68
68
 
69
+ function writeWindowsShim(cliJs) {
70
+ const script = `@echo off\r
71
+ rem Generated by MindOS CLI — overwritten on each mindos start.\r
72
+ setlocal\r
73
+ set "CLI=${cliJs}"\r
74
+ if not exist "%CLI%" (\r
75
+ for /f "delims=" %%R in ('npm root -g 2^>nul') do set "NPM_CLI=%%R\\@geminilight\\mindos\\bin\\cli.js"\r
76
+ if defined NPM_CLI if exist "%NPM_CLI%" set "CLI=%NPM_CLI%"\r
77
+ )\r
78
+ if not exist "%CLI%" (\r
79
+ echo mindos: CLI not found. Reinstall: npm install -g @geminilight/mindos >&2\r
80
+ exit /b 127\r
81
+ )\r
82
+ set "MINDOS_NODE=%USERPROFILE%\\.mindos\\node\\node.exe"\r
83
+ if exist "%MINDOS_NODE%" (\r
84
+ "%MINDOS_NODE%" "%CLI%" %*\r
85
+ exit /b %ERRORLEVEL%\r
86
+ )\r
87
+ where node >nul 2>nul\r
88
+ if %ERRORLEVEL% equ 0 (\r
89
+ node "%CLI%" %*\r
90
+ exit /b %ERRORLEVEL%\r
91
+ )\r
92
+ echo mindos: Node.js not found. Install Node 18+ or run MindOS Desktop. >&2\r
93
+ exit /b 127\r
94
+ `;
95
+ mkdirSync(shimDir(), { recursive: true });
96
+ writeFileSync(shimPath(), script, 'utf-8');
97
+ }
98
+
99
+ /**
100
+ * On Windows, add ~/.mindos/bin to user PATH via PowerShell profile (idempotent).
101
+ * Falls back gracefully if PowerShell is not available.
102
+ */
103
+ function appendPathWindows() {
104
+ const binDir = shimDir();
105
+ const dirs = (process.env.PATH || '').split(';');
106
+ if (dirs.some(d => d === binDir)) return false;
107
+
108
+ // Write a PowerShell profile snippet
109
+ try {
110
+ const psProfileDir = resolve(home, 'Documents', 'WindowsPowerShell');
111
+ mkdirSync(psProfileDir, { recursive: true });
112
+ const psProfile = resolve(psProfileDir, 'Microsoft.PowerShell_profile.ps1');
113
+ const psBlock = `\n${SHELL_MARKER}\n$env:PATH = "$env:USERPROFILE\\.mindos\\bin;$env:PATH"\n`;
114
+
115
+ let needsWrite = !existsSync(psProfile);
116
+ if (!needsWrite) {
117
+ const content = readFileSync(psProfile, 'utf-8');
118
+ needsWrite = !content.includes(SHELL_MARKER) && !content.includes('.mindos\\bin');
119
+ }
120
+ if (needsWrite) {
121
+ appendFileSync(psProfile, psBlock, 'utf-8');
122
+ return true;
123
+ }
124
+ } catch { /* best effort */ }
125
+ return false;
126
+ }
127
+
69
128
  /**
70
129
  * Append ~/.mindos/bin to PATH in relevant shell rc files (idempotent).
71
130
  * AI Agents run commands via non-interactive shells:
@@ -74,7 +133,9 @@ exit 127
74
133
  * - Fish reads ~/.config/fish/conf.d/*.fish always
75
134
  */
76
135
  function appendPathToShellRc() {
77
- if (platform() === 'win32') return false;
136
+ if (platform() === 'win32') {
137
+ return appendPathWindows();
138
+ }
78
139
 
79
140
  const block = `\n${SHELL_MARKER}\nexport PATH="$HOME/.mindos/bin:$PATH"\n`;
80
141
 
@@ -144,7 +205,11 @@ function appendPathToShellRc() {
144
205
  */
145
206
  export function ensureCliShim() {
146
207
  try {
147
- writeUnixShim(CLI_PATH);
208
+ if (platform() === 'win32') {
209
+ writeWindowsShim(CLI_PATH);
210
+ } else {
211
+ writeUnixShim(CLI_PATH);
212
+ }
148
213
  } catch (e) {
149
214
  console.warn('[MindOS] Failed to write CLI shim:', e instanceof Error ? e.message : e);
150
215
  return false;
package/bin/lib/config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { CONFIG_PATH } from './constants.js';
3
+ import { stripBom } from './jsonc.js';
3
4
 
4
5
  let loaded = false;
5
6
 
@@ -9,7 +10,7 @@ export function loadConfig() {
9
10
  if (!existsSync(CONFIG_PATH)) return;
10
11
  let config;
11
12
  try {
12
- config = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
13
+ config = JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8')));
13
14
  } catch {
14
15
  console.error(`Warning: failed to parse ${CONFIG_PATH}`);
15
16
  return;
@@ -49,9 +50,7 @@ export function loadConfig() {
49
50
 
50
51
  export function getStartMode() {
51
52
  try {
52
- const mode = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')).startMode || 'start';
53
- // 'daemon' is stored in config when user chose background service;
54
- // CLI maps it to the 'start' command with --daemon flag
53
+ const mode = JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8'))).startMode || 'start';
55
54
  return mode === 'daemon' ? 'start' : mode;
56
55
  } catch {
57
56
  return 'start';
@@ -60,7 +59,7 @@ export function getStartMode() {
60
59
 
61
60
  export function isDaemonMode() {
62
61
  try {
63
- return JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')).startMode === 'daemon';
62
+ return JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8'))).startMode === 'daemon';
64
63
  } catch {
65
64
  return false;
66
65
  }
@@ -1,10 +1,11 @@
1
1
  import { execSync } from 'node:child_process';
2
- import { existsSync, readFileSync, writeFileSync, rmSync, mkdirSync, statSync, renameSync, unlinkSync, openSync, readSync, closeSync } from 'node:fs';
2
+ import { existsSync, readFileSync, writeFileSync, rmSync, mkdirSync, statSync, renameSync, unlinkSync, openSync, readSync, closeSync, realpathSync } from 'node:fs';
3
3
  import { resolve, dirname } from 'node:path';
4
4
  import { homedir } from 'node:os';
5
5
  import { MINDOS_DIR, LOG_PATH, CLI_PATH, NODE_BIN, CONFIG_PATH } from './constants.js';
6
6
  import { green, red, dim, cyan, yellow } from './colors.js';
7
7
  import { isPortInUse } from './port.js';
8
+ import { stripBom } from './jsonc.js';
8
9
 
9
10
  // ── Helpers ──────────────────────────────────────────────────────────────────
10
11
 
@@ -15,31 +16,17 @@ import { isPortInUse } from './port.js';
15
16
  */
16
17
  function getCurrentCliPath() {
17
18
  try {
18
- // Try to find mindos in PATH
19
- const mindosBin = execSync('which mindos', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
19
+ const whichCmd = process.platform === 'win32' ? 'where mindos' : 'which mindos';
20
+ // `where` on Windows can return multiple lines; take the first match
21
+ const mindosBin = execSync(whichCmd, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim().split(/\r?\n/)[0];
20
22
  if (mindosBin) {
21
- // mindos is usually a symlink, resolve it
22
23
  try {
23
- const realPath = execSync(`readlink -f "${mindosBin}"`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
24
- if (realPath && existsSync(realPath)) {
25
- return realPath;
26
- }
27
- } catch {
28
- // readlink -f not available on macOS, fallback to realpath
29
- try {
30
- const realPath = execSync(`realpath "${mindosBin}"`, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
31
- if (realPath && existsSync(realPath)) {
32
- return realPath;
33
- }
34
- } catch {}
35
- }
36
- // Fallback: use the symlink target itself
37
- if (existsSync(mindosBin)) {
38
- return mindosBin;
39
- }
24
+ const realPath = realpathSync(mindosBin);
25
+ if (existsSync(realPath)) return realPath;
26
+ } catch {}
27
+ if (existsSync(mindosBin)) return mindosBin;
40
28
  }
41
29
  } catch {}
42
- // Fallback to static CLI_PATH if dynamic resolution fails
43
30
  return CLI_PATH;
44
31
  }
45
32
 
@@ -113,13 +100,43 @@ export function parseLogHint(line) {
113
100
  return null;
114
101
  }
115
102
 
116
- export async function waitForHttp(port, { retries = 60, intervalMs = 2000, label = 'service', logFile = null } = {}) {
103
+ export async function waitForHttp(port, { retries = 60, intervalMs = 2000, label = 'service', logFile = null, expectedVersion = null } = {}) {
117
104
  const start = Date.now();
118
105
  const elapsed = () => {
119
106
  const s = Math.round((Date.now() - start) / 1000);
120
107
  return s < 60 ? `${s}s` : `${Math.floor(s / 60)}m${String(s % 60).padStart(2, '0')}s`;
121
108
  };
122
109
 
110
+ /**
111
+ * Version-aware readiness check: after health check passes, verify the
112
+ * server is actually running the expected version (not an orphaned old process).
113
+ * Prevents the "fake update" where health check hits a stale worker.
114
+ */
115
+ async function verifyVersion(hostname) {
116
+ if (!expectedVersion) return true; // no version check requested
117
+ try {
118
+ const { request } = await import('node:http');
119
+ return new Promise((resolve) => {
120
+ const req = request(
121
+ { hostname, port, path: '/api/update-check', method: 'GET', timeout: 5000 },
122
+ (res) => {
123
+ let body = '';
124
+ res.on('data', (chunk) => { body += chunk; });
125
+ res.on('end', () => {
126
+ try {
127
+ const data = JSON.parse(body);
128
+ resolve(data.current === expectedVersion);
129
+ } catch { resolve(false); }
130
+ });
131
+ }
132
+ );
133
+ req.on('error', () => resolve(false));
134
+ req.on('timeout', () => { req.destroy(); resolve(false); });
135
+ req.end();
136
+ });
137
+ } catch { return false; }
138
+ }
139
+
123
140
  // Track log file position for incremental reads
124
141
  let logOffset = 0;
125
142
  let lastHint = 'starting…';
@@ -169,9 +186,16 @@ export async function waitForHttp(port, { retries = 60, intervalMs = 2000, label
169
186
  });
170
187
  const ok = await tryHost('127.0.0.1') || await tryHost('localhost');
171
188
  if (ok) {
172
- process.stdout.write(`\r\x1b[K`);
173
- process.stdout.write(` ${green('\u2714')} ${label} ready ${dim(`(${elapsed()})`)}\n`);
174
- return true;
189
+ // If expectedVersion is set, verify the server is running the right version
190
+ const versionOk = await verifyVersion('127.0.0.1') || await verifyVersion('localhost');
191
+ if (!versionOk && expectedVersion) {
192
+ // Health check passed but wrong version — old process still serving
193
+ // Continue waiting for the new process to take over
194
+ } else {
195
+ process.stdout.write(`\r\x1b[K`);
196
+ process.stdout.write(` ${green('\u2714')} ${label} ready ${dim(`(${elapsed()})`)}\n`);
197
+ return true;
198
+ }
175
199
  }
176
200
  } catch { /* not ready yet */ }
177
201
 
@@ -353,7 +377,7 @@ const launchd = {
353
377
  // Read ports before bootout so we can wait for them to be freed
354
378
  let webPort = 3456, mcpPort = 8781;
355
379
  try {
356
- const config = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
380
+ const config = JSON.parse(stripBom(readFileSync(CONFIG_PATH, 'utf-8')));
357
381
  if (config.port) webPort = Number(config.port);
358
382
  if (config.mcpPort) mcpPort = Number(config.mcpPort);
359
383
  } catch {}
package/bin/lib/jsonc.js CHANGED
@@ -1,11 +1,16 @@
1
1
  /**
2
- * JSONC parser — strips comments before JSON.parse.
2
+ * JSONC parser — strips BOM and comments before JSON.parse.
3
3
  *
4
4
  * VS Code-based editors (Cursor, Windsurf, Cline) use JSONC for config files.
5
+ * Windows editors (Notepad) may prepend a UTF-8 BOM (\uFEFF).
5
6
  */
6
7
 
8
+ export function stripBom(text) {
9
+ return text.charCodeAt(0) === 0xFEFF ? text.slice(1) : text;
10
+ }
11
+
7
12
  export const parseJsonc = (text) => {
8
- let stripped = text.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*$)/gm, (m, g) => g ? '' : m);
13
+ let stripped = stripBom(text).replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*$)/gm, (m, g) => g ? '' : m);
9
14
  stripped = stripped.replace(/\/\*[\s\S]*?\*\//g, '');
10
15
  if (!stripped.trim()) return {};
11
16
  return JSON.parse(stripped);
@@ -9,8 +9,14 @@
9
9
 
10
10
  import { existsSync } from 'node:fs';
11
11
  import { execSync } from 'node:child_process';
12
+ import { resolve } from 'node:path';
12
13
  import { expandHome } from './path-expand.js';
13
14
 
15
+ function winAppData(...segments) {
16
+ const appData = process.env.APPDATA || resolve(process.env.USERPROFILE || '', 'AppData', 'Roaming');
17
+ return resolve(appData, ...segments);
18
+ }
19
+
14
20
  export const MCP_AGENTS = {
15
21
  'claude-code': {
16
22
  name: 'Claude Code',
@@ -42,12 +48,15 @@ export const MCP_AGENTS = {
42
48
  project: null,
43
49
  global: process.platform === 'darwin'
44
50
  ? '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json'
45
- : '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
51
+ : process.platform === 'win32'
52
+ ? winAppData('Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json')
53
+ : '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
46
54
  key: 'mcpServers',
47
55
  preferredTransport: 'stdio',
48
56
  presenceDirs: [
49
57
  '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/',
50
58
  '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/',
59
+ ...(process.platform === 'win32' ? [winAppData('Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev')] : []),
51
60
  ],
52
61
  },
53
62
  'trae': {
@@ -153,13 +162,16 @@ export const MCP_AGENTS = {
153
162
  project: '.trae/mcp.json',
154
163
  global: process.platform === 'darwin'
155
164
  ? '~/Library/Application Support/Trae CN/User/mcp.json'
156
- : '~/.config/Trae CN/User/mcp.json',
165
+ : process.platform === 'win32'
166
+ ? winAppData('Trae CN', 'User', 'mcp.json')
167
+ : '~/.config/Trae CN/User/mcp.json',
157
168
  key: 'mcpServers',
158
169
  preferredTransport: 'stdio',
159
170
  presenceCli: 'trae-cli',
160
171
  presenceDirs: [
161
172
  '~/Library/Application Support/Trae CN/',
162
173
  '~/.config/Trae CN/',
174
+ ...(process.platform === 'win32' ? [winAppData('Trae CN')] : []),
163
175
  ],
164
176
  },
165
177
  'roo': {
@@ -167,12 +179,15 @@ export const MCP_AGENTS = {
167
179
  project: '.roo/mcp.json',
168
180
  global: process.platform === 'darwin'
169
181
  ? '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json'
170
- : '~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json',
182
+ : process.platform === 'win32'
183
+ ? winAppData('Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'mcp_settings.json')
184
+ : '~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json',
171
185
  key: 'mcpServers',
172
186
  preferredTransport: 'stdio',
173
187
  presenceDirs: [
174
188
  '~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/',
175
189
  '~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/',
190
+ ...(process.platform === 'win32' ? [winAppData('Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline')] : []),
176
191
  ],
177
192
  },
178
193
  'github-copilot': {
@@ -180,12 +195,15 @@ export const MCP_AGENTS = {
180
195
  project: '.vscode/mcp.json',
181
196
  global: process.platform === 'darwin'
182
197
  ? '~/Library/Application Support/Code/User/mcp.json'
183
- : '~/.config/Code/User/mcp.json',
198
+ : process.platform === 'win32'
199
+ ? winAppData('Code', 'User', 'mcp.json')
200
+ : '~/.config/Code/User/mcp.json',
184
201
  key: 'servers',
185
202
  preferredTransport: 'stdio',
186
203
  presenceDirs: [
187
204
  '~/Library/Application Support/Code/',
188
205
  '~/.config/Code/',
206
+ ...(process.platform === 'win32' ? [winAppData('Code')] : []),
189
207
  ],
190
208
  presenceCli: 'code',
191
209
  },
@@ -239,6 +257,9 @@ export function detectAgentPresence(agentKey) {
239
257
  return true;
240
258
  } catch { /* not found */ }
241
259
  }
242
- if (agent.presenceDirs?.some(d => existsSync(expandHome(d)))) return true;
260
+ if (agent.presenceDirs?.some(d => {
261
+ // Paths from winAppData() are already absolute; expandHome only handles ~/
262
+ try { return existsSync(d.startsWith('~') ? expandHome(d) : d); } catch { return false; }
263
+ })) return true;
243
264
  return false;
244
265
  }
@@ -1,9 +1,12 @@
1
1
  /**
2
- * Path expansion — resolve `~/...` to absolute paths.
2
+ * Path expansion — resolve `~/...` or `~\...` to absolute paths.
3
3
  */
4
4
 
5
5
  import { resolve } from 'node:path';
6
6
  import { homedir } from 'node:os';
7
7
 
8
- export const expandHome = (p) =>
9
- p.startsWith('~/') ? resolve(homedir(), p.slice(2)) : p;
8
+ export const expandHome = (p) => {
9
+ if (p === '~') return homedir();
10
+ if (p.startsWith('~/') || p.startsWith('~\\')) return resolve(homedir(), p.slice(2));
11
+ return p;
12
+ };
package/bin/lib/port.js CHANGED
@@ -33,7 +33,11 @@ export async function assertPortFree(port, name) {
33
33
  if (await isPortInUse(port)) {
34
34
  console.error(`\n${red('\u2718')} ${bold(`Port ${port} is still in use after cleanup`)} ${dim(`(${name})`)}`);
35
35
  console.error(`\n ${dim('Stop MindOS:')} mindos stop`);
36
- console.error(` ${dim('Find the process:')} lsof -i :${port}\n`);
36
+ if (process.platform === 'win32') {
37
+ console.error(` ${dim('Find the process:')} netstat -ano | findstr :${port}\n`);
38
+ } else {
39
+ console.error(` ${dim('Find the process:')} lsof -i :${port}\n`);
40
+ }
37
41
  process.exit(1);
38
42
  }
39
43
  console.log(` ${dim('Cleaned up orphaned processes on port')} ${port}`);