@geminilight/mindos-windows-arm64 1.0.7 → 1.0.9

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 (516) hide show
  1. package/_standalone/.mindos-build-version +1 -1
  2. package/_standalone/__next/BUILD_ID +1 -1
  3. package/_standalone/__next/app-path-routes-manifest.json +33 -33
  4. package/_standalone/__next/build-manifest.json +4 -4
  5. package/_standalone/__next/prerender-manifest.json +3 -3
  6. package/_standalone/__next/react-loadable-manifest.json +50 -9
  7. package/_standalone/__next/required-server-files.json +4 -4
  8. package/_standalone/__next/server/app/.well-known/agent-card.json/route.js +1 -1
  9. package/_standalone/__next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  10. package/_standalone/__next/server/app/_global-error/page.js +3 -3
  11. package/_standalone/__next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/_standalone/__next/server/app/_global-error.html +2 -2
  13. package/_standalone/__next/server/app/_global-error.rsc +3 -3
  14. package/_standalone/__next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  15. package/_standalone/__next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/_standalone/__next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/_standalone/__next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/_standalone/__next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  19. package/_standalone/__next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/_standalone/__next/server/app/_not-found/page.js +2 -2
  21. package/_standalone/__next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/_standalone/__next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/_standalone/__next/server/app/agents/[agentKey]/page.js +2 -2
  24. package/_standalone/__next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  25. package/_standalone/__next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  26. package/_standalone/__next/server/app/agents/page.js +2 -2
  27. package/_standalone/__next/server/app/agents/page.js.nft.json +1 -1
  28. package/_standalone/__next/server/app/agents/page_client-reference-manifest.js +1 -1
  29. package/_standalone/__next/server/app/api/a2a/agents/route.js +1 -1
  30. package/_standalone/__next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  31. package/_standalone/__next/server/app/api/a2a/delegations/route.js +1 -1
  32. package/_standalone/__next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  33. package/_standalone/__next/server/app/api/a2a/discover/route.js +1 -1
  34. package/_standalone/__next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  35. package/_standalone/__next/server/app/api/a2a/route.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.js +1 -1
  38. package/_standalone/__next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  39. package/_standalone/__next/server/app/api/acp/detect/route.js +1 -1
  40. package/_standalone/__next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  41. package/_standalone/__next/server/app/api/acp/install/route.js +1 -1
  42. package/_standalone/__next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  43. package/_standalone/__next/server/app/api/acp/registry/route.js +1 -1
  44. package/_standalone/__next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  45. package/_standalone/__next/server/app/api/acp/session/route.js +1 -1
  46. package/_standalone/__next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  47. package/_standalone/__next/server/app/api/agent-activity/route.js +1 -1
  48. package/_standalone/__next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  49. package/_standalone/__next/server/app/api/agents/copy-skill/route.js +1 -1
  50. package/_standalone/__next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
  51. package/_standalone/__next/server/app/api/agents/custom/detect/route.js +1 -1
  52. package/_standalone/__next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
  53. package/_standalone/__next/server/app/api/agents/custom/route.js +1 -1
  54. package/_standalone/__next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
  55. package/_standalone/__next/server/app/api/ask/route.js +6 -6
  56. package/_standalone/__next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  57. package/_standalone/__next/server/app/api/ask-sessions/route.js +1 -1
  58. package/_standalone/__next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  59. package/_standalone/__next/server/app/api/auth/route.js +1 -1
  60. package/_standalone/__next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  61. package/_standalone/__next/server/app/api/backlinks/route.js +1 -1
  62. package/_standalone/__next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  63. package/_standalone/__next/server/app/api/bootstrap/route.js +1 -1
  64. package/_standalone/__next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  65. package/_standalone/__next/server/app/api/changes/route.js +1 -1
  66. package/_standalone/__next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  67. package/_standalone/__next/server/app/api/channels/verify/route.js +1 -1
  68. package/_standalone/__next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
  69. package/_standalone/__next/server/app/api/connect/route.js +1 -1
  70. package/_standalone/__next/server/app/api/connect/route_client-reference-manifest.js +1 -1
  71. package/_standalone/__next/server/app/api/embedding/route.js +1 -1
  72. package/_standalone/__next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
  73. package/_standalone/__next/server/app/api/export/route.js +1 -1
  74. package/_standalone/__next/server/app/api/export/route_client-reference-manifest.js +1 -1
  75. package/_standalone/__next/server/app/api/extract-docx/route.js +1 -1
  76. package/_standalone/__next/server/app/api/extract-docx/route_client-reference-manifest.js +1 -1
  77. package/_standalone/__next/server/app/api/extract-pdf/route.js +2 -2
  78. package/_standalone/__next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  79. package/_standalone/__next/server/app/api/file/import/route.js +1 -1
  80. package/_standalone/__next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  81. package/_standalone/__next/server/app/api/file/raw/route.js +1 -1
  82. package/_standalone/__next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
  83. package/_standalone/__next/server/app/api/file/route.js +1 -1
  84. package/_standalone/__next/server/app/api/file/route_client-reference-manifest.js +1 -1
  85. package/_standalone/__next/server/app/api/files/route.js +1 -1
  86. package/_standalone/__next/server/app/api/files/route_client-reference-manifest.js +1 -1
  87. package/_standalone/__next/server/app/api/git/route.js +1 -1
  88. package/_standalone/__next/server/app/api/git/route_client-reference-manifest.js +1 -1
  89. package/_standalone/__next/server/app/api/graph/route.js +1 -1
  90. package/_standalone/__next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  91. package/_standalone/__next/server/app/api/health/route.js +1 -1
  92. package/_standalone/__next/server/app/api/health/route_client-reference-manifest.js +1 -1
  93. package/_standalone/__next/server/app/api/im/activity/route.js +1 -1
  94. package/_standalone/__next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
  95. package/_standalone/__next/server/app/api/im/config/route.js +1 -1
  96. package/_standalone/__next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
  97. package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route.js +1 -1
  98. package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route_client-reference-manifest.js +1 -1
  99. package/_standalone/__next/server/app/api/im/feishu/long-connection/route.js +1 -1
  100. package/_standalone/__next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
  101. package/_standalone/__next/server/app/api/im/status/route.js +1 -1
  102. package/_standalone/__next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
  103. package/_standalone/__next/server/app/api/im/test/route.js +1 -1
  104. package/_standalone/__next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
  105. package/_standalone/__next/server/app/api/im/webhook/feishu/route.js +1 -1
  106. package/_standalone/__next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
  107. package/_standalone/__next/server/app/api/im/webhook-status/route.js +1 -1
  108. package/_standalone/__next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
  109. package/_standalone/__next/server/app/api/inbox/clip/route.js +2 -2
  110. package/_standalone/__next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
  111. package/_standalone/__next/server/app/api/inbox/route.js +1 -1
  112. package/_standalone/__next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  113. package/_standalone/__next/server/app/api/init/route.js +1 -1
  114. package/_standalone/__next/server/app/api/init/route_client-reference-manifest.js +1 -1
  115. package/_standalone/__next/server/app/api/lint/route.js +1 -1
  116. package/_standalone/__next/server/app/api/lint/route_client-reference-manifest.js +1 -1
  117. package/_standalone/__next/server/app/api/mcp/agents/route.js +1 -1
  118. package/_standalone/__next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  119. package/_standalone/__next/server/app/api/mcp/direct-tools/route.js +1 -1
  120. package/_standalone/__next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
  121. package/_standalone/__next/server/app/api/mcp/install/route.js +1 -1
  122. package/_standalone/__next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  123. package/_standalone/__next/server/app/api/mcp/install-skill/route.js +1 -1
  124. package/_standalone/__next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  125. package/_standalone/__next/server/app/api/mcp/restart/route.js +1 -1
  126. package/_standalone/__next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  127. package/_standalone/__next/server/app/api/mcp/status/route.js +1 -1
  128. package/_standalone/__next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  129. package/_standalone/__next/server/app/api/mcp/tools/route.js +1 -1
  130. package/_standalone/__next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  131. package/_standalone/__next/server/app/api/mcp/uninstall/route.js +1 -1
  132. package/_standalone/__next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  133. package/_standalone/__next/server/app/api/monitoring/route.js +1 -1
  134. package/_standalone/__next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  135. package/_standalone/__next/server/app/api/obsidian/compat-report/route.js +1 -1
  136. package/_standalone/__next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -1
  137. package/_standalone/__next/server/app/api/obsidian/import/route.js +1 -1
  138. package/_standalone/__next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -1
  139. package/_standalone/__next/server/app/api/obsidian-plugins/settings/route.js +2 -2
  140. package/_standalone/__next/server/app/api/obsidian-plugins/settings/route_client-reference-manifest.js +1 -1
  141. package/_standalone/__next/server/app/api/recent-files/route.js +1 -1
  142. package/_standalone/__next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  143. package/_standalone/__next/server/app/api/restart/route.js +1 -1
  144. package/_standalone/__next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  145. package/_standalone/__next/server/app/api/search/prewarm/route.js +1 -1
  146. package/_standalone/__next/server/app/api/search/prewarm/route_client-reference-manifest.js +1 -1
  147. package/_standalone/__next/server/app/api/search/route.js +1 -1
  148. package/_standalone/__next/server/app/api/search/route_client-reference-manifest.js +1 -1
  149. package/_standalone/__next/server/app/api/settings/list-models/route.js +1 -1
  150. package/_standalone/__next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  151. package/_standalone/__next/server/app/api/settings/reset-token/route.js +1 -1
  152. package/_standalone/__next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  153. package/_standalone/__next/server/app/api/settings/route.js +1 -1
  154. package/_standalone/__next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  155. package/_standalone/__next/server/app/api/settings/test-key/route.js +1 -1
  156. package/_standalone/__next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  157. package/_standalone/__next/server/app/api/setup/check-path/route.js +1 -1
  158. package/_standalone/__next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  159. package/_standalone/__next/server/app/api/setup/check-port/route.js +1 -1
  160. package/_standalone/__next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  161. package/_standalone/__next/server/app/api/setup/generate-token/route.js +1 -1
  162. package/_standalone/__next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  163. package/_standalone/__next/server/app/api/setup/ls/route.js +1 -1
  164. package/_standalone/__next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  165. package/_standalone/__next/server/app/api/setup/route.js +1 -1
  166. package/_standalone/__next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  167. package/_standalone/__next/server/app/api/skills/route.js +1 -1
  168. package/_standalone/__next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  169. package/_standalone/__next/server/app/api/space-overview/route.js +1 -1
  170. package/_standalone/__next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
  171. package/_standalone/__next/server/app/api/sync/route.js +1 -1
  172. package/_standalone/__next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  173. package/_standalone/__next/server/app/api/tree-version/route.js +1 -1
  174. package/_standalone/__next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  175. package/_standalone/__next/server/app/api/uninstall/route.js +1 -1
  176. package/_standalone/__next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  177. package/_standalone/__next/server/app/api/update/route.js +1 -1
  178. package/_standalone/__next/server/app/api/update/route_client-reference-manifest.js +1 -1
  179. package/_standalone/__next/server/app/api/update-check/route.js +1 -1
  180. package/_standalone/__next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  181. package/_standalone/__next/server/app/api/update-status/route.js +1 -1
  182. package/_standalone/__next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  183. package/_standalone/__next/server/app/api/workflows/route.js +1 -1
  184. package/_standalone/__next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  185. package/_standalone/__next/server/app/capture/history/page.js +2 -2
  186. package/_standalone/__next/server/app/capture/history/page.js.nft.json +1 -1
  187. package/_standalone/__next/server/app/capture/history/page_client-reference-manifest.js +1 -1
  188. package/_standalone/__next/server/app/capture/page.js +2 -2
  189. package/_standalone/__next/server/app/capture/page.js.nft.json +1 -1
  190. package/_standalone/__next/server/app/capture/page_client-reference-manifest.js +1 -1
  191. package/_standalone/__next/server/app/changelog/page.js +2 -2
  192. package/_standalone/__next/server/app/changelog/page.js.nft.json +1 -1
  193. package/_standalone/__next/server/app/changelog/page_client-reference-manifest.js +1 -1
  194. package/_standalone/__next/server/app/changes/page.js +2 -2
  195. package/_standalone/__next/server/app/changes/page.js.nft.json +1 -1
  196. package/_standalone/__next/server/app/changes/page_client-reference-manifest.js +1 -1
  197. package/_standalone/__next/server/app/echo/[segment]/page.js +5 -5
  198. package/_standalone/__next/server/app/echo/[segment]/page.js.nft.json +1 -1
  199. package/_standalone/__next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  200. package/_standalone/__next/server/app/echo/page.js +2 -2
  201. package/_standalone/__next/server/app/echo/page.js.nft.json +1 -1
  202. package/_standalone/__next/server/app/echo/page_client-reference-manifest.js +1 -1
  203. package/_standalone/__next/server/app/explore/page.js +3 -3
  204. package/_standalone/__next/server/app/explore/page.js.nft.json +1 -1
  205. package/_standalone/__next/server/app/explore/page_client-reference-manifest.js +1 -1
  206. package/_standalone/__next/server/app/help/page.js +2 -2
  207. package/_standalone/__next/server/app/help/page.js.nft.json +1 -1
  208. package/_standalone/__next/server/app/help/page_client-reference-manifest.js +1 -1
  209. package/_standalone/__next/server/app/icon.svg/route.js +1 -1
  210. package/_standalone/__next/server/app/inbox/history/page.js +2 -2
  211. package/_standalone/__next/server/app/inbox/history/page.js.nft.json +1 -1
  212. package/_standalone/__next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
  213. package/_standalone/__next/server/app/login/page.js +2 -2
  214. package/_standalone/__next/server/app/login/page.js.nft.json +1 -1
  215. package/_standalone/__next/server/app/login/page_client-reference-manifest.js +1 -1
  216. package/_standalone/__next/server/app/page.js +2 -2
  217. package/_standalone/__next/server/app/page.js.nft.json +1 -1
  218. package/_standalone/__next/server/app/page_client-reference-manifest.js +1 -1
  219. package/_standalone/__next/server/app/settings/page.js +8 -3
  220. package/_standalone/__next/server/app/settings/page.js.nft.json +1 -1
  221. package/_standalone/__next/server/app/settings/page_client-reference-manifest.js +1 -1
  222. package/_standalone/__next/server/app/setup/page.js +2 -2
  223. package/_standalone/__next/server/app/setup/page.js.nft.json +1 -1
  224. package/_standalone/__next/server/app/setup/page_client-reference-manifest.js +1 -1
  225. package/_standalone/__next/server/app/todo/page.js +2 -2
  226. package/_standalone/__next/server/app/todo/page.js.nft.json +1 -1
  227. package/_standalone/__next/server/app/todo/page_client-reference-manifest.js +1 -1
  228. package/_standalone/__next/server/app/trash/page.js +3 -3
  229. package/_standalone/__next/server/app/trash/page.js.nft.json +1 -1
  230. package/_standalone/__next/server/app/trash/page_client-reference-manifest.js +1 -1
  231. package/_standalone/__next/server/app/view/[...path]/page.js +3 -3
  232. package/_standalone/__next/server/app/view/[...path]/page.js.nft.json +1 -1
  233. package/_standalone/__next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  234. package/_standalone/__next/server/app/wiki/page.js +2 -2
  235. package/_standalone/__next/server/app/wiki/page.js.nft.json +1 -1
  236. package/_standalone/__next/server/app/wiki/page_client-reference-manifest.js +1 -1
  237. package/_standalone/__next/server/app-paths-manifest.json +33 -33
  238. package/_standalone/__next/server/chunks/103.js +1 -1
  239. package/_standalone/__next/server/chunks/1665.js +3 -3
  240. package/_standalone/__next/server/chunks/{9773.js → 1855.js} +4 -4
  241. package/_standalone/__next/server/chunks/1976.js +1 -1
  242. package/_standalone/__next/server/chunks/2428.js +3 -3
  243. package/_standalone/__next/server/chunks/3466.js +1 -1
  244. package/_standalone/__next/server/chunks/4466.js +4 -4
  245. package/_standalone/__next/server/chunks/4793.js +1 -1
  246. package/_standalone/__next/server/chunks/6343.js +1 -0
  247. package/_standalone/__next/server/chunks/6377.js +3 -3
  248. package/_standalone/__next/server/chunks/6602.js +187 -0
  249. package/_standalone/__next/server/chunks/6646.js +16 -0
  250. package/_standalone/__next/server/chunks/8461.js +17 -17
  251. package/_standalone/__next/server/chunks/9868.js +2 -0
  252. package/_standalone/__next/server/middleware-build-manifest.js +1 -1
  253. package/_standalone/__next/server/middleware-react-loadable-manifest.js +1 -1
  254. package/_standalone/__next/server/middleware.js +2 -2
  255. package/_standalone/__next/server/pages/500.html +2 -2
  256. package/_standalone/__next/server/server-reference-manifest.js +1 -1
  257. package/_standalone/__next/server/server-reference-manifest.json +1 -1
  258. package/_standalone/__next/static/chunks/{1430-c4ffa328888515c1.js → 1104-0822d9349a412b9b.js} +7 -2
  259. package/_standalone/__next/static/chunks/1495-4e4ece56ffa8d568.js +1 -0
  260. package/_standalone/__next/static/chunks/1655.0a559759973b42e9.js +1 -0
  261. package/{static-web/_next/static/chunks/2073-3f913ebb13702b7e.js → _standalone/__next/static/chunks/2073-758ad3659b9d2cfc.js} +4 -4
  262. package/_standalone/__next/static/chunks/2303.da761b42cec4cd5c.js +1 -0
  263. package/{static-web/_next/static/chunks/4937-4101fcdadacf46e3.js → _standalone/__next/static/chunks/2409-244f9b90dceb0c04.js} +1 -1
  264. package/_standalone/__next/static/chunks/308-25a235e97ee9bfd4.js +14 -0
  265. package/_standalone/__next/static/chunks/3181-8c6aaeedf700984c.js +33 -0
  266. package/_standalone/__next/static/chunks/3279-b49c25a4f2964b16.js +1 -0
  267. package/_standalone/__next/static/chunks/3966.ea75f9c5490955de.js +1 -0
  268. package/_standalone/__next/static/chunks/4010.48b219cb22dfa5d8.js +10 -0
  269. package/_standalone/__next/static/chunks/5026-7fed7ca22272c18f.js +1 -0
  270. package/_standalone/__next/static/chunks/5152-87e6ed56dfd7d17d.js +1 -0
  271. package/_standalone/__next/static/chunks/525-b830b69e910a03f2.js +53 -0
  272. package/_standalone/__next/static/chunks/577.5e448c99068f1323.js +1 -0
  273. package/_standalone/__next/static/chunks/5840.ad2131db64e173a7.js +1 -0
  274. package/_standalone/__next/static/chunks/5881-f2bcf9869b07f268.js +1 -0
  275. package/_standalone/__next/static/chunks/5913.b07379f3c130378c.js +1 -0
  276. package/_standalone/__next/static/chunks/596.9cbaf6ba90cb204f.js +7 -0
  277. package/_standalone/__next/static/chunks/6223-3fb90852221bda56.js +1 -0
  278. package/_standalone/__next/static/chunks/6343.582d063078c45d73.js +6 -0
  279. package/_standalone/__next/static/chunks/7083-00c0b48d2a6b06dd.js +1 -0
  280. package/_standalone/__next/static/chunks/{5913.3cee388e26959b62.js → 8294.cc9f9ff2f8b219ed.js} +1 -1
  281. package/_standalone/__next/static/chunks/8626-7da79d9ab2504eed.js +1 -0
  282. package/{static-web/_next/static/chunks/6728.e1841cddb63308b0.js → _standalone/__next/static/chunks/8629.de25b1f455fe4ffa.js} +1 -1
  283. package/_standalone/__next/static/chunks/{8732.9002f42201b06fe8.js → 8732.87554c78e8825fac.js} +4 -4
  284. package/_standalone/__next/static/chunks/9479-ebd5043c9039f447.js +34 -0
  285. package/{static-web/_next/static/chunks/9602.4e99e3525e5f062c.js → _standalone/__next/static/chunks/9602.218427fc7b3d6b11.js} +1 -1
  286. package/_standalone/__next/static/chunks/app/_not-found/{page-eaedcec1b693c03c.js → page-ec6fa498a07e6fd9.js} +1 -1
  287. package/_standalone/__next/static/chunks/app/agents/[agentKey]/page-ef111ea0a3368752.js +1 -0
  288. package/_standalone/__next/static/chunks/app/agents/page-aacead0f47cedb0d.js +1 -0
  289. package/_standalone/__next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +1 -0
  290. package/_standalone/__next/static/chunks/app/capture/page-7f9e43ada77e7ad4.js +1 -0
  291. package/_standalone/__next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +1 -0
  292. package/_standalone/__next/static/chunks/app/changes/page-64cf8d751245eee9.js +1 -0
  293. package/_standalone/__next/static/chunks/app/echo/[segment]/{page-44b6b8e7fd0bbe31.js → page-c5ea40ac04f2dc29.js} +2 -2
  294. package/_standalone/__next/static/chunks/app/echo/page-64cf8d751245eee9.js +1 -0
  295. package/_standalone/__next/static/chunks/app/{error-1cfcd6abd93c3837.js → error-c46d1b03d5e3289c.js} +1 -1
  296. package/{static-web/_next/static/chunks/app/explore/page-117fcf54b8b9765c.js → _standalone/__next/static/chunks/app/explore/page-5d6dd4af8d1bb468.js} +1 -1
  297. package/_standalone/__next/static/chunks/app/global-error-d42727c6c6c48879.js +1 -0
  298. package/_standalone/__next/static/chunks/app/help/{page-6efb8aa3a3c169fa.js → page-3f0a1a8e51249cb2.js} +1 -1
  299. package/_standalone/__next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +1 -0
  300. package/_standalone/__next/static/chunks/app/layout-859f69bfc1960d30.js +99 -0
  301. package/_standalone/__next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +1 -0
  302. package/_standalone/__next/static/chunks/app/page-98737d491e89d3e1.js +1 -0
  303. package/_standalone/__next/static/chunks/app/settings/{page-f816f13a34613538.js → page-36ffdd1a8cc7eb2b.js} +1 -1
  304. package/_standalone/__next/static/chunks/app/setup/{page-a1027871dc33ffbd.js → page-034a608f19d04653.js} +1 -1
  305. package/_standalone/__next/static/chunks/app/todo/page-c7629a0c102c634f.js +1 -0
  306. package/_standalone/__next/static/chunks/app/trash/page-417d4e6dc8cd8d9b.js +1 -0
  307. package/_standalone/__next/static/chunks/app/view/[...path]/{error-c9a3f6de7c963c74.js → error-f73092e638a4e999.js} +1 -1
  308. package/_standalone/__next/static/chunks/app/view/[...path]/{not-found-5a4f2b4fbe28d617.js → not-found-80e5f4054819b372.js} +1 -1
  309. package/_standalone/__next/static/chunks/app/view/[...path]/page-3b0976dc13f3c49a.js +12 -0
  310. package/_standalone/__next/static/chunks/app/wiki/{page-7afd3b97c1ea1b8c.js → page-53dfa7d9fd1a0080.js} +2 -2
  311. package/_standalone/__next/static/chunks/{main-app-8a6081b103b8f494.js → main-app-23adfdc06470abb6.js} +1 -1
  312. package/_standalone/__next/static/chunks/webpack-e80a45ffc99584ae.js +1 -0
  313. package/_standalone/__next/static/css/db8559f3a861a510.css +1 -0
  314. package/_standalone/__node_modules/@aws-sdk/xml-builder/node_modules/.bin/fxparser +2 -2
  315. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/.bin/pi-ai +2 -2
  316. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  317. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  318. package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  319. package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  320. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/extract-zip +2 -2
  321. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/highlight +2 -2
  322. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/jiti +2 -2
  323. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/marked +2 -2
  324. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/pi-ai +2 -2
  325. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/yaml +2 -2
  326. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  327. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  328. package/_standalone/__node_modules/@mariozechner/pi-tui/node_modules/.bin/marked +2 -2
  329. package/_standalone/__node_modules/degenerator/node_modules/.bin/escodegen +2 -2
  330. package/_standalone/__node_modules/degenerator/node_modules/.bin/esgenerate +2 -2
  331. package/_standalone/__node_modules/degenerator/node_modules/.bin/esparse +2 -2
  332. package/_standalone/__node_modules/degenerator/node_modules/.bin/esvalidate +2 -2
  333. package/_standalone/__node_modules/escodegen/node_modules/.bin/esparse +2 -2
  334. package/_standalone/__node_modules/escodegen/node_modules/.bin/esvalidate +2 -2
  335. package/_standalone/__node_modules/global-agent/node_modules/.bin/semver +2 -2
  336. package/_standalone/__node_modules/jsdom/node_modules/.bin/specificity +2 -2
  337. package/_standalone/__node_modules/postcss/node_modules/.bin/nanoid +2 -2
  338. package/_standalone/__node_modules/tough-cookie/node_modules/.bin/tldts +2 -2
  339. package/_standalone/public/agent-icons/claude.svg +1 -0
  340. package/_standalone/public/agent-icons/cursor.svg +1 -0
  341. package/_standalone/public/agent-icons/github-copilot.svg +1 -0
  342. package/_standalone/public/agent-icons/google.svg +1 -0
  343. package/_standalone/public/agent-icons/openai.svg +1 -0
  344. package/_standalone/public/agent-icons/windsurf.svg +1 -0
  345. package/_standalone/server.js +1 -1
  346. package/bin/lib/stop.js +45 -0
  347. package/bin/lib/sync.js +32 -19
  348. package/dist/server/handlers/file.js +5 -2
  349. package/dist/server/handlers/file.js.map +1 -1
  350. package/dist/server/handlers/inbox.d.ts.map +1 -1
  351. package/dist/server/handlers/inbox.js +23 -2
  352. package/dist/server/handlers/inbox.js.map +1 -1
  353. package/dist/server/handlers/mcp-restart.d.ts +2 -0
  354. package/dist/server/handlers/mcp-restart.d.ts.map +1 -1
  355. package/dist/server/handlers/mcp-restart.js +45 -2
  356. package/dist/server/handlers/mcp-restart.js.map +1 -1
  357. package/dist/server/handlers/skills.d.ts.map +1 -1
  358. package/dist/server/handlers/skills.js +76 -8
  359. package/dist/server/handlers/skills.js.map +1 -1
  360. package/dist/server/handlers/sync.d.ts.map +1 -1
  361. package/dist/server/handlers/sync.js +28 -10
  362. package/dist/server/handlers/sync.js.map +1 -1
  363. package/dist/server/index.d.ts +1 -1
  364. package/dist/server/index.d.ts.map +1 -1
  365. package/dist/server/index.js +1 -1
  366. package/dist/server/index.js.map +1 -1
  367. package/dist/server/runtime.d.ts +1 -0
  368. package/dist/server/runtime.d.ts.map +1 -1
  369. package/dist/server/runtime.js +30 -22
  370. package/dist/server/runtime.js.map +1 -1
  371. package/package.json +1 -1
  372. package/runtime-manifest.json +1 -1
  373. package/scripts/build-bun-binary.mjs +139 -6
  374. package/scripts/prepare-static-web.mjs +52 -4
  375. package/scripts/release.sh +1 -1
  376. package/scripts/setup.js +115 -2
  377. package/static-web/.mindos-build-version +1 -1
  378. package/static-web/_next/static/chunks/{1430-c4ffa328888515c1.js → 1104-0822d9349a412b9b.js} +7 -2
  379. package/static-web/_next/static/chunks/1495-4e4ece56ffa8d568.js +1 -0
  380. package/static-web/_next/static/chunks/1655.0a559759973b42e9.js +1 -0
  381. package/{_standalone/__next/static/chunks/2073-3f913ebb13702b7e.js → static-web/_next/static/chunks/2073-758ad3659b9d2cfc.js} +4 -4
  382. package/static-web/_next/static/chunks/2303.da761b42cec4cd5c.js +1 -0
  383. package/{_standalone/__next/static/chunks/4937-4101fcdadacf46e3.js → static-web/_next/static/chunks/2409-244f9b90dceb0c04.js} +1 -1
  384. package/static-web/_next/static/chunks/308-25a235e97ee9bfd4.js +14 -0
  385. package/static-web/_next/static/chunks/3181-8c6aaeedf700984c.js +33 -0
  386. package/static-web/_next/static/chunks/3279-b49c25a4f2964b16.js +1 -0
  387. package/static-web/_next/static/chunks/3966.ea75f9c5490955de.js +1 -0
  388. package/static-web/_next/static/chunks/4010.48b219cb22dfa5d8.js +10 -0
  389. package/static-web/_next/static/chunks/5026-7fed7ca22272c18f.js +1 -0
  390. package/static-web/_next/static/chunks/5152-87e6ed56dfd7d17d.js +1 -0
  391. package/static-web/_next/static/chunks/525-b830b69e910a03f2.js +53 -0
  392. package/static-web/_next/static/chunks/577.5e448c99068f1323.js +1 -0
  393. package/static-web/_next/static/chunks/5840.ad2131db64e173a7.js +1 -0
  394. package/static-web/_next/static/chunks/5881-f2bcf9869b07f268.js +1 -0
  395. package/static-web/_next/static/chunks/5913.b07379f3c130378c.js +1 -0
  396. package/static-web/_next/static/chunks/596.9cbaf6ba90cb204f.js +7 -0
  397. package/static-web/_next/static/chunks/6223-3fb90852221bda56.js +1 -0
  398. package/static-web/_next/static/chunks/6343.582d063078c45d73.js +6 -0
  399. package/static-web/_next/static/chunks/7083-00c0b48d2a6b06dd.js +1 -0
  400. package/static-web/_next/static/chunks/{5913.3cee388e26959b62.js → 8294.cc9f9ff2f8b219ed.js} +1 -1
  401. package/static-web/_next/static/chunks/8626-7da79d9ab2504eed.js +1 -0
  402. package/{_standalone/__next/static/chunks/6728.e1841cddb63308b0.js → static-web/_next/static/chunks/8629.de25b1f455fe4ffa.js} +1 -1
  403. package/static-web/_next/static/chunks/{8732.9002f42201b06fe8.js → 8732.87554c78e8825fac.js} +4 -4
  404. package/static-web/_next/static/chunks/9479-ebd5043c9039f447.js +34 -0
  405. package/{_standalone/__next/static/chunks/9602.4e99e3525e5f062c.js → static-web/_next/static/chunks/9602.218427fc7b3d6b11.js} +1 -1
  406. package/static-web/_next/static/chunks/app/_not-found/{page-eaedcec1b693c03c.js → page-ec6fa498a07e6fd9.js} +1 -1
  407. package/static-web/_next/static/chunks/app/agents/[agentKey]/page-ef111ea0a3368752.js +1 -0
  408. package/static-web/_next/static/chunks/app/agents/page-aacead0f47cedb0d.js +1 -0
  409. package/static-web/_next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +1 -0
  410. package/static-web/_next/static/chunks/app/capture/page-7f9e43ada77e7ad4.js +1 -0
  411. package/static-web/_next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +1 -0
  412. package/static-web/_next/static/chunks/app/changes/page-64cf8d751245eee9.js +1 -0
  413. package/static-web/_next/static/chunks/app/echo/[segment]/{page-44b6b8e7fd0bbe31.js → page-c5ea40ac04f2dc29.js} +2 -2
  414. package/static-web/_next/static/chunks/app/echo/page-64cf8d751245eee9.js +1 -0
  415. package/static-web/_next/static/chunks/app/{error-1cfcd6abd93c3837.js → error-c46d1b03d5e3289c.js} +1 -1
  416. package/{_standalone/__next/static/chunks/app/explore/page-117fcf54b8b9765c.js → static-web/_next/static/chunks/app/explore/page-5d6dd4af8d1bb468.js} +1 -1
  417. package/static-web/_next/static/chunks/app/global-error-d42727c6c6c48879.js +1 -0
  418. package/static-web/_next/static/chunks/app/help/{page-6efb8aa3a3c169fa.js → page-3f0a1a8e51249cb2.js} +1 -1
  419. package/static-web/_next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +1 -0
  420. package/static-web/_next/static/chunks/app/layout-859f69bfc1960d30.js +99 -0
  421. package/static-web/_next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +1 -0
  422. package/static-web/_next/static/chunks/app/page-98737d491e89d3e1.js +1 -0
  423. package/static-web/_next/static/chunks/app/settings/{page-f816f13a34613538.js → page-36ffdd1a8cc7eb2b.js} +1 -1
  424. package/static-web/_next/static/chunks/app/setup/{page-a1027871dc33ffbd.js → page-034a608f19d04653.js} +1 -1
  425. package/static-web/_next/static/chunks/app/todo/page-c7629a0c102c634f.js +1 -0
  426. package/static-web/_next/static/chunks/app/trash/page-417d4e6dc8cd8d9b.js +1 -0
  427. package/static-web/_next/static/chunks/app/view/[...path]/{error-c9a3f6de7c963c74.js → error-f73092e638a4e999.js} +1 -1
  428. package/static-web/_next/static/chunks/app/view/[...path]/{not-found-5a4f2b4fbe28d617.js → not-found-80e5f4054819b372.js} +1 -1
  429. package/static-web/_next/static/chunks/app/view/[...path]/page-3b0976dc13f3c49a.js +12 -0
  430. package/static-web/_next/static/chunks/app/wiki/{page-7afd3b97c1ea1b8c.js → page-53dfa7d9fd1a0080.js} +2 -2
  431. package/static-web/_next/static/chunks/{main-app-8a6081b103b8f494.js → main-app-23adfdc06470abb6.js} +1 -1
  432. package/static-web/_next/static/chunks/webpack-e80a45ffc99584ae.js +1 -0
  433. package/static-web/_next/static/css/db8559f3a861a510.css +1 -0
  434. package/static-web/agent-icons/claude.svg +1 -0
  435. package/static-web/agent-icons/cursor.svg +1 -0
  436. package/static-web/agent-icons/github-copilot.svg +1 -0
  437. package/static-web/agent-icons/google.svg +1 -0
  438. package/static-web/agent-icons/openai.svg +1 -0
  439. package/static-web/agent-icons/windsurf.svg +1 -0
  440. package/static-web/help/index.html +13 -24
  441. package/static-web/index.html +15 -25
  442. package/static-web/setup/index.html +13 -24
  443. package/static-web/static-web-manifest.json +1 -1
  444. package/static-web/wiki/index.html +12 -23
  445. package/_standalone/__next/server/chunks/1834.js +0 -210
  446. package/_standalone/__next/server/chunks/2037.js +0 -2
  447. package/_standalone/__next/server/chunks/3727.js +0 -1
  448. package/_standalone/__next/server/chunks/9350.js +0 -11
  449. package/_standalone/__next/static/chunks/1957-723ac4eb5200214c.js +0 -33
  450. package/_standalone/__next/static/chunks/2288-4dcb8ad3ccbd651e.js +0 -1
  451. package/_standalone/__next/static/chunks/2303.ac755d2213a6ba9e.js +0 -1
  452. package/_standalone/__next/static/chunks/2737-f4970f0684c334d6.js +0 -48
  453. package/_standalone/__next/static/chunks/3424-060f01a8983e438d.js +0 -1
  454. package/_standalone/__next/static/chunks/4172-4fc551f07f7d082f.js +0 -1
  455. package/_standalone/__next/static/chunks/4454-f582e17b76ccf1d1.js +0 -1
  456. package/_standalone/__next/static/chunks/5152-2db55438be7ecb94.js +0 -1
  457. package/_standalone/__next/static/chunks/5200-6c82e5ce54a95b4b.js +0 -6
  458. package/_standalone/__next/static/chunks/5840.b812d86b830668e3.js +0 -1
  459. package/_standalone/__next/static/chunks/6272-6889f9239e888604.js +0 -14
  460. package/_standalone/__next/static/chunks/6274-f173cb227ad1ef21.js +0 -1
  461. package/_standalone/__next/static/chunks/6947.fb89346ef2f6be17.js +0 -1
  462. package/_standalone/__next/static/chunks/725-3b648bf7929ff78d.js +0 -1
  463. package/_standalone/__next/static/chunks/9479-7b304601a56304cd.js +0 -32
  464. package/_standalone/__next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js +0 -1
  465. package/_standalone/__next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js +0 -1
  466. package/_standalone/__next/static/chunks/app/capture/history/page-51db96203209a441.js +0 -1
  467. package/_standalone/__next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +0 -1
  468. package/_standalone/__next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +0 -1
  469. package/_standalone/__next/static/chunks/app/changes/page-c9f8d5632a001849.js +0 -1
  470. package/_standalone/__next/static/chunks/app/echo/page-c9f8d5632a001849.js +0 -1
  471. package/_standalone/__next/static/chunks/app/global-error-11b333dcf222bc09.js +0 -1
  472. package/_standalone/__next/static/chunks/app/inbox/history/page-913645bbd6161116.js +0 -1
  473. package/_standalone/__next/static/chunks/app/layout-24a31ea28c556e82.js +0 -114
  474. package/_standalone/__next/static/chunks/app/login/page-7f9aca3d51266bec.js +0 -1
  475. package/_standalone/__next/static/chunks/app/page-35662964020c0ea9.js +0 -1
  476. package/_standalone/__next/static/chunks/app/todo/page-54c3ec77f662ff73.js +0 -1
  477. package/_standalone/__next/static/chunks/app/trash/page-50622e3df2047204.js +0 -1
  478. package/_standalone/__next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js +0 -12
  479. package/_standalone/__next/static/chunks/webpack-7d8c24c6af17dd51.js +0 -1
  480. package/_standalone/__next/static/css/0d2fd378b5449176.css +0 -1
  481. package/static-web/_next/static/chunks/1957-723ac4eb5200214c.js +0 -33
  482. package/static-web/_next/static/chunks/2288-4dcb8ad3ccbd651e.js +0 -1
  483. package/static-web/_next/static/chunks/2303.ac755d2213a6ba9e.js +0 -1
  484. package/static-web/_next/static/chunks/2737-f4970f0684c334d6.js +0 -48
  485. package/static-web/_next/static/chunks/3424-060f01a8983e438d.js +0 -1
  486. package/static-web/_next/static/chunks/4172-4fc551f07f7d082f.js +0 -1
  487. package/static-web/_next/static/chunks/4454-f582e17b76ccf1d1.js +0 -1
  488. package/static-web/_next/static/chunks/5152-2db55438be7ecb94.js +0 -1
  489. package/static-web/_next/static/chunks/5200-6c82e5ce54a95b4b.js +0 -6
  490. package/static-web/_next/static/chunks/5840.b812d86b830668e3.js +0 -1
  491. package/static-web/_next/static/chunks/6272-6889f9239e888604.js +0 -14
  492. package/static-web/_next/static/chunks/6274-f173cb227ad1ef21.js +0 -1
  493. package/static-web/_next/static/chunks/6947.fb89346ef2f6be17.js +0 -1
  494. package/static-web/_next/static/chunks/725-3b648bf7929ff78d.js +0 -1
  495. package/static-web/_next/static/chunks/9479-7b304601a56304cd.js +0 -32
  496. package/static-web/_next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js +0 -1
  497. package/static-web/_next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js +0 -1
  498. package/static-web/_next/static/chunks/app/capture/history/page-51db96203209a441.js +0 -1
  499. package/static-web/_next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +0 -1
  500. package/static-web/_next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +0 -1
  501. package/static-web/_next/static/chunks/app/changes/page-c9f8d5632a001849.js +0 -1
  502. package/static-web/_next/static/chunks/app/echo/page-c9f8d5632a001849.js +0 -1
  503. package/static-web/_next/static/chunks/app/global-error-11b333dcf222bc09.js +0 -1
  504. package/static-web/_next/static/chunks/app/inbox/history/page-913645bbd6161116.js +0 -1
  505. package/static-web/_next/static/chunks/app/layout-24a31ea28c556e82.js +0 -114
  506. package/static-web/_next/static/chunks/app/login/page-7f9aca3d51266bec.js +0 -1
  507. package/static-web/_next/static/chunks/app/page-35662964020c0ea9.js +0 -1
  508. package/static-web/_next/static/chunks/app/todo/page-54c3ec77f662ff73.js +0 -1
  509. package/static-web/_next/static/chunks/app/trash/page-50622e3df2047204.js +0 -1
  510. package/static-web/_next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js +0 -12
  511. package/static-web/_next/static/chunks/webpack-7d8c24c6af17dd51.js +0 -1
  512. package/static-web/_next/static/css/0d2fd378b5449176.css +0 -1
  513. /package/_standalone/__next/static/{3FkuJxcda957EywJ5ZWWG → nrLECSDKmE4psF72Jmkoa}/_buildManifest.js +0 -0
  514. /package/_standalone/__next/static/{3FkuJxcda957EywJ5ZWWG → nrLECSDKmE4psF72Jmkoa}/_ssgManifest.js +0 -0
  515. /package/static-web/_next/static/{3FkuJxcda957EywJ5ZWWG → nrLECSDKmE4psF72Jmkoa}/_buildManifest.js +0 -0
  516. /package/static-web/_next/static/{3FkuJxcda957EywJ5ZWWG → nrLECSDKmE4psF72Jmkoa}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=1976,exports.ids=[1976],exports.modules={7017:(a,b,c)=>{c.d(b,{G:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);function h(a,b,c,d){let h=[],i=e().basename(b,".md"),j=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),k=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=[RegExp(`\\[\\[${k}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[\\[${j}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[[^\\]]+\\]\\(${j}(?:#[^)]*)?\\)`,"i"),RegExp(`\\[[^\\]]+\\]\\([^)]*${k}\\.md(?:#[^)]*)?\\)`,"i"),RegExp("`"+j.replace(/\//g,"\\/")+"`")];for(let e of c||(d?d.filter(a=>a.endsWith(".md")&&a!==b):(0,f.f)(a).filter(a=>a.endsWith(".md")&&a!==b))){let c;if(e===b)continue;try{c=(0,g.TA)(a,e)}catch{continue}let d=c.split("\n");for(let a=0;a<d.length;a++)if(l.some(b=>b.test(d[a]))){let b=a;for(;b>0&&b>a-3&&""!==d[b].trim();)b--;let c=a;for(;c<d.length-1&&c<a+3&&""!==d[c].trim();)c++;let f=d.slice(b,c+1).join("\n").trim();f=f.replace(/\n{2,}/g," ↵ "),h.push({source:e,line:a+1,context:f});break}}return h}},11976:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{El:()=>y,F2:()=>G,FR:()=>I,G1:()=>L,H5:()=>C,JX:()=>p,WZ:()=>D,_P:()=>z,f:()=>x,fu:()=>A,g7:()=>J,getFileTree:()=>w,gm:()=>q,mV:()=>H,startFileWatcher:()=>t,vg:()=>F,wf:()=>E,x3:()=>B,zK:()=>K});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(39852),j=c(72385),k=c(23414),l=c(28647),m=c(82614),n=c(28287),o=a([j,k]);function p(){return(0,k.kh)()}[j,k]=o.then?(await o)():o;let M=new Set([".git","node_modules","app",".next",".DS_Store",".media","mcp"]),N=new Set([".md",".csv",".json",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),O=null,P=0,Q=new j.Xs;function q(){O=null,P++,(0,j._E)(),Q.invalidate()}function r(a){O=null,P++,(0,j.KZ)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function s(){var a;let b,c,d,e;return null!==O&&Date.now()-O.timestamp<3e4?O:(a=p(),b=m.Y.startTimer("tree.cache.build"),c=function a(b,c){let d,e=c??p();try{d=f().readdirSync(b,{withFileTypes:!0})}catch{return[]}let g=[];for(let c of d){let d=h().join(b,c.name),i=h().relative(e,d);if(c.isDirectory()){if(M.has(c.name))continue;let b=a(d,e);if(b.length>0){let a=b.some(a=>"file"===a.type&&"INSTRUCTION.md"===a.name),e={name:c.name,path:i,type:"directory",children:b};a&&(e.isSpace=!0,e.spacePreview=function(a){let b,c=h().join(a,"INSTRUCTION.md"),d=h().join(a,"README.md"),e=v(d);try{let a=f().readFileSync(d,"utf-8").match(/<!-- mindos:compiled (\S+) files:\d+ -->/);a&&(b=a[1])}catch{}return{instructionLines:u(c,3),readmeLines:u(d,3),isTemplate:v(c)&&e,readmeIsTemplate:e,lastCompiled:b}}(d)),g.push(e)}}else if(c.isFile()){let a=h().extname(c.name).toLowerCase();N.has(a)&&g.push({name:c.name,path:i,type:"file",extension:a})}}return g.sort((a,b)=>a.type!==b.type?"directory"===a.type?-1:1:a.name.localeCompare(b.name)),g}(a),d=[],e=0,function a(b){for(let c of b)"file"===c.type?d.push(c.path):c.children&&(e++,a(c.children))}(c),b({fileCount:d.length,directoryCount:e}),O={tree:c,allFiles:d,timestamp:Date.now()},R||t(),O)}let R=null,S=null;function t(){let a;if(!R){try{a=p()}catch{return}try{(R=f().watch(a,{recursive:!0},(a,b)=>{!b||b.startsWith(".git")||b.includes("node_modules")||b.includes(".next")||(S&&clearTimeout(S),S=setTimeout(()=>{O=null,P++,S=null},500))})).on("error",()=>{S&&(clearTimeout(S),S=null),R&&(R.close(),R=null)})}catch{R=null}}}function u(a,b){try{let c=f().readFileSync(a,"utf-8"),d=[];for(let a of c.split("\n")){let c=a.trim();if(!(!c||c.startsWith("#"))&&(d.push(c),d.length>=b))break}return d}catch{return[]}}let T=["Define local execution rules for this directory.","(your files here)","(Describe the purpose and usage of this space.)","(Add usage guidelines for this space.)"];function v(a){try{let b=f().readFileSync(a,"utf-8");return T.some(a=>b.includes(a))}catch{return!1}}function w(){return s().tree}function x(){return s().allFiles}function y(a=10){let b=p(),c=x().map(a=>{try{let c=(0,j.n2)(b,a),d=f().statSync(c);return{path:a,mtime:d.mtimeMs}}catch{return null}}).filter(Boolean);return c.sort((a,b)=>b.mtime-a.mtime),c.slice(0,a)}function z(a){let b=p();if(".pdf"===h().extname(a).toLowerCase()){let c=(0,j.n2)(b,a);if(!f().existsSync(c))throw new i.Vt(i.tG.FILE_NOT_FOUND,`File not found: ${a}`,{filePath:a});let d=(0,l.b)(c);if(!d)throw new i.Vt(i.tG.INTERNAL_ERROR,`Could not extract text from PDF: ${a}`,{filePath:a});return d}return(0,j.TA)(b,a)}function A(a,b){(0,j._h)(p(),a,b),r(a)}function B(a,b=""){(0,j.x3)(p(),a,b),O=null,P++,(0,j.As)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function C(a,b){let c=(0,j.H5)(p(),a,b);return q(),c}function D(a,b){(0,j.WZ)(p(),a,b),r(a)}function E(a,b,c){(0,j.wf)(p(),a,b,c),r(a)}function F(a,b,c){(0,j.vg)(p(),a,b,c),r(a)}function G(a,b){let c=(0,j.F2)(p(),a,b);return r(a),c}function H(a,b){let c=(0,j.mV)(p(),a,b,j.G1);return q(),c}function I(a,b=10){return(0,j.FR)(p(),a,b)}function J(a,b){return(0,j.g7)(p(),a,b)}function K(a){let b=(0,n.F0)(p(),a);return q(),b}function L(a){let b,c=p(),d=(b=p(),!Q.isBuiltFor(b)&&Q.rebuild(b),Q).getBacklinks(a);return(0,j.G1)(c,a,d)}d()}catch(a){d(a)}})},12169:(a,b,c)=>{c.d(b,{FR:()=>f,g7:()=>g});var d=c(79646),e=c(13308);function f(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["log","--follow","--format=%H%x00%aI%x00%s%x00%an","-n",String(c),"--",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?g.split("\n").map(a=>{let[b,c,d,e]=a.split("\0");return{hash:b,date:c,message:d,author:e}}):[]}function g(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["ls-files","--full-name",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?(0,d.execFileSync)("git",["show",`${c}:${g}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}):(0,d.execFileSync)("git",["show",`${c}:${b}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}},13308:(a,b,c)=>{c.d(b,{cP:()=>A,n2:()=>B});var d=c(33873),e=c.n(d),f=c(29021),g=c.n(f);class h extends Error{constructor(a,b,c,d){super(a),this.name=this.constructor.name,this.code=b,this.statusCode=c,this.context=d?.context,this.cause=d?.cause,this.metadata={timestamp:Date.now(),...d?.metadata},Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,context:this.context,metadata:this.metadata,stack:this.stack}}toUserMessage(){return this.message}}let i={VALIDATION_ERROR:400,NOT_FOUND:404,UNAUTHORIZED:401,FORBIDDEN:403,CONFLICT:409,INTERNAL_ERROR:500,SERVICE_UNAVAILABLE:503,TIMEOUT:408,RATE_LIMIT_EXCEEDED:429,FILE_SYSTEM_ERROR:500,FILE_READ_ERROR:500,FILE_WRITE_ERROR:500,FILE_STAT_ERROR:500,FILE_REMOVE_ERROR:500,FILE_COPY_ERROR:500,FILE_MOVE_ERROR:500,FILE_WATCH_ERROR:500,DIRECTORY_READ_ERROR:500,DIRECTORY_CREATE_ERROR:500,DATABASE_ERROR:500,NETWORK_ERROR:500,CONFIGURATION_ERROR:500,SEARCH_ERROR:500,VECTOR_ERROR:500,MCP_ERROR:500},j={VALIDATION_ERROR:"Validation failed",NOT_FOUND:"Resource not found",UNAUTHORIZED:"Unauthorized access",FORBIDDEN:"Access forbidden",CONFLICT:"Resource conflict",INTERNAL_ERROR:"Internal server error",SERVICE_UNAVAILABLE:"Service unavailable",TIMEOUT:"Operation timed out",RATE_LIMIT_EXCEEDED:"Rate limit exceeded",FILE_SYSTEM_ERROR:"File system operation failed",FILE_READ_ERROR:"Failed to read file",FILE_WRITE_ERROR:"Failed to write file",FILE_STAT_ERROR:"Failed to get file stats",FILE_REMOVE_ERROR:"Failed to remove file",FILE_COPY_ERROR:"Failed to copy file",FILE_MOVE_ERROR:"Failed to move file",FILE_WATCH_ERROR:"Failed to watch file",DIRECTORY_READ_ERROR:"Failed to read directory",DIRECTORY_CREATE_ERROR:"Failed to create directory",DATABASE_ERROR:"Database operation failed",NETWORK_ERROR:"Network operation failed",CONFIGURATION_ERROR:"Configuration error",SEARCH_ERROR:"Search operation failed",VECTOR_ERROR:"Vector operation failed",MCP_ERROR:"MCP operation failed"};function k(a,b,c){let d=i[a],e=j[a];return new h(b??e,a,d,{...c,metadata:{...c?.metadata,retryable:["SERVICE_UNAVAILABLE","TIMEOUT","NETWORK_ERROR"].includes(a),retryAfter:function(a){switch(a){case"RATE_LIMIT_EXCEEDED":return 6e4;case"SERVICE_UNAVAILABLE":return 5e3;case"TIMEOUT":return 1e3;case"NETWORK_ERROR":return 2e3;default:return 0}}(a)}})}let l=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,m=/[<>:"|?*\x00-\x1f]/;function n(a){return/^[A-Za-z]:/.test(a)}function o(a,b){let c,e,f;if(c=d.resolve(b),e=d.resolve(a),""!==(f=d.relative(c,e))&&(".."===f||f.startsWith(`..${d.sep}`)||d.isAbsolute(f)))throw k("VALIDATION_ERROR","Access denied: path outside root",{context:{resolved:a,root:b}})}function p(a,b,c,d,e,f){return{path:a,webRouteFile:`packages/web/app${a}/route.ts`,owner:b,adapter:c,phase:d,risk:e,residualRisk:f}}let q=(a,b="low")=>p(a,"product-owned","next-response","Phase 1: migrated Product Server adapter",b,"No residual product ownership expected; this route should remain a thin Next adapter."),r=(a,b,c,d)=>p(a,"optional-capability","optional-capability",b,c,d),s=(a,b,c="medium")=>p(a,"host-owned","host","Host-owned",c,b);[q("/api/a2a/agents","medium"),q("/api/a2a/delegations","medium"),q("/api/a2a/discover","medium"),q("/api/a2a","medium"),q("/api/acp/config","high"),q("/api/acp/detect","medium"),q("/api/acp/install","high"),q("/api/acp/registry","medium"),q("/api/acp/session","high"),q("/api/agent-activity"),q("/api/agents/copy-skill","high"),q("/api/agents/custom/detect","medium"),q("/api/agents/custom","high"),q("/api/ask-sessions"),p("/api/ask","product-owned","stream","Phase 6: generated client and stream adapter","high","Ask is mostly Product runtime-owned through session and agent modules, but the streaming Web route still owns host assembly and should become a generated stream adapter."),s("/api/auth","Auth cookie/session handling is host-specific today; Product Server will need an auth context adapter before direct HTTP exposure.","high"),q("/api/backlinks"),q("/api/bootstrap"),q("/api/changes"),q("/api/channels/verify","medium"),q("/api/connect"),q("/api/embedding","medium"),r("/api/export","Phase 5: content ingestion optional capabilities","high","Export/archive logic carries heavy dependencies and filesystem writes that need optional capability packaging."),r("/api/extract-docx","Phase 5: content ingestion optional capabilities","high","DOCX extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/extract-pdf","Phase 5: content ingestion optional capabilities","high","PDF extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/file/import","Phase 5: content ingestion optional capabilities","high","File import is a content-ingestion write path and needs capability-level size limits, conflict checks, and rollback."),q("/api/file/raw"),q("/api/file","high"),q("/api/files"),q("/api/git"),q("/api/graph"),q("/api/health"),q("/api/im/activity","medium"),q("/api/im/config","high"),s("/api/im/feishu/long-connection/event","Raw long-connection event delivery is host-specific, but event parsing and state updates should stay behind Product protocol handlers.","medium"),q("/api/im/feishu/long-connection","high"),q("/api/im/status","medium"),q("/api/im/test","medium"),q("/api/im/webhook-status","medium"),s("/api/im/webhook/feishu","Raw inbound Feishu webhook receipt is host-owned, while signature verification and state writes should move to Product protocol handlers.","high"),r("/api/inbox/clip","Phase 5: content ingestion optional capabilities","high","Inbox clipping is still Web-owned ingestion and needs optional capability packaging plus fetch timeout and content limits."),q("/api/inbox","medium"),q("/api/init","high"),r("/api/lint","Phase 5: content ingestion optional capabilities","medium","Knowledge linting remains Web-owned and should become an optional Product capability with bounded filesystem traversal."),q("/api/mcp/agents","high"),q("/api/mcp/direct-tools","medium"),q("/api/mcp/install-skill","high"),q("/api/mcp/install","high"),q("/api/mcp/restart","high"),q("/api/mcp/status"),q("/api/mcp/tools","medium"),q("/api/mcp/uninstall","high"),q("/api/monitoring","medium"),r("/api/obsidian-plugins/settings","Phase 5: content ingestion optional capabilities","medium","Obsidian plugin settings remain Web-owned and should be modeled as an optional Product compatibility capability."),r("/api/obsidian/compat-report","Phase 5: content ingestion optional capabilities","medium","Obsidian compatibility reporting remains Web-owned and should use optional capability diagnostics."),r("/api/obsidian/import","Phase 5: content ingestion optional capabilities","high","Obsidian import remains a Web-owned bulk write path and needs optional capability size limits and rollback."),q("/api/recent-files"),q("/api/restart","high"),q("/api/search/prewarm"),q("/api/search"),q("/api/settings/list-models","medium"),q("/api/settings/reset-token","high"),q("/api/settings","medium"),q("/api/settings/test-key","medium"),q("/api/setup/check-path","medium"),q("/api/setup/check-port","medium"),q("/api/setup/generate-token","medium"),q("/api/setup/ls","medium"),q("/api/setup","high"),q("/api/skills","high"),q("/api/space-overview"),q("/api/sync","high"),q("/api/tree-version"),q("/api/uninstall","high"),q("/api/update-check"),q("/api/update-status"),q("/api/update","high"),q("/api/workflows","medium")].map(a=>[a.path,a]),c(51455),c(73024);var t=c(76760);c(77598);var u=c(48161);function v(a){return"darwin"===process.platform?a.darwin:"win32"===process.platform?`${(process.env.APPDATA||(0,t.join)((0,u.homedir)(),"AppData","Roaming")).replace(/\\/g,"/").replace(/\/+$/,"")}/${a.win32}`:a.linux}c(37067),c(73136),v({darwin:"~/Library/Application Support/Code/User",linux:"~/.config/Code/User",win32:"Code/User"}),v({darwin:"~/Library/Application Support/Code",linux:"~/.config/Code",win32:"Code"}),v({darwin:"~/Library/Application Support/Trae CN",linux:"~/.config/Trae CN",win32:"Trae CN"}),c(31421),c(50294);var w=c(79646);(0,c(28354).promisify)(w.execFile),(0,t.join)((0,u.homedir)(),".mindos","im-activity.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),c(21820),c(77030),c(38264);let x=(0,t.join)((0,u.homedir)(),".mindos");(0,t.join)(x,"config.json"),(0,t.join)(x,"sync-state.json"),[{id:"health",method:"GET",path:"/api/health",auth:"public"},{id:"files",method:"GET",path:"/api/files",auth:"required"},{id:"recent-files",method:"GET",path:"/api/recent-files",auth:"required"},{id:"tree-version",method:"GET",path:"/api/tree-version",auth:"required"},{id:"file.read",method:"GET",path:"/api/file",auth:"required"},{id:"file.write",method:"POST",path:"/api/file",auth:"required"},{id:"file.raw",method:"GET",path:"/api/file/raw",auth:"required"},{id:"search",method:"GET",path:"/api/search",auth:"required"},{id:"search.prewarm",method:"GET",path:"/api/search/prewarm",auth:"required"},{id:"a2a",method:"POST",path:"/api/a2a",auth:"required"},{id:"a2a.options",method:"OPTIONS",path:"/api/a2a",auth:"public"},{id:"a2a.agents",method:"GET",path:"/api/a2a/agents",auth:"required"},{id:"a2a.delegations",method:"GET",path:"/api/a2a/delegations",auth:"required"},{id:"a2a.discover",method:"POST",path:"/api/a2a/discover",auth:"required"},{id:"acp.config",method:"GET",path:"/api/acp/config",auth:"required"},{id:"acp.config.update",method:"POST",path:"/api/acp/config",auth:"required"},{id:"acp.config.delete",method:"DELETE",path:"/api/acp/config",auth:"required"},{id:"acp.detect",method:"GET",path:"/api/acp/detect",auth:"required"},{id:"acp.install",method:"POST",path:"/api/acp/install",auth:"required"},{id:"acp.registry",method:"GET",path:"/api/acp/registry",auth:"required"},{id:"acp.session",method:"GET",path:"/api/acp/session",auth:"required"},{id:"acp.session.action",method:"POST",path:"/api/acp/session",auth:"required"},{id:"acp.session.close",method:"DELETE",path:"/api/acp/session",auth:"required"},{id:"backlinks",method:"GET",path:"/api/backlinks",auth:"required"},{id:"graph",method:"GET",path:"/api/graph",auth:"required"},{id:"agent-activity",method:"GET",path:"/api/agent-activity",auth:"required"},{id:"bootstrap",method:"GET",path:"/api/bootstrap",auth:"required"},{id:"connect",method:"GET",path:"/api/connect",auth:"required"},{id:"embedding",method:"GET",path:"/api/embedding",auth:"required"},{id:"embedding.action",method:"POST",path:"/api/embedding",auth:"required"},{id:"channels.verify",method:"POST",path:"/api/channels/verify",auth:"required"},{id:"im.activity",method:"GET",path:"/api/im/activity",auth:"required"},{id:"im.config",method:"GET",path:"/api/im/config",auth:"required"},{id:"im.config.update",method:"PUT",path:"/api/im/config",auth:"required"},{id:"im.config.delete",method:"DELETE",path:"/api/im/config",auth:"required"},{id:"im.status",method:"GET",path:"/api/im/status",auth:"required"},{id:"im.test",method:"POST",path:"/api/im/test",auth:"required"},{id:"im.webhook-status",method:"GET",path:"/api/im/webhook-status",auth:"required"},{id:"im.feishu.long-connection",method:"GET",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.start",method:"POST",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.stop",method:"DELETE",path:"/api/im/feishu/long-connection",auth:"required"},{id:"monitoring",method:"GET",path:"/api/monitoring",auth:"required"},{id:"update-status",method:"GET",path:"/api/update-status",auth:"required"},{id:"update-check",method:"GET",path:"/api/update-check",auth:"required"},{id:"restart",method:"POST",path:"/api/restart",auth:"required"},{id:"update",method:"POST",path:"/api/update",auth:"required"},{id:"uninstall",method:"POST",path:"/api/uninstall",auth:"required"},{id:"init",method:"POST",path:"/api/init",auth:"required"},{id:"sync",method:"GET",path:"/api/sync",auth:"required"},{id:"sync.action",method:"POST",path:"/api/sync",auth:"required"},{id:"inbox",method:"GET",path:"/api/inbox",auth:"required"},{id:"inbox.save",method:"POST",path:"/api/inbox",auth:"required"},{id:"inbox.archive",method:"DELETE",path:"/api/inbox",auth:"required"},{id:"setup.check-path",method:"POST",path:"/api/setup/check-path",auth:"required"},{id:"setup.check-port",method:"POST",path:"/api/setup/check-port",auth:"required"},{id:"setup.generate-token",method:"POST",path:"/api/setup/generate-token",auth:"required"},{id:"setup.ls",method:"POST",path:"/api/setup/ls",auth:"required"},{id:"setup",method:"GET",path:"/api/setup",auth:"required"},{id:"setup.apply",method:"POST",path:"/api/setup",auth:"required"},{id:"setup.guide-state",method:"PATCH",path:"/api/setup",auth:"required"},{id:"workflows",method:"GET",path:"/api/workflows",auth:"required"},{id:"workflows.create",method:"POST",path:"/api/workflows",auth:"required"},{id:"ask.stream",method:"POST",path:"/api/ask",auth:"required"},{id:"ask-sessions",method:"GET",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.save",method:"POST",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.delete",method:"DELETE",path:"/api/ask-sessions",auth:"required"},{id:"space-overview",method:"GET",path:"/api/space-overview",auth:"required"},{id:"git",method:"GET",path:"/api/git",auth:"required"},{id:"settings",method:"GET",path:"/api/settings",auth:"required"},{id:"settings.update",method:"POST",path:"/api/settings",auth:"required"},{id:"settings.reset-token",method:"POST",path:"/api/settings/reset-token",auth:"required"},{id:"settings.test-key",method:"POST",path:"/api/settings/test-key",auth:"required"},{id:"settings.list-models",method:"POST",path:"/api/settings/list-models",auth:"required"},{id:"mcp.status",method:"GET",path:"/api/mcp/status",auth:"required"},{id:"mcp.agents",method:"GET",path:"/api/mcp/agents",auth:"required"},{id:"mcp.tools",method:"GET",path:"/api/mcp/tools",auth:"required"},{id:"mcp.direct-tools",method:"POST",path:"/api/mcp/direct-tools",auth:"required"},{id:"mcp.install",method:"POST",path:"/api/mcp/install",auth:"required"},{id:"mcp.install-skill",method:"POST",path:"/api/mcp/install-skill",auth:"required"},{id:"mcp.restart",method:"POST",path:"/api/mcp/restart",auth:"required"},{id:"mcp.uninstall",method:"POST",path:"/api/mcp/uninstall",auth:"required"},{id:"skills",method:"GET",path:"/api/skills",auth:"required"},{id:"skills.action",method:"POST",path:"/api/skills",auth:"required"},{id:"changes",method:"GET",path:"/api/changes",auth:"required"},{id:"changes.mark-seen",method:"POST",path:"/api/changes",auth:"required"},{id:"agents.custom.create",method:"POST",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.update",method:"PUT",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.delete",method:"DELETE",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.detect",method:"POST",path:"/api/agents/custom/detect",auth:"required"},{id:"agents.copy-skill",method:"POST",path:"/api/agents/copy-skill",auth:"required"}].map(a=>[`${a.method} ${a.path}`,a.auth]),c(84389);var y=c(39852);function z(a,b){return a instanceof y.Vt?a:new y.Vt(y.tG.PATH_OUTSIDE_ROOT,a?.message||"Access denied: path outside MIND_ROOT",a?.context??b)}function A(a,b){try{o(a,b)}catch(c){throw z(c,{resolved:a,root:b})}}function B(a,b){var c,f;let h,i,j,p,q,r=function(a,b){try{let g=b.replace(/\\/g,"/");if(d.isAbsolute(g)||d.win32.isAbsolute(b)||d.win32.isAbsolute(g)||n(b)||n(g))throw k("VALIDATION_ERROR","Access denied: absolute paths are not allowed",{context:{root:a,filePath:b}});var c=a,e=b,f=g;for(let a of f.split("/"))if(a&&"."!==a&&(a.endsWith(".")||a.endsWith(" ")||l.test(a)||m.test(a)))throw k("VALIDATION_ERROR","Access denied: path contains a Windows-invalid file name segment",{context:{root:c,filePath:e,segment:a}});let h=d.resolve(a),i=d.resolve(d.join(h,g));return o(i,h),i}catch(c){throw z(c,{mindRoot:a,filePath:b})}}(a,b),s=function(a){let b=a;for(;!g().existsSync(b);){let a=e().dirname(b);if(a===b)break;b=a}return b}(r);try{h=g().realpathSync(e().resolve(a)),i=g().realpathSync(s)}catch(c){throw z(c,{mindRoot:a,filePath:b,resolved:r,existing:s})}if(c=i,f=h,j=e().resolve(f),p=e().resolve(c),""!==(q=e().relative(j,p))&&(".."===q||q.startsWith(`..${e().sep}`)||e().isAbsolute(q)))throw new y.Vt(y.tG.PATH_OUTSIDE_ROOT,"Access denied: symlink resolves outside MIND_ROOT",{mindRoot:a,filePath:b,resolved:r,existing:s,targetReal:i});return r}},14360:(a,b,c)=>{c.d(b,{P2:()=>j,WZ:()=>k,vg:()=>m,wf:()=>l});var d=c(29021),e=c.n(d),f=c(59349),g=c(39852),h=c(13308);function i(a,b){return(0,f.TA)(a,b).split("\n")}function j(a,b,c,d,e){let h=i(a,b);var j=h.length;if(c<0||d<0)throw new g.Vt(g.tG.INVALID_RANGE,"Invalid line index: indices must be >= 0",{start:c,end:d});if(c>d)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid range: start (${c}) > end (${d})`,{start:c,end:d});if(c>=j)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid line index: start (${c}) >= total lines (${j})`,{start:c,totalLines:j});h.splice(c,d-c+1,...e),(0,f._h)(a,b,h.join("\n"))}function k(a,b,c){let d=(0,h.n2)(a,b);try{let a=e().statSync(d);if(0===a.size)return void e().appendFileSync(d,c,"utf-8");let b=Math.min(8,a.size),f=e().openSync(d,"r");try{let g=Buffer.alloc(b);e().readSync(f,g,0,b,Math.max(0,a.size-b));let h=g.toString("utf-8").endsWith("\n\n")?"":"\n";e().appendFileSync(d,h+c,"utf-8")}finally{e().closeSync(f)}}catch(g){let d=(0,f.TA)(a,b),e=d.length>0&&!d.endsWith("\n\n")?"\n":"";(0,f._h)(a,b,d+e+c)}}function l(a,b,c,d){let e=i(a,b),h=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===h)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let j=h+1;for(;j<e.length&&""===e[j].trim();)j++;!function(a,b,c,d){let e=i(a,b);if(c>=e.length)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid after_index: ${c} >= total lines (${e.length})`,{afterIndex:c,totalLines:e.length});e.splice(c<0?0:c+1,0,...d),(0,f._h)(a,b,e.join("\n"))}(a,b,j-1,["",d])}function m(a,b,c,d){let e=i(a,b),f=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===f)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let h=(e[f].match(/^#+/)??[""])[0].length,k=e.length-1;for(let a=f+1;a<e.length;a++){let b=e[a].match(/^(#+)\s/);if(b&&b[1].length<=h){k=a-1;break}}for(;k>f&&""===e[k].trim();)k--;j(a,b,f+1,k,["",d])}},22288:(a,b,c)=>{var d=c(73566),e=c(31751),f=c(59349),g=c(13308),h=c(28647),i=c(87155),j=c(33873),k=c.n(j);let l="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function m(a,b){for(let c=0;c<a.length;c++)b.add(a[c]),c+1<a.length&&b.add(a[c]+a[c+1])}if(d.parentPort&&d.workerData?.mindRoot)try{let a=function(a){let b=(0,e.f)(a),c={},d={},j=0;for(let e of b){let b;if(".pdf"===k().extname(e).toLowerCase())try{let c=(0,g.n2)(a,e);if(!(b=(0,h.b)(c)))continue}catch{continue}else try{b=(0,f.TA)(a,e)}catch{continue}for(let a of(d[e]=b.length,j+=b.length,b.length>5e4&&(b=b.slice(0,5e4)),function(a){let b=new Set,c=a.toLowerCase(),d=c.match(/[a-z0-9_$@#]+/g);if(d)for(let a of d)a.length>=2&&b.add(a);if(i.y.test(c))if(l)for(let{segment:a,isWordLike:d}of l.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))i.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)i.y.test(d)?a.push(d):a.length>0&&(m(a,b),a.length=0);a.length>0&&m(a,b)}return b}(e+"\n"+b)))c[a]||(c[a]=[]),c[a].push(e)}return{version:1,builtForRoot:a,fileCount:b.length,totalChars:j,docLengths:d,invertedIndex:c,timestamp:Date.now()}}(d.workerData.mindRoot);d.parentPort.postMessage({ok:!0,data:a})}catch(a){d.parentPort.postMessage({ok:!1,error:a instanceof Error?a.message:String(a)})}},23414:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Sf:()=>p,kh:()=>q,sb:()=>o});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(28696),l=c(31756),m=c(62697),n=a([l,m]);[l,m]=n.then?(await n)():n;let r=h().join(j().homedir(),".mindos","config.json"),s={ai:{activeProvider:"",providers:[]},mindRoot:""},t=new Set(["free","tavily","brave","serper","bing-api"]);function o(){try{var a;let c=f().readFileSync(r,"utf-8"),d=JSON.parse(c),e=d.ai,g=e&&!Array.isArray(e.providers),i={ai:function(a){let b=a.ai;if(!b)return{...s.ai};if(Array.isArray(b.providers)){let a=(0,m.S9)(b.providers),c="string"==typeof b.activeProvider?b.activeProvider:"";return{activeProvider:function(a,b){if(a&&(0,m.Ny)(a)&&(0,m.lh)(b,a))return a;if(a&&(0,l.rl)(a)){let c=b.find(b=>b.protocol===a);if(c)return c.id}return b[0]?.id??""}(c,a),providers:a}}let c=(0,m.Ko)(a);return c?{activeProvider:c.activeProvider,providers:c.providers}:{...s.ai}}(d),agent:function(a){if(!a||"object"!=typeof a)return;let b={};return"number"==typeof a.maxSteps&&(b.maxSteps=Math.min(999,Math.max(1,a.maxSteps))),"boolean"==typeof a.enableThinking&&(b.enableThinking=a.enableThinking),"number"==typeof a.thinkingBudget&&(b.thinkingBudget=Math.min(5e4,Math.max(1e3,a.thinkingBudget))),("auto"===a.contextStrategy||"off"===a.contextStrategy)&&(b.contextStrategy=a.contextStrategy),"number"==typeof a.reconnectRetries&&(b.reconnectRetries=Math.min(10,Math.max(0,a.reconnectRetries))),Object.keys(b).length>0?b:void 0}(d.agent),embedding:function(a){if(!a||"object"!=typeof a||"boolean"!=typeof a.enabled)return;let b="local"===a.provider||"api"===a.provider?a.provider:"api";return{enabled:a.enabled,provider:b,baseUrl:"string"==typeof a.baseUrl?a.baseUrl:"",apiKey:"string"==typeof a.apiKey?a.apiKey:"",model:"string"==typeof a.model?a.model:""}}(d.embedding),webSearch:function(a){if(a&&"object"==typeof a)return{provider:"string"==typeof a.provider&&t.has(a.provider)?a.provider:"free",apiKey:"string"==typeof a.apiKey?a.apiKey:""}}(d.webSearch),acpAgents:(a=d.acpAgents,(0,k.gG)(a)),mindRoot:d.mindRoot??s.mindRoot,webPassword:"string"==typeof d.webPassword?d.webPassword:void 0,authToken:"string"==typeof d.authToken?d.authToken:void 0,allowNetworkAccess:!0===d.allowNetworkAccess,mcpPort:"number"==typeof d.mcpPort?d.mcpPort:void 0,port:"number"==typeof d.port?d.port:void 0,startMode:"string"==typeof d.startMode?d.startMode:void 0,setupPending:!0===d.setupPending||void 0,disabledSkills:Array.isArray(d.disabledSkills)?d.disabledSkills:void 0,guideState:function(a){if(!a||"object"!=typeof a||!0!==a.active)return;let b="en"===a.template||"zh"===a.template||"empty"===a.template?a.template:"en";return{active:!0,dismissed:!0===a.dismissed,template:b,step1Done:!0===a.step1Done,askedAI:!0===a.askedAI,nextStepIndex:"number"==typeof a.nextStepIndex?a.nextStepIndex:0,walkthroughStep:"number"==typeof a.walkthroughStep?a.walkthroughStep:void 0,walkthroughDismissed:"boolean"==typeof a.walkthroughDismissed?a.walkthroughDismissed:void 0}}(d.guideState),baseUrlCompat:(()=>{let a=d.baseUrlCompat;if(!a||"object"!=typeof a)return;let b={};for(let[c,d]of Object.entries(a))("streaming"===d||"non-streaming"===d)&&(b[c]=d);return Object.keys(b).length>0?b:void 0})(),connectionMode:function(a){if(a.connectionMode&&"object"==typeof a.connectionMode){let b=a.connectionMode;if("boolean"==typeof b.cli&&"boolean"==typeof b.mcp)return{cli:b.cli,mcp:b.mcp}}let b=!0===a.setupPending||!a.mindRoot;return{cli:!0,mcp:!b}}(d),customAgents:Array.isArray(d.customAgents)?d.customAgents:void 0};if(g)try{var b=i;let a=h().dirname(r);f().existsSync(a)||f().mkdirSync(a,{recursive:!0});let c={};try{c=JSON.parse(f().readFileSync(r,"utf-8"))}catch{}let d={...c,ai:b.ai,mindRoot:b.mindRoot};void 0!==b.agent&&(d.agent=b.agent),void 0!==b.embedding&&(d.embedding=b.embedding),void 0!==b.webSearch&&(d.webSearch=b.webSearch),void 0!==b.webPassword&&(d.webPassword=b.webPassword),void 0!==b.authToken&&(d.authToken=b.authToken),"boolean"==typeof b.allowNetworkAccess&&(d.allowNetworkAccess=b.allowNetworkAccess),void 0!==b.port&&(d.port=b.port),void 0!==b.mcpPort&&(d.mcpPort=b.mcpPort),void 0!==b.startMode&&(d.startMode=b.startMode),void 0!==b.disabledSkills&&(d.disabledSkills=b.disabledSkills),void 0!==b.guideState&&(d.guideState=b.guideState),void 0!==b.acpAgents&&(d.acpAgents=b.acpAgents),void 0!==b.baseUrlCompat&&(d.baseUrlCompat=b.baseUrlCompat),void 0!==b.connectionMode&&(d.connectionMode=b.connectionMode),void 0!==b.customAgents&&(d.customAgents=b.customAgents),void 0!==b.skillPaths&&(d.skillPaths=b.skillPaths),delete d.customProviders,"setupPending"in b&&(b.setupPending?d.setupPending=!0:delete d.setupPending),"setupPort"in b&&(b.setupPort?d.setupPort=b.setupPort:delete d.setupPort),f().writeFileSync(r,JSON.stringify(d,null,2)+"\n","utf-8")}catch{}return i}catch{return{...s,ai:{...s.ai,providers:[]},setupPending:!0,connectionMode:{cli:!0,mcp:!1},allowNetworkAccess:!1}}}function p(a){let b=o(),c=a||b.ai.activeProvider,d=c?(0,m.lh)(b.ai.providers,c):void 0;if(!d&&a&&(0,l.rl)(a)){let c=b.ai.activeProvider?(0,m.lh)(b.ai.providers,b.ai.activeProvider):void 0;d=c?.protocol===a?c:b.ai.providers.find(b=>b.protocol===a)}if(d){let a=l.T_[d.protocol],b=d.apiKey||(0,l.lr)(d.protocol)||a?.apiKeyFallback||"",c=d.model||a?.defaultModel||"",e=d.baseUrl||a?.fixedBaseUrl||"";return{provider:d.protocol,apiKey:b,model:c,baseUrl:e}}let e=a&&(0,l.rl)(a)?a:process.env.AI_PROVIDER,f=e&&(0,l.rl)(e)?e:"anthropic",g=l.T_[f]??l.T_.anthropic;return{provider:f,apiKey:(0,l.lr)(f)||g.apiKeyFallback||"",model:g.defaultModel,baseUrl:g.fixedBaseUrl||""}}function q(){return o().mindRoot||process.env.MIND_ROOT||h().join(j().homedir(),"MindOS","mind")}d()}catch(a){d(a)}})},27152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Bk:()=>p,II:()=>o,s7:()=>q});var e=c(23414),f=c(79646),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(33873),l=c.n(k),m=c(79551),n=a([e]);function o(){try{let a=(0,e.sb)().embedding;if(!a||!a.enabled||"api"===a.provider&&(!a.baseUrl||!a.model)||"local"===a.provider&&!a.model)return null;return{enabled:!0,provider:a.provider||"api",baseUrl:(a.baseUrl||"").replace(/\/+$/,""),apiKey:a.apiKey||"",model:a.model}}catch{return null}}async function p(a){let b=o();if(!b||0===a.length)return[];try{if("local"===b.provider)return await x(b.model,a);return await y(b,a)}catch(a){return console.error("[embedding] Failed to get embeddings:",a instanceof Error?a.message:a),[]}}async function q(a){let b=await p([a]);return b.length>0?b[0]:null}e=(n.then?(await n)():n)[0];let B=["@huggingface/transformers@4.2.0","onnxruntime-node@1.24.3","onnxruntime-web@1.26.0-dev.20260416-b7804b056c"],C=Function("specifier","return import(specifier)");class D extends Error{constructor(a="Local embedding runtime is not installed. Install it from Settings > AI > Embedding Search, or use API mode."){super(a),this.name="LocalEmbeddingRuntimeMissingError"}}function r(){return process.env.MINDOS_LOCAL_EMBEDDING_RUNTIME_DIR||l().join(j().homedir(),".mindos","local-embedding-runtime")}let E=null,F=null,G=null;async function s(){let a=r();h().mkdirSync(a,{recursive:!0});let b=l().join(a,"package.json");h().existsSync(b)||h().writeFileSync(b,JSON.stringify({private:!0,name:"mindos-local-embedding-runtime",description:"Optional MindOS local embedding runtime installed on user request."},null,2)+"\n");let c=function(){if(process.env.MINDOS_NPM_BIN)return{command:process.env.MINDOS_NPM_BIN,args:[]};let a=process.env.MINDOS_PROJECT_ROOT;if(a){let b=l().join(a,"node","lib","node_modules","npm","bin","npm-cli.js");if(h().existsSync(b))return{command:process.env.MINDOS_NODE_BIN||process.execPath,args:[b]}}return{command:"win32"===process.platform?"npm.cmd":"npm",args:[]}}(),d=[...c.args,"install","--prefix",a,"--omit=dev","--no-audit","--no-fund","--ignore-scripts",...B];await t(c.command,d,6e5)}async function t(a,b,c){await new Promise((d,e)=>{let g=(0,f.spawn)(a,b,{stdio:["ignore","pipe","pipe"],env:process.env}),h="",i=setTimeout(()=>{g.kill("SIGTERM"),e(Error("Local embedding runtime install timed out. Check your network and try again, or use API mode."))},c);g.stdout.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.stderr.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.on("error",a=>{clearTimeout(i),"ENOENT"===a.code?e(Error("npm is required to install the optional local embedding runtime. Install Node.js/npm, or use API embedding mode.")):e(a)}),g.on("exit",a=>{clearTimeout(i),0===a?d():e(Error(`Local embedding runtime install failed with exit code ${a}. ${h.trim().slice(-1e3)}`))})})}async function u(a){return E&&F===a?E:G&&F===a?G:(F=a,G=(async()=>{for(let b=0;b<=2;b++){let c=null,d=!1,e=null;try{let{pipeline:e,env:f}=await v({installIfMissing:!1});process.env.HF_ENDPOINT||f.remoteHost||(console.log("[embedding] Configuring hf-mirror.com for better connectivity in China"),f.remoteHost="https://hf-mirror.com",f.remotePathTemplate="{model}/resolve/{revision}/{fileName}"),c=setTimeout(()=>{d=!0},3e5),console.log(`[embedding] Attempt ${b+1}/3: Loading pipeline for ${a}...`);let g=e("feature-extraction",a,{dtype:"fp32"});return E=await g,c&&clearTimeout(c),console.log(`[embedding] Successfully loaded pipeline for ${a}`),E}catch(f){e=f instanceof Error?f:Error(String(f)),c&&clearTimeout(c),d&&(e=Error("Request timeout (>300s)"));let a=function(a){if(!(a instanceof Error))return!1;let b=a.message.toLowerCase();return b.includes("enotfound")||b.includes("econnrefused")||b.includes("econnreset")||b.includes("etimedout")||b.includes("timeout")||b.includes("temporarily unavailable")||b.includes("connect econnrefused")||b.includes("net::err_internet_disconnected")||b.includes("eaddrnotavail")||b.includes("enetunreach")||b.includes("socket hang up")}(e)&&b<2;if(console.error(`[embedding] Download attempt ${b+1}/3 failed: ${e.message}`+(a?` — retrying...`:" — giving up")),a){let a=1e3*Math.pow(2,b);console.log(`[embedding] Waiting ${a}ms before retry...`),await new Promise(b=>setTimeout(b,a));continue}throw E=null,F=null,G=null,e}}})())}async function v({installIfMissing:a}){try{return await Promise.resolve().then(c.bind(c,99253))}catch(c){let b=w();if(b)return await C((0,m.pathToFileURL)(b).href);if(a){await s();let a=w();if(a)return await C((0,m.pathToFileURL)(a).href)}throw new D(c instanceof Error&&c.message.includes("@huggingface/transformers")?void 0:`Local embedding runtime is unavailable: ${c instanceof Error?c.message:String(c)}`)}}function w(){let a=l().join(r(),"node_modules","@huggingface","transformers"),b=l().join(a,"package.json");if(!h().existsSync(b))return null;try{let c=JSON.parse(h().readFileSync(b,"utf-8")),d=c.exports?.node?.import?.default,e="string"==typeof d?d:"string"==typeof c.module?c.module:c.main;if("string"!=typeof e)return null;let f=l().resolve(a,e);return h().existsSync(f)?f:null}catch{return null}}async function x(a,b){let c=await u(a);if(!c)return[];let d=[];for(let a=0;a<b.length;a+=32)for(let e of b.slice(a,a+32)){let a=(await c(e,{pooling:"mean",normalize:!0})).data;d.push(new Float32Array(a))}return d}async function y(a,b){let c=[];for(let d=0;d<b.length;d+=100){let e=b.slice(d,d+100),f=await z(a,e);if(0===f.length)return[];c.push(...f)}return c}async function z(a,b){let c=`${a.baseUrl}/embeddings`,d=JSON.stringify({model:a.model,input:b}),e={"Content-Type":"application/json"};a.apiKey&&(e.Authorization=`Bearer ${a.apiKey}`);for(let a=0;a<=2;a++)try{let b=new AbortController,f=setTimeout(()=>b.abort(),3e4),g=await fetch(c,{method:"POST",headers:e,body:d,signal:b.signal});if(clearTimeout(f),!g.ok){let b=g.status;if((429===b||b>=500)&&a<2){let a=parseInt(g.headers.get("retry-after")||"1",10);await A(Math.min(1e3*a,5e3));continue}let c=await g.text().catch(()=>"");return console.error(`[embedding] API error ${b}: ${c.slice(0,200)}`),[]}let h=await g.json();if(!h.data||!Array.isArray(h.data))return console.error("[embedding] Unexpected response shape"),[];return h.data.sort((a,b)=>a.index-b.index),h.data.map(a=>new Float32Array(a.embedding))}catch(b){if(a<2){await A(1e3*(a+1));continue}console.error("[embedding] Request failed:",b instanceof Error?b.message:b);break}return[]}function A(a){return new Promise(b=>setTimeout(b,a))}d()}catch(a){d(a)}})},28287:(a,b,c)=>{c.d(b,{F0:()=>m});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(13308);function i(a){return k(a,".trash")}function j(a){return k(a,".trash-meta")}function k(a,b){l(b);let c=g().resolve(g().dirname(a)),d=g().resolve(c,b),f=g().relative(c,d);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent");if(e().existsSync(d)){if(e().lstatSync(d).isSymbolicLink())throw Error("Access denied: trash directory must not be a symlink");let a=e().realpathSync(c),b=e().realpathSync(d),f=g().relative(a,b);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent")}return d}function l(a){if(!a||a.includes("/")||a.includes("\\")||g().basename(a)!==a)throw Error("Invalid trash id")}function m(a,b){let c,d;e().mkdirSync(i(a),{recursive:!0}),e().mkdirSync(j(a),{recursive:!0});let f=(0,h.n2)(a,b);if(!e().existsSync(f))throw Error(`File not found: ${b}`);let k=e().statSync(f).isDirectory(),m=g().basename(b),n=(c=m.replace(/[^a-zA-Z0-9._\-\u4e00-\u9fff]/g,"_"),`${Date.now()}_${c}`),o=g().join(i(a),n);if(e().mkdirSync(g().dirname(o),{recursive:!0}),k)e().cpSync(f,o,{recursive:!0}),e().rmSync(f,{recursive:!0,force:!0});else try{e().renameSync(f,o)}catch(a){if("EXDEV"===a.code)e().copyFileSync(f,o),e().unlinkSync(f);else throw a}let p=new Date,q={id:n,originalPath:b,deletedAt:p.toISOString(),expiresAt:new Date(p.getTime()+2592e6).toISOString(),fileName:m,isDirectory:k};return l(q.id),d=g().join(j(a),`${q.id}.json`),e().writeFileSync(d,JSON.stringify(q,null,2),"utf-8"),q}},28647:(a,b,c)=>{c.d(b,{b:()=>i});var d=c(79646),e=c(29021),f=c.n(e),g=c(33873),h=c.n(g);function i(a){try{let b=function(a){let b=[],c=process.env.MINDOS_PROJECT_ROOT;c&&b.push(h().join(c,"packages","web","scripts",a));let d=process.cwd();for(let c of(b.push(h().join(d,"scripts",a)),b.push(h().resolve(d,"..","..","scripts",a)),b.push(h().join(d,".next","standalone","scripts",a)),b))if(f().existsSync(c))return c;return null}("extract-pdf.cjs");if(!b)return"";let c=(0,d.execFileSync)(function(a=process.env){return a.MINDOS_NODE_BIN?.trim()||process.execPath}(),[b,a],{encoding:"utf-8",timeout:15e3,maxBuffer:5242880});return JSON.parse(c).text||""}catch{return""}}},28696:(a,b,c)=>{c.d(b,{gG:()=>d.gG});var d=c(50294)},30281:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O:()=>o});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(31751),l=c(59349),m=c(27152),n=a([m]);m=(n.then?(await n)():n)[0];class o{isReady(){return this._ready}isBuilding(){return this._building}getDocCount(){return this.vectors.size}getDimensions(){return this.dimensions}async rebuild(a){if(!this._building){this._building=!0;try{if(!(0,m.II)()){this._building=!1;return}let b=(0,k.f)(a),c=[],d=[];for(let e of b){let b,f=h().extname(e).toLowerCase();if(".md"!==f&&".csv"!==f)continue;try{b=(0,l.TA)(a,e)}catch{continue}let g=`${e}
1
+ "use strict";exports.id=1976,exports.ids=[1976],exports.modules={7017:(a,b,c)=>{c.d(b,{G:()=>h});var d=c(33873),e=c.n(d),f=c(31751),g=c(59349);function h(a,b,c,d){let h=[],i=e().basename(b,".md"),j=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),k=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=[RegExp(`\\[\\[${k}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[\\[${j}(?:[|#][^\\]]*)?\\]\\]`,"i"),RegExp(`\\[[^\\]]+\\]\\(${j}(?:#[^)]*)?\\)`,"i"),RegExp(`\\[[^\\]]+\\]\\([^)]*${k}\\.md(?:#[^)]*)?\\)`,"i"),RegExp("`"+j.replace(/\//g,"\\/")+"`")];for(let e of c||(d?d.filter(a=>a.endsWith(".md")&&a!==b):(0,f.f)(a).filter(a=>a.endsWith(".md")&&a!==b))){let c;if(e===b)continue;try{c=(0,g.TA)(a,e)}catch{continue}let d=c.split("\n");for(let a=0;a<d.length;a++)if(l.some(b=>b.test(d[a]))){let b=a;for(;b>0&&b>a-3&&""!==d[b].trim();)b--;let c=a;for(;c<d.length-1&&c<a+3&&""!==d[c].trim();)c++;let f=d.slice(b,c+1).join("\n").trim();f=f.replace(/\n{2,}/g," ↵ "),h.push({source:e,line:a+1,context:f});break}}return h}},11976:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{El:()=>y,F2:()=>G,FR:()=>I,G1:()=>L,H5:()=>C,JX:()=>p,WZ:()=>D,_P:()=>z,f:()=>x,fu:()=>A,g7:()=>J,getFileTree:()=>w,gm:()=>q,mV:()=>H,startFileWatcher:()=>t,vg:()=>F,wf:()=>E,x3:()=>B,zK:()=>K});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(39852),j=c(72385),k=c(23414),l=c(28647),m=c(82614),n=c(28287),o=a([j,k]);function p(){return(0,k.kh)()}[j,k]=o.then?(await o)():o;let M=new Set([".git","node_modules","app",".next",".DS_Store",".media","mcp"]),N=new Set([".md",".csv",".json",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),O=null,P=0,Q=new j.Xs;function q(){O=null,P++,(0,j._E)(),Q.invalidate()}function r(a){O=null,P++,(0,j.KZ)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function s(){var a;let b,c,d,e;return null!==O&&Date.now()-O.timestamp<3e4?O:(a=p(),b=m.Y.startTimer("tree.cache.build"),c=function a(b,c){let d,e=c??p();try{d=f().readdirSync(b,{withFileTypes:!0})}catch{return[]}let g=[];for(let c of d){let d=h().join(b,c.name),i=h().relative(e,d);if(c.isDirectory()){if(M.has(c.name))continue;let b=a(d,e);if(b.length>0){let a=b.some(a=>"file"===a.type&&"INSTRUCTION.md"===a.name),e={name:c.name,path:i,type:"directory",children:b};a&&(e.isSpace=!0,e.spacePreview=function(a){let b,c=h().join(a,"INSTRUCTION.md"),d=h().join(a,"README.md"),e=v(d);try{let a=f().readFileSync(d,"utf-8").match(/<!-- mindos:compiled (\S+) files:\d+ -->/);a&&(b=a[1])}catch{}return{instructionLines:u(c,3),readmeLines:u(d,3),isTemplate:v(c)&&e,readmeIsTemplate:e,lastCompiled:b}}(d)),g.push(e)}}else if(c.isFile()){let a=h().extname(c.name).toLowerCase();N.has(a)&&g.push({name:c.name,path:i,type:"file",extension:a})}}return g.sort((a,b)=>a.type!==b.type?"directory"===a.type?-1:1:a.name.localeCompare(b.name)),g}(a),d=[],e=0,function a(b){for(let c of b)"file"===c.type?d.push(c.path):c.children&&(e++,a(c.children))}(c),b({fileCount:d.length,directoryCount:e}),O={tree:c,allFiles:d,timestamp:Date.now()},R||t(),O)}let R=null,S=null;function t(){let a;if(!R){try{a=p()}catch{return}try{(R=f().watch(a,{recursive:!0},(a,b)=>{!b||b.startsWith(".git")||b.includes("node_modules")||b.includes(".next")||(S&&clearTimeout(S),S=setTimeout(()=>{O=null,P++,S=null},500))})).on("error",()=>{S&&(clearTimeout(S),S=null),R&&(R.close(),R=null)})}catch{R=null}}}function u(a,b){try{let c=f().readFileSync(a,"utf-8"),d=[];for(let a of c.split("\n")){let c=a.trim();if(!(!c||c.startsWith("#"))&&(d.push(c),d.length>=b))break}return d}catch{return[]}}let T=["Define local execution rules for this directory.","(your files here)","(Describe the purpose and usage of this space.)","(Add usage guidelines for this space.)"];function v(a){try{let b=f().readFileSync(a,"utf-8");return T.some(a=>b.includes(a))}catch{return!1}}function w(){return s().tree}function x(){return s().allFiles}function y(a=10){let b=p(),c=x().map(a=>{try{let c=(0,j.n2)(b,a),d=f().statSync(c);return{path:a,mtime:d.mtimeMs}}catch{return null}}).filter(Boolean);return c.sort((a,b)=>b.mtime-a.mtime),c.slice(0,a)}function z(a){let b=p();if(".pdf"===h().extname(a).toLowerCase()){let c=(0,j.n2)(b,a);if(!f().existsSync(c))throw new i.Vt(i.tG.FILE_NOT_FOUND,`File not found: ${a}`,{filePath:a});let d=(0,l.b)(c);if(!d)throw new i.Vt(i.tG.INTERNAL_ERROR,`Could not extract text from PDF: ${a}`,{filePath:a});return d}return(0,j.TA)(b,a)}function A(a,b){(0,j._h)(p(),a,b),r(a)}function B(a,b=""){(0,j.x3)(p(),a,b),O=null,P++,(0,j.As)(p(),a),Q.isBuilt()&&Q.updateFile(p(),a)}function C(a,b){let c=(0,j.H5)(p(),a,b);return q(),c}function D(a,b){(0,j.WZ)(p(),a,b),r(a)}function E(a,b,c){(0,j.wf)(p(),a,b,c),r(a)}function F(a,b,c){(0,j.vg)(p(),a,b,c),r(a)}function G(a,b){let c=(0,j.F2)(p(),a,b);return r(a),c}function H(a,b){let c=(0,j.mV)(p(),a,b,j.G1);return q(),c}function I(a,b=10){return(0,j.FR)(p(),a,b)}function J(a,b){return(0,j.g7)(p(),a,b)}function K(a){let b=(0,n.F0)(p(),a);return q(),b}function L(a){let b,c=p(),d=(b=p(),!Q.isBuiltFor(b)&&Q.rebuild(b),Q).getBacklinks(a);return(0,j.G1)(c,a,d)}d()}catch(a){d(a)}})},12169:(a,b,c)=>{c.d(b,{FR:()=>f,g7:()=>g});var d=c(79646),e=c(13308);function f(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["log","--follow","--format=%H%x00%aI%x00%s%x00%an","-n",String(c),"--",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?g.split("\n").map(a=>{let[b,c,d,e]=a.split("\0");return{hash:b,date:c,message:d,author:e}}):[]}function g(a,b,c){let f=(0,e.n2)(a,b),g=(0,d.execFileSync)("git",["ls-files","--full-name",f],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();return g?(0,d.execFileSync)("git",["show",`${c}:${g}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}):(0,d.execFileSync)("git",["show",`${c}:${b}`],{cwd:a,encoding:"utf-8",stdio:["pipe","pipe","pipe"]})}},13308:(a,b,c)=>{c.d(b,{cP:()=>A,n2:()=>B});var d=c(33873),e=c.n(d),f=c(29021),g=c.n(f);class h extends Error{constructor(a,b,c,d){super(a),this.name=this.constructor.name,this.code=b,this.statusCode=c,this.context=d?.context,this.cause=d?.cause,this.metadata={timestamp:Date.now(),...d?.metadata},Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,statusCode:this.statusCode,context:this.context,metadata:this.metadata,stack:this.stack}}toUserMessage(){return this.message}}let i={VALIDATION_ERROR:400,NOT_FOUND:404,UNAUTHORIZED:401,FORBIDDEN:403,CONFLICT:409,INTERNAL_ERROR:500,SERVICE_UNAVAILABLE:503,TIMEOUT:408,RATE_LIMIT_EXCEEDED:429,FILE_SYSTEM_ERROR:500,FILE_READ_ERROR:500,FILE_WRITE_ERROR:500,FILE_STAT_ERROR:500,FILE_REMOVE_ERROR:500,FILE_COPY_ERROR:500,FILE_MOVE_ERROR:500,FILE_WATCH_ERROR:500,DIRECTORY_READ_ERROR:500,DIRECTORY_CREATE_ERROR:500,DATABASE_ERROR:500,NETWORK_ERROR:500,CONFIGURATION_ERROR:500,SEARCH_ERROR:500,VECTOR_ERROR:500,MCP_ERROR:500},j={VALIDATION_ERROR:"Validation failed",NOT_FOUND:"Resource not found",UNAUTHORIZED:"Unauthorized access",FORBIDDEN:"Access forbidden",CONFLICT:"Resource conflict",INTERNAL_ERROR:"Internal server error",SERVICE_UNAVAILABLE:"Service unavailable",TIMEOUT:"Operation timed out",RATE_LIMIT_EXCEEDED:"Rate limit exceeded",FILE_SYSTEM_ERROR:"File system operation failed",FILE_READ_ERROR:"Failed to read file",FILE_WRITE_ERROR:"Failed to write file",FILE_STAT_ERROR:"Failed to get file stats",FILE_REMOVE_ERROR:"Failed to remove file",FILE_COPY_ERROR:"Failed to copy file",FILE_MOVE_ERROR:"Failed to move file",FILE_WATCH_ERROR:"Failed to watch file",DIRECTORY_READ_ERROR:"Failed to read directory",DIRECTORY_CREATE_ERROR:"Failed to create directory",DATABASE_ERROR:"Database operation failed",NETWORK_ERROR:"Network operation failed",CONFIGURATION_ERROR:"Configuration error",SEARCH_ERROR:"Search operation failed",VECTOR_ERROR:"Vector operation failed",MCP_ERROR:"MCP operation failed"};function k(a,b,c){let d=i[a],e=j[a];return new h(b??e,a,d,{...c,metadata:{...c?.metadata,retryable:["SERVICE_UNAVAILABLE","TIMEOUT","NETWORK_ERROR"].includes(a),retryAfter:function(a){switch(a){case"RATE_LIMIT_EXCEEDED":return 6e4;case"SERVICE_UNAVAILABLE":return 5e3;case"TIMEOUT":return 1e3;case"NETWORK_ERROR":return 2e3;default:return 0}}(a)}})}let l=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,m=/[<>:"|?*\x00-\x1f]/;function n(a){return/^[A-Za-z]:/.test(a)}function o(a,b){let c,e,f;if(c=d.resolve(b),e=d.resolve(a),""!==(f=d.relative(c,e))&&(".."===f||f.startsWith(`..${d.sep}`)||d.isAbsolute(f)))throw k("VALIDATION_ERROR","Access denied: path outside root",{context:{resolved:a,root:b}})}function p(a,b,c,d,e,f){return{path:a,webRouteFile:`packages/web/app${a}/route.ts`,owner:b,adapter:c,phase:d,risk:e,residualRisk:f}}let q=(a,b="low")=>p(a,"product-owned","next-response","Phase 1: migrated Product Server adapter",b,"No residual product ownership expected; this route should remain a thin Next adapter."),r=(a,b,c,d)=>p(a,"optional-capability","optional-capability",b,c,d),s=(a,b,c="medium")=>p(a,"host-owned","host","Host-owned",c,b);[q("/api/a2a/agents","medium"),q("/api/a2a/delegations","medium"),q("/api/a2a/discover","medium"),q("/api/a2a","medium"),q("/api/acp/config","high"),q("/api/acp/detect","medium"),q("/api/acp/install","high"),q("/api/acp/registry","medium"),q("/api/acp/session","high"),q("/api/agent-activity"),q("/api/agents/copy-skill","high"),q("/api/agents/custom/detect","medium"),q("/api/agents/custom","high"),q("/api/ask-sessions"),p("/api/ask","product-owned","stream","Phase 6: generated client and stream adapter","high","Ask is mostly Product runtime-owned through session and agent modules, but the streaming Web route still owns host assembly and should become a generated stream adapter."),s("/api/auth","Auth cookie/session handling is host-specific today; Product Server will need an auth context adapter before direct HTTP exposure.","high"),q("/api/backlinks"),q("/api/bootstrap"),q("/api/changes"),q("/api/channels/verify","medium"),q("/api/connect"),q("/api/embedding","medium"),r("/api/export","Phase 5: content ingestion optional capabilities","high","Export/archive logic carries heavy dependencies and filesystem writes that need optional capability packaging."),r("/api/extract-docx","Phase 5: content ingestion optional capabilities","high","DOCX extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/extract-pdf","Phase 5: content ingestion optional capabilities","high","PDF extraction should be Product-owned but lazy-loaded so parser dependencies do not inflate the default package."),r("/api/file/import","Phase 5: content ingestion optional capabilities","high","File import is a content-ingestion write path and needs capability-level size limits, conflict checks, and rollback."),q("/api/file/raw"),q("/api/file","high"),q("/api/files"),q("/api/git"),q("/api/graph"),q("/api/health"),q("/api/im/activity","medium"),q("/api/im/config","high"),s("/api/im/feishu/long-connection/event","Raw long-connection event delivery is host-specific, but event parsing and state updates should stay behind Product protocol handlers.","medium"),q("/api/im/feishu/long-connection","high"),q("/api/im/status","medium"),q("/api/im/test","medium"),q("/api/im/webhook-status","medium"),s("/api/im/webhook/feishu","Raw inbound Feishu webhook receipt is host-owned, while signature verification and state writes should move to Product protocol handlers.","high"),r("/api/inbox/clip","Phase 5: content ingestion optional capabilities","high","Inbox clipping is still Web-owned ingestion and needs optional capability packaging plus fetch timeout and content limits."),q("/api/inbox","medium"),q("/api/init","high"),r("/api/lint","Phase 5: content ingestion optional capabilities","medium","Knowledge linting remains Web-owned and should become an optional Product capability with bounded filesystem traversal."),q("/api/mcp/agents","high"),q("/api/mcp/direct-tools","medium"),q("/api/mcp/install-skill","high"),q("/api/mcp/install","high"),q("/api/mcp/restart","high"),q("/api/mcp/status"),q("/api/mcp/tools","medium"),q("/api/mcp/uninstall","high"),q("/api/monitoring","medium"),r("/api/obsidian-plugins/settings","Phase 5: content ingestion optional capabilities","medium","Obsidian plugin settings remain Web-owned and should be modeled as an optional Product compatibility capability."),r("/api/obsidian/compat-report","Phase 5: content ingestion optional capabilities","medium","Obsidian compatibility reporting remains Web-owned and should use optional capability diagnostics."),r("/api/obsidian/import","Phase 5: content ingestion optional capabilities","high","Obsidian import remains a Web-owned bulk write path and needs optional capability size limits and rollback."),q("/api/recent-files"),q("/api/restart","high"),q("/api/search/prewarm"),q("/api/search"),q("/api/settings/list-models","medium"),q("/api/settings/reset-token","high"),q("/api/settings","medium"),q("/api/settings/test-key","medium"),q("/api/setup/check-path","medium"),q("/api/setup/check-port","medium"),q("/api/setup/generate-token","medium"),q("/api/setup/ls","medium"),q("/api/setup","high"),q("/api/skills","high"),q("/api/space-overview"),q("/api/sync","high"),q("/api/tree-version"),q("/api/uninstall","high"),q("/api/update-check"),q("/api/update-status"),q("/api/update","high"),q("/api/workflows","medium")].map(a=>[a.path,a]),c(51455),c(73024);var t=c(76760);c(77598);var u=c(48161);function v(a){return"darwin"===process.platform?a.darwin:"win32"===process.platform?`${(process.env.APPDATA||(0,t.join)((0,u.homedir)(),"AppData","Roaming")).replace(/\\/g,"/").replace(/\/+$/,"")}/${a.win32}`:a.linux}c(37067),c(73136),v({darwin:"~/Library/Application Support/Code/User",linux:"~/.config/Code/User",win32:"Code/User"}),v({darwin:"~/Library/Application Support/Code",linux:"~/.config/Code",win32:"Code"}),v({darwin:"~/Library/Application Support/Trae CN",linux:"~/.config/Trae CN",win32:"Trae CN"}),c(31421),c(50294);var w=c(79646);(0,c(28354).promisify)(w.execFile),(0,t.join)((0,u.homedir)(),".mindos","im-activity.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),(0,t.join)((0,u.homedir)(),".mindos","im.json"),c(21820),c(77030),c(38264);let x=(0,t.join)((0,u.homedir)(),".mindos");(0,t.join)(x,"config.json"),(0,t.join)(x,"sync-state.json"),[{id:"health",method:"GET",path:"/api/health",auth:"public"},{id:"files",method:"GET",path:"/api/files",auth:"required"},{id:"recent-files",method:"GET",path:"/api/recent-files",auth:"required"},{id:"tree-version",method:"GET",path:"/api/tree-version",auth:"required"},{id:"file.read",method:"GET",path:"/api/file",auth:"required"},{id:"file.write",method:"POST",path:"/api/file",auth:"required"},{id:"file.raw",method:"GET",path:"/api/file/raw",auth:"required"},{id:"search",method:"GET",path:"/api/search",auth:"required"},{id:"search.prewarm",method:"GET",path:"/api/search/prewarm",auth:"required"},{id:"a2a",method:"POST",path:"/api/a2a",auth:"required"},{id:"a2a.options",method:"OPTIONS",path:"/api/a2a",auth:"public"},{id:"a2a.agents",method:"GET",path:"/api/a2a/agents",auth:"required"},{id:"a2a.delegations",method:"GET",path:"/api/a2a/delegations",auth:"required"},{id:"a2a.discover",method:"POST",path:"/api/a2a/discover",auth:"required"},{id:"acp.config",method:"GET",path:"/api/acp/config",auth:"required"},{id:"acp.config.update",method:"POST",path:"/api/acp/config",auth:"required"},{id:"acp.config.delete",method:"DELETE",path:"/api/acp/config",auth:"required"},{id:"acp.detect",method:"GET",path:"/api/acp/detect",auth:"required"},{id:"acp.install",method:"POST",path:"/api/acp/install",auth:"required"},{id:"acp.registry",method:"GET",path:"/api/acp/registry",auth:"required"},{id:"acp.session",method:"GET",path:"/api/acp/session",auth:"required"},{id:"acp.session.action",method:"POST",path:"/api/acp/session",auth:"required"},{id:"acp.session.close",method:"DELETE",path:"/api/acp/session",auth:"required"},{id:"backlinks",method:"GET",path:"/api/backlinks",auth:"required"},{id:"graph",method:"GET",path:"/api/graph",auth:"required"},{id:"agent-activity",method:"GET",path:"/api/agent-activity",auth:"required"},{id:"bootstrap",method:"GET",path:"/api/bootstrap",auth:"required"},{id:"connect",method:"GET",path:"/api/connect",auth:"required"},{id:"embedding",method:"GET",path:"/api/embedding",auth:"required"},{id:"embedding.action",method:"POST",path:"/api/embedding",auth:"required"},{id:"channels.verify",method:"POST",path:"/api/channels/verify",auth:"required"},{id:"im.activity",method:"GET",path:"/api/im/activity",auth:"required"},{id:"im.config",method:"GET",path:"/api/im/config",auth:"required"},{id:"im.config.update",method:"PUT",path:"/api/im/config",auth:"required"},{id:"im.config.delete",method:"DELETE",path:"/api/im/config",auth:"required"},{id:"im.status",method:"GET",path:"/api/im/status",auth:"required"},{id:"im.test",method:"POST",path:"/api/im/test",auth:"required"},{id:"im.webhook-status",method:"GET",path:"/api/im/webhook-status",auth:"required"},{id:"im.feishu.long-connection",method:"GET",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.start",method:"POST",path:"/api/im/feishu/long-connection",auth:"required"},{id:"im.feishu.long-connection.stop",method:"DELETE",path:"/api/im/feishu/long-connection",auth:"required"},{id:"monitoring",method:"GET",path:"/api/monitoring",auth:"required"},{id:"update-status",method:"GET",path:"/api/update-status",auth:"required"},{id:"update-check",method:"GET",path:"/api/update-check",auth:"required"},{id:"restart",method:"POST",path:"/api/restart",auth:"required"},{id:"update",method:"POST",path:"/api/update",auth:"required"},{id:"uninstall",method:"POST",path:"/api/uninstall",auth:"required"},{id:"init",method:"POST",path:"/api/init",auth:"required"},{id:"sync",method:"GET",path:"/api/sync",auth:"required"},{id:"sync.action",method:"POST",path:"/api/sync",auth:"required"},{id:"inbox",method:"GET",path:"/api/inbox",auth:"required"},{id:"inbox.save",method:"POST",path:"/api/inbox",auth:"required"},{id:"inbox.archive",method:"DELETE",path:"/api/inbox",auth:"required"},{id:"setup.check-path",method:"POST",path:"/api/setup/check-path",auth:"required"},{id:"setup.check-port",method:"POST",path:"/api/setup/check-port",auth:"required"},{id:"setup.generate-token",method:"POST",path:"/api/setup/generate-token",auth:"required"},{id:"setup.ls",method:"POST",path:"/api/setup/ls",auth:"required"},{id:"setup",method:"GET",path:"/api/setup",auth:"required"},{id:"setup.apply",method:"POST",path:"/api/setup",auth:"required"},{id:"setup.guide-state",method:"PATCH",path:"/api/setup",auth:"required"},{id:"workflows",method:"GET",path:"/api/workflows",auth:"required"},{id:"workflows.create",method:"POST",path:"/api/workflows",auth:"required"},{id:"ask.stream",method:"POST",path:"/api/ask",auth:"required"},{id:"ask-sessions",method:"GET",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.save",method:"POST",path:"/api/ask-sessions",auth:"required"},{id:"ask-sessions.delete",method:"DELETE",path:"/api/ask-sessions",auth:"required"},{id:"space-overview",method:"GET",path:"/api/space-overview",auth:"required"},{id:"git",method:"GET",path:"/api/git",auth:"required"},{id:"settings",method:"GET",path:"/api/settings",auth:"required"},{id:"settings.update",method:"POST",path:"/api/settings",auth:"required"},{id:"settings.reset-token",method:"POST",path:"/api/settings/reset-token",auth:"required"},{id:"settings.test-key",method:"POST",path:"/api/settings/test-key",auth:"required"},{id:"settings.list-models",method:"POST",path:"/api/settings/list-models",auth:"required"},{id:"mcp.status",method:"GET",path:"/api/mcp/status",auth:"required"},{id:"mcp.agents",method:"GET",path:"/api/mcp/agents",auth:"required"},{id:"mcp.tools",method:"GET",path:"/api/mcp/tools",auth:"required"},{id:"mcp.direct-tools",method:"POST",path:"/api/mcp/direct-tools",auth:"required"},{id:"mcp.install",method:"POST",path:"/api/mcp/install",auth:"required"},{id:"mcp.install-skill",method:"POST",path:"/api/mcp/install-skill",auth:"required"},{id:"mcp.restart",method:"POST",path:"/api/mcp/restart",auth:"required"},{id:"mcp.uninstall",method:"POST",path:"/api/mcp/uninstall",auth:"required"},{id:"skills",method:"GET",path:"/api/skills",auth:"required"},{id:"skills.action",method:"POST",path:"/api/skills",auth:"required"},{id:"changes",method:"GET",path:"/api/changes",auth:"required"},{id:"changes.mark-seen",method:"POST",path:"/api/changes",auth:"required"},{id:"agents.custom.create",method:"POST",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.update",method:"PUT",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.delete",method:"DELETE",path:"/api/agents/custom",auth:"required"},{id:"agents.custom.detect",method:"POST",path:"/api/agents/custom/detect",auth:"required"},{id:"agents.copy-skill",method:"POST",path:"/api/agents/copy-skill",auth:"required"}].map(a=>[`${a.method} ${a.path}`,a.auth]),c(84389);var y=c(39852);function z(a,b){return a instanceof y.Vt?a:new y.Vt(y.tG.PATH_OUTSIDE_ROOT,a?.message||"Access denied: path outside MIND_ROOT",a?.context??b)}function A(a,b){try{o(a,b)}catch(c){throw z(c,{resolved:a,root:b})}}function B(a,b){var c,f;let h,i,j,p,q,r=function(a,b){try{let g=b.replace(/\\/g,"/");if(d.isAbsolute(g)||d.win32.isAbsolute(b)||d.win32.isAbsolute(g)||n(b)||n(g))throw k("VALIDATION_ERROR","Access denied: absolute paths are not allowed",{context:{root:a,filePath:b}});var c=a,e=b,f=g;for(let a of f.split("/"))if(a&&"."!==a&&(a.endsWith(".")||a.endsWith(" ")||l.test(a)||m.test(a)))throw k("VALIDATION_ERROR","Access denied: path contains a Windows-invalid file name segment",{context:{root:c,filePath:e,segment:a}});let h=d.resolve(a),i=d.resolve(d.join(h,g));return o(i,h),i}catch(c){throw z(c,{mindRoot:a,filePath:b})}}(a,b),s=function(a){let b=a;for(;!g().existsSync(b);){let a=e().dirname(b);if(a===b)break;b=a}return b}(r);try{h=g().realpathSync(e().resolve(a)),i=g().realpathSync(s)}catch(c){throw z(c,{mindRoot:a,filePath:b,resolved:r,existing:s})}if(c=i,f=h,j=e().resolve(f),p=e().resolve(c),""!==(q=e().relative(j,p))&&(".."===q||q.startsWith(`..${e().sep}`)||e().isAbsolute(q)))throw new y.Vt(y.tG.PATH_OUTSIDE_ROOT,"Access denied: symlink resolves outside MIND_ROOT",{mindRoot:a,filePath:b,resolved:r,existing:s,targetReal:i});return r}},14360:(a,b,c)=>{c.d(b,{P2:()=>j,WZ:()=>k,vg:()=>m,wf:()=>l});var d=c(29021),e=c.n(d),f=c(59349),g=c(39852),h=c(13308);function i(a,b){return(0,f.TA)(a,b).split("\n")}function j(a,b,c,d,e){let h=i(a,b);var j=h.length;if(c<0||d<0)throw new g.Vt(g.tG.INVALID_RANGE,"Invalid line index: indices must be >= 0",{start:c,end:d});if(c>d)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid range: start (${c}) > end (${d})`,{start:c,end:d});if(c>=j)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid line index: start (${c}) >= total lines (${j})`,{start:c,totalLines:j});h.splice(c,d-c+1,...e),(0,f._h)(a,b,h.join("\n"))}function k(a,b,c){let d=(0,h.n2)(a,b);try{let a=e().statSync(d);if(0===a.size)return void e().appendFileSync(d,c,"utf-8");let b=Math.min(8,a.size),f=e().openSync(d,"r");try{let g=Buffer.alloc(b);e().readSync(f,g,0,b,Math.max(0,a.size-b));let h=g.toString("utf-8").endsWith("\n\n")?"":"\n";e().appendFileSync(d,h+c,"utf-8")}finally{e().closeSync(f)}}catch(g){let d=(0,f.TA)(a,b),e=d.length>0&&!d.endsWith("\n\n")?"\n":"";(0,f._h)(a,b,d+e+c)}}function l(a,b,c,d){let e=i(a,b),h=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===h)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let j=h+1;for(;j<e.length&&""===e[j].trim();)j++;!function(a,b,c,d){let e=i(a,b);if(c>=e.length)throw new g.Vt(g.tG.INVALID_RANGE,`Invalid after_index: ${c} >= total lines (${e.length})`,{afterIndex:c,totalLines:e.length});e.splice(c<0?0:c+1,0,...d),(0,f._h)(a,b,e.join("\n"))}(a,b,j-1,["",d])}function m(a,b,c,d){let e=i(a,b),f=e.findIndex(a=>{let b=a.trim();return b===c||b.replace(/^#+\s*/,"")===c.replace(/^#+\s*/,"")});if(-1===f)throw new g.Vt(g.tG.HEADING_NOT_FOUND,`Heading not found: "${c}"`,{heading:c});let h=(e[f].match(/^#+/)??[""])[0].length,k=e.length-1;for(let a=f+1;a<e.length;a++){let b=e[a].match(/^(#+)\s/);if(b&&b[1].length<=h){k=a-1;break}}for(;k>f&&""===e[k].trim();)k--;j(a,b,f+1,k,["",d])}},22288:(a,b,c)=>{var d=c(73566),e=c(31751),f=c(59349),g=c(13308),h=c(28647),i=c(87155),j=c(33873),k=c.n(j);let l="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function m(a,b){for(let c=0;c<a.length;c++)b.add(a[c]),c+1<a.length&&b.add(a[c]+a[c+1])}if(d.parentPort&&d.workerData?.mindRoot)try{let a=function(a){let b=(0,e.f)(a),c={},d={},j=0;for(let e of b){let b;if(".pdf"===k().extname(e).toLowerCase())try{let c=(0,g.n2)(a,e);if(!(b=(0,h.b)(c)))continue}catch{continue}else try{b=(0,f.TA)(a,e)}catch{continue}for(let a of(d[e]=b.length,j+=b.length,b.length>5e4&&(b=b.slice(0,5e4)),function(a){let b=new Set,c=a.toLowerCase(),d=c.match(/[a-z0-9_$@#]+/g);if(d)for(let a of d)a.length>=2&&b.add(a);if(i.y.test(c))if(l)for(let{segment:a,isWordLike:d}of l.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))i.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)i.y.test(d)?a.push(d):a.length>0&&(m(a,b),a.length=0);a.length>0&&m(a,b)}return b}(e+"\n"+b)))c[a]||(c[a]=[]),c[a].push(e)}return{version:1,builtForRoot:a,fileCount:b.length,totalChars:j,docLengths:d,invertedIndex:c,timestamp:Date.now()}}(d.workerData.mindRoot);d.parentPort.postMessage({ok:!0,data:a})}catch(a){d.parentPort.postMessage({ok:!1,error:a instanceof Error?a.message:String(a)})}},23414:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Sf:()=>p,kh:()=>q,sb:()=>o});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(28696),l=c(31756),m=c(62697),n=a([l,m]);[l,m]=n.then?(await n)():n;let r=h().join(j().homedir(),".mindos","config.json"),s={ai:{activeProvider:"",providers:[]},mindRoot:""},t=new Set(["free","tavily","brave","serper","bing-api"]);function o(){try{var a;let c=f().readFileSync(r,"utf-8"),d=JSON.parse(c),e=d.ai,g=e&&!Array.isArray(e.providers),i={ai:function(a){let b=a.ai;if(!b)return{...s.ai};if(Array.isArray(b.providers)){let a=(0,m.S9)(b.providers),c="string"==typeof b.activeProvider?b.activeProvider:"";return{activeProvider:function(a,b){if(a&&(0,m.Ny)(a)&&(0,m.lh)(b,a))return a;if(a&&(0,l.rl)(a)){let c=b.find(b=>b.protocol===a);if(c)return c.id}return b[0]?.id??""}(c,a),providers:a}}let c=(0,m.Ko)(a);return c?{activeProvider:c.activeProvider,providers:c.providers}:{...s.ai}}(d),agent:function(a){if(!a||"object"!=typeof a)return;let b={};return"number"==typeof a.maxSteps&&(b.maxSteps=Math.min(999,Math.max(1,a.maxSteps))),"boolean"==typeof a.enableThinking&&(b.enableThinking=a.enableThinking),"number"==typeof a.thinkingBudget&&(b.thinkingBudget=Math.min(5e4,Math.max(1e3,a.thinkingBudget))),("auto"===a.contextStrategy||"off"===a.contextStrategy)&&(b.contextStrategy=a.contextStrategy),"number"==typeof a.reconnectRetries&&(b.reconnectRetries=Math.min(10,Math.max(0,a.reconnectRetries))),Object.keys(b).length>0?b:void 0}(d.agent),embedding:function(a){if(!a||"object"!=typeof a||"boolean"!=typeof a.enabled)return;let b="local"===a.provider||"api"===a.provider?a.provider:"api";return{enabled:a.enabled,provider:b,baseUrl:"string"==typeof a.baseUrl?a.baseUrl:"",apiKey:"string"==typeof a.apiKey?a.apiKey:"",model:"string"==typeof a.model?a.model:""}}(d.embedding),webSearch:function(a){if(a&&"object"==typeof a)return{provider:"string"==typeof a.provider&&t.has(a.provider)?a.provider:"free",apiKey:"string"==typeof a.apiKey?a.apiKey:""}}(d.webSearch),acpAgents:(a=d.acpAgents,(0,k.gG)(a)),mindRoot:d.mindRoot??s.mindRoot,webPassword:"string"==typeof d.webPassword?d.webPassword:void 0,authToken:"string"==typeof d.authToken?d.authToken:void 0,allowNetworkAccess:!0===d.allowNetworkAccess,mcpPort:"number"==typeof d.mcpPort?d.mcpPort:void 0,port:"number"==typeof d.port?d.port:void 0,startMode:"string"==typeof d.startMode?d.startMode:void 0,setupPending:!0===d.setupPending||void 0,disabledSkills:Array.isArray(d.disabledSkills)?d.disabledSkills:void 0,guideState:function(a){if(!a||"object"!=typeof a||!0!==a.active)return;let b="en"===a.template||"zh"===a.template||"empty"===a.template?a.template:"en";return{active:!0,dismissed:!0===a.dismissed,template:b,step1Done:!0===a.step1Done,askedAI:!0===a.askedAI,nextStepIndex:"number"==typeof a.nextStepIndex?a.nextStepIndex:0,walkthroughStep:"number"==typeof a.walkthroughStep?a.walkthroughStep:void 0,walkthroughDismissed:"boolean"==typeof a.walkthroughDismissed?a.walkthroughDismissed:void 0}}(d.guideState),baseUrlCompat:(()=>{let a=d.baseUrlCompat;if(!a||"object"!=typeof a)return;let b={};for(let[c,d]of Object.entries(a))("streaming"===d||"non-streaming"===d)&&(b[c]=d);return Object.keys(b).length>0?b:void 0})(),connectionMode:function(a){if(a.connectionMode&&"object"==typeof a.connectionMode){let b=a.connectionMode;if("boolean"==typeof b.cli&&"boolean"==typeof b.mcp)return{cli:b.cli,mcp:b.mcp}}let b=!0===a.setupPending||!a.mindRoot;return{cli:!0,mcp:!b}}(d),customAgents:Array.isArray(d.customAgents)?d.customAgents:void 0,skillPaths:function(a){if(!a||"object"!=typeof a)return;let b={};if("boolean"==typeof a.enableAgentsDir&&(b.enableAgentsDir=a.enableAgentsDir),Array.isArray(a.custom)){let c=a.custom.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean);c.length>0&&(b.custom=c)}return Object.keys(b).length>0?b:void 0}(d.skillPaths)};if(g)try{var b=i;let a=h().dirname(r);f().existsSync(a)||f().mkdirSync(a,{recursive:!0});let c={};try{c=JSON.parse(f().readFileSync(r,"utf-8"))}catch{}let d={...c,ai:b.ai,mindRoot:b.mindRoot};void 0!==b.agent&&(d.agent=b.agent),void 0!==b.embedding&&(d.embedding=b.embedding),void 0!==b.webSearch&&(d.webSearch=b.webSearch),void 0!==b.webPassword&&(d.webPassword=b.webPassword),void 0!==b.authToken&&(d.authToken=b.authToken),"boolean"==typeof b.allowNetworkAccess&&(d.allowNetworkAccess=b.allowNetworkAccess),void 0!==b.port&&(d.port=b.port),void 0!==b.mcpPort&&(d.mcpPort=b.mcpPort),void 0!==b.startMode&&(d.startMode=b.startMode),void 0!==b.disabledSkills&&(d.disabledSkills=b.disabledSkills),void 0!==b.guideState&&(d.guideState=b.guideState),void 0!==b.acpAgents&&(d.acpAgents=b.acpAgents),void 0!==b.baseUrlCompat&&(d.baseUrlCompat=b.baseUrlCompat),void 0!==b.connectionMode&&(d.connectionMode=b.connectionMode),void 0!==b.customAgents&&(d.customAgents=b.customAgents),void 0!==b.skillPaths&&(d.skillPaths=b.skillPaths),delete d.customProviders,"setupPending"in b&&(b.setupPending?d.setupPending=!0:delete d.setupPending),"setupPort"in b&&(b.setupPort?d.setupPort=b.setupPort:delete d.setupPort),f().writeFileSync(r,JSON.stringify(d,null,2)+"\n","utf-8")}catch{}return i}catch{return{...s,ai:{...s.ai,providers:[]},setupPending:!0,connectionMode:{cli:!0,mcp:!1},allowNetworkAccess:!1}}}function p(a){let b=o(),c=a||b.ai.activeProvider,d=c?(0,m.lh)(b.ai.providers,c):void 0;if(!d&&a&&(0,l.rl)(a)){let c=b.ai.activeProvider?(0,m.lh)(b.ai.providers,b.ai.activeProvider):void 0;d=c?.protocol===a?c:b.ai.providers.find(b=>b.protocol===a)}if(d){let a=l.T_[d.protocol],b=d.apiKey||(0,l.lr)(d.protocol)||a?.apiKeyFallback||"",c=d.model||a?.defaultModel||"",e=d.baseUrl||a?.fixedBaseUrl||"";return{provider:d.protocol,apiKey:b,model:c,baseUrl:e}}let e=a&&(0,l.rl)(a)?a:process.env.AI_PROVIDER,f=e&&(0,l.rl)(e)?e:"anthropic",g=l.T_[f]??l.T_.anthropic;return{provider:f,apiKey:(0,l.lr)(f)||g.apiKeyFallback||"",model:g.defaultModel,baseUrl:g.fixedBaseUrl||""}}function q(){return o().mindRoot||process.env.MIND_ROOT||h().join(j().homedir(),"MindOS","mind")}d()}catch(a){d(a)}})},27152:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Bk:()=>p,II:()=>o,s7:()=>q});var e=c(23414),f=c(79646),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(33873),l=c.n(k),m=c(79551),n=a([e]);function o(){try{let a=(0,e.sb)().embedding;if(!a||!a.enabled||"api"===a.provider&&(!a.baseUrl||!a.model)||"local"===a.provider&&!a.model)return null;return{enabled:!0,provider:a.provider||"api",baseUrl:(a.baseUrl||"").replace(/\/+$/,""),apiKey:a.apiKey||"",model:a.model}}catch{return null}}async function p(a){let b=o();if(!b||0===a.length)return[];try{if("local"===b.provider)return await x(b.model,a);return await y(b,a)}catch(a){return console.error("[embedding] Failed to get embeddings:",a instanceof Error?a.message:a),[]}}async function q(a){let b=await p([a]);return b.length>0?b[0]:null}e=(n.then?(await n)():n)[0];let B=["@huggingface/transformers@4.2.0","onnxruntime-node@1.24.3","onnxruntime-web@1.26.0-dev.20260416-b7804b056c"],C=Function("specifier","return import(specifier)");class D extends Error{constructor(a="Local embedding runtime is not installed. Install it from Settings > AI > Embedding Search, or use API mode."){super(a),this.name="LocalEmbeddingRuntimeMissingError"}}function r(){return process.env.MINDOS_LOCAL_EMBEDDING_RUNTIME_DIR||l().join(j().homedir(),".mindos","local-embedding-runtime")}let E=null,F=null,G=null;async function s(){let a=r();h().mkdirSync(a,{recursive:!0});let b=l().join(a,"package.json");h().existsSync(b)||h().writeFileSync(b,JSON.stringify({private:!0,name:"mindos-local-embedding-runtime",description:"Optional MindOS local embedding runtime installed on user request."},null,2)+"\n");let c=function(){if(process.env.MINDOS_NPM_BIN)return{command:process.env.MINDOS_NPM_BIN,args:[]};let a=process.env.MINDOS_PROJECT_ROOT;if(a){let b=l().join(a,"node","lib","node_modules","npm","bin","npm-cli.js");if(h().existsSync(b))return{command:process.env.MINDOS_NODE_BIN||process.execPath,args:[b]}}return{command:"win32"===process.platform?"npm.cmd":"npm",args:[]}}(),d=[...c.args,"install","--prefix",a,"--omit=dev","--no-audit","--no-fund","--ignore-scripts",...B];await t(c.command,d,6e5)}async function t(a,b,c){await new Promise((d,e)=>{let g=(0,f.spawn)(a,b,{stdio:["ignore","pipe","pipe"],env:process.env}),h="",i=setTimeout(()=>{g.kill("SIGTERM"),e(Error("Local embedding runtime install timed out. Check your network and try again, or use API mode."))},c);g.stdout.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.stderr.on("data",a=>{(h+=a.toString()).length>8e3&&(h=h.slice(-8e3))}),g.on("error",a=>{clearTimeout(i),"ENOENT"===a.code?e(Error("npm is required to install the optional local embedding runtime. Install Node.js/npm, or use API embedding mode.")):e(a)}),g.on("exit",a=>{clearTimeout(i),0===a?d():e(Error(`Local embedding runtime install failed with exit code ${a}. ${h.trim().slice(-1e3)}`))})})}async function u(a){return E&&F===a?E:G&&F===a?G:(F=a,G=(async()=>{for(let b=0;b<=2;b++){let c=null,d=!1,e=null;try{let{pipeline:e,env:f}=await v({installIfMissing:!1});process.env.HF_ENDPOINT||f.remoteHost||(console.log("[embedding] Configuring hf-mirror.com for better connectivity in China"),f.remoteHost="https://hf-mirror.com",f.remotePathTemplate="{model}/resolve/{revision}/{fileName}"),c=setTimeout(()=>{d=!0},3e5),console.log(`[embedding] Attempt ${b+1}/3: Loading pipeline for ${a}...`);let g=e("feature-extraction",a,{dtype:"fp32"});return E=await g,c&&clearTimeout(c),console.log(`[embedding] Successfully loaded pipeline for ${a}`),E}catch(f){e=f instanceof Error?f:Error(String(f)),c&&clearTimeout(c),d&&(e=Error("Request timeout (>300s)"));let a=function(a){if(!(a instanceof Error))return!1;let b=a.message.toLowerCase();return b.includes("enotfound")||b.includes("econnrefused")||b.includes("econnreset")||b.includes("etimedout")||b.includes("timeout")||b.includes("temporarily unavailable")||b.includes("connect econnrefused")||b.includes("net::err_internet_disconnected")||b.includes("eaddrnotavail")||b.includes("enetunreach")||b.includes("socket hang up")}(e)&&b<2;if(console.error(`[embedding] Download attempt ${b+1}/3 failed: ${e.message}`+(a?` — retrying...`:" — giving up")),a){let a=1e3*Math.pow(2,b);console.log(`[embedding] Waiting ${a}ms before retry...`),await new Promise(b=>setTimeout(b,a));continue}throw E=null,F=null,G=null,e}}})())}async function v({installIfMissing:a}){try{return await Promise.resolve().then(c.bind(c,99253))}catch(c){let b=w();if(b)return await C((0,m.pathToFileURL)(b).href);if(a){await s();let a=w();if(a)return await C((0,m.pathToFileURL)(a).href)}throw new D(c instanceof Error&&c.message.includes("@huggingface/transformers")?void 0:`Local embedding runtime is unavailable: ${c instanceof Error?c.message:String(c)}`)}}function w(){let a=l().join(r(),"node_modules","@huggingface","transformers"),b=l().join(a,"package.json");if(!h().existsSync(b))return null;try{let c=JSON.parse(h().readFileSync(b,"utf-8")),d=c.exports?.node?.import?.default,e="string"==typeof d?d:"string"==typeof c.module?c.module:c.main;if("string"!=typeof e)return null;let f=l().resolve(a,e);return h().existsSync(f)?f:null}catch{return null}}async function x(a,b){let c=await u(a);if(!c)return[];let d=[];for(let a=0;a<b.length;a+=32)for(let e of b.slice(a,a+32)){let a=(await c(e,{pooling:"mean",normalize:!0})).data;d.push(new Float32Array(a))}return d}async function y(a,b){let c=[];for(let d=0;d<b.length;d+=100){let e=b.slice(d,d+100),f=await z(a,e);if(0===f.length)return[];c.push(...f)}return c}async function z(a,b){let c=`${a.baseUrl}/embeddings`,d=JSON.stringify({model:a.model,input:b}),e={"Content-Type":"application/json"};a.apiKey&&(e.Authorization=`Bearer ${a.apiKey}`);for(let a=0;a<=2;a++)try{let b=new AbortController,f=setTimeout(()=>b.abort(),3e4),g=await fetch(c,{method:"POST",headers:e,body:d,signal:b.signal});if(clearTimeout(f),!g.ok){let b=g.status;if((429===b||b>=500)&&a<2){let a=parseInt(g.headers.get("retry-after")||"1",10);await A(Math.min(1e3*a,5e3));continue}let c=await g.text().catch(()=>"");return console.error(`[embedding] API error ${b}: ${c.slice(0,200)}`),[]}let h=await g.json();if(!h.data||!Array.isArray(h.data))return console.error("[embedding] Unexpected response shape"),[];return h.data.sort((a,b)=>a.index-b.index),h.data.map(a=>new Float32Array(a.embedding))}catch(b){if(a<2){await A(1e3*(a+1));continue}console.error("[embedding] Request failed:",b instanceof Error?b.message:b);break}return[]}function A(a){return new Promise(b=>setTimeout(b,a))}d()}catch(a){d(a)}})},28287:(a,b,c)=>{c.d(b,{F0:()=>m});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(13308);function i(a){return k(a,".trash")}function j(a){return k(a,".trash-meta")}function k(a,b){l(b);let c=g().resolve(g().dirname(a)),d=g().resolve(c,b),f=g().relative(c,d);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent");if(e().existsSync(d)){if(e().lstatSync(d).isSymbolicLink())throw Error("Access denied: trash directory must not be a symlink");let a=e().realpathSync(c),b=e().realpathSync(d),f=g().relative(a,b);if(".."===f||f.startsWith(`..${g().sep}`)||g().isAbsolute(f))throw Error("Access denied: trash directory outside root parent")}return d}function l(a){if(!a||a.includes("/")||a.includes("\\")||g().basename(a)!==a)throw Error("Invalid trash id")}function m(a,b){let c,d;e().mkdirSync(i(a),{recursive:!0}),e().mkdirSync(j(a),{recursive:!0});let f=(0,h.n2)(a,b);if(!e().existsSync(f))throw Error(`File not found: ${b}`);let k=e().statSync(f).isDirectory(),m=g().basename(b),n=(c=m.replace(/[^a-zA-Z0-9._\-\u4e00-\u9fff]/g,"_"),`${Date.now()}_${c}`),o=g().join(i(a),n);if(e().mkdirSync(g().dirname(o),{recursive:!0}),k)e().cpSync(f,o,{recursive:!0}),e().rmSync(f,{recursive:!0,force:!0});else try{e().renameSync(f,o)}catch(a){if("EXDEV"===a.code)e().copyFileSync(f,o),e().unlinkSync(f);else throw a}let p=new Date,q={id:n,originalPath:b,deletedAt:p.toISOString(),expiresAt:new Date(p.getTime()+2592e6).toISOString(),fileName:m,isDirectory:k};return l(q.id),d=g().join(j(a),`${q.id}.json`),e().writeFileSync(d,JSON.stringify(q,null,2),"utf-8"),q}},28647:(a,b,c)=>{c.d(b,{b:()=>i});var d=c(79646),e=c(29021),f=c.n(e),g=c(33873),h=c.n(g);function i(a){try{let b=function(a){let b=[],c=process.env.MINDOS_PROJECT_ROOT;c&&b.push(h().join(c,"packages","web","scripts",a));let d=process.cwd();for(let c of(b.push(h().join(d,"scripts",a)),b.push(h().resolve(d,"..","..","scripts",a)),b.push(h().join(d,".next","standalone","scripts",a)),b))if(f().existsSync(c))return c;return null}("extract-pdf.cjs");if(!b)return"";let c=(0,d.execFileSync)(function(a=process.env){return a.MINDOS_NODE_BIN?.trim()||process.execPath}(),[b,a],{encoding:"utf-8",timeout:15e3,maxBuffer:5242880});return JSON.parse(c).text||""}catch{return""}}},28696:(a,b,c)=>{c.d(b,{gG:()=>d.gG});var d=c(50294)},30281:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{O:()=>o});var e=c(29021),f=c.n(e),g=c(33873),h=c.n(g),i=c(21820),j=c.n(i),k=c(31751),l=c(59349),m=c(27152),n=a([m]);m=(n.then?(await n)():n)[0];class o{isReady(){return this._ready}isBuilding(){return this._building}getDocCount(){return this.vectors.size}getDimensions(){return this.dimensions}async rebuild(a){if(!this._building){this._building=!0;try{if(!(0,m.II)()){this._building=!1;return}let b=(0,k.f)(a),c=[],d=[];for(let e of b){let b,f=h().extname(e).toLowerCase();if(".md"!==f&&".csv"!==f)continue;try{b=(0,l.TA)(a,e)}catch{continue}let g=`${e}
2
2
  ${b}`.slice(0,8e3);c.push(g),d.push(e)}if(0===c.length){this._building=!1,this._ready=!0,this.builtForRoot=a;return}let e=await (0,m.Bk)(c);if(e.length!==c.length){console.error(`[embedding-index] Expected ${c.length} vectors, got ${e.length}`),this._building=!1;return}this.vectors.clear(),this.dimensions=e[0].length;for(let a=0;a<d.length;a++)this.vectors.set(d[a],e[a]);this.builtForRoot=a,this._ready=!0;try{this.persist()}catch{}}catch(a){console.error("[embedding-index] Rebuild failed:",a instanceof Error?a.message:a)}finally{this._building=!1}}}async updateFile(a,b){let c;if(!this._ready)return;let d=h().extname(b).toLowerCase();if(".md"!==d&&".csv"!==d)return;try{c=(0,l.TA)(a,b)}catch{return}let e=`${b}
3
3
  ${c}`.slice(0,8e3),f=await (0,m.s7)(e);f&&(this.vectors.set(b,f),0===this.dimensions&&(this.dimensions=f.length))}removeFile(a){this.vectors.delete(a)}searchByVector(a,b=20){if(!this._ready||0===this.vectors.size)return[];if(this.dimensions>0&&a.length!==this.dimensions)return console.warn(`[embedding-index] Dimension mismatch: query has ${a.length} dimensions, index has ${this.dimensions}. Returning empty results.`),[];let c=[];for(let[b,d]of this.vectors){let e=function(a,b){if(a.length!==b.length||0===a.length)return 0;let c=0,d=0,e=0;for(let f=0;f<a.length;f++)c+=a[f]*b[f],d+=a[f]*a[f],e+=b[f]*b[f];let f=Math.sqrt(d)*Math.sqrt(e);return 0===f?0:Math.max(0,Math.min(1,c/f))}(a,d);c.push({path:b,similarity:e})}return c.sort((a,b)=>b.similarity-a.similarity),c.slice(0,b)}async search(a,b=20){if(!this._ready)return[];let c=await (0,m.s7)(a);return c?this.searchByVector(c,b):[]}get persistPath(){return h().join(j().homedir(),".mindos","embedding-index.json")}persist(){if(0===this.vectors.size)return;let a={version:1,builtForRoot:this.builtForRoot??"",dimensions:this.dimensions,docCount:this.vectors.size,timestamp:Date.now(),vectors:{}};for(let[b,c]of this.vectors)a.vectors[b]=Array.from(c);let b=h().dirname(this.persistPath);try{f().mkdirSync(b,{recursive:!0}),f().writeFileSync(this.persistPath,JSON.stringify(a),"utf-8")}catch{}}load(a){try{let b=f().readFileSync(this.persistPath,"utf-8"),c=JSON.parse(b);if(1!==c.version||c.builtForRoot!==a)return!1;let d=(0,k.f)(a).filter(a=>{let b=h().extname(a).toLowerCase();return".md"===b||".csv"===b}).length;if(Math.abs(d-c.docCount)>Math.max(5,.1*d))return!1;for(let[a,b]of(this.vectors.clear(),this.dimensions=c.dimensions,Object.entries(c.vectors)))this.vectors.set(a,new Float32Array(b));return this.builtForRoot=c.builtForRoot,this._ready=!0,!0}catch{return!1}}invalidate(){this.vectors.clear(),this.dimensions=0,this.builtForRoot=null,this._ready=!1}isBuiltFor(a){return this._ready&&this.builtForRoot===a}constructor(){this.vectors=new Map,this.dimensions=0,this.builtForRoot=null,this._ready=!1,this._building=!1}}d()}catch(a){d(a)}})},31751:(a,b,c)=>{c.d(b,{f:()=>function a(b,c,d={}){let f,k=function(a,b){let c=g().resolve(a),d=b?g().resolve(b):c;try{var f;let a,b=e().realpathSync(c);if(f=e().realpathSync(d),a=g().relative(b,f),""!==a&&(".."===a||a.startsWith(`..${g().sep}`)||g().isAbsolute(a)))return null}catch{return null}return{root:c,dir:d}}(b,c);if(!k)return[];let{root:l,dir:m}=k,n=d.ignoredDirs??h,o=d.allowedExtensions??i;try{f=e().readdirSync(m,{withFileTypes:!0})}catch{return[]}let p=[];for(let c of f){let e=g().join(m,c.name);if(c.isDirectory()){if(n.has(c.name))continue;p.push(...a(b,e,d))}else if(c.isFile()){var q;if(m===l&&j.has(c.name))continue;let a=g().extname(c.name).toLowerCase();o.has(a)&&p.push((q=g().relative(l,e),"win32"===process.platform?q.replace(/\\/g,"/"):q))}}return p}});var d=c(29021),e=c.n(d);c(79748);var f=c(33873),g=c.n(f);let h=new Set([".git","node_modules","app",".next",".DS_Store","mcp",".media"]),i=new Set([".md",".csv",".pdf",".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".mp3",".wav",".m4a",".ogg",".flac",".aac",".mp4",".webm",".mov",".mkv"]),j=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"])},31756:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{KP:()=>i,Ot:()=>k,T_:()=>m,im:()=>h,lr:()=>j,rl:()=>g,us:()=>l});var e=c(14270);c(84389);var f=a([e]);e=(f.then?(await f)():f)[0];let m={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",shortLabel:"Anthropic",defaultModel:"claude-sonnet-4-6",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://console.anthropic.com/settings/keys",category:"primary"},openai:{id:"openai",name:"OpenAI",nameZh:"OpenAI",shortLabel:"OpenAI",defaultModel:"gpt-5.4",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.openai.com/api-keys",category:"primary"},google:{id:"google",name:"Google Gemini",nameZh:"Google Gemini",shortLabel:"Gemini",defaultModel:"gemini-2.5-flash",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://aistudio.google.com/apikey",category:"primary"},groq:{id:"groq",name:"Groq",nameZh:"Groq",shortLabel:"Groq",defaultModel:"llama-3.3-70b-versatile",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://console.groq.com/keys",category:"more"},xai:{id:"xai",name:"xAI (Grok)",nameZh:"xAI (Grok)",shortLabel:"xAI",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",shortLabel:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",shortLabel:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",shortLabel:"DeepSeek",defaultModel:"deepseek-chat",piProviderOverride:"openai",fixedBaseUrl:"https://api.deepseek.com/v1",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.deepseek.com/api_keys",category:"more"},zai:{id:"zai",name:"ZhipuAI (GLM)",nameZh:"智谱 AI (GLM 国际版)",shortLabel:"智谱GLM",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"zai-cn":{id:"zai-cn",name:"ZhipuAI (GLM China)",nameZh:"智谱 AI (GLM 国内版)",shortLabel:"智谱GLM-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"glm-4-plus",piProviderOverride:"zai",fixedBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://open.bigmodel.cn/",category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",shortLabel:"Kimi Coding",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",shortLabel:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax (国际版)",shortLabel:"MiniMax",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"minimax-cn":{id:"minimax-cn",name:"MiniMax (China)",nameZh:"MiniMax (国内版)",shortLabel:"MiniMax-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",shortLabel:"HuggingFace",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",shortLabel:"Ollama",description:"Local server (requires setup)",descriptionZh:"本地服务器 (需要本地部署)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"local"},"lm-studio":{id:"lm-studio",name:"LM Studio",nameZh:"LM Studio (本地)",shortLabel:"LM Studio",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:1234/v1",apiKeyFallback:"lm-studio",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://lmstudio.ai/",category:"local"},vllm:{id:"vllm",name:"vLLM",nameZh:"vLLM (本地)",shortLabel:"vLLM",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:8000/v1",apiKeyFallback:"vllm",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://docs.vllm.ai/",category:"local"}};function g(a){return a in m}function h(a){return m[a]??m.anthropic}function i(a){return m[a].piProviderOverride??a}function j(a){return"deepseek"===a?process.env.DEEPSEEK_API_KEY:(0,e.getEnvApiKey)(i(a))}function k(a){let b=m[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}function l(a){try{let b=(0,e.getModels)(i(a));return b[0]?.api??"openai-completions"}catch{return"openai-completions"}}Object.keys(m),d()}catch(a){d(a)}})},36057:(a,b,c)=>{c(33873),c(59349)},37700:(a,b,c)=>{c.d(b,{d:()=>q});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(31751),i=c(59349),j=c(13308),k=c(28647),l=c(87155),m=c(82614);let n="u">typeof Intl&&Intl.Segmenter?new Intl.Segmenter("zh",{granularity:"word"}):null;function o(a){let b=new Set,c=a.toLowerCase(),d=c.match(/[a-z0-9_$@#]+/g);if(d)for(let a of d)a.length>=2&&b.add(a);if(l.y.test(c))if(n)for(let{segment:a,isWordLike:d}of n.segment(c)){if(!d)continue;let c=a.trim();if(c)for(let a of(b.add(c),c))l.y.test(a)&&b.add(a)}else{let a=[];for(let d of c)l.y.test(d)?a.push(d):a.length>0&&(p(a,b),a.length=0);a.length>0&&p(a,b)}return b}function p(a,b){for(let c=0;c<a.length;c++)b.add(a[c]),c+1<a.length&&b.add(a[c]+a[c+1])}class q{async rebuildAsync(a){let b=m.Y.startTimer("search.index.rebuild.async");try{let d,{Worker:e}=await Promise.resolve().then(c.t.bind(c,73566,23)),{existsSync:f}=await Promise.resolve().then(c.t.bind(c,29021,23));try{if(d=22288,!f(d))throw Error("Worker file not found")}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_no_worker"});return}let g=await new Promise((b,c)=>{let f=new e(d,{workerData:{mindRoot:a},execArgv:process.execArgv.filter(a=>a.startsWith("--require")||a.startsWith("--loader"))}),g=setTimeout(()=>{f.terminate(),c(Error("Search rebuild worker timed out"))},3e4);f.on("message",a=>{clearTimeout(g),f.terminate(),a.ok&&a.data?b(a.data):c(Error(a.error||"Worker failed"))}),f.on("error",a=>{clearTimeout(g),f.terminate(),c(a)})});this.restoreFromPersisted(g),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"worker"})}catch{this.rebuild(a),b({fileCount:this.fileCount,tokenCount:this.invertedIndex?.size??0,method:"sync_fallback"})}}restoreFromPersisted(a){this.builtForRoot=a.builtForRoot,this.fileCount=a.fileCount,this.totalChars=a.totalChars,this.docLengths=new Map(Object.entries(a.docLengths).map(([a,b])=>[a,b]));let b=new Map,c=new Map;for(let[d,e]of Object.entries(a.invertedIndex)){let a=new Set(e);for(let e of(b.set(d,a),a)){let a=c.get(e);a||(a=new Set,c.set(e,a)),a.add(d)}}this.invertedIndex=b,this.fileTokens=c}rebuild(a){let b=m.Y.startTimer("search.index.rebuild"),c=(0,h.f)(a),d=new Map,e=new Map,f=new Map,l=0,n=0;for(let b of c){let c;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))continue}catch{continue}else try{c=(0,i.TA)(a,b)}catch{continue}e.set(b,c.length),l+=c.length,c.length>5e4&&(c=c.slice(0,5e4));let h=o(b+"\n"+c);for(let a of(n+=h.size,f.set(b,h),h)){let c=d.get(a);c||(c=new Set,d.set(a,c)),c.add(b)}}this.invertedIndex=d,this.builtForRoot=a,this.fileCount=c.length,this.docLengths=e,this.totalChars=l,this.fileTokens=f,b({fileCount:c.length,tokenCount:n})}invalidate(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths.clear(),this.totalChars=0,this.fileTokens.clear()}removeFile(a){if(!this.invertedIndex)return;let b=this.fileTokens.get(a);if(b){for(let c of b)this.invertedIndex.get(c)?.delete(a);this.fileTokens.delete(a)}let c=this.docLengths.get(a)??0;this.totalChars-=c,this.docLengths.delete(a),this.fileCount=Math.max(0,this.fileCount-1)}addFile(a,b){let c;if(!this.invertedIndex)return;if(".pdf"===g().extname(b).toLowerCase())try{let d=(0,j.n2)(a,b);if(!(c=(0,k.b)(d)))return}catch{return}else try{c=(0,i.TA)(a,b)}catch{return}this.docLengths.set(b,c.length),this.totalChars+=c.length,this.fileCount++,c.length>5e4&&(c=c.slice(0,5e4));let d=o(b+"\n"+c);for(let a of(this.fileTokens.set(b,d),d)){let c=this.invertedIndex.get(a);c||(c=new Set,this.invertedIndex.set(a,c)),c.add(b)}}updateFile(a,b){this.invertedIndex&&(this.removeFile(b),this.addFile(a,b))}isBuiltFor(a){return null!==this.invertedIndex&&this.builtForRoot===a}isBuilt(){return null!==this.invertedIndex}getFileCount(){return this.fileCount}getAvgDocLength(){return this.fileCount>0?this.totalChars/this.fileCount:0}getDocLength(a){return this.docLengths.get(a)??0}getDocFrequency(a){return this.invertedIndex?this.invertedIndex.get(a)?.size??0:0}getCandidatesUnion(a){if(!a.trim()||!this.invertedIndex)return null;let b=o(a.toLowerCase().trim());if(0===b.size)return null;let c=new Map;for(let a of b){let b=this.invertedIndex.get(a);if(b)for(let a of b)c.set(a,(c.get(a)??0)+1)}if(0===c.size)return[];let d=b.size;if(d>=3){let a=Math.max(1,Math.floor(d/2)),b=[...c.entries()].filter(([,b])=>b>=a).map(([a])=>a);if(b.length>0)return b}return[...c.keys()]}getCandidates(a){if(!a.trim()||!this.invertedIndex)return null;let b=o(a.toLowerCase().trim());if(0===b.size)return null;let c=null;for(let a of b){let b=this.invertedIndex.get(a);if(!b)return[];if(null===c)c=new Set(b);else{for(let a of c)b.has(a)||c.delete(a);if(0===c.size)return[]}}return c?Array.from(c):[]}persist(a){if(!this.invertedIndex)return;let b={version:1,builtForRoot:this.builtForRoot??"",fileCount:this.fileCount,totalChars:this.totalChars,docLengths:Object.fromEntries(this.docLengths),invertedIndex:{},timestamp:Date.now()};for(let[a,c]of this.invertedIndex)b.invertedIndex[a]=[...c];let c=g().join(a,"search-index.json");try{e().mkdirSync(a,{recursive:!0}),e().writeFileSync(c,JSON.stringify(b),"utf-8")}catch{}}load(a,b){let c,d,f=g().join(a,"search-index.json");try{c=e().readFileSync(f,"utf-8")}catch{return!1}try{d=JSON.parse(c)}catch{return!1}if(1!==d.version||d.builtForRoot!==b||(0,h.f)(b).length!==d.fileCount)return!1;let i=Object.keys(d.docLengths);if(Math.min(50,i.length)===i.length)for(let a of i)try{if(e().statSync((0,j.n2)(b,a)).mtimeMs>d.timestamp)return!1}catch{return!1}else{let a=Math.max(1,Math.floor(i.length/40)),c=new Set;for(let b=0;b<i.length;b+=a)c.add(b);for(let a=Math.max(0,i.length-10);a<i.length;a++)c.add(a);for(let a of c)try{if(e().statSync((0,j.n2)(b,i[a])).mtimeMs>d.timestamp)return!1}catch{return!1}}return this.restoreFromPersisted(d),!0}constructor(){this.invertedIndex=null,this.builtForRoot=null,this.fileCount=0,this.docLengths=new Map,this.totalChars=0,this.fileTokens=new Map}}},38264:(a,b,c)=>{function d(a){return!!a&&"object"==typeof a}function e(a,b){let c=a[b];return d(c)?c:void 0}function f(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="text_delta"}function g(a){if(!d(a))return"";let b=e(a,"assistantMessageEvent");return"string"==typeof b?.delta?b.delta:""}function h(a){return!!d(a)&&"message_update"===a.type&&e(a,"assistantMessageEvent")?.type==="thinking_delta"}function i(a){return g(a)}function j(a){return d(a)&&"tool_execution_start"===a.type}function k(a){return d(a)?{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",toolName:"string"==typeof a.toolName?a.toolName:"unknown",args:a.args??{}}:{toolCallId:"",toolName:"unknown",args:{}}}function l(a){return d(a)&&"tool_execution_end"===a.type}function m(a){if(!d(a))return{toolCallId:"",output:"",isError:!1};let b=e(a,"result"),c=(Array.isArray(b?.content)?b.content:[]).filter(a=>d(a)&&"text"===a.type).map(a=>a.text??"").join("");return{toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"",output:c,isError:!0===a.isError}}function n(a){return"organize"===a?"organize":"chat"===a?"chat":"agent"}function o(a){return Math.min(1e3*2**a,1e4)}function p(a,b){return new Promise((c,d)=>{let e=()=>b?.reason??new DOMException("The operation was aborted.","AbortError");if(b?.aborted)return void d(e());let f=setTimeout(c,a);b?.addEventListener("abort",()=>{clearTimeout(f),d(e())},{once:!0})})}async function q(a){let b=a.messages.length>0?a.messages[a.messages.length-1]:void 0,c=b?.role==="user"?b.content:"",d=b?.role==="user"&&"string"==typeof b.skillName?b.skillName:void 0,e=r(b),f=a.services.resolveModelConfig({providerOverride:a.providerOverride,modelOverride:a.modelOverride,messages:a.messages,hasImages:a.messages.some(a=>(r(a)?.length??0)>0)}),g=a.systemPrompt;if("ollama"===f.provider&&a.services.getOllamaContextWindow&&a.services.estimateTokens&&a.services.compactPrompt){let b=f.baseUrl||"http://localhost:11434/v1",c=await a.services.getOllamaContextWindow(b,f.modelName),d=a.services.estimateTokens(g),e=c?Math.floor(.7*c):void 0;a.services.onOllamaContext?.({modelName:f.modelName,contextWindow:c,promptTokens:d,maxPromptTokens:e}),e&&d>e&&(g=a.services.compactPrompt(g,{maxPromptTokens:e,estimateTokens:a.services.estimateTokens,onStrip:a.services.onOllamaCompactStrip}),a.services.onOllamaCompacted?.({beforeTokens:d,afterTokens:a.services.estimateTokens(g)}))}let h=(function(a){let b=[];for(let c of a){let a=c.timestamp??Date.now();if("user"===c.role){b.push({role:"user",content:function(a,b){let c=b?.filter(a=>a.data);if(!c||0===c.length)return a;let d=c.map(a=>({type:"image",data:a.data,mimeType:a.mimeType}));return a&&d.push({type:"text",text:a}),d}(c.content,c.images),timestamp:a});continue}if(c.content.startsWith("__error__"))continue;if(!c.parts||0===c.parts.length){c.content&&b.push(s({content:[{type:"text",text:c.content}],stopReason:"stop",timestamp:a}));continue}let d=[],e=[];for(let a of c.parts)"text"===a.type?a.text&&d.push({type:"text",text:a.text}):"tool-call"===a.type&&(d.push({type:"toolCall",id:a.toolCallId,name:a.toolName,arguments:a.input??{}}),e.push(a));for(let c of(d.length>0&&b.push(s({content:d,stopReason:e.length>0?"toolUse":"stop",timestamp:a})),e))b.push({role:"toolResult",toolCallId:c.toolCallId,toolName:c.toolName,content:[{type:"text",text:c.output??""}],isError:"error"===c.state,timestamp:a})}return b})(a.messages).slice(0,-1),i=a.services.convertToLlm(h);a.services.setKbMode(a.mode);let j=a.services.createAuthStorage();j.setRuntimeApiKey(a.services.toRuntimeProvider(f.provider),f.apiKey);let k=a.services.createModelRegistry(j),l=a.services.createSettingsManager(function(a={},b){return{enableSkillCommands:!0,...a.enableThinking&&"anthropic"===b?{thinkingBudgets:{medium:a.thinkingBudget??5e3}}:{},..."off"===a.contextStrategy?{compaction:{enabled:!1}}:{}}}(a.agentConfig,f.provider)),m=new Set(["mindos","mindos-zh","mindos-max","mindos-max-zh"]),n=a.services.createResourceLoader({cwd:a.projectRoot,settingsManager:l,systemPromptOverride:()=>g,appendSystemPromptOverride:()=>[],agentsFilesOverride:()=>({agentsFiles:[]}),skillsOverride:a=>({...a,skills:a.skills.filter(a=>!m.has(a.name))}),additionalSkillPaths:a.additionalSkillPaths??[],additionalExtensionPaths:a.additionalExtensionPaths??[]});if(await n.reload(),"agent"===a.mode){let b=new Set(a.serverSettings?.disabledSkills??[]),c=(n.getSkills?.().skills??[]).filter(a=>!m.has(a.name)&&!a.disableModelInvocation&&!b.has(a.name));c.length>0&&a.services.generateSkillsXml&&(g+=`
4
4
 
@@ -8,7 +8,7 @@ ${c.text||"(empty response)"}`)}finally{await (0,g.Vu)(d.id).catch(()=>{})}}catc
8
8
 
9
9
  [...extracted ${k}/${j} paragraphs by relevance — file is ${a.length} chars]`:""),truncated:k<j}}function e(a,b){let c=a.lastIndexOf("\n\n",b);(-1===c||c<.5*b)&&(c=a.lastIndexOf("\n",b)),-1===c&&(c=b);let d=a.split("\n").length;return{result:a.slice(0,c)+`
10
10
 
11
- [...truncated — file is ${a.length} chars (${d} lines), showing first ~${c} chars]`+"\n[Use read_file_chunk to read the rest of the file by specifying start_line and end_line]",truncated:!0}}c.d(b,{u:()=>d})},49899:(a,b,c)=>{c.d(b,{h:()=>i});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(68850);function i(a,b){let{projectRoot:c,mindRoot:d,settings:f}=b;for(let b of(0,h.G)(c,d,f)){let c=g().join(b,a,"SKILL.md");if(e().existsSync(c))return e().readFileSync(c,"utf-8")}return null}},52001:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{em:()=>i,wD:()=>h});var e=c(14270),f=c(52076),g=a([e]);function h(a){let b=(0,f.H)(a),c=a.length-b;return Math.ceil(1.5*b+c/4)}e=(g.then?(await g)():g)[0];let j=new Map;async function i(a,b){let c=`${a}::${b}`;if(j.has(c))return j.get(c);let d=a.replace(/\/v1\/?$/,"");try{let a,e=await fetch(`${d}/api/show`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b}),signal:AbortSignal.timeout(3e3)});if(!e.ok)return;let f=await e.json();if(f.model_info){let b=f.model_info.context_length??f.model_info.num_ctx??f.model_info["general.context_length"];"number"==typeof b&&b>0&&(a=b)}if(!a&&"string"==typeof f.parameters){let b=f.parameters.match(/num_ctx\s+(\d+)/);b&&(a=parseInt(b[1],10))}if(a&&a>0)return j.set(c,a),a}catch{}}Object.entries({claude:2e5,"gpt-4o":128e3,"gpt-4":128e3,"gpt-3.5":16e3,"gpt-5":2e5}).sort((a,b)=>b[0].length-a[0].length),d()}catch(a){d(a)}})},57774:(a,b,c)=>{c.d(b,{n:()=>j});var d=c(73566),e=c(33873),f=c.n(e);let g=null,h=0,i=new Map;function j(a,b){let c=function(){if(g)return g;try{let a=f().resolve(__dirname,"diff-worker.js");return(g=new d.Worker(a)).on("message",({id:a,result:b,error:c})=>{let d=i.get(a);d&&(i.delete(a),clearTimeout(d.timer),c?d.reject(Error(c)):d.resolve(b))}),g.on("error",()=>{g=null,k()}),g.on("exit",()=>{g=null,k()}),g}catch{return null}}();if(!c)return Promise.resolve(null);let e=h++;return new Promise(d=>{let f=setTimeout(()=>{i.delete(e),d(null)},5e3);i.set(e,{resolve:a=>d(a),reject:()=>d(null),timer:f}),c.postMessage({id:e,before:a,after:b})})}function k(){for(let[,a]of i)clearTimeout(a.timer),a.resolve([]);i.clear()}},64368:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{AC:()=>r,v3:()=>q,wA:()=>s});var e=c(33873),f=c.n(e),g=c(7091),h=c(76969),i=c(52001),j=c(9320),k=c(51986),l=c(95949),m=c(5675),n=c(35266),o=c(68850),p=a([g,h,i,j,k,l,m]);function q(a){return"organize"===a?(0,h.dg)():"chat"===a?(0,h.WC)():(0,h.bm)()}function r(a){let b=f().join(a.projectRoot,"packages","web");return{additionalSkillPaths:(0,o.G)(a.projectRoot,a.mindRoot,a.serverSettings),additionalExtensionPaths:[...(0,m.Zx)(),f().join(b,"lib","agent","kb-extension.ts"),f().join(b,"node_modules","pi-mcp-adapter","index.ts"),f().join(b,"lib","im","index.ts"),f().join(b,"node_modules","pi-subagents","index.ts"),f().join(b,"lib","agent","web-search-extension.ts"),f().join(b,"node_modules","pi-web-access","index.ts"),f().join(b,"lib","schedule-prompt","index.ts")]}}function s(a){return{resolveModelConfig:b=>{let c,d;if(b.providerOverride)if((0,k.yx)(b.providerOverride)){let e=(0,k.CY)(a.ai?.providers??[],b.providerOverride);if(!e){let a=Error("Custom provider not found");throw a.code="INVALID_REQUEST",a.status=400,a}c=e.protocol,d={apiKey:e.apiKey,model:e.model,baseUrl:e.baseUrl}}else(0,j.rl)(b.providerOverride)&&(c=b.providerOverride);let e=b.modelOverride?.trim()||void 0;return(0,g.Ac)({provider:c,apiKey:d?.apiKey,model:e??d?.model,baseUrl:d?.baseUrl,hasImages:(0,g.v9)(b.messages)})},toRuntimeProvider:a=>(0,j.KP)(a),setKbMode:a=>(0,l.H)("organize"===a?"organize":"chat"===a?"chat":"agent"),generateSkillsXml:a=>(0,n.X)(a),getOllamaContextWindow:i.em,estimateTokens:i.wD,onOllamaContext:({modelName:a,contextWindow:b,promptTokens:c,maxPromptTokens:d})=>{b&&console.log(`[ask] Ollama model="${a}" context=${b} promptTokens=${c} maxPromptTokens=${d}`),d&&c>d&&console.warn(`[ask] Ollama context overflow: prompt ${c} tokens > ${d} max (${b} ctx). Compacting...`)},onOllamaCompactStrip:(a,b)=>{console.log(`[ask] Ollama compact: stripping section (${b} tokens): ${a.slice(0,80)}...`)},onOllamaCompacted:({beforeTokens:a,afterTokens:b})=>{console.log(`[ask] Ollama compacted: ${a} -> ${b} tokens`)}}}[g,h,i,j,k,l,m]=p.then?(await p)():p,d()}catch(a){d(a)}})},68681:(a,b,c)=>{c.d(b,{de:()=>g,TS:()=>k});let d=`You are MindOS — the user's local knowledge assistant.
11
+ [...truncated — file is ${a.length} chars (${d} lines), showing first ~${c} chars]`+"\n[Use read_file_chunk to read the rest of the file by specifying start_line and end_line]",truncated:!0}}c.d(b,{u:()=>d})},49899:(a,b,c)=>{c.d(b,{h:()=>i});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(68850);function i(a,b){let{projectRoot:c,mindRoot:d,settings:f}=b;for(let b of(0,h.Gw)(c,d,f)){let c=g().join(b,a,"SKILL.md");if(e().existsSync(c))return e().readFileSync(c,"utf-8");let d=g().join(b,"SKILL.md");if(e().existsSync(d)){let c=e().readFileSync(d,"utf-8");if((function(a){let b=a.match(/^---\n([\s\S]*?)\n---/);if(!b)return{name:"",description:""};let c=b[1],d=c.match(/^name:\s*(.+)/m),e="",f=c.match(/^description:\s*>?\s*\n((?:\s+.+\n?)*)/m);if(f&&f[1].trim())e=f[1].split("\n").map(a=>a.replace(/^\s+/,"")).filter(a=>a.trim()).join(" ").slice(0,200);else{let a=c.match(/^description:\s*(.+)/m);if(a){let b=a[1].trim();e=">"===b?"":b.slice(0,200)}}return{name:d?d[1].trim():"",description:e}}(c).name||g().basename(b))===a)return c}}return null}},52001:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{em:()=>i,wD:()=>h});var e=c(14270),f=c(52076),g=a([e]);function h(a){let b=(0,f.H)(a),c=a.length-b;return Math.ceil(1.5*b+c/4)}e=(g.then?(await g)():g)[0];let j=new Map;async function i(a,b){let c=`${a}::${b}`;if(j.has(c))return j.get(c);let d=a.replace(/\/v1\/?$/,"");try{let a,e=await fetch(`${d}/api/show`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b}),signal:AbortSignal.timeout(3e3)});if(!e.ok)return;let f=await e.json();if(f.model_info){let b=f.model_info.context_length??f.model_info.num_ctx??f.model_info["general.context_length"];"number"==typeof b&&b>0&&(a=b)}if(!a&&"string"==typeof f.parameters){let b=f.parameters.match(/num_ctx\s+(\d+)/);b&&(a=parseInt(b[1],10))}if(a&&a>0)return j.set(c,a),a}catch{}}Object.entries({claude:2e5,"gpt-4o":128e3,"gpt-4":128e3,"gpt-3.5":16e3,"gpt-5":2e5}).sort((a,b)=>b[0].length-a[0].length),d()}catch(a){d(a)}})},57774:(a,b,c)=>{c.d(b,{n:()=>j});var d=c(73566),e=c(33873),f=c.n(e);let g=null,h=0,i=new Map;function j(a,b){let c=function(){if(g)return g;try{let a=f().resolve(__dirname,"diff-worker.js");return(g=new d.Worker(a)).on("message",({id:a,result:b,error:c})=>{let d=i.get(a);d&&(i.delete(a),clearTimeout(d.timer),c?d.reject(Error(c)):d.resolve(b))}),g.on("error",()=>{g=null,k()}),g.on("exit",()=>{g=null,k()}),g}catch{return null}}();if(!c)return Promise.resolve(null);let e=h++;return new Promise(d=>{let f=setTimeout(()=>{i.delete(e),d(null)},5e3);i.set(e,{resolve:a=>d(a),reject:()=>d(null),timer:f}),c.postMessage({id:e,before:a,after:b})})}function k(){for(let[,a]of i)clearTimeout(a.timer),a.resolve([]);i.clear()}},64368:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{AC:()=>r,v3:()=>q,wA:()=>s});var e=c(33873),f=c.n(e),g=c(7091),h=c(76969),i=c(52001),j=c(9320),k=c(51986),l=c(95949),m=c(5675),n=c(35266),o=c(68850),p=a([g,h,i,j,k,l,m]);function q(a){return"organize"===a?(0,h.dg)():"chat"===a?(0,h.WC)():(0,h.bm)()}function r(a){let b=f().join(a.projectRoot,"packages","web");return{additionalSkillPaths:(0,o.Gw)(a.projectRoot,a.mindRoot,a.serverSettings),additionalExtensionPaths:[...(0,m.Zx)(),f().join(b,"lib","agent","kb-extension.ts"),f().join(b,"node_modules","pi-mcp-adapter","index.ts"),f().join(b,"lib","im","index.ts"),f().join(b,"node_modules","pi-subagents","index.ts"),f().join(b,"lib","agent","web-search-extension.ts"),f().join(b,"node_modules","pi-web-access","index.ts"),f().join(b,"lib","schedule-prompt","index.ts")]}}function s(a){return{resolveModelConfig:b=>{let c,d;if(b.providerOverride)if((0,k.yx)(b.providerOverride)){let e=(0,k.CY)(a.ai?.providers??[],b.providerOverride);if(!e){let a=Error("Custom provider not found");throw a.code="INVALID_REQUEST",a.status=400,a}c=e.protocol,d={apiKey:e.apiKey,model:e.model,baseUrl:e.baseUrl}}else(0,j.rl)(b.providerOverride)&&(c=b.providerOverride);let e=b.modelOverride?.trim()||void 0;return(0,g.Ac)({provider:c,apiKey:d?.apiKey,model:e??d?.model,baseUrl:d?.baseUrl,hasImages:(0,g.v9)(b.messages)})},toRuntimeProvider:a=>(0,j.KP)(a),setKbMode:a=>(0,l.H)("organize"===a?"organize":"chat"===a?"chat":"agent"),generateSkillsXml:a=>(0,n.X)(a),getOllamaContextWindow:i.em,estimateTokens:i.wD,onOllamaContext:({modelName:a,contextWindow:b,promptTokens:c,maxPromptTokens:d})=>{b&&console.log(`[ask] Ollama model="${a}" context=${b} promptTokens=${c} maxPromptTokens=${d}`),d&&c>d&&console.warn(`[ask] Ollama context overflow: prompt ${c} tokens > ${d} max (${b} ctx). Compacting...`)},onOllamaCompactStrip:(a,b)=>{console.log(`[ask] Ollama compact: stripping section (${b} tokens): ${a.slice(0,80)}...`)},onOllamaCompacted:({beforeTokens:a,afterTokens:b})=>{console.log(`[ask] Ollama compacted: ${a} -> ${b} tokens`)}}}[g,h,i,j,k,l,m]=p.then?(await p)():p,d()}catch(a){d(a)}})},68681:(a,b,c)=>{c.d(b,{de:()=>g,TS:()=>k});let d=`You are MindOS — the user's local knowledge assistant.
12
12
 
13
13
  Persona: Warm yet precise, reliable, execution-oriented. Like a trusted notebook that understands you — quiet confidence, zero fluff. Be professional but never cold; be helpful but never verbose.
14
14
 
@@ -123,13 +123,13 @@ ${a.content}`).join("\n\n---\n\n");a.push(`---
123
123
 
124
124
  The following notes were automatically found in the knowledge base based on the user's question. Reference this content to provide accurate, grounded answers. Cite the file path when using information from a specific note.
125
125
 
126
- `+e)}catch(a){c.warn?.("[ask] Active recall failed, continuing without:",a)}}},68850:(a,b,c)=>{c.d(b,{G:()=>h,Z:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);function h(a,b,c){let d=g().homedir(),f=[e().join(a,"packages","web","data","skills"),e().join(a,"skills"),e().join(b,".skills"),e().join(d,".mindos","skills")];for(let a of(c?.skillPaths?.enableAgentsDir!==!1&&f.push(e().join(d,".agents","skills")),c?.skillPaths?.custom??[])){let b=a.trim();b&&f.push(b)}return f}function i(a,b,c,d){return h(b,c,d).map(b=>e().join(b,a))}},73992:(a,b,c)=>{c.d(b,{Ew:()=>d.Ew,Rf:()=>d.Rf,l3:()=>d.l3});var d=c(75791)},75634:(a,b,c)=>{c.d(b,{aY:()=>h});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f);function h(){if(process.env.MINDOS_PROJECT_ROOT)return process.env.MINDOS_PROJECT_ROOT;let a=process.cwd();for(let b=0;b<8;b+=1){if(e().existsSync(g().join(a,"pnpm-workspace.yaml"))||e().existsSync(g().join(a,"packages","mindos","package.json")))return a;let b=g().dirname(a);if(b===a)break;a=b}return g().resolve(process.cwd(),"..","..")}},76969:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{WC:()=>y,bm:()=>z,dg:()=>x,xv:()=>q});var e=c(55304),f=c(81665),g=c(18731),h=c(49899),i=c(50103),j=c(93638),k=c(4725),l=c(33229),m=c(49856),n=c(57774),o=c(75634),p=a([f,g,i,k]);function q(a,b){let{result:c}=(0,m.u)(a,2e4,b);return c}function r(a){return a instanceof Error?a.message:String(a)}function s(a){return{content:[{type:"text",text:a}],details:{}}}async function t(a,b){if(a===b)return"";let c=a.split("\n").length,d=b.split("\n").length;if(c<=2e3&&d<=2e3)return u((0,l.m)(a,b));let e=await (0,n.n)(a,b);if(!e){let a=Math.max(0,d-c),b=Math.max(0,c-d);return`(~+${a} ~−${b}, ${d} lines total)
126
+ `+e)}catch(a){c.warn?.("[ask] Active recall failed, continuing without:",a)}}},68850:(a,b,c)=>{c.d(b,{Gw:()=>h,Z6:()=>i});var d=c(33873),e=c.n(d),f=c(21820),g=c.n(f);function h(a,b,c){let d=g().homedir(),f=[e().join(a,"packages","web","data","skills"),e().join(a,"skills"),e().join(b,".skills"),e().join(d,".mindos","skills")];for(let a of(c?.skillPaths?.enableAgentsDir!==!1&&f.push(e().join(d,".agents","skills")),c?.skillPaths?.custom??[])){let b=function(a,b=g().homedir()){let c=a.trim();return"~"===c?b:c.startsWith("~/")||c.startsWith("~\\")?e().join(b,c.slice(2)):c}(a,d);b&&f.push(b)}return f}function i(a,b,c,d){return h(b,c,d).map(b=>e().join(b,a))}},73992:(a,b,c)=>{c.d(b,{Ew:()=>d.Ew,Rf:()=>d.Rf,l3:()=>d.l3});var d=c(75791)},75634:(a,b,c)=>{c.d(b,{aY:()=>h});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f);function h(){if(process.env.MINDOS_PROJECT_ROOT)return process.env.MINDOS_PROJECT_ROOT;let a=process.cwd();for(let b=0;b<8;b+=1){if(e().existsSync(g().join(a,"pnpm-workspace.yaml"))||e().existsSync(g().join(a,"packages","mindos","package.json")))return a;let b=g().dirname(a);if(b===a)break;a=b}return g().resolve(process.cwd(),"..","..")}},76969:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{WC:()=>y,bm:()=>z,dg:()=>x,xv:()=>q});var e=c(55304),f=c(81665),g=c(18731),h=c(49899),i=c(50103),j=c(93638),k=c(4725),l=c(33229),m=c(49856),n=c(57774),o=c(75634),p=a([f,g,i,k]);function q(a,b){let{result:c}=(0,m.u)(a,2e4,b);return c}function r(a){return a instanceof Error?a.message:String(a)}function s(a){return{content:[{type:"text",text:a}],details:{}}}async function t(a,b){if(a===b)return"";let c=a.split("\n").length,d=b.split("\n").length;if(c<=2e3&&d<=2e3)return u((0,l.m)(a,b));let e=await (0,n.n)(a,b);if(!e){let a=Math.max(0,d-c),b=Math.max(0,c-d);return`(~+${a} ~−${b}, ${d} lines total)
127
127
 
128
128
  --- changes ---
129
129
  (diff timed out)`}return u(e)}function u(a){let b=a.filter(a=>"insert"===a.type).length,c=a.filter(a=>"delete"===a.type).length,d=`+${b} −${c}`,e=(0,l.S)(a,2),f=[];for(let a of e){if(f.length>=30){f.push("... (diff truncated)");break}if("gap"===a.type){f.push(` ... ${a.count} lines unchanged ...`);continue}let b="insert"===a.type?"+":"delete"===a.type?"-":" ";f.push(`${b} ${a.text}`)}return`(${d})
130
130
 
131
131
  --- changes ---
132
- ${f.join("\n")}`}function v(a){try{return(0,f._P)(a)}catch{return""}}function w(a){return async(b,c,d)=>{try{return await a(b,c,d)}catch(a){return s(`Error: ${r(a)}`)}}}[f,g,i,k]=p.then?(await p)():p;let A=e.ZU.Object({path:e.ZU.Optional(e.ZU.String({description:'Optional subdirectory to list (e.g. "Projects/Products"). Omit to list everything.'})),depth:e.ZU.Optional(e.ZU.Number({description:"Max tree depth to expand (default 3). Directories deeper than this show item count only.",minimum:1,maximum:10}))}),B=e.ZU.Object({path:e.ZU.String({description:"Relative file path"})}),C=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),start_line:e.ZU.Number({description:"Line number to start reading from (1-indexed)"}),end_line:e.ZU.Number({description:"Line number to stop reading at (1-indexed)"})}),D=e.ZU.Object({query:e.ZU.String({description:"Search query (case-insensitive)"})}),E=e.ZU.Object({limit:e.ZU.Optional(e.ZU.Number({description:"Number of files to return (default 10)",minimum:1,maximum:50}))}),F=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),content:e.ZU.String({description:"New full content"})}),G=e.ZU.Object({path:e.ZU.String({description:"Relative file path (must end in .md or .csv)"}),content:e.ZU.Optional(e.ZU.String({description:"Initial file content"}))}),H=e.ZU.Object({files:e.ZU.Array(e.ZU.Object({path:e.ZU.String({description:"Relative file path (must end in .md or .csv)"}),content:e.ZU.String({description:"Initial file content"})}),{description:"List of files to create"})}),I=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),content:e.ZU.String({description:"Content to append"})}),J=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),heading:e.ZU.String({description:'Heading text to find (e.g. "## Tasks" or just "Tasks")'}),content:e.ZU.String({description:"Content to insert after the heading"})}),K=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),heading:e.ZU.String({description:'Heading text to find (e.g. "## Status")'}),content:e.ZU.String({description:"New content for the section"})}),L=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),start_line:e.ZU.Number({description:"1-indexed line number to start replacing"}),end_line:e.ZU.Number({description:"1-indexed line number to stop replacing (inclusive)"}),content:e.ZU.String({description:"New content to insert in place of those lines"})}),M=e.ZU.Object({path:e.ZU.String({description:"Current relative file path"}),new_name:e.ZU.String({description:'New filename (no path separators, e.g. "new-name.md")'})}),N=e.ZU.Object({from_path:e.ZU.String({description:"Current relative file path"}),to_path:e.ZU.String({description:"New relative file path"})}),O=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),limit:e.ZU.Optional(e.ZU.Number({description:"Number of commits to return (default 10)",minimum:1,maximum:50}))}),P=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),commit:e.ZU.String({description:"Git commit hash (full or abbreviated)"})}),Q=e.ZU.Object({path:e.ZU.String({description:"Relative path to .csv file"}),row:e.ZU.Array(e.ZU.String(),{description:"Array of cell values for the new row"})}),R=e.ZU.Object({name:e.ZU.String({description:'Skill name, e.g. "mindos" or "context7"'})}),S=new Set(["list_files","read_file","search","create_file","batch_create_files","write_file","append_to_file","insert_after_heading","update_section"]);function x(){return U.filter(a=>S.has(a.name))}let T=new Set(["list_files","read_file","read_file_chunk","search","get_recent","get_backlinks"]);function y(){return U.filter(a=>T.has(a.name))}function z(){return[...U,...j.I,...k.I]}let U=[{name:"list_files",label:"List Files",description:'List files in the knowledge base as an indented tree. Directories beyond `depth` show "... (N items)". Pass `path` to list only a subdirectory, or `depth` to control how deep to expand (default 3).',parameters:A,execute:w(async(a,b)=>{let{path:c,depth:d}=b,e=(0,f.xY)();if(0===e.length&&!c){let a=(0,f.JX)();return s(`(empty — no .md or .csv files found under mind_root: ${a})`)}let g=d??3,h=[];function i(a,b){for(let c of a)h.push(" ".repeat(b)+("directory"===c.type?`${c.name}/`:c.name)),"directory"===c.type&&Array.isArray(c.children)&&(b+1<g?i(c.children,b+1):h.push(" ".repeat(b+1)+`... (${c.children.length} items)`))}if(c){let a=c.replace(/[\\/]+$/,"").split(/[/\\]/).filter(Boolean),b=e;for(let d of a){let a=b.find(a=>a.name===d&&"directory"===a.type);if(!a||!Array.isArray(a.children))return s(`Directory not found: ${c}`);b=a.children}i(b,0)}else i(e,0);return s(h.length>0?h.join("\n"):"(empty directory)")})},{name:"read_file",label:"Read File",description:"Read the content of a file by its relative path. Always read a file before modifying it. If the file is too large, it will be truncated. Use read_file_chunk to read specific parts of large files.",parameters:B,execute:w(async(a,b)=>s(q((0,f._P)(b.path))))},{name:"read_file_chunk",label:"Read File Chunk",description:"Read a specific range of lines from a file. Highly recommended for reading large files that were truncated by read_file.",parameters:C,execute:w(async(a,b)=>{let c=(0,f._P)(b.path).split("\n"),d=Math.max(1,b.start_line),e=Math.min(c.length,b.end_line);if(d>e)return s(`Error: start_line (${d}) is greater than end_line (${e}) or file has fewer lines.`);let g=String(c.length).length,h=c.slice(d-1,e).map((a,b)=>`${String(d+b).padStart(g," ")} | ${a}`).join("\n");return s(`Showing lines ${d} to ${e} of ${c.length}:
132
+ ${f.join("\n")}`}function v(a){try{return(0,f._P)(a)}catch{return""}}function w(a){return async(b,c,d)=>{try{return await a(b,c,d)}catch(a){return s(`Error: ${r(a)}`)}}}[f,g,i,k]=p.then?(await p)():p;let A=e.ZU.Object({path:e.ZU.Optional(e.ZU.String({description:'Optional subdirectory to list (e.g. "Projects/Products"). Omit to list everything.'})),depth:e.ZU.Optional(e.ZU.Number({description:"Max tree depth to expand (default 3). Directories deeper than this show item count only.",minimum:1,maximum:10}))}),B=e.ZU.Object({path:e.ZU.String({description:"Relative file path"})}),C=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),start_line:e.ZU.Number({description:"Line number to start reading from (1-indexed)"}),end_line:e.ZU.Number({description:"Line number to stop reading at (1-indexed)"})}),D=e.ZU.Object({query:e.ZU.String({description:"Search query (case-insensitive)"})}),E=e.ZU.Object({limit:e.ZU.Optional(e.ZU.Number({description:"Number of files to return (default 10)",minimum:1,maximum:50}))}),F=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),content:e.ZU.String({description:"New full content"})}),G=e.ZU.Object({path:e.ZU.String({description:"Relative file path (must end in .md or .csv)"}),content:e.ZU.Optional(e.ZU.String({description:"Initial file content"}))}),H=e.ZU.Object({files:e.ZU.Array(e.ZU.Object({path:e.ZU.String({description:"Relative file path (must end in .md or .csv)"}),content:e.ZU.String({description:"Initial file content"})}),{description:"List of files to create"})}),I=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),content:e.ZU.String({description:"Content to append"})}),J=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),heading:e.ZU.String({description:'Heading text to find (e.g. "## Tasks" or just "Tasks")'}),content:e.ZU.String({description:"Content to insert after the heading"})}),K=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),heading:e.ZU.String({description:'Heading text to find (e.g. "## Status")'}),content:e.ZU.String({description:"New content for the section"})}),L=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),start_line:e.ZU.Number({description:"1-indexed line number to start replacing"}),end_line:e.ZU.Number({description:"1-indexed line number to stop replacing (inclusive)"}),content:e.ZU.String({description:"New content to insert in place of those lines"})}),M=e.ZU.Object({path:e.ZU.String({description:"Current relative file path"}),new_name:e.ZU.String({description:'New filename (no path separators, e.g. "new-name.md")'})}),N=e.ZU.Object({from_path:e.ZU.String({description:"Current relative file path"}),to_path:e.ZU.String({description:"New relative file path"})}),O=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),limit:e.ZU.Optional(e.ZU.Number({description:"Number of commits to return (default 10)",minimum:1,maximum:50}))}),P=e.ZU.Object({path:e.ZU.String({description:"Relative file path"}),commit:e.ZU.String({description:"Git commit hash (full or abbreviated)"})}),Q=e.ZU.Object({path:e.ZU.String({description:"Relative path to .csv file"}),row:e.ZU.Array(e.ZU.String(),{description:"Array of cell values for the new row"})}),R=e.ZU.Object({name:e.ZU.String({description:'Skill name, e.g. "mindos" or "context7"'})}),S=new Set(["list_files","read_file","search","load_skill","create_file","batch_create_files","write_file","append_to_file","insert_after_heading","update_section"]);function x(){return U.filter(a=>S.has(a.name))}let T=new Set(["list_files","read_file","read_file_chunk","search","load_skill","get_recent","get_backlinks"]);function y(){return U.filter(a=>T.has(a.name))}function z(){return[...U,...j.I,...k.I]}let U=[{name:"list_files",label:"List Files",description:'List files in the knowledge base as an indented tree. Directories beyond `depth` show "... (N items)". Pass `path` to list only a subdirectory, or `depth` to control how deep to expand (default 3).',parameters:A,execute:w(async(a,b)=>{let{path:c,depth:d}=b,e=(0,f.xY)();if(0===e.length&&!c){let a=(0,f.JX)();return s(`(empty — no .md or .csv files found under mind_root: ${a})`)}let g=d??3,h=[];function i(a,b){for(let c of a)h.push(" ".repeat(b)+("directory"===c.type?`${c.name}/`:c.name)),"directory"===c.type&&Array.isArray(c.children)&&(b+1<g?i(c.children,b+1):h.push(" ".repeat(b+1)+`... (${c.children.length} items)`))}if(c){let a=c.replace(/[\\/]+$/,"").split(/[/\\]/).filter(Boolean),b=e;for(let d of a){let a=b.find(a=>a.name===d&&"directory"===a.type);if(!a||!Array.isArray(a.children))return s(`Directory not found: ${c}`);b=a.children}i(b,0)}else i(e,0);return s(h.length>0?h.join("\n"):"(empty directory)")})},{name:"read_file",label:"Read File",description:"Read the content of a file by its relative path. Always read a file before modifying it. If the file is too large, it will be truncated. Use read_file_chunk to read specific parts of large files.",parameters:B,execute:w(async(a,b)=>s(q((0,f._P)(b.path))))},{name:"read_file_chunk",label:"Read File Chunk",description:"Read a specific range of lines from a file. Highly recommended for reading large files that were truncated by read_file.",parameters:C,execute:w(async(a,b)=>{let c=(0,f._P)(b.path).split("\n"),d=Math.max(1,b.start_line),e=Math.min(c.length,b.end_line);if(d>e)return s(`Error: start_line (${d}) is greater than end_line (${e}) or file has fewer lines.`);let g=String(c.length).length,h=c.slice(d-1,e).map((a,b)=>`${String(d+b).padStart(g," ")} | ${a}`).join("\n");return s(`Showing lines ${d} to ${e} of ${c.length}:
133
133
 
134
134
  ${h}`)})},{name:"search",label:"Search",description:"Full-text search across all files in the knowledge base. Returns matching files with context snippets.",parameters:D,execute:w(async(a,b)=>{let c=await (0,g.z0)((0,f.JX)(),b.query);return 0===c.length?s("No results found."):s(c.map(a=>`- **${a.path}** (score: ${a.score.toFixed(1)}): ${a.snippet}`).join("\n"))})},{name:"load_skill",label:"Load Skill",description:"Load the full content of a specific skill by name. Available skills are listed in the system prompt under <available_skills>.",parameters:R,execute:w(async(a,b)=>{let c=(0,o.aY)(),d=(0,h.h)(b.name,{projectRoot:c,mindRoot:(0,f.JX)(),settings:(0,i.sb)()});return d?s(q(d)):s(`Skill not found: ${b.name}`)})},{name:"get_recent",label:"Recent Files",description:"Get the most recently modified files in the knowledge base.",parameters:E,execute:w(async(a,b)=>{let c=(0,f.El)(b.limit??10);return s(c.map(a=>`- ${a.path} (${new Date(a.mtime).toISOString()})`).join("\n"))})},{name:"write_file",label:"Write File",description:"Overwrite the entire content of an existing file. Use read_file first to see current content. Prefer update_section or insert_after_heading for partial edits.",parameters:F,execute:w(async(a,b)=>{let c=v(b.path);(0,f.fu)(b.path,b.content);let d=await t(c,b.content);return s(`File written: ${b.path}${d?" "+d:""}`)})},{name:"create_file",label:"Create File",description:"Create a new file. Only .md and .csv files are allowed. Parent directories are created automatically. Does NOT create Space scaffolding (INSTRUCTION.md/README.md). Use create_space to create a Space.",parameters:G,execute:w(async(a,b)=>{let c=b.content??"";(0,f.x3)(b.path,c);let d=c.split("\n").length;return s(`File created: ${b.path} (+${d})
135
135
 
@@ -1 +1 @@
1
- "use strict";exports.id=3466,exports.ids=[3466],exports.modules={9100:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},14016:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(72269),f=c(78520),g=c(65836),h=c(63353),i=c(55231),j=c(10270),k=c(22222),l=c(33659),m=a([k]);function n({value:a,onChange:b,showSkip:c=!1,compact:d=!1,configuredProviders:m,customProviders:n,onAdd:o}){let{locale:p}=(0,l.Y)(),[q,r]=(0,f.useState)(!1),s=(0,k.bf)(),t=m&&m.size>0,u=n&&n.length>0,v=d&&(t||u)&&!c,w=t?k.jt.filter(a=>m.has(a)):[],{primary:x,local:y,more:z}=s,A=[...y,...z],B=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h=a===c,i=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${h?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${h?"text-foreground":"text-muted-foreground"}`,children:f}),i&&!h&&(0,e.jsx)(g.A,{size:12,className:"text-success ml-auto shrink-0"}),h&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c)},C=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h="zh"===p?d.descriptionZh:d.description,i=a===c,j=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:i?"var(--amber-dim)":"var(--card)",borderColor:i?"var(--amber)":"var(--border)"},children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:f}),h&&(0,e.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:h}),(0,e.jsx)("p",{className:`text-xs ${h?"mt-1":"mt-0.5"}`,style:{color:"var(--muted-foreground)"},children:d.defaultModel})]}),j&&!i&&(0,e.jsx)(g.A,{size:14,className:"text-success shrink-0 mt-0.5"}),i&&(0,e.jsx)(g.A,{size:16,className:"shrink-0 mt-0.5",style:{color:"var(--amber)"}})]},c)};return v?(0,e.jsx)("div",{className:"space-y-2",children:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[w.map(a=>B(a)),n?.map(c=>{let d=a===c.id;return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c.id),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${d?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${d?"text-foreground":"text-muted-foreground"}`,children:c.name}),d&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c.id)}),o&&(0,e.jsxs)("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-border/50 text-sm text-muted-foreground hover:border-border hover:text-foreground transition-all",children:[(0,e.jsx)(h.A,{size:14}),(0,e.jsx)("span",{children:"zh"===p?"添加":"Add"})]})]})}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:x.map(a=>d?B(a):C(a))}),A.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",onClick:()=>r(!q),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,e.jsx)(i.A,{size:12,className:`transition-transform ${q?"rotate-180":""}`}),q?"zh"===p?"收起":"Show less":"zh"===p?`更多 (${A.length})`:`More (${A.length})`]}),q&&(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:A.map(a=>d?B(a):C(a))})]}),c&&(0,e.jsxs)("button",{type:"button",onClick:()=>b("skip"),className:"flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm w-full mt-1",style:{background:"skip"===a?"var(--amber-dim)":"var(--card)",borderColor:"skip"===a?"var(--amber)":"var(--border)"},children:[(0,e.jsx)(j.A,{size:14,className:"shrink-0",style:{color:"skip"===a?"var(--amber)":"var(--muted-foreground)"}}),(0,e.jsx)("span",{className:`font-medium ${"skip"===a?"text-foreground":"text-muted-foreground"}`,children:"zh"===p?"暂时跳过":"Skip for now"}),"skip"===a&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},26093:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},36326:(a,b,c)=>{c.d(b,{default:()=>d});let d=(0,c(52707).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/mindos-dev/mindos-dev/packages/web/components/ClientRedirect.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/mindos-dev/mindos-dev/packages/web/components/ClientRedirect.tsx","default")},51670:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>l});var e=c(72269),f=c(78520),g=c(53679),h=c(55231),i=c(71977),j=c(22222),k=a([j]);function l({value:a,onChange:b,placeholder:c,provider:d,apiKey:k,envKey:l,baseUrl:m,supportsListModels:n,allowNoKey:o,browseLabel:p="Browse",noModelsLabel:q="No models found"}){let[r,s]=(0,f.useState)(null),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(-1),D=(0,f.useRef)(null),E=(0,f.useRef)(null),F=(0,f.useRef)(null),[G,H]=(0,f.useState)({}),I=(0,f.useRef)(!1),J=(0,f.useRef)(0),K=(0,f.useRef)(!1),L=o||!!k||!!l||!!j.T_[d]?.apiKeyFallback,M=(0,f.useCallback)(async(a=!1)=>{if(K.current)return;K.current=!0,u(!0),a||y("");let b=J.current;try{let c={provider:d};k&&(c.apiKey=k),m&&(c.baseUrl=m);let e=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(b!==J.current)return;let f=await e.json();if(b!==J.current)return;f.ok&&Array.isArray(f.models)?(s(f.models),I.current=!0,a||w(!0)):a||y(f.error||"Failed to fetch models")}catch{if(b!==J.current)return;a||y("Network error")}finally{K.current=!1,u(!1)}},[d,k,m]),N=(0,f.useCallback)(()=>{A(!0),!I.current&&n&&L&&!K.current&&M(!0)},[n,L,M]),O=(0,f.useMemo)(()=>{if(!r)return[];if(!a.trim())return r;let b=a.toLowerCase();return[...r].sort((a,c)=>{let d=a.toLowerCase(),e=c.toLowerCase(),f=d.includes(b),g=e.includes(b);if(f!==g)return f?-1:1;if(f&&g){let a=d.startsWith(b),c=e.startsWith(b);if(a!==c)return a?-1:1;let f=d===b,g=e===b;if(f!==g)return f?-1:1}return a.localeCompare(c)})},[r,a]),P=v||z&&null!==r&&a.trim().length>0&&O.length>0,Q=(0,f.useCallback)(a=>{let c=P?O:[];c.length&&("ArrowDown"===a.key?(a.preventDefault(),C(a=>(a+1)%c.length)):"ArrowUp"===a.key?(a.preventDefault(),C(a=>(a-1+c.length)%c.length)):"Enter"===a.key&&B>=0&&B<c.length?(a.preventDefault(),b(c[B]),w(!1),A(!1)):"Escape"===a.key&&(w(!1),A(!1)))},[P,O,B,b]);return(0,e.jsxs)("div",{ref:D,className:"relative",children:[(0,e.jsxs)("div",{ref:E,className:"flex gap-1.5",children:[(0,e.jsx)(i.pd,{value:a,onChange:a=>{b(a.target.value),v||A(!0)},onFocus:N,onKeyDown:Q,placeholder:c,className:"flex-1",autoComplete:"off"}),n&&(0,e.jsxs)("button",{type:"button",disabled:!L||t,onClick:()=>M(!1),title:p,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[t?(0,e.jsx)(g.A,{size:12,className:"animate-spin"}):(0,e.jsx)(h.A,{size:12}),p]})]}),x&&(0,e.jsx)("p",{className:"text-xs text-error mt-1",children:x}),P&&O.length>0&&(0,e.jsx)("div",{ref:F,style:G,className:"fixed z-50 max-h-48 overflow-y-auto rounded-lg border border-border bg-popover shadow-lg",children:O.map((c,d)=>{let f=!a.trim()||c.toLowerCase().includes(a.toLowerCase());return(0,e.jsx)("button",{type:"button","data-model-item":!0,className:`w-full text-left px-3 py-1.5 text-sm transition-colors ${c===a?"bg-accent/60 font-medium":d===B?"bg-accent":"hover:bg-accent"} ${!f?"opacity-50":""}`,onClick:()=>{b(c),w(!1),A(!1)},children:c},c)})}),v&&0===O.length&&(0,e.jsx)("div",{style:G,className:"fixed z-50 rounded-lg border border-border bg-popover shadow-lg px-3 py-2 text-xs text-muted-foreground",children:q})]})}j=(k.then?(await k)():k)[0],d()}catch(a){d(a)}})},96832:(a,b,c)=>{c.d(b,{default:()=>e});var d=c(72269);function e({href:a,label:b="Redirecting..."}){return(0,d.jsx)("main",{className:"min-h-screen flex items-center justify-center px-6",children:(0,d.jsx)("a",{href:a,className:"text-sm underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring rounded-sm",style:{color:"var(--muted-foreground)"},children:b})})}c(78520)}};
1
+ "use strict";exports.id=3466,exports.ids=[3466],exports.modules={9100:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},14016:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>n});var e=c(72269),f=c(78520),g=c(65836),h=c(63353),i=c(55231),j=c(10270),k=c(22222),l=c(33659),m=a([k]);function n({value:a,onChange:b,showSkip:c=!1,compact:d=!1,configuredProviders:m,customProviders:n,onAdd:o}){let{locale:p}=(0,l.Y)(),[q,r]=(0,f.useState)(!1),s=(0,k.bf)(),t=m&&m.size>0,u=n&&n.length>0,v=d&&(t||u)&&!c,w=t?k.jt.filter(a=>m.has(a)):[],{primary:x,local:y,more:z}=s,A=[...y,...z],B=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h=a===c,i=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${h?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${h?"text-foreground":"text-muted-foreground"}`,children:f}),i&&!h&&(0,e.jsx)(g.A,{size:12,className:"text-success ml-auto shrink-0"}),h&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c)},C=c=>{let d=k.T_[c],f="zh"===p?d.nameZh:d.name,h="zh"===p?d.descriptionZh:d.description,i=a===c,j=m?.has(c);return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c),className:"flex items-start gap-3 p-4 rounded-xl border text-left transition-all duration-150",style:{background:i?"var(--amber-dim)":"var(--card)",borderColor:i?"var(--amber)":"var(--border)"},children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",style:{color:"var(--foreground)"},children:f}),h&&(0,e.jsx)("p",{className:"text-xs mt-0.5",style:{color:"var(--muted-foreground)"},children:h}),(0,e.jsx)("p",{className:`text-xs ${h?"mt-1":"mt-0.5"}`,style:{color:"var(--muted-foreground)"},children:d.defaultModel})]}),j&&!i&&(0,e.jsx)(g.A,{size:14,className:"text-success shrink-0 mt-0.5"}),i&&(0,e.jsx)(g.A,{size:16,className:"shrink-0 mt-0.5",style:{color:"var(--amber)"}})]},c)};return v?(0,e.jsx)("div",{className:"space-y-2",children:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[w.map(a=>B(a)),n?.map(c=>{let d=a===c.id;return(0,e.jsxs)("button",{type:"button",onClick:()=>b(c.id),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm ${d?"border-[var(--amber)] bg-[var(--amber-subtle)] shadow-sm":"border-border/50 hover:border-border hover:bg-muted/30"}`,children:[(0,e.jsx)("span",{className:`font-medium ${d?"text-foreground":"text-muted-foreground"}`,children:c.name}),d&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]},c.id)}),o&&(0,e.jsxs)("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-border/50 text-sm text-muted-foreground hover:border-border hover:text-foreground transition-all",children:[(0,e.jsx)(h.A,{size:14}),(0,e.jsx)("span",{children:"zh"===p?"添加":"Add"})]})]})}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:x.map(a=>d?B(a):C(a))}),A.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{type:"button",onClick:()=>r(!q),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[(0,e.jsx)(i.A,{size:12,className:`transition-transform ${q?"rotate-180":""}`}),q?"zh"===p?"收起":"Show less":"zh"===p?`更多 (${A.length})`:`More (${A.length})`]}),q&&(0,e.jsx)("div",{className:d?"flex flex-wrap gap-2":"grid grid-cols-1 gap-2",children:A.map(a=>d?B(a):C(a))})]}),c&&(0,e.jsxs)("button",{type:"button",onClick:()=>b("skip"),className:"flex items-center gap-2 px-3 py-2 rounded-lg border text-left transition-all text-sm w-full mt-1",style:{background:"skip"===a?"var(--amber-dim)":"var(--card)",borderColor:"skip"===a?"var(--amber)":"var(--border)"},children:[(0,e.jsx)(j.A,{size:14,className:"shrink-0",style:{color:"skip"===a?"var(--amber)":"var(--muted-foreground)"}}),(0,e.jsx)("span",{className:`font-medium ${"skip"===a?"text-foreground":"text-muted-foreground"}`,children:"zh"===p?"暂时跳过":"Skip for now"}),"skip"===a&&(0,e.jsx)(g.A,{size:14,className:"ml-auto shrink-0",style:{color:"var(--amber)"}})]})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},26093:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(55168).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]])},36326:(a,b,c)=>{c.d(b,{default:()=>d});let d=(0,c(52707).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/packages/web/components/ClientRedirect.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/packages/web/components/ClientRedirect.tsx","default")},51670:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A:()=>l});var e=c(72269),f=c(78520),g=c(53679),h=c(55231),i=c(71977),j=c(22222),k=a([j]);function l({value:a,onChange:b,placeholder:c,provider:d,apiKey:k,envKey:l,baseUrl:m,supportsListModels:n,allowNoKey:o,browseLabel:p="Browse",noModelsLabel:q="No models found"}){let[r,s]=(0,f.useState)(null),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(-1),D=(0,f.useRef)(null),E=(0,f.useRef)(null),F=(0,f.useRef)(null),[G,H]=(0,f.useState)({}),I=(0,f.useRef)(!1),J=(0,f.useRef)(0),K=(0,f.useRef)(!1),L=o||!!k||!!l||!!j.T_[d]?.apiKeyFallback,M=(0,f.useCallback)(async(a=!1)=>{if(K.current)return;K.current=!0,u(!0),a||y("");let b=J.current;try{let c={provider:d};k&&(c.apiKey=k),m&&(c.baseUrl=m);let e=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(b!==J.current)return;let f=await e.json();if(b!==J.current)return;f.ok&&Array.isArray(f.models)?(s(f.models),I.current=!0,a||w(!0)):a||y(f.error||"Failed to fetch models")}catch{if(b!==J.current)return;a||y("Network error")}finally{K.current=!1,u(!1)}},[d,k,m]),N=(0,f.useCallback)(()=>{A(!0),!I.current&&n&&L&&!K.current&&M(!0)},[n,L,M]),O=(0,f.useMemo)(()=>{if(!r)return[];if(!a.trim())return r;let b=a.toLowerCase();return[...r].sort((a,c)=>{let d=a.toLowerCase(),e=c.toLowerCase(),f=d.includes(b),g=e.includes(b);if(f!==g)return f?-1:1;if(f&&g){let a=d.startsWith(b),c=e.startsWith(b);if(a!==c)return a?-1:1;let f=d===b,g=e===b;if(f!==g)return f?-1:1}return a.localeCompare(c)})},[r,a]),P=v||z&&null!==r&&a.trim().length>0&&O.length>0,Q=(0,f.useCallback)(a=>{let c=P?O:[];c.length&&("ArrowDown"===a.key?(a.preventDefault(),C(a=>(a+1)%c.length)):"ArrowUp"===a.key?(a.preventDefault(),C(a=>(a-1+c.length)%c.length)):"Enter"===a.key&&B>=0&&B<c.length?(a.preventDefault(),b(c[B]),w(!1),A(!1)):"Escape"===a.key&&(w(!1),A(!1)))},[P,O,B,b]);return(0,e.jsxs)("div",{ref:D,className:"relative",children:[(0,e.jsxs)("div",{ref:E,className:"flex gap-1.5",children:[(0,e.jsx)(i.pd,{value:a,onChange:a=>{b(a.target.value),v||A(!0)},onFocus:N,onKeyDown:Q,placeholder:c,className:"flex-1",autoComplete:"off"}),n&&(0,e.jsxs)("button",{type:"button",disabled:!L||t,onClick:()=>M(!1),title:p,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-lg border border-border text-muted-foreground hover:text-foreground hover:border-foreground/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:[t?(0,e.jsx)(g.A,{size:12,className:"animate-spin"}):(0,e.jsx)(h.A,{size:12}),p]})]}),x&&(0,e.jsx)("p",{className:"text-xs text-error mt-1",children:x}),P&&O.length>0&&(0,e.jsx)("div",{ref:F,style:G,className:"fixed z-50 max-h-48 overflow-y-auto rounded-lg border border-border bg-popover shadow-lg",children:O.map((c,d)=>{let f=!a.trim()||c.toLowerCase().includes(a.toLowerCase());return(0,e.jsx)("button",{type:"button","data-model-item":!0,className:`w-full text-left px-3 py-1.5 text-sm transition-colors ${c===a?"bg-accent/60 font-medium":d===B?"bg-accent":"hover:bg-accent"} ${!f?"opacity-50":""}`,onClick:()=>{b(c),w(!1),A(!1)},children:c},c)})}),v&&0===O.length&&(0,e.jsx)("div",{style:G,className:"fixed z-50 rounded-lg border border-border bg-popover shadow-lg px-3 py-2 text-xs text-muted-foreground",children:q})]})}j=(k.then?(await k)():k)[0],d()}catch(a){d(a)}})},96832:(a,b,c)=>{c.d(b,{default:()=>e});var d=c(72269);function e({href:a,label:b="Redirecting..."}){return(0,d.jsx)("main",{className:"min-h-screen flex items-center justify-center px-6",children:(0,d.jsx)("a",{href:a,className:"text-sm underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring rounded-sm",style:{color:"var(--muted-foreground)"},children:b})})}c(78520)}};