@geminilight/mindos 0.6.76 → 0.6.78

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 (434) 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 +25 -23
  4. package/_standalone/.next/build-manifest.json +3 -3
  5. package/_standalone/.next/cache/.previewinfo +1 -1
  6. package/_standalone/.next/cache/.rscinfo +1 -1
  7. package/_standalone/.next/cache/config.json +3 -3
  8. package/_standalone/.next/prerender-manifest.json +3 -3
  9. package/_standalone/.next/react-loadable-manifest.json +4 -4
  10. package/_standalone/.next/required-server-files.json +2 -1
  11. package/_standalone/.next/routes-manifest.json +12 -0
  12. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  13. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  14. package/_standalone/.next/server/app/_global-error.html +2 -2
  15. package/_standalone/.next/server/app/_global-error.rsc +1 -1
  16. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  17. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  18. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  19. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  20. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  21. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  22. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  23. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  24. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  25. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  26. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  27. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  28. package/_standalone/.next/server/app/agents/page.js +1 -1
  29. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  30. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  31. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.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_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/acp/detect/route.js +1 -1
  37. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  39. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  40. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  41. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  42. package/_standalone/.next/server/app/api/agents/copy-skill/route.js.nft.json +1 -1
  43. package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
  44. package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
  45. package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
  46. package/_standalone/.next/server/app/api/ask/route.js +2 -2
  47. package/_standalone/.next/server/app/api/ask/route.js.nft.json +1 -1
  48. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  49. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  51. package/_standalone/.next/server/app/api/backlinks/route.js.nft.json +1 -1
  52. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  53. package/_standalone/.next/server/app/api/bootstrap/route.js.nft.json +1 -1
  54. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  55. package/_standalone/.next/server/app/api/changes/route.js.nft.json +1 -1
  56. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
  58. package/_standalone/.next/server/app/api/connect/route_client-reference-manifest.js +1 -1
  59. package/_standalone/.next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/export/route.js.nft.json +1 -1
  61. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  62. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  63. package/_standalone/.next/server/app/api/file/import/route.js.nft.json +1 -1
  64. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  65. package/_standalone/.next/server/app/api/file/raw/route.js.nft.json +1 -1
  66. package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
  67. package/_standalone/.next/server/app/api/file/route.js.nft.json +1 -1
  68. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  69. package/_standalone/.next/server/app/api/files/route.js.nft.json +1 -1
  70. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  71. package/_standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  72. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
  74. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  75. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
  77. package/_standalone/.next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/im/feishu/long-connection/route.js.nft.json +1 -1
  79. package/_standalone/.next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/im/status/route.js.nft.json +1 -1
  81. package/_standalone/.next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/api/im/webhook/feishu/route.js.nft.json +1 -1
  84. package/_standalone/.next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
  85. package/_standalone/.next/server/app/api/im/webhook-status/route.js.nft.json +1 -1
  86. package/_standalone/.next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
  87. package/_standalone/.next/server/app/api/inbox/clip/route.js.nft.json +1 -1
  88. package/_standalone/.next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
  89. package/_standalone/.next/server/app/api/inbox/route.js.nft.json +1 -1
  90. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  91. package/_standalone/.next/server/app/api/init/route.js.nft.json +1 -1
  92. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  93. package/_standalone/.next/server/app/api/lint/route.js.nft.json +1 -1
  94. package/_standalone/.next/server/app/api/lint/route_client-reference-manifest.js +1 -1
  95. package/_standalone/.next/server/app/api/mcp/agents/route.js.nft.json +1 -1
  96. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  97. package/_standalone/.next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
  98. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  99. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  100. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  101. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  102. package/_standalone/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  103. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  104. package/_standalone/.next/server/app/api/monitoring/route.js.nft.json +1 -1
  105. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  106. package/_standalone/.next/server/app/api/obsidian/compat-report/route.js +1 -0
  107. package/_standalone/.next/server/app/api/obsidian/compat-report/route.js.nft.json +1 -0
  108. package/_standalone/.next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -0
  109. package/_standalone/.next/server/app/api/obsidian/import/route.js +1 -0
  110. package/_standalone/.next/server/app/api/obsidian/import/route.js.nft.json +1 -0
  111. package/_standalone/.next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -0
  112. package/_standalone/.next/server/app/api/recent-files/route.js.nft.json +1 -1
  113. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  114. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  115. package/_standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  116. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  117. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  118. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  119. package/_standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
  120. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  121. package/_standalone/.next/server/app/api/settings/test-key/route.js +1 -1
  122. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  123. package/_standalone/.next/server/app/api/setup/check-path/route.js +1 -1
  124. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  125. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  126. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  127. package/_standalone/.next/server/app/api/setup/ls/route.js +1 -1
  128. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  129. package/_standalone/.next/server/app/api/setup/route.js +1 -1
  130. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  131. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  132. package/_standalone/.next/server/app/api/space-overview/route.js +1 -1
  133. package/_standalone/.next/server/app/api/space-overview/route.js.nft.json +1 -1
  134. package/_standalone/.next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
  135. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  136. package/_standalone/.next/server/app/api/tree-version/route.js.nft.json +1 -1
  137. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  138. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  139. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  140. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  141. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  142. package/_standalone/.next/server/app/api/workflows/route.js.nft.json +1 -1
  143. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  144. package/_standalone/.next/server/app/changelog/page.js +1 -1
  145. package/_standalone/.next/server/app/changelog/page.js.nft.json +1 -1
  146. package/_standalone/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  147. package/_standalone/.next/server/app/changes/page.js +1 -1
  148. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  149. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  150. package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
  151. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  152. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  153. package/_standalone/.next/server/app/echo/page.js +1 -1
  154. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  155. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  156. package/_standalone/.next/server/app/explore/page.js +1 -1
  157. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  158. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  159. package/_standalone/.next/server/app/help/page.js +1 -1
  160. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  161. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  162. package/_standalone/.next/server/app/inbox/history/page.js +1 -1
  163. package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
  164. package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
  165. package/_standalone/.next/server/app/login/page.js +1 -1
  166. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  167. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  168. package/_standalone/.next/server/app/page.js +1 -1
  169. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  170. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  171. package/_standalone/.next/server/app/setup/page.js +2 -2
  172. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  173. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  174. package/_standalone/.next/server/app/trash/page.js +3 -3
  175. package/_standalone/.next/server/app/trash/page.js.nft.json +1 -1
  176. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  177. package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
  178. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  179. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  180. package/_standalone/.next/server/app-paths-manifest.json +25 -23
  181. package/_standalone/.next/server/chunks/1299.js +1 -1
  182. package/_standalone/.next/server/chunks/{7686.js → 2057.js} +3 -3
  183. package/_standalone/.next/server/chunks/4802.js +37 -37
  184. package/_standalone/.next/server/chunks/5299.js +1 -1
  185. package/_standalone/.next/server/chunks/6223.js +1 -1
  186. package/_standalone/.next/server/chunks/7531.js +1 -0
  187. package/_standalone/.next/server/middleware-build-manifest.js +1 -1
  188. package/_standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
  189. package/_standalone/.next/server/pages/500.html +2 -2
  190. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  191. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  192. package/_standalone/.next/static/chunks/{5484.a70877a2667d0779.js → 1768.1e964db7834ecb4f.js} +1 -1
  193. package/_standalone/.next/static/chunks/{4878.ad1f431d34ff03fc.js → 1937.e178266395104aa3.js} +1 -1
  194. package/_standalone/.next/static/chunks/{5358-15ceeb8c1cd9889d.js → 5358-4d1ef32068d304de.js} +2 -2
  195. package/_standalone/.next/static/chunks/{5581-c3be891101a3e511.js → 5581-c29703cc06a6c8dc.js} +2 -2
  196. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-6359573cc0d7ff3b.js +1 -0
  197. package/_standalone/.next/static/chunks/app/_global-error/page-6359573cc0d7ff3b.js +1 -0
  198. package/_standalone/.next/static/chunks/app/api/a2a/agents/route-6359573cc0d7ff3b.js +1 -0
  199. package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-6359573cc0d7ff3b.js +1 -0
  200. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-6359573cc0d7ff3b.js +1 -0
  201. package/_standalone/.next/static/chunks/app/api/a2a/route-6359573cc0d7ff3b.js +1 -0
  202. package/_standalone/.next/static/chunks/app/api/acp/config/route-6359573cc0d7ff3b.js +1 -0
  203. package/_standalone/.next/static/chunks/app/api/acp/detect/route-6359573cc0d7ff3b.js +1 -0
  204. package/_standalone/.next/static/chunks/app/api/acp/install/route-6359573cc0d7ff3b.js +1 -0
  205. package/_standalone/.next/static/chunks/app/api/acp/registry/route-6359573cc0d7ff3b.js +1 -0
  206. package/_standalone/.next/static/chunks/app/api/acp/session/route-6359573cc0d7ff3b.js +1 -0
  207. package/_standalone/.next/static/chunks/app/api/agent-activity/route-6359573cc0d7ff3b.js +1 -0
  208. package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-6359573cc0d7ff3b.js +1 -0
  209. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-6359573cc0d7ff3b.js +1 -0
  210. package/_standalone/.next/static/chunks/app/api/agents/custom/route-6359573cc0d7ff3b.js +1 -0
  211. package/_standalone/.next/static/chunks/app/api/ask/route-6359573cc0d7ff3b.js +1 -0
  212. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-6359573cc0d7ff3b.js +1 -0
  213. package/_standalone/.next/static/chunks/app/api/auth/route-6359573cc0d7ff3b.js +1 -0
  214. package/_standalone/.next/static/chunks/app/api/backlinks/route-6359573cc0d7ff3b.js +1 -0
  215. package/_standalone/.next/static/chunks/app/api/bootstrap/route-6359573cc0d7ff3b.js +1 -0
  216. package/_standalone/.next/static/chunks/app/api/changes/route-6359573cc0d7ff3b.js +1 -0
  217. package/_standalone/.next/static/chunks/app/api/channels/verify/route-6359573cc0d7ff3b.js +1 -0
  218. package/_standalone/.next/static/chunks/app/api/connect/route-6359573cc0d7ff3b.js +1 -0
  219. package/_standalone/.next/static/chunks/app/api/embedding/route-6359573cc0d7ff3b.js +1 -0
  220. package/_standalone/.next/static/chunks/app/api/export/route-6359573cc0d7ff3b.js +1 -0
  221. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-6359573cc0d7ff3b.js +1 -0
  222. package/_standalone/.next/static/chunks/app/api/file/import/route-6359573cc0d7ff3b.js +1 -0
  223. package/_standalone/.next/static/chunks/app/api/file/raw/route-6359573cc0d7ff3b.js +1 -0
  224. package/_standalone/.next/static/chunks/app/api/file/route-6359573cc0d7ff3b.js +1 -0
  225. package/_standalone/.next/static/chunks/app/api/files/route-6359573cc0d7ff3b.js +1 -0
  226. package/_standalone/.next/static/chunks/app/api/git/route-6359573cc0d7ff3b.js +1 -0
  227. package/_standalone/.next/static/chunks/app/api/graph/route-6359573cc0d7ff3b.js +1 -0
  228. package/_standalone/.next/static/chunks/app/api/health/route-6359573cc0d7ff3b.js +1 -0
  229. package/_standalone/.next/static/chunks/app/api/im/activity/route-6359573cc0d7ff3b.js +1 -0
  230. package/_standalone/.next/static/chunks/app/api/im/config/route-6359573cc0d7ff3b.js +1 -0
  231. package/_standalone/.next/static/chunks/app/api/im/feishu/long-connection/route-6359573cc0d7ff3b.js +1 -0
  232. package/_standalone/.next/static/chunks/app/api/im/status/route-6359573cc0d7ff3b.js +1 -0
  233. package/_standalone/.next/static/chunks/app/api/im/test/route-6359573cc0d7ff3b.js +1 -0
  234. package/_standalone/.next/static/chunks/app/api/im/webhook/feishu/route-6359573cc0d7ff3b.js +1 -0
  235. package/_standalone/.next/static/chunks/app/api/im/webhook-status/route-6359573cc0d7ff3b.js +1 -0
  236. package/_standalone/.next/static/chunks/app/api/inbox/clip/route-6359573cc0d7ff3b.js +1 -0
  237. package/_standalone/.next/static/chunks/app/api/inbox/route-6359573cc0d7ff3b.js +1 -0
  238. package/_standalone/.next/static/chunks/app/api/init/route-6359573cc0d7ff3b.js +1 -0
  239. package/_standalone/.next/static/chunks/app/api/lint/route-6359573cc0d7ff3b.js +1 -0
  240. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-6359573cc0d7ff3b.js +1 -0
  241. package/_standalone/.next/static/chunks/app/api/mcp/direct-tools/route-6359573cc0d7ff3b.js +1 -0
  242. package/_standalone/.next/static/chunks/app/api/mcp/install/route-6359573cc0d7ff3b.js +1 -0
  243. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-6359573cc0d7ff3b.js +1 -0
  244. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-6359573cc0d7ff3b.js +1 -0
  245. package/_standalone/.next/static/chunks/app/api/mcp/status/route-6359573cc0d7ff3b.js +1 -0
  246. package/_standalone/.next/static/chunks/app/api/mcp/tools/route-6359573cc0d7ff3b.js +1 -0
  247. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-6359573cc0d7ff3b.js +1 -0
  248. package/_standalone/.next/static/chunks/app/api/monitoring/route-6359573cc0d7ff3b.js +1 -0
  249. package/_standalone/.next/static/chunks/app/api/obsidian/compat-report/route-6359573cc0d7ff3b.js +1 -0
  250. package/_standalone/.next/static/chunks/app/api/obsidian/import/route-6359573cc0d7ff3b.js +1 -0
  251. package/_standalone/.next/static/chunks/app/api/recent-files/route-6359573cc0d7ff3b.js +1 -0
  252. package/_standalone/.next/static/chunks/app/api/restart/route-6359573cc0d7ff3b.js +1 -0
  253. package/_standalone/.next/static/chunks/app/api/search/route-6359573cc0d7ff3b.js +1 -0
  254. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-6359573cc0d7ff3b.js +1 -0
  255. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-6359573cc0d7ff3b.js +1 -0
  256. package/_standalone/.next/static/chunks/app/api/settings/route-6359573cc0d7ff3b.js +1 -0
  257. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-6359573cc0d7ff3b.js +1 -0
  258. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-6359573cc0d7ff3b.js +1 -0
  259. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-6359573cc0d7ff3b.js +1 -0
  260. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-6359573cc0d7ff3b.js +1 -0
  261. package/_standalone/.next/static/chunks/app/api/setup/ls/route-6359573cc0d7ff3b.js +1 -0
  262. package/_standalone/.next/static/chunks/app/api/setup/route-6359573cc0d7ff3b.js +1 -0
  263. package/_standalone/.next/static/chunks/app/api/skills/route-6359573cc0d7ff3b.js +1 -0
  264. package/_standalone/.next/static/chunks/app/api/space-overview/route-6359573cc0d7ff3b.js +1 -0
  265. package/_standalone/.next/static/chunks/app/api/sync/route-6359573cc0d7ff3b.js +1 -0
  266. package/_standalone/.next/static/chunks/app/api/tree-version/route-6359573cc0d7ff3b.js +1 -0
  267. package/_standalone/.next/static/chunks/app/api/uninstall/route-6359573cc0d7ff3b.js +1 -0
  268. package/_standalone/.next/static/chunks/app/api/update/route-6359573cc0d7ff3b.js +1 -0
  269. package/_standalone/.next/static/chunks/app/api/update-check/route-6359573cc0d7ff3b.js +1 -0
  270. package/_standalone/.next/static/chunks/app/api/update-status/route-6359573cc0d7ff3b.js +1 -0
  271. package/_standalone/.next/static/chunks/app/api/workflows/route-6359573cc0d7ff3b.js +1 -0
  272. package/_standalone/.next/static/chunks/app/changes/page-6359573cc0d7ff3b.js +1 -0
  273. package/_standalone/.next/static/chunks/app/echo/page-6359573cc0d7ff3b.js +1 -0
  274. package/_standalone/.next/static/chunks/app/{layout-55af7e1870f7d59b.js → layout-5832614ed6a78167.js} +65 -65
  275. package/_standalone/.next/static/chunks/app/loading-6359573cc0d7ff3b.js +1 -0
  276. package/_standalone/.next/static/chunks/app/setup/page-6135642c48cbf4e8.js +1 -0
  277. package/_standalone/.next/static/chunks/app/trash/{page-77dfe3df94abafb4.js → page-21dc1c6b6490cae8.js} +1 -1
  278. package/_standalone/.next/static/chunks/app/view/[...path]/loading-6359573cc0d7ff3b.js +1 -0
  279. package/_standalone/.next/static/chunks/app/view/[...path]/{page-6791166d03535cb7.js → page-e5330470ce362641.js} +2 -2
  280. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6359573cc0d7ff3b.js +1 -0
  281. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6359573cc0d7ff3b.js +1 -0
  282. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6359573cc0d7ff3b.js +1 -0
  283. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6359573cc0d7ff3b.js +1 -0
  284. package/_standalone/.next/static/chunks/webpack-6a9916defe5b8b6d.js +1 -0
  285. package/_standalone/.next/static/yJdsYbp_76hvDnNeV7OCT/_buildManifest.js +1 -0
  286. package/_standalone/.next/trace +72 -72
  287. package/_standalone/.next/types/routes.d.ts +3 -1
  288. package/_standalone/.next/types/validator.ts +18 -0
  289. package/_standalone/__tests__/acp/subprocess.test.ts +80 -0
  290. package/_standalone/__tests__/agent/model-config.test.ts +90 -0
  291. package/_standalone/__tests__/api/acp-detect.test.ts +4 -3
  292. package/_standalone/__tests__/api/obsidian-compat-report.test.ts +62 -0
  293. package/_standalone/__tests__/api/obsidian-import.test.ts +89 -0
  294. package/_standalone/__tests__/api/setup-path-utils.test.ts +188 -0
  295. package/_standalone/__tests__/ask/agent-selector-capsule.test.tsx +34 -0
  296. package/_standalone/__tests__/ask/ask-content-agent-capsule-visibility.test.tsx +195 -0
  297. package/_standalone/__tests__/ask/ask-content-input-during-run.test.tsx +1 -1
  298. package/_standalone/__tests__/fixtures/obsidian-community-fixtures.ts +92 -0
  299. package/_standalone/__tests__/obsidian-compat/community-smoke.test.ts +62 -0
  300. package/_standalone/__tests__/obsidian-compat/obsidian-import.test.ts +126 -0
  301. package/_standalone/__tests__/obsidian-compat/plugin-manager.test.ts +28 -0
  302. package/_standalone/__tests__/scripts/extract-pdf-runtime.test.ts +139 -0
  303. package/_standalone/components/ask/AgentSelectorCapsule.tsx +5 -4
  304. package/_standalone/components/ask/AskContent.tsx +2 -2
  305. package/_standalone/components/setup/StepKB.tsx +66 -17
  306. package/_standalone/lib/obsidian-compat/index.ts +1 -0
  307. package/_standalone/lib/obsidian-compat/plugin-manager.ts +13 -0
  308. package/_standalone/next.config.ts +2 -0
  309. package/_standalone/package-lock.json +2 -2
  310. package/_standalone/package.json +1 -1
  311. package/_standalone/server.js +1 -1
  312. package/_standalone/tsconfig.tsbuildinfo +1 -1
  313. package/app/__tests__/acp/subprocess.test.ts +80 -0
  314. package/app/__tests__/agent/model-config.test.ts +90 -0
  315. package/app/__tests__/api/acp-detect.test.ts +4 -3
  316. package/app/__tests__/api/obsidian-compat-report.test.ts +62 -0
  317. package/app/__tests__/api/obsidian-import.test.ts +89 -0
  318. package/app/__tests__/api/setup-path-utils.test.ts +188 -0
  319. package/app/__tests__/ask/agent-selector-capsule.test.tsx +34 -0
  320. package/app/__tests__/ask/ask-content-agent-capsule-visibility.test.tsx +195 -0
  321. package/app/__tests__/ask/ask-content-input-during-run.test.tsx +1 -1
  322. package/app/__tests__/fixtures/obsidian-community-fixtures.ts +92 -0
  323. package/app/__tests__/obsidian-compat/community-smoke.test.ts +62 -0
  324. package/app/__tests__/obsidian-compat/obsidian-import.test.ts +126 -0
  325. package/app/__tests__/obsidian-compat/plugin-manager.test.ts +28 -0
  326. package/app/__tests__/scripts/extract-pdf-runtime.test.ts +139 -0
  327. package/app/app/api/obsidian/compat-report/route.ts +33 -0
  328. package/app/app/api/obsidian/import/route.ts +37 -0
  329. package/app/app/api/setup/check-path/route.ts +16 -2
  330. package/app/app/api/setup/path-utils.ts +123 -1
  331. package/app/app/api/setup/route.ts +11 -1
  332. package/app/components/ask/AgentSelectorCapsule.tsx +5 -4
  333. package/app/components/ask/AskContent.tsx +2 -2
  334. package/app/components/setup/StepKB.tsx +66 -17
  335. package/app/components/setup/index.tsx +19 -1
  336. package/app/lib/acp/detect-local.ts +105 -24
  337. package/app/lib/acp/subprocess.ts +2 -1
  338. package/app/lib/agent/model.ts +2 -1
  339. package/app/lib/i18n/modules/onboarding.ts +2 -0
  340. package/app/lib/obsidian-compat/index.ts +1 -0
  341. package/app/lib/obsidian-compat/obsidian-import.ts +118 -0
  342. package/app/lib/obsidian-compat/plugin-manager.ts +13 -0
  343. package/app/lib/settings.ts +17 -5
  344. package/app/next.config.ts +2 -0
  345. package/app/package.json +1 -1
  346. package/package.json +1 -1
  347. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-6d0a0465c7af74d1.js +0 -1
  348. package/_standalone/.next/static/chunks/app/_global-error/page-6d0a0465c7af74d1.js +0 -1
  349. package/_standalone/.next/static/chunks/app/api/a2a/agents/route-6d0a0465c7af74d1.js +0 -1
  350. package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-6d0a0465c7af74d1.js +0 -1
  351. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-6d0a0465c7af74d1.js +0 -1
  352. package/_standalone/.next/static/chunks/app/api/a2a/route-6d0a0465c7af74d1.js +0 -1
  353. package/_standalone/.next/static/chunks/app/api/acp/config/route-6d0a0465c7af74d1.js +0 -1
  354. package/_standalone/.next/static/chunks/app/api/acp/detect/route-6d0a0465c7af74d1.js +0 -1
  355. package/_standalone/.next/static/chunks/app/api/acp/install/route-6d0a0465c7af74d1.js +0 -1
  356. package/_standalone/.next/static/chunks/app/api/acp/registry/route-6d0a0465c7af74d1.js +0 -1
  357. package/_standalone/.next/static/chunks/app/api/acp/session/route-6d0a0465c7af74d1.js +0 -1
  358. package/_standalone/.next/static/chunks/app/api/agent-activity/route-6d0a0465c7af74d1.js +0 -1
  359. package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-6d0a0465c7af74d1.js +0 -1
  360. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-6d0a0465c7af74d1.js +0 -1
  361. package/_standalone/.next/static/chunks/app/api/agents/custom/route-6d0a0465c7af74d1.js +0 -1
  362. package/_standalone/.next/static/chunks/app/api/ask/route-6d0a0465c7af74d1.js +0 -1
  363. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-6d0a0465c7af74d1.js +0 -1
  364. package/_standalone/.next/static/chunks/app/api/auth/route-6d0a0465c7af74d1.js +0 -1
  365. package/_standalone/.next/static/chunks/app/api/backlinks/route-6d0a0465c7af74d1.js +0 -1
  366. package/_standalone/.next/static/chunks/app/api/bootstrap/route-6d0a0465c7af74d1.js +0 -1
  367. package/_standalone/.next/static/chunks/app/api/changes/route-6d0a0465c7af74d1.js +0 -1
  368. package/_standalone/.next/static/chunks/app/api/channels/verify/route-6d0a0465c7af74d1.js +0 -1
  369. package/_standalone/.next/static/chunks/app/api/connect/route-6d0a0465c7af74d1.js +0 -1
  370. package/_standalone/.next/static/chunks/app/api/embedding/route-6d0a0465c7af74d1.js +0 -1
  371. package/_standalone/.next/static/chunks/app/api/export/route-6d0a0465c7af74d1.js +0 -1
  372. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-6d0a0465c7af74d1.js +0 -1
  373. package/_standalone/.next/static/chunks/app/api/file/import/route-6d0a0465c7af74d1.js +0 -1
  374. package/_standalone/.next/static/chunks/app/api/file/raw/route-6d0a0465c7af74d1.js +0 -1
  375. package/_standalone/.next/static/chunks/app/api/file/route-6d0a0465c7af74d1.js +0 -1
  376. package/_standalone/.next/static/chunks/app/api/files/route-6d0a0465c7af74d1.js +0 -1
  377. package/_standalone/.next/static/chunks/app/api/git/route-6d0a0465c7af74d1.js +0 -1
  378. package/_standalone/.next/static/chunks/app/api/graph/route-6d0a0465c7af74d1.js +0 -1
  379. package/_standalone/.next/static/chunks/app/api/health/route-6d0a0465c7af74d1.js +0 -1
  380. package/_standalone/.next/static/chunks/app/api/im/activity/route-6d0a0465c7af74d1.js +0 -1
  381. package/_standalone/.next/static/chunks/app/api/im/config/route-6d0a0465c7af74d1.js +0 -1
  382. package/_standalone/.next/static/chunks/app/api/im/feishu/long-connection/route-6d0a0465c7af74d1.js +0 -1
  383. package/_standalone/.next/static/chunks/app/api/im/status/route-6d0a0465c7af74d1.js +0 -1
  384. package/_standalone/.next/static/chunks/app/api/im/test/route-6d0a0465c7af74d1.js +0 -1
  385. package/_standalone/.next/static/chunks/app/api/im/webhook/feishu/route-6d0a0465c7af74d1.js +0 -1
  386. package/_standalone/.next/static/chunks/app/api/im/webhook-status/route-6d0a0465c7af74d1.js +0 -1
  387. package/_standalone/.next/static/chunks/app/api/inbox/clip/route-6d0a0465c7af74d1.js +0 -1
  388. package/_standalone/.next/static/chunks/app/api/inbox/route-6d0a0465c7af74d1.js +0 -1
  389. package/_standalone/.next/static/chunks/app/api/init/route-6d0a0465c7af74d1.js +0 -1
  390. package/_standalone/.next/static/chunks/app/api/lint/route-6d0a0465c7af74d1.js +0 -1
  391. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-6d0a0465c7af74d1.js +0 -1
  392. package/_standalone/.next/static/chunks/app/api/mcp/direct-tools/route-6d0a0465c7af74d1.js +0 -1
  393. package/_standalone/.next/static/chunks/app/api/mcp/install/route-6d0a0465c7af74d1.js +0 -1
  394. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-6d0a0465c7af74d1.js +0 -1
  395. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-6d0a0465c7af74d1.js +0 -1
  396. package/_standalone/.next/static/chunks/app/api/mcp/status/route-6d0a0465c7af74d1.js +0 -1
  397. package/_standalone/.next/static/chunks/app/api/mcp/tools/route-6d0a0465c7af74d1.js +0 -1
  398. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-6d0a0465c7af74d1.js +0 -1
  399. package/_standalone/.next/static/chunks/app/api/monitoring/route-6d0a0465c7af74d1.js +0 -1
  400. package/_standalone/.next/static/chunks/app/api/recent-files/route-6d0a0465c7af74d1.js +0 -1
  401. package/_standalone/.next/static/chunks/app/api/restart/route-6d0a0465c7af74d1.js +0 -1
  402. package/_standalone/.next/static/chunks/app/api/search/route-6d0a0465c7af74d1.js +0 -1
  403. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-6d0a0465c7af74d1.js +0 -1
  404. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-6d0a0465c7af74d1.js +0 -1
  405. package/_standalone/.next/static/chunks/app/api/settings/route-6d0a0465c7af74d1.js +0 -1
  406. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-6d0a0465c7af74d1.js +0 -1
  407. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-6d0a0465c7af74d1.js +0 -1
  408. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-6d0a0465c7af74d1.js +0 -1
  409. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-6d0a0465c7af74d1.js +0 -1
  410. package/_standalone/.next/static/chunks/app/api/setup/ls/route-6d0a0465c7af74d1.js +0 -1
  411. package/_standalone/.next/static/chunks/app/api/setup/route-6d0a0465c7af74d1.js +0 -1
  412. package/_standalone/.next/static/chunks/app/api/skills/route-6d0a0465c7af74d1.js +0 -1
  413. package/_standalone/.next/static/chunks/app/api/space-overview/route-6d0a0465c7af74d1.js +0 -1
  414. package/_standalone/.next/static/chunks/app/api/sync/route-6d0a0465c7af74d1.js +0 -1
  415. package/_standalone/.next/static/chunks/app/api/tree-version/route-6d0a0465c7af74d1.js +0 -1
  416. package/_standalone/.next/static/chunks/app/api/uninstall/route-6d0a0465c7af74d1.js +0 -1
  417. package/_standalone/.next/static/chunks/app/api/update/route-6d0a0465c7af74d1.js +0 -1
  418. package/_standalone/.next/static/chunks/app/api/update-check/route-6d0a0465c7af74d1.js +0 -1
  419. package/_standalone/.next/static/chunks/app/api/update-status/route-6d0a0465c7af74d1.js +0 -1
  420. package/_standalone/.next/static/chunks/app/api/workflows/route-6d0a0465c7af74d1.js +0 -1
  421. package/_standalone/.next/static/chunks/app/changes/page-6d0a0465c7af74d1.js +0 -1
  422. package/_standalone/.next/static/chunks/app/echo/page-6d0a0465c7af74d1.js +0 -1
  423. package/_standalone/.next/static/chunks/app/loading-6d0a0465c7af74d1.js +0 -1
  424. package/_standalone/.next/static/chunks/app/setup/page-64d7fa097ef3f367.js +0 -1
  425. package/_standalone/.next/static/chunks/app/view/[...path]/loading-6d0a0465c7af74d1.js +0 -1
  426. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6d0a0465c7af74d1.js +0 -1
  427. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6d0a0465c7af74d1.js +0 -1
  428. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6d0a0465c7af74d1.js +0 -1
  429. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6d0a0465c7af74d1.js +0 -1
  430. package/_standalone/.next/static/chunks/webpack-aeeb4e3ebba9ef3c.js +0 -1
  431. package/_standalone/.next/static/f4SL2Rxm_VRCg6oVg9EuX/_buildManifest.js +0 -1
  432. package/_standalone/lib/obsidian-compat/compatibility-report.ts +0 -131
  433. package/_standalone/lib/obsidian-compat/manifest.ts +0 -90
  434. /package/_standalone/.next/static/{f4SL2Rxm_VRCg6oVg9EuX → yJdsYbp_76hvDnNeV7OCT}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=4802,exports.ids=[4802],exports.modules={221:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("6068feabd46864d225c07320a3076256b40aeb79ac",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},1108:(a,b,c)=>{"use strict";c.d(b,{Dp:()=>e,Sx:()=>f,oT:()=>g,qQ:()=>d});let d={files:280,search:320,echo:340,agents:300,discover:300,workflows:320},e={DEFAULT:280,MIN:240,MAX_RATIO:.45,MAX_ABS:600},f={DEFAULT:380,MIN:320,MAX_ABS:4e3,MIN_CONTENT:200},g={DEFAULT:400,MIN:300,MAX_ABS:640,MAX_RATIO:.42}},1394:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TimelineRenderer() from the server but TimelineRenderer is 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/app/components/renderers/timeline/TimelineRenderer.tsx","TimelineRenderer")},2420:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[50vh] gap-4 px-6",children:[(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:a.message||"An unexpected error occurred while rendering this page."})]}),(0,d.jsx)("button",{onClick:b,className:"px-4 py-2 rounded-md text-sm font-medium transition-colors",style:{background:"var(--muted)",color:"var(--foreground)"},children:"Try again"})]})}c(67484)},2518:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{A:()=>d}),c(67484),c(18329)},2548:(a,b,c)=>{"use strict";c.d(b,{_:()=>e});var d=c(67484);function e({width:a,minWidth:b,maxWidth:c,maxWidthRatio:e,direction:f,disabled:g,onResize:h,onResizeEnd:i}){let j=(0,d.useRef)(!1),k=(0,d.useRef)(0),l=(0,d.useRef)(0),m=(0,d.useRef)(a);m.current=a;let n=(0,d.useRef)(h);n.current=h;let o=(0,d.useRef)(i);return o.current=i,(0,d.useCallback)(d=>{if(g)return;d.preventDefault(),j.current=!0,k.current=d.clientX,l.current=a,document.body.classList.add("select-none"),document.body.style.cursor="col-resize";let h=a=>{if(!j.current)return;let d="right"===f?a.clientX-k.current:k.current-a.clientX,g=Math.round(Math.max(b,Math.min(Math.min(c,window.innerWidth*e),l.current+d)));n.current(g)},i=()=>{j.current=!1,document.body.classList.remove("select-none"),document.body.style.cursor="",o.current(m.current),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",i)},[a,b,c,e,f,g])}},2820:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>V});var d=c(48249),e=c(67484),f=c(12625),g=c(88282),h=c(95801),i=c(8455),j=c(49216),k=c(7309),l=c(24520),m=c(40560),n=c(53549),o=c(49681),p=c(44218),q=c(72419),r=c(59347),s=c(91282),t=c(10316),u=c(46674),v=c(80600),w=c(65032),x=c(19794);function y({trigger:a,children:b,open:c,onClose:f}){let g=(0,e.useRef)(null);return(0,d.jsxs)("div",{ref:g,className:"relative",children:[a,c&&(0,d.jsx)("div",{className:"absolute top-full left-0 mt-1 w-full min-w-[220px] max-h-[260px] overflow-y-auto bg-card border border-border rounded-lg shadow-lg z-50",children:b})]})}function z({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(""),m=k?i.filter(a=>a.id.toLowerCase().includes(k.toLowerCase())||a.name.toLowerCase().includes(k.toLowerCase())):i,n=a=>{b(a),f(!1),l("")},o=a?i.find(b=>b.id===a)?.name||a:void 0;return(0,d.jsxs)(y,{open:c,onClose:()=>{f(!1),l("")},trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:a?"text-foreground truncate":"text-muted-foreground",children:o||"MindOS"}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,d.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,d.jsx)(t.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),autoFocus:!0,placeholder:"Search agents...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),(0,d.jsxs)("button",{onClick:()=>n(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!a?"text-[var(--amber)] font-medium":"text-foreground"}`,children:["MindOS ",(0,d.jsx)("span",{className:"text-muted-foreground/50 ml-1",children:"(default)"})]}),m.slice(0,30).map(b=>(0,d.jsxs)("button",{onClick:()=>n(b.id),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${a===b.id?"text-[var(--amber)] font-medium":"text-foreground"}`,children:[b.name," ",b.name!==b.id&&(0,d.jsxs)("span",{className:"text-muted-foreground/50 ml-1",children:["(",b.id,")"]})]},b.id)),0===i.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),i.length>0&&0===m.length&&!k&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No ACP agents found"}),(0,d.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(n(g.trim()),h(""))},placeholder:"Custom agent ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}let A=[{group:"Anthropic",models:["claude-sonnet-4-6","claude-opus-4","claude-3.5-sonnet","claude-3.5-haiku"]},{group:"OpenAI",models:["gpt-4o","gpt-4o-mini","o3","o4-mini"]},{group:"Google",models:["gemini-2.5-pro","gemini-2.5-flash"]}];function B({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),i=a=>{b(a),f(!1)};return(0,d.jsxs)(y,{open:c,onClose:()=>f(!1),trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:a?"text-foreground truncate":"text-muted-foreground",children:a||"Default model"}),a?(0,d.jsx)(u.A,{size:12,className:"text-muted-foreground shrink-0 hover:text-foreground cursor-pointer",onClick:a=>{a.stopPropagation(),i(void 0)}}):(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,d.jsx)("button",{onClick:()=>i(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!a?"text-[var(--amber)] font-medium":"text-muted-foreground"}`,children:"(default)"}),A.map(b=>(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-3 py-1 text-2xs font-semibold text-muted-foreground/60 uppercase tracking-wide bg-muted/30",children:b.group}),b.models.map(b=>(0,d.jsx)("button",{onClick:()=>i(b),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${a===b?"text-[var(--amber)] font-medium":"text-foreground"}`,children:b},b))]},b.group)),(0,d.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(i(g.trim()),h(""))},placeholder:"Custom model ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}function C({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([]),[i,j]=(0,e.useState)(""),k=i?g.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())):g;return(0,d.jsxs)("div",{children:[a.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mb-1.5",children:a.map(c=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-md text-2xs bg-[var(--amber)]/10 text-[var(--amber)] border border-[var(--amber)]/20",children:[c,(0,d.jsx)("button",{onClick:()=>b(a.filter(a=>a!==c)),className:"p-0.5 rounded hover:bg-[var(--amber)]/20 transition-colors",children:(0,d.jsx)(u.A,{size:10})})]},c))}),(0,d.jsxs)(y,{open:c,onClose:()=>{f(!1),j("")},trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:0===a.length?"Add skills...":`${a.length} selected`}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground"})]}),children:[(0,d.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,d.jsx)(t.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("input",{type:"text",value:i,onChange:a=>j(a.target.value),autoFocus:!0,placeholder:"Search skills...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),k.slice(0,60).map(c=>{let e=a.includes(c.name);return(0,d.jsxs)("button",{onClick:()=>{var d;return d=c.name,void(a.includes(d)?b(a.filter(a=>a!==d)):b([...a,d]))},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors flex items-center gap-2 ${e?"bg-[var(--amber)]/5":""}`,children:[(0,d.jsx)("span",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 transition-colors ${e?"bg-[var(--amber)] border-[var(--amber)] text-[var(--amber-foreground)]":"border-border"}`,children:e&&(0,d.jsx)("span",{className:"text-[9px]",children:"✓"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate",children:c.name}),c.description&&(0,d.jsx)("span",{className:"block text-2xs text-muted-foreground truncate mt-0.5",children:c.description})]})]},c.name)}),0===g.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),g.length>0&&0===k.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No skills found"})]})]})}function D({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),i=(0,e.useCallback)(c=>{let d=c.trim();d&&!a.includes(d)&&b([...a,d])},[a,b]),j=(0,e.useCallback)(a=>{a.preventDefault(),f(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b)return void i(b);let c=a.dataTransfer.getData("text/plain");c&&i(c)},[i]),l=(0,e.useCallback)(a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",f(!0)},[]),m=(0,e.useCallback)(()=>f(!1),[]);return(0,d.jsxs)("div",{children:[a.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-1 mb-1.5",children:a.map(c=>(0,d.jsxs)("div",{className:"flex items-center gap-1.5 pl-2 pr-1 py-1 rounded-md text-2xs bg-muted/60 border border-border group",children:[(0,d.jsx)(v.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-foreground truncate flex-1",title:c,children:c}),(0,d.jsx)("button",{onClick:()=>b(a.filter(a=>a!==c)),className:"p-0.5 rounded hover:bg-[var(--error)]/10 text-muted-foreground hover:text-[var(--error)] opacity-0 group-hover:opacity-100 transition-all",children:(0,d.jsx)(u.A,{size:10})})]},c))}),(0,d.jsxs)("div",{onDrop:j,onDragOver:l,onDragLeave:m,className:`flex items-center gap-2 px-3 py-2.5 rounded-lg border-2 border-dashed transition-colors ${c?"border-[var(--amber)] bg-[var(--amber)]/5":"border-border hover:border-muted-foreground/30"}`,children:[(0,d.jsx)(k.A,{size:14,className:`shrink-0 ${c?"text-[var(--amber)]":"text-muted-foreground/40"}`}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:"Drag files here from the sidebar"})]}),(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(i(g.trim()),h(""))},placeholder:"Or type a file path...",className:"w-full px-2.5 py-1 text-2xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}async function E(a){try{let b=await fetch("/api/setup/ls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a||"~"})});if(!b.ok)return[];return(await b.json()).dirs??[]}catch{return[]}}function F({value:a,onChange:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(-1),l=(0,e.useRef)(!1),m=(0,e.useRef)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(a||"~"),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!1),v=()=>{f([]),h(!1),j(-1)},z=a=>{l.current=!0,b(a),v(),m.current?.focus()};return(0,e.useCallback)(async a=>{u(!0),s(await E(a)),u(!1)},[]),(0,d.jsxs)("div",{className:"relative flex gap-1.5",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("input",{ref:m,type:"text",value:a,onChange:a=>{b(a.target.value),h(!0)},onKeyDown:a=>{g&&0!==c.length&&("ArrowDown"===a.key?(a.preventDefault(),j(a=>Math.min(a+1,c.length-1))):"ArrowUp"===a.key?(a.preventDefault(),j(a=>Math.max(a-1,-1))):"Enter"===a.key&&i>=0?(a.preventDefault(),z(c[i])):"Escape"===a.key?v():"Tab"===a.key&&i>=0&&(a.preventDefault(),z(c[i])))},onBlur:()=>setTimeout(v,150),onFocus:()=>c.length>0&&h(!0),placeholder:"~/projects/my-app",className:"w-full px-2.5 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground font-mono placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),g&&c.length>0&&(0,d.jsx)("div",{role:"listbox",className:"absolute z-50 left-0 right-0 top-full mt-1 rounded-lg border border-border bg-card shadow-lg overflow-auto max-h-[200px]",children:c.map((a,b)=>(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b===i,onMouseDown:()=>z(a),className:`w-full text-left px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 ${b===i?"bg-muted text-foreground":"text-foreground hover:bg-muted/50"}`,children:[(0,d.jsx)(w.A,{size:11,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a})]},a))})]}),(0,d.jsxs)(y,{open:n,onClose:()=>o(!1),trigger:(0,d.jsx)("button",{type:"button",onClick:()=>{q(a||"~"),o(a=>!a)},className:"px-2 py-1.5 rounded-lg border border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Browse directories",children:(0,d.jsx)(k.A,{size:13})}),children:[(0,d.jsxs)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-2 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-2xs font-mono text-muted-foreground truncate flex-1",title:p,children:p}),(0,d.jsx)("button",{onClick:()=>{b(p),o(!1)},className:"px-2 py-0.5 text-2xs rounded font-medium bg-[var(--amber)] text-[var(--amber-foreground)] shrink-0",children:"Select"})]}),"~"!==p&&(0,d.jsxs)("button",{onClick:()=>{let a=p.split("/");a.length<=1||(a.pop(),q(a.join("/")||"~"))},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-muted-foreground flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:12,className:"shrink-0"})," .."]}),t&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),!t&&0===r.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No subdirectories"}),r.map(a=>(0,d.jsxs)("button",{onClick:()=>{q("~"===p?`~/${a}`:`${p.replace(/\/+$/,"")}/${a}`)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-foreground flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:12,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:"truncate flex-1",children:a}),(0,d.jsx)(x.A,{size:10,className:"text-muted-foreground/40 shrink-0"})]},a))]})]})}function G({step:a,index:b,onChange:c,onDelete:f,onMoveUp:g,onMoveDown:h}){let[i,j]=(0,e.useState)(!a.prompt),[k,l]=(0,e.useState)(!1),m=b=>c({...a,...b}),n=a.skills?.length?a.skills:a.skill?[a.skill]:[],o=!!(a.agent||a.model||n.length||a.context?.length||a.description||a.timeout);return i?(0,d.jsxs)("div",{className:"rounded-lg border border-[var(--amber)]/20 bg-card overflow-hidden shadow-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/20",children:[(0,d.jsx)("span",{className:`text-xs font-medium flex-1 truncate ${a.name?"text-foreground":"text-muted-foreground/50 italic"}`,children:a.name||"Untitled step"}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move up",children:(0,d.jsx)(q.A,{size:12})}),h&&(0,d.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move down",children:(0,d.jsx)(p.A,{size:12})}),(0,d.jsx)("button",{onClick:f,className:"p-1 rounded hover:bg-[var(--error)]/10 text-muted-foreground/50 hover:text-[var(--error)] transition-colors",title:"Delete",children:(0,d.jsx)(r.A,{size:11})}),(0,d.jsx)("button",{onClick:()=>j(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground/50 transition-colors",title:"Collapse",children:(0,d.jsx)(q.A,{size:12})})]})]}),(0,d.jsxs)("div",{className:"px-3 py-3 space-y-3",children:[(0,d.jsx)("input",{type:"text",value:a.name,onChange:a=>m({name:a.target.value}),placeholder:"Step name...",autoFocus:!a.name,className:"w-full text-sm font-medium bg-transparent text-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,d.jsx)("textarea",{value:a.prompt,onChange:a=>m({prompt:a.target.value}),placeholder:"What should the AI do?",rows:3,className:"w-full px-3 py-2.5 text-sm rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y leading-relaxed"}),(0,d.jsxs)("div",{className:`grid ${a.agent?"grid-cols-2":"grid-cols-1"} gap-2`,children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Agent"}),(0,d.jsx)(z,{value:a.agent,onChange:b=>m({agent:b,model:b?a.model:void 0})})]}),a.agent&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Model"}),(0,d.jsx)(B,{value:a.model,onChange:a=>m({model:a})})]})]}),(0,d.jsxs)("button",{onClick:()=>l(a=>!a),className:`flex items-center gap-1.5 text-2xs transition-colors ${k||o?"text-muted-foreground":"text-muted-foreground/40 hover:text-muted-foreground"}`,children:[(0,d.jsx)(s.A,{size:11}),k?"Less options":"More options",!k&&o&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"})]}),k&&(0,d.jsxs)("div",{className:"space-y-3 pt-1",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Skills"}),(0,d.jsx)(C,{value:n,onChange:a=>m({skills:a,skill:void 0})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Context files"}),(0,d.jsx)(D,{value:a.context??[],onChange:a=>m({context:a.length?a:void 0})})]}),(0,d.jsxs)("div",{className:"grid grid-cols-[1fr,auto] gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Description"}),(0,d.jsx)("input",{type:"text",value:a.description||"",onChange:a=>m({description:a.target.value||void 0}),placeholder:"Optional note...",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Timeout"}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{type:"number",min:0,value:a.timeout||"",onChange:a=>m({timeout:a.target.value?Number(a.target.value):void 0}),placeholder:"120",className:"w-16 px-2 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40",children:"s"})]})]})]})]})]})]}):(0,d.jsxs)("div",{className:"group flex items-start gap-2 px-3 py-2 rounded-lg hover:bg-muted/40 transition-colors cursor-pointer -ml-1",onClick:()=>j(!0),children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:`text-sm leading-tight block ${a.name?"text-foreground font-medium":"text-muted-foreground/50 italic"}`,children:a.name||"Untitled step"}),o&&(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[a.agent&&(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground",children:a.agent}),n.slice(0,2).map(a=>(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-[var(--amber)]/8 text-[var(--amber)]",children:a},a)),n.length>2&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:["+",n.length-2]}),a.context?.length?(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:[a.context.length," files"]}):null]}),a.prompt&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/50 mt-1 line-clamp-1 leading-relaxed",children:a.prompt})]}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground/30 mt-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function H({workflow:a,filePath:b,onChange:c,onSaved:f}){let[g,i]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1),t=b=>c({...a,...b}),u=(0,e.useCallback)((b,d)=>{let e=[...a.steps];e[b]=d,c({...a,steps:e})},[a,c]),v=(0,e.useCallback)(b=>{let d=a.steps[b];(!(d.name||d.prompt)||window.confirm(`Delete step "${d.name||"Untitled"}"?`))&&c({...a,steps:a.steps.filter((a,c)=>c!==b)})},[a,c]),w=(0,e.useCallback)(()=>{let b=a.steps.map(a=>a.id),d=a.steps.length+1,e={id:function(a,b){let c=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"step",d=c,e=2;for(;b.includes(d);)d=`${c}-${e}`,e++;return d}(`step-${d}`,b),name:`Step ${d}`,prompt:""};c({...a,steps:[...a.steps,e]})},[a,c]),x=(0,e.useCallback)((b,d)=>{if(d<0||d>=a.steps.length)return;let e=[...a.steps],[f]=e.splice(b,1);e.splice(d,0,f),c({...a,steps:e})},[a,c]),y=async()=>{i(!0),q(""),s(!1);try{let c,d=(c={title:a.title},a.description&&(c.description=a.description),a.workDir&&(c.workDir=a.workDir),a.skills?.length&&(c.skills=a.skills),a.tools?.length&&(c.tools=a.tools),c.steps=a.steps.map(a=>{let b={id:a.id,name:a.name};return a.description&&(b.description=a.description),a.agent&&(b.agent=a.agent),a.model&&(b.model=a.model),a.skill&&(b.skill=a.skill),a.skills?.length&&(b.skills=a.skills),a.tools?.length&&(b.tools=a.tools),a.context?.length&&(b.context=a.context),b.prompt=a.prompt,a.timeout&&(b.timeout=a.timeout),b}),j.Ay.dump(c,{lineWidth:-1,noRefs:!0,quotingType:'"',forceQuotes:!1})),e=await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b,op:"save_file",content:d})});if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(a.error||`Save failed (HTTP ${e.status})`)}s(!0),f?.()}catch(a){q(a instanceof Error?a.message:"Save failed")}finally{i(!1)}},z=!g&&!!a.title.trim()&&a.steps.length>0;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"space-y-3 mb-8",children:[(0,d.jsx)("input",{type:"text",value:a.title,onChange:a=>t({title:a.target.value}),placeholder:"Flow title...",className:"w-full text-lg font-semibold bg-transparent text-foreground placeholder:text-muted-foreground/40 focus:outline-none border-none p-0 leading-tight"}),(0,d.jsx)("input",{type:"text",value:a.description||"",onChange:a=>t({description:a.target.value||void 0}),placeholder:"Add a description...",className:"w-full text-sm bg-transparent text-muted-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(k.A,{size:12,className:"text-muted-foreground/40 shrink-0"}),(0,d.jsx)(F,{value:a.workDir||"",onChange:a=>t({workDir:a||void 0})})]})]}),a.steps.length>0?(0,d.jsxs)("div",{className:"relative",children:[a.steps.length>1&&(0,d.jsx)("div",{className:"absolute left-[19px] top-6 bottom-16 w-px bg-border"}),(0,d.jsx)("div",{className:"flex flex-col gap-3 mb-5 relative",children:a.steps.map((b,c)=>(0,d.jsxs)("div",{className:"relative pl-11",children:[(0,d.jsx)("div",{className:"absolute left-[7px] top-3 w-[22px] h-[22px] rounded-full border-2 border-border bg-background z-10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"text-[10px] font-bold text-muted-foreground/60",children:c+1})}),(0,d.jsx)(G,{step:b,index:c,onChange:a=>u(c,a),onDelete:()=>v(c),onMoveUp:c>0?()=>x(c,c-1):void 0,onMoveDown:c<a.steps.length-1?()=>x(c,c+1):void 0})]},b.id))}),(0,d.jsxs)("div",{className:"relative pl-11",children:[(0,d.jsx)("div",{className:"absolute left-[7px] top-2.5 w-[22px] h-[22px] rounded-full border-2 border-dashed border-border bg-background z-10 flex items-center justify-center",children:(0,d.jsx)(l.A,{size:9,className:"text-muted-foreground/40"})}),(0,d.jsx)("button",{onClick:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/40 transition-colors",children:"Add step..."})]})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,d.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-[var(--amber)]/8 flex items-center justify-center mb-4",children:(0,d.jsx)(h.A,{size:22,className:"text-[var(--amber)]/60"})}),(0,d.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Build your flow"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/60 mb-5 max-w-[240px]",children:"Each step is a task for an AI agent. Chain them together to automate complex workflows."}),(0,d.jsxs)("button",{onClick:w,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:[(0,d.jsx)(l.A,{size:12}),"Add first step"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-8 pt-4 border-t border-border/50",children:[(0,d.jsxs)("button",{onClick:y,disabled:!z,title:a.title.trim()?0===a.steps.length?"Add at least one step":void 0:"Title is required",className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium transition-all disabled:opacity-40 disabled:cursor-not-allowed ${z?"bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90":"bg-muted text-muted-foreground"}`,children:[g?(0,d.jsx)(m.A,{size:12,className:"animate-spin"}):(0,d.jsx)(n.A,{size:12}),g?"Saving...":"Save"]}),p&&(0,d.jsx)("span",{className:"text-xs text-[var(--error)]",children:p}),r&&!p&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-2xs text-[var(--success)]",children:[(0,d.jsx)(o.A,{size:11}),"Saved"]}),(0,d.jsx)("kbd",{className:"text-2xs text-muted-foreground/30 ml-auto font-mono",children:"Ctrl+S"})]})]})}var I=c(78835),J=c(2797),K=c(6079),L=c(31724),M=c(89165);let N=new Map;async function O(a,b){if(N.has(a))return N.get(a);try{let c=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:a}),signal:b});if(!c.ok)return N.set(a,null),null;let d=(await c.json()).content;return N.set(a,d??null),d??null}catch{return null}}async function P(a,b){try{let c=await fetch(`/api/acp/registry?agent=${encodeURIComponent(a)}`,{signal:b});if(!c.ok)return null;let d=await c.json();if(d.agent?.id)return{id:d.agent.id,name:d.agent.name||a};return null}catch{return null}}async function Q(a,b,c,d,e){let f=function(a,b){let c=[];if(a.skills?.length)for(let b of a.skills)c.includes(b)||c.push(b);else a.skill&&c.push(a.skill);for(let a of b.skills??[])c.includes(a)||c.push(a);return c}(a,b),g=new Map;if(f.length>0)for(let[a,b]of(await Promise.all(f.map(async a=>{let b=await O(a,e);return[a,b]}))))b&&g.set(a,b);let h=null;a.agent&&(h=await P(a.agent,e));let i={messages:[{role:"user",content:function(a,b,c){let d=b.steps.map((a,b)=>`${b+1}. ${a.name}`).join("\n"),e=a.skills?.length?a.skills[0]:a.skill,f="";if(c.size>0){let a=[];for(let[b,d]of c){let c=b===e;a.push(`### ${c?"[Primary] ":""}Skill: ${b}
1
+ exports.id=4802,exports.ids=[4802],exports.modules={1108:(a,b,c)=>{"use strict";c.d(b,{Dp:()=>e,Sx:()=>f,oT:()=>g,qQ:()=>d});let d={files:280,search:320,echo:340,agents:300,discover:300,workflows:320},e={DEFAULT:280,MIN:240,MAX_RATIO:.45,MAX_ABS:600},f={DEFAULT:380,MIN:320,MAX_ABS:4e3,MIN_CONTENT:200},g={DEFAULT:400,MIN:300,MAX_ABS:640,MAX_RATIO:.42}},1394:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TimelineRenderer() from the server but TimelineRenderer is 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/app/components/renderers/timeline/TimelineRenderer.tsx","TimelineRenderer")},2420:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[50vh] gap-4 px-6",children:[(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:a.message||"An unexpected error occurred while rendering this page."})]}),(0,d.jsx)("button",{onClick:b,className:"px-4 py-2 rounded-md text-sm font-medium transition-colors",style:{background:"var(--muted)",color:"var(--foreground)"},children:"Try again"})]})}c(67484)},2518:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{A:()=>d}),c(67484),c(18329)},2548:(a,b,c)=>{"use strict";c.d(b,{_:()=>e});var d=c(67484);function e({width:a,minWidth:b,maxWidth:c,maxWidthRatio:e,direction:f,disabled:g,onResize:h,onResizeEnd:i}){let j=(0,d.useRef)(!1),k=(0,d.useRef)(0),l=(0,d.useRef)(0),m=(0,d.useRef)(a);m.current=a;let n=(0,d.useRef)(h);n.current=h;let o=(0,d.useRef)(i);return o.current=i,(0,d.useCallback)(d=>{if(g)return;d.preventDefault(),j.current=!0,k.current=d.clientX,l.current=a,document.body.classList.add("select-none"),document.body.style.cursor="col-resize";let h=a=>{if(!j.current)return;let d="right"===f?a.clientX-k.current:k.current-a.clientX,g=Math.round(Math.max(b,Math.min(Math.min(c,window.innerWidth*e),l.current+d)));n.current(g)},i=()=>{j.current=!1,document.body.classList.remove("select-none"),document.body.style.cursor="",o.current(m.current),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",i)},[a,b,c,e,f,g])}},2820:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>V});var d=c(48249),e=c(67484),f=c(12625),g=c(88282),h=c(95801),i=c(8455),j=c(49216),k=c(7309),l=c(24520),m=c(40560),n=c(53549),o=c(49681),p=c(44218),q=c(72419),r=c(59347),s=c(91282),t=c(10316),u=c(46674),v=c(80600),w=c(65032),x=c(19794);function y({trigger:a,children:b,open:c,onClose:f}){let g=(0,e.useRef)(null);return(0,d.jsxs)("div",{ref:g,className:"relative",children:[a,c&&(0,d.jsx)("div",{className:"absolute top-full left-0 mt-1 w-full min-w-[220px] max-h-[260px] overflow-y-auto bg-card border border-border rounded-lg shadow-lg z-50",children:b})]})}function z({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(""),m=k?i.filter(a=>a.id.toLowerCase().includes(k.toLowerCase())||a.name.toLowerCase().includes(k.toLowerCase())):i,n=a=>{b(a),f(!1),l("")},o=a?i.find(b=>b.id===a)?.name||a:void 0;return(0,d.jsxs)(y,{open:c,onClose:()=>{f(!1),l("")},trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:a?"text-foreground truncate":"text-muted-foreground",children:o||"MindOS"}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,d.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,d.jsx)(t.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),autoFocus:!0,placeholder:"Search agents...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),(0,d.jsxs)("button",{onClick:()=>n(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!a?"text-[var(--amber)] font-medium":"text-foreground"}`,children:["MindOS ",(0,d.jsx)("span",{className:"text-muted-foreground/50 ml-1",children:"(default)"})]}),m.slice(0,30).map(b=>(0,d.jsxs)("button",{onClick:()=>n(b.id),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${a===b.id?"text-[var(--amber)] font-medium":"text-foreground"}`,children:[b.name," ",b.name!==b.id&&(0,d.jsxs)("span",{className:"text-muted-foreground/50 ml-1",children:["(",b.id,")"]})]},b.id)),0===i.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),i.length>0&&0===m.length&&!k&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No ACP agents found"}),(0,d.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(n(g.trim()),h(""))},placeholder:"Custom agent ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}let A=[{group:"Anthropic",models:["claude-sonnet-4-6","claude-opus-4","claude-3.5-sonnet","claude-3.5-haiku"]},{group:"OpenAI",models:["gpt-4o","gpt-4o-mini","o3","o4-mini"]},{group:"Google",models:["gemini-2.5-pro","gemini-2.5-flash"]}];function B({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),i=a=>{b(a),f(!1)};return(0,d.jsxs)(y,{open:c,onClose:()=>f(!1),trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:a?"text-foreground truncate":"text-muted-foreground",children:a||"Default model"}),a?(0,d.jsx)(u.A,{size:12,className:"text-muted-foreground shrink-0 hover:text-foreground cursor-pointer",onClick:a=>{a.stopPropagation(),i(void 0)}}):(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,d.jsx)("button",{onClick:()=>i(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!a?"text-[var(--amber)] font-medium":"text-muted-foreground"}`,children:"(default)"}),A.map(b=>(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-3 py-1 text-2xs font-semibold text-muted-foreground/60 uppercase tracking-wide bg-muted/30",children:b.group}),b.models.map(b=>(0,d.jsx)("button",{onClick:()=>i(b),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${a===b?"text-[var(--amber)] font-medium":"text-foreground"}`,children:b},b))]},b.group)),(0,d.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(i(g.trim()),h(""))},placeholder:"Custom model ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}function C({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)([]),[i,j]=(0,e.useState)(""),k=i?g.filter(a=>a.name.toLowerCase().includes(i.toLowerCase())):g;return(0,d.jsxs)("div",{children:[a.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mb-1.5",children:a.map(c=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-md text-2xs bg-[var(--amber)]/10 text-[var(--amber)] border border-[var(--amber)]/20",children:[c,(0,d.jsx)("button",{onClick:()=>b(a.filter(a=>a!==c)),className:"p-0.5 rounded hover:bg-[var(--amber)]/20 transition-colors",children:(0,d.jsx)(u.A,{size:10})})]},c))}),(0,d.jsxs)(y,{open:c,onClose:()=>{f(!1),j("")},trigger:(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:0===a.length?"Add skills...":`${a.length} selected`}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground"})]}),children:[(0,d.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,d.jsx)(t.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("input",{type:"text",value:i,onChange:a=>j(a.target.value),autoFocus:!0,placeholder:"Search skills...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),k.slice(0,60).map(c=>{let e=a.includes(c.name);return(0,d.jsxs)("button",{onClick:()=>{var d;return d=c.name,void(a.includes(d)?b(a.filter(a=>a!==d)):b([...a,d]))},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors flex items-center gap-2 ${e?"bg-[var(--amber)]/5":""}`,children:[(0,d.jsx)("span",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 transition-colors ${e?"bg-[var(--amber)] border-[var(--amber)] text-[var(--amber-foreground)]":"border-border"}`,children:e&&(0,d.jsx)("span",{className:"text-[9px]",children:"✓"})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate",children:c.name}),c.description&&(0,d.jsx)("span",{className:"block text-2xs text-muted-foreground truncate mt-0.5",children:c.description})]})]},c.name)}),0===g.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),g.length>0&&0===k.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No skills found"})]})]})}function D({value:a,onChange:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(""),i=(0,e.useCallback)(c=>{let d=c.trim();d&&!a.includes(d)&&b([...a,d])},[a,b]),j=(0,e.useCallback)(a=>{a.preventDefault(),f(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b)return void i(b);let c=a.dataTransfer.getData("text/plain");c&&i(c)},[i]),l=(0,e.useCallback)(a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",f(!0)},[]),m=(0,e.useCallback)(()=>f(!1),[]);return(0,d.jsxs)("div",{children:[a.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-1 mb-1.5",children:a.map(c=>(0,d.jsxs)("div",{className:"flex items-center gap-1.5 pl-2 pr-1 py-1 rounded-md text-2xs bg-muted/60 border border-border group",children:[(0,d.jsx)(v.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-foreground truncate flex-1",title:c,children:c}),(0,d.jsx)("button",{onClick:()=>b(a.filter(a=>a!==c)),className:"p-0.5 rounded hover:bg-[var(--error)]/10 text-muted-foreground hover:text-[var(--error)] opacity-0 group-hover:opacity-100 transition-all",children:(0,d.jsx)(u.A,{size:10})})]},c))}),(0,d.jsxs)("div",{onDrop:j,onDragOver:l,onDragLeave:m,className:`flex items-center gap-2 px-3 py-2.5 rounded-lg border-2 border-dashed transition-colors ${c?"border-[var(--amber)] bg-[var(--amber)]/5":"border-border hover:border-muted-foreground/30"}`,children:[(0,d.jsx)(k.A,{size:14,className:`shrink-0 ${c?"text-[var(--amber)]":"text-muted-foreground/40"}`}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:"Drag files here from the sidebar"})]}),(0,d.jsx)("div",{className:"mt-1.5",children:(0,d.jsx)("input",{type:"text",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"===a.key&&g.trim()&&(i(g.trim()),h(""))},placeholder:"Or type a file path...",className:"w-full px-2.5 py-1 text-2xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}async function E(a){try{let b=await fetch("/api/setup/ls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a||"~"})});if(!b.ok)return[];return(await b.json()).dirs??[]}catch{return[]}}function F({value:a,onChange:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(-1),l=(0,e.useRef)(!1),m=(0,e.useRef)(null),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(a||"~"),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!1),v=()=>{f([]),h(!1),j(-1)},z=a=>{l.current=!0,b(a),v(),m.current?.focus()};return(0,e.useCallback)(async a=>{u(!0),s(await E(a)),u(!1)},[]),(0,d.jsxs)("div",{className:"relative flex gap-1.5",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("input",{ref:m,type:"text",value:a,onChange:a=>{b(a.target.value),h(!0)},onKeyDown:a=>{g&&0!==c.length&&("ArrowDown"===a.key?(a.preventDefault(),j(a=>Math.min(a+1,c.length-1))):"ArrowUp"===a.key?(a.preventDefault(),j(a=>Math.max(a-1,-1))):"Enter"===a.key&&i>=0?(a.preventDefault(),z(c[i])):"Escape"===a.key?v():"Tab"===a.key&&i>=0&&(a.preventDefault(),z(c[i])))},onBlur:()=>setTimeout(v,150),onFocus:()=>c.length>0&&h(!0),placeholder:"~/projects/my-app",className:"w-full px-2.5 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground font-mono placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),g&&c.length>0&&(0,d.jsx)("div",{role:"listbox",className:"absolute z-50 left-0 right-0 top-full mt-1 rounded-lg border border-border bg-card shadow-lg overflow-auto max-h-[200px]",children:c.map((a,b)=>(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b===i,onMouseDown:()=>z(a),className:`w-full text-left px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 ${b===i?"bg-muted text-foreground":"text-foreground hover:bg-muted/50"}`,children:[(0,d.jsx)(w.A,{size:11,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a})]},a))})]}),(0,d.jsxs)(y,{open:n,onClose:()=>o(!1),trigger:(0,d.jsx)("button",{type:"button",onClick:()=>{q(a||"~"),o(a=>!a)},className:"px-2 py-1.5 rounded-lg border border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Browse directories",children:(0,d.jsx)(k.A,{size:13})}),children:[(0,d.jsxs)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-2 flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-2xs font-mono text-muted-foreground truncate flex-1",title:p,children:p}),(0,d.jsx)("button",{onClick:()=>{b(p),o(!1)},className:"px-2 py-0.5 text-2xs rounded font-medium bg-[var(--amber)] text-[var(--amber-foreground)] shrink-0",children:"Select"})]}),"~"!==p&&(0,d.jsxs)("button",{onClick:()=>{let a=p.split("/");a.length<=1||(a.pop(),q(a.join("/")||"~"))},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-muted-foreground flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:12,className:"shrink-0"})," .."]}),t&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),!t&&0===r.length&&(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No subdirectories"}),r.map(a=>(0,d.jsxs)("button",{onClick:()=>{q("~"===p?`~/${a}`:`${p.replace(/\/+$/,"")}/${a}`)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-foreground flex items-center gap-1.5",children:[(0,d.jsx)(w.A,{size:12,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:"truncate flex-1",children:a}),(0,d.jsx)(x.A,{size:10,className:"text-muted-foreground/40 shrink-0"})]},a))]})]})}function G({step:a,index:b,onChange:c,onDelete:f,onMoveUp:g,onMoveDown:h}){let[i,j]=(0,e.useState)(!a.prompt),[k,l]=(0,e.useState)(!1),m=b=>c({...a,...b}),n=a.skills?.length?a.skills:a.skill?[a.skill]:[],o=!!(a.agent||a.model||n.length||a.context?.length||a.description||a.timeout);return i?(0,d.jsxs)("div",{className:"rounded-lg border border-[var(--amber)]/20 bg-card overflow-hidden shadow-sm",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/20",children:[(0,d.jsx)("span",{className:`text-xs font-medium flex-1 truncate ${a.name?"text-foreground":"text-muted-foreground/50 italic"}`,children:a.name||"Untitled step"}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move up",children:(0,d.jsx)(q.A,{size:12})}),h&&(0,d.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move down",children:(0,d.jsx)(p.A,{size:12})}),(0,d.jsx)("button",{onClick:f,className:"p-1 rounded hover:bg-[var(--error)]/10 text-muted-foreground/50 hover:text-[var(--error)] transition-colors",title:"Delete",children:(0,d.jsx)(r.A,{size:11})}),(0,d.jsx)("button",{onClick:()=>j(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground/50 transition-colors",title:"Collapse",children:(0,d.jsx)(q.A,{size:12})})]})]}),(0,d.jsxs)("div",{className:"px-3 py-3 space-y-3",children:[(0,d.jsx)("input",{type:"text",value:a.name,onChange:a=>m({name:a.target.value}),placeholder:"Step name...",autoFocus:!a.name,className:"w-full text-sm font-medium bg-transparent text-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,d.jsx)("textarea",{value:a.prompt,onChange:a=>m({prompt:a.target.value}),placeholder:"What should the AI do?",rows:3,className:"w-full px-3 py-2.5 text-sm rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y leading-relaxed"}),(0,d.jsxs)("div",{className:`grid ${a.agent?"grid-cols-2":"grid-cols-1"} gap-2`,children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Agent"}),(0,d.jsx)(z,{value:a.agent,onChange:b=>m({agent:b,model:b?a.model:void 0})})]}),a.agent&&(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Model"}),(0,d.jsx)(B,{value:a.model,onChange:a=>m({model:a})})]})]}),(0,d.jsxs)("button",{onClick:()=>l(a=>!a),className:`flex items-center gap-1.5 text-2xs transition-colors ${k||o?"text-muted-foreground":"text-muted-foreground/40 hover:text-muted-foreground"}`,children:[(0,d.jsx)(s.A,{size:11}),k?"Less options":"More options",!k&&o&&(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"})]}),k&&(0,d.jsxs)("div",{className:"space-y-3 pt-1",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Skills"}),(0,d.jsx)(C,{value:n,onChange:a=>m({skills:a,skill:void 0})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Context files"}),(0,d.jsx)(D,{value:a.context??[],onChange:a=>m({context:a.length?a:void 0})})]}),(0,d.jsxs)("div",{className:"grid grid-cols-[1fr,auto] gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Description"}),(0,d.jsx)("input",{type:"text",value:a.description||"",onChange:a=>m({description:a.target.value||void 0}),placeholder:"Optional note...",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Timeout"}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{type:"number",min:0,value:a.timeout||"",onChange:a=>m({timeout:a.target.value?Number(a.target.value):void 0}),placeholder:"120",className:"w-16 px-2 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40",children:"s"})]})]})]})]})]})]}):(0,d.jsxs)("div",{className:"group flex items-start gap-2 px-3 py-2 rounded-lg hover:bg-muted/40 transition-colors cursor-pointer -ml-1",onClick:()=>j(!0),children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:`text-sm leading-tight block ${a.name?"text-foreground font-medium":"text-muted-foreground/50 italic"}`,children:a.name||"Untitled step"}),o&&(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[a.agent&&(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground",children:a.agent}),n.slice(0,2).map(a=>(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-[var(--amber)]/8 text-[var(--amber)]",children:a},a)),n.length>2&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:["+",n.length-2]}),a.context?.length?(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:[a.context.length," files"]}):null]}),a.prompt&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/50 mt-1 line-clamp-1 leading-relaxed",children:a.prompt})]}),(0,d.jsx)(p.A,{size:12,className:"text-muted-foreground/30 mt-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"})]})}function H({workflow:a,filePath:b,onChange:c,onSaved:f}){let[g,i]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!1),t=b=>c({...a,...b}),u=(0,e.useCallback)((b,d)=>{let e=[...a.steps];e[b]=d,c({...a,steps:e})},[a,c]),v=(0,e.useCallback)(b=>{let d=a.steps[b];(!(d.name||d.prompt)||window.confirm(`Delete step "${d.name||"Untitled"}"?`))&&c({...a,steps:a.steps.filter((a,c)=>c!==b)})},[a,c]),w=(0,e.useCallback)(()=>{let b=a.steps.map(a=>a.id),d=a.steps.length+1,e={id:function(a,b){let c=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"step",d=c,e=2;for(;b.includes(d);)d=`${c}-${e}`,e++;return d}(`step-${d}`,b),name:`Step ${d}`,prompt:""};c({...a,steps:[...a.steps,e]})},[a,c]),x=(0,e.useCallback)((b,d)=>{if(d<0||d>=a.steps.length)return;let e=[...a.steps],[f]=e.splice(b,1);e.splice(d,0,f),c({...a,steps:e})},[a,c]),y=async()=>{i(!0),q(""),s(!1);try{let c,d=(c={title:a.title},a.description&&(c.description=a.description),a.workDir&&(c.workDir=a.workDir),a.skills?.length&&(c.skills=a.skills),a.tools?.length&&(c.tools=a.tools),c.steps=a.steps.map(a=>{let b={id:a.id,name:a.name};return a.description&&(b.description=a.description),a.agent&&(b.agent=a.agent),a.model&&(b.model=a.model),a.skill&&(b.skill=a.skill),a.skills?.length&&(b.skills=a.skills),a.tools?.length&&(b.tools=a.tools),a.context?.length&&(b.context=a.context),b.prompt=a.prompt,a.timeout&&(b.timeout=a.timeout),b}),j.Ay.dump(c,{lineWidth:-1,noRefs:!0,quotingType:'"',forceQuotes:!1})),e=await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:b,op:"save_file",content:d})});if(!e.ok){let a=await e.json().catch(()=>({}));throw Error(a.error||`Save failed (HTTP ${e.status})`)}s(!0),f?.()}catch(a){q(a instanceof Error?a.message:"Save failed")}finally{i(!1)}},z=!g&&!!a.title.trim()&&a.steps.length>0;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"space-y-3 mb-8",children:[(0,d.jsx)("input",{type:"text",value:a.title,onChange:a=>t({title:a.target.value}),placeholder:"Flow title...",className:"w-full text-lg font-semibold bg-transparent text-foreground placeholder:text-muted-foreground/40 focus:outline-none border-none p-0 leading-tight"}),(0,d.jsx)("input",{type:"text",value:a.description||"",onChange:a=>t({description:a.target.value||void 0}),placeholder:"Add a description...",className:"w-full text-sm bg-transparent text-muted-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(k.A,{size:12,className:"text-muted-foreground/40 shrink-0"}),(0,d.jsx)(F,{value:a.workDir||"",onChange:a=>t({workDir:a||void 0})})]})]}),a.steps.length>0?(0,d.jsxs)("div",{className:"relative",children:[a.steps.length>1&&(0,d.jsx)("div",{className:"absolute left-[19px] top-6 bottom-16 w-px bg-border"}),(0,d.jsx)("div",{className:"flex flex-col gap-3 mb-5 relative",children:a.steps.map((b,c)=>(0,d.jsxs)("div",{className:"relative pl-11",children:[(0,d.jsx)("div",{className:"absolute left-[7px] top-3 w-[22px] h-[22px] rounded-full border-2 border-border bg-background z-10 flex items-center justify-center",children:(0,d.jsx)("span",{className:"text-[10px] font-bold text-muted-foreground/60",children:c+1})}),(0,d.jsx)(G,{step:b,index:c,onChange:a=>u(c,a),onDelete:()=>v(c),onMoveUp:c>0?()=>x(c,c-1):void 0,onMoveDown:c<a.steps.length-1?()=>x(c,c+1):void 0})]},b.id))}),(0,d.jsxs)("div",{className:"relative pl-11",children:[(0,d.jsx)("div",{className:"absolute left-[7px] top-2.5 w-[22px] h-[22px] rounded-full border-2 border-dashed border-border bg-background z-10 flex items-center justify-center",children:(0,d.jsx)(l.A,{size:9,className:"text-muted-foreground/40"})}),(0,d.jsx)("button",{onClick:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/40 transition-colors",children:"Add step..."})]})]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,d.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-[var(--amber)]/8 flex items-center justify-center mb-4",children:(0,d.jsx)(h.A,{size:22,className:"text-[var(--amber)]/60"})}),(0,d.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Build your flow"}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/60 mb-5 max-w-[240px]",children:"Each step is a task for an AI agent. Chain them together to automate complex workflows."}),(0,d.jsxs)("button",{onClick:w,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:[(0,d.jsx)(l.A,{size:12}),"Add first step"]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-8 pt-4 border-t border-border/50",children:[(0,d.jsxs)("button",{onClick:y,disabled:!z,title:a.title.trim()?0===a.steps.length?"Add at least one step":void 0:"Title is required",className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium transition-all disabled:opacity-40 disabled:cursor-not-allowed ${z?"bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90":"bg-muted text-muted-foreground"}`,children:[g?(0,d.jsx)(m.A,{size:12,className:"animate-spin"}):(0,d.jsx)(n.A,{size:12}),g?"Saving...":"Save"]}),p&&(0,d.jsx)("span",{className:"text-xs text-[var(--error)]",children:p}),r&&!p&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-2xs text-[var(--success)]",children:[(0,d.jsx)(o.A,{size:11}),"Saved"]}),(0,d.jsx)("kbd",{className:"text-2xs text-muted-foreground/30 ml-auto font-mono",children:"Ctrl+S"})]})]})}var I=c(78835),J=c(2797),K=c(6079),L=c(31724),M=c(89165);let N=new Map;async function O(a,b){if(N.has(a))return N.get(a);try{let c=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:a}),signal:b});if(!c.ok)return N.set(a,null),null;let d=(await c.json()).content;return N.set(a,d??null),d??null}catch{return null}}async function P(a,b){try{let c=await fetch(`/api/acp/registry?agent=${encodeURIComponent(a)}`,{signal:b});if(!c.ok)return null;let d=await c.json();if(d.agent?.id)return{id:d.agent.id,name:d.agent.name||a};return null}catch{return null}}async function Q(a,b,c,d,e){let f=function(a,b){let c=[];if(a.skills?.length)for(let b of a.skills)c.includes(b)||c.push(b);else a.skill&&c.push(a.skill);for(let a of b.skills??[])c.includes(a)||c.push(a);return c}(a,b),g=new Map;if(f.length>0)for(let[a,b]of(await Promise.all(f.map(async a=>{let b=await O(a,e);return[a,b]}))))b&&g.set(a,b);let h=null;a.agent&&(h=await P(a.agent,e));let i={messages:[{role:"user",content:function(a,b,c){let d=b.steps.map((a,b)=>`${b+1}. ${a.name}`).join("\n"),e=a.skills?.length?a.skills[0]:a.skill,f="";if(c.size>0){let a=[];for(let[b,d]of c){let c=b===e;a.push(`### ${c?"[Primary] ":""}Skill: ${b}
2
2
 
3
3
  ${d}`)}f=`
4
4
 
@@ -44,13 +44,23 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
44
44
  relative flex items-center ${f?"justify-start px-3 w-full":"justify-center w-10"} h-10 rounded-md transition-colors
45
45
  ${e?"text-[var(--amber)] bg-[var(--amber-dim)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}
46
46
  focus-visible:ring-2 focus-visible:ring-ring
47
- `,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function w({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:w,onDiscoverClick:x,onWorkflowsClick:y,onSpacesClick:z,syncStatus:A,expanded:B,onExpandedChange:C,onSettingsClick:D,onSyncClick:E}){let F=(0,e.useRef)(0),G=(0,e.useRef)(null),{t:H}=(0,q.Y)(),I=(0,f.usePathname)(),J=(0,f.useRouter)(),K="/"===I,[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(a=>{let b=Date.now();b-F.current<300||(F.current=b,a())},[]),S=(0,e.useCallback)(c=>{R(()=>b(a===c?null:c))},[a,b,R]),T=(0,r.Bq)(A,!1),U=B?u:t,V="off"!==T&&"synced"!==T?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${r.BG[T]} ${"error"===T||"conflicts"===T?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${U}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{K?b("files"===a?null:"files"):(b("files"),J.push("/"))},className:`flex items-center ${B?"px-3 gap-2":"justify-center"} w-full h-[46px] shrink-0 transition-opacity cursor-pointer ${K?"opacity-100":"opacity-50 hover:opacity-80"}`,"aria-label":"MindOS Home",children:[(0,d.jsx)(s.A,{id:"rail",className:"w-7 h-3.5 shrink-0"}),B&&(0,d.jsx)("span",{className:"text-sm text-foreground font-brand whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(g.A,{size:18}),label:H.sidebar.files,active:!K&&"files"===a,expanded:B,onClick:()=>z?R(z):S("files"),walkthroughId:"files-panel"}),N&&(0,d.jsx)(v,{icon:(0,d.jsx)(h.A,{size:18}),label:H.sidebar.echo,active:"echo"===a,expanded:B,onClick:()=>c?R(c):S("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(v,{icon:(0,d.jsx)(i.A,{size:18}),label:H.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:B,onClick:()=>S("search")}),(0,d.jsx)(v,{icon:(0,d.jsx)(j.A,{size:18}),label:H.sidebar.agents,active:"agents"===a,expanded:B,onClick:()=>w?R(w):S("agents"),walkthroughId:"agents-panel"}),P&&(0,d.jsx)(v,{icon:(0,d.jsx)(k.A,{size:18}),label:H.sidebar.workflows??"Flows",active:"workflows"===a,expanded:B,onClick:()=>y?R(y):S("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(v,{icon:(0,d.jsx)(l.A,{size:18}),label:H.sidebar.discover,active:"discover"===a,expanded:B,onClick:()=>x?R(x):S("discover")})}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(m.A,{size:18}),label:H.sidebar.settingsTitle,shortcut:"⌘,",expanded:B,onClick:()=>R(D),badge:L?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),A?.enabled&&A?.remote&&"(not configured)"!==A.remote&&(0,d.jsx)(v,{icon:(0,d.jsx)(n.A,{size:18}),label:H.sidebar.syncLabel,expanded:B,buttonRef:G,badge:V,onClick:()=>R(()=>{let a=G.current?.getBoundingClientRect();a&&E(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>C(!B),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":B?"Collapse sidebar":"Expand sidebar",title:B?"Collapse":"Expand",children:B?(0,d.jsx)(o.A,{size:10}):(0,d.jsx)(p.A,{size:10})})]})}},4949:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(19099),g=c(97621),h=c(50567),i=c(22772),j=c(86588),k=c(40560),l=c(42742),m=c(6079),n=c(8455),o=c(45231),p=c(46674),q=c(47086),r=c(13481),s=c(44218),t=c(47223),u=c(33191),v=c(39624);function w(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function x({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:x}){let{t:y}=(0,t.Y)(),z=(0,f.useRouter)(),A=y.fileImport,B="organizing"===a.phase,{elapsed:C,displayHint:D}=function(a,b){let[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(!1);return(0,e.useRef)(Date.now()),{elapsed:c,displayHint:f?{stage:"thinking"}:b}}(0,a.stageHint),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),K=(0,e.useRef)(null),L=(0,e.useRef)(null),M="done"===a.phase,N="error"===a.phase,O=B||M||N,P=a.changes.filter(a=>a.ok&&!a.undone).length,Q=(0,e.useCallback)(()=>{K.current&&clearTimeout(K.current),(M||N)&&(K.current=setTimeout(()=>{b()},18e4))},[M,N,b]),R=(0,e.useCallback)(()=>{Q()},[Q]),S=(0,e.useCallback)(async b=>{R(),J(!0);let c=await a.undoOne(b);J(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(L.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);(0,v.W8)(L.current,{files:c,status:d?"undone":"partial"}),x?.()}},0))},[a,R,x]),T=(0,e.useCallback)(async()=>{R(),J(!0);let b=await a.undoAll();J(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),L.current&&((0,v.W8)(L.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),x?.()))},[a,R,x]),U=(0,e.useCallback)(a=>{R(),z.push(`/view/${(0,u.O0)(a)}`)},[z,R]),V=(0,e.useCallback)(()=>{b()},[b]);if(!O)return null;function W(b,c){let e=b.undone,f=a.canUndo(b.path),k=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(g.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(h.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(i.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:k}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:A.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?A.organizeCreated:A.organizeUpdated:A.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>S(b.path),disabled:I,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:A.organizeUndoOne,children:(0,d.jsx)(g.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>U(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:A.organizeViewFile,children:(0,d.jsx)(j.A,{size:12})})]},`${b.path}-${c}`)}function X(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[M&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:T,disabled:I,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[I?(0,d.jsx)(k.A,{size:12,className:"animate-spin"}):(0,d.jsx)(g.A,{size:12}),A.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:V,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]})}return G?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&H(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:R,role:"dialog","aria-modal":"true","aria-label":A.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[B?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):M?(0,d.jsx)(l.A,{size:16,className:"text-success"}):(0,d.jsx)(n.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:A.organizeDetailTitle}),B&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:A.organizeElapsed(C)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>H(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeMinimizeModal,children:(0,d.jsx)(o.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(p.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:w(y,D)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(q.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||B)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||A.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>W(a,b))})]}),N&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(M||N)&&X()]})}):E&&(M||N)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,d.jsx)(l.A,{size:14,className:"text-success"}):(0,d.jsx)(n.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:M?A.organizeReviewTitle:A.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{F(!1),H(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>F(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}),M&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>W(a,b))}),N&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),X()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeReviewDesc(P)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{F(!0),R()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(s.A,{size:12,className:"rotate-180"}),A.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:V,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]}):N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{F(!0),R()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:A.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:w(y,D)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:A.organizeElapsed(C)}),(0,d.jsx)("button",{type:"button",onClick:()=>{H(!0),R()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]})})}},5200:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(67484),e=c(47223),f=c(52610);function g({ssrLocale:a}){let b=(0,d.useRef)(!1);return b.current||(b.current=!0,e.D.getState().locale!==a&&e.D.setState({locale:a,t:f.D[a]})),null}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.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/app/components/ShellLayout.tsx","default")},6597:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(7309),g=c(83654),h=c(80600),i=c(93096);function j({results:a,selectedIndex:b,query:c,onSelect:j}){let k=(0,e.useRef)(null),l=(0,e.useRef)(null),[m,n]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:l,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-muted-foreground/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Files"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:k,className:"overflow-y-auto",style:{maxHeight:m},children:a.map((a,e)=>{let f=a.split("/").pop()??a,k=a.split("/").slice(0,-1).join("/"),l=f.endsWith(".csv");return(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),j(a)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[l?(0,d.jsx)(g.A,{size:13,className:"text-success shrink-0"}):(0,d.jsx)(h.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate font-medium flex-1",title:f,children:(0,d.jsx)(i.A,{text:f,query:c})}),k&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 truncate max-w-[140px] shrink-0",title:k,children:(0,d.jsx)(i.A,{text:k,query:c})})]},a)})}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},9311:(a,b,c)=>{"use strict";c.d(b,{BG:()=>l,jc:()=>q,Ay:()=>p,Bq:()=>k,ky:()=>o,bj:()=>n,dW:()=>m});var d=c(48249),e=c(67484),f=c(49681),g=c(2797),h=c(69924),i=c(95054),j=c(47223);function k(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}c(81285);let l={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function m(){let[a,b]=(0,e.useState)(null),[c,d]=(0,e.useState)(!1);return(0,e.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,e.useCallback)(async()=>{try{let a=await (0,i.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function n(a){let[b,c]=(0,e.useState)(!1),[d,f]=(0,e.useState)(null),g=(0,e.useCallback)(async()=>{if(!b){c(!0),f(null);try{await (0,i.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),f("success")}catch{await a(),f("error")}finally{c(!1),setTimeout(()=>f(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function o(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${function(a,b){if(!a)return(void 0)??"never";let c=Date.now()-new Date(a).getTime();if(c<6e4)return(void 0)??"just now";let d=Math.floor(c/6e4);if(c<36e5)return(void 0)??`${d}m ago`;let e=Math.floor(c/36e5);if(c<864e5)return(void 0)??`${e}h ago`;let f=Math.floor(c/864e5);return(void 0)??`${f}d ago`}(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function p({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:i,fetchStatus:p}=m(),{syncing:q,syncResult:r,syncNow:s}=n(p),[t,u]=(0,e.useState)(null);(0,e.useRef)("off");let[v,w]=(0,e.useState)(()=>!1),{t:x}=(0,j.Y)();if(!function(a){let[,b]=(0,e.useState)(0)}(0),!i||a)return null;let y=k(c,q);if("off"===y){if(v)return null;let a=x.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}w(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let z=x.sidebar?.sync,{label:A,tooltip:B}=o(y,c,z);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:B,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${l[y]} ${"syncing"===y||"conflicts"===y?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:t||A})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===r||t)&&(0,d.jsx)(f.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===r&&(0,d.jsx)(g.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),s()},disabled:q,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:z?.syncNow??"Sync now",children:(0,d.jsx)(h.A,{size:12,className:q?"animate-spin":""})})]})]})}function q({status:a,syncing:b}){let c=k(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["imprint","growth","self"],e={imprint:"/echo/imprint",growth:"/echo/growth",self:"/echo/self"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},10927:(a,b,c)=>{"use strict";function d(a,b=!0){}c.d(b,{r:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.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/app/app/register-sw.tsx","default")},13859:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>i});var e=c(67484),f=c(61112),g=c(92464),h=a([f]);function i(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(f.eX),[h,i]=(0,e.useState)("panel"),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!1);(0,e.useRef)(!1).current=n;let[p,q]=(0,e.useState)("user"),[r,s]=(0,e.useState)(null),t=(0,e.useRef)(f.eX);(0,g.KT)();let u=(0,e.useCallback)(()=>{"popup"===h?k(a=>(a||(m(""),q("user"),s(null)),!a)):b(a=>(a||(m(""),q("user"),s(null)),!a))},[h]),v=(0,e.useCallback)(()=>{b(!1),n&&(d(t.current),o(!1))},[n]),w=(0,e.useCallback)(()=>{o(a=>(a?d(t.current):t.current=c,!a))},[c]),x=(0,e.useCallback)(()=>k(!1),[]),y=(0,e.useCallback)(a=>d(a),[]),z=(0,e.useCallback)(a=>{try{localStorage.setItem("right-ask-panel-width",String(a))}catch{}},[]),A=(0,e.useCallback)(()=>{i(a=>{let c="panel"===a?"popup":"panel";try{localStorage.setItem("ask-mode",c),window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:c}))}catch{}return"popup"===c?(b(!1),k(!0)):(k(!1),b(!0)),c})},[]);return{askPanelOpen:a,askPanelWidth:c,askMaximized:n,askMode:h,desktopAskPopupOpen:j,askInitialMessage:l,askOpenSource:p,askAcpAgent:r,toggleAskPanel:u,closeAskPanel:v,closeDesktopAskPopup:x,handleAskWidthChange:y,handleAskWidthCommit:z,handleAskModeSwitch:A,toggleAskMaximized:w}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},14986:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call VideoRenderer() from the server but VideoRenderer is 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/app/components/renderers/video/VideoRenderer.tsx","VideoRenderer")},15330:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0);(0,d.useCallback)(()=>{fetch("/api/files").then(a=>a.ok?a.json():[]).then(a=>Array.isArray(a)?a:[]).catch(()=>[]).then(b)},[]);let j=(0,d.useCallback)((b,c)=>{let d=c??b.length,f=b.slice(0,d),h=f.lastIndexOf("@");if(-1===h||h>0&&" "!==f[h-1]&&"\n"!==f[h-1])return void e(null);let j=f.slice(h+1);if(j.includes(" ")||j.includes("\n")){e(null),g([]),i(0);return}let k=j.toLowerCase();if(!k){e(j),g(a.slice(0,30)),i(0);return}let l=a.map(a=>{let b=(a.split("/").pop()??a).toLowerCase(),c=a.toLowerCase(),d=0;return b.startsWith(k)?d=100:b.includes(k)?d=50:c.includes(k)&&(d=10),{path:a,score:d}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,30);if(0===l.length){e(null),g([]),i(0);return}e(j),g(l.map(a=>a.path)),i(0)},[a]),k=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{mentionQuery:c,mentionResults:f,mentionIndex:h,updateMentionFromInput:j,navigateMention:k,resetMention:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},17233:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("40e9c24d132e2360d5a5d63bf2f8f31d7b4e255bfd",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},18329:(a,b,c)=>{"use strict";c.d(b,{av:()=>k,kr:()=>i,oc:()=>j,u_:()=>l,zd:()=>h});var d=c(31417),e=c(95054);let f=null;async function g(a){f?.abort();let b=new AbortController;f=b;try{let[c,d,f]=await Promise.all([(0,e.n)("/api/mcp/status",{signal:b.signal}),(0,e.n)("/api/mcp/agents",{signal:b.signal}),(0,e.n)("/api/skills",{signal:b.signal})]);b.signal.aborted||a({status:c,agents:d.agents,skills:f.skills})}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{b.signal.aborted||a({loading:!1})}}let h=(0,d.v)((a,b)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>g(a),toggleSkill:async(c,d)=>{a({skills:b().skills.map(a=>a.name===c?{...a,enabled:d}:a)});try{return await (0,e.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:c,enabled:d})}),!0}catch{return a({skills:b().skills.map(a=>a.name===c?{...a,enabled:!d}:a)}),!1}},installAgent:async(c,d)=>{let f=b().agents.find(a=>a.key===c);if(!f)return!1;try{let b=await (0,e.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:c,scope:d?.scope??(f.hasProjectScope?"project":"global"),transport:d?.transport??f.preferredTransport}],transport:"auto"})}),h=b.results?.[0],i=h?.ok===!0||h?.status==="ok";return i&&await g(a),i}catch{return!1}},_init:()=>{let b;g(a);let c=()=>{clearTimeout(b),b=setTimeout(()=>g(a),500)};window.addEventListener("mindos:skills-changed",c);let d=setInterval(()=>{"visible"===document.visibilityState&&g(a)},3e4);return()=>{f?.abort(),clearTimeout(b),clearInterval(d),window.removeEventListener("mindos:skills-changed",c)}}}));function i(){return h()}let j=()=>h(a=>a.agents),k=()=>h(a=>a.status),l=()=>h(a=>a.installAgent)},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is 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/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},20892:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"bottom"},{anchor:"agents-panel",position:"right"}]},21416:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),k=(0,e.useCallback)(()=>{h(!1),f(!0),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full h-full min-h-[80vh] flex flex-col relative",children:[c&&!g&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading PDF..."})}),g&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load PDF"}),(0,d.jsx)("button",{onClick:k,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("iframe",{src:b,className:"w-full flex-1 min-h-[80vh] border-0 rounded-lg bg-[var(--bg-secondary)]",title:a.split("/").pop()??"PDF",onLoad:()=>f(!1),onError:()=>{f(!1),h(!0)},style:{display:g?"none":"block"}},i)]})}},23017:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let[a,b]=(0,e.useState)(!1),{t:c}=(0,g.Y)(),h=c.shortcutPanel,i="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",j=(0,e.useMemo)(()=>[{keys:`${i} K`,label:h.toggleSearch,section:h.navigation},{keys:`${i} /`,label:h.toggleAskAI,section:h.navigation},{keys:`${i} ,`,label:h.openSettings,section:h.navigation},{keys:`${i} ?`,label:h.keyboardShortcuts,section:h.navigation},{keys:"Esc",label:h.closePanel,section:h.panelsSection},{keys:`${i} S`,label:h.saveFile,section:h.editor},{keys:`${i} Z`,label:h.undo,section:h.editor},{keys:`${i} Shift Z`,label:h.redo,section:h.editor}],[i,h]);if(!a)return null;let k=[...new Set(j.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":h.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:h.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(f.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:k.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:j.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:i}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",h.toggleHint]})})]})})}},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.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/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},29406:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call PdfRenderer() from the server but PdfRenderer is 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/app/components/renderers/pdf/PdfRenderer.tsx","PdfRenderer")},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29820:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(48249),e=c(67484),f=c(19099),g=c(98631),h=c(84248),i=c(69924),j=c(98971),k=c(90473),l=c(2188),m=c(10316),n=c(16651),o=c(17512),p=c(70366),q=c(95801),r=c(41861),s=c(44218),t=c(4140),u=c(78890),v=c(47223),w=c(86367),x=c(92464),y=c(29974),z=c(81285);function A({icon:a,title:b,prompt:c,tryLabel:e}){return(0,d.jsxs)("div",{className:"group flex items-center gap-2.5 px-4 py-1.5 hover:bg-muted/50 transition-colors rounded-sm mx-1",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:b,children:b}),(0,d.jsx)("button",{onClick:()=>(0,x.NH)(c,"user"),className:"opacity-0 group-hover:opacity-100 text-2xs px-2 py-0.5 rounded text-[var(--amber-text)] bg-[var(--amber-dim)] hover:opacity-80 transition-all duration-150 shrink-0",children:e})]})}let B={c1:(0,d.jsx)(g.A,{size:12}),c2:(0,d.jsx)(h.A,{size:12}),c3:(0,d.jsx)(i.A,{size:12}),c4:(0,d.jsx)(j.A,{size:12}),c5:(0,d.jsx)(k.A,{size:12}),c6:(0,d.jsx)(l.A,{size:12}),c7:(0,d.jsx)(m.A,{size:12}),c8:(0,d.jsx)(n.A,{size:12}),c9:(0,d.jsx)(o.A,{size:12})};function C({active:a,maximized:b,onMaximize:c}){let{t:g}=(0,v.Y)(),h=g.panels.discover,i=g.explore,j=g.panels.plugins,l=(0,f.useRouter)(),[m,n]=(0,e.useState)(!1),[o,x]=(0,e.useState)(!1),[,C]=(0,e.useState)(0),[D,E]=(0,e.useState)(new Set);(0,e.useRef)(!1);let F=(0,e.useCallback)((a,b)=>{(0,y.$7)(a,b),C(a=>a+1),window.dispatchEvent(new Event("renderer-state-changed"))},[]),G=(0,e.useCallback)(a=>{l.push(`/view/${a.split("/").map(encodeURIComponent).join("/")}`)},[l]),H=m?(0,y.MZ)():[],I=m?H.filter(a=>(0,y.pl)(a.id)).length:0;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(t.A,{title:h.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(u.G,{icon:(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)]"}),title:h.useCases,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground",children:w.LD.length}),href:"/explore"}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(p.A,{size:14,className:"text-muted-foreground"}),title:h.pluginMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(q.A,{size:14,className:"text-muted-foreground"}),title:h.skillMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(r.A,{size:14,className:"text-muted-foreground"}),title:h.spaceTemplates,badge:(0,d.jsx)(u.M,{label:h.comingSoon})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(a=>!a),className:"w-full flex items-center gap-1.5 px-4 py-1.5 text-left",children:[(0,d.jsx)(s.A,{size:11,className:`text-muted-foreground transition-transform duration-150 ${o?"":"-rotate-90"}`}),(0,d.jsx)(p.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider flex-1",children:j.title}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[I,"/",H.length]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${o?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",...!o&&{inert:!0},children:H.map(a=>{let b=(0,y.pl)(a.id),c=!!a.entryPath&&D.has(a.entryPath),e=b&&a.entryPath&&c;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-1.5 mx-1 rounded-sm transition-colors ${e?"cursor-pointer hover:bg-muted/50":""} ${!b?"opacity-50":""}`,onClick:e?()=>G(a.entryPath):void 0,role:e?"link":void 0,tabIndex:e?0:void 0,onKeyDown:e?b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),G(a.entryPath))}:void 0,children:[(0,d.jsx)("span",{className:"text-sm shrink-0",suppressHydrationWarning:!0,children:a.icon}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:a.name,children:a.name}),a.core?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:j.core}):(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),children:(0,d.jsx)(z.lM,{checked:b,onChange:b=>F(a.id,b),size:"sm"})})]},a.id)})})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)("div",{className:"px-4 py-1.5",children:(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:h.useCases})}),w.LD.map(a=>{var b;let c=(b=a.id,({c1:i.c1,c2:i.c2,c3:i.c3,c4:i.c4,c5:i.c5,c6:i.c6,c7:i.c7,c8:i.c8,c9:i.c9})[b]);return c?(0,d.jsx)(A,{icon:B[a.id]||(0,d.jsx)(k.A,{size:12}),title:c.title,prompt:c.prompt,tryLabel:h.tryIt},a.id):null})]})]})]})}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},30488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"audio",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),m=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col items-center gap-6 py-12 px-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--text-secondary)]",children:[(0,d.jsx)("span",{className:"text-4xl opacity-40",children:"\uD83C\uDFB5"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:c}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"uppercase opacity-60",children:f}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`})]})]})]}),g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load audio"}),(0,d.jsx)("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}):(0,d.jsx)("audio",{controls:!0,preload:"metadata",className:"w-full max-w-lg",onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)]})}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},31442:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.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/app/lib/stores/LocaleStoreInit.tsx","default")},32056:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>y,metadata:()=>z,viewport:()=>A});var e=c(5735),f=c(82204),g=c.n(f),h=c(10890),i=c.n(h),j=c(1256),k=c.n(j),l=c(57353),m=c.n(l);c(82704);var n=c(50953),o=c(5315),p=c(68533),q=c(31442),r=c(24387),s=c(32248),t=c(12978),u=c(90598),v=c(39219),w=c(65573);c(95351);var x=a([n]);n=(x.then?(await x)():x)[0];let z={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},A={width:"device-width",initialScale:1,viewportFit:"cover"};async function y({children:a}){let b=[];try{b=(0,n.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),d=c.get("locale")?.value,f="en";return"zh"===d?f="zh":"en"!==d&&(f=((await (0,w.b3)()).get("Accept-Language")||"").includes("zh")?"zh":"en"),(0,e.jsxs)("html",{lang:f,suppressHydrationWarning:!0,children:[(0,e.jsxs)("head",{children:[(0,e.jsx)("meta",{name:"theme-color",content:"#c8873a"}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');if(pf==='geist'){pf='inter';localStorage.setItem('prose-font','inter')}var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',inter:'var(--font-inter), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;window.__mindos_locale__=rl;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,e.jsxs)("body",{className:`${g().variable} ${i().variable} ${k().variable} ${m().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:[(0,e.jsx)(q.default,{ssrLocale:f}),(0,e.jsx)(p.TooltipProvider,{delay:300,children:(0,e.jsx)(r.default,{children:(0,e.jsx)(o.default,{fileTree:b,children:a})})}),(0,e.jsx)(s.default,{}),(0,e.jsx)(t.default,{}),(0,e.jsx)(u.default,{}),(0,e.jsx)(v.default,{})]})]})}d()}catch(a){d(a)}})},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.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/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33046:(a,b,c)=>{Promise.resolve().then(c.bind(c,12978)),Promise.resolve().then(c.bind(c,24387)),Promise.resolve().then(c.bind(c,66913)),Promise.resolve().then(c.bind(c,59238)),Promise.resolve().then(c.bind(c,66874)),Promise.resolve().then(c.bind(c,43951)),Promise.resolve().then(c.bind(c,63112)),Promise.resolve().then(c.bind(c,60442)),Promise.resolve().then(c.bind(c,37718)),Promise.resolve().then(c.bind(c,92206)),Promise.resolve().then(c.bind(c,29406)),Promise.resolve().then(c.bind(c,45862)),Promise.resolve().then(c.bind(c,1394)),Promise.resolve().then(c.bind(c,18776)),Promise.resolve().then(c.bind(c,14986)),Promise.resolve().then(c.bind(c,83539)),Promise.resolve().then(c.bind(c,5315)),Promise.resolve().then(c.bind(c,32248)),Promise.resolve().then(c.bind(c,68533)),Promise.resolve().then(c.bind(c,90598)),Promise.resolve().then(c.bind(c,39219)),Promise.resolve().then(c.bind(c,31442))},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},33827:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(48249),e=c(67484),f=c(74429),g=c(80600),h=c(19226),i=c(33407),j=c(95801),k=c(65255),l=c(65032),m=c(83654),n=c(40560),o=c(8455),p=c(31675),q=c(49681),r=c(46674);let s={kb:{icon:g.A,cls:"text-muted-foreground"},upload:{icon:h.A,cls:"text-muted-foreground"},image:{icon:i.A,cls:"text-muted-foreground"},skill:{icon:j.A,cls:"text-[var(--amber)]"},agent:{icon:k.A,cls:"text-[var(--amber)]"}},t={kb:"border-border bg-muted text-foreground",upload:"border-border bg-muted text-foreground",image:"border-border bg-muted text-foreground",skill:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground",agent:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground"};function u({path:a,onRemove:b,variant:c="kb",imageData:g,imageMime:h,status:i,error:j,truncatedInfo:k}){let[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),F="kb"===c&&a.endsWith("/"),G=F?a.slice(0,-1):a,H=G.split("/").pop()??G,I="kb"===c&&!F&&H.endsWith(".csv"),{icon:J,cls:K}=F?{icon:l.A,cls:"text-yellow-400"}:I?{icon:m.A,cls:"text-success"}:s[c],L=!!k,M=null,N="";"loading"===i?(M=n.A,N="text-muted-foreground animate-spin"):"error"===i?(M=o.A,N="text-destructive"):L?(M=p.A,N="text-[var(--amber)]"):"success"===i&&(M=q.A,N="text-emerald-500");let O="error"===i?"border-destructive/30 bg-destructive/5 text-foreground":L?"border-[var(--amber)]/30 bg-[var(--amber)]/5 text-foreground":t[c],P=null;if("error"===i&&j)P=j;else if(L){let a=k.totalChars>0?Math.round(k.includedChars/k.totalChars*100):0;P=`Document truncated — only ${a}% included (${Math.round(k.includedChars/1e3)}K / ${Math.round(k.totalChars/1e3)}K chars, ${k.totalPages} pages total)`}let Q=u&&B&&g&&h?(0,d.jsx)("div",{className:"fixed z-50 p-1 rounded-lg border border-border bg-card shadow-lg pointer-events-none",style:{left:B.left,bottom:window.innerHeight-B.top},children:(0,d.jsx)("img",{src:`data:${h};base64,${g}`,alt:H,className:"max-h-48 max-w-64 rounded object-contain"})}):null,R=w&&D&&P?(0,d.jsx)("div",{className:`fixed z-50 px-2.5 py-1.5 rounded-lg border bg-card text-xs shadow-lg pointer-events-none max-w-[280px] ${"error"===i?"border-destructive/20 text-destructive":"border-[var(--amber)]/20 text-[var(--amber-text)]"}`,style:{left:D.left,bottom:window.innerHeight-D.top},children:P}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{ref:A,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border max-w-[220px] ${O}`,onMouseEnter:()=>{g&&v(!0),P&&x(!0)},onMouseLeave:()=>{v(!1),x(!1)},children:[(0,d.jsx)(J,{size:11,className:`${K} shrink-0`}),(0,d.jsx)("span",{className:"truncate",title:F?G:a,children:H}),M&&(0,d.jsx)(M,{size:10,className:`${N} shrink-0`}),(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":`Remove ${H}`,className:"p-0.5 -mr-1 rounded hover:text-foreground transition-colors shrink-0 text-muted-foreground",children:(0,d.jsx)(r.A,{size:10})})]}),y&&Q&&(0,f.createPortal)(Q,document.body),y&&R&&(0,f.createPortal)(R,document.body)]})}},34545:(a,b,c)=>{"use strict";c.d(b,{P:()=>d,u:()=>e});let d=[{id:"telegram",name:"Telegram",icon:"\uD83D\uDCF1",guide:"1. Open Telegram → search @BotFather\n2. Send /newbot → follow prompts\n3. Copy the token below",purpose:"Receive MindOS notifications and quick updates in Telegram.",purposeZh:"通过 Telegram 接收 MindOS 的通知和快速更新。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. chat ID like 123456789 or -1001234567890",recipientExampleZh:"例如 123456789 或 -1001234567890 这样的 chat ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456789:AABBccDD-EeFfGgHh...",hint:"Format: number:alphanumeric"}]},{id:"feishu",name:"Feishu",icon:"\uD83D\uDC26",guide:"1. open.feishu.cn → Create App\n2. Credentials page → copy App ID & Secret\n3. Enable Bot capability + add permissions",guideUrl:"https://open.feishu.cn/",editHint:"Need to update credentials? Edit and save below — MindOS will reconnect automatically.",purpose:"Receive MindOS results in Feishu, or let users message the bot directly when conversations are enabled.",purposeZh:"通过飞书接收 MindOS 的结果;开启对话后,也可以让用户直接在飞书里给机器人发消息。",useCases:["Agent completion alerts","Error notifications","Test messages","Direct bot conversations in Feishu"],useCasesZh:["Agent 完成提醒","错误通知","测试消息","在飞书里直接与机器人对话"],recipientExample:"e.g. ou_xxx, oc_xxx, or a work email",recipientExampleZh:"例如 ou_xxx、oc_xxx,或企业邮箱",fields:[{key:"app_id",label:"App ID",placeholder:"CLI_XXXXXXXXXXXXXXXXX",hint:"From Credentials page on open.feishu.cn"},{key:"app_secret",label:"App Secret",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXX",hint:"Keep this secret — do not share"}]},{id:"discord",name:"Discord",icon:"\uD83D\uDCAC",guide:"1. discord.com/developers → New Application\n2. Bot tab → Reset Token → copy\n3. Enable Message Content Intent",purpose:"Send MindOS updates into Discord channels and DMs.",purposeZh:"把 MindOS 的更新发送到 Discord 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Discord channel or user ID",recipientExampleZh:"例如 Discord 频道 ID 或用户 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"MTIxNzM..."}]},{id:"slack",name:"Slack",icon:"\uD83D\uDCBC",guide:"1. api.slack.com/apps → Create New App\n2. OAuth & Permissions → add chat:write scope\n3. Install to Workspace → copy Bot Token",purpose:"Route MindOS notifications into Slack channels and direct messages.",purposeZh:"把 MindOS 的通知发送到 Slack 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Slack channel or user ID like C123... or U123...",recipientExampleZh:"例如 Slack 频道 ID 或用户 ID(如 C123... / U123...)",fields:[{key:"bot_token",label:"Bot Token",placeholder:"xoxb-xxxx-xxxx-xxxx",hint:"Starts with xoxb-"}]},{id:"wecom",name:"WeCom",icon:"\uD83C\uDFE2",guide:"1. Group chat → Add Robot → Custom\n2. Copy Webhook URL\n3. Extract the key parameter from URL",purpose:"Deliver MindOS notifications into WeCom group chats.",purposeZh:"把 MindOS 通知投递到企业微信群聊。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured robot or WeCom target",recipientExampleZh:"使用你配置好的机器人或企业微信目标",fields:[{key:"webhook_key",label:"Webhook Key",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",hint:"The key= value from webhook URL"}]},{id:"dingtalk",name:"DingTalk",icon:"\uD83D\uDD14",guide:"1. Group → Settings → Smart Assistant → Add Robot\n2. Select Custom (Webhook)\n3. Copy the full Webhook URL",purpose:"Push MindOS notifications into DingTalk groups.",purposeZh:"把 MindOS 通知发送到钉钉群。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured DingTalk robot target",recipientExampleZh:"使用你配置好的钉钉机器人目标",fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",hint:"Full URL including access_token"}]},{id:"wechat",name:"WeChat",icon:"\uD83D\uDC9A",guide:"1. Visit ilinkai.weixin.qq.com\n2. Register & create a bot application\n3. QR login in the console → copy Bot Token from dashboard",purpose:"Send MindOS updates to WeChat via your configured bot.",purposeZh:"通过你配置好的机器人把 MindOS 更新发送到微信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the WeChat user or chat ID supported by your bot",recipientExampleZh:"使用你的机器人支持的微信用户或群聊 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"wx_xxxxxxxxxxxxxxxx",hint:"From iLink Bot console after QR login"}]},{id:"qq",name:"QQ",icon:"\uD83D\uDC27",guide:"1. q.qq.com → Create Bot\n2. Development tab → copy App ID & Secret\n3. Add group/C2C intents as needed",purpose:"Deliver MindOS notifications through QQ bot channels.",purposeZh:"通过 QQ 机器人频道接收 MindOS 通知。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the QQ openid or group_openid for your target",recipientExampleZh:"使用目标 QQ 的 openid 或 group_openid",fields:[{key:"app_id",label:"App ID",placeholder:"102xxxxxx"},{key:"app_secret",label:"App Secret",placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx"}]}];function e(a){return d.find(b=>b.id===a)}},36161:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is 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/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},38957:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>n,bA:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(22341),h=c(6079),i=c(42742),j=c(44218),k=c(47223);function l(){return"agent"}let m=["agent","chat"];function n({mode:a,onChange:b,disabled:c}){let{t:l}=(0,k.Y)(),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(null),s=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!r.current)return;let a=r.current.getBoundingClientRect(),b=a.top,c=b>window.innerHeight-a.bottom&&b>120?"up":"down";q({left:a.left,top:"up"===c?a.top-6:a.bottom+6,direction:c})},[]);let t=(0,e.useCallback)(a=>{b(a);try{localStorage.setItem("mindos-ask-mode",a)}catch{}o(!1)},[b]),u="chat"===a,v=(a,b)=>"chat"===a?(0,d.jsx)(g.A,{size:b,className:"shrink-0"}):(0,d.jsx)(h.A,{size:b,className:"shrink-0"}),w=a=>"chat"===a?l.ask.modeChat:l.ask.modeAgent,x=a=>"chat"===a?l.ask.modeChatHint:l.ask.modeAgentHint,y=n&&p?(0,d.jsx)("div",{ref:s,role:"listbox","aria-label":"Select mode",className:"fixed z-50 min-w-[200px] max-w-[260px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:p.left,..."up"===p.direction?{bottom:window.innerHeight-p.top}:{top:p.top}},children:m.map(b=>{let c=a===b;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>t(b),className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:v(b,13)}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"font-medium",children:w(b)}),(0,d.jsx)("div",{className:"text-2xs text-muted-foreground mt-0.5",children:x(b)})]}),c&&(0,d.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"})]},b)})}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:r,type:"button",onClick:()=>{c||o(a=>!a)},disabled:c,className:`
47
+ `,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function w({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:w,onDiscoverClick:x,onWorkflowsClick:y,onSpacesClick:z,syncStatus:A,expanded:B,onExpandedChange:C,onSettingsClick:D,onSyncClick:E}){let F=(0,e.useRef)(0),G=(0,e.useRef)(null),{t:H}=(0,q.Y)(),I=(0,f.usePathname)(),J=(0,f.useRouter)(),K="/"===I,[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(a=>{let b=Date.now();b-F.current<300||(F.current=b,a())},[]),S=(0,e.useCallback)(c=>{R(()=>b(a===c?null:c))},[a,b,R]),T=(0,r.Bq)(A,!1),U=B?u:t,V="off"!==T&&"synced"!==T?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${r.BG[T]} ${"error"===T||"conflicts"===T?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${U}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{K?b("files"===a?null:"files"):(b("files"),J.push("/"))},className:`flex items-center ${B?"px-3 gap-2":"justify-center"} w-full h-[46px] shrink-0 transition-opacity cursor-pointer ${K?"opacity-100":"opacity-50 hover:opacity-80"}`,"aria-label":"MindOS Home",children:[(0,d.jsx)(s.A,{id:"rail",className:"w-7 h-3.5 shrink-0"}),B&&(0,d.jsx)("span",{className:"text-sm text-foreground font-brand whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(g.A,{size:18}),label:H.sidebar.files,active:!K&&"files"===a,expanded:B,onClick:()=>z?R(z):S("files"),walkthroughId:"files-panel"}),N&&(0,d.jsx)(v,{icon:(0,d.jsx)(h.A,{size:18}),label:H.sidebar.echo,active:"echo"===a,expanded:B,onClick:()=>c?R(c):S("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(v,{icon:(0,d.jsx)(i.A,{size:18}),label:H.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:B,onClick:()=>S("search")}),(0,d.jsx)(v,{icon:(0,d.jsx)(j.A,{size:18}),label:H.sidebar.agents,active:"agents"===a,expanded:B,onClick:()=>w?R(w):S("agents"),walkthroughId:"agents-panel"}),P&&(0,d.jsx)(v,{icon:(0,d.jsx)(k.A,{size:18}),label:H.sidebar.workflows??"Flows",active:"workflows"===a,expanded:B,onClick:()=>y?R(y):S("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(v,{icon:(0,d.jsx)(l.A,{size:18}),label:H.sidebar.discover,active:"discover"===a,expanded:B,onClick:()=>x?R(x):S("discover")})}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(m.A,{size:18}),label:H.sidebar.settingsTitle,shortcut:"⌘,",expanded:B,onClick:()=>R(D),badge:L?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),A?.enabled&&A?.remote&&"(not configured)"!==A.remote&&(0,d.jsx)(v,{icon:(0,d.jsx)(n.A,{size:18}),label:H.sidebar.syncLabel,expanded:B,buttonRef:G,badge:V,onClick:()=>R(()=>{let a=G.current?.getBoundingClientRect();a&&E(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>C(!B),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":B?"Collapse sidebar":"Expand sidebar",title:B?"Collapse":"Expand",children:B?(0,d.jsx)(o.A,{size:10}):(0,d.jsx)(p.A,{size:10})})]})}},4949:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(19099),g=c(97621),h=c(50567),i=c(22772),j=c(86588),k=c(40560),l=c(42742),m=c(6079),n=c(8455),o=c(45231),p=c(46674),q=c(47086),r=c(13481),s=c(44218),t=c(47223),u=c(33191),v=c(39624);function w(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function x({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:x}){let{t:y}=(0,t.Y)(),z=(0,f.useRouter)(),A=y.fileImport,B="organizing"===a.phase,{elapsed:C,displayHint:D}=function(a,b){let[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(!1);return(0,e.useRef)(Date.now()),{elapsed:c,displayHint:f?{stage:"thinking"}:b}}(0,a.stageHint),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),K=(0,e.useRef)(null),L=(0,e.useRef)(null),M="done"===a.phase,N="error"===a.phase,O=B||M||N,P=a.changes.filter(a=>a.ok&&!a.undone).length,Q=(0,e.useCallback)(()=>{K.current&&clearTimeout(K.current),(M||N)&&(K.current=setTimeout(()=>{b()},18e4))},[M,N,b]),R=(0,e.useCallback)(()=>{Q()},[Q]),S=(0,e.useCallback)(async b=>{R(),J(!0);let c=await a.undoOne(b);J(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(L.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);(0,v.W8)(L.current,{files:c,status:d?"undone":"partial"}),x?.()}},0))},[a,R,x]),T=(0,e.useCallback)(async()=>{R(),J(!0);let b=await a.undoAll();J(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),L.current&&((0,v.W8)(L.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),x?.()))},[a,R,x]),U=(0,e.useCallback)(a=>{R(),z.push(`/view/${(0,u.O0)(a)}`)},[z,R]),V=(0,e.useCallback)(()=>{b()},[b]);if(!O)return null;function W(b,c){let e=b.undone,f=a.canUndo(b.path),k=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(g.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(h.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(i.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:k}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:A.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?A.organizeCreated:A.organizeUpdated:A.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>S(b.path),disabled:I,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:A.organizeUndoOne,children:(0,d.jsx)(g.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>U(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:A.organizeViewFile,children:(0,d.jsx)(j.A,{size:12})})]},`${b.path}-${c}`)}function X(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[M&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:T,disabled:I,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[I?(0,d.jsx)(k.A,{size:12,className:"animate-spin"}):(0,d.jsx)(g.A,{size:12}),A.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:V,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]})}return G?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&H(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:R,role:"dialog","aria-modal":"true","aria-label":A.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[B?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):M?(0,d.jsx)(l.A,{size:16,className:"text-success"}):(0,d.jsx)(n.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:A.organizeDetailTitle}),B&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:A.organizeElapsed(C)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>H(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeMinimizeModal,children:(0,d.jsx)(o.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(p.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:w(y,D)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(q.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||B)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||A.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>W(a,b))})]}),N&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(M||N)&&X()]})}):E&&(M||N)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,d.jsx)(l.A,{size:14,className:"text-success"}):(0,d.jsx)(n.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:M?A.organizeReviewTitle:A.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{F(!1),H(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>F(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}),M&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>W(a,b))}),N&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),X()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeReviewDesc(P)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{F(!0),R()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(s.A,{size:12,className:"rotate-180"}),A.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:V,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]}):N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{F(!0),R()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:A.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:w(y,D)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:A.organizeElapsed(C)}),(0,d.jsx)("button",{type:"button",onClick:()=>{H(!0),R()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]})})}},5200:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(67484),e=c(47223),f=c(52610);function g({ssrLocale:a}){let b=(0,d.useRef)(!1);return b.current||(b.current=!0,e.D.getState().locale!==a&&e.D.setState({locale:a,t:f.D[a]})),null}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.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/app/components/ShellLayout.tsx","default")},6597:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(7309),g=c(83654),h=c(80600),i=c(93096);function j({results:a,selectedIndex:b,query:c,onSelect:j}){let k=(0,e.useRef)(null),l=(0,e.useRef)(null),[m,n]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:l,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-muted-foreground/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Files"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:k,className:"overflow-y-auto",style:{maxHeight:m},children:a.map((a,e)=>{let f=a.split("/").pop()??a,k=a.split("/").slice(0,-1).join("/"),l=f.endsWith(".csv");return(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),j(a)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[l?(0,d.jsx)(g.A,{size:13,className:"text-success shrink-0"}):(0,d.jsx)(h.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate font-medium flex-1",title:f,children:(0,d.jsx)(i.A,{text:f,query:c})}),k&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 truncate max-w-[140px] shrink-0",title:k,children:(0,d.jsx)(i.A,{text:k,query:c})})]},a)})}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},9311:(a,b,c)=>{"use strict";c.d(b,{BG:()=>l,jc:()=>q,Ay:()=>p,Bq:()=>k,ky:()=>o,bj:()=>n,dW:()=>m});var d=c(48249),e=c(67484),f=c(49681),g=c(2797),h=c(69924),i=c(95054),j=c(47223);function k(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}c(81285);let l={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function m(){let[a,b]=(0,e.useState)(null),[c,d]=(0,e.useState)(!1);return(0,e.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,e.useCallback)(async()=>{try{let a=await (0,i.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function n(a){let[b,c]=(0,e.useState)(!1),[d,f]=(0,e.useState)(null),g=(0,e.useCallback)(async()=>{if(!b){c(!0),f(null);try{await (0,i.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),f("success")}catch{await a(),f("error")}finally{c(!1),setTimeout(()=>f(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function o(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${function(a,b){if(!a)return(void 0)??"never";let c=Date.now()-new Date(a).getTime();if(c<6e4)return(void 0)??"just now";let d=Math.floor(c/6e4);if(c<36e5)return(void 0)??`${d}m ago`;let e=Math.floor(c/36e5);if(c<864e5)return(void 0)??`${e}h ago`;let f=Math.floor(c/864e5);return(void 0)??`${f}d ago`}(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function p({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:i,fetchStatus:p}=m(),{syncing:q,syncResult:r,syncNow:s}=n(p),[t,u]=(0,e.useState)(null);(0,e.useRef)("off");let[v,w]=(0,e.useState)(()=>!1),{t:x}=(0,j.Y)();if(!function(a){let[,b]=(0,e.useState)(0)}(0),!i||a)return null;let y=k(c,q);if("off"===y){if(v)return null;let a=x.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}w(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let z=x.sidebar?.sync,{label:A,tooltip:B}=o(y,c,z);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:B,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${l[y]} ${"syncing"===y||"conflicts"===y?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:t||A})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===r||t)&&(0,d.jsx)(f.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===r&&(0,d.jsx)(g.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),s()},disabled:q,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:z?.syncNow??"Sync now",children:(0,d.jsx)(h.A,{size:12,className:q?"animate-spin":""})})]})]})}function q({status:a,syncing:b}){let c=k(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["imprint","growth","self"],e={imprint:"/echo/imprint",growth:"/echo/growth",self:"/echo/self"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},10927:(a,b,c)=>{"use strict";function d(a,b=!0){}c.d(b,{r:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.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/app/app/register-sw.tsx","default")},13859:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>i});var e=c(67484),f=c(61112),g=c(92464),h=a([f]);function i(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(f.eX),[h,i]=(0,e.useState)("panel"),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!1);(0,e.useRef)(!1).current=n;let[p,q]=(0,e.useState)("user"),[r,s]=(0,e.useState)(null),t=(0,e.useRef)(f.eX);(0,g.KT)();let u=(0,e.useCallback)(()=>{"popup"===h?k(a=>(a||(m(""),q("user"),s(null)),!a)):b(a=>(a||(m(""),q("user"),s(null)),!a))},[h]),v=(0,e.useCallback)(()=>{b(!1),n&&(d(t.current),o(!1))},[n]),w=(0,e.useCallback)(()=>{o(a=>(a?d(t.current):t.current=c,!a))},[c]),x=(0,e.useCallback)(()=>k(!1),[]),y=(0,e.useCallback)(a=>d(a),[]),z=(0,e.useCallback)(a=>{try{localStorage.setItem("right-ask-panel-width",String(a))}catch{}},[]),A=(0,e.useCallback)(()=>{i(a=>{let c="panel"===a?"popup":"panel";try{localStorage.setItem("ask-mode",c),window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:c}))}catch{}return"popup"===c?(b(!1),k(!0)):(k(!1),b(!0)),c})},[]);return{askPanelOpen:a,askPanelWidth:c,askMaximized:n,askMode:h,desktopAskPopupOpen:j,askInitialMessage:l,askOpenSource:p,askAcpAgent:r,toggleAskPanel:u,closeAskPanel:v,closeDesktopAskPopup:x,handleAskWidthChange:y,handleAskWidthCommit:z,handleAskModeSwitch:A,toggleAskMaximized:w}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},14986:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call VideoRenderer() from the server but VideoRenderer is 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/app/components/renderers/video/VideoRenderer.tsx","VideoRenderer")},15330:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0);(0,d.useCallback)(()=>{fetch("/api/files").then(a=>a.ok?a.json():[]).then(a=>Array.isArray(a)?a:[]).catch(()=>[]).then(b)},[]);let j=(0,d.useCallback)((b,c)=>{let d=c??b.length,f=b.slice(0,d),h=f.lastIndexOf("@");if(-1===h||h>0&&" "!==f[h-1]&&"\n"!==f[h-1])return void e(null);let j=f.slice(h+1);if(j.includes(" ")||j.includes("\n")){e(null),g([]),i(0);return}let k=j.toLowerCase();if(!k){e(j),g(a.slice(0,30)),i(0);return}let l=a.map(a=>{let b=(a.split("/").pop()??a).toLowerCase(),c=a.toLowerCase(),d=0;return b.startsWith(k)?d=100:b.includes(k)?d=50:c.includes(k)&&(d=10),{path:a,score:d}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,30);if(0===l.length){e(null),g([]),i(0);return}e(j),g(l.map(a=>a.path)),i(0)},[a]),k=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{mentionQuery:c,mentionResults:f,mentionIndex:h,updateMentionFromInput:j,navigateMention:k,resetMention:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},18329:(a,b,c)=>{"use strict";c.d(b,{av:()=>k,kr:()=>i,oc:()=>j,u_:()=>l,zd:()=>h});var d=c(31417),e=c(95054);let f=null;async function g(a){f?.abort();let b=new AbortController;f=b;try{let[c,d,f]=await Promise.all([(0,e.n)("/api/mcp/status",{signal:b.signal}),(0,e.n)("/api/mcp/agents",{signal:b.signal}),(0,e.n)("/api/skills",{signal:b.signal})]);b.signal.aborted||a({status:c,agents:d.agents,skills:f.skills})}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{b.signal.aborted||a({loading:!1})}}let h=(0,d.v)((a,b)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>g(a),toggleSkill:async(c,d)=>{a({skills:b().skills.map(a=>a.name===c?{...a,enabled:d}:a)});try{return await (0,e.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:c,enabled:d})}),!0}catch{return a({skills:b().skills.map(a=>a.name===c?{...a,enabled:!d}:a)}),!1}},installAgent:async(c,d)=>{let f=b().agents.find(a=>a.key===c);if(!f)return!1;try{let b=await (0,e.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:c,scope:d?.scope??(f.hasProjectScope?"project":"global"),transport:d?.transport??f.preferredTransport}],transport:"auto"})}),h=b.results?.[0],i=h?.ok===!0||h?.status==="ok";return i&&await g(a),i}catch{return!1}},_init:()=>{let b;g(a);let c=()=>{clearTimeout(b),b=setTimeout(()=>g(a),500)};window.addEventListener("mindos:skills-changed",c);let d=setInterval(()=>{"visible"===document.visibilityState&&g(a)},3e4);return()=>{f?.abort(),clearTimeout(b),clearInterval(d),window.removeEventListener("mindos:skills-changed",c)}}}));function i(){return h()}let j=()=>h(a=>a.agents),k=()=>h(a=>a.status),l=()=>h(a=>a.installAgent)},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is 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/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},20892:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"bottom"},{anchor:"agents-panel",position:"right"}]},21416:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),k=(0,e.useCallback)(()=>{h(!1),f(!0),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full h-full min-h-[80vh] flex flex-col relative",children:[c&&!g&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading PDF..."})}),g&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load PDF"}),(0,d.jsx)("button",{onClick:k,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("iframe",{src:b,className:"w-full flex-1 min-h-[80vh] border-0 rounded-lg bg-[var(--bg-secondary)]",title:a.split("/").pop()??"PDF",onLoad:()=>f(!1),onError:()=>{f(!1),h(!0)},style:{display:g?"none":"block"}},i)]})}},23017:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let[a,b]=(0,e.useState)(!1),{t:c}=(0,g.Y)(),h=c.shortcutPanel,i="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",j=(0,e.useMemo)(()=>[{keys:`${i} K`,label:h.toggleSearch,section:h.navigation},{keys:`${i} /`,label:h.toggleAskAI,section:h.navigation},{keys:`${i} ,`,label:h.openSettings,section:h.navigation},{keys:`${i} ?`,label:h.keyboardShortcuts,section:h.navigation},{keys:"Esc",label:h.closePanel,section:h.panelsSection},{keys:`${i} S`,label:h.saveFile,section:h.editor},{keys:`${i} Z`,label:h.undo,section:h.editor},{keys:`${i} Shift Z`,label:h.redo,section:h.editor}],[i,h]);if(!a)return null;let k=[...new Set(j.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":h.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:h.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(f.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:k.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:j.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:i}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",h.toggleHint]})})]})})}},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.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/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},29406:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call PdfRenderer() from the server but PdfRenderer is 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/app/components/renderers/pdf/PdfRenderer.tsx","PdfRenderer")},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29820:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(48249),e=c(67484),f=c(19099),g=c(98631),h=c(84248),i=c(69924),j=c(98971),k=c(90473),l=c(2188),m=c(10316),n=c(16651),o=c(17512),p=c(70366),q=c(95801),r=c(41861),s=c(44218),t=c(4140),u=c(78890),v=c(47223),w=c(86367),x=c(92464),y=c(29974),z=c(81285);function A({icon:a,title:b,prompt:c,tryLabel:e}){return(0,d.jsxs)("div",{className:"group flex items-center gap-2.5 px-4 py-1.5 hover:bg-muted/50 transition-colors rounded-sm mx-1",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:b,children:b}),(0,d.jsx)("button",{onClick:()=>(0,x.NH)(c,"user"),className:"opacity-0 group-hover:opacity-100 text-2xs px-2 py-0.5 rounded text-[var(--amber-text)] bg-[var(--amber-dim)] hover:opacity-80 transition-all duration-150 shrink-0",children:e})]})}let B={c1:(0,d.jsx)(g.A,{size:12}),c2:(0,d.jsx)(h.A,{size:12}),c3:(0,d.jsx)(i.A,{size:12}),c4:(0,d.jsx)(j.A,{size:12}),c5:(0,d.jsx)(k.A,{size:12}),c6:(0,d.jsx)(l.A,{size:12}),c7:(0,d.jsx)(m.A,{size:12}),c8:(0,d.jsx)(n.A,{size:12}),c9:(0,d.jsx)(o.A,{size:12})};function C({active:a,maximized:b,onMaximize:c}){let{t:g}=(0,v.Y)(),h=g.panels.discover,i=g.explore,j=g.panels.plugins,l=(0,f.useRouter)(),[m,n]=(0,e.useState)(!1),[o,x]=(0,e.useState)(!1),[,C]=(0,e.useState)(0),[D,E]=(0,e.useState)(new Set);(0,e.useRef)(!1);let F=(0,e.useCallback)((a,b)=>{(0,y.$7)(a,b),C(a=>a+1),window.dispatchEvent(new Event("renderer-state-changed"))},[]),G=(0,e.useCallback)(a=>{l.push(`/view/${a.split("/").map(encodeURIComponent).join("/")}`)},[l]),H=m?(0,y.MZ)():[],I=m?H.filter(a=>(0,y.pl)(a.id)).length:0;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(t.A,{title:h.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(u.G,{icon:(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)]"}),title:h.useCases,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground",children:w.LD.length}),href:"/explore"}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(p.A,{size:14,className:"text-muted-foreground"}),title:h.pluginMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(q.A,{size:14,className:"text-muted-foreground"}),title:h.skillMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(r.A,{size:14,className:"text-muted-foreground"}),title:h.spaceTemplates,badge:(0,d.jsx)(u.M,{label:h.comingSoon})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(a=>!a),className:"w-full flex items-center gap-1.5 px-4 py-1.5 text-left",children:[(0,d.jsx)(s.A,{size:11,className:`text-muted-foreground transition-transform duration-150 ${o?"":"-rotate-90"}`}),(0,d.jsx)(p.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider flex-1",children:j.title}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[I,"/",H.length]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${o?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",...!o&&{inert:!0},children:H.map(a=>{let b=(0,y.pl)(a.id),c=!!a.entryPath&&D.has(a.entryPath),e=b&&a.entryPath&&c;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-1.5 mx-1 rounded-sm transition-colors ${e?"cursor-pointer hover:bg-muted/50":""} ${!b?"opacity-50":""}`,onClick:e?()=>G(a.entryPath):void 0,role:e?"link":void 0,tabIndex:e?0:void 0,onKeyDown:e?b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),G(a.entryPath))}:void 0,children:[(0,d.jsx)("span",{className:"text-sm shrink-0",suppressHydrationWarning:!0,children:a.icon}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:a.name,children:a.name}),a.core?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:j.core}):(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),children:(0,d.jsx)(z.lM,{checked:b,onChange:b=>F(a.id,b),size:"sm"})})]},a.id)})})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)("div",{className:"px-4 py-1.5",children:(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:h.useCases})}),w.LD.map(a=>{var b;let c=(b=a.id,({c1:i.c1,c2:i.c2,c3:i.c3,c4:i.c4,c5:i.c5,c6:i.c6,c7:i.c7,c8:i.c8,c9:i.c9})[b]);return c?(0,d.jsx)(A,{icon:B[a.id]||(0,d.jsx)(k.A,{size:12}),title:c.title,prompt:c.prompt,tryLabel:h.tryIt},a.id):null})]})]})]})}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},30488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"audio",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),m=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col items-center gap-6 py-12 px-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--text-secondary)]",children:[(0,d.jsx)("span",{className:"text-4xl opacity-40",children:"\uD83C\uDFB5"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:c}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"uppercase opacity-60",children:f}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`})]})]})]}),g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load audio"}),(0,d.jsx)("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}):(0,d.jsx)("audio",{controls:!0,preload:"metadata",className:"w-full max-w-lg",onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)]})}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},31442:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.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/app/lib/stores/LocaleStoreInit.tsx","default")},32056:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>y,metadata:()=>z,viewport:()=>A});var e=c(5735),f=c(82204),g=c.n(f),h=c(10890),i=c.n(h),j=c(1256),k=c.n(j),l=c(57353),m=c.n(l);c(82704);var n=c(50953),o=c(5315),p=c(68533),q=c(31442),r=c(24387),s=c(32248),t=c(12978),u=c(90598),v=c(39219),w=c(65573);c(95351);var x=a([n]);n=(x.then?(await x)():x)[0];let z={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},A={width:"device-width",initialScale:1,viewportFit:"cover"};async function y({children:a}){let b=[];try{b=(0,n.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),d=c.get("locale")?.value,f="en";return"zh"===d?f="zh":"en"!==d&&(f=((await (0,w.b3)()).get("Accept-Language")||"").includes("zh")?"zh":"en"),(0,e.jsxs)("html",{lang:f,suppressHydrationWarning:!0,children:[(0,e.jsxs)("head",{children:[(0,e.jsx)("meta",{name:"theme-color",content:"#c8873a"}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');if(pf==='geist'){pf='inter';localStorage.setItem('prose-font','inter')}var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',inter:'var(--font-inter), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;window.__mindos_locale__=rl;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,e.jsxs)("body",{className:`${g().variable} ${i().variable} ${k().variable} ${m().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:[(0,e.jsx)(q.default,{ssrLocale:f}),(0,e.jsx)(p.TooltipProvider,{delay:300,children:(0,e.jsx)(r.default,{children:(0,e.jsx)(o.default,{fileTree:b,children:a})})}),(0,e.jsx)(s.default,{}),(0,e.jsx)(t.default,{}),(0,e.jsx)(u.default,{}),(0,e.jsx)(v.default,{})]})]})}d()}catch(a){d(a)}})},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.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/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33046:(a,b,c)=>{Promise.resolve().then(c.bind(c,12978)),Promise.resolve().then(c.bind(c,24387)),Promise.resolve().then(c.bind(c,66913)),Promise.resolve().then(c.bind(c,59238)),Promise.resolve().then(c.bind(c,66874)),Promise.resolve().then(c.bind(c,43951)),Promise.resolve().then(c.bind(c,63112)),Promise.resolve().then(c.bind(c,60442)),Promise.resolve().then(c.bind(c,37718)),Promise.resolve().then(c.bind(c,92206)),Promise.resolve().then(c.bind(c,29406)),Promise.resolve().then(c.bind(c,45862)),Promise.resolve().then(c.bind(c,1394)),Promise.resolve().then(c.bind(c,18776)),Promise.resolve().then(c.bind(c,14986)),Promise.resolve().then(c.bind(c,83539)),Promise.resolve().then(c.bind(c,5315)),Promise.resolve().then(c.bind(c,32248)),Promise.resolve().then(c.bind(c,68533)),Promise.resolve().then(c.bind(c,90598)),Promise.resolve().then(c.bind(c,39219)),Promise.resolve().then(c.bind(c,31442))},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},33827:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(48249),e=c(67484),f=c(74429),g=c(80600),h=c(19226),i=c(33407),j=c(95801),k=c(65255),l=c(65032),m=c(83654),n=c(40560),o=c(8455),p=c(31675),q=c(49681),r=c(46674);let s={kb:{icon:g.A,cls:"text-muted-foreground"},upload:{icon:h.A,cls:"text-muted-foreground"},image:{icon:i.A,cls:"text-muted-foreground"},skill:{icon:j.A,cls:"text-[var(--amber)]"},agent:{icon:k.A,cls:"text-[var(--amber)]"}},t={kb:"border-border bg-muted text-foreground",upload:"border-border bg-muted text-foreground",image:"border-border bg-muted text-foreground",skill:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground",agent:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground"};function u({path:a,onRemove:b,variant:c="kb",imageData:g,imageMime:h,status:i,error:j,truncatedInfo:k}){let[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),F="kb"===c&&a.endsWith("/"),G=F?a.slice(0,-1):a,H=G.split("/").pop()??G,I="kb"===c&&!F&&H.endsWith(".csv"),{icon:J,cls:K}=F?{icon:l.A,cls:"text-yellow-400"}:I?{icon:m.A,cls:"text-success"}:s[c],L=!!k,M=null,N="";"loading"===i?(M=n.A,N="text-muted-foreground animate-spin"):"error"===i?(M=o.A,N="text-destructive"):L?(M=p.A,N="text-[var(--amber)]"):"success"===i&&(M=q.A,N="text-emerald-500");let O="error"===i?"border-destructive/30 bg-destructive/5 text-foreground":L?"border-[var(--amber)]/30 bg-[var(--amber)]/5 text-foreground":t[c],P=null;if("error"===i&&j)P=j;else if(L){let a=k.totalChars>0?Math.round(k.includedChars/k.totalChars*100):0;P=`Document truncated — only ${a}% included (${Math.round(k.includedChars/1e3)}K / ${Math.round(k.totalChars/1e3)}K chars, ${k.totalPages} pages total)`}let Q=u&&B&&g&&h?(0,d.jsx)("div",{className:"fixed z-50 p-1 rounded-lg border border-border bg-card shadow-lg pointer-events-none",style:{left:B.left,bottom:window.innerHeight-B.top},children:(0,d.jsx)("img",{src:`data:${h};base64,${g}`,alt:H,className:"max-h-48 max-w-64 rounded object-contain"})}):null,R=w&&D&&P?(0,d.jsx)("div",{className:`fixed z-50 px-2.5 py-1.5 rounded-lg border bg-card text-xs shadow-lg pointer-events-none max-w-[280px] ${"error"===i?"border-destructive/20 text-destructive":"border-[var(--amber)]/20 text-[var(--amber-text)]"}`,style:{left:D.left,bottom:window.innerHeight-D.top},children:P}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{ref:A,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border max-w-[220px] ${O}`,onMouseEnter:()=>{g&&v(!0),P&&x(!0)},onMouseLeave:()=>{v(!1),x(!1)},children:[(0,d.jsx)(J,{size:11,className:`${K} shrink-0`}),(0,d.jsx)("span",{className:"truncate",title:F?G:a,children:H}),M&&(0,d.jsx)(M,{size:10,className:`${N} shrink-0`}),(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":`Remove ${H}`,className:"p-0.5 -mr-1 rounded hover:text-foreground transition-colors shrink-0 text-muted-foreground",children:(0,d.jsx)(r.A,{size:10})})]}),y&&Q&&(0,f.createPortal)(Q,document.body),y&&R&&(0,f.createPortal)(R,document.body)]})}},34545:(a,b,c)=>{"use strict";c.d(b,{P:()=>d,u:()=>e});let d=[{id:"telegram",name:"Telegram",icon:"\uD83D\uDCF1",guide:"1. Open Telegram → search @BotFather\n2. Send /newbot → follow prompts\n3. Copy the token below",purpose:"Receive MindOS notifications and quick updates in Telegram.",purposeZh:"通过 Telegram 接收 MindOS 的通知和快速更新。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. chat ID like 123456789 or -1001234567890",recipientExampleZh:"例如 123456789 或 -1001234567890 这样的 chat ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456789:AABBccDD-EeFfGgHh...",hint:"Format: number:alphanumeric"}]},{id:"feishu",name:"Feishu",icon:"\uD83D\uDC26",guide:"1. open.feishu.cn → Create App\n2. Credentials page → copy App ID & Secret\n3. Enable Bot capability + add permissions",guideUrl:"https://open.feishu.cn/",editHint:"Need to update credentials? Edit and save below — MindOS will reconnect automatically.",purpose:"Receive MindOS results in Feishu, or let users message the bot directly when conversations are enabled.",purposeZh:"通过飞书接收 MindOS 的结果;开启对话后,也可以让用户直接在飞书里给机器人发消息。",useCases:["Agent completion alerts","Error notifications","Test messages","Direct bot conversations in Feishu"],useCasesZh:["Agent 完成提醒","错误通知","测试消息","在飞书里直接与机器人对话"],recipientExample:"e.g. ou_xxx, oc_xxx, or a work email",recipientExampleZh:"例如 ou_xxx、oc_xxx,或企业邮箱",fields:[{key:"app_id",label:"App ID",placeholder:"CLI_XXXXXXXXXXXXXXXXX",hint:"From Credentials page on open.feishu.cn"},{key:"app_secret",label:"App Secret",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXX",hint:"Keep this secret — do not share"}]},{id:"discord",name:"Discord",icon:"\uD83D\uDCAC",guide:"1. discord.com/developers → New Application\n2. Bot tab → Reset Token → copy\n3. Enable Message Content Intent",purpose:"Send MindOS updates into Discord channels and DMs.",purposeZh:"把 MindOS 的更新发送到 Discord 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Discord channel or user ID",recipientExampleZh:"例如 Discord 频道 ID 或用户 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"MTIxNzM..."}]},{id:"slack",name:"Slack",icon:"\uD83D\uDCBC",guide:"1. api.slack.com/apps → Create New App\n2. OAuth & Permissions → add chat:write scope\n3. Install to Workspace → copy Bot Token",purpose:"Route MindOS notifications into Slack channels and direct messages.",purposeZh:"把 MindOS 的通知发送到 Slack 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Slack channel or user ID like C123... or U123...",recipientExampleZh:"例如 Slack 频道 ID 或用户 ID(如 C123... / U123...)",fields:[{key:"bot_token",label:"Bot Token",placeholder:"xoxb-xxxx-xxxx-xxxx",hint:"Starts with xoxb-"}]},{id:"wecom",name:"WeCom",icon:"\uD83C\uDFE2",guide:"1. Group chat → Add Robot → Custom\n2. Copy Webhook URL\n3. Extract the key parameter from URL",purpose:"Deliver MindOS notifications into WeCom group chats.",purposeZh:"把 MindOS 通知投递到企业微信群聊。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured robot or WeCom target",recipientExampleZh:"使用你配置好的机器人或企业微信目标",fields:[{key:"webhook_key",label:"Webhook Key",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",hint:"The key= value from webhook URL"}]},{id:"dingtalk",name:"DingTalk",icon:"\uD83D\uDD14",guide:"1. Group → Settings → Smart Assistant → Add Robot\n2. Select Custom (Webhook)\n3. Copy the full Webhook URL",purpose:"Push MindOS notifications into DingTalk groups.",purposeZh:"把 MindOS 通知发送到钉钉群。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured DingTalk robot target",recipientExampleZh:"使用你配置好的钉钉机器人目标",fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",hint:"Full URL including access_token"}]},{id:"wechat",name:"WeChat",icon:"\uD83D\uDC9A",guide:"1. Visit ilinkai.weixin.qq.com\n2. Register & create a bot application\n3. QR login in the console → copy Bot Token from dashboard",purpose:"Send MindOS updates to WeChat via your configured bot.",purposeZh:"通过你配置好的机器人把 MindOS 更新发送到微信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the WeChat user or chat ID supported by your bot",recipientExampleZh:"使用你的机器人支持的微信用户或群聊 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"wx_xxxxxxxxxxxxxxxx",hint:"From iLink Bot console after QR login"}]},{id:"qq",name:"QQ",icon:"\uD83D\uDC27",guide:"1. q.qq.com → Create Bot\n2. Development tab → copy App ID & Secret\n3. Add group/C2C intents as needed",purpose:"Deliver MindOS notifications through QQ bot channels.",purposeZh:"通过 QQ 机器人频道接收 MindOS 通知。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the QQ openid or group_openid for your target",recipientExampleZh:"使用目标 QQ 的 openid 或 group_openid",fields:[{key:"app_id",label:"App ID",placeholder:"102xxxxxx"},{key:"app_secret",label:"App Secret",placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx"}]}];function e(a){return d.find(b=>b.id===a)}},36161:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is 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/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},38957:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>n,bA:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(22341),h=c(6079),i=c(42742),j=c(44218),k=c(47223);function l(){return"agent"}let m=["agent","chat"];function n({mode:a,onChange:b,disabled:c}){let{t:l}=(0,k.Y)(),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(null),s=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!r.current)return;let a=r.current.getBoundingClientRect(),b=a.top,c=b>window.innerHeight-a.bottom&&b>120?"up":"down";q({left:a.left,top:"up"===c?a.top-6:a.bottom+6,direction:c})},[]);let t=(0,e.useCallback)(a=>{b(a);try{localStorage.setItem("mindos-ask-mode",a)}catch{}o(!1)},[b]),u="chat"===a,v=(a,b)=>"chat"===a?(0,d.jsx)(g.A,{size:b,className:"shrink-0"}):(0,d.jsx)(h.A,{size:b,className:"shrink-0"}),w=a=>"chat"===a?l.ask.modeChat:l.ask.modeAgent,x=a=>"chat"===a?l.ask.modeChatHint:l.ask.modeAgentHint,y=n&&p?(0,d.jsx)("div",{ref:s,role:"listbox","aria-label":"Select mode",className:"fixed z-50 min-w-[200px] max-w-[260px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:p.left,..."up"===p.direction?{bottom:window.innerHeight-p.top}:{top:p.top}},children:m.map(b=>{let c=a===b;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>t(b),className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:v(b,13)}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"font-medium",children:w(b)}),(0,d.jsx)("div",{className:"text-2xs text-muted-foreground mt-0.5",children:x(b)})]}),c&&(0,d.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"})]},b)})}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:r,type:"button",onClick:()=>{c||o(a=>!a)},disabled:c,className:`
48
48
  inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
49
49
  text-2xs font-medium transition-colors select-none
50
50
  border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
51
51
  disabled:opacity-40 disabled:cursor-not-allowed
52
52
  ${u?"bg-muted/50 border-border/50 text-muted-foreground hover:bg-muted hover:text-foreground":"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-foreground hover:bg-[var(--amber)]/15"}
53
- `,title:x(a),"aria-expanded":n,"aria-haspopup":"listbox",children:[v(a,11),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:w(a)}),(0,d.jsx)(j.A,{size:10,className:"shrink-0 text-muted-foreground"})]}),"u">typeof document&&y&&(0,f.createPortal)(y,document.body)]})}},39219:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/UpdateToast.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/app/components/UpdateToast.tsx","default")},39624:(a,b,c)=>{"use strict";function d(){return[]}function e(a){}function f(a){let b=[];b.unshift(a);let c=b.slice(0,50);return e(c),c}function g(a,b){let c=[],d=c.findIndex(b=>b.id===a);return d>=0&&(c[d]={...c[d],...b},e(c)),c}function h(){}c.d(b,{D4:()=>f,FB:()=>d,W8:()=>g,g4:()=>h,jQ:()=>j});let i=0;function j(){return`org-${Date.now()}-${++i}`}},39868:(a,b,c)=>{"use strict";async function d(a){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(a),!0}catch{}try{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();let c=document.execCommand("copy");return document.body.removeChild(b),c}catch{return!1}}c.d(b,{l:()=>d})},41297:(a,b,c)=>{"use strict";c.d(b,{l:()=>h});var d=c(67484);let e=new Set([".txt",".md",".markdown",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf"]);function f(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}async function g(a){let b=a.name;try{let c=await a.arrayBuffer(),d=function(a){let b="";for(let c=0;c<a.length;c+=32768)b+=String.fromCharCode(...a.subarray(c,c+32768));return btoa(b)}(new Uint8Array(c)),e=await fetch("/api/extract-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,dataBase64:d})}),f={};try{f=await e.json()}catch{throw Error("Failed to parse extraction response")}if(!e.ok)throw Error(f.error||`PDF extraction failed (${e.status})`);if("error"===f.extracted)return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:f.extractionError||"PDF extraction failed (unable to parse PDF)"};let g="success"===f.extracted&&f.text||"";if(!g)return{name:b,content:`[PDF: ${b}] Could not extract readable text (possibly scanned/image PDF).`,status:"error",error:"No extractable text found — PDF may be scanned, image-only, or have no text content"};let h={name:b,content:`[PDF TEXT EXTRACTED: ${b}]
53
+ `,title:x(a),"aria-expanded":n,"aria-haspopup":"listbox",children:[v(a,11),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:w(a)}),(0,d.jsx)(j.A,{size:10,className:"shrink-0 text-muted-foreground"})]}),"u">typeof document&&y&&(0,f.createPortal)(y,document.body)]})}},39139:(a,b,c)=>{"use strict";c.d(b,{SQ:()=>D,Ld:()=>B,iP:()=>A,Ay:()=>E});var d=c(48249),e=c(67484),f=c(19099),g=c(24520),h=c(80600),i=c(86718),j=c(7817),k=c(84699),l=c(12417),m=c(24703),n=c(28330),o=c(96286),p=c(59347),q=c(41479),r=c(61075),s=c(60407),t=c(9311),u=c(4140),v=c(2548),w=c(47223),x=c(99829);x.callServer,x.findSourceMapURL;var y=c(1108);let z=()=>{},A=y.qQ,B=y.Dp.MIN,C=y.Dp.MAX_RATIO,D=y.Dp.MAX_ABS;function E({activePanel:a,fileTree:b,onNavigate:c,onOpenSyncSettings:x,railWidth:y=48,panelWidth:E,onWidthChange:F,onWidthCommit:G,maximized:H=!1,onMaximize:I,onImport:J,children:K}){let L=a?A[a]:280,M=H?void 0:E??L,{t:N}=(0,w.Y)(),O=(0,f.useRouter)(),P=(0,f.usePathname)(),Q="/view/Inbox"===P||"/view/Inbox/"===P,[R,S]=(0,e.useState)(null),T=(0,e.useMemo)(()=>(function a(b,c=0){let d=c;for(let e of b)"directory"===e.type&&(d=Math.max(d,a(e.children??[],c+1)));return d})(b),[b]),[U,V]=(0,e.useState)(!1),W=(0,e.useRef)(null),X=(0,e.useRef)(null),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(null),_=(0,e.useRef)(null),aa=(0,s.gL)(),[ab,ac]=(0,e.useState)(0),[ad,ae]=(0,e.useState)(0),[af,ag]=(0,e.useState)(!1),ah=(0,e.useCallback)(()=>{if(!af){ag(!0);try{localStorage.setItem("mindos-tree-dblclick-hint","1")}catch{}}},[af]),ai=(0,v._)({width:E??L,minWidth:B,maxWidth:D,maxWidthRatio:C,direction:"right",disabled:H,onResize:F??z,onResizeEnd:G??z});return(0,d.jsxs)("aside",{className:`
54
+ hidden md:flex fixed top-0 h-screen z-30
55
+ flex-col bg-card border-r border-border
56
+ transition-[transform,left,width] duration-200 ease-out
57
+ ${null!==a?"translate-x-0":"-translate-x-full pointer-events-none"}
58
+ `,style:{width:H?`calc(100vw - ${y}px)`:`${M}px`,left:`${y}px`},role:"region","aria-label":a?`${a} panel`:void 0,children:[(0,d.jsxs)("div",{className:`flex flex-col h-full ${"files"===a?"":"hidden"}`,children:[(0,d.jsx)(u.A,{title:N.sidebar.files,children:(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:W,type:"button",onClick:()=>{Z(!1),V(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.new,title:N.sidebar.new,children:(0,d.jsx)(g.A,{size:13})}),U&&(0,d.jsxs)("div",{ref:X,className:"absolute top-full right-0 mt-1 min-w-[152px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{V(!1),O.push("/view/Untitled.md")},children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0"}),N.sidebar.newFile]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{V(!1),window.dispatchEvent(new Event("mindos:create-space"))},children:[(0,d.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),N.sidebar.newSpace]})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>J?.(),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.importFile,title:N.sidebar.importFile,children:(0,d.jsx)(j.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsx)("button",{onClick:()=>S(a=>Math.max(-1,(a??T)-1)),onDoubleClick:()=>{S(-1),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.collapseLevel,title:af?N.sidebar.collapseLevel:N.sidebar.collapseLevelHint??N.sidebar.collapseLevel,children:(0,d.jsx)(k.A,{size:13})}),(0,d.jsx)("button",{onClick:()=>S(a=>{let b=(a??0)+1;return b>T?null:b}),onDoubleClick:()=>{S(null),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.expandLevel,title:af?N.sidebar.expandLevel:N.sidebar.expandLevelHint??N.sidebar.expandLevel,children:(0,d.jsx)(l.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:$,type:"button",onClick:()=>{V(!1),Z(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.more,title:N.sidebar.more,children:(0,d.jsx)(m.A,{size:13})}),Y&&(0,d.jsxs)("div",{ref:_,className:"absolute top-full right-0 mt-1 min-w-[172px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/view/Inbox/")},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:"text-2xs font-medium tabular-nums px-1.5 py-px rounded-full bg-[var(--amber)]/10 text-[var(--amber)]/70",children:ad})]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/view/.mindos/change-log.json")},children:[(0,d.jsx)(o.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.changes.title})]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/trash")},children:[(0,d.jsx)(p.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.trash.title}),ab>0&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:ab})]}),(0,d.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{(0,s.Fo)(!aa)},children:[aa?(0,d.jsx)(q.A,{size:14,className:"shrink-0"}):(0,d.jsx)(r.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.showHiddenFiles}),aa&&(0,d.jsx)("span",{className:"text-[var(--amber)] text-xs",children:"✓"})]})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&a.stopPropagation()},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},onDrop:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},children:(0,d.jsx)(s.Ay,{nodes:b,onNavigate:c,maxOpenDepth:R,onImport:J})}),(0,d.jsxs)("button",{type:"button",onClick:()=>O.push("/view/Inbox/"),className:`flex items-center gap-2 mx-2 px-2 py-1.5 text-sm rounded-lg transition-all duration-150 group shrink-0 ${Q?"bg-[var(--amber-dim)] text-[var(--amber)]":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("div",{className:`flex items-center justify-center w-5 h-5 rounded-md shrink-0 transition-colors ${Q?"bg-[var(--amber)]/15":"bg-transparent"}`,children:(0,d.jsx)(n.A,{size:13,className:`shrink-0 transition-colors ${Q?"text-[var(--amber)]":"text-[var(--amber)]/60 group-hover:text-[var(--amber)]"}`})}),(0,d.jsx)("span",{className:`flex-1 text-left text-xs transition-colors ${Q?"font-medium text-[var(--amber)]":"text-muted-foreground group-hover:text-foreground"}`,children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:`text-2xs font-medium tabular-nums px-1.5 py-px rounded-full transition-colors ${Q?"bg-[var(--amber)]/15 text-[var(--amber)]":"bg-[var(--amber)]/10 text-[var(--amber)]/70"}`,children:ad})]}),(0,d.jsx)(t.Ay,{collapsed:!1,onOpenSyncSettings:x})]}),K,!H&&F&&(0,d.jsx)("div",{className:"absolute top-0 -right-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:ai,children:(0,d.jsx)("div",{className:"absolute right-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/60 transition-opacity"})})]})}},39219:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/UpdateToast.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/app/components/UpdateToast.tsx","default")},39624:(a,b,c)=>{"use strict";function d(){return[]}function e(a){}function f(a){let b=[];b.unshift(a);let c=b.slice(0,50);return e(c),c}function g(a,b){let c=[],d=c.findIndex(b=>b.id===a);return d>=0&&(c[d]={...c[d],...b},e(c)),c}function h(){}c.d(b,{D4:()=>f,FB:()=>d,W8:()=>g,g4:()=>h,jQ:()=>j});let i=0;function j(){return`org-${Date.now()}-${++i}`}},39868:(a,b,c)=>{"use strict";async function d(a){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(a),!0}catch{}try{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();let c=document.execCommand("copy");return document.body.removeChild(b),c}catch{return!1}}c.d(b,{l:()=>d})},39876:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(97621),g=c(42742),h=c(6079),i=c(46674),j=c(19099),k=c(47223),l=c(33191),m=c(99829);let n=(0,m.createServerReference)("70e1a503b87380112dacf7c10af6d96d79427f1c19",m.callServer,void 0,m.findSourceMapURL,"revertSpaceInitAction");function o(){let[a,b]=(0,e.useState)(null),[c,m]=(0,e.useState)(!1),[o,q]=(0,e.useTransition)(),r=(0,j.useRouter)(),{t:s}=(0,k.Y)(),t=(0,e.useCallback)(()=>{m(!1),setTimeout(()=>b(null),200)},[]);(0,e.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>m(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),r.refresh()):t()},[r,t]);let u=(0,e.useCallback)(()=>{a&&(t(),r.push(`/view/${(0,l.O0)(a.spacePath+"/")}`))},[a,t,r]),v=(0,e.useCallback)(()=>{a&&q(async()=>{await n(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),r.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(t,2e3)})},[a,r,t]),w=(0,e.useCallback)(()=>{t()},[t]);if(!a)return null;let x=s.home,{state:y}=a,z="done"===y,A="reverted"===y;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:z?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${A?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===y?"animate-pulse":""}`,children:A?(0,d.jsx)(f.A,{size:12}):z?(0,d.jsx)(g.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(h.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:A?x.aiInitReverted(a.spaceName):z?x.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[x.aiInitGenerating(a.spaceName),(0,d.jsx)(p,{})]})}),z&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:u,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:x.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:v,disabled:o,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:x.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:w,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(i.A,{size:12})})]})]})})}function p(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
59
+ @keyframes dotBounce {
60
+ 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
61
+ 30% { opacity: 1; transform: translateY(-2px); }
62
+ }
63
+ `})]})}},41297:(a,b,c)=>{"use strict";c.d(b,{l:()=>h});var d=c(67484);let e=new Set([".txt",".md",".markdown",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf"]);function f(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}async function g(a){let b=a.name;try{let c=await a.arrayBuffer(),d=function(a){let b="";for(let c=0;c<a.length;c+=32768)b+=String.fromCharCode(...a.subarray(c,c+32768));return btoa(b)}(new Uint8Array(c)),e=await fetch("/api/extract-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,dataBase64:d})}),f={};try{f=await e.json()}catch{throw Error("Failed to parse extraction response")}if(!e.ok)throw Error(f.error||`PDF extraction failed (${e.status})`);if("error"===f.extracted)return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:f.extractionError||"PDF extraction failed (unable to parse PDF)"};let g="success"===f.extracted&&f.text||"";if(!g)return{name:b,content:`[PDF: ${b}] Could not extract readable text (possibly scanned/image PDF).`,status:"error",error:"No extractable text found — PDF may be scanned, image-only, or have no text content"};let h={name:b,content:`[PDF TEXT EXTRACTED: ${b}]
54
64
 
55
65
  ${g}`,status:"success"};return f.truncated&&f.totalChars&&(h.truncatedInfo={totalChars:f.totalChars,includedChars:g.length,totalPages:f.pagesParsed??0}),h}catch(a){return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:a instanceof Error?a.message:"Unknown error"}}}function h(a){let[b,c]=(0,d.useState)([]),[h,i]=(0,d.useState)(""),j=(0,d.useRef)(null),k=(0,d.useRef)(a);k.current=a;let l=(0,d.useCallback)(async a=>{if(!a||0===a.length)return;let b=Array.from(a).slice(0,8),d=[],h=[];for(let a of b){let b=f(a.name);e.has(b)?d.push(a):h.push(a.name)}if(h.length>0){let a=k.current?.unsupportedType??"Unsupported file type";i(`${a}: ${h.join(", ")}`)}else i("");let j=[],l=[];for(let a of d)".pdf"===f(a.name)?(l.push({name:a.name,content:"",status:"loading"}),j.push(a)):l.push({name:a.name,content:await a.text(),status:"success"});if(c(a=>{let b=[...a];for(let a of l)b.some(b=>b.name===a.name)||b.push(a);return b}),j.length>0){let a=await Promise.all(j.map(g));c(b=>b.map(b=>"loading"!==b.status?b:a.find(a=>a.name===b.name)??b))}},[]),m=(0,d.useCallback)(a=>{c(b=>b.filter((b,c)=>c!==a))},[]);return{localAttachments:b,uploadError:h,uploadInputRef:j,pickFiles:l,removeAttachment:m,clearAttachments:(0,d.useCallback)(()=>{c([]),i("")},[]),injectFiles:(0,d.useCallback)(a=>{c(b=>{let c=[...b];for(let b of a)c.some(a=>a.name===b.name)||c.push(b);return c})},[])}}},41739:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(93017),h=c(42742),i=c(3129),j=c(12625),k=c(59347),l=c(96286),m=c(6079),n=c(44218),o=c(35389),p=c(45231),q=c(13481),r=c(92343),s=c(50514),t=c(46674),u=c(59867),v=c(47223),w=c(54461);let x=(0,e.memo)(function({isPanel:a,showHistory:b,onToggleHistory:c,onReset:x,isLoading:y,maximized:z,onMaximize:A,askMode:B,onModeSwitch:C,onClose:D,onDockToPanel:E,hideTitle:F,sessions:G,activeSessionId:H,onLoadSession:I,onDeleteSession:J,onRenameSession:K,onTogglePinSession:L,messages:M}){let{t:N}=(0,v.Y)(),O=G&&G.length>=2,P=G?.find(a=>a.id===H),Q=P?(0,w.d)(P):null,[R,S]=(0,e.useState)(!1),T=(0,e.useRef)(null),U=(0,e.useRef)(null),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(""),Z=(0,e.useRef)(null),$=(0,e.useCallback)(a=>{I?.(a),S(!1)},[I]),_=(0,e.useCallback)((a,b)=>{W(a),Y("(empty session)"===b?"":b)},[]),aa=(0,e.useCallback)(()=>{V&&K&&X.trim()&&K(V,X.trim()),W(null)},[V,X,K]),[ab,ac]=(0,e.useState)(null),ad=R&&ab&&G?(0,f.createPortal)((0,d.jsx)("div",{ref:U,className:"fixed z-50 rounded-xl border border-border/50 bg-card shadow-lg py-1 animate-in fade-in-0 slide-in-from-top-1 duration-100 max-h-[60vh] overflow-y-auto",style:{top:ab.top,left:ab.left,minWidth:Math.max(ab.width,280),maxWidth:340},role:"listbox",children:G.map(a=>{let b=a.id===H,c=(0,w.d)(a),e="(empty session)"===c?N.hints?.newChat??"New chat":c;return V===a.id?(0,d.jsx)("div",{className:"flex items-center gap-1 px-2 py-1.5",children:(0,d.jsx)("input",{ref:Z,type:"text",value:X,onChange:a=>Y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&aa(),"Escape"===a.key&&W(null)},onBlur:aa,className:"flex-1 min-w-0 px-2 py-1 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50",placeholder:"Session name..."})},a.id):(0,d.jsxs)("div",{className:"group/item flex items-center",children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>$(a.id),className:`flex-1 min-w-0 flex items-center gap-2 px-3 py-2.5 text-xs text-left transition-colors ${b?"text-foreground font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[a.pinned&&(0,d.jsx)(g.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),b&&!a.pinned&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"truncate",children:e})]}),(0,d.jsxs)("div",{className:"shrink-0 flex items-center gap-0.5 mr-1 opacity-0 group-hover/item:opacity-100 transition-opacity",children:[L&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),L(a.id)},className:`p-1.5 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground hover:bg-muted/60":"text-muted-foreground/40 hover:text-[var(--amber)] hover:bg-[var(--amber)]/5"}`,"aria-label":a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(i.A,{size:10}):(0,d.jsx)(g.A,{size:10})}),K&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),_(a.id,c)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60","aria-label":`Rename: ${e}`,children:(0,d.jsx)(j.A,{size:10})}),G.length>1&&J&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),J(a.id)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5","aria-label":`Delete: ${e}`,children:(0,d.jsx)(k.A,{size:10})})]})]},a.id)})}),document.body):null;return(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 shrink-0",children:[!a&&(0,d.jsx)("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 w-8 h-1 rounded-full bg-muted-foreground/20 md:hidden"}),!F&&(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("div",{className:"w-6 h-6 rounded-lg bg-[var(--amber)]/10 flex items-center justify-center shrink-0",children:b?(0,d.jsx)(l.A,{size:13,className:"text-[var(--amber)]"}):(0,d.jsx)(m.A,{size:13,className:"text-[var(--amber)]"})}),b?(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--amber)]",children:N.ask?.sessionHistory??"Session History"}):O&&Q?(0,d.jsxs)("button",{ref:T,type:"button",onClick:()=>{G&&G.length>=2?S(a=>!a):c()},className:"flex items-center gap-1 min-w-0 text-sm font-medium text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors","aria-expanded":R,"aria-haspopup":"listbox",children:[(0,d.jsx)("span",{className:"truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}),(0,d.jsx)(n.A,{size:12,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${R?"rotate-180":""}`})]}):Q?(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/60 truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}):(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/40",children:N.hints?.newChat??"New chat"})]}),F&&(0,d.jsx)("div",{}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),c()},"aria-pressed":b,className:`p-2 rounded-lg transition-colors ${b?"bg-[var(--amber)]/10 text-[var(--amber)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:N.hints.sessionHistory,children:(0,d.jsx)(l.A,{size:14})}),M&&M.length>0&&(0,d.jsx)(u.A,{messages:M,disabled:y}),(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),x()},disabled:y,className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors disabled:opacity-40",title:N.hints.newSession,children:(0,d.jsx)(o.A,{size:14})}),A&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),A()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:z?N.hints.restorePanel:N.hints.maximizePanel,children:z?(0,d.jsx)(p.A,{size:14}):(0,d.jsx)(q.A,{size:14})}),E&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),E()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.dockToSide??"Dock to side panel",children:(0,d.jsx)(r.A,{size:14})}),C&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),C()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"popup"===B?N.hints.dockToSide:N.hints.openAsPopup,children:"popup"===B?(0,d.jsx)(r.A,{size:14}):(0,d.jsx)(s.A,{size:14})}),D&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),D()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.closePanel,"aria-label":"Close",children:(0,d.jsx)(t.A,{size:14})})]}),"u">typeof document&&ad]})})},41829:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>D});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(82318),i=c(94703),j=c(11732),k=c(12625),l=c(15273),m=c(71465),n=c(95801),o=c(80600),p=c(65255),q=c(98631),r=c(66336),s=c(96286),t=c(56692),u=c(69924),v=c(10316),w=c(44218),x=c(19794),y=c(95054),z=c(47223),A=c(27608),B=c(91199);function C(){return(0,d.jsx)("div",{className:"rounded-lg border border-border bg-card overflow-hidden animate-pulse",children:(0,d.jsx)("div",{className:"px-4 py-3 space-y-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("div",{className:"w-4 h-4 bg-muted rounded mt-1"}),(0,d.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,d.jsx)("div",{className:"h-5 bg-muted rounded w-2/3"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded w-full"})]})]})})})}function D(a){let{t:b}=(0,z.Y)(),[c,f]=(0,e.useState)("all"),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)([]),[H,I]=(0,e.useState)({unreadCount:0,totalCount:0}),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(!0),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(async()=>{M(!0),O(null);try{let a=new URLSearchParams({op:"list",limit:"120"});"all"!==c&&a.set("source",c),D.trim()&&a.set("q",D.trim());let[b,d]=await Promise.all([(0,y.n)(`/api/changes?${a.toString()}`),(0,y.n)("/api/changes?op=summary")]);G(b.events),I(d)}catch(a){O(a instanceof Error?a.message:String(a))}finally{M(!1)}},[c,D]),S=(0,e.useCallback)(async()=>{await (0,y.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})}),await R()},[R]),T=(0,e.useMemo)(()=>[{value:"all",label:b.changes.filters.all},{value:"agent",label:b.changes.filters.agent},{value:"user",label:b.changes.filters.user},{value:"system",label:b.changes.filters.system}],[b]),U=(0,e.useCallback)(a=>"agent"===a?b.changes.filters.agent:"user"===a?b.changes.filters.user:b.changes.filters.system,[b]),V=(0,e.useCallback)(a=>b.changes.operations?.[a]??a,[b]);return(0,d.jsxs)("div",{style:{padding:"1.5rem 0"},children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-6",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.A,{size:20,className:"text-[var(--amber)]"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-foreground tracking-tight",children:b.changes.title}),(0,d.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:b.changes.subtitle})]})]}),(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-muted/60 text-muted-foreground text-xs font-medium",children:b.changes.eventsCount(F.length)}),H.unreadCount>0&&(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-[var(--amber)]/10 text-[var(--amber)] text-xs font-medium border border-[var(--amber)]/20",children:b.changes.unreadCount(H.unreadCount)})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>Q(a=>!a),className:`inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring ${P?"bg-[var(--amber)]/10 text-[var(--amber)]":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:b.changes.filters.source,children:(0,d.jsx)(t.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:()=>void R(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.refresh,children:(0,d.jsx)(u.A,{size:14})}),H.unreadCount>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.markAllRead,children:[(0,d.jsx)("span",{className:"hidden sm:inline",children:b.changes.markAllRead}),(0,d.jsx)("span",{className:"inline sm:hidden",children:"✓"})]})]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${P?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",children:(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-4 mb-4",children:(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.source}),(0,d.jsx)(A.A,{value:c,onChange:a=>f(a),options:T})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.keyword}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(v.A,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{value:D,onChange:a=>E(a.target.value),placeholder:b.changes.filters.keywordPlaceholder,className:"w-full pl-9 pr-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:ring-1 focus-visible:ring-ring hover:border-border/80 transition-all"})]})]})]})})})}),L&&(0,d.jsxs)("div",{className:"space-y-2.5",children:[(0,d.jsx)(C,{}),(0,d.jsx)(C,{}),(0,d.jsx)(C,{})]}),!L&&N&&(0,d.jsxs)("div",{className:"rounded-lg border border-error/20 bg-error/5 p-4 text-sm text-error",children:[N,(0,d.jsx)("button",{onClick:()=>void R(),className:"ml-2 underline hover:no-underline font-medium",children:b.changes.refresh})]}),!L&&!N&&0===F.length&&(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-8 md:p-12",children:(0,d.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,d.jsx)("div",{className:"mb-4 p-4 bg-muted/50 rounded-lg",children:(0,d.jsx)(o.A,{size:28,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-base font-semibold text-foreground mb-1",children:b.changes.empty}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm",children:b.changes.emptyHint})]})}),!L&&!N&&F.length>0&&(0,d.jsx)("div",{className:"space-y-2",children:F.map(a=>{var c,e,f,s;let t,u,v=!!J[a.id],y=(0,B.m)(a.before??"",a.after??""),z=(0,B.S)(y),A=y.filter(a=>"insert"===a.type).length,C=y.filter(a=>"delete"===a.type).length;return(0,d.jsxs)("div",{className:"group rounded-lg border border-border/60 bg-card/70 overflow-hidden transition-all duration-150 hover:border-border hover:bg-card hover:shadow-sm",children:[(0,d.jsx)("button",{type:"button",onClick:()=>K(b=>({...b,[a.id]:!b[a.id]})),className:"w-full px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-muted/20 transition-all",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsxs)("div",{className:"pt-0.5 text-muted-foreground/60 shrink-0 relative",children:[v&&(0,d.jsx)("div",{className:"absolute -left-4 top-0 bottom-0 w-[2px] rounded-r-full bg-[var(--amber)]"}),v?(0,d.jsx)(w.A,{size:15}):(0,d.jsx)(x.A,{size:15})]}),(0,d.jsx)("div",{className:"w-7 h-7 rounded-md bg-muted/50 flex items-center justify-center shrink-0 text-muted-foreground group-hover:bg-muted transition-all",children:"create_file"===(c=a.op)||"create_space"===c?(0,d.jsx)(h.A,{size:14}):"delete_file"===c?(0,d.jsx)(i.A,{size:14}):"update_lines"===c||"update_section"===c?(0,d.jsx)(j.A,{size:14}):"insert_lines"===c||"insert_after_heading"===c?(0,d.jsx)(k.A,{size:14}):"append_to_file"===c||"append_csv"===c?(0,d.jsx)(l.A,{size:14}):"rename_file"===c||"rename_space"===c||"move_file"===c?(0,d.jsx)(m.A,{size:14}):"import_file"===c?(0,d.jsx)(n.A,{size:14}):(0,d.jsx)(o.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:function(a,b){let c=b.changes.summaries;if("Updated file content"===a)return c.updatedFileContent;if("Appended content to file"===a)return c.appendedContent;if("Moved to trash"===a)return c.movedToTrash;if("Created file"===a)return c.createdFile;if("Created space"===a)return c.createdSpace;if("Imported file into knowledge base"===a)return c.importedFile;let d=a.match(/^Inserted (\d+) line\(s\)$/);if(d)return c.insertedLines(Number(d[1]));let e=a.match(/^Updated lines (\d+)-(\d+)$/);if(e)return c.updatedLines(Number(e[1]),Number(e[2]));let f=a.match(/^Inserted content after heading "(.+)"$/);if(f)return c.insertedAfterHeading(f[1]);let g=a.match(/^Updated section "(.+)"$/);if(g)return c.updatedSection(g[1]);let h=a.match(/^Renamed file to (.+)$/);if(h)return c.renamedFile(h[1]);let i=a.match(/^Moved file to (.+)$/);if(i)return c.movedFile(i[1]);let j=a.match(/^Renamed space to (.+)$/);if(j)return c.renamedSpace(j[1]);let k=a.match(/^Appended CSV row \((\d+) cells?\)$/);return k?c.appendedCsvRow(Number(k[1])):a.startsWith("Imported legacy agent diff")?c.importedLegacyDiff:a}(a.summary,b)}),(A>0||C>0)&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground/70",children:[A>0&&(0,d.jsxs)("span",{className:"text-success font-semibold",children:["+",A]}),A>0&&C>0&&(0,d.jsx)("span",{className:"mx-0.5",children:"\xb7"}),C>0&&(0,d.jsxs)("span",{className:"text-error font-semibold",children:["-",C]})]})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{className:"rounded-md px-2 py-0.5 bg-[var(--amber-dim)] text-[var(--amber)] text-xs font-medium truncate inline-block max-w-[200px]",title:a.path,children:a.path}),(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium ${"agent"===(e=a.source)?"bg-[var(--info)]/10 text-[var(--info)] border border-[var(--info)]/20":"user"===e?"bg-[var(--success)]/10 text-[var(--success)] border border-[var(--success)]/20":"bg-muted text-muted-foreground border border-border"} transition-colors`,children:["agent"===(f=a.source)?(0,d.jsx)(p.A,{size:13}):"user"===f?(0,d.jsx)(q.A,{size:13}):(0,d.jsx)(r.A,{size:13}),U(a.source)]}),(0,d.jsx)("span",{className:`text-xs font-medium ${(s=a.op).startsWith("create")||"import_file"===s?"text-success":s.startsWith("delete")?"text-error":s.startsWith("rename")||s.startsWith("move")?"text-muted-foreground":""}`,children:V(a.op)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-auto shrink-0",children:function(a,b){let c=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(c<1)return b.changes.relativeTime.justNow;if(c<60)return b.changes.relativeTime.minutesAgo(c);let d=Math.floor(c/60);return d<24?b.changes.relativeTime.hoursAgo(d):b.changes.relativeTime.daysAgo(Math.floor(d/24))}(a.ts,b)})]})]}),(0,d.jsx)(g(),{href:`/view/${a.path.split("/").map(encodeURIComponent).join("/")}`,className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-[var(--amber)]/10 text-[var(--amber)] hover:bg-[var(--amber)] hover:text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring transition-all duration-150 shrink-0",onClick:a=>a.stopPropagation(),title:b.changes.open,children:b.changes.open})]})}),v&&(t=1,u=1,(0,d.jsx)("div",{className:"border-t border-border/50 bg-background/60 max-h-80 overflow-y-auto",children:z.map((c,e)=>{if("gap"===c.type)return t+=c.count,u+=c.count,(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground/50 border-y border-border/30 bg-muted/10 text-center font-medium",children:b.changes.unchangedLines(c.count)},`${a.id}-gap-${e}`);let f="insert"===c.type?"+":"delete"===c.type?"-":" ",g="insert"!==c.type?t:"",h="delete"!==c.type?u:"";return"insert"!==c.type&&t++,"delete"!==c.type&&u++,(0,d.jsxs)("div",{className:`flex items-start text-xs font-mono leading-6 px-4 ${"insert"===c.type?"bg-success/5 hover:bg-success/8":"delete"===c.type?"bg-error/5 hover:bg-error/8":"hover:bg-muted/20"} transition-colors`,children:[(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:g}),(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:h}),(0,d.jsx)("span",{className:`w-3 shrink-0 text-center select-none font-bold ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground/20"}`,children:f}),(0,d.jsx)("span",{className:`flex-1 whitespace-pre-wrap break-all overflow-hidden ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground"}`,children:c.text||"\xa0"})]},`${a.id}-${e}`)})}))]},a.id)})})]})}},42529:(a,b,c)=>{"use strict";c.d(b,{A:()=>p});var d=c(48249),e=c(67484),f=c(10316),g=c(46674),h=c(35389),i=c(22341),j=c(59347),k=c(93017),l=c(3129),m=c(12625),n=c(54461),o=c(47223);function p({sessions:a,activeSessionId:b,onLoad:c,onDelete:k,onRename:l,onTogglePin:m,onClearAll:p,onClose:r,onNewChat:s}){let{t}=(0,o.Y)(),u=t.ask,[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(!1),D=(0,e.useRef)(void 0),E=(0,e.useRef)(null),F=(0,e.useRef)(null),G=(0,e.useMemo)(()=>{if(!v.trim())return a;let b=v.toLowerCase();return a.filter(a=>!!(0,n.d)(a).toLowerCase().includes(b)||a.messages.some(a=>a.content.toLowerCase().includes(b)))},[a,v]),H=(0,e.useMemo)(()=>{let a=[],b=[],c=[],d=[],e=[];for(let f of G){if(f.pinned){a.push(f);continue}let g=function(a){let b=new Date,c=new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime(),d=c-864e5*b.getDay();return a>=c?"today":a>=c-864e5?"yesterday":a>=d?"week":"older"}(f.updatedAt);"today"===g?b.push(f):"yesterday"===g?c.push(f):"week"===g?d.push(f):e.push(f)}return{pinned:a,today:b,yesterday:c,week:d,older:e}},[G]),I=a.filter(a=>a.pinned).length,J=a.filter(a=>a.messages.length>0).length,K=(0,e.useCallback)(a=>{c(a),r()},[c,r]),L=(0,e.useCallback)(()=>{s(),r()},[s,r]),M=(0,e.useCallback)(a=>{y(a.id),A((0,n.d)(a))},[]),N=(0,e.useCallback)(()=>{x&&z.trim()&&l(x,z.trim()),y(null)},[x,z,l]),O=(0,e.useCallback)(()=>{if(!B){C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>C(!1),3e3);return}D.current&&clearTimeout(D.current),p(),C(!1)},[B,p]),P=(a,c)=>0===c.length?null:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-2xs font-medium text-muted-foreground/50 uppercase tracking-wider px-1 py-2",children:a}),(0,d.jsx)("div",{className:"flex flex-col gap-1",children:c.map(a=>(0,d.jsx)(q,{session:a,isActive:a.id===b,editing:x===a.id,editValue:z,onEditValueChange:A,inputRef:F,onLoad:()=>K(a.id),onStartRename:()=>M(a),onCommitRename:N,onCancelRename:()=>y(null),onDelete:()=>k(a.id),onTogglePin:()=>m(a.id),ask:u},a.id))})]},a),Q=G.length>0;return(0,d.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 animate-in fade-in-0 duration-150",children:[(0,d.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(f.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{ref:E,type:"text",value:v,onChange:a=>w(a.target.value),placeholder:u?.historySearch??"Search conversations...",className:"w-full pl-8 pr-8 py-2 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:border-[var(--amber)]/40 transition-colors"}),v&&(0,d.jsx)("button",{type:"button",onClick:()=>w(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded text-muted-foreground/40 hover:text-foreground",children:(0,d.jsx)(g.A,{size:12})})]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2 shrink-0",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[u?.historyStats?.(J)??`${J} conversations`,I>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",I," ",u?.historyPinned??"pinned"]})]}),(0,d.jsxs)("button",{type:"button",onClick:L,className:"flex items-center gap-1 text-2xs text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors",children:[(0,d.jsx)(h.A,{size:11}),(0,d.jsx)("span",{children:t.hints?.newChat??"New chat"})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-3 pb-3",children:Q?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[P(u?.historyPinned??"Pinned",H.pinned),P(u?.historyToday??"Today",H.today),P(u?.historyYesterday??"Yesterday",H.yesterday),P(u?.historyThisWeek??"This week",H.week),P(u?.historyOlder??"Older",H.older)]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,d.jsx)(i.A,{size:32,className:"text-muted-foreground/20 mb-3"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/60",children:v?"No matching conversations":u?.historyEmpty??"No conversations yet"}),!v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mt-1",children:u?.historyEmptyHint??"Start a new chat to begin"})]})}),J>0&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border/40 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:O,className:`text-2xs px-2 py-0.5 rounded-md transition-colors ${B?"bg-error/10 text-error font-medium":"text-muted-foreground/50 hover:text-error hover:bg-muted"}`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(j.A,{size:10}),B?u?.confirmClear??"Confirm clear?":u?.clearAll??"Clear all"]})}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums",children:u?.historyCapacity?.(J)??`${J} of 30`})]})]})}function q({session:a,isActive:b,editing:c,editValue:e,onEditValueChange:f,inputRef:g,onLoad:h,onStartRename:o,onCommitRename:p,onCancelRename:q,onDelete:r,onTogglePin:s,ask:t}){let u=(0,n.d)(a),v=function(a){let b=a.messages.find(a=>"user"===a.role);if(!b)return"";let c=b.content.replace(/\s+/g," ").trim();return c.length>60?`${c.slice(0,60)}...`:c}(a),w=a.messages.length;return(0,d.jsxs)("div",{className:`group relative rounded-lg transition-colors cursor-pointer ${b?"bg-[var(--amber)]/8 border border-[var(--amber)]/15":"hover:bg-muted/60 border border-transparent"}`,onClick:h,children:[b&&(0,d.jsx)("span",{className:"absolute left-0 top-3 bottom-3 w-[2px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsxs)("div",{className:"px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.pinned&&(0,d.jsx)(k.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),c?(0,d.jsx)("input",{ref:g,type:"text",value:e,onChange:a=>f(a.target.value),onBlur:p,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),p()),"Escape"===a.key&&(a.preventDefault(),q())},onClick:a=>a.stopPropagation(),className:"flex-1 min-w-0 bg-transparent border-b border-[var(--amber)] outline-none text-xs font-medium text-foreground"}):(0,d.jsx)("span",{className:"flex-1 min-w-0 text-xs font-medium text-foreground truncate",children:u}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 shrink-0 tabular-nums",children:function(a){let b=Math.floor((Date.now()-a.getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return d<7?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric"})}(new Date(a.updatedAt))})]}),!c&&v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/50 truncate mt-0.5 pl-0.5",children:v}),!c&&(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/40 flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:9}),t?.historyMsgs?.(w)??`${w} msgs`]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:s,className:`p-1 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground":"text-muted-foreground/40 hover:text-[var(--amber)]"}`,title:a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(l.A,{size:11}):(0,d.jsx)(k.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:o,className:"p-1 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60 transition-colors",title:t?.renameSession??"Rename",children:(0,d.jsx)(m.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:r,className:"p-1 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5 transition-colors",title:"Delete",children:(0,d.jsx)(j.A,{size:11})})]})]})]})]})}},43248:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{style:{margin:0,fontFamily:"'IBM Plex Sans', system-ui, sans-serif",background:"#131210",color:"#e8e4dc"},children:(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",gap:"16px",padding:"24px",textAlign:"center"},children:[(0,d.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,margin:0},children:"Something went wrong"}),(0,d.jsx)("p",{style:{fontSize:"14px",color:"#8a8275",maxWidth:"400px",margin:0},children:a.message||"An unexpected error occurred. Please try again."}),(0,d.jsxs)("div",{style:{display:"flex",gap:"12px",marginTop:"8px"},children:[(0,d.jsx)("button",{onClick:b,style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#1c1a17",color:"#e8e4dc",border:"1px solid rgba(232,228,220,0.08)",cursor:"pointer"},children:"Try again"}),(0,d.jsx)("a",{href:"/setup",style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#c8873a",color:"#fff",textDecoration:"none",cursor:"pointer"},children:"Go to Setup"})]})]})})})}},43951:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ChangeLogRenderer() from the server but ChangeLogRenderer is 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/app/components/renderers/change-log/ChangeLogRenderer.tsx","ChangeLogRenderer")},45108:(a,b,c)=>{"use strict";c.d(b,{u:()=>h});var d=c(67484);let e=new Set(["image/png","image/jpeg","image/gif","image/webp"]);async function f(a){let b=a.type;if(a.size<=5242880){let c=new Uint8Array(await a.arrayBuffer()),d="";for(let a=0;a<c.length;a+=32768)d+=String.fromCharCode(...c.subarray(a,a+32768));return{data:btoa(d),mimeType:b}}return new Promise((b,c)=>{let d=new Image,e=URL.createObjectURL(a);d.onload=()=>{let{width:a,height:f}=d;if(a>1920||f>1920){let b=Math.min(1920/a,1920/f);a=Math.round(a*b),f=Math.round(f*b)}let g=document.createElement("canvas");g.width=a,g.height=f;let h=g.getContext("2d");if(!h){URL.revokeObjectURL(e),c(Error("Canvas not supported"));return}h.drawImage(d,0,0,a,f);let i=g.toDataURL("image/jpeg",.85).split(",")[1];URL.revokeObjectURL(e),b({data:i,mimeType:"image/jpeg"})},d.onerror=()=>{URL.revokeObjectURL(e),c(Error("Failed to load image"))},d.src=e})}function g(a){let b=[];for(let c of Array.from(a))if("file"===c.kind&&e.has(c.type)){let a=c.getAsFile();a&&b.push(a)}return b}function h(){let[a,b]=(0,d.useState)([]),[c,h]=(0,d.useState)(""),i=(0,d.useCallback)(async a=>{h("");let c=a.slice(0,4),d=[];for(let a of c){var g;if(g=a.type,!e.has(g)){h(`Unsupported image type: ${a.type}`);continue}try{let{data:b,mimeType:c}=await f(a);d.push({type:"image",data:b,mimeType:c,fileName:a.name||void 0})}catch{h(`Failed to process image: ${a.name}`)}}b(a=>{let b=[...a,...d];return b.length>4?(h("Maximum 4 images allowed"),b.slice(0,4)):b})},[]),j=(0,d.useCallback)(async a=>{let b=a.clipboardData?.items;if(!b)return!1;let c=g(b);return 0!==c.length&&(await i(c),!0)},[i]),k=(0,d.useCallback)(async a=>{let b=a.dataTransfer?.items;if(!b)return;let c=g(b);c.length>0&&(a.preventDefault(),await i(c))},[i]),l=(0,d.useCallback)(async a=>{if(!a)return;let b=Array.from(a).filter(a=>{var b;return b=a.type,e.has(b)});await i(b)},[i]);return{images:a,imageError:c,addImages:i,handlePaste:j,handleDrop:k,handleFileSelect:l,removeImage:(0,d.useCallback)(a=>{b(b=>b.filter((b,c)=>c!==a))},[]),clearImages:(0,d.useCallback)(()=>{b([]),h("")},[])}}},45862:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call SummaryRenderer() from the server but SummaryRenderer is 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/app/components/renderers/summary/SummaryRenderer.tsx","SummaryRenderer")},46427:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>D});var d=c(48249),e=c(67484),f=c.n(e),g=c(93053),h=c(75155),i=c(22242),j=c(91282),k=c(65732),l=c.n(k);function m(a,b){return l().unparse([a,...b])}let n=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"},{bg:"rgba(200,96,96,0.12)",text:"#c86060"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function o(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return n[b%n.length]}var p=c(82884),q=c(72419),r=c(44218),s=c(59347),t=c(24520);function u({value:a,onCommit:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(a),i=(0,e.useRef)(null);function j(){f(!1),g!==a?b(g):h(a)}return c?(0,d.jsx)("input",{ref:i,value:g,onChange:a=>h(a.target.value),onBlur:j,onKeyDown:b=>{"Enter"===b.key&&j(),"Escape"===b.key&&(h(a),f(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:a=>a.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,d.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>f(!0),title:a,children:a||(0,d.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function v({headers:a,visibleIndices:b,onAdd:c,onCancel:f}){let[g,h]=(0,e.useState)(()=>Array(a.length).fill(""));return(0,d.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[b.map((b,e)=>(0,d.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("input",{autoFocus:0===e,value:g[b],onChange:a=>{var c;return c=a.target.value,void h(a=>{let d=[...a];return d[b]=c,d})},onKeyDown:a=>{"Enter"===a.key&&c(g),"Escape"===a.key&&f()},placeholder:a[b],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},b)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function w({headers:a,rows:b,cfg:c,saveAction:g}){let[h,i]=(0,e.useState)(b),[j,k]=(0,e.useState)(!1),l=(0,e.useMemo)(()=>a.map((a,b)=>b).filter(b=>!c.hiddenFields.includes(a[b])),[a,c.hiddenFields]),n=a.indexOf(c.sortField),o=(0,e.useMemo)(()=>{let a=[...h];return n>=0&&a.sort((a,b)=>{let d=a[n]??"",e=b[n]??"",f=parseFloat(d),g=parseFloat(e),h=isNaN(f)||isNaN(g)?d.localeCompare(e):f-g;return"asc"===c.sortDir?h:-h}),a},[h,n,c.sortDir]),p=a.indexOf(c.groupField),w=(0,e.useMemo)(()=>{if(p<0)return[{key:null,rows:o.map(a=>({row:a,orig:a}))}];let a=new Map;for(let b of o){let c=b[p]||"(empty)";a.has(c)||a.set(c,[]),a.get(c).push(b)}return[...a.entries()].map(([a,b])=>({key:a,rows:b.map(a=>({row:a,orig:a}))}))},[o,p]);async function x(b,c,d){let e=h.map(a=>a===b?a.map((a,b)=>b===c?d:a):a);i(e),await g(m(a,e))}async function y(b){let c=h.filter(a=>a!==b);i(c),await g(m(a,c))}async function z(b){let c=[...h,b];i(c),k(!1),await g(m(a,c))}let A={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},B=0;return(0,d.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{background:"var(--muted)"},children:[l.map(b=>(0,d.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:A,children:(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[a[b],c.sortField===a[b]&&("asc"===c.sortDir?(0,d.jsx)(q.A,{size:10,style:{color:"var(--amber)"}}):(0,d.jsx)(r.A,{size:10,style:{color:"var(--amber)"}}))]})},b)),(0,d.jsx)("th",{className:"w-8",style:{...A,background:"var(--muted)"}})]})}),(0,d.jsxs)("tbody",{children:[w.map((a,b)=>(0,d.jsxs)(f().Fragment,{children:[null!==a.key&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:l.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,d.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[a.key," \xb7 ",a.rows.length]})})},`grp-${a.key}`),a.rows.map(({row:a,orig:b})=>{let c=B++;return(0,d.jsxs)("tr",{className:"group transition-colors",style:{background:c%2==0?"var(--background)":"var(--card)"},onMouseEnter:a=>a.currentTarget.style.background="var(--muted)",onMouseLeave:a=>a.currentTarget.style.background=c%2==0?"var(--background)":"var(--card)",children:[l.map(c=>(0,d.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)(u,{value:a[c]??"",onCommit:a=>x(b,c,a)})},c)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("button",{onClick:()=>y(b),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(s.A,{size:12})})})]},c)})]},a.key??`section-${b}`)),j&&(0,d.jsx)(v,{headers:a,visibleIndices:l,onAdd:z,onCancel:()=>k(!1)})]})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[h.length," rows \xb7 ",a.length," cols"]}),j?(0,d.jsx)("button",{onClick:()=>k(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,d.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,d.jsx)(t.A,{size:12})," Add row"]})]})]})}function x({headers:a,rows:b,cfg:c}){let e=a.indexOf(c.titleField),f=a.indexOf(c.descField),g=a.indexOf(c.tagField);return(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map((b,c)=>{let h=e>=0?b[e]:b[0]??"",i=f>=0?b[f]:"",j=g>=0?b[g]:"",k=j?o(j):null;return(0,d.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[j&&k&&(0,d.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:k.bg,color:k.text},children:j}),(0,d.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:h}),i&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:i}),(0,d.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:a.map((a,c)=>{if(c===e||c===f||c===g)return null;let h=b[c];return h?(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:a}),(0,d.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:h})]},c):null})})]},c)})})}function y({headers:a,rows:b,cfg:c,saveAction:f}){let[g,h]=(0,e.useState)(b),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(!1),q=a.indexOf(c.groupField),r=a.indexOf(c.titleField),s=a.indexOf(c.descField),{groups:u,groupKeys:v}=(0,e.useMemo)(()=>{let a=new Map;return g.forEach((b,c)=>{let d=(q>=0?b[q]:"")||"(empty)";a.has(d)||a.set(d,[]),a.get(d).push({row:b,origIdx:c})}),{groups:a,groupKeys:[...a.keys()]}},[g,q]);async function w(b,c){let d=g.map((a,d)=>{if(d!==b)return a;let e=[...a];return q>=0&&(e[q]=c),e});h(d),await f(m(a,d))}function x({group:b}){let c=u.get(b)??[],e=o(b),f=i===b;return(0,d.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:e.text}}),(0,d.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:e.text},children:b}),(0,d.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:c.length})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:f?"var(--amber-dim)":"var(--muted)",border:`1px solid ${f?"var(--amber)":"transparent"}`},onDragOver:a=>{a.preventDefault(),j(b)},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||j(null)},onDrop:a=>{j(null);let c=parseInt(a.dataTransfer.getData("origIdx"));isNaN(c)||w(c,b)},children:[c.map(({row:b,origIdx:c})=>{let e=r>=0?b[r]:b[0]??"",f=s>=0?b[s]:"";return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.setData("origIdx",String(c)),j(null)},onDragEnd:()=>j(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:e}),f&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:f}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:a.map((a,c)=>{if(c===q||c===r||c===s)return null;let e=b[c];return e?(0,d.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[a,": ",e]},c):null})})]},c)}),0===c.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,d.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[v.map(a=>(0,d.jsx)(x,{group:a},a)),(0,d.jsx)("div",{className:"flex-shrink-0 w-64",children:n?(0,d.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("input",{autoFocus:!0,value:k,onChange:a=>l(a.target.value),onKeyDown:a=>{"Enter"===a.key&&k.trim()&&(l(""),p(!1)),"Escape"===a.key&&(l(""),p(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,d.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,d.jsx)(t.A,{size:12})," Add column"]})})]})}var z=c(46674),A=c(27608);function B({headers:a,cfg:b,view:c,onClose:e,onChange:f}){let g={color:"var(--muted-foreground)",fontSize:"0.72rem"};function h({label:b,value:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-display",style:g,children:b}),(0,d.jsx)(A.A,{value:c,onChange:e,size:"sm",options:[{value:"",label:"— none —"},...a.map(a=>({value:a,label:a}))]})]})}return(0,d.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:[c," settings"]}),(0,d.jsx)("button",{onClick:e,style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(z.A,{size:13})})]}),"table"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Sort"}),(0,d.jsx)(h,{label:"Sort by",value:b.table.sortField,onChange:a=>f({...b,table:{...b.table,sortField:a}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{style:g,children:"Direction"}),(0,d.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(a=>(0,d.jsx)("button",{onClick:()=>f({...b,table:{...b.table,sortDir:a}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:b.table.sortDir===a?"var(--amber)":"var(--background)",color:b.table.sortDir===a?"var(--amber-foreground)":"var(--muted-foreground)"},children:a},a))})]}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Group"}),(0,d.jsx)(h,{label:"Group by",value:b.table.groupField,onChange:a=>f({...b,table:{...b.table,groupField:a}})}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Columns"}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(a=>{let c=b.table.hiddenFields.includes(a);return(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{style:g,children:a}),(0,d.jsx)("button",{onClick:()=>{let d=c?b.table.hiddenFields.filter(b=>b!==a):[...b.table.hiddenFields,a];f({...b,table:{...b.table,hiddenFields:d}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:c?"var(--muted)":"var(--amber-dim)",color:c?"var(--muted-foreground)":"var(--amber)"},children:c?"Hidden":"Visible"})]},a)})})]}),"gallery"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Title",value:b.gallery.titleField,onChange:a=>f({...b,gallery:{...b.gallery,titleField:a}})}),(0,d.jsx)(h,{label:"Description",value:b.gallery.descField,onChange:a=>f({...b,gallery:{...b.gallery,descField:a}})}),(0,d.jsx)(h,{label:"Tag / Badge",value:b.gallery.tagField,onChange:a=>f({...b,gallery:{...b.gallery,tagField:a}})})]}),"board"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Group by",value:b.board.groupField,onChange:a=>f({...b,board:{...b.board,groupField:a}})}),(0,d.jsx)(h,{label:"Card title",value:b.board.titleField,onChange:a=>f({...b,board:{...b.board,titleField:a}})}),(0,d.jsx)(h,{label:"Card desc",value:b.board.descField,onChange:a=>f({...b,board:{...b.board,descField:a}})})]})]})}let C=[{id:"table",icon:(0,d.jsx)(g.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,d.jsx)(h.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,d.jsx)(i.A,{size:13}),label:"Board"}];function D({filePath:a,content:b,saveAction:c}){let{headers:f,rows:g}=(0,e.useMemo)(()=>{let a;return{headers:(a=l().parse(b,{skipEmptyLines:!0}).data)[0]??[],rows:a.slice(1)}},[b]),h=(0,e.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:f[0]??"",descField:f[1]??"",tagField:f[2]??""},board:{groupField:f[f.length-1]??"",titleField:f[0]??"",descField:f[1]??""}}),[f]),[i,k]=(0,p.Un)("csv",a,h),[m,n]=(0,e.useState)(!1),o=(0,e.useCallback)(a=>{k(a)},[k]),q=i.activeView;return(0,d.jsxs)("div",{className:"w-full py-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,d.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:C.map(a=>(0,d.jsxs)("button",{onClick:()=>o({...i,activeView:a.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:q===a.id?"var(--card)":"transparent",color:q===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:q===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[a.icon,a.label]},a.id))}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[g.length," rows"]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,d.jsx)(j.A,{size:13})}),m&&(0,d.jsx)(B,{headers:f,cfg:i,view:q,onClose:()=>n(!1),onChange:o})]})]}),"table"===q&&(0,d.jsx)(w,{headers:f,rows:g,cfg:i.table,saveAction:c}),"gallery"===q&&(0,d.jsx)(x,{headers:f,rows:g,cfg:i.gallery}),"board"===q&&(0,d.jsx)(y,{headers:f,rows:g,cfg:i.board,saveAction:c})]})}},47223:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,Y:()=>g});var d=c(31417),e=c(52610);let f=(0,d.v)(a=>({locale:"en",t:e.D.en,setLocale:b=>{document.cookie=`locale=${b};path=/;max-age=31536000;SameSite=Lax`,document.documentElement.lang="zh"===b?"zh":"en",window.__mindos_locale__=b,a({locale:b,t:e.D[b]}),window.dispatchEvent(new Event("mindos-locale-change"))},_init:b=>{"en"!==f.getState().locale&&a({locale:"en",t:e.D.en});let c=()=>{a({locale:"en",t:e.D.en})};return window.addEventListener("mindos-locale-change",c),()=>window.removeEventListener("mindos-locale-change",c)}}));function g(){return f()}},47336:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ImageRenderer:()=>g});var d=c(48249),e=c(67484);let f=[.25,.5,.75,1,1.5,2,3,4];function g({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"image",g=c.split(".").pop()?.toLowerCase()??"",h=["png","svg","webp","ico","gif"].includes(g),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(0),[o,p]=(0,e.useState)("fit"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useCallback)(()=>{j(!1);let a=u.current;a&&r({w:a.naturalWidth,h:a.naturalHeight})},[]),x=(0,e.useCallback)(()=>{j(!1),l(!0)},[]),y=(0,e.useCallback)(()=>{l(!1),j(!0),n(a=>a+1)},[]),z=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return f.find(a=>a>b)??b})},[]),A=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return[...f].reverse().find(a=>a<b)??b})},[]),B=(0,e.useCallback)(()=>{p(a=>"fit"===a?1:"fit")},[]),C="fit"===o?"Fit":`${Math.round(100*o)}%`,D="fit"===o?{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"}:q?{width:q.w*o,height:"auto"}:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"};return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[q&&(0,d.jsxs)("span",{children:[q.w," x ",q.h]}),null!==s&&(0,d.jsx)("span",{children:s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:g})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{onClick:A,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom out (-)",children:"-"}),(0,d.jsx)("button",{onClick:B,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors min-w-[48px] text-center disabled:opacity-30",title:"fit"===o?"Actual size (1)":"Fit to view (0)",children:C}),(0,d.jsx)("button",{onClick:z,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom in (+)",children:"+"})]})]}),(0,d.jsxs)("div",{ref:v,tabIndex:-1,className:`relative flex-1 min-h-[70vh] overflow-auto flex items-center justify-center outline-none ${h?"bg-checkerboard":"bg-[var(--bg-secondary)]"}`,children:[i&&!k&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading..."})}),k&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load image"}),(0,d.jsx)("button",{onClick:y,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("img",{ref:u,src:b,alt:c,onLoad:w,onError:x,draggable:!1,className:"select-none",style:{display:k?"none":"block",...D}},m)]})]})}},49223:(a,b,c)=>{"use strict";c.d(b,{EI:()=>g,No:()=>e,R3:()=>h,_r:()=>f});let d={id:"mindos",name:"MindOS"};function e(a,b){let c=b??d;return{...a,agentId:c.id,agentName:c.name}}function f({sessionAgent:a,initialAgent:b}){return a??b??null}function g(a){return a.agentId&&a.agentName&&a.agentId!==d.id?{id:a.agentId,name:a.agentName}:null}function h(a,b){return{...a,defaultAcpAgent:b}}},49905:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{default:()=>i});var e=c(48249),f=c(19099),g=c(89119),h=a([g]);function i({fileTree:a,children:b}){let c=(0,f.usePathname)();return"/login"===c?(0,e.jsx)(e.Fragment,{children:b}):(0,e.jsx)(g.A,{fileTree:a,children:b})}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},51488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>m});var d=c(48249),e=c(67484),f=c(69924),g=c(6079),h=c(80600),i=c(13576),j=c(33191);function k(a){let b=Date.now()-a,c=Math.floor(b/6e4),d=Math.floor(b/36e5),e=Math.floor(b/864e5);return c<1?"just now":c<60?`${c}m ago`:d<24?`${d}h ago`:`${e}d ago`}function l(a){return a.split("/").pop()?.replace(/\.(md|csv)$/,"")??a}function m({filePath:a}){let[b,c]=(0,e.useState)([]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useMemo)(()=>m.replace(/^### (.+)$/gm,'<h3 style="font-size:.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:1em 0 .3em">$1</h3>').replace(/^## (.+)$/gm,'<h2 style="font-size:.9rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h2>').replace(/^# (.+)$/gm,'<h1 style="font-size:1rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h1>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:.82em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/^[-*] (.+)$/gm,'<li style="margin:.2em 0;padding-left:.3em">$1</li>').replace(/(<li[^>]*>.*<\/li>\n?)+/g,a=>`<ul style="margin:.4em 0;padding-left:1.4em;list-style:disc">${a}</ul>`).replace(/\n{2,}/g,'</p><p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">').replace(/^(?!<[hulo])(.+)$/gm,'<p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">$1</p>'),[m]);async function w(){if(0===b.length)return;u.current?.abort();let a=new AbortController;u.current=a,n(""),r(""),p(!0),t(!1);let c=b.map(a=>a.path),d=b.map(a=>`- **${l(a.path)}** (${a.path}, modified ${k(a.mtime)})`).join("\n"),e=`You are summarizing recent changes in a personal knowledge base (MindOS).
56
66
 
@@ -94,7 +104,7 @@ Do NOT just reply with a text summary. You must actually write to the knowledge
94
104
 
95
105
  Do NOT just reply with a text summary. You must actually write to the knowledge base.`},arrowTo:"→",remove:"Remove",aiRecommended:"Recommended",aiRecommendedHint:"Auto-matched by filename",conflictsFound:a=>`${a} file${1!==a?"s":""} already exist${1===a?"s":""}`,organizeTitle:"AI Organizing",organizeProcessing:"AI is analyzing and organizing your files...",organizeConnecting:"Connecting to AI...",organizeAnalyzing:"AI is analyzing your files...",organizeReading:a=>a?`Reading ${a}...`:"Reading files...",organizeThinking:"AI is thinking deeply...",organizeWriting:a=>a?`Writing ${a}...`:"Writing files...",organizeElapsed:a=>{let b=Math.floor(a/60);return`${b}:${(a%60).toString().padStart(2,"0")}`},organizeCancel:"Cancel",organizeMinimize:"Continue browsing",organizeExpand:"View",organizeCreating:a=>`Creating ${a}`,organizeUpdating:a=>`Updating ${a}`,organizeReviewTitle:"Organization Complete",organizeErrorTitle:"Organization Failed",organizeReviewDesc:a=>`AI organized your files into ${a} change${1!==a?"s":""}`,organizeCreated:"Created",organizeUpdated:"Updated",organizeFailed:"Failed",organizeNoChanges:"AI analyzed your files but made no changes.",organizeToolCallsInfo:a=>`AI executed ${a} operation${a>1?"s":""} — check knowledge base for updates`,organizeError:"Organization failed",organizeRetry:"Retry",organizeDone:"Done",organizeUndoAll:"Undo All",organizeUndoOne:"Undo",organizeUndone:"Undone",organizeViewFile:"View file",organizeUndoSuccess:a=>`Reverted ${a} file${1!==a?"s":""}`,organizeDetailTitle:"AI Organize Details",organizeSourceFiles:"Source Files",organizeSummaryLabel:"AI Summary",organizeChangesLabel:a=>`Changes (${a})`,organizeNoSummary:"AI is working...",organizeMinimizeModal:"Minimize"},importHistory:{title:"Import History",clearAll:"Clear history",clearConfirm:"Clear all history? This cannot be undone.",emptyTitle:"No import history yet",emptyDesc:"AI organize results will appear here",back:"← Back",sourceLabel:"Source",changesCount:(a,b)=>`${a}/${b} changes`,changesSummary:a=>`→ ${a} ${1===a?"change":"changes"}`,nFiles:a=>`${a} file${1===a?"":"s"}`,statusUndone:"undone",statusCreated:"created",statusUpdated:"updated",recordCount:a=>`${a} record${1!==a?"s":""}`,today:"Today",yesterday:"Yesterday",older:"Older",processedArchive:"Processed files are archived in Inbox/.processed/"},dirView:{gridView:"Grid view",listView:"List view",emptyFolder:"This folder is empty.",fileCount:a=>`${a} files`,newFile:"New file",uninitTitle:"Space not yet initialized",uninitDesc:"README.md and INSTRUCTION.md contain default templates. Configure an AI API key in Settings to auto-generate personalized content, or edit them manually.",uninitEditReadme:"Edit README",uninitEditInstruction:"Edit Instruction",uninitSettings:"Settings",overviewNoFiles:"No files to analyze yet.",overviewCta:"Generate Overview",overviewCtaHint:a=>`Scan ${a} file${1!==a?"s":""} to create a summary`,overviewCtaNoKey:"Configure an AI key in Settings first",overviewOrEdit:"or edit README.md manually",overviewGenerating:"Generating overview…",overviewScanningFiles:a=>`Scanning ${a} file${1!==a?"s":""}`,overviewRegenerate:"Regenerate overview with AI",overviewRegenerateLabel:"Refresh",overviewRegenerateConfirm:"This will scan changed files and refresh the overview, which uses AI credits.",overviewRegenerateCancel:"Cancel",overviewRegenerateStart:"Refresh Now",overviewUnchanged:"Overview is up to date — no files changed.",overviewLastCompiled:a=>`Last refreshed ${a}`,overviewIncremental:a=>`Updated from ${a} changed file${1!==a?"s":""}`,overviewError:"Could not generate overview",overviewRetry:"Retry"},view:{saveDirectory:"Directory",saveFileName:"File name",delete:"Delete",deleteConfirm:a=>`Delete "${a}"? It will be moved to Trash.`,cancel:"Cancel",rename:"Rename",copyPath:"Copy Path",more:"More",dismiss:"Dismiss",tocTitle:"On this page",tocCollapse:"Collapse",tocExpand:"Expand",emptyNote:"This note is empty. Press E to start writing.",switchToDoc:"Document view",switchToGraph:"Wiki Graph"},findInPage:{placeholder:"Find in document…",matchCount:(a,b)=>`${a} of ${b}`,noResults:"No results"},panels:{agents:{title:"Agents",connected:"connected",refresh:"Refresh agent status",retry:"Retry",failedToLoad:"Failed to load agents",mcpServer:"MCP Server",stopped:"Stopped",sectionConnected:"Connected",sectionDetected:"Detected",sectionNotDetected:"Not Detected",noAgents:"No agents detected.",autoRefresh:"Auto-refresh every 30s",connect:"Connect",installing:"Installing...",install:"Install",installSuccess:"Installed",installFailed:"Install failed",retryInstall:"Retry",copyConfig:"Copy Config",copied:"Copied!",transportLocal:"Local",transportRemote:"Remote",configPath:"Config path",noAuthWarning:"No auth token — set in Advanced Config",skillsTitle:"Skills",skillsActive:"active",builtinSkills:"Built-in",newSkill:"+ New",advancedConfig:"Advanced Config →",channels:"Channels",navOverview:"Overview",navMcp:"MCP",navSkills:"Skills",navChannels:"Channels",navNetwork:"Network",navSessions:"Sessions",navActivity:"Activity",activitySubtitle:"Agent operations audit log.",activity:{loading:"Loading activity...",empty:"No agent operations logged yet.",emptyHint:"Operations from connected agents will appear here.",agentLabel:"Agent"},a2aTabTitle:"Remote Agents",a2aTabEmpty:"No remote agents",a2aTabEmptyHint:"Discover agents to enable cross-agent delegation.",a2aRemoveAgent:"Remove",rosterLabel:"Your setup",notFoundDetail:"This agent app was not detected on this machine. Install it, then refresh the list.",skillsEmptyHint:"Enable and edit skills in MCP & Skills settings.",backToList:"Back",closeAgentDetail:"Close",agentDetailPanelAria:"Agent connection configuration",agentDetailTransport:"Transport",agentDetailSnippet:"Config snippet",a2aLabel:"A2A",a2aReady:"A2A Ready",a2aChecking:"Checking A2A...",a2aUnavailable:"A2A Unavailable",a2aRemote:"Remote",a2aDiscover:"Discover Remote Agent",a2aDiscoverHint:"Connect to an external A2A agent by URL",a2aDiscoverPlaceholder:"https://agent.example.com",a2aDiscovering:"Discovering...",a2aDiscoverSuccess:"Agent discovered!",a2aDiscoverFailed:"No A2A agent found at this URL",a2aDiscoverFailedHint:"The server may not support the A2A protocol. Check the URL and try again.",a2aSkills:"Skills",a2aEndpoint:"Endpoint",a2aVersion:"Version",a2aCapabilities:"A2A Capabilities",a2aStatus:"Status",a2aConnected:"Connected & A2A Ready",a2aNoRemote:"No remote agents",a2aNoRemoteHint:"Discover remote agents to enable cross-agent delegation.",a2aDelegations:"Recent Delegations",a2aDelegationsEmpty:"No delegations yet",a2aDelegationCompleted:"Completed",a2aDelegationFailed:"Failed",a2aDelegationPending:"Pending",acpSectionTitle:"Installed Agents",acpSectionDesc:a=>`${a} agent${1!==a?"s":""} detected`,acpNoInstalled:"No coding agents detected. Install one to delegate tasks directly from MindOS.",acpAvailableTitle:"Available in Registry",acpAvailableDesc:a=>`${a} more agent${1!==a?"s":""} available`,acpShowAvailable:"Show",acpHideAvailable:"Hide",acpCopyCmd:"Copy",acpCopied:"Copied",acpTransportNpx:"npx",acpTransportBinary:"binary",acpTransportUvx:"uvx",acpTransportStdio:"stdio",acpUseAgent:"Use",acpComingSoon:"Coming soon — use MindOS to invoke",acpReady:"Ready",acpNotInstalled:"Not Installed",acpScan:"Re-scan",acpInstallHint:a=>`Install with: ${a}`,acpInstall:"Install",acpInstalling:"Installing…",acpLoading:"Loading ACP registry…",acpLoadFailed:"Failed to load ACP registry.",acpRetry:"Retry",acpQuickReview:"Review code",acpQuickFix:"Fix bugs",acpQuickExplain:"Explain repo",acpUseWith:a=>`Use ${a} to `,acpDefaultAgent:"MindOS",acpSelectAgent:"Select Agent",acpChangeAgent:"Change agent",acpConfigToggle:"Configure",acpConfigCommand:"Command",acpConfigArgs:"Args",acpConfigEnv:"Env",acpConfigEnvAdd:"Add env var",acpConfigSource:"Source",acpConfigSourceBuiltin:"built-in",acpConfigSourceRegistry:"registry",acpConfigSourceUser:"custom",acpConfigReset:"Reset",acpConfigSave:"Save",acpConfigSaved:"Saved",acpConfigPath:"Path",networkEmptyTitle:"Connect to the agent ecosystem",networkEmptyDesc:"Discover remote agents or browse coding agents from the ACP registry.",networkDiscoverBtn:"Discover Agent",networkBrowseBtn:"Browse Registry"},plugins:{title:"Plugins",active:"active",noPlugins:"No plugins registered",core:"Core",coreDisabled:"Core plugin — cannot be disabled",footer:"Plugins customize how files render. Core plugins cannot be disabled.",ready:"Ready — click to open",disabled:"Disabled",noFile:"Entry file not found",createFile:"Create {file} to activate"},echo:{title:"Echo",imprintTitle:"Imprint",imprintDesc:"Daily traces and history",growthTitle:"Growth",growthDesc:"The direction you're pushing",selfTitle:"Self",selfDesc:"Clues that point back to you"},discover:{title:"Discover",useCases:"Use Cases",useCasesDesc:"Try MindOS scenarios hands-on",pluginMarket:"Plugin Market",pluginMarketDesc:"Extend how files are rendered and edited",skillMarket:"Skill Market",skillMarketDesc:"Add new abilities to your AI agents",spaceTemplates:"Space Templates",spaceTemplatesDesc:"Pre-built space structures for common workflows",comingSoon:"Coming soon",viewAll:"View all use cases",tryIt:"Try"},workflows:{title:"Flows",empty:"No flows yet",emptyDesc:"Create your first flow to automate multi-step tasks with AI.",newWorkflow:"New Flow",nSteps:a=>`${a} step${1===a?"":"s"}`,parseError:"Parse error",name:"Name",namePlaceholder:"My Flow",template:"Template",templateBlank:"Blank",create:"Create",cancel:"Cancel",creating:"Creating...",exists:"A workflow with this name already exists"},im:{title:"CHANNELS",emptyTitle:"No channels configured",emptyDesc:"Connect messaging platforms to let MindOS send messages on your behalf.",connected:"connected",notConfigured:"Set up",statusConnected:"Connected",tabStatus:"Status",tabConfigure:"Configure",testSend:"Test Send",recipientPlaceholder:"Recipient ID",messagePlaceholder:"Hello from MindOS",sendTest:"Send Test",sentOk:"Sent successfully",saveConfig:"Save",saved:"Saved — reconnecting...",cancel:"Cancel",fetchError:"Failed to load channel status.",retry:"Retry",disconnect:"Disconnect",confirmDisconnect:"Confirm?",showSecret:"Show value",hideSecret:"Hide value",getStarted:"Get Started",statsConnected:"Connected",statsSupported:"Supported",statsStatus:"Status",statsReady:"Ready",statsNotConfigured:"Not configured",platformsTitle:"Platforms",backToChannels:"Back to Channels",setupGuide:"Setup Guide",howItWorks:"How it works",currentMode:"Current mode",notificationsOnly:"Notifications only",twoWayConversation:"Two-way conversation",conversationTitle:"Conversation",conversationEnable:"Allow messages from Feishu",conversationWaiting:"Waiting for verification",conversationReady:"Ready for replies",conversationDisabled:"Disabled",conversationNeedsPublicUrl:"Public URL required",conversationNeedsEncryptKey:"Encrypt Key required",conversationHint:"Users can DM the bot, and group messages only trigger when the bot is mentioned.",conversationConfigHint:"Turn this on after you have a reachable public URL and your Feishu Encrypt Key ready.",conversationWebhookUrl:"Webhook URL",conversationCopyUrl:"Copy URL",conversationStatus:"Webhook status",conversationReachability:"Reachability",conversationReachabilityHint:"Feishu must be able to reach this URL from the public internet.",conversationOpenPlatform:"Open Feishu console",conversationPublicBaseUrl:"Public base URL",conversationEncryptKey:"Encrypt Key",conversationVerificationToken:"Verification Token",conversationVerificationTokenHint:"Used for Feishu webhook challenge verification. Leave blank to keep the saved value.",conversationSecretPlaceholder:"Leave blank to keep saved value",conversationGroupMentions:"Only reply when mentioned in groups",conversationSaved:"Conversation settings saved",conversationSave:"Save conversation settings",workInMindosHint:"Use Ask in MindOS to work with the agent. Use this channel to receive updates, alerts, and sample messages.",thisIsNotChat:"This is a delivery channel, not a chat inbox.",useCasesTitle:"What you can receive",statusSummaryTitle:"Status summary",lastActivity:"Last activity",lastRecipient:"Last recipient",noActivityYet:"No messages sent yet",noActivityHint:"Send a sample message to verify this channel is working.",recentActivity:"Recent activity",sendSample:"Send sample notification",sampleHint:"This sends a real outbound message through the selected channel.",settingsTitle:"Settings",settingsHint:"Maintain credentials and channel settings here.",showSettings:"Show settings",hideSettings:"Hide settings",latestSuccess:"Latest success",latestFailure:"Latest failure",noRecentActivity:"No recent activity",notAvailable:"Not available",activityTypeTest:"Sample message",activityTypeAgent:"Agent update",activityTypeManual:"Manual send",disconnectHint:"Remove credentials and disconnect this platform.",editCredentials:"Update credentials",editCredentialsHint:"Need to rotate tokens or fix a broken connection? Update and save here.",guideLink:"Open setup guide",recipientHint:"Use the platform-specific recipient ID.",savedValuesHint:"Saved values stay hidden. To update credentials, paste the full replacement values and save.",required:"required",saving:"Saving..."}},echoPages:{parent:"Echo",heroKicker:"",segmentNavAria:"Echo sections",snapshotBadge:"Local \xb7 private",factsHeading:"Snapshot",snapshotImprintTitle:"Start with one line",snapshotImprintBody:"Your line saves automatically the moment you leave the field.",snapshotGrowthTitle:"Intent lives here",snapshotGrowthBody:"Write one sentence about the direction you are pushing. It stays on this device and can change over time.",snapshotSelfTitle:"Coming soon",snapshotSelfBody:"Notes about you will surface here automatically as your knowledge base grows.",insightTitle:"Insight",insightShow:"Show insight",insightHide:"Hide insight",insightHint:"Reflects on what you've written on this page. Enable AI in Settings to use.",generateInsight:"Generate insight",generateInsightNoAi:"Enable AI in Settings → AI to use this feature.",insightGenerating:"Generating…",insightErrorPrefix:"Something went wrong:",insightRetry:"Try again",imprintChatLabel:"Reflect on this",growthChatLabel:"Explore this direction",selfChatLabel:"Discover patterns",dailyReportTitle:"Echo Report",dailyReportGenerated:"Generated at",dailyReportGenerate:"Generate report",dailyReportGenerating:"Generating…",dailyReportRetry:"Retry",dailyReportContinueAgent:"Chat about this",reportSnapshotTitle:"Activity",reportSnapshotFilesEdited:"Files edited",reportSnapshotFilesCreated:"Files created",reportSnapshotSessions:"Chat sessions",reportSnapshotKbGrowth:"KB growth",reportThemesTitle:"Themes",reportThemeFiles:"files",reportAlignmentTitle:"Alignment",reportAlignmentScore:"Alignment",reportAlignmentAligned:"Aligned",reportAlignmentPartial:"Partial",reportAlignmentMisaligned:"Drifted",reportReflectionTitle:"For tomorrow",dailyLineLabel:"A line for today",dailyLinePlaceholder:"Write one quiet line…",dailySavedNote:"Saved locally.",savedFlash:"Saved",dailyAskPrefill:a=>`Help me reflect on what I wrote today:
96
106
 
97
- ${a.trim()||"(nothing written yet)"}`,growthIntentLabel:"What you are steering toward",growthIntentPlaceholder:"Write your current intent…",growthSavedNote:"Saved locally.",imprintLead:"Write one line about today. Generate a report or chat to go deeper.",growthLead:"Write what you're working toward. Review it over time to see how it evolves.",selfLead:"Notes about you surface here as your knowledge base grows."},agentsContent:{title:"Agents",subtitle:"Connections, skills, and status at a glance.",workspacePulse:{title:"Your Agents",connected:"Connected",detected:"Detected",notFound:"Not found",risk:"Risks",enabledSkills:"Skills on",healthy:"Healthy",needsAttention:a=>`${a} issue${1!==a?"s":""}`},navOverview:"Overview",navMcp:"MCP",navSkills:"Skills",navNetwork:"Network",navSessions:"Sessions",navActivity:"Activity",navChannels:"Channels",channelsSubtitle:"Connect messaging platforms to let MindOS send messages on your behalf.",activitySubtitle:"Agent operations audit log.",activity:{loading:"Loading activity...",empty:"No agent operations logged yet.",emptyHint:"Operations from connected agents will appear here.",agentLabel:"Agent"},a2aTabTitle:"Remote Agents",a2aTabEmptyHint:"Discover agents to enable cross-agent delegation.",backToOverview:"Back to Agents",na:"N/A",status:{connected:"Connected",detected:"Detected",notFound:"Not found"},overview:{connected:"Connected",detected:"Detected",notFound:"Not found",riskQueue:"Attention",noRisk:"All clear — no issues detected.",usagePulse:"All agents",nextAction:"Suggested next",nextActionHint:"Reconnect detected agents first, then enable remaining skills.",riskLevelError:"Error",riskLevelWarn:"Warning",na:"N/A",colAgent:"Agent",colStatus:"Status",colMcp:"MCP",colSkills:"Skills",colMode:"Mode",colRuntime:"Runtime",pulseMcp:"MCP",pulseTools:"Tools",mcpOffline:"Offline",toolsUnit:a=>`${a} tools`,enabledUnit:a=>`${a} enabled`,agentCount:a=>`${a} agent${1!==a?"s":""}`,runtimeActive:"Active",riskMcpStopped:"MCP server is not running.",riskDetected:a=>`${a} detected agent(s) need configuration.`,riskSkillsDisabled:"All skills are disabled.",recentActivity:"Recent Activity",viewAll:"View all",showLess:"Show less",addCustomAgent:"Add your own agent",addCustomAgentTitle:"Add Custom Agent",editCustomAgentTitle:a=>`Edit ${a}`,customAgentName:"Agent Name",customAgentNamePlaceholder:"e.g. QCLaw, WorkBuddy",customAgentDir:"Config Directory",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"Common: ~/.xxx/ or ~/Library/Application Support/",customAgentKeyPreview:a=>`Key: ${a}`,customAgentContinue:"Continue",customAgentDetecting:"Detecting...",customAgentDirFound:"Directory found",customAgentDirNotFound:"Not found yet — agent will appear when installed",customAgentDetectTimeout:"Detection timed out, using defaults",customAgentDetectedTitle:"Detected Configuration",customAgentDefaultTitle:"Default Configuration",customAgentConfigLabel:"MCP Config",customAgentFormatLabel:"Format",customAgentTransportLabel:"Transport",customAgentSkillsLabel:"Skills",customAgentSkillsFound:a=>`${a} skill${1!==a?"s":""} found`,customAgentSkillsNone:"Not detected",customAgentSkillDir:"Skills Directory",customAgentSkillDirHint:"Where skills are installed for this agent",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"Customize these settings",customAgentAdd:"Add Agent",customAgentAdding:"Adding...",customAgentSave:"Save Changes",customAgentSaving:"Saving...",customAgentRetry:"Retry",customAgentAdded:a=>`${a} added`,customAgentUpdated:a=>`${a} updated`,customAgentRemoved:a=>`${a} removed`,customAgentRemoveTitle:a=>`Remove "${a}"?`,customAgentRemoveMessage:"This removes the agent from MindOS. No files will be deleted on disk.",customAgentRemoveConfirm:"Remove",customAgentConfigPath:"MCP Config File Path",customAgentConfigKey:"Config Key",customAgentFormat:"Format",customAgentTransport:"Transport",customAgentProjectConfig:"Project Config (optional)",customAgentCliBinary:"CLI Binary (optional)",customAgentCliBinaryPlaceholder:"e.g. qclaw",customAgentEdit:"Edit",customAgentRemove:"Remove",customAgentCancel:"Cancel",customAgentNetworkError:"Network error. Please try again.",customAgentFailedSave:"Failed to save",customAgentFailedRemove:"Failed to remove",customAgentKeyConflict:a=>`An agent with key "${a}" already exists`,customAgentBuiltinConflict:a=>`Conflicts with built-in agent "${a}"`},mcp:{title:"MCP Connections",refresh:"Refresh",connectionGraph:"Server connections across agents",tabs:{manage:"Manage",topology:"Topology",byAgent:"By Agent",byServer:"By MCP Server"},searchPlaceholder:"Search agents...",installMindos:"Install MindOS MCP",installed:"Installed",mcpServerLabel:"MCP Server",searchServersPlaceholder:"Search MCP servers...",serverAgentCount:a=>`${a} agent${1!==a?"s":""}`,emptyState:"No agents match current filters.",resultCount:a=>`${a} agents`,filteredSummaryTitle:"Filtered status summary",filteredConnected:a=>`Connected: ${a}`,filteredDetected:a=>`Detected: ${a}`,filteredNotFound:a=>`Not found: ${a}`,crossAgentServersTitle:"MCP Servers",crossAgentServersEmpty:"No MCP servers detected.",crossAgentServerAgents:a=>`Used by ${a}`,configVisibilityTitle:"Configuration",hiddenRootDetected:(a,b)=>`Hidden roots: ${a}/${b}`,runtimeSignalDetected:(a,b)=>`Runtime signals: ${a}/${b}`,riskQueueTitle:"Attention",riskMcpStopped:"MCP server is not running.",riskDetected:a=>`${a} detected agent(s) need configuration.`,riskNotFound:a=>`${a} agent(s) not found on this machine.`,riskSkillsDisabled:"All skills are disabled.",bulkReconnectFiltered:"Reconnect all",bulkRunning:"Running reconnect...",bulkSummary:(a,b)=>`Reconnected ${a}, failed ${b}.`,transportFilters:{all:"All transport",stdio:"stdio",http:"http",other:"other"},filters:{all:"All",connected:"Connected",detected:"Detected",notFound:"Not found"},table:{agent:"Agent",status:"Status",transport:"Transport",actions:"Actions"},actions:{copySnippet:"Copy Snippet",copied:"Copied",testConnection:"Test Connection",reconnect:"Reconnect"},addAgent:"Add",removeFromServer:"Remove",confirmRemoveTitle:"Remove from server?",confirmRemoveMessage:(a,b)=>`Remove "${a}" from "${b}"? The agent config will be updated automatically.`,cancel:"Cancel",noAvailableAgents:"All agents already connected.",manualRemoveHint:"Flagged for removal — edit the agent config to finalize.",removeSuccess:"Removed. Restart your agent to apply.",removeFailed:"Failed to remove. Try editing the config file manually.",reconnectAllInServer:"Reconnect all",reconnectAllRunning:"Reconnecting...",reconnectAllDone:(a,b)=>`Done: ${a} reconnected${b>0?`, ${b} failed`:""}.`,serverTransport:a=>`Transport: ${a}`,mcpDisabledMessage:"MCP mode is not enabled.",mcpDisabledHint:"Enable it in Settings → Connections to use MCP agents."},skills:{title:"Skills",summaryTitle:"Skill Status",summaryEnabled:a=>`Enabled: ${a}`,summaryDisabled:a=>`Disabled: ${a}`,summaryAttention:a=>`Needs attention: ${a}`,crossAgentSkillsTitle:"Installed Skills",crossAgentSkillsEmpty:"No skills detected.",crossAgentSkillAgents:a=>`Installed in ${a}`,capabilityGroups:"Skill management across agents",registrySummaryTitle:"Skill Registry",registryUniversal:a=>`Universal: ${a}`,registryAdditional:a=>`Additional: ${a}`,registryUnsupported:a=>`Unsupported: ${a}`,registryHiddenRoots:(a,b)=>`Hidden roots: ${a}/${b}`,tabs:{manage:"Manage",matrix:"Matrix",bySkill:"By Skill",byAgent:"By Agent"},searchPlaceholder:"Search skills...",agentSkillMode:"Skill Mode",agentMcpServers:"MCP Servers",agentNativeSkills:"Native Skills",agentMindosSkills:"MindOS Skills",noAgentsYet:"No agents detected yet.",moreSkills:a=>`+${a} more`,sourceAll:"All",sourceBuiltin:"Built-in",sourceUser:"Custom",sourceNative:"Native",summaryNative:a=>`Native: ${a}`,statusAll:"All status",statusEnabled:"Enabled",statusDisabled:"Disabled",statusAttention:"Needs attention",capabilityAll:"All capabilities",bulkEnableFiltered:"Enable all",bulkDisableFiltered:"Disable all",bulkRunning:"Applying changes...",bulkNoChanges:"No skill changes needed.",bulkAllSucceeded:a=>`Updated ${a} skills.`,bulkPartialFailed:(a,b)=>`Updated ${a}, failed ${b}.`,resultCount:a=>`${a} skills`,matrixAgentFocusLabel:"Agent focus",matrixAgentFocusAll:"All agents",matrixColumnSkill:"Skill",matrixEnabled:"Enabled",matrixDisabled:"Disabled",matrixUnsupported:"Unsupported",matrixNoAgents:"No agents available for matrix.",noSkillsMatchFilter:"No skills match current filters.",matrixEmpty:"No skills match current filters.",addAgentToSkill:"Add",removeAgentFromSkill:"Remove",confirmRemoveAgentTitle:"Remove from skill?",confirmRemoveAgentMessage:(a,b)=>`Remove "${a}" from "${b}"? This requires editing the agent config file.`,cancelSkillAction:"Cancel",noAvailableAgentsForSkill:"All agents already have this skill.",manualSkillHint:"Flagged — edit the agent config to finalize.",skillDescription:"Description",skillNoDescription:"No description available.",skillDeleteAction:"Delete",confirmDeleteSkillTitle:"Delete skill?",confirmDeleteSkillMessage:a=>`Permanently delete skill "${a}"? This cannot be undone.`,skillDeleted:"Skill deleted.",skillDeleteFailed:"Failed to delete skill.",copyInstallCmd:"Copy install command",installCmdCopied:"Copied!",skillAgentCount:a=>`${a} agent${1===a?"":"s"}`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} skills`,showAllNative:a=>`Show all ${a}`,collapseNative:"Collapse",emptyGroup:"No skills in this group.",groupLabels:{research:"Research",coding:"Coding",docs:"Docs",ops:"Ops",memory:"Memory"},skillPopover:{close:"Close",source:"Source",sourceBuiltin:"Built-in",sourceUser:"Custom",sourceNative:"Native",capability:"Capability",path:"File path",enabled:"Enabled",disabled:"Disabled",agents:"Agents",noAgents:"No agents have this skill.",content:"Skill content",loading:"Loading...",loadFailed:"Failed to load skill content.",retry:"Retry",copyContent:"Copy",copied:"Copied!",noDescription:"No description available.",deleteSkill:"Delete",confirmDeleteTitle:"Delete skill?",confirmDeleteMessage:a=>`Permanently delete skill "${a}"? This cannot be undone.`,confirmDeleteAction:"Delete",cancelAction:"Cancel",deleted:"Skill deleted.",deleteFailed:"Failed to delete skill."}},detail:{healthStripTitle:"Status",healthConnected:"Connected",healthInstalled:"MCP installed",healthRuntimeSignals:"Runtime signals",healthConfiguredServers:"Configured servers",healthInstalledSkills:"Native installed skills",identity:"Identity",connection:"Connection",capabilities:"Capability Profile",skillAssignments:"Skill Assignments",runtimeSignals:"Runtime",recentActivity:"Recent Activity",spaceReach:"Space Reach",agentKey:"Agent key",status:"Status",transport:"Transport",endpoint:"Endpoint",port:"Port",auth:"Auth",authConfigured:"Configured",authMissing:"Missing",projectScope:"Project scope",globalScope:"Global scope",format:"Config format",skillMode:"Skill mode",hiddenRoot:"Hidden root path",hiddenRootPresent:"Hidden root",conversationSignal:"Conversation",usageSignal:"Usage",lastActivityAt:"Last active",skillsAll:"All skills",skillsEnabled:"Enabled skills",skillsSourceBuiltin:"Built-in",skillsSourceUser:"Custom",skillsSearchPlaceholder:"Search all configured skills...",skillsFilterAll:"All",skillsFilterBuiltin:"Built-in",skillsFilterUser:"Custom",skillEnable:"Enable",skillDisable:"Disable",skillEdit:"Edit",skillSave:"Save",skillCancel:"Cancel",skillActionLoading:"Working...",skillReadFailed:"Failed to read skill content.",skillSaveFailed:"Failed to save skill content.",mcpManagement:"MCP Management",mcpInstalled:"Installed",mcpScope:"Current scope",mcpConfigPath:"Config path",mcpTargetScope:"Target scope",mcpTargetTransport:"Target transport",mcpScopeProject:"Project",mcpScopeGlobal:"Global",mcpCopySnippet:"Copy snippet",mcpCopied:"Copied",mcpRefresh:"Refresh status",mcpReconnect:"Apply MCP config",mcpApplying:"Applying MCP config...",mcpApplySuccess:"MCP config applied.",mcpApplyFailed:"Failed to apply MCP config.",nativeInstalledSkills:"Installed Skills",nativeInstalledSkillsCount:a=>`${a} detected`,nativeInstalledSkillsEmpty:"No installed skills detected.",nativeInstalledSkillsMore:a=>`+${a} more`,configuredMcpServers:"MCP Servers",configuredMcpServersCount:a=>`${a} detected`,configuredMcpServersEmpty:"No MCP servers configured.",configuredMcpServersMore:a=>`+${a} more`,yes:"Yes",no:"No",noSkills:"No enabled skills.",noActivity:"No activity recorded yet.",noSpaceReach:"No space reach data yet.",skillDelete:"Delete",skillDeleteConfirm:a=>`Delete skill "${a}"? This cannot be undone.`,skillDeleteSuccess:"Skill deleted.",skillDeleteFailed:"Failed to delete skill.",mcpServerAdd:"Add MCP server",mcpServerRemove:"Remove",mcpServerRemoveConfirm:a=>`Remove "${a}" from this agent? This requires editing the config file.`,mcpServerHint:"Flagged — edit the agent config to finalize.",mcpReconnectAll:"Reconnect all",mcpReconnectAllRunning:"Reconnecting...",mcpReconnectAllDone:(a,b)=>`Reconnected ${a}${b>0?`, failed ${b}`:""}.`,runtimeDiagTitle:"Runtime & Diagnostics",runtimePing:"Ping",runtimePinging:"Pinging...",runtimePingOk:a=>`Reachable (${a}ms)`,runtimePingFail:"Unreachable",runtimeUptime:"Uptime",runtimePid:"Process",runtimeMemory:"Memory",runtimeVersion:"Version",runtimeStartedAt:"Started",runtimeNoData:"No runtime data available.",envPermTitle:"Environment & Permissions",envVars:"Environment variables",envVarsCount:a=>`${a} configured`,envVarsEmpty:"No custom environment variables.",envScope:"Scope",envReadOnly:"Read-only access",envWriteAccess:"Write access",envFileAccess:"File access",envNetworkAccess:"Network access",envAllowed:"Allowed",envRestricted:"Restricted",activityTitle:"Activity & Usage",activityTotal:"Total invocations",activityLast7d:"Last 7 days",activityLastInvocation:"Last invocation",activityTokensUsed:"Tokens used",activityAvgLatency:"Avg latency",activityNoData:"No activity recorded yet.",knowledgeInteraction:"Knowledge Interaction",knowledgeNoData:"No interactions yet. Agents will show activity here once they start working with your knowledge base.",recentOps:"Recent Operations",statTotalCalls:"Total calls",statFilesTouched:"Files touched",statReadWrite:"Read / Write",statHealth:"Health",viewFullLog:"View full log",showLess:"Show less"},detailSubtitle:"",detailNotFound:"Agent not found — it may have been removed or renamed.",detailNotFoundHint:"The agent may have disconnected or its configuration file was moved. Try restarting the agent or check the MCP configuration.",detailNotFoundSuggestion:"Connected agents you can explore:"},settings:{title:"Settings",tabs:{ai:"AI",appearance:"Appearance",knowledge:"General",sync:"Sync",mcp:"Connections",plugins:"Plugins",shortcuts:"Shortcuts",monitoring:"Monitoring",agents:"Agents",update:"Update",uninstall:"Uninstall"},ai:{provider:"Model Providers",model:"Model",apiKey:"API Key",baseUrl:"Base URL",baseUrlHint:"Optional. Use for proxies or custom API endpoints.",keyHint:"Stored locally in ~/.mindos/config.json",keyOptionalHint:"Optional for local providers. Stored in ~/.mindos/config.json",keyChange:"Change",keyCancel:"Cancel",envHint:"Fields marked env have a value from environment variables. You can override them here, or restore all to env defaults.",envFieldNote:a=>`Env var ${a} is set. Clear this field to fall back to it.`,resetToEnv:"Reset to env value",restoreFromEnv:"Restore from env",noApiKey:"API key is not set. AI features will be unavailable until you add one.",testKey:"Test",testKeyTesting:"Testing...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"Invalid API key",testKeyModelNotFound:"Model not found",testKeyEndpointError:"Endpoint or protocol mismatch",testKeyRateLimited:"Rate limited, try again later",testKeyNetworkError:"Network error",testKeyNoKey:"No API key configured",testKeyUnknown:"Test failed",listModels:"Browse",noModelsFound:"No models found",resetProvider:"Reset",resetProviderConfirm:"Click again to confirm"},customProviders:{title:"Model Providers",subtitle:"Add custom API endpoints with your own names",addButton:"+ Add Provider",editButton:"Edit",deleteButton:"Delete",testButton:"Test",emptyState:"No custom providers yet. Add one to use custom API endpoints or proxies.",modal:{titleAdd:"Add Model Provider",titleEdit:"Edit Model Provider",fieldName:"Name",fieldNameHint:"e.g., Company GPT-4, Local LLaMA",fieldProtocol:"Protocol",fieldProtocolHint:"(Most local servers use OpenAI-compatible)",fieldBaseUrl:"Base URL",fieldBaseUrlHint:"e.g., https://api.company.com/v1 or http://localhost:8080/v1",fieldApiKey:"API Key",fieldApiKeyHint:"Leave empty if not required (e.g., for local servers)",fieldModel:"Model",fieldModelHint:"e.g., gpt-4-turbo, llama3.2",buttonCancel:"Cancel",buttonSave:"Save & Test",buttonSaveOnly:"Save",validating:"Testing connection...",success:"✓ Connected",error:"Connection failed"},deleteConfirm:a=>`Delete "${a}"? This cannot be undone.`,deleteConfirmButton:"Delete"},agent:{title:"Agent Behavior",subtitle:"Configure how the AI agent operates",maxSteps:"Max Steps",maxStepsHint:"Maximum tool call steps per request (1-30)",contextStrategy:"Context Strategy",contextStrategyHint:"Auto: summarize early messages when context fills up. Off: no summarization (emergency pruning still applies).",contextStrategyAuto:"Auto (compact + prune)",contextStrategyOff:"Off",thinking:"Extended Thinking",thinkingHint:"Show Claude's reasoning process (uses more tokens)",thinkingBudget:"Thinking Budget",thinkingBudgetHint:"Max tokens for reasoning (1000-50000)",reconnectRetries:"Auto Reconnect",reconnectRetriesHint:"When connection drops, automatically retry this many times before giving up (0 = disabled)"},appearance:{readingTitle:"Reading",readingDesc:"Customize how your notes look",readingFont:"Reading font",fontSize:"Font size",fontSizePreview:"The quick brown fox.",contentWidth:"Content width",preferencesTitle:"Preferences",colorTheme:"Color theme",system:"System",dark:"Dark",light:"Light",language:"Language",browserNote:"Appearance settings are saved in your browser.",labsTitle:"Labs",labsDesc:"Experimental features still in development. May change or be removed.",labsEcho:"Echo",labsEchoDesc:"Reflective journaling powered by your notes.",labsWorkflows:"Flows",labsWorkflowsDesc:"Visual workflow automation for agents.",fontPreview:"The quick brown fox jumps over the lazy dog."},knowledge:{cardTitle:"Knowledge Base",securityTitle:"Security",passwordPlaceholder:"Leave empty to disable",passwordShow:"Show",passwordHide:"Hide",tokenNotSet:"— not set —",mcpUrl:"MCP URL",tokenGenerated:"New token generated. Copy it now — it won't be shown in full again.",monitoringTitle:"System Monitoring",monitoringFailed:"Failed to load monitoring data",monitorHeap:"Heap",monitorRss:"RSS",monitorUptime:"Uptime",monitorNode:"Node",monitorRequests:"Requests",monitorToolCalls:"Tool Calls",monitorTokens:"Tokens",monitorFiles:"Files",monitorErrors:"Errors",monitorMcpRunning:a=>`Running :${a}`,monitorMcpStopped:"Stopped",cancel:"Cancel",mindRoot:"Knowledge base root",mindRootHint:"Absolute path to your notes directory. Requires server restart to take effect.",mindRootEnvHint:a=>`MIND_ROOT env var is set to "${a}". Fill in above to override it.`,envNote:"MIND_ROOT env var is set. Fill in above to override it — your value takes priority.",webPassword:"Web UI password",webPasswordHint:"Protect the browser UI with a password. Leave empty to disable. Changes take effect on next page load.",webPasswordClear:"Clear password",authToken:"MCP / API auth token",authTokenHint:"Bearer token for Agent and MCP clients. Not required for browser access.",authTokenNone:"No token set — API is open to all requests.",authTokenCopy:"Copy",authTokenCopied:"Copied!",authTokenReset:"Regenerate",authTokenClear:"Clear token",authTokenResetConfirm:"Regenerate token? All existing MCP clients will need to update their config.",authTokenMcpPort:"MCP port",restartWalkthrough:"Restart walkthrough",showHiddenFiles:"Show hidden files",showHiddenFilesHint:"Display dot-prefixed folders (.agents, .claude, .mindos, etc.) in the file tree.",cleanupExamples:"Clean up example files",cleanupExamplesHint:"Remove all template example files (\uD83E\uDDEA_example_*) from your knowledge base.",cleanupExamplesButton:"Clean up",cleanupExamplesNone:"No example files found",cleanupExamplesConfirm:a=>`Delete ${a} example file${a>1?"s":""}? This cannot be undone.`,cleanupExamplesDone:a=>`Removed ${a} example file${a>1?"s":""}`,cleanupExamplesScanning:"Scanning..."},sync:{emptyTitle:"Cross-device Sync",emptyDesc:"Automatically sync your knowledge base across devices via Git.",featureAutoCommit:"Auto-commit on save",featureAutoPull:"Auto-pull from remote",featureConflict:"Conflict detection",featureMultiDevice:"Works across devices",remoteUrl:"Git Remote URL",invalidUrl:"Invalid Git URL — use HTTPS (https://...) or SSH (git@...)",sshBrief:"one-time key setup, no token needed",httpsBrief:"works anywhere, token recommended",sshHint:"Requires SSH key on this machine. Verify with: ssh -T git@github.com",accessToken:"Access Token",optional:"(optional, for private repos)",tokenHint:"GitHub:",tokenLink:"Create a token (repo scope)",branchLabel:"Branch",connectButton:"Connect & Start Sync",connecting:"Connecting...",stepConnecting:"Connecting to remote...",stepAuthenticating:"Authenticating...",stepSyncing:"Syncing data...",stepAlmostDone:"Almost done...",stepDone:"Sync configured successfully!",gitignoreTitle:"Excluded files",gitignorePlaceholder:"# Files to exclude from sync\n*.tmp\nsecret/",gitignoreSave:"Save",gitignoreSaved:"Saved",conflictExplain:"These files were changed on both this device and the remote. Choose which version to keep.",keepLocal:"Keep local",keepRemote:"Keep remote",keepLocalHint:"Keep this device's version",keepRemoteHint:"Replace with the remote version",viewDiff:"Click to compare versions",localVersion:"Local (this device)",remoteVersion:"Remote",emptyFile:"(empty)",sectionTitle:"Sync",labelProvider:"Provider",labelRemote:"Remote",labelBranch:"Branch",labelLastSync:"Last sync",labelUnpushed:"Unpushed",labelAutoSync:"Auto-sync",unpushedCommits:a=>`${a} commits`,syncNow:"Sync Now",disableAutoSync:"Disable Auto-sync",enableAutoSync:"Enable Auto-sync",syncComplete:"Sync complete",syncFailed:"Sync failed",autoSyncDisabled:"Auto-sync disabled",autoSyncEnabled:"Auto-sync enabled",toggleFailed:"Failed to toggle sync",conflictsTitle:a=>`Conflicts (${a})`,conflictHint:"Click a file to view your version. Hover and click",conflictHintSuffix:"to see the remote version.",timeNever:"never",timeJustNow:"just now",timeMinAgo:a=>`${a}m ago`,timeHourAgo:a=>`${a}h ago`,timeDayAgo:a=>`${a}d ago`},plugins:{title:"Installed Renderers",builtinBadge:"built-in",coreBadge:"core",enabled:"Enabled",disabled:"Disabled",matchHint:"Auto-activates on",coreHint:"Core renderer — always enabled",noPlugins:"No renderers installed.",comingSoon:"Plugin marketplace coming soon."},mcp:{modeCardTitle:"Connection Mode",modeCardDesc:"Choose how agents connect to MindOS.",cliLabel:"CLI",cliModeDesc:"Claude Code, Gemini CLI, Codex, etc.",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop, Cursor, Windsurf, etc.",alwaysOn:"Always On",mcpRunning:"Running",mcpStopped:"Stopped",mcpEnabledHint:"MCP mode enabled. Disable to simplify the interface if you only use CLI agents.",mcpDisabledHint:"Enable MCP to connect Desktop clients like Claude Desktop or Cursor.",serverTitle:"MindOS MCP Server",status:"Status",running:"Running",stopped:"Stopped",transport:"Transport",endpoint:"Endpoint",tools:"Tools",toolsRegistered:a=>`${a} registered`,auth:"Auth",authSet:"Token set",authNotSet:"No token",copyEndpoint:"Copy Endpoint",copyConfig:"Copy Config",copied:"Copied!",agentsTitle:"Agent Configuration",agent:"Agent",scope:"Scope",project:"Project",global:"Global",installed:"Installed",notInstalled:"Not installed",detected:"Detected",notFound:"Not found",transportStdio:"stdio (recommended)",transportHttp:"http",transportAuto:"auto (recommended)",httpUrl:"MCP URL",httpToken:"Auth Token",installSelected:"Install Selected",installing:"Installing...",installSuccess:a=>`${a} agent(s) configured`,installFailed:"Install failed",portLabel:"MCP Port",portHint:"Changes require server restart",skillsTitle:"Skills",skillsDesc:"Teach agents how to operate your knowledge base.",skillAutoLoaded:"Auto-loaded on every request",skillSource:"Source",skillBuiltin:"Built-in",skillUser:"Custom",addSkill:"+ Add Skill",cliInstallHint:"Install via CLI:",skillPathHint:"Skill files installed at:",deleteSkill:"Delete",editSkill:"Edit",saveSkill:"Save",cancelSkill:"Cancel",skillName:"Name",skillDesc:"Description",skillContent:"Content",skillNameConflict:"A skill with this name already exists",skillDeleteConfirm:a=>`Delete skill "${a}"? This cannot be undone.`,skillLanguage:"Skill Language",skillLangEn:"English",skillLangZh:"中文",searchSkills:"Search skills...",customGroup:"Custom",builtinGroup:"Built-in",noSkillsMatch:a=>`No skills match "${a}"`,skillTemplate:"Template",skillTemplateGeneral:"General",skillTemplateToolUse:"Tool-use",skillTemplateWorkflow:"Workflow",selectDetected:"Select Detected",clearSelection:"Clear",quickSetup:"Quick Setup",configureFor:"Configure for",configPath:"Config path",transportLocal:"Local",transportRemote:"Remote",transportLocalHint:"Local — same machine as MindOS server",transportRemoteHint:"Remote — connect from another device via HTTP",remoteDetectedHint:"Using your current remote IP.",remoteManualHint:"Replace 127.0.0.1 with your server's public or LAN IP.",remoteSteps:"To connect from another device: ① Open port {port} in firewall/security group ② Use the config below in your Agent ③ For public networks, consider SSH tunnel for encryption.",noAuthWarning:"⚠ No auth token — set one in Settings → General before enabling remote access.",showJson:"Show JSON",hideJson:"Hide JSON",connectionTitle:"Connect Agents",connectionHint:"Choose how your AI agents connect to MindOS.",tokenCardTitle:"Auth Token",tokenCardDesc:"Used by CLI remote mode and MCP connections.",mcpHint:"For Claude Desktop, Cursor, and agents that use MCP tool protocol.",tokenLabel:"Auth Token",tokenMasked:"Click Show to reveal the full token",tokenShow:"Show",tokenHide:"Hide",tokenCopy:"Copy",tokenCopied:"Token copied!",tokenNone:"No token set — your MCP server is open to all requests.",tokenNoneAction:"Generate a token in Settings → General → Security.",serverUrl:"MCP Server URL",serverUrlCopy:"Copy URL",howToConnect:"How to connect an AI agent",howToStep1:"Open your agent's MCP settings (e.g. Claude Code, Cursor)",howToStep2:"Add a new MCP server with the URL above",howToStep3:"Set the Auth Token as the bearer token",howToStep4:"Save and verify the connection",cliSkillTitle:"CLI Skill",cliSkillHint:"For agents with bash (Claude Code, Gemini CLI, Codex) — lower token cost, no MCP needed.",cliSkillDesc:"Lower token cost, Skill included — just install and go.",cliLocalDesc:"MindOS Skill is built-in. Install the CLI and you're good to go.",cliRemoteDesc:"Install the CLI on another machine and connect to this MindOS server.",cliSkillInstall:"Install",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"Remote",cliSkillVerify:"Verify",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"Configure",cliInstallSkill:"Install Skill",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"Requires per-agent MCP config. Install Skill separately via",mcpLocalDesc:"Copy the config snippet and paste into your agent's MCP settings.",mcpRunningLabel:"MCP Running",mcpServerStatus:"MCP Server",autoInstallAgents:"Auto-install to detected agents",detectedAgentsTitle:"Detected Agents",cliInstallDesc:"Install the MindOS Skill to your agent so it can operate your knowledge base.",mcpInstallDesc:"Install MCP config + Skill to detected agents on this machine.",tokenCopyFullHint:"Copies full token",skillsInstalled:"skills installed",recommended:"Recommended",localTitle:"Local",localReady:"Ready to use",remoteTitle:"Remote Access",remoteSubtitle:"Connect from another device",restarting:"Restarting...",restart:"Restart",portsCardTitle:"Server Ports",portsCardDesc:"Web UI and MCP server ports. Changes take effect after restart.",webPortLabel:"Web UI Port",webPortHint:"The port your browser connects to.",mcpPortLabel:"MCP Server Port",mcpPortHint:"The port agents and desktop apps connect to.",portChecking:"Checking…",portAvailable:"Available",portSelf:"Current port",portInUse:a=>`Port ${a} is in use`,portSuggest:a=>`Use ${a}`,portConflict:"Web and MCP ports must be different.",portUpdating:"Saving…",portWebRestarting:"Restarting server…",portMcpRestarting:"Restarting MCP…",portUpdateSuccess:"Ports updated successfully.",portUpdateFailed:"Failed to update ports.",portRestartTimeout:"Restart timed out. Please try again.",portRedirecting:"Redirecting to new address…",portUpdateBtn:"Update Ports",externalToolsTitle:"External MCP Tools",externalToolsDesc:"Configure tool access mode for external MCP servers."},monitoring:{system:"System",heapMemory:"Heap Memory",rss:"RSS",uptime:"Uptime",nodeVersion:"Node",application:"Application",requests:"Requests",toolCalls:"Tool Calls",avgResponse:"Avg Response",tokens:"Tokens",errors:"Errors",knowledgeBase:"Knowledge Base",files:"Files",totalSize:"Total Size",rootPath:"Root",mcpStatus:"Status",mcpRunning:"Running",mcpStopped:"Stopped",mcpPort:"Port",autoRefresh:"Auto-refresh every 5s",fetchError:"Failed to load monitoring data"},agents:{mcpServer:"MCP Server",running:"Running",stopped:"Not running",restarting:"Restarting...",restart:"Restart",onPort:a=>`on :${a}`,refresh:"Refresh",refreshing:"Refreshing...",connected:"Connected",connectedCount:a=>`Connected (${a})`,detectedNotConfigured:"Detected but not configured",detectedCount:a=>`Detected but not configured (${a})`,notDetected:"Not Detected",notDetectedCount:a=>`Not Detected (${a})`,showAll:"Show all",hideAll:"Hide",connect:"Connect",noAgents:"No agents detected on this machine.",fetchError:"Failed to load agent data",autoRefresh:"Auto-refresh every 30s"},save:"Save",saved:"Saved",saveFailed:"Save failed",reconfigure:"Reconfigure",askDisplayMode:{label:"Display Mode",hint:"Side panel stays docked on the right. Popup opens a floating dialog.",panel:"Side Panel",popup:"Popup"},update:{checking:"Checking for updates...",upToDate:"You're up to date",available:(a,b)=>`Update available: v${a} → v${b}`,updating:"Updating MindOS... The server will restart shortly.",updatingHint:"This may take 1–3 minutes. Do not close this page.",serverRestarting:"Server is restarting, please wait...",updated:"Updated successfully! Reloading...",timeout:"Update may still be in progress.",timeoutHint:"The server may need more time to rebuild. Try refreshing.",refreshButton:"Refresh Page",retryButton:"Retry Update",error:"Failed to check for updates. Check your network connection.",checkButton:"Check for Updates",updateButton:a=>`Update to v${a}`,releaseNotes:"View release notes",hint:"Updates are installed via npm. Equivalent to running",inTerminal:"in your terminal.",desktopDownloading:"Downloading update...",desktopReady:"Update downloaded. Restart to apply.",desktopRestart:"Restart Now",desktopHint:"Updates are delivered through the Desktop app auto-updater.",coreTitle:"MindOS Core",coreUpToDate:"Core is up to date",coreAvailable:a=>`Update available (${a})`,coreDownloading:"Downloading...",coreCancel:"Cancel",coreReady:"Ready — restart services to apply",coreRestartServices:"Restart Services",coreApplying:"Applying update...",coreApplied:"Updated! Reloading...",coreError:"Core update failed.",coreRetry:"Retry",coreDesktopTooOld:a=>`v${a} requires a newer Desktop version.`,coreDesktopTooOldHint:"Please update MindOS Desktop first.",coreHint:"Core updates only restart services — no app restart needed.",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} available`,titleMultiple:"Updates available",desktopLabel:"Desktop",coreLabel:"Core",viewDetails:"View Details",skipVersion:"Skip Version",skipAll:"Skip All"}},uninstall:{title:"Uninstall MindOS",descCli:"Remove MindOS CLI, background services, and configuration files from this machine.",descDesktop:"Remove MindOS Desktop, background services, and configuration files from this machine.",warning:"Select what to clean up. Your knowledge base files are always kept safe.",stopServices:"Stop services & remove daemon",stopServicesDesc:"Stop all running MindOS processes and remove the background daemon.",removeConfig:"Remove configuration",removeConfigDesc:"Delete ~/.mindos/ directory (config, logs, PID files).",removeNpm:"Uninstall CLI package",removeNpmDesc:"Run npm uninstall -g @geminilight/mindos.",removeApp:"Move Desktop app to Trash",removeAppDesc:"Move MindOS.app to Trash. You can restore it later if needed.",confirmTitle:"Confirm Uninstall",confirmButton:"Uninstall",cancelButton:"Cancel",running:"Uninstalling...",success:"MindOS has been uninstalled.",successDesktop:"MindOS has been uninstalled. The app will quit now.",error:"Uninstall failed. You can run `mindos uninstall` in terminal manually.",nothingSelected:"Select at least one item to uninstall.",kbSafe:"Your knowledge base files are always safe — they are never deleted by this action."}},onboarding:{subtitle:"Your knowledge base is empty. Pick a starter template to get going.",templates:{en:{title:"English",desc:"Pre-built structure with Profile, Notes, Projects, and more."},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"Empty",desc:"Just the essentials — README, CONFIG, and INSTRUCTION."}},importHint:"Already have notes? Set MIND_ROOT to your existing directory in Settings.",syncHint:"Want cross-device sync? Run",syncHintSuffix:"in the terminal after setup.",initError:"Initialization failed. Please refresh the page or try a different template.",dismiss:"Dismiss"},setup:{stepTitles:["Knowledge Base","AI Configuration","Agent Connection","Confirm"],kbPath:"Knowledge base path",kbPathHint:"Absolute path to your notes directory.",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`Use ${a}`,kbPathHasFiles:a=>`This directory already contains ${a} file${a>1?"s":""}. You can skip the template or merge (existing files won't be overwritten).`,kbTemplateSkip:"Skip template",kbTemplateMerge:"Choose a template to merge",template:"Starter template",templateSkip:"Skip (directory already has files)",aiProvider:"AI Provider",aiProviderHint:"Choose your preferred AI service.",aiSkip:"Skip — configure later",apiKey:"API Key",apiKeyExisting:"Existing key configured. Leave blank to keep it.",model:"Model",listModels:"Browse",noModelsFound:"No models found",baseUrl:"Base URL",baseUrlHint:"Optional. For proxies or custom API endpoints.",webPort:"Web UI port",mcpPort:"MCP server port",portHint:"Valid range: 1024–65535",portRestartWarning:"The service will start on these ports after setup completes.",portInUse:a=>`Port ${a} is already in use.`,portSuggest:a=>`Use ${a}`,portChecking:"Checking…",portSelf:"Current port",portConflict:"Web UI and MCP ports must be different.",portVerifyHint:"Click outside each field to verify, or wait for auto-check.",authToken:"Auth Token",authTokenHint:"Bearer token for MCP / API clients. Auto-generated.",authTokenUsage:"Used for MCP connections and API clients. When configuring an Agent, this token is written automatically — no manual steps needed.",authTokenUsageWhat:"What is this?",authTokenSeed:"Custom seed (optional)",authTokenSeedHint:"Enter a passphrase to derive a deterministic token.",generateToken:"Generate",copyToken:"Copy",copiedToken:"Copied!",webPassword:"Web Password",webPasswordHint:"Protect your knowledge base from unauthorized browser access.",webPasswordRequired:"Password is required to protect your data.",advancedPorts:"Advanced Settings",tokenSectionTitle:"Auth Token (auto-generated)",tokenSectionHint:"Used by AI agents to connect to your MindOS server.",agentToolsTitle:"Agent Connection",connectionModeTitle:"Connection Mode",connectionModeCliHint:"Recommended \xb7 Lower token usage",connectionModeMcpHint:"Optional \xb7 Higher token usage",agentToolsHint:"Select which AI agents to configure. This step is optional.",agentToolsHintCliOnly:"Agent selection applies when MCP mode is enabled. CLI works with all agents that have bash access.",agentToolsHintNone:"No connection mode selected. Select at least one mode to connect agents.",agentTransport:"Transport",agentScope:"Scope",agentToolsLoading:"Loading agents…",agentToolsEmpty:"No supported agents detected.",agentNoneSelected:"No agents selected. You can configure agents later in Settings.",agentSkipLater:"Clear all",agentSelectDetected:"Select detected agents",agentNoneDetected:"No agents detected on your system.",agentShowMore:a=>`Show ${a} more agents`,agentAdvanced:"Advanced options",agentScopeGlobal:"Install for all projects",agentScopeProject:"This project only",badgeInstalled:"Installed",badgeDetected:"Detected",badgeNotFound:"Not found",agentNotInstalled:"not installed",agentDetected:"detected",agentNotFound:"not found",agentGetIt:"Get it →",agentStatusOk:"configured",agentStatusError:"failed",agentInstalling:"Configuring…",agentTransportAuto:"Auto (recommended)",agentTransportLabel:"Transport",agentVerified:"verified",agentUnverified:"unverified",agentVerifyNote:"stdio agents are verified after restart",skillWhat:"",skillAutoHint:()=>"",skillLabel:"Skill",skillInstalling:"Installing skill…",skillInstalled:"Skill installed",skillFailed:"Skill install failed",aiSkipTitle:"Skip for now",aiSkipDesc:"You can add an API key later in Settings → AI.",reviewHint:"Verify your settings, then press Complete Setup.",reviewInstallResults:"Agent configuration results:",phaseSaving:"Saving configuration…",phaseAgents:"Configuring agents…",phaseSkill:"Installing skill…",phaseDone:"Setup complete!",retryAgent:"Retry",agentFailedCount:a=>`${a} agent${a>1?"s":""} failed`,agentCountSummary:a=>`${a} agent${a>1?"s":""}`,agentFailureNote:"Agent failures are non-blocking — you can enter MindOS and retry from Settings → Connections.",portAvailable:"Available",portChanged:"Port changed — please restart the server for it to take effect.",restartRequired:"Server restart required for these changes to take effect.",restartNow:"Restart now",restarting:"Restarting…",restartDone:"Server is restarting. Redirecting shortly…",restartManual:"Restart manually:",back:"Back",next:"Next",complete:"Complete Setup",skip:"Skip",completing:"Saving...",completeDone:"Setup complete!",completeFailed:"Setup failed. Please try again.",healthKb:"Knowledge Base",healthKbNone:"Not configured",healthAi:"AI Provider",healthAiNone:"Not configured — AI features disabled",healthAiAction:"Add an API key in Settings → AI.",healthAgents:"Agent Connection",healthAgentsOk:a=>`${a} agent${a>1?"s":""} configured`,healthAgentsPartial:"Configuration in progress...",healthAgentsNone:"No agents configured",healthAgentsAction:"You can add agents later in Settings → Connections.",healthSkills:"Skills",healthSkillsOk:"Skills installed successfully",healthSkillsError:"Skill installation failed",healthSkillsSkipped:"Skipped",healthSkillsInstalling:"Installing skills...",healthSkillsAction:"You can install skills manually later.",healthTokenTitle:"Auth Token",healthTokenCopy:"Copy token",healthTokenHint:"Used by CLI remote mode and MCP connections. Also available in Settings → Connections.",healthGoHome:"Go to MindOS",welcomeTitle:"Welcome to MindOS!",welcomeDesc:"Setup is complete. Start by asking MindOS a question, browsing your knowledge base, or configuring MCP agents.",welcomeLinkReconfigure:"Reconfigure",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP Settings"},guide:{title:"Quick Start",showGuide:"Show getting started guide",close:"Close",skip:"Skip",stepLocked:"Complete the previous step first",import:{title:"Import your files",cta:"Import",desc:"Upload your resume, project docs, or notes — anything you want AI agents to know about you.",button:"Import Files"},ai:{title:"Save with AI",cta:"Try it",desc:"Ask MindOS to capture knowledge from this conversation into your knowledge base:",prompt:"Help me distill the key takeaways from our conversation into a reusable SOP in my knowledge base.",promptEmpty:"Help me design a knowledge base folder structure that fits my needs"},agent:{title:"Connect other Agents",cta:"Copy prompt",desc:"Open Cursor, Claude Code, or any Agent with MindOS CLI and paste:",copyPrompt:"Summarize what we discussed and save it to my MindOS knowledge base as a reusable SOP.",copy:"Copy",copied:"Copied!"},done:{title:"You're all set!",titleFinal:"You've mastered MindOS essentials!",steps:[{hint:"Next: try saving an article into your KB →",prompt:"Help me save the key points from this article into MindOS."},{hint:"Next: try turning experience into a reusable SOP →",prompt:"Help me distill this conversation into a reusable workflow in MindOS."}]}},walkthrough:{step:(a,b)=>`${a} of ${b}`,next:"Next",back:"Back",skip:"Skip tour",done:"Done",exploreCta:"Explore what you can do →",steps:[{title:"Your Project Memory",body:"Organize projects, SOPs, and preferences in Spaces. Everything is local-first and under your control."},{title:"AI That Already Knows You",body:"MindOS reads your knowledge base automatically. Ask about your projects without restating the background every time."},{title:"Connect Any Agent",body:"Link Cursor, Claude Code, or Windsurf via MCP — they all share the same project memory."}]},shortcuts:[{keys:["⌘","K"],description:"Search"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"Settings"},{keys:["E"],description:"Edit current file"},{keys:["⌘","S"],description:"Save"},{keys:["Esc"],description:"Cancel edit / close modal"},{keys:["@"],description:"Attach file in MindOS"}],help:{title:"Help & Guide",subtitle:"Everything you need to get started with MindOS",whatIs:{title:"What is MindOS?",body:"MindOS is your local knowledge assistant. It keeps your projects, decisions, SOPs, and preferences in one place so you and your connected agents can work from the same context. Your files stay local, your knowledge stays reusable, and you do not need to restate everything from scratch."},quickStart:{title:"Quick Start",step1Title:"Browse your knowledge base",step1Desc:'Click the Spaces icon in the left sidebar to explore your files. Each top-level folder is a "Space" — a themed area like Profile, Notes, or Projects.',step2Title:"Talk to MindOS",step2Desc:"Press ⌘/ (or Ctrl/) to open MindOS. Ask about your knowledge base, or use @ to attach a specific file for context.",step3Title:"Connect your AI agents",step3Desc:"Go to Settings → Connections to connect external agents like Claude Code, Cursor, or Windsurf. Once connected, they can read and write your knowledge base directly."},concepts:{title:"Core Concepts",spaceTitle:"Space",spaceDesc:"Spaces are knowledge partitions organized the way you think. You decide the structure, and AI agents follow it to read, write, and manage automatically.",instructionTitle:"Instruction",instructionDesc:"A rules file that all AI agents obey. You write the boundaries once, and every agent connected to your knowledge base follows them.",skillTitle:"Skill",skillDesc:"Teaches agents how to operate your knowledge base — reading, writing, organizing. Agents don't guess; they follow the skills you've installed."},shortcutsTitle:"Keyboard Shortcuts",agentUsage:{title:"Using MindOS with AI Agents",intro:"Once you connect an agent (Claude Code, Cursor, Windsurf, etc.) via MCP, just talk to it naturally. The agent can read and write your knowledge base directly — no special commands needed. Here are the most common scenarios:",scenarios:[{emoji:"\uD83E\uDEAA",title:"Inject Your Identity",desc:"Tell all AI agents who you are — preferences, tech stack, communication style — in one shot.",prompt:'"Here\'s my resume, read it and organize my info into MindOS."'},{emoji:"\uD83D\uDD04",title:"Cross-Agent Handoff",desc:"Brainstorm ideas in GPT, then execute in Claude Code — zero context loss.",prompt:'"Save this conversation to MindOS."\n"Read the plan in MindOS and help me start coding."'},{emoji:"\uD83D\uDCCB",title:"Experience → SOP",desc:"Turn hard-won debugging sessions into reusable workflows that prevent future mistakes.",prompt:'"Help me distill this conversation into a reusable workflow in MindOS."'},{emoji:"\uD83D\uDE80",title:"Project Cold Start",desc:"Spin up a new project in minutes — your profile and SOPs guide the scaffolding automatically.",prompt:'"Help me start a new project following the Startup SOP in MindOS."'},{emoji:"\uD83D\uDD0D",title:"Research & Archive",desc:"Let agents research competitors or topics for you, then file structured results in your knowledge base.",prompt:'"Help me research X, Y, Z products and save results to the MindOS product library."'}],copy:"Copy prompt",hint:'Tip: The agent auto-discovers your knowledge base structure. Just mention "MindOS" in your prompt and it will know where to look. Click "Explore" in the left sidebar for more scenarios.'},shortcuts:{search:"Search files",askAI:"Toggle MindOS",settings:"Open Settings",shortcutPanel:"Keyboard shortcuts panel",editFile:"Edit current file",save:"Save file",closePanel:"Close panel / Exit modal",attachFile:"Attach file in MindOS"},faq:{title:"FAQ",items:[{q:"How do I change the language?",a:"Go to Settings → Appearance → Language. You can switch between English and Chinese."},{q:"How do I connect an AI agent?",a:"Go to Settings → Connections. MindOS auto-detects installed agents (Claude Code, Cursor, etc.) and lets you connect them with one click."},{q:"Where is my data stored?",a:"All your data stays on your local machine as plain Markdown files. MindOS never uploads your data to any cloud service. You own everything."},{q:"How do I sync across devices?",a:"Go to Settings → Sync. MindOS uses Git for cross-device sync. Enter your Git remote URL and access token to start syncing."},{q:"Can I use my own AI provider?",a:"Yes! Go to Settings → AI. You can use OpenAI, Anthropic, Google, or any OpenAI-compatible API with a custom base URL."},{q:"What file formats are supported?",a:"MindOS works best with Markdown (.md) files, but also supports JSON, CSV, and plain text. Plugins extend rendering for special formats like Kanban boards or timelines."},{q:"How do I create a new note?",a:"Click the + icon next to any folder in the file tree, or ask AI to create one for you. Notes are just Markdown files — you can also create them from your file system."}]}},explore:{title:"Explore Use Cases",subtitle:"Discover what you can do with MindOS — pick a scenario and try it now.",tryIt:"Try it",all:"All",byCapability:"By Capability",byScenario:"By Scenario",categories:{"knowledge-management":"Knowledge Management","memory-sync":"Memory Sync","auto-execute":"Auto Execute","experience-evolution":"Experience Evolution","human-insights":"Human Insights","audit-control":"Audit & Control"},scenarios:{"first-day":"First Day",daily:"Daily Work",project:"Project Work",advanced:"Advanced"},c1:{title:"Inject Your Identity",desc:"Tell all AI agents who you are — preferences, tech stack, communication style — in one shot.",prompt:"Here's my resume, read it and organize my info into MindOS."},c2:{title:"Save Information",desc:"Archive articles, meeting notes, or web pages into your knowledge base with one prompt.",prompt:"Help me save the key points from this article into MindOS."},c3:{title:"Cross-Agent Handoff",desc:"Start a plan in MindOS, continue coding in Claude Code, refine in Cursor — zero context loss.",prompt:"Help me start coding based on the plan in MindOS."},c4:{title:"Experience → SOP",desc:"Turn hard-won debugging sessions into reusable workflows that prevent future mistakes.",prompt:"Help me distill this conversation into a reusable workflow in MindOS."},c5:{title:"Capture Ideas on the Go",desc:"Jot down an inspiration on your phone — MindOS archives, decomposes, and assigns to agents.",prompt:"Help me organize this idea into MindOS and break it into actionable sub-tasks."},c6:{title:"Project Cold Start",desc:"Spin up a new project in 4 minutes — your profile and SOPs guide the scaffolding automatically.",prompt:"Help me start a new project following the Startup SOP in MindOS."},c7:{title:"Research & Archive",desc:"Let agents research competitors or topics for you, then file structured results in your KB.",prompt:"Help me research X, Y, Z products and save results to the MindOS product library."},c8:{title:"Network Management",desc:"Log conversations with contacts, auto-generate follow-up TODOs, and keep full context.",prompt:"I met with someone today — update MindOS Connections and create follow-up TODOs."},c9:{title:"Audit & Correct",desc:"Review what agents know about you, fix mistakes in one place, and all agents update instantly.",prompt:"Check my MindOS Profile for accuracy and correct any errors."}}},zh:{common:{relatedFiles:"关联视图"},app:{tagline:"你在此思考,Agent 依此行动",footer:"MindOS \xb7 人机共生知识系统"},login:{tagline:"人类在此思考,Agent 依此行动",subtitle:"请输入密码以继续",passwordLabel:"密码",passwordPlaceholder:"输入密码",signIn:"登录",signingIn:"登录中…",incorrectPassword:"密码错误,请重试。",connectionError:"连接错误,请重试。"},notFound:{title:"文件未找到",description:"该文件不存在于你的知识库中。",createButton:"创建此文件",creating:"创建中...",goToParent:"返回上级目录",goHome:"首页"},updateBanner:{newVersion:(a,b)=>`MindOS v${a} 可用(当前 v${b})`,updateNow:"更新",runUpdate:"终端运行",orSee:"或",releaseNotes:"查看更新说明"},sidebar:{files:"知识库",search:"搜索",searchTitle:"搜索",askTitle:"MindOS",settingsTitle:"设置",plugins:"插件",agents:"智能体",echo:"回响",discover:"探索",workflows:"流程",history:"历史",help:"帮助",syncLabel:"同步",collapseTitle:"收起侧栏",expandTitle:"展开侧栏",collapseLevel:"折叠一级",collapseLevelHint:"折叠一级(双击:全部折叠)",expandLevel:"展开一级",expandLevelHint:"展开一级(双击:全部展开)",importFile:"导入文件",new:"新建",newFile:"新建文件",newSpace:"新建空间",more:"更多",capture:"暂存台",showHiddenFiles:"显示隐藏文件",sync:{synced:"已同步",unpushed:"待推送",unpushedHint:"个提交尚未推送到远程 — 将自动同步",conflicts:"冲突",conflictsHint:"个文件存在合并冲突 — 前往 设置 > 同步 解决",syncError:"同步出错",syncOff:"同步关闭",syncing:"同步中...",syncNow:"立即同步",syncDone:"同步完成",syncFailed:"同步失败",syncRestored:"同步已恢复",enableSync:"启用同步",enableHint:"设置跨设备同步"}},search:{placeholder:"搜索文件...",emptyTitle:"快速查找笔记",emptyHint:"输入文件名或内容关键词",noResults:"未找到匹配的文件",noResultsHint:"尝试其他关键词",prompt:"输入关键词搜索所有文件",navigate:"上下导航",open:"打开",close:"关闭",clear:"清除搜索",dragToChat:"拖入对话",tabSearch:"搜索",tabActions:"快捷操作",openSettings:"打开设置",restartWalkthrough:"重新开始引导",toggleDarkMode:"切换深色模式",goToAgents:"前往智能体",goToDiscover:"前往探索",goToHelp:"前往帮助",walkthroughRestarted:"引导已重置"},shortcutPanel:{title:"快捷键",navigation:"导航",panelsSection:"面板",editor:"编辑器",toggleSearch:"切换搜索",toggleAskAI:"切换 MindOS",openSettings:"打开设置",keyboardShortcuts:"快捷键",closePanel:"关闭面板 / 退出最大化",saveFile:"保存文件",undo:"撤销",redo:"重做",toggleHint:"切换此面板"},...d,home:{recentlyModified:"最近修改",recentlyActive:"最近活跃",recentlyEdited:"最近编辑",allSpaces:"所有空间",spaces:"心智空间",nFiles:a=>`${a} 个文件`,other:"其他",newSpace:"新建空间",spaceName:"空间名称",spaceDescription:"描述",spaceDescPlaceholder:"描述这个空间的用途",spaceNameNoSlash:"名称不能包含 / 或 \\",spaceExists:"已存在同名空间",spaceCreateFailed:"创建空间失败",noSpacesYet:"还没有空间,创建一个来整理你的知识吧。",spaceLocation:"位置",rootLevel:"根目录",optional:"可选",aiInit:"AI 初始化内容",aiInitHint:"AI 将自动生成空间说明和操作指南",aiInitNoKey:"在 设置 → AI 中配置 API 密钥以启用",aiInitGenerating:a=>`正在为「${a}」生成内容`,aiInitReady:a=>`「${a}」已就绪`,aiInitReview:"查看",aiInitDiscard:"撤销",aiInitReverted:a=>`「${a}」已恢复为模板`,createSpace:"创建",cancelCreate:"取消",continueEditing:"继续编辑",newNote:"新建笔记",builtinFeatures:"工具面板",builtinActive:"已启用",builtinInactive:"未激活",toolName:{"agent-inspector":"审计面板","config-panel":"配置面板",todo:"待办面板","workflow-yaml":"工作流"},toolDesc:{"agent-inspector":"查看 Agent 操作日志与调用轨迹","config-panel":"编辑和管理全局配置项",todo:"以看板形式管理待办事项","workflow-yaml":"执行多步骤工作流,AI 辅助执行"},plugins:"扩展",changeHistory:"变更历史",showMore:"查看更多",showLess:"收起",viewAll:"查看全部",wikiTagline:"你的知识空间,井然有序。",sortRecent:"最近",sortName:"字母序",sortCount:"文件数",createToActivate:"创建 {file} 以启用",shortcuts:{searchFiles:"搜索文件",askAI:"MindOS",editFile:"编辑文件",save:"保存",settings:"设置"},relativeTime:{justNow:"刚刚",minutesAgo:a=>`${a} 分钟前`,hoursAgo:a=>`${a} 小时前`,daysAgo:a=>`${a} 天前`},cleanupExamples:a=>`有 ${a} 个模板示例文件可以清理`,cleanupExamplesButton:"一键清理",cleanupExamplesDone:"示例文件已清理"},echoSpotlight:{title:"回响",dailyLine:"今日一行",placeholder:"写下今天的一行想法…",invite:"记录今天的一行想法",inviteDesc:"一行就够。回响会沉淀你的思维模式。",goToEcho:"打开回响",savedLocally:"保存在本设备"},dailyEcho:{title:"每日回响报告",generate:"生成今日报告",generating:"生成中...",generated:"生成于 {time}",regenerate:"重新生成",download:"下载 PDF",continueAgent:"继续与 Agent",error:"生成失败",retry:"重试",snapshotTitle:"\uD83D\uDCCA 今日动向",snapshotFilesEdited:"文件编辑",snapshotFilesCreated:"新建文件",snapshotSessions:"聊天会话",snapshotKbGrowth:"知识库增长",themesTitle:"\uD83C\uDFAF 今日主题",themeFiles:"个文件",alignmentTitle:"✅ 对齐度",alignmentScore:"评分",alignmentMisaligned:"偏离",alignmentPartial:"部分对齐",alignmentAligned:"充分对齐",reflectionTitle:"❓ 明天思考"},suggestion:{title:"你可能想",staleFiles:a=>`${a} 个文件超过 30 天未更新`,reviewStale:"查看",dismiss:"忽略"},inbox:{title:"暂存台",count:a=>`${a}`,emptyTitle:"快速捕获,稍后整理",emptyDesc:"拖拽文件到此处,或点击上传按钮,即刻保存到暂存台。",uploadButton:"上传文件",organizeButton:"AI 整理",organizing:"整理中...",viewAll:"查看全部",more:a=>`还有 ${a} 个`,viewAllFiles:a=>`查看 Inbox 中全部 ${a} 个文件`,viewAllHistory:a=>`查看全部 ${a} 条记录 →`,agingHint:"7天+",savedToast:a=>`${a} 个文件已保存到暂存台`,savedToDir:(a,b)=>`${a} 个文件已保存到 ${b}`,savedWithSkipped:(a,b)=>a>0?`已保存 ${a} 个,跳过 ${b} 个(格式不支持)`:`${b} 个文件被跳过(格式不支持)`,tooLarge:a=>`${a} 个文件过大(上限 10 MB)`,savedWithOversized:(a,b)=>`已保存 ${a} 个,${b} 个过大被跳过`,organizePrompt:a=>`请将暂存台中的这些文件整理到知识库的合适位置。分析每个文件的内容,将其移动到最匹配的空间或目录。需要的话可以创建新目录。以下是待整理的文件:
107
+ ${a.trim()||"(nothing written yet)"}`,growthIntentLabel:"What you are steering toward",growthIntentPlaceholder:"Write your current intent…",growthSavedNote:"Saved locally.",imprintLead:"Write one line about today. Generate a report or chat to go deeper.",growthLead:"Write what you're working toward. Review it over time to see how it evolves.",selfLead:"Notes about you surface here as your knowledge base grows."},agentsContent:{title:"Agents",subtitle:"Connections, skills, and status at a glance.",workspacePulse:{title:"Your Agents",connected:"Connected",detected:"Detected",notFound:"Not found",risk:"Risks",enabledSkills:"Skills on",healthy:"Healthy",needsAttention:a=>`${a} issue${1!==a?"s":""}`},navOverview:"Overview",navMcp:"MCP",navSkills:"Skills",navNetwork:"Network",navSessions:"Sessions",navActivity:"Activity",navChannels:"Channels",channelsSubtitle:"Connect messaging platforms to let MindOS send messages on your behalf.",activitySubtitle:"Agent operations audit log.",activity:{loading:"Loading activity...",empty:"No agent operations logged yet.",emptyHint:"Operations from connected agents will appear here.",agentLabel:"Agent"},a2aTabTitle:"Remote Agents",a2aTabEmptyHint:"Discover agents to enable cross-agent delegation.",backToOverview:"Back to Agents",na:"N/A",status:{connected:"Connected",detected:"Detected",notFound:"Not found"},overview:{connected:"Connected",detected:"Detected",notFound:"Not found",riskQueue:"Attention",noRisk:"All clear — no issues detected.",usagePulse:"All agents",nextAction:"Suggested next",nextActionHint:"Reconnect detected agents first, then enable remaining skills.",riskLevelError:"Error",riskLevelWarn:"Warning",na:"N/A",colAgent:"Agent",colStatus:"Status",colMcp:"MCP",colSkills:"Skills",colMode:"Mode",colRuntime:"Runtime",pulseMcp:"MCP",pulseTools:"Tools",mcpOffline:"Offline",toolsUnit:a=>`${a} tools`,enabledUnit:a=>`${a} enabled`,agentCount:a=>`${a} agent${1!==a?"s":""}`,runtimeActive:"Active",riskMcpStopped:"MCP server is not running.",riskDetected:a=>`${a} detected agent(s) need configuration.`,riskSkillsDisabled:"All skills are disabled.",recentActivity:"Recent Activity",viewAll:"View all",showLess:"Show less",addCustomAgent:"Add your own agent",addCustomAgentTitle:"Add Custom Agent",editCustomAgentTitle:a=>`Edit ${a}`,customAgentName:"Agent Name",customAgentNamePlaceholder:"e.g. QCLaw, WorkBuddy",customAgentDir:"Config Directory",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"Common: ~/.xxx/ or ~/Library/Application Support/",customAgentKeyPreview:a=>`Key: ${a}`,customAgentContinue:"Continue",customAgentDetecting:"Detecting...",customAgentDirFound:"Directory found",customAgentDirNotFound:"Not found yet — agent will appear when installed",customAgentDetectTimeout:"Detection timed out, using defaults",customAgentDetectedTitle:"Detected Configuration",customAgentDefaultTitle:"Default Configuration",customAgentConfigLabel:"MCP Config",customAgentFormatLabel:"Format",customAgentTransportLabel:"Transport",customAgentSkillsLabel:"Skills",customAgentSkillsFound:a=>`${a} skill${1!==a?"s":""} found`,customAgentSkillsNone:"Not detected",customAgentSkillDir:"Skills Directory",customAgentSkillDirHint:"Where skills are installed for this agent",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"Customize these settings",customAgentAdd:"Add Agent",customAgentAdding:"Adding...",customAgentSave:"Save Changes",customAgentSaving:"Saving...",customAgentRetry:"Retry",customAgentAdded:a=>`${a} added`,customAgentUpdated:a=>`${a} updated`,customAgentRemoved:a=>`${a} removed`,customAgentRemoveTitle:a=>`Remove "${a}"?`,customAgentRemoveMessage:"This removes the agent from MindOS. No files will be deleted on disk.",customAgentRemoveConfirm:"Remove",customAgentConfigPath:"MCP Config File Path",customAgentConfigKey:"Config Key",customAgentFormat:"Format",customAgentTransport:"Transport",customAgentProjectConfig:"Project Config (optional)",customAgentCliBinary:"CLI Binary (optional)",customAgentCliBinaryPlaceholder:"e.g. qclaw",customAgentEdit:"Edit",customAgentRemove:"Remove",customAgentCancel:"Cancel",customAgentNetworkError:"Network error. Please try again.",customAgentFailedSave:"Failed to save",customAgentFailedRemove:"Failed to remove",customAgentKeyConflict:a=>`An agent with key "${a}" already exists`,customAgentBuiltinConflict:a=>`Conflicts with built-in agent "${a}"`},mcp:{title:"MCP Connections",refresh:"Refresh",connectionGraph:"Server connections across agents",tabs:{manage:"Manage",topology:"Topology",byAgent:"By Agent",byServer:"By MCP Server"},searchPlaceholder:"Search agents...",installMindos:"Install MindOS MCP",installed:"Installed",mcpServerLabel:"MCP Server",searchServersPlaceholder:"Search MCP servers...",serverAgentCount:a=>`${a} agent${1!==a?"s":""}`,emptyState:"No agents match current filters.",resultCount:a=>`${a} agents`,filteredSummaryTitle:"Filtered status summary",filteredConnected:a=>`Connected: ${a}`,filteredDetected:a=>`Detected: ${a}`,filteredNotFound:a=>`Not found: ${a}`,crossAgentServersTitle:"MCP Servers",crossAgentServersEmpty:"No MCP servers detected.",crossAgentServerAgents:a=>`Used by ${a}`,configVisibilityTitle:"Configuration",hiddenRootDetected:(a,b)=>`Hidden roots: ${a}/${b}`,runtimeSignalDetected:(a,b)=>`Runtime signals: ${a}/${b}`,riskQueueTitle:"Attention",riskMcpStopped:"MCP server is not running.",riskDetected:a=>`${a} detected agent(s) need configuration.`,riskNotFound:a=>`${a} agent(s) not found on this machine.`,riskSkillsDisabled:"All skills are disabled.",bulkReconnectFiltered:"Reconnect all",bulkRunning:"Running reconnect...",bulkSummary:(a,b)=>`Reconnected ${a}, failed ${b}.`,transportFilters:{all:"All transport",stdio:"stdio",http:"http",other:"other"},filters:{all:"All",connected:"Connected",detected:"Detected",notFound:"Not found"},table:{agent:"Agent",status:"Status",transport:"Transport",actions:"Actions"},actions:{copySnippet:"Copy Snippet",copied:"Copied",testConnection:"Test Connection",reconnect:"Reconnect"},addAgent:"Add",removeFromServer:"Remove",confirmRemoveTitle:"Remove from server?",confirmRemoveMessage:(a,b)=>`Remove "${a}" from "${b}"? The agent config will be updated automatically.`,cancel:"Cancel",noAvailableAgents:"All agents already connected.",manualRemoveHint:"Flagged for removal — edit the agent config to finalize.",removeSuccess:"Removed. Restart your agent to apply.",removeFailed:"Failed to remove. Try editing the config file manually.",reconnectAllInServer:"Reconnect all",reconnectAllRunning:"Reconnecting...",reconnectAllDone:(a,b)=>`Done: ${a} reconnected${b>0?`, ${b} failed`:""}.`,serverTransport:a=>`Transport: ${a}`,mcpDisabledMessage:"MCP mode is not enabled.",mcpDisabledHint:"Enable it in Settings → Connections to use MCP agents."},skills:{title:"Skills",summaryTitle:"Skill Status",summaryEnabled:a=>`Enabled: ${a}`,summaryDisabled:a=>`Disabled: ${a}`,summaryAttention:a=>`Needs attention: ${a}`,crossAgentSkillsTitle:"Installed Skills",crossAgentSkillsEmpty:"No skills detected.",crossAgentSkillAgents:a=>`Installed in ${a}`,capabilityGroups:"Skill management across agents",registrySummaryTitle:"Skill Registry",registryUniversal:a=>`Universal: ${a}`,registryAdditional:a=>`Additional: ${a}`,registryUnsupported:a=>`Unsupported: ${a}`,registryHiddenRoots:(a,b)=>`Hidden roots: ${a}/${b}`,tabs:{manage:"Manage",matrix:"Matrix",bySkill:"By Skill",byAgent:"By Agent"},searchPlaceholder:"Search skills...",agentSkillMode:"Skill Mode",agentMcpServers:"MCP Servers",agentNativeSkills:"Native Skills",agentMindosSkills:"MindOS Skills",noAgentsYet:"No agents detected yet.",moreSkills:a=>`+${a} more`,sourceAll:"All",sourceBuiltin:"Built-in",sourceUser:"Custom",sourceNative:"Native",summaryNative:a=>`Native: ${a}`,statusAll:"All status",statusEnabled:"Enabled",statusDisabled:"Disabled",statusAttention:"Needs attention",capabilityAll:"All capabilities",bulkEnableFiltered:"Enable all",bulkDisableFiltered:"Disable all",bulkRunning:"Applying changes...",bulkNoChanges:"No skill changes needed.",bulkAllSucceeded:a=>`Updated ${a} skills.`,bulkPartialFailed:(a,b)=>`Updated ${a}, failed ${b}.`,resultCount:a=>`${a} skills`,matrixAgentFocusLabel:"Agent focus",matrixAgentFocusAll:"All agents",matrixColumnSkill:"Skill",matrixEnabled:"Enabled",matrixDisabled:"Disabled",matrixUnsupported:"Unsupported",matrixNoAgents:"No agents available for matrix.",noSkillsMatchFilter:"No skills match current filters.",matrixEmpty:"No skills match current filters.",addAgentToSkill:"Add",removeAgentFromSkill:"Remove",confirmRemoveAgentTitle:"Remove from skill?",confirmRemoveAgentMessage:(a,b)=>`Remove "${a}" from "${b}"? This requires editing the agent config file.`,cancelSkillAction:"Cancel",noAvailableAgentsForSkill:"All agents already have this skill.",manualSkillHint:"Flagged — edit the agent config to finalize.",skillDescription:"Description",skillNoDescription:"No description available.",skillDeleteAction:"Delete",confirmDeleteSkillTitle:"Delete skill?",confirmDeleteSkillMessage:a=>`Permanently delete skill "${a}"? This cannot be undone.`,skillDeleted:"Skill deleted.",skillDeleteFailed:"Failed to delete skill.",copyInstallCmd:"Copy install command",installCmdCopied:"Copied!",skillAgentCount:a=>`${a} agent${1===a?"":"s"}`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} skills`,showAllNative:a=>`Show all ${a}`,collapseNative:"Collapse",emptyGroup:"No skills in this group.",groupLabels:{research:"Research",coding:"Coding",docs:"Docs",ops:"Ops",memory:"Memory"},skillPopover:{close:"Close",source:"Source",sourceBuiltin:"Built-in",sourceUser:"Custom",sourceNative:"Native",capability:"Capability",path:"File path",enabled:"Enabled",disabled:"Disabled",agents:"Agents",noAgents:"No agents have this skill.",content:"Skill content",loading:"Loading...",loadFailed:"Failed to load skill content.",retry:"Retry",copyContent:"Copy",copied:"Copied!",noDescription:"No description available.",deleteSkill:"Delete",confirmDeleteTitle:"Delete skill?",confirmDeleteMessage:a=>`Permanently delete skill "${a}"? This cannot be undone.`,confirmDeleteAction:"Delete",cancelAction:"Cancel",deleted:"Skill deleted.",deleteFailed:"Failed to delete skill."}},detail:{healthStripTitle:"Status",healthConnected:"Connected",healthInstalled:"MCP installed",healthRuntimeSignals:"Runtime signals",healthConfiguredServers:"Configured servers",healthInstalledSkills:"Native installed skills",identity:"Identity",connection:"Connection",capabilities:"Capability Profile",skillAssignments:"Skill Assignments",runtimeSignals:"Runtime",recentActivity:"Recent Activity",spaceReach:"Space Reach",agentKey:"Agent key",status:"Status",transport:"Transport",endpoint:"Endpoint",port:"Port",auth:"Auth",authConfigured:"Configured",authMissing:"Missing",projectScope:"Project scope",globalScope:"Global scope",format:"Config format",skillMode:"Skill mode",hiddenRoot:"Hidden root path",hiddenRootPresent:"Hidden root",conversationSignal:"Conversation",usageSignal:"Usage",lastActivityAt:"Last active",skillsAll:"All skills",skillsEnabled:"Enabled skills",skillsSourceBuiltin:"Built-in",skillsSourceUser:"Custom",skillsSearchPlaceholder:"Search all configured skills...",skillsFilterAll:"All",skillsFilterBuiltin:"Built-in",skillsFilterUser:"Custom",skillEnable:"Enable",skillDisable:"Disable",skillEdit:"Edit",skillSave:"Save",skillCancel:"Cancel",skillActionLoading:"Working...",skillReadFailed:"Failed to read skill content.",skillSaveFailed:"Failed to save skill content.",mcpManagement:"MCP Management",mcpInstalled:"Installed",mcpScope:"Current scope",mcpConfigPath:"Config path",mcpTargetScope:"Target scope",mcpTargetTransport:"Target transport",mcpScopeProject:"Project",mcpScopeGlobal:"Global",mcpCopySnippet:"Copy snippet",mcpCopied:"Copied",mcpRefresh:"Refresh status",mcpReconnect:"Apply MCP config",mcpApplying:"Applying MCP config...",mcpApplySuccess:"MCP config applied.",mcpApplyFailed:"Failed to apply MCP config.",nativeInstalledSkills:"Installed Skills",nativeInstalledSkillsCount:a=>`${a} detected`,nativeInstalledSkillsEmpty:"No installed skills detected.",nativeInstalledSkillsMore:a=>`+${a} more`,configuredMcpServers:"MCP Servers",configuredMcpServersCount:a=>`${a} detected`,configuredMcpServersEmpty:"No MCP servers configured.",configuredMcpServersMore:a=>`+${a} more`,yes:"Yes",no:"No",noSkills:"No enabled skills.",noActivity:"No activity recorded yet.",noSpaceReach:"No space reach data yet.",skillDelete:"Delete",skillDeleteConfirm:a=>`Delete skill "${a}"? This cannot be undone.`,skillDeleteSuccess:"Skill deleted.",skillDeleteFailed:"Failed to delete skill.",mcpServerAdd:"Add MCP server",mcpServerRemove:"Remove",mcpServerRemoveConfirm:a=>`Remove "${a}" from this agent? This requires editing the config file.`,mcpServerHint:"Flagged — edit the agent config to finalize.",mcpReconnectAll:"Reconnect all",mcpReconnectAllRunning:"Reconnecting...",mcpReconnectAllDone:(a,b)=>`Reconnected ${a}${b>0?`, failed ${b}`:""}.`,runtimeDiagTitle:"Runtime & Diagnostics",runtimePing:"Ping",runtimePinging:"Pinging...",runtimePingOk:a=>`Reachable (${a}ms)`,runtimePingFail:"Unreachable",runtimeUptime:"Uptime",runtimePid:"Process",runtimeMemory:"Memory",runtimeVersion:"Version",runtimeStartedAt:"Started",runtimeNoData:"No runtime data available.",envPermTitle:"Environment & Permissions",envVars:"Environment variables",envVarsCount:a=>`${a} configured`,envVarsEmpty:"No custom environment variables.",envScope:"Scope",envReadOnly:"Read-only access",envWriteAccess:"Write access",envFileAccess:"File access",envNetworkAccess:"Network access",envAllowed:"Allowed",envRestricted:"Restricted",activityTitle:"Activity & Usage",activityTotal:"Total invocations",activityLast7d:"Last 7 days",activityLastInvocation:"Last invocation",activityTokensUsed:"Tokens used",activityAvgLatency:"Avg latency",activityNoData:"No activity recorded yet.",knowledgeInteraction:"Knowledge Interaction",knowledgeNoData:"No interactions yet. Agents will show activity here once they start working with your knowledge base.",recentOps:"Recent Operations",statTotalCalls:"Total calls",statFilesTouched:"Files touched",statReadWrite:"Read / Write",statHealth:"Health",viewFullLog:"View full log",showLess:"Show less"},detailSubtitle:"",detailNotFound:"Agent not found — it may have been removed or renamed.",detailNotFoundHint:"The agent may have disconnected or its configuration file was moved. Try restarting the agent or check the MCP configuration.",detailNotFoundSuggestion:"Connected agents you can explore:"},settings:{title:"Settings",tabs:{ai:"AI",appearance:"Appearance",knowledge:"General",sync:"Sync",mcp:"Connections",plugins:"Plugins",shortcuts:"Shortcuts",monitoring:"Monitoring",agents:"Agents",update:"Update",uninstall:"Uninstall"},ai:{provider:"Model Providers",model:"Model",apiKey:"API Key",baseUrl:"Base URL",baseUrlHint:"Optional. Use for proxies or custom API endpoints.",keyHint:"Stored locally in ~/.mindos/config.json",keyOptionalHint:"Optional for local providers. Stored in ~/.mindos/config.json",keyChange:"Change",keyCancel:"Cancel",envHint:"Fields marked env have a value from environment variables. You can override them here, or restore all to env defaults.",envFieldNote:a=>`Env var ${a} is set. Clear this field to fall back to it.`,resetToEnv:"Reset to env value",restoreFromEnv:"Restore from env",noApiKey:"API key is not set. AI features will be unavailable until you add one.",testKey:"Test",testKeyTesting:"Testing...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"Invalid API key",testKeyModelNotFound:"Model not found",testKeyEndpointError:"Endpoint or protocol mismatch",testKeyRateLimited:"Rate limited, try again later",testKeyNetworkError:"Network error",testKeyNoKey:"No API key configured",testKeyUnknown:"Test failed",listModels:"Browse",noModelsFound:"No models found",resetProvider:"Reset",resetProviderConfirm:"Click again to confirm"},customProviders:{title:"Model Providers",subtitle:"Add custom API endpoints with your own names",addButton:"+ Add Provider",editButton:"Edit",deleteButton:"Delete",testButton:"Test",emptyState:"No custom providers yet. Add one to use custom API endpoints or proxies.",modal:{titleAdd:"Add Model Provider",titleEdit:"Edit Model Provider",fieldName:"Name",fieldNameHint:"e.g., Company GPT-4, Local LLaMA",fieldProtocol:"Protocol",fieldProtocolHint:"(Most local servers use OpenAI-compatible)",fieldBaseUrl:"Base URL",fieldBaseUrlHint:"e.g., https://api.company.com/v1 or http://localhost:8080/v1",fieldApiKey:"API Key",fieldApiKeyHint:"Leave empty if not required (e.g., for local servers)",fieldModel:"Model",fieldModelHint:"e.g., gpt-4-turbo, llama3.2",buttonCancel:"Cancel",buttonSave:"Save & Test",buttonSaveOnly:"Save",validating:"Testing connection...",success:"✓ Connected",error:"Connection failed"},deleteConfirm:a=>`Delete "${a}"? This cannot be undone.`,deleteConfirmButton:"Delete"},agent:{title:"Agent Behavior",subtitle:"Configure how the AI agent operates",maxSteps:"Max Steps",maxStepsHint:"Maximum tool call steps per request (1-30)",contextStrategy:"Context Strategy",contextStrategyHint:"Auto: summarize early messages when context fills up. Off: no summarization (emergency pruning still applies).",contextStrategyAuto:"Auto (compact + prune)",contextStrategyOff:"Off",thinking:"Extended Thinking",thinkingHint:"Show Claude's reasoning process (uses more tokens)",thinkingBudget:"Thinking Budget",thinkingBudgetHint:"Max tokens for reasoning (1000-50000)",reconnectRetries:"Auto Reconnect",reconnectRetriesHint:"When connection drops, automatically retry this many times before giving up (0 = disabled)"},appearance:{readingTitle:"Reading",readingDesc:"Customize how your notes look",readingFont:"Reading font",fontSize:"Font size",fontSizePreview:"The quick brown fox.",contentWidth:"Content width",preferencesTitle:"Preferences",colorTheme:"Color theme",system:"System",dark:"Dark",light:"Light",language:"Language",browserNote:"Appearance settings are saved in your browser.",labsTitle:"Labs",labsDesc:"Experimental features still in development. May change or be removed.",labsEcho:"Echo",labsEchoDesc:"Reflective journaling powered by your notes.",labsWorkflows:"Flows",labsWorkflowsDesc:"Visual workflow automation for agents.",fontPreview:"The quick brown fox jumps over the lazy dog."},knowledge:{cardTitle:"Knowledge Base",securityTitle:"Security",passwordPlaceholder:"Leave empty to disable",passwordShow:"Show",passwordHide:"Hide",tokenNotSet:"— not set —",mcpUrl:"MCP URL",tokenGenerated:"New token generated. Copy it now — it won't be shown in full again.",monitoringTitle:"System Monitoring",monitoringFailed:"Failed to load monitoring data",monitorHeap:"Heap",monitorRss:"RSS",monitorUptime:"Uptime",monitorNode:"Node",monitorRequests:"Requests",monitorToolCalls:"Tool Calls",monitorTokens:"Tokens",monitorFiles:"Files",monitorErrors:"Errors",monitorMcpRunning:a=>`Running :${a}`,monitorMcpStopped:"Stopped",cancel:"Cancel",mindRoot:"Knowledge base root",mindRootHint:"Absolute path to your notes directory. Requires server restart to take effect.",mindRootEnvHint:a=>`MIND_ROOT env var is set to "${a}". Fill in above to override it.`,envNote:"MIND_ROOT env var is set. Fill in above to override it — your value takes priority.",webPassword:"Web UI password",webPasswordHint:"Protect the browser UI with a password. Leave empty to disable. Changes take effect on next page load.",webPasswordClear:"Clear password",authToken:"MCP / API auth token",authTokenHint:"Bearer token for Agent and MCP clients. Not required for browser access.",authTokenNone:"No token set — API is open to all requests.",authTokenCopy:"Copy",authTokenCopied:"Copied!",authTokenReset:"Regenerate",authTokenClear:"Clear token",authTokenResetConfirm:"Regenerate token? All existing MCP clients will need to update their config.",authTokenMcpPort:"MCP port",restartWalkthrough:"Restart walkthrough",showHiddenFiles:"Show hidden files",showHiddenFilesHint:"Display dot-prefixed folders (.agents, .claude, .mindos, etc.) in the file tree.",cleanupExamples:"Clean up example files",cleanupExamplesHint:"Remove all template example files (\uD83E\uDDEA_example_*) from your knowledge base.",cleanupExamplesButton:"Clean up",cleanupExamplesNone:"No example files found",cleanupExamplesConfirm:a=>`Delete ${a} example file${a>1?"s":""}? This cannot be undone.`,cleanupExamplesDone:a=>`Removed ${a} example file${a>1?"s":""}`,cleanupExamplesScanning:"Scanning..."},sync:{emptyTitle:"Cross-device Sync",emptyDesc:"Automatically sync your knowledge base across devices via Git.",featureAutoCommit:"Auto-commit on save",featureAutoPull:"Auto-pull from remote",featureConflict:"Conflict detection",featureMultiDevice:"Works across devices",remoteUrl:"Git Remote URL",invalidUrl:"Invalid Git URL — use HTTPS (https://...) or SSH (git@...)",sshBrief:"one-time key setup, no token needed",httpsBrief:"works anywhere, token recommended",sshHint:"Requires SSH key on this machine. Verify with: ssh -T git@github.com",accessToken:"Access Token",optional:"(optional, for private repos)",tokenHint:"GitHub:",tokenLink:"Create a token (repo scope)",branchLabel:"Branch",connectButton:"Connect & Start Sync",connecting:"Connecting...",stepConnecting:"Connecting to remote...",stepAuthenticating:"Authenticating...",stepSyncing:"Syncing data...",stepAlmostDone:"Almost done...",stepDone:"Sync configured successfully!",gitignoreTitle:"Excluded files",gitignorePlaceholder:"# Files to exclude from sync\n*.tmp\nsecret/",gitignoreSave:"Save",gitignoreSaved:"Saved",conflictExplain:"These files were changed on both this device and the remote. Choose which version to keep.",keepLocal:"Keep local",keepRemote:"Keep remote",keepLocalHint:"Keep this device's version",keepRemoteHint:"Replace with the remote version",viewDiff:"Click to compare versions",localVersion:"Local (this device)",remoteVersion:"Remote",emptyFile:"(empty)",sectionTitle:"Sync",labelProvider:"Provider",labelRemote:"Remote",labelBranch:"Branch",labelLastSync:"Last sync",labelUnpushed:"Unpushed",labelAutoSync:"Auto-sync",unpushedCommits:a=>`${a} commits`,syncNow:"Sync Now",disableAutoSync:"Disable Auto-sync",enableAutoSync:"Enable Auto-sync",syncComplete:"Sync complete",syncFailed:"Sync failed",autoSyncDisabled:"Auto-sync disabled",autoSyncEnabled:"Auto-sync enabled",toggleFailed:"Failed to toggle sync",conflictsTitle:a=>`Conflicts (${a})`,conflictHint:"Click a file to view your version. Hover and click",conflictHintSuffix:"to see the remote version.",timeNever:"never",timeJustNow:"just now",timeMinAgo:a=>`${a}m ago`,timeHourAgo:a=>`${a}h ago`,timeDayAgo:a=>`${a}d ago`},plugins:{title:"Installed Renderers",builtinBadge:"built-in",coreBadge:"core",enabled:"Enabled",disabled:"Disabled",matchHint:"Auto-activates on",coreHint:"Core renderer — always enabled",noPlugins:"No renderers installed.",comingSoon:"Plugin marketplace coming soon."},mcp:{modeCardTitle:"Connection Mode",modeCardDesc:"Choose how agents connect to MindOS.",cliLabel:"CLI",cliModeDesc:"Claude Code, Gemini CLI, Codex, etc.",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop, Cursor, Windsurf, etc.",alwaysOn:"Always On",mcpRunning:"Running",mcpStopped:"Stopped",mcpEnabledHint:"MCP mode enabled. Disable to simplify the interface if you only use CLI agents.",mcpDisabledHint:"Enable MCP to connect Desktop clients like Claude Desktop or Cursor.",serverTitle:"MindOS MCP Server",status:"Status",running:"Running",stopped:"Stopped",transport:"Transport",endpoint:"Endpoint",tools:"Tools",toolsRegistered:a=>`${a} registered`,auth:"Auth",authSet:"Token set",authNotSet:"No token",copyEndpoint:"Copy Endpoint",copyConfig:"Copy Config",copied:"Copied!",agentsTitle:"Agent Configuration",agent:"Agent",scope:"Scope",project:"Project",global:"Global",installed:"Installed",notInstalled:"Not installed",detected:"Detected",notFound:"Not found",transportStdio:"stdio (recommended)",transportHttp:"http",transportAuto:"auto (recommended)",httpUrl:"MCP URL",httpToken:"Auth Token",installSelected:"Install Selected",installing:"Installing...",installSuccess:a=>`${a} agent(s) configured`,installFailed:"Install failed",portLabel:"MCP Port",portHint:"Changes require server restart",skillsTitle:"Skills",skillsDesc:"Teach agents how to operate your knowledge base.",skillAutoLoaded:"Auto-loaded on every request",skillSource:"Source",skillBuiltin:"Built-in",skillUser:"Custom",addSkill:"+ Add Skill",cliInstallHint:"Install via CLI:",skillPathHint:"Skill files installed at:",deleteSkill:"Delete",editSkill:"Edit",saveSkill:"Save",cancelSkill:"Cancel",skillName:"Name",skillDesc:"Description",skillContent:"Content",skillNameConflict:"A skill with this name already exists",skillDeleteConfirm:a=>`Delete skill "${a}"? This cannot be undone.`,skillLanguage:"Skill Language",skillLangEn:"English",skillLangZh:"中文",searchSkills:"Search skills...",customGroup:"Custom",builtinGroup:"Built-in",noSkillsMatch:a=>`No skills match "${a}"`,skillTemplate:"Template",skillTemplateGeneral:"General",skillTemplateToolUse:"Tool-use",skillTemplateWorkflow:"Workflow",selectDetected:"Select Detected",clearSelection:"Clear",quickSetup:"Quick Setup",configureFor:"Configure for",configPath:"Config path",transportLocal:"Local",transportRemote:"Remote",transportLocalHint:"Local — same machine as MindOS server",transportRemoteHint:"Remote — connect from another device via HTTP",remoteDetectedHint:"Using your current remote IP.",remoteManualHint:"Replace 127.0.0.1 with your server's public or LAN IP.",remoteSteps:"To connect from another device: ① Open port {port} in firewall/security group ② Use the config below in your Agent ③ For public networks, consider SSH tunnel for encryption.",noAuthWarning:"⚠ No auth token — set one in Settings → General before enabling remote access.",showJson:"Show JSON",hideJson:"Hide JSON",connectionTitle:"Connect Agents",connectionHint:"Choose how your AI agents connect to MindOS.",tokenCardTitle:"Auth Token",tokenCardDesc:"Used by CLI remote mode and MCP connections.",mcpHint:"For Claude Desktop, Cursor, and agents that use MCP tool protocol.",tokenLabel:"Auth Token",tokenMasked:"Click Show to reveal the full token",tokenShow:"Show",tokenHide:"Hide",tokenCopy:"Copy",tokenCopied:"Token copied!",tokenNone:"No token set — your MCP server is open to all requests.",tokenNoneAction:"Generate a token in Settings → General → Security.",serverUrl:"MCP Server URL",serverUrlCopy:"Copy URL",howToConnect:"How to connect an AI agent",howToStep1:"Open your agent's MCP settings (e.g. Claude Code, Cursor)",howToStep2:"Add a new MCP server with the URL above",howToStep3:"Set the Auth Token as the bearer token",howToStep4:"Save and verify the connection",cliSkillTitle:"CLI Skill",cliSkillHint:"For agents with bash (Claude Code, Gemini CLI, Codex) — lower token cost, no MCP needed.",cliSkillDesc:"Lower token cost, Skill included — just install and go.",cliLocalDesc:"MindOS Skill is built-in. Install the CLI and you're good to go.",cliRemoteDesc:"Install the CLI on another machine and connect to this MindOS server.",cliSkillInstall:"Install",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"Remote",cliSkillVerify:"Verify",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"Configure",cliInstallSkill:"Install Skill",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"Requires per-agent MCP config. Install Skill separately via",mcpLocalDesc:"Copy the config snippet and paste into your agent's MCP settings.",mcpRunningLabel:"MCP Running",mcpServerStatus:"MCP Server",autoInstallAgents:"Auto-install to detected agents",detectedAgentsTitle:"Detected Agents",cliInstallDesc:"Install the MindOS Skill to your agent so it can operate your knowledge base.",mcpInstallDesc:"Install MCP config + Skill to detected agents on this machine.",tokenCopyFullHint:"Copies full token",skillsInstalled:"skills installed",recommended:"Recommended",localTitle:"Local",localReady:"Ready to use",remoteTitle:"Remote Access",remoteSubtitle:"Connect from another device",restarting:"Restarting...",restart:"Restart",portsCardTitle:"Server Ports",portsCardDesc:"Web UI and MCP server ports. Changes take effect after restart.",webPortLabel:"Web UI Port",webPortHint:"The port your browser connects to.",mcpPortLabel:"MCP Server Port",mcpPortHint:"The port agents and desktop apps connect to.",portChecking:"Checking…",portAvailable:"Available",portSelf:"Current port",portInUse:a=>`Port ${a} is in use`,portSuggest:a=>`Use ${a}`,portConflict:"Web and MCP ports must be different.",portUpdating:"Saving…",portWebRestarting:"Restarting server…",portMcpRestarting:"Restarting MCP…",portUpdateSuccess:"Ports updated successfully.",portUpdateFailed:"Failed to update ports.",portRestartTimeout:"Restart timed out. Please try again.",portRedirecting:"Redirecting to new address…",portUpdateBtn:"Update Ports",externalToolsTitle:"External MCP Tools",externalToolsDesc:"Configure tool access mode for external MCP servers."},monitoring:{system:"System",heapMemory:"Heap Memory",rss:"RSS",uptime:"Uptime",nodeVersion:"Node",application:"Application",requests:"Requests",toolCalls:"Tool Calls",avgResponse:"Avg Response",tokens:"Tokens",errors:"Errors",knowledgeBase:"Knowledge Base",files:"Files",totalSize:"Total Size",rootPath:"Root",mcpStatus:"Status",mcpRunning:"Running",mcpStopped:"Stopped",mcpPort:"Port",autoRefresh:"Auto-refresh every 5s",fetchError:"Failed to load monitoring data"},agents:{mcpServer:"MCP Server",running:"Running",stopped:"Not running",restarting:"Restarting...",restart:"Restart",onPort:a=>`on :${a}`,refresh:"Refresh",refreshing:"Refreshing...",connected:"Connected",connectedCount:a=>`Connected (${a})`,detectedNotConfigured:"Detected but not configured",detectedCount:a=>`Detected but not configured (${a})`,notDetected:"Not Detected",notDetectedCount:a=>`Not Detected (${a})`,showAll:"Show all",hideAll:"Hide",connect:"Connect",noAgents:"No agents detected on this machine.",fetchError:"Failed to load agent data",autoRefresh:"Auto-refresh every 30s"},save:"Save",saved:"Saved",saveFailed:"Save failed",reconfigure:"Reconfigure",askDisplayMode:{label:"Display Mode",hint:"Side panel stays docked on the right. Popup opens a floating dialog.",panel:"Side Panel",popup:"Popup"},update:{checking:"Checking for updates...",upToDate:"You're up to date",available:(a,b)=>`Update available: v${a} → v${b}`,updating:"Updating MindOS... The server will restart shortly.",updatingHint:"This may take 1–3 minutes. Do not close this page.",serverRestarting:"Server is restarting, please wait...",updated:"Updated successfully! Reloading...",timeout:"Update may still be in progress.",timeoutHint:"The server may need more time to rebuild. Try refreshing.",refreshButton:"Refresh Page",retryButton:"Retry Update",error:"Failed to check for updates. Check your network connection.",checkButton:"Check for Updates",updateButton:a=>`Update to v${a}`,releaseNotes:"View release notes",hint:"Updates are installed via npm. Equivalent to running",inTerminal:"in your terminal.",desktopDownloading:"Downloading update...",desktopReady:"Update downloaded. Restart to apply.",desktopRestart:"Restart Now",desktopHint:"Updates are delivered through the Desktop app auto-updater.",coreTitle:"MindOS Core",coreUpToDate:"Core is up to date",coreAvailable:a=>`Update available (${a})`,coreDownloading:"Downloading...",coreCancel:"Cancel",coreReady:"Ready — restart services to apply",coreRestartServices:"Restart Services",coreApplying:"Applying update...",coreApplied:"Updated! Reloading...",coreError:"Core update failed.",coreRetry:"Retry",coreDesktopTooOld:a=>`v${a} requires a newer Desktop version.`,coreDesktopTooOldHint:"Please update MindOS Desktop first.",coreHint:"Core updates only restart services — no app restart needed.",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} available`,titleMultiple:"Updates available",desktopLabel:"Desktop",coreLabel:"Core",viewDetails:"View Details",skipVersion:"Skip Version",skipAll:"Skip All"}},uninstall:{title:"Uninstall MindOS",descCli:"Remove MindOS CLI, background services, and configuration files from this machine.",descDesktop:"Remove MindOS Desktop, background services, and configuration files from this machine.",warning:"Select what to clean up. Your knowledge base files are always kept safe.",stopServices:"Stop services & remove daemon",stopServicesDesc:"Stop all running MindOS processes and remove the background daemon.",removeConfig:"Remove configuration",removeConfigDesc:"Delete ~/.mindos/ directory (config, logs, PID files).",removeNpm:"Uninstall CLI package",removeNpmDesc:"Run npm uninstall -g @geminilight/mindos.",removeApp:"Move Desktop app to Trash",removeAppDesc:"Move MindOS.app to Trash. You can restore it later if needed.",confirmTitle:"Confirm Uninstall",confirmButton:"Uninstall",cancelButton:"Cancel",running:"Uninstalling...",success:"MindOS has been uninstalled.",successDesktop:"MindOS has been uninstalled. The app will quit now.",error:"Uninstall failed. You can run `mindos uninstall` in terminal manually.",nothingSelected:"Select at least one item to uninstall.",kbSafe:"Your knowledge base files are always safe — they are never deleted by this action."}},onboarding:{subtitle:"Your knowledge base is empty. Pick a starter template to get going.",templates:{en:{title:"English",desc:"Pre-built structure with Profile, Notes, Projects, and more."},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"Empty",desc:"Just the essentials — README, CONFIG, and INSTRUCTION."}},importHint:"Already have notes? Set MIND_ROOT to your existing directory in Settings.",syncHint:"Want cross-device sync? Run",syncHintSuffix:"in the terminal after setup.",initError:"Initialization failed. Please refresh the page or try a different template.",dismiss:"Dismiss"},setup:{stepTitles:["Knowledge Base","AI Configuration","Agent Connection","Confirm"],kbPath:"Knowledge base path",kbPathHint:"Absolute path to your notes directory.",kbPathDefault:"~/MindOS/mind",kbPathBrowse:"Browse...",kbPathUseDefault:a=>`Use ${a}`,kbPathHasFiles:a=>`This directory already contains ${a} file${a>1?"s":""}. You can skip the template or merge (existing files won't be overwritten).`,kbTemplateSkip:"Skip template",kbTemplateMerge:"Choose a template to merge",template:"Starter template",templateSkip:"Skip (directory already has files)",aiProvider:"AI Provider",aiProviderHint:"Choose your preferred AI service.",aiSkip:"Skip — configure later",apiKey:"API Key",apiKeyExisting:"Existing key configured. Leave blank to keep it.",model:"Model",listModels:"Browse",noModelsFound:"No models found",baseUrl:"Base URL",baseUrlHint:"Optional. For proxies or custom API endpoints.",webPort:"Web UI port",mcpPort:"MCP server port",portHint:"Valid range: 1024–65535",portRestartWarning:"The service will start on these ports after setup completes.",portInUse:a=>`Port ${a} is already in use.`,portSuggest:a=>`Use ${a}`,portChecking:"Checking…",portSelf:"Current port",portConflict:"Web UI and MCP ports must be different.",portVerifyHint:"Click outside each field to verify, or wait for auto-check.",authToken:"Auth Token",authTokenHint:"Bearer token for MCP / API clients. Auto-generated.",authTokenUsage:"Used for MCP connections and API clients. When configuring an Agent, this token is written automatically — no manual steps needed.",authTokenUsageWhat:"What is this?",authTokenSeed:"Custom seed (optional)",authTokenSeedHint:"Enter a passphrase to derive a deterministic token.",generateToken:"Generate",copyToken:"Copy",copiedToken:"Copied!",webPassword:"Web Password",webPasswordHint:"Protect your knowledge base from unauthorized browser access.",webPasswordRequired:"Password is required to protect your data.",advancedPorts:"Advanced Settings",tokenSectionTitle:"Auth Token (auto-generated)",tokenSectionHint:"Used by AI agents to connect to your MindOS server.",agentToolsTitle:"Agent Connection",connectionModeTitle:"Connection Mode",connectionModeCliHint:"Recommended \xb7 Lower token usage",connectionModeMcpHint:"Optional \xb7 Higher token usage",agentToolsHint:"Select which AI agents to configure. This step is optional.",agentToolsHintCliOnly:"Agent selection applies when MCP mode is enabled. CLI works with all agents that have bash access.",agentToolsHintNone:"No connection mode selected. Select at least one mode to connect agents.",agentTransport:"Transport",agentScope:"Scope",agentToolsLoading:"Loading agents…",agentToolsEmpty:"No supported agents detected.",agentNoneSelected:"No agents selected. You can configure agents later in Settings.",agentSkipLater:"Clear all",agentSelectDetected:"Select detected agents",agentNoneDetected:"No agents detected on your system.",agentShowMore:a=>`Show ${a} more agents`,agentAdvanced:"Advanced options",agentScopeGlobal:"Install for all projects",agentScopeProject:"This project only",badgeInstalled:"Installed",badgeDetected:"Detected",badgeNotFound:"Not found",agentNotInstalled:"not installed",agentDetected:"detected",agentNotFound:"not found",agentGetIt:"Get it →",agentStatusOk:"configured",agentStatusError:"failed",agentInstalling:"Configuring…",agentTransportAuto:"Auto (recommended)",agentTransportLabel:"Transport",agentVerified:"verified",agentUnverified:"unverified",agentVerifyNote:"stdio agents are verified after restart",skillWhat:"",skillAutoHint:()=>"",skillLabel:"Skill",skillInstalling:"Installing skill…",skillInstalled:"Skill installed",skillFailed:"Skill install failed",aiSkipTitle:"Skip for now",aiSkipDesc:"You can add an API key later in Settings → AI.",reviewHint:"Verify your settings, then press Complete Setup.",reviewInstallResults:"Agent configuration results:",phaseSaving:"Saving configuration…",phaseAgents:"Configuring agents…",phaseSkill:"Installing skill…",phaseDone:"Setup complete!",retryAgent:"Retry",agentFailedCount:a=>`${a} agent${a>1?"s":""} failed`,agentCountSummary:a=>`${a} agent${a>1?"s":""}`,agentFailureNote:"Agent failures are non-blocking — you can enter MindOS and retry from Settings → Connections.",portAvailable:"Available",portChanged:"Port changed — please restart the server for it to take effect.",restartRequired:"Server restart required for these changes to take effect.",restartNow:"Restart now",restarting:"Restarting…",restartDone:"Server is restarting. Redirecting shortly…",restartManual:"Restart manually:",back:"Back",next:"Next",complete:"Complete Setup",skip:"Skip",completing:"Saving...",completeDone:"Setup complete!",completeFailed:"Setup failed. Please try again.",healthKb:"Knowledge Base",healthKbNone:"Not configured",healthAi:"AI Provider",healthAiNone:"Not configured — AI features disabled",healthAiAction:"Add an API key in Settings → AI.",healthAgents:"Agent Connection",healthAgentsOk:a=>`${a} agent${a>1?"s":""} configured`,healthAgentsPartial:"Configuration in progress...",healthAgentsNone:"No agents configured",healthAgentsAction:"You can add agents later in Settings → Connections.",healthSkills:"Skills",healthSkillsOk:"Skills installed successfully",healthSkillsError:"Skill installation failed",healthSkillsSkipped:"Skipped",healthSkillsInstalling:"Installing skills...",healthSkillsAction:"You can install skills manually later.",healthTokenTitle:"Auth Token",healthTokenCopy:"Copy token",healthTokenHint:"Used by CLI remote mode and MCP connections. Also available in Settings → Connections.",healthGoHome:"Go to MindOS",welcomeTitle:"Welcome to MindOS!",welcomeDesc:"Setup is complete. Start by asking MindOS a question, browsing your knowledge base, or configuring MCP agents.",welcomeLinkReconfigure:"Reconfigure",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP Settings"},guide:{title:"Quick Start",showGuide:"Show getting started guide",close:"Close",skip:"Skip",stepLocked:"Complete the previous step first",import:{title:"Import your files",cta:"Import",desc:"Upload your resume, project docs, or notes — anything you want AI agents to know about you.",button:"Import Files"},ai:{title:"Save with AI",cta:"Try it",desc:"Ask MindOS to capture knowledge from this conversation into your knowledge base:",prompt:"Help me distill the key takeaways from our conversation into a reusable SOP in my knowledge base.",promptEmpty:"Help me design a knowledge base folder structure that fits my needs"},agent:{title:"Connect other Agents",cta:"Copy prompt",desc:"Open Cursor, Claude Code, or any Agent with MindOS CLI and paste:",copyPrompt:"Summarize what we discussed and save it to my MindOS knowledge base as a reusable SOP.",copy:"Copy",copied:"Copied!"},done:{title:"You're all set!",titleFinal:"You've mastered MindOS essentials!",steps:[{hint:"Next: try saving an article into your KB →",prompt:"Help me save the key points from this article into MindOS."},{hint:"Next: try turning experience into a reusable SOP →",prompt:"Help me distill this conversation into a reusable workflow in MindOS."}]}},walkthrough:{step:(a,b)=>`${a} of ${b}`,next:"Next",back:"Back",skip:"Skip tour",done:"Done",exploreCta:"Explore what you can do →",steps:[{title:"Your Project Memory",body:"Organize projects, SOPs, and preferences in Spaces. Everything is local-first and under your control."},{title:"AI That Already Knows You",body:"MindOS reads your knowledge base automatically. Ask about your projects without restating the background every time."},{title:"Connect Any Agent",body:"Link Cursor, Claude Code, or Windsurf via MCP — they all share the same project memory."}]},shortcuts:[{keys:["⌘","K"],description:"Search"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"Settings"},{keys:["E"],description:"Edit current file"},{keys:["⌘","S"],description:"Save"},{keys:["Esc"],description:"Cancel edit / close modal"},{keys:["@"],description:"Attach file in MindOS"}],help:{title:"Help & Guide",subtitle:"Everything you need to get started with MindOS",whatIs:{title:"What is MindOS?",body:"MindOS is your local knowledge assistant. It keeps your projects, decisions, SOPs, and preferences in one place so you and your connected agents can work from the same context. Your files stay local, your knowledge stays reusable, and you do not need to restate everything from scratch."},quickStart:{title:"Quick Start",step1Title:"Browse your knowledge base",step1Desc:'Click the Spaces icon in the left sidebar to explore your files. Each top-level folder is a "Space" — a themed area like Profile, Notes, or Projects.',step2Title:"Talk to MindOS",step2Desc:"Press ⌘/ (or Ctrl/) to open MindOS. Ask about your knowledge base, or use @ to attach a specific file for context.",step3Title:"Connect your AI agents",step3Desc:"Go to Settings → Connections to connect external agents like Claude Code, Cursor, or Windsurf. Once connected, they can read and write your knowledge base directly."},concepts:{title:"Core Concepts",spaceTitle:"Space",spaceDesc:"Spaces are knowledge partitions organized the way you think. You decide the structure, and AI agents follow it to read, write, and manage automatically.",instructionTitle:"Instruction",instructionDesc:"A rules file that all AI agents obey. You write the boundaries once, and every agent connected to your knowledge base follows them.",skillTitle:"Skill",skillDesc:"Teaches agents how to operate your knowledge base — reading, writing, organizing. Agents don't guess; they follow the skills you've installed."},shortcutsTitle:"Keyboard Shortcuts",agentUsage:{title:"Using MindOS with AI Agents",intro:"Once you connect an agent (Claude Code, Cursor, Windsurf, etc.) via MCP, just talk to it naturally. The agent can read and write your knowledge base directly — no special commands needed. Here are the most common scenarios:",scenarios:[{emoji:"\uD83E\uDEAA",title:"Inject Your Identity",desc:"Tell all AI agents who you are — preferences, tech stack, communication style — in one shot.",prompt:'"Here\'s my resume, read it and organize my info into MindOS."'},{emoji:"\uD83D\uDD04",title:"Cross-Agent Handoff",desc:"Brainstorm ideas in GPT, then execute in Claude Code — zero context loss.",prompt:'"Save this conversation to MindOS."\n"Read the plan in MindOS and help me start coding."'},{emoji:"\uD83D\uDCCB",title:"Experience → SOP",desc:"Turn hard-won debugging sessions into reusable workflows that prevent future mistakes.",prompt:'"Help me distill this conversation into a reusable workflow in MindOS."'},{emoji:"\uD83D\uDE80",title:"Project Cold Start",desc:"Spin up a new project in minutes — your profile and SOPs guide the scaffolding automatically.",prompt:'"Help me start a new project following the Startup SOP in MindOS."'},{emoji:"\uD83D\uDD0D",title:"Research & Archive",desc:"Let agents research competitors or topics for you, then file structured results in your knowledge base.",prompt:'"Help me research X, Y, Z products and save results to the MindOS product library."'}],copy:"Copy prompt",hint:'Tip: The agent auto-discovers your knowledge base structure. Just mention "MindOS" in your prompt and it will know where to look. Click "Explore" in the left sidebar for more scenarios.'},shortcuts:{search:"Search files",askAI:"Toggle MindOS",settings:"Open Settings",shortcutPanel:"Keyboard shortcuts panel",editFile:"Edit current file",save:"Save file",closePanel:"Close panel / Exit modal",attachFile:"Attach file in MindOS"},faq:{title:"FAQ",items:[{q:"How do I change the language?",a:"Go to Settings → Appearance → Language. You can switch between English and Chinese."},{q:"How do I connect an AI agent?",a:"Go to Settings → Connections. MindOS auto-detects installed agents (Claude Code, Cursor, etc.) and lets you connect them with one click."},{q:"Where is my data stored?",a:"All your data stays on your local machine as plain Markdown files. MindOS never uploads your data to any cloud service. You own everything."},{q:"How do I sync across devices?",a:"Go to Settings → Sync. MindOS uses Git for cross-device sync. Enter your Git remote URL and access token to start syncing."},{q:"Can I use my own AI provider?",a:"Yes! Go to Settings → AI. You can use OpenAI, Anthropic, Google, or any OpenAI-compatible API with a custom base URL."},{q:"What file formats are supported?",a:"MindOS works best with Markdown (.md) files, but also supports JSON, CSV, and plain text. Plugins extend rendering for special formats like Kanban boards or timelines."},{q:"How do I create a new note?",a:"Click the + icon next to any folder in the file tree, or ask AI to create one for you. Notes are just Markdown files — you can also create them from your file system."}]}},explore:{title:"Explore Use Cases",subtitle:"Discover what you can do with MindOS — pick a scenario and try it now.",tryIt:"Try it",all:"All",byCapability:"By Capability",byScenario:"By Scenario",categories:{"knowledge-management":"Knowledge Management","memory-sync":"Memory Sync","auto-execute":"Auto Execute","experience-evolution":"Experience Evolution","human-insights":"Human Insights","audit-control":"Audit & Control"},scenarios:{"first-day":"First Day",daily:"Daily Work",project:"Project Work",advanced:"Advanced"},c1:{title:"Inject Your Identity",desc:"Tell all AI agents who you are — preferences, tech stack, communication style — in one shot.",prompt:"Here's my resume, read it and organize my info into MindOS."},c2:{title:"Save Information",desc:"Archive articles, meeting notes, or web pages into your knowledge base with one prompt.",prompt:"Help me save the key points from this article into MindOS."},c3:{title:"Cross-Agent Handoff",desc:"Start a plan in MindOS, continue coding in Claude Code, refine in Cursor — zero context loss.",prompt:"Help me start coding based on the plan in MindOS."},c4:{title:"Experience → SOP",desc:"Turn hard-won debugging sessions into reusable workflows that prevent future mistakes.",prompt:"Help me distill this conversation into a reusable workflow in MindOS."},c5:{title:"Capture Ideas on the Go",desc:"Jot down an inspiration on your phone — MindOS archives, decomposes, and assigns to agents.",prompt:"Help me organize this idea into MindOS and break it into actionable sub-tasks."},c6:{title:"Project Cold Start",desc:"Spin up a new project in 4 minutes — your profile and SOPs guide the scaffolding automatically.",prompt:"Help me start a new project following the Startup SOP in MindOS."},c7:{title:"Research & Archive",desc:"Let agents research competitors or topics for you, then file structured results in your KB.",prompt:"Help me research X, Y, Z products and save results to the MindOS product library."},c8:{title:"Network Management",desc:"Log conversations with contacts, auto-generate follow-up TODOs, and keep full context.",prompt:"I met with someone today — update MindOS Connections and create follow-up TODOs."},c9:{title:"Audit & Correct",desc:"Review what agents know about you, fix mistakes in one place, and all agents update instantly.",prompt:"Check my MindOS Profile for accuracy and correct any errors."}}},zh:{common:{relatedFiles:"关联视图"},app:{tagline:"你在此思考,Agent 依此行动",footer:"MindOS \xb7 人机共生知识系统"},login:{tagline:"人类在此思考,Agent 依此行动",subtitle:"请输入密码以继续",passwordLabel:"密码",passwordPlaceholder:"输入密码",signIn:"登录",signingIn:"登录中…",incorrectPassword:"密码错误,请重试。",connectionError:"连接错误,请重试。"},notFound:{title:"文件未找到",description:"该文件不存在于你的知识库中。",createButton:"创建此文件",creating:"创建中...",goToParent:"返回上级目录",goHome:"首页"},updateBanner:{newVersion:(a,b)=>`MindOS v${a} 可用(当前 v${b})`,updateNow:"更新",runUpdate:"终端运行",orSee:"或",releaseNotes:"查看更新说明"},sidebar:{files:"知识库",search:"搜索",searchTitle:"搜索",askTitle:"MindOS",settingsTitle:"设置",plugins:"插件",agents:"智能体",echo:"回响",discover:"探索",workflows:"流程",history:"历史",help:"帮助",syncLabel:"同步",collapseTitle:"收起侧栏",expandTitle:"展开侧栏",collapseLevel:"折叠一级",collapseLevelHint:"折叠一级(双击:全部折叠)",expandLevel:"展开一级",expandLevelHint:"展开一级(双击:全部展开)",importFile:"导入文件",new:"新建",newFile:"新建文件",newSpace:"新建空间",more:"更多",capture:"暂存台",showHiddenFiles:"显示隐藏文件",sync:{synced:"已同步",unpushed:"待推送",unpushedHint:"个提交尚未推送到远程 — 将自动同步",conflicts:"冲突",conflictsHint:"个文件存在合并冲突 — 前往 设置 > 同步 解决",syncError:"同步出错",syncOff:"同步关闭",syncing:"同步中...",syncNow:"立即同步",syncDone:"同步完成",syncFailed:"同步失败",syncRestored:"同步已恢复",enableSync:"启用同步",enableHint:"设置跨设备同步"}},search:{placeholder:"搜索文件...",emptyTitle:"快速查找笔记",emptyHint:"输入文件名或内容关键词",noResults:"未找到匹配的文件",noResultsHint:"尝试其他关键词",prompt:"输入关键词搜索所有文件",navigate:"上下导航",open:"打开",close:"关闭",clear:"清除搜索",dragToChat:"拖入对话",tabSearch:"搜索",tabActions:"快捷操作",openSettings:"打开设置",restartWalkthrough:"重新开始引导",toggleDarkMode:"切换深色模式",goToAgents:"前往智能体",goToDiscover:"前往探索",goToHelp:"前往帮助",walkthroughRestarted:"引导已重置"},shortcutPanel:{title:"快捷键",navigation:"导航",panelsSection:"面板",editor:"编辑器",toggleSearch:"切换搜索",toggleAskAI:"切换 MindOS",openSettings:"打开设置",keyboardShortcuts:"快捷键",closePanel:"关闭面板 / 退出最大化",saveFile:"保存文件",undo:"撤销",redo:"重做",toggleHint:"切换此面板"},...d,home:{recentlyModified:"最近修改",recentlyActive:"最近活跃",recentlyEdited:"最近编辑",allSpaces:"所有空间",spaces:"心智空间",nFiles:a=>`${a} 个文件`,other:"其他",newSpace:"新建空间",spaceName:"空间名称",spaceDescription:"描述",spaceDescPlaceholder:"描述这个空间的用途",spaceNameNoSlash:"名称不能包含 / 或 \\",spaceExists:"已存在同名空间",spaceCreateFailed:"创建空间失败",noSpacesYet:"还没有空间,创建一个来整理你的知识吧。",spaceLocation:"位置",rootLevel:"根目录",optional:"可选",aiInit:"AI 初始化内容",aiInitHint:"AI 将自动生成空间说明和操作指南",aiInitNoKey:"在 设置 → AI 中配置 API 密钥以启用",aiInitGenerating:a=>`正在为「${a}」生成内容`,aiInitReady:a=>`「${a}」已就绪`,aiInitReview:"查看",aiInitDiscard:"撤销",aiInitReverted:a=>`「${a}」已恢复为模板`,createSpace:"创建",cancelCreate:"取消",continueEditing:"继续编辑",newNote:"新建笔记",builtinFeatures:"工具面板",builtinActive:"已启用",builtinInactive:"未激活",toolName:{"agent-inspector":"审计面板","config-panel":"配置面板",todo:"待办面板","workflow-yaml":"工作流"},toolDesc:{"agent-inspector":"查看 Agent 操作日志与调用轨迹","config-panel":"编辑和管理全局配置项",todo:"以看板形式管理待办事项","workflow-yaml":"执行多步骤工作流,AI 辅助执行"},plugins:"扩展",changeHistory:"变更历史",showMore:"查看更多",showLess:"收起",viewAll:"查看全部",wikiTagline:"你的知识空间,井然有序。",sortRecent:"最近",sortName:"字母序",sortCount:"文件数",createToActivate:"创建 {file} 以启用",shortcuts:{searchFiles:"搜索文件",askAI:"MindOS",editFile:"编辑文件",save:"保存",settings:"设置"},relativeTime:{justNow:"刚刚",minutesAgo:a=>`${a} 分钟前`,hoursAgo:a=>`${a} 小时前`,daysAgo:a=>`${a} 天前`},cleanupExamples:a=>`有 ${a} 个模板示例文件可以清理`,cleanupExamplesButton:"一键清理",cleanupExamplesDone:"示例文件已清理"},echoSpotlight:{title:"回响",dailyLine:"今日一行",placeholder:"写下今天的一行想法…",invite:"记录今天的一行想法",inviteDesc:"一行就够。回响会沉淀你的思维模式。",goToEcho:"打开回响",savedLocally:"保存在本设备"},dailyEcho:{title:"每日回响报告",generate:"生成今日报告",generating:"生成中...",generated:"生成于 {time}",regenerate:"重新生成",download:"下载 PDF",continueAgent:"继续与 Agent",error:"生成失败",retry:"重试",snapshotTitle:"\uD83D\uDCCA 今日动向",snapshotFilesEdited:"文件编辑",snapshotFilesCreated:"新建文件",snapshotSessions:"聊天会话",snapshotKbGrowth:"知识库增长",themesTitle:"\uD83C\uDFAF 今日主题",themeFiles:"个文件",alignmentTitle:"✅ 对齐度",alignmentScore:"评分",alignmentMisaligned:"偏离",alignmentPartial:"部分对齐",alignmentAligned:"充分对齐",reflectionTitle:"❓ 明天思考"},suggestion:{title:"你可能想",staleFiles:a=>`${a} 个文件超过 30 天未更新`,reviewStale:"查看",dismiss:"忽略"},inbox:{title:"暂存台",count:a=>`${a}`,emptyTitle:"快速捕获,稍后整理",emptyDesc:"拖拽文件到此处,或点击上传按钮,即刻保存到暂存台。",uploadButton:"上传文件",organizeButton:"AI 整理",organizing:"整理中...",viewAll:"查看全部",more:a=>`还有 ${a} 个`,viewAllFiles:a=>`查看 Inbox 中全部 ${a} 个文件`,viewAllHistory:a=>`查看全部 ${a} 条记录 →`,agingHint:"7天+",savedToast:a=>`${a} 个文件已保存到暂存台`,savedToDir:(a,b)=>`${a} 个文件已保存到 ${b}`,savedWithSkipped:(a,b)=>a>0?`已保存 ${a} 个,跳过 ${b} 个(格式不支持)`:`${b} 个文件被跳过(格式不支持)`,tooLarge:a=>`${a} 个文件过大(上限 10 MB)`,savedWithOversized:(a,b)=>`已保存 ${a} 个,${b} 个过大被跳过`,organizePrompt:a=>`请将暂存台中的这些文件整理到知识库的合适位置。分析每个文件的内容,将其移动到最匹配的空间或目录。需要的话可以创建新目录。以下是待整理的文件:
98
108
 
99
109
  ${a.map(a=>`- Inbox/${a}`).join("\n")}`,dropOverlay:"拖放到暂存台快速保存",dropOverlayFormats:"md \xb7 txt \xb7 pdf \xb7 csv \xb7 json",noMindRoot:"请先配置知识库路径",saveFailed:"保存文件失败,请检查磁盘空间和权限。",organizeFailed:"无法读取文件进行整理,请检查文件权限。",removeFile:"从暂存台移除",openFile:"打开",copyName:"复制文件名",fileRemoved:"文件已从暂存台移除",fileRemoveFailed:"移除文件失败",fileCount:a=>`${a} 个文件`,viewEmptyGuide:"拖入的文件将暂存于此,等待 AI 整理到知识库中。",viewOrganizeTip:"点击 AI 整理,将这些文件分类到知识库的合适位置。",clipUrlPlaceholder:"粘贴网址,一键剪藏网页...",clipButton:"剪藏",clipping:"剪藏中...",clipSuccess:a=>`已剪藏「${a}」到暂存台`,clipFailed:"网页剪藏失败",clipInvalidUrl:"请输入有效网址(http:// 或 https://)",dropUrlOverlay:"松开以剪藏网页",dropFilesOrLinks:"拖拽文件或链接,或"},pulse:{title:"你的 Agent",manage:"管理",connectTitle:"连接你的 AI 工具",connectDesc:"让 Cursor、Claude Code 等 AI 读到你的笔记。",connectAction:"连接 Agent",active:"已连接",detected:"已检测",notFound:"未发现",running:"在线",offline:"离线",summary:(a,b)=>`${a} 个 Agent \xb7 ${b} 个技能`,skillCount:(a,b)=>`${a}/${b} 个技能`,showMore:a=>`还有 ${a} 个`,showLess:"收起",otherDetected:"已检测到"},fileTree:{newFileTitle:"在此目录新建文件",rename:"重命名",delete:"删除",create:"创建",enterFileName:"请输入文件名",failed:"操作失败",confirmDelete:a=>`确定删除「${a}」?可在回收站恢复(30 天内)。`,rules:"规则",about:"概述",viewAll:"查看全部",editRules:"编辑规则",viewRules:"查看规则",renameSpace:"重命名空间",deleteSpace:"删除空间",confirmDeleteSpace:a=>`删除空间「${a}」及其所有文件?可在回收站恢复(30 天内)。`,convertToSpace:"转为空间",deleteFolder:"删除文件夹",confirmDeleteFolder:a=>`删除文件夹「${a}」及其所有内容?可在回收站恢复(30 天内)。`,newFile:"新建文件",importFile:"导入文件",importToSpace:"导入文件到此空间",copyPath:"复制路径",pathCopied:"路径已复制",pinToFavorites:"固定到收藏",removeFromFavorites:"取消收藏",export:"导出..."},pinnedFiles:{title:"收藏文件",addedToast:"已添加到收藏",removedToast:"已取消收藏",empty:"还没有收藏文件",emptyHint:"点击任何文件上的星标图标即可收藏"},trash:{title:"回收站",subtitle:"删除的文件将保留 30 天。",empty:"回收站为空",emptySubtext:"删除的文件将在此处保留 30 天。",emptyTrash:"清空回收站",emptyTrashConfirm:"永久删除回收站中的所有项目?此操作不可撤销。",restore:"恢复",deletePermanently:"彻底删除",deletePermanentlyConfirm:a=>`确定彻底删除「${a}」?此操作不可撤销。`,from:"来自",deletedAgo:a=>`${a}删除`,expiresIn:a=>`${a} 天后过期`,restored:"已恢复",deleted:"已彻底删除",movedToTrash:"已删除",undo:"撤销",undoFailed:"撤销失败",restoreFailed:"无法恢复文件,请检查磁盘空间后重试。",deleteFailed:"无法彻底删除,请重试。",emptyFailed:"无法清空回收站,请重试。",emptied:a=>`已清空 ${a} 个项目`,restoreConflict:"原位置已有同名文件。",overwrite:"覆盖",saveAsCopy:"保存副本",itemCount:a=>`${a} 个项目`,undoDelete:"撤销",viewInTrash:"查看回收站",fileDeleted:a=>`「${a}」已移至回收站`,cancel:"取消",justNow:"刚刚",minutesAgo:a=>`${a} 分钟前`,hoursAgo:a=>`${a} 小时前`,daysAgo:a=>`${a} 天前`},export:{title:"导出",exportFile:"导出文件",exportSpace:"导出空间",chooseFormat:"选择格式",formatMd:"Markdown (.md)",formatMdDesc:"原始格式,可编辑",formatHtml:"HTML (.html)",formatHtmlDesc:"静态网页,可分享",formatZipMd:"Markdown ZIP",formatZipMdDesc:"所有文件,原始格式",formatZipHtml:"HTML ZIP",formatZipHtmlDesc:"所有文件,网页格式",preview:"预览",exporting:"导出中...",exportButton:"导出",cancel:"取消",close:"完成",done:"导出完成",downloadAgain:"再次下载",fileCount:a=>`${a} 个文件`,downloaded:"已下载",error:"导出失败,请检查磁盘空间后重试。",retry:"重试"},fileImport:{title:"导入文件",subtitle:"将外部文件存入知识库或让 AI 帮你整理",dropzoneText:"拖拽文件到这里,或",dropzoneButton:"点击选择",dropzoneCompact:"拖拽更多文件,或",dropzoneCompactButton:"点击添加",dropzoneMobile:"点击选择文件",fileCount:a=>`${a} 个文件`,clearAll:"清空全部",unsupported:"不支持的文件类型",tooLarge:a=>`文件过大(最大 ${a})`,archiveTitle:"存入知识库",archiveDesc:"原样归档到指定空间",digestTitle:"AI 帮我整理",digestDesc:"提取要点,沉淀到笔记",archiveConfigTitle:"存入知识库",back:"← 返回",targetSpace:"目标空间",rootDir:"根目录",conflictLabel:"同名文件已存在时",conflictRename:"自动重命名(添加序号后缀)",conflictSkip:"跳过不导入",conflictOverwrite:"覆盖已有文件",overwriteWarn:"将永久替换已有文件内容",cancel:"取消",importButton:a=>`存入 ${a} 个文件`,importing:"正在存入...",preparing:"准备中...",successToast:(a,b)=>`已存入 ${a} 个文件到 ${b||"知识库"}`,updatedIndex:a=>`更新了 ${a} 个索引文件`,partialToast:(a,b)=>`存入 ${a}/${b} 个文件`,skipReason:"同名文件已存在",failToast:"导入失败",retry:"重试",undo:"撤销",discardTitle:"放弃导入?",discardMessage:a=>`放弃已选的 ${a} 个文件?`,discardConfirm:"放弃",discardCancel:"取消",dropOverlay:"松开鼠标,导入文件到知识库",dropOverlayFormats:"支持 .md .txt .pdf .csv .json .yaml .html",onboardingHint:"已有笔记?导入文件到知识库 →",digestPromptSingle:(a,b)=>{let c=b?`"${b}" 空间下`:"知识库中合适的位置";return`用户上传了「${a}」。你必须:
100
110
  1. 从上方「USER-UPLOADED FILES」区域读取文件内容
@@ -108,7 +118,7 @@ ${a.map(a=>`- Inbox/${a}`).join("\n")}`,dropOverlay:"拖放到暂存台快速保
108
118
 
109
119
  不要只做文字回复。你必须实际写入知识库。`},arrowTo:"→",remove:"移除",aiRecommended:"推荐",aiRecommendedHint:"根据文件名自动匹配",conflictsFound:a=>`${a} 个文件已存在`,organizeTitle:"AI 整理中",organizeProcessing:"AI 正在分析和整理你的文件...",organizeConnecting:"正在连接 AI...",organizeAnalyzing:"AI 正在分析你的文件...",organizeReading:a=>a?`正在阅读 ${a}...`:"正在阅读文件...",organizeThinking:"AI 正在深度思考...",organizeWriting:a=>a?`正在写入 ${a}...`:"正在写入文件...",organizeElapsed:a=>{let b=Math.floor(a/60);return`${b}:${(a%60).toString().padStart(2,"0")}`},organizeCancel:"取消",organizeMinimize:"继续浏览",organizeExpand:"查看",organizeCreating:a=>`正在创建 ${a}`,organizeUpdating:a=>`正在更新 ${a}`,organizeReviewTitle:"整理完成",organizeErrorTitle:"整理失败",organizeReviewDesc:a=>`AI 整理了 ${a} 处变更`,organizeCreated:"已创建",organizeUpdated:"已更新",organizeFailed:"失败",organizeNoChanges:"AI 分析了你的文件,但没有做任何更改。",organizeToolCallsInfo:a=>`AI 执行了 ${a} 个操作 — 请检查知识库查看更新`,organizeError:"整理失败",organizeRetry:"重试",organizeDone:"完成",organizeUndoAll:"撤销全部",organizeUndoOne:"撤销",organizeUndone:"已撤销",organizeViewFile:"查看文件",organizeUndoSuccess:a=>`已撤销 ${a} 个文件`,organizeDetailTitle:"AI 整理详情",organizeSourceFiles:"源文件",organizeSummaryLabel:"AI 总结",organizeChangesLabel:a=>`变更列表 (${a})`,organizeNoSummary:"AI 正在处理中...",organizeMinimizeModal:"最小化"},importHistory:{title:"导入历史",clearAll:"清空历史",clearConfirm:"清空所有历史记录?此操作不可撤销。",emptyTitle:"暂无导入记录",emptyDesc:"AI 整理的结果会出现在这里",back:"← 返回",sourceLabel:"来源",changesCount:(a,b)=>`${a}/${b} 处变更`,changesSummary:a=>`→ ${a} 处变更`,nFiles:a=>`${a} 个文件`,statusUndone:"已撤销",statusCreated:"已创建",statusUpdated:"已更新",recordCount:a=>`${a} 条记录`,today:"今天",yesterday:"昨天",older:"更早",processedArchive:"已处理的文件归档在 Inbox/.processed/ 中"},dirView:{gridView:"网格视图",listView:"列表视图",emptyFolder:"此目录为空。",fileCount:a=>`${a} 个文件`,newFile:"新建文件",uninitTitle:"空间尚未初始化",uninitDesc:"README.md 和 INSTRUCTION.md 仍是默认模板。配置 AI API 密钥后可自动生成个性化内容,或手动编辑。",uninitEditReadme:"编辑 README",uninitEditInstruction:"编辑 Instruction",uninitSettings:"设置",overviewNoFiles:"暂无文件可分析。",overviewCta:"生成概览",overviewCtaHint:a=>`扫描 ${a} 个文件,生成空间概要`,overviewCtaNoKey:"请先在设置中配置 AI 密钥",overviewOrEdit:"或手动编辑 README.md",overviewGenerating:"正在生成概览…",overviewScanningFiles:a=>`正在扫描 ${a} 个文件`,overviewRegenerate:"用 AI 重新生成概览",overviewRegenerateLabel:"刷新",overviewRegenerateConfirm:"将扫描变更文件并刷新概述,会消耗一定 AI 额度。",overviewRegenerateCancel:"取消",overviewRegenerateStart:"立即刷新",overviewUnchanged:"概述已是最新,没有文件变更。",overviewLastCompiled:a=>`上次刷新:${a}`,overviewIncremental:a=>`已从 ${a} 个变更文件增量更新`,overviewError:"无法生成概览",overviewRetry:"重试"},view:{saveDirectory:"目录",saveFileName:"文件名",delete:"删除",deleteConfirm:a=>`确定删除「${a}」?文件将移至回收站。`,cancel:"取消",rename:"重命名",copyPath:"复制路径",more:"更多",dismiss:"关闭",tocTitle:"本页目录",tocCollapse:"收起",tocExpand:"展开",emptyNote:"此笔记为空。按 E 开始编辑。",switchToDoc:"文档视图",switchToGraph:"知识图谱"},findInPage:{placeholder:"在文档中查找…",matchCount:(a,b)=>`${a} / ${b}`,noResults:"无结果"},panels:{agents:{title:"智能体",connected:"已连接",refresh:"刷新智能体状态",retry:"重试",failedToLoad:"加载智能体失败",mcpServer:"MCP 服务器",stopped:"已停止",sectionConnected:"已连接",sectionDetected:"已检测",sectionNotDetected:"未检测到",noAgents:"未检测到智能体。",autoRefresh:"每 30 秒自动刷新",connect:"连接",installing:"安装中...",install:"安装",installSuccess:"已安装",installFailed:"安装失败",retryInstall:"重试",copyConfig:"复制配置",copied:"已复制!",transportLocal:"本地",transportRemote:"远程",configPath:"配置路径",noAuthWarning:"未设置 Token — 请在高级配置中设置",skillsTitle:"技能",skillsActive:"已启用",builtinSkills:"内置",newSkill:"+ 新建",advancedConfig:"高级配置 →",channels:"频道",navOverview:"总览",navMcp:"MCP",navSkills:"技能",navChannels:"频道",navNetwork:"网络",navSessions:"会话",navActivity:"活动",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmpty:"无远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aRemoveAgent:"移除",rosterLabel:"当前环境",notFoundDetail:"本机未检测到该智能体客户端。请安装后刷新列表。",skillsEmptyHint:"请在「MCP 与技能」设置中启用或编辑技能。",backToList:"返回",closeAgentDetail:"关闭",agentDetailPanelAria:"智能体连接配置",agentDetailTransport:"传输方式",agentDetailSnippet:"配置片段",a2aLabel:"A2A",a2aReady:"A2A 就绪",a2aChecking:"检测 A2A 中...",a2aUnavailable:"A2A 不可用",a2aRemote:"远程",a2aDiscover:"发现远程 Agent",a2aDiscoverHint:"通过 URL 连接外部 A2A Agent",a2aDiscoverPlaceholder:"https://agent.example.com",a2aDiscovering:"发现中...",a2aDiscoverSuccess:"Agent 已发现!",a2aDiscoverFailed:"未在此 URL 找到 A2A Agent",a2aDiscoverFailedHint:"该服务器可能不支持 A2A 协议,请检查 URL 后重试。",a2aSkills:"技能",a2aEndpoint:"端点",a2aVersion:"版本",a2aCapabilities:"A2A 能力",a2aStatus:"状态",a2aConnected:"已连接,A2A 就绪",a2aNoRemote:"无远程 Agent",a2aNoRemoteHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aDelegations:"近期委派",a2aDelegationsEmpty:"暂无委派记录",a2aDelegationCompleted:"已完成",a2aDelegationFailed:"失败",a2aDelegationPending:"进行中",acpSectionTitle:"已安装智能体",acpSectionDesc:a=>`已检测到 ${a} 个智能体`,acpNoInstalled:"未检测到编程智能体。安装一个即可在 MindOS 中直接委派任务。",acpAvailableTitle:"注册表中可用",acpAvailableDesc:a=>`还有 ${a} 个智能体可安装`,acpShowAvailable:"展开",acpHideAvailable:"收起",acpCopyCmd:"复制",acpCopied:"已复制",acpTransportNpx:"npx",acpTransportBinary:"二进制",acpTransportUvx:"uvx",acpTransportStdio:"stdio",acpUseAgent:"使用",acpComingSoon:"即将上线 — 当前可通过 MindOS 调用",acpReady:"就绪",acpNotInstalled:"未安装",acpScan:"重新扫描",acpInstallHint:a=>`安装命令: ${a}`,acpInstall:"安装",acpInstalling:"安装中…",acpLoading:"加载 ACP 注册表中…",acpLoadFailed:"加载 ACP 注册表失败。",acpRetry:"重试",acpQuickReview:"代码审查",acpQuickFix:"修复Bug",acpQuickExplain:"解释项目",acpUseWith:a=>`使用 ${a} `,acpDefaultAgent:"MindOS",acpSelectAgent:"选择 Agent",acpChangeAgent:"切换 Agent",acpConfigToggle:"配置",acpConfigCommand:"命令",acpConfigArgs:"参数",acpConfigEnv:"环境变量",acpConfigEnvAdd:"添加环境变量",acpConfigSource:"来源",acpConfigSourceBuiltin:"内置",acpConfigSourceRegistry:"注册表",acpConfigSourceUser:"自定义",acpConfigReset:"重置",acpConfigSave:"保存",acpConfigSaved:"已保存",acpConfigPath:"路径",networkEmptyTitle:"连接智能体生态",networkEmptyDesc:"发现远程 Agent 或浏览 ACP 注册表中的编程智能体。",networkDiscoverBtn:"发现 Agent",networkBrowseBtn:"浏览注册表"},plugins:{title:"插件",active:"已启用",noPlugins:"暂无插件",core:"核心",coreDisabled:"核心插件 — 不可禁用",footer:"插件用于自定义文件渲染方式。核心插件不可禁用。",ready:"就绪 — 点击打开",disabled:"已禁用",noFile:"入口文件不存在",createFile:"创建 {file} 以激活"},echo:{title:"回响",imprintTitle:"印迹",imprintDesc:"每日痕迹与历史",growthTitle:"生长",growthDesc:"你正在推进的方向",selfTitle:"自观",selfDesc:"指向你的笔记与线索"},discover:{title:"探索",useCases:"使用案例",useCasesDesc:"动手体验 MindOS 的典型场景",pluginMarket:"插件市场",pluginMarketDesc:"扩展文件的渲染和编辑方式",skillMarket:"技能市场",skillMarketDesc:"为 AI 智能体添加新能力",spaceTemplates:"空间模板",spaceTemplatesDesc:"预设的空间结构,适用于常见工作流场景",comingSoon:"即将推出",viewAll:"查看所有使用案例",tryIt:"试试"},workflows:{title:"流程",empty:"还没有流程",emptyDesc:"创建第一个流程,用 AI 自动化多步骤任务。",newWorkflow:"新建流程",nSteps:a=>`${a} 个步骤`,parseError:"解析错误",name:"名称",namePlaceholder:"我的流程",template:"模板",templateBlank:"空白",create:"创建",cancel:"取消",creating:"创建中...",exists:"已存在同名流程"},im:{title:"频道",emptyTitle:"尚未配置任何频道",emptyDesc:"连接消息平台,让 MindOS 代您发送消息。",connected:"已连接",notConfigured:"配置",statusConnected:"已连接",tabStatus:"状态",tabConfigure:"配置",testSend:"测试发送",recipientPlaceholder:"接收者 ID",messagePlaceholder:"来自 MindOS 的问候",sendTest:"发送测试",sentOk:"发送成功",saveConfig:"保存",saved:"已保存,正在重新连接...",cancel:"取消",fetchError:"无法加载频道状态。",retry:"重试",disconnect:"断开连接",confirmDisconnect:"确认?",showSecret:"显示",hideSecret:"隐藏",getStarted:"开始配置",statsConnected:"已连接",statsSupported:"支持平台",statsStatus:"状态",statsReady:"就绪",statsNotConfigured:"未配置",platformsTitle:"平台列表",backToChannels:"返回频道",setupGuide:"配置指南",howItWorks:"这个渠道怎么用",currentMode:"当前模式",notificationsOnly:"仅用于通知",twoWayConversation:"双向对话",conversationTitle:"对话设置",conversationEnable:"允许从飞书发起消息",conversationWaiting:"等待飞书验证",conversationReady:"可接收并回复",conversationDisabled:"未开启",conversationNeedsPublicUrl:"需要公网地址",conversationNeedsEncryptKey:"需要 Encrypt Key",conversationHint:"用户可以私聊机器人;群聊里只有 @机器人 时才会触发回复。",conversationConfigHint:"只有在你已经准备好公网地址和 Feishu Encrypt Key 后,才建议开启。",conversationWebhookUrl:"Webhook 地址",conversationCopyUrl:"复制地址",conversationStatus:"Webhook 状态",conversationReachability:"公网可达性",conversationReachabilityHint:"飞书必须能从公网访问这个地址,才能把消息推送到 MindOS。",conversationOpenPlatform:"打开飞书开放平台",conversationPublicBaseUrl:"公网 Base URL",conversationEncryptKey:"Encrypt Key",conversationVerificationToken:"Verification Token",conversationVerificationTokenHint:"用于飞书 webhook challenge 校验。留空会保留已保存的值。",conversationSecretPlaceholder:"留空则保留已保存的值",conversationGroupMentions:"群聊中仅在被 @ 时回复",conversationSaved:"对话设置已保存",conversationSave:"保存对话设置",workInMindosHint:"与 MindOS 交互请回到 Ask。这个渠道当前用于接收结果更新、提醒和示例消息。",thisIsNotChat:"这里是消息投递渠道,不是聊天收件箱。",useCasesTitle:"你会收到什么",statusSummaryTitle:"状态摘要",lastActivity:"最近活动",lastRecipient:"最近接收者",noActivityYet:"还没有发送过消息",noActivityHint:"发送一条示例消息,确认这个渠道已经可用。",recentActivity:"最近活动记录",sendSample:"发送示例通知",sampleHint:"这会通过当前渠道发送一条真实的外发消息。",settingsTitle:"设置",settingsHint:"在这里维护凭证和渠道设置。",showSettings:"展开设置",hideSettings:"收起设置",latestSuccess:"最近成功",latestFailure:"最近失败",noRecentActivity:"暂无最近活动",notAvailable:"暂无",activityTypeTest:"示例消息",activityTypeAgent:"Agent 更新",activityTypeManual:"手动发送",disconnectHint:"移除凭证并断开此平台的连接。",editCredentials:"更新凭证",editCredentialsHint:"如果需要轮换密钥或修复连接,可直接在这里更新并保存。",guideLink:"打开配置指南",recipientHint:"请输入平台对应的接收者 ID。",savedValuesHint:"已保存的值会保持隐藏。若要更新凭证,请重新粘贴完整的新值后再保存。",required:"必填",saving:"保存中..."}},echoPages:{parent:"回响",heroKicker:"",segmentNavAria:"回响模块",snapshotBadge:"本地 \xb7 私密",factsHeading:"所见",snapshotImprintTitle:"从一行开始",snapshotImprintBody:"离手即存,自动保存在本机。",snapshotGrowthTitle:"意图落在这里",snapshotGrowthBody:"写一句此刻最想推进的方向。它只保存在本机,可随时间改写。",snapshotSelfTitle:"即将推出",snapshotSelfBody:"随着知识库增长,与你相关的笔记会自动浮现在这里。",insightTitle:"见解",insightShow:"展开见解",insightHide:"收起见解",insightHint:"基于你在本页写下的内容生成反思。需在设置中启用 AI。",generateInsight:"生成见解",generateInsightNoAi:"请在 设置 → AI 中启用 AI 功能。",insightGenerating:"生成中…",insightErrorPrefix:"生成失败:",insightRetry:"重试",imprintChatLabel:"聊聊这一行",growthChatLabel:"探索这个方向",selfChatLabel:"发现规律",dailyReportTitle:"回响报告",dailyReportGenerated:"生成于",dailyReportGenerate:"生成回响",dailyReportGenerating:"生成中…",dailyReportRetry:"重试",dailyReportContinueAgent:"聊聊这个",reportSnapshotTitle:"动向",reportSnapshotFilesEdited:"编辑文件",reportSnapshotFilesCreated:"新建文件",reportSnapshotSessions:"对话次数",reportSnapshotKbGrowth:"知识库增长",reportThemesTitle:"主题",reportThemeFiles:"个文件",reportAlignmentTitle:"对齐度",reportAlignmentScore:"对齐度",reportAlignmentAligned:"对齐",reportAlignmentPartial:"部分对齐",reportAlignmentMisaligned:"偏离",reportReflectionTitle:"明天思考",dailyLineLabel:"今日一行",dailyLinePlaceholder:"写下一行轻量的文字…",dailySavedNote:"已保存在本机。",savedFlash:"已保存",dailyAskPrefill:a=>`帮我围绕今天写的内容展开:
110
120
 
111
- ${a.trim()||"(还没有写)"}`,growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",imprintLead:"写一行今天的思绪。可以生成回响报告,或聊聊来深入。",growthLead:"写下你正在推进的方向。随时间回看,观察它如何演变。",selfLead:"随着知识库增长,与你相关的笔记会自动浮现在这里。"},agentsContent:{title:"智能体",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"你的 Agent",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"技能",navNetwork:"网络",navSessions:"会话",navActivity:"活动",navChannels:"频道",channelsSubtitle:"连接消息平台,让 MindOS 代您发送消息。",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回总览",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起",addCustomAgent:"添加自定义 Agent",addCustomAgentTitle:"添加自定义 Agent",editCustomAgentTitle:a=>`编辑 ${a}`,customAgentName:"Agent 名称",customAgentNamePlaceholder:"例如 QCLaw、WorkBuddy",customAgentDir:"配置目录",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"常见路径:~/.xxx/ 或 ~/Library/Application Support/",customAgentKeyPreview:a=>`标识符:${a}`,customAgentContinue:"继续",customAgentDetecting:"检测中...",customAgentDirFound:"目录已找到",customAgentDirNotFound:"目录尚未创建,安装后将自动检测",customAgentDetectTimeout:"检测超时,使用默认配置",customAgentDetectedTitle:"检测到的配置",customAgentDefaultTitle:"默认配置",customAgentConfigLabel:"MCP 配置",customAgentFormatLabel:"格式",customAgentTransportLabel:"传输协议",customAgentSkillsLabel:"技能",customAgentSkillsFound:a=>`发现 ${a} 个技能`,customAgentSkillsNone:"未检测到",customAgentSkillDir:"技能目录",customAgentSkillDirHint:"此 Agent 安装技能的目录",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"自定义配置",customAgentAdd:"添加 Agent",customAgentAdding:"添加中...",customAgentSave:"保存更改",customAgentSaving:"保存中...",customAgentRetry:"重试",customAgentAdded:a=>`${a} 已添加`,customAgentUpdated:a=>`${a} 已更新`,customAgentRemoved:a=>`${a} 已移除`,customAgentRemoveTitle:a=>`移除「${a}」?`,customAgentRemoveMessage:"这将从 MindOS 中移除该 Agent,不会删除磁盘上的任何文件。",customAgentRemoveConfirm:"移除",customAgentConfigPath:"MCP 配置文件路径",customAgentConfigKey:"配置键名",customAgentFormat:"格式",customAgentTransport:"传输协议",customAgentProjectConfig:"项目配置路径(可选)",customAgentCliBinary:"CLI 命令名(可选)",customAgentCliBinaryPlaceholder:"例如 qclaw",customAgentEdit:"编辑",customAgentRemove:"移除",customAgentCancel:"取消",customAgentNetworkError:"网络错误,请重试。",customAgentFailedSave:"保存失败",customAgentFailedRemove:"移除失败",customAgentKeyConflict:a=>`已存在标识为 "${a}" 的 Agent`,customAgentBuiltinConflict:a=>`与内置 Agent "${a}" 冲突`},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP 服务器查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP 服务器",searchServersPlaceholder:"搜索 MCP 服务器...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?配置文件将自动更新。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",removeSuccess:"已移除,重启 Agent 后生效。",removeFailed:"移除失败,请手动编辑配置文件。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`,mcpDisabledMessage:"MCP 模式未启用。",mcpDisabledHint:"请在设置 → 连接中启用,以使用 MCP 智能体。"},skills:{title:"技能",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`通用:${a}`,registryAdditional:a=>`附加:${a}`,registryUnsupported:a=>`不支持:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按技能查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"技能模式",agentMcpServers:"MCP 服务器",agentNativeSkills:"原生技能",agentMindosSkills:"MindOS 技能",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置服务器",healthInstalledSkills:"原生已安装技能",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent 标识",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"技能模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部技能",skillsEnabled:"已启用技能",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置技能...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取技能内容失败。",skillSaveFailed:"保存技能内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。",knowledgeInteraction:"知识交互",knowledgeNoData:"暂无交互记录。Agent 开始使用你的知识库后,活动将显示在这里。",recentOps:"近期操作",statTotalCalls:"总调用",statFilesTouched:"涉及文件",statReadWrite:"读 / 写",statHealth:"健康度",viewFullLog:"查看完整日志",showLess:"收起"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"连接",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"智能体",update:"更新",uninstall:"卸载"},ai:{provider:"模型服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",keyHint:"本地存储于 ~/.mindos/config.json",keyOptionalHint:"本地服务商可选。存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",keyChange:"更改",keyCancel:"取消",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyEndpointError:"接口地址或协议不匹配",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型",resetProvider:"重置",resetProviderConfirm:"再次点击确认"},customProviders:{title:"Model Providers",subtitle:"添加自定义 API 端点并为其命名",addButton:"+ 添加 Provider",editButton:"编辑",deleteButton:"删除",testButton:"测试",emptyState:"还没有自定义 Provider。添加一个来使用自定义 API 端点或代理。",modal:{titleAdd:"添加 Model Provider",titleEdit:"编辑 Model Provider",fieldName:"名称",fieldNameHint:"例如:公司 GPT-4、本地 LLaMA",fieldProtocol:"协议",fieldProtocolHint:"(大多数本地服务使用 OpenAI 兼容接口)",fieldBaseUrl:"接口地址",fieldBaseUrlHint:"例如:https://api.company.com/v1 或 http://localhost:8080/v1",fieldApiKey:"API 密钥",fieldApiKeyHint:"本地服务可留空",fieldModel:"模型",fieldModelHint:"例如:gpt-4-turbo、llama3.2",buttonCancel:"取消",buttonSave:"保存并测试",buttonSaveOnly:"保存",validating:"测试连接中...",success:"✓ 已连接",error:"连接失败"},deleteConfirm:a=>`删除 "${a}"?此操作不可撤销。`,deleteConfirmButton:"删除"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",labsTitle:"实验性功能",labsDesc:"仍在开发中的功能,可能会变更或移除。",labsEcho:"回响",labsEchoDesc:"基于笔记的反思性日记。",labsWorkflows:"工作流",labsWorkflowsDesc:"Agent 可视化工作流自动化。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{cardTitle:"知识库",securityTitle:"安全",passwordPlaceholder:"留空可禁用",passwordShow:"显示",passwordHide:"隐藏",tokenNotSet:"— 未设置 —",mcpUrl:"MCP 地址",tokenGenerated:"已生成新令牌。请立即复制 — 之后不会再次完整显示。",monitoringTitle:"系统监控",monitoringFailed:"加载监控数据失败",monitorHeap:"堆内存",monitorRss:"RSS",monitorUptime:"运行时间",monitorNode:"Node",monitorRequests:"请求数",monitorToolCalls:"工具调用",monitorTokens:"Token",monitorFiles:"文件",monitorErrors:"错误",monitorMcpRunning:a=>`运行中 :${a}`,monitorMcpStopped:"已停止",cancel:"取消",mindRoot:"知识库根目录",mindRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",mindRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshBrief:"一次配置,无需令牌",httpsBrief:"通用性强,建议配令牌",sshHint:"需要本机已配置 SSH 密钥。验证命令:ssh -T git@github.com",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub:",tokenLink:"创建令牌(勾选 repo 权限)",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中...",stepConnecting:"正在连接远程仓库...",stepAuthenticating:"正在验证身份...",stepSyncing:"正在同步数据...",stepAlmostDone:"即将完成...",stepDone:"同步配置成功!",gitignoreTitle:"排除文件",gitignorePlaceholder:"# 不同步的文件\n*.tmp\nsecret/",gitignoreSave:"保存",gitignoreSaved:"已保存",conflictExplain:"这些文件在本机和远程都被修改了。请选择保留哪个版本。",keepLocal:"保留本地",keepRemote:"保留远程",keepLocalHint:"保留本机的版本",keepRemoteHint:"替换为远程版本",viewDiff:"点击查看两个版本的差异",localVersion:"本地(本机)",remoteVersion:"远程",emptyFile:"(空)",sectionTitle:"同步",labelProvider:"提供商",labelRemote:"远程",labelBranch:"分支",labelLastSync:"最后同步",labelUnpushed:"未推送",labelAutoSync:"自动同步",unpushedCommits:a=>`${a} 次提交`,syncNow:"立即同步",disableAutoSync:"禁用自动同步",enableAutoSync:"启用自动同步",syncComplete:"同步完成",syncFailed:"同步失败",autoSyncDisabled:"已禁用自动同步",autoSyncEnabled:"已启用自动同步",toggleFailed:"切换同步失败",conflictsTitle:a=>`冲突 (${a})`,conflictHint:"单击文件查看你的版本。悬停并单击",conflictHintSuffix:"查看远程版本。",timeNever:"从未",timeJustNow:"刚刚",timeMinAgo:a=>`${a} 分钟前`,timeHourAgo:a=>`${a} 小时前`,timeDayAgo:a=>`${a} 天前`},plugins:{title:"已安装渲染器",builtinBadge:"内置",coreBadge:"核心",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{modeCardTitle:"连接模式",modeCardDesc:"选择 Agent 如何连接到 MindOS。",cliLabel:"CLI",cliModeDesc:"Claude Code、Gemini CLI、Codex 等。",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop、Cursor、Windsurf 等。",alwaysOn:"始终开启",mcpRunning:"运行中",mcpStopped:"已停止",mcpEnabledHint:"MCP 模式已启用。若仅使用 CLI Agent,可禁用此项以简化界面。",mcpDisabledHint:"启用 MCP 以连接 Claude Desktop 或 Cursor 等桌面客户端。",serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"技能",skillsDesc:"教 Agent 如何操作你的知识库。",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加技能",cliInstallHint:"通过命令行安装:",skillPathHint:"技能文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名技能已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"技能语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索技能...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的技能`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON",connectionTitle:"连接 Agent",connectionHint:"选择 AI Agent 连接 MindOS 的方式。",tokenCardTitle:"认证令牌",tokenCardDesc:"用于 CLI 远程模式和 MCP 连接。",mcpHint:"适用于 Claude Desktop、Cursor 等使用 MCP 工具协议的 Agent。",tokenLabel:"认证令牌",tokenMasked:"点击「显示」查看完整令牌",tokenShow:"显示",tokenHide:"隐藏",tokenCopy:"复制",tokenCopied:"令牌已复制!",tokenNone:"未设置令牌 — MCP 服务对所有请求开放。",tokenNoneAction:"请在 设置 → 通用 → 安全 中生成令牌。",serverUrl:"MCP 服务地址",serverUrlCopy:"复制地址",howToConnect:"如何连接 AI 助手",howToStep1:"打开你的 AI 助手的 MCP 设置(如 Claude Code、Cursor)",howToStep2:"添加一个新的 MCP 服务,填入上方地址",howToStep3:"将认证令牌设为 Bearer Token",howToStep4:"保存并验证连接",cliSkillTitle:"CLI 技能",cliSkillHint:"适用于支持 bash 的 Agent(Claude Code、Gemini CLI、Codex)——更省 token,无需 MCP。",cliSkillDesc:"更省 token,技能内置——安装即可使用。",cliLocalDesc:"MindOS Skill 已内置,安装 CLI 即可直接使用。",cliRemoteDesc:"在其他设备上安装 CLI,远程连接到此 MindOS 服务器。",cliSkillInstall:"安装",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"远程",cliSkillVerify:"验证",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"配置",cliInstallSkill:"安装技能",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"需要逐个 Agent 配置 MCP,通过以下命令单独安装技能:",mcpLocalDesc:"复制下方配置代码,粘贴到你的 Agent 的 MCP 设置中。",mcpRunningLabel:"MCP 运行中",mcpServerStatus:"MCP 服务",autoInstallAgents:"自动安装到已检测的 Agent",detectedAgentsTitle:"检测到的 Agent",cliInstallDesc:"为你的 Agent 安装 MindOS Skill,让它能操作你的知识库。",mcpInstallDesc:"为本机检测到的 Agent 安装 MCP 配置和 Skill。",tokenCopyFullHint:"复制完整令牌",skillsInstalled:"个技能已安装",recommended:"推荐",localTitle:"本机",localReady:"可直接使用",remoteTitle:"远程访问",remoteSubtitle:"从其他设备连接",restarting:"重启中...",restart:"重启",portsCardTitle:"服务端口",portsCardDesc:"Web UI 和 MCP 服务端口。更改后重启生效。",webPortLabel:"Web UI 端口",webPortHint:"浏览器访问的端口。",mcpPortLabel:"MCP 服务端口",mcpPortHint:"Agent 和桌面客户端连接的端口。",portChecking:"检测中…",portAvailable:"可用",portSelf:"当前端口",portInUse:a=>`端口 ${a} 已被占用`,portSuggest:a=>`使用 ${a}`,portConflict:"Web 和 MCP 端口不能相同。",portUpdating:"保存中…",portWebRestarting:"正在重启服务…",portMcpRestarting:"正在重启 MCP…",portUpdateSuccess:"端口更新成功。",portUpdateFailed:"端口更新失败。",portRestartTimeout:"重启超时,请重试。",portRedirecting:"正在跳转到新地址…",portUpdateBtn:"更新端口",externalToolsTitle:"外部 MCP 工具",externalToolsDesc:"配置外部 MCP 服务器的工具访问模式。"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。",coreTitle:"MindOS Core",coreUpToDate:"核心已是最新",coreAvailable:a=>`有新版本可用(${a})`,coreDownloading:"下载中...",coreCancel:"取消",coreReady:"已就绪 — 重启服务即可生效",coreRestartServices:"重启服务",coreApplying:"正在应用更新...",coreApplied:"更新成功!正在刷新...",coreError:"核心更新失败。",coreRetry:"重试",coreDesktopTooOld:a=>`v${a} 需要更新版本的 Desktop。`,coreDesktopTooOldHint:"请先更新 MindOS Desktop。",coreHint:"核心更新只需重启服务,无需重启应用。",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} 可用`,titleMultiple:"有可用更新",desktopLabel:"桌面版",coreLabel:"运行时",viewDetails:"查看详情",skipVersion:"跳过此版本",skipAll:"全部跳过"}},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败。请刷新页面或尝试其他模板。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 连接","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",listModels:"选择模型",noModelsFound:"未找到可用模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"认证令牌",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 连接",connectionModeTitle:"连接模式",connectionModeCliHint:"推荐 \xb7 更省 token",connectionModeMcpHint:"可选 \xb7 消耗更多 token",agentToolsHint:"选择要配置的 AI Agent。此步骤可选。",agentToolsHintCliOnly:"Agent 选择在 MCP 模式启用时生效。CLI 可直接用于所有支持 bash 的 Agent。",agentToolsHintNone:"未选择连接模式。请至少选择一种模式以连接 Agent。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 Agent。可稍后在设置中配置。",agentSkipLater:"清除选择",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentGetIt:"去安装 →",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"",skillAutoHint:()=>"",skillLabel:"技能",skillInstalling:"正在安装技能…",skillInstalled:"技能已安装",skillFailed:"技能安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → 连接 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",healthKb:"知识库",healthKbNone:"未配置",healthAi:"AI 服务",healthAiNone:"未配置 — AI 功能不可用",healthAiAction:"可在 设置 → AI 中添加 API 密钥。",healthAgents:"Agent 连接",healthAgentsOk:a=>`已配置 ${a} 个 Agent`,healthAgentsPartial:"正在配置中...",healthAgentsNone:"未配置 Agent",healthAgentsAction:"可稍后在 设置 → 连接 中添加。",healthSkills:"Skills",healthSkillsOk:"Skill 安装成功",healthSkillsError:"Skill 安装失败",healthSkillsSkipped:"已跳过",healthSkillsInstalling:"正在安装 Skill…",healthSkillsAction:"可稍后手动安装 Skill。",healthTokenTitle:"认证令牌",healthTokenCopy:"复制令牌",healthTokenHint:"CLI 远程模式和 MCP 连接时使用。也可在 设置 → 连接 中找到。",healthGoHome:"进入 MindOS",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。现在可以直接问 MindOS、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",stepLocked:"请先完成上一步",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"AI 帮你沉淀",cta:"试试",desc:"让 MindOS 把对话中的经验沉淀到知识库:",prompt:"帮我把这次对话的关键收获整理成一份可复用的 SOP,存到我的知识库里。",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"连接其他 Agent",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意 MCP Agent,粘贴以下提示词,让知识流入 MindOS:",copyPrompt:"把我们刚才讨论的内容总结一下,存到我的 MindOS 知识库里,形成可复用的 SOP。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS 会自动读取你的知识库。问它项目相关的事,不需要每次都重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你的本地知识助手。它把项目、决策、SOP 和偏好整理在同一处,让你和已连接的 Agent 都能基于同一份上下文工作。文件保留在本地,知识可以反复复用,也不用每次都从头交代背景。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如个人档案、笔记或项目。',step2Title:"和 MindOS 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 MindOS。你可以直接询问知识库相关问题,或用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → 连接 以连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 MindOS",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 MindOS 中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → 连接。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}}},53825:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("404f80dfdc1dfd86d6e251d8fc5d276a2b2998d6d6",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},54195:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>O});var d=c(48249),e=c(67484),f=c(33740);let g=/^##\s+(.+)/,h=/^#\s+/,i=/^#{3,6}\s+(.+)/,j=/^(\s*)- \[([ xX~])\]\s+(.*)$/,k=/`(P[012])`/,l=/`(\d{4}-\d{2}-\d{2}|\d{2}-\d{2})`/,m=/#([a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*)/g;function n(a,b){let c=[...a];return b(c),c.join("\n")}function o(a){let b=function(a){if(!a)return null;let b=new Date;return new Date(/^\d{2}-\d{2}$/.test(a)?`${b.getFullYear()}-${a}`:a)}(a);if(!b||isNaN(b.getTime()))return null;let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()),e=(new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-d.getTime())/864e5;return e<0?"overdue":0===e?"today":e<=3?"soon":"future"}function p(a,b){return a.reduce((a,c)=>a+ +(c.status===b)+p(c.children,b),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r(a,b){return("all"===b.status||a.status===b.status)&&("all"===b.priority||a.meta.priority===b.priority)&&("all"===b.tag||!!a.meta.tags.includes(b.tag))}let s={P0:{bg:"bg-red-500/10",text:"text-red-500",border:"border-red-500/20"},P1:{bg:"bg-amber-500/10",text:"text-amber-500",border:"border-amber-500/20"},P2:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/20"}},t={overdue:{text:"text-red-500",bg:"bg-red-500/10"},today:{text:"text-amber-500",bg:"bg-amber-500/10"},soon:{text:"text-amber-400",bg:"bg-amber-400/5"},future:{text:"text-muted-foreground",bg:""}},u={TODAY:{dot:"bg-red-400",label:"text-red-400"},"This Week":{dot:"bg-orange-400",label:"text-orange-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Done:{dot:"bg-emerald-400",label:"text-emerald-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};var v=c(56692),w=c(46674);function x({filters:a,onFilterChange:b,allTags:c,allPriorities:e,counts:f}){let g="all"!==a.priority||"all"!==a.tag||"all"!==a.status;return 0===c.length&&0===e.length?null:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,d.jsx)(v.A,{size:12,className:"text-muted-foreground shrink-0"}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden text-xs",children:[(0,d.jsxs)("button",{onClick:()=>b({...a,status:"all"}),className:`px-2.5 py-1 transition-colors ${"all"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["All ",f.total]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"todo"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"todo"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Todo ",f.todo]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"in-progress"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"in-progress"===a.status?"bg-[var(--amber)]/10 text-[var(--amber)] font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["In Progress ",f.inProgress]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"done"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"done"===a.status?"bg-emerald-500/10 text-emerald-500 font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Done ",f.done]})]}),e.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:e.map(c=>{if(!c)return null;let e=s[c],f=a.priority===c;return(0,d.jsx)("button",{onClick:()=>b({...a,priority:f?"all":c}),className:`px-2 py-0.5 rounded text-xs font-mono font-medium border transition-colors ${f?`${e.bg} ${e.text} ${e.border}`:"border-transparent text-muted-foreground hover:bg-muted"}`,children:c},c)})}),c.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:c.map(c=>{let e=a.tag===c;return(0,d.jsxs)("button",{onClick:()=>b({...a,tag:e?"all":c}),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${e?"bg-[var(--amber)]/15 text-[var(--amber)]":"text-muted-foreground hover:bg-muted"}`,children:["#",c]},c)})}),g&&(0,d.jsxs)("button",{onClick:()=>b({priority:"all",tag:"all",status:"all"}),className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(w.A,{size:10})," Clear"]})]})}var y=c(75154),z=c(99941),A=c(44643),B=c(24520),C=c(44218),D=c(19794),E=c(59347),F=c(13576);function G({priority:a}){if(!a)return null;let b=s[a];return(0,d.jsx)("span",{className:`inline-flex items-center px-1.5 py-0 rounded text-[10px] font-mono font-semibold leading-4 border shrink-0 ${b.bg} ${b.text} ${b.border}`,children:a})}function H({dateStr:a,status:b}){if(!a||"done"===b)return null;let c=o(a);if(!c)return null;let e=t[c];return(0,d.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0 rounded text-[10px] leading-4 shrink-0 ${e.text} ${e.bg}`,children:[(0,d.jsx)(y.A,{size:9}),a]})}function I({tag:a}){return(0,d.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0 rounded-full text-[10px] leading-4 text-muted-foreground bg-muted/60 shrink-0",children:["#",a]})}function J({status:a,onClick:b}){return(0,d.jsxs)("button",{onClick:b,className:"shrink-0 transition-colors",title:"Click to cycle status",children:["done"===a&&(0,d.jsx)(z.A,{size:15,style:{color:"var(--amber)"}}),"in-progress"===a&&(0,d.jsx)(f.A,{size:15,className:"text-[var(--amber)] fill-[var(--amber)]/20"}),"todo"===a&&(0,d.jsx)(A.A,{size:15,style:{color:"var(--muted-foreground)"}})]})}function K({text:a,status:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${"done"===b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function L({onAdd:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(""),h=(0,e.useRef)(null);function i(){let b=f.trim();b&&a(b),g(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(A.A,{size:15})}),(0,d.jsx)("input",{ref:h,value:f,onChange:a=>g(a.target.value),onBlur:i,onKeyDown:a=>{"Enter"===a.key&&i(),"Escape"===a.key&&(g(""),c(!1))},placeholder:"New item… (supports `P0` `03-28` #tag)",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(B.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function M({item:a,depth:b,filters:c,onCycleStatus:f,onRename:g,onDelete:h}){let[i,j]=(0,e.useState)(!0),k=a.children.length>0,l=r(a,c),m=a.children.some(a=>(function a(b,c){return!!r(b,c)||b.children.some(b=>a(b,c))})(a,c));if(("all"!==c.status||"all"!==c.priority||"all"!==c.tag)&&!l&&!m)return null;let n=o(a.meta.dueDate);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${"done"===a.status?"opacity-45":""} ${"overdue"===n&&"done"!==a.status?"bg-error/[0.03]":""}`,style:{paddingLeft:`${8+20*b}px`},children:[k?(0,d.jsx)("button",{onClick:()=>j(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:i?(0,d.jsx)(C.A,{size:13}):(0,d.jsx)(D.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)(J,{status:a.status,onClick:()=>{var b;return f(a.lineIndex,"todo"===(b=a.status)?"in-progress":"in-progress"===b?"done":"todo")}}),(0,d.jsx)(K,{text:a.text,status:a.status,onRename:b=>g(a.lineIndex,b)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(G,{priority:a.meta.priority}),(0,d.jsx)(H,{dateStr:a.meta.dueDate,status:a.status}),a.meta.tags.map(a=>(0,d.jsx)(I,{tag:a},a))]}),(0,d.jsx)("button",{onClick:()=>h(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(E.A,{size:12})})]}),k&&i&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(M,{item:a,depth:b+1,filters:c,onCycleStatus:f,onRename:g,onDelete:h},a.id))})]})}function N({name:a,meta:b,filters:c,defaultCollapsed:f,onCycleStatus:g,onRename:h,onDelete:i,onAdd:j}){let k,[l,m]=(0,e.useState)(f??!1),n=(k=Object.keys(u).find(b=>a.includes(b)))?u[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:o,lastLineIndex:r}=b,s=p(o,"done"),t=p(o,"in-progress"),v=q(o),w=a.includes("Done");return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:[s,"/",v]}),t>0&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-[var(--amber)]",children:[(0,d.jsx)(F.A,{size:9})," ",t]})]}),l?(0,d.jsx)(D.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(C.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:v?`${s/v*100}%`:"0%",background:w?"var(--success, #22c55e)":"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[o.map(a=>(0,d.jsx)(M,{item:a,depth:0,filters:c,onCycleStatus:g,onRename:h,onDelete:i},a.id)),0===o.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),!w&&(0,d.jsx)(L,{onAdd:a=>j(r,a)})]})]})}function O({content:a,saveAction:b}){let[c,o]=(0,e.useState)(a),[r,s]=(0,e.useState)({priority:"all",tag:"all",status:"all"}),{sections:t,lines:u,sectionOrder:v}=(0,e.useMemo)(()=>{let a,b,d,e,f,n,o;return a=c.split("\n"),b="General",d={},e=[],f=[],n=!1,o=!1,a.forEach((a,c)=>{if(!o){if(0===c&&"---"===a.trim()){n=!0;return}if(n){"---"===a.trim()&&(n=!1,o=!0);return}o=!0}if(h.test(a))return;let p=a.match(g);if(p){d[b=p[1].replace(/^[^\w\s\u4e00-\u9fff]+\s*/,"").trim()]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:c},e.push(b));return}if(i.test(a))return;let q=a.match(j);if(!q)return;let[,r,s,t]=q,u=Math.floor(r.length/2),v="~"===s?"in-progress":"x"===s.toLowerCase()?"done":"todo",{cleanText:w,meta:x}=function(a){let b,c=a,d=null,e=null,f=[],g=c.match(k);g&&(d=g[1],c=c.replace(k,"").trim());let h=c.match(l);h&&(e=h[1],c=c.replace(l,"").trim());let i=RegExp(m.source,"g");for(;null!==(b=i.exec(c));)f.push(b[1]);return f.length>0&&(c=c.replace(/#[a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*/g,"").trim()),{cleanText:c=c.replace(/\*\*(.*?)\*\*/g,"$1").trim(),meta:{priority:d,dueDate:e,tags:f}}}(t),y={id:`${c}`,text:w,rawText:t,status:v,indent:u,lineIndex:c,section:b,children:[],meta:x};for(;f.length>0&&f[f.length-1].indent>=u;)f.pop();d[b]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:-1},e.push(b)),f.length>0?f[f.length-1].children.push(y):d[b].items.push(y),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),f.push(y)}),{sections:d,lines:a,sectionOrder:e}},[c]),w=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"done"),0),[t]),y=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"in-progress"),0),[t]),z=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+q(b.items),0),[t]),A=z-w-y,B=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c){for(let a of d.meta.tags)b.add(a);a(d.children)}}(c.items);return[...b].sort()})(t),[t]),C=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c)d.meta.priority&&b.add(d.meta.priority),a(d.children)}(c.items);return["P0","P1","P2"].filter(a=>b.has(a))})(t),[t]),D=(0,e.useCallback)(async a=>{o(a),await b(a)},[b]),E=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/- \[[ xX~]\]/,`- [${"done"===b?"x":"in-progress"===b?"~":" "}]`)}))},[u,D]),F=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/(- \[[ xX~]\]\s*)(.*)$/,`$1${b}`)}))},[u,D]),G=(0,e.useCallback)(async a=>{await D(n(u,b=>{b.splice(a,1)}))},[u,D]),H=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[u,D]),I=v.filter(a=>t[a]).map(a=>[a,t[a]]),J=z?Math.round(w/z*100):0;return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsx)("div",{className:"mb-5 flex items-center gap-4",children:(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsxs)("span",{className:"text-lg font-semibold font-display text-foreground tabular-nums",children:[J,"%"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground font-display",children:[w,"/",z," completed"]}),y>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[var(--amber)]",children:[(0,d.jsx)(f.A,{size:8,className:"fill-[var(--amber)]/30"}),y," in progress"]})]}),(0,d.jsx)("div",{className:"mt-2 w-full max-w-xs h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${J}%`,background:"var(--amber)"}})})]})}),(0,d.jsx)(x,{filters:r,onFilterChange:s,allTags:B,allPriorities:C,counts:{todo:A,inProgress:y,done:w,total:z}}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[I.map(([a,b])=>(0,d.jsx)(N,{name:a,meta:b,filters:r,defaultCollapsed:a.includes("Done"),onCycleStatus:E,onRename:F,onDelete:G,onAdd:H},a)),0===I.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},54461:(a,b,c)=>{"use strict";c.d(b,{X:()=>l,d:()=>g});var d=c(67484),e=c(49223);function f(a){let b=Date.now();return{id:`${b}-${Math.random().toString(36).slice(2,8)}`,currentFile:a,createdAt:b,updatedAt:b,messages:[]}}function g(a){if(a.title)return a.title;let b=a.messages.find(a=>"user"===a.role);if(!b)return"(empty session)";let c=b.content.replace(/\s+/g," ").trim();return!c&&b.images&&b.images.length>0?`[${b.images.length} image${b.images.length>1?"s":""}]`:c.length>42?`${c.slice(0,42)}...`:c||"(empty session)"}async function h(){try{let a=await fetch("/api/ask-sessions",{cache:"no-store"});if(!a.ok)return[];let b=await a.json();if(!Array.isArray(b))return[];return b.slice(0,30)}catch{return[]}}async function i(a){try{let b={...a,messages:a.messages.map(a=>a.images&&0!==a.images.length?{...a,images:a.images.map(a=>({...a,data:""}))}:a)};await fetch("/api/ask-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b})})}catch{}}async function j(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})})}catch{}}async function k(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a})})}catch{}}function l(a){let[b,c]=(0,d.useState)([]),[g,l]=(0,d.useState)([]),[m,n]=(0,d.useState)(null),o=(0,d.useRef)(null),p=(0,d.useCallback)(async()=>{let b=(await h()).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30),d=b.filter(a=>0===a.messages.length).map(a=>a.id),e=d.length>0?b.filter(a=>!d.includes(a.id)):b;d.length>0&&k(d);let g=f(a),i=a?e.find(b=>b.currentFile===a):e[0];i?(n(i.id),c(i.messages),l([...e])):(n(g.id),c([]),l([g,...e].slice(0,30)))},[a]),q=(0,d.useCallback)((b,c)=>{if(!c||0===b.length)return;let d=null;l(e=>{let f=Date.now(),g=e.find(a=>a.id===c);d=g?{...g,currentFile:a,updatedAt:f,messages:b}:{id:c,currentFile:a,createdAt:f,updatedAt:f,messages:b};let h=e.filter(a=>a.id!==c);return[d,...h].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{d&&i(d)},600)},[a]),r=(0,d.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),s=(0,d.useCallback)(()=>{l(b=>{let d=b.find(a=>a.id===m);if(d&&0===d.messages.length)return b;let e=f(a);return n(e.id),c([]),[e,...b].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)})},[a,m]),t=(0,d.useCallback)(a=>{let b=g.find(b=>b.id===a);if(!b)return;let d=m?g.find(a=>a.id===m):null;d&&0===d.messages.length&&d.id!==a&&l(a=>a.filter(a=>a.id!==d.id)),n(b.id),c(b.messages)},[g,m]),u=(0,d.useCallback)(b=>{let d=g.find(a=>a.id===b);d&&d.messages.length>0&&j(b);let e=g.filter(a=>a.id!==b);if(l(e),m===b){let b=f(a);n(b.id),c([]),l([b,...e].slice(0,30))}},[m,a,g]),v=(0,d.useCallback)((a,b)=>{let c=b.trim();l(b=>{let d=b.findIndex(b=>b.id===a);if(d<0)return b;let e={...b[d],title:c||void 0},f=[...b];return f[d]=e,i(e),f})},[]),w=(0,d.useCallback)(a=>{l(b=>{let c=b.findIndex(b=>b.id===a);if(c<0)return b;let d={...b[c],pinned:!b[c].pinned},e=[...b];return e[c]=d,d.messages.length>0&&i(d),e})},[]),x=(0,d.useCallback)(b=>{if(!m)return;let c=g.find(a=>a.id===m);if(!c)return;let d=(0,e.R3)({...c,currentFile:c.currentFile??a,updatedAt:Date.now()},b);l(a=>[d,...a.filter(a=>a.id!==m)].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)),o.current&&clearTimeout(o.current),d.messages.length>0&&(o.current=setTimeout(()=>{i(d)},600))},[m,a,g]),y=(0,d.useCallback)(()=>{let b=g.filter(a=>a.messages.length>0).map(a=>a.id);b.length>0&&k(b);let d=f(a);n(d.id),c([]),l([d])},[a,g]);return{messages:b,setMessages:c,sessions:[...g].sort((a,b)=>a.pinned&&!b.pinned?-1:!a.pinned&&b.pinned?1:b.updatedAt-a.updatedAt),activeSession:g.find(a=>a.id===m)??null,activeSessionId:m,initSessions:p,persistSession:q,clearPersistTimer:r,resetSession:s,loadSession:t,deleteSession:u,renameSession:v,togglePinSession:w,setSessionDefaultAcpAgent:x,clearAllSessions:y}}},55038:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/global-error.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/app/app/global-error.tsx","default")},55232:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0),j=(0,d.useRef)(!1),k=(0,d.useCallback)(async()=>{b((await fetch("/api/skills").then(a=>a.ok?a.json():{skills:[]}).then(a=>Array.isArray(a?.skills)?a.skills:[]).catch(()=>[])).filter(a=>a.enabled)),j.current=!0},[]),l=(0,d.useCallback)((b,c)=>{let d=b.slice(0,c),f=d.lastIndexOf("/");if(-1===f||f>0&&" "!==d[f-1]&&"\n"!==d[f-1])return void e(null);let h=d.slice(f+1);if(h.includes(" "))return void e(null);if(!j.current){k(),e(null);return}let l=h.toLowerCase(),m=l?a.map(a=>{let b=a.name.toLowerCase(),c=0;return b.startsWith(l)?c=100:b.includes(l)?c=50:a.description.toLowerCase().includes(l)&&(c=10),{s:a,score:c}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,20).map(a=>({type:"skill",name:a.s.name,description:a.s.description})):a.slice(0,20).map(a=>({type:"skill",name:a.name,description:a.description}));if(0===m.length){e(null),g([]),i(0);return}e(h),g(m),i(0)},[a,k]),m=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{slashQuery:c,slashResults:f,slashIndex:h,updateSlashFromInput:l,navigateSlash:m,resetSlash:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},56606:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,30488)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,41829)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,47336)),Promise.resolve().then(c.bind(c,21416)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,54195)),Promise.resolve().then(c.bind(c,63956)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,49905)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,70137)),Promise.resolve().then(c.bind(c,5200))},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>v,DO:()=>l,KF:()=>j,Mv:()=>n,TM:()=>u,ZC:()=>t,lx:()=>s,md:()=>k,pp:()=>o,rA:()=>m});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484),i=c(10927);function j({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function k({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function l({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function m({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function n({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function o({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/40 bg-card/30 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let p=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function q(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function r(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function s({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=p[q(a)%p.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:r(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function t({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function u({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:j,variant:k="destructive"}){let l=(0,h.useRef)(null),m=(0,h.useRef)(null);return((0,i.r)(m,a),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:j,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{id:"confirm-dialog-title",className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:j,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===k?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function v({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=p[q(a.name)%p.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:r(a.name)})})(),a.name]},a.key))})}):null}},59238:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AudioRenderer() from the server but AudioRenderer is 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/app/components/renderers/audio/AudioRenderer.tsx","AudioRenderer")},59867:(a,b,c)=>{"use strict";c.d(b,{x:()=>u,A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(801),h=c(6079),i=c(8455),j=c(40560),k=c(42742),l=c(19794),m=c(44218),n=c(47223),o=c(95054),p=c(99101),q=c(90826),r=c(69593);function s(a,b,c=new Date){let d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=`> Saved session from MindOS Ask \xb7 ${d}-${e}-${f}`;if("full"===b){let b=a.map(a=>{let b=(0,r.Oo)(a.content).trim();if(!b)return null;let c="user"===a.role?"**User**":"**Assistant**";return`### ${c}
121
+ ${a.trim()||"(还没有写)"}`,growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",imprintLead:"写一行今天的思绪。可以生成回响报告,或聊聊来深入。",growthLead:"写下你正在推进的方向。随时间回看,观察它如何演变。",selfLead:"随着知识库增长,与你相关的笔记会自动浮现在这里。"},agentsContent:{title:"智能体",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"你的 Agent",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"技能",navNetwork:"网络",navSessions:"会话",navActivity:"活动",navChannels:"频道",channelsSubtitle:"连接消息平台,让 MindOS 代您发送消息。",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回总览",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起",addCustomAgent:"添加自定义 Agent",addCustomAgentTitle:"添加自定义 Agent",editCustomAgentTitle:a=>`编辑 ${a}`,customAgentName:"Agent 名称",customAgentNamePlaceholder:"例如 QCLaw、WorkBuddy",customAgentDir:"配置目录",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"常见路径:~/.xxx/ 或 ~/Library/Application Support/",customAgentKeyPreview:a=>`标识符:${a}`,customAgentContinue:"继续",customAgentDetecting:"检测中...",customAgentDirFound:"目录已找到",customAgentDirNotFound:"目录尚未创建,安装后将自动检测",customAgentDetectTimeout:"检测超时,使用默认配置",customAgentDetectedTitle:"检测到的配置",customAgentDefaultTitle:"默认配置",customAgentConfigLabel:"MCP 配置",customAgentFormatLabel:"格式",customAgentTransportLabel:"传输协议",customAgentSkillsLabel:"技能",customAgentSkillsFound:a=>`发现 ${a} 个技能`,customAgentSkillsNone:"未检测到",customAgentSkillDir:"技能目录",customAgentSkillDirHint:"此 Agent 安装技能的目录",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"自定义配置",customAgentAdd:"添加 Agent",customAgentAdding:"添加中...",customAgentSave:"保存更改",customAgentSaving:"保存中...",customAgentRetry:"重试",customAgentAdded:a=>`${a} 已添加`,customAgentUpdated:a=>`${a} 已更新`,customAgentRemoved:a=>`${a} 已移除`,customAgentRemoveTitle:a=>`移除「${a}」?`,customAgentRemoveMessage:"这将从 MindOS 中移除该 Agent,不会删除磁盘上的任何文件。",customAgentRemoveConfirm:"移除",customAgentConfigPath:"MCP 配置文件路径",customAgentConfigKey:"配置键名",customAgentFormat:"格式",customAgentTransport:"传输协议",customAgentProjectConfig:"项目配置路径(可选)",customAgentCliBinary:"CLI 命令名(可选)",customAgentCliBinaryPlaceholder:"例如 qclaw",customAgentEdit:"编辑",customAgentRemove:"移除",customAgentCancel:"取消",customAgentNetworkError:"网络错误,请重试。",customAgentFailedSave:"保存失败",customAgentFailedRemove:"移除失败",customAgentKeyConflict:a=>`已存在标识为 "${a}" 的 Agent`,customAgentBuiltinConflict:a=>`与内置 Agent "${a}" 冲突`},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP 服务器查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP 服务器",searchServersPlaceholder:"搜索 MCP 服务器...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?配置文件将自动更新。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",removeSuccess:"已移除,重启 Agent 后生效。",removeFailed:"移除失败,请手动编辑配置文件。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`,mcpDisabledMessage:"MCP 模式未启用。",mcpDisabledHint:"请在设置 → 连接中启用,以使用 MCP 智能体。"},skills:{title:"技能",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`通用:${a}`,registryAdditional:a=>`附加:${a}`,registryUnsupported:a=>`不支持:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按技能查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"技能模式",agentMcpServers:"MCP 服务器",agentNativeSkills:"原生技能",agentMindosSkills:"MindOS 技能",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置服务器",healthInstalledSkills:"原生已安装技能",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent 标识",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"技能模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部技能",skillsEnabled:"已启用技能",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置技能...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取技能内容失败。",skillSaveFailed:"保存技能内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。",knowledgeInteraction:"知识交互",knowledgeNoData:"暂无交互记录。Agent 开始使用你的知识库后,活动将显示在这里。",recentOps:"近期操作",statTotalCalls:"总调用",statFilesTouched:"涉及文件",statReadWrite:"读 / 写",statHealth:"健康度",viewFullLog:"查看完整日志",showLess:"收起"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"连接",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"智能体",update:"更新",uninstall:"卸载"},ai:{provider:"模型服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",keyHint:"本地存储于 ~/.mindos/config.json",keyOptionalHint:"本地服务商可选。存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",keyChange:"更改",keyCancel:"取消",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyEndpointError:"接口地址或协议不匹配",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型",resetProvider:"重置",resetProviderConfirm:"再次点击确认"},customProviders:{title:"Model Providers",subtitle:"添加自定义 API 端点并为其命名",addButton:"+ 添加 Provider",editButton:"编辑",deleteButton:"删除",testButton:"测试",emptyState:"还没有自定义 Provider。添加一个来使用自定义 API 端点或代理。",modal:{titleAdd:"添加 Model Provider",titleEdit:"编辑 Model Provider",fieldName:"名称",fieldNameHint:"例如:公司 GPT-4、本地 LLaMA",fieldProtocol:"协议",fieldProtocolHint:"(大多数本地服务使用 OpenAI 兼容接口)",fieldBaseUrl:"接口地址",fieldBaseUrlHint:"例如:https://api.company.com/v1 或 http://localhost:8080/v1",fieldApiKey:"API 密钥",fieldApiKeyHint:"本地服务可留空",fieldModel:"模型",fieldModelHint:"例如:gpt-4-turbo、llama3.2",buttonCancel:"取消",buttonSave:"保存并测试",buttonSaveOnly:"保存",validating:"测试连接中...",success:"✓ 已连接",error:"连接失败"},deleteConfirm:a=>`删除 "${a}"?此操作不可撤销。`,deleteConfirmButton:"删除"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",labsTitle:"实验性功能",labsDesc:"仍在开发中的功能,可能会变更或移除。",labsEcho:"回响",labsEchoDesc:"基于笔记的反思性日记。",labsWorkflows:"工作流",labsWorkflowsDesc:"Agent 可视化工作流自动化。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{cardTitle:"知识库",securityTitle:"安全",passwordPlaceholder:"留空可禁用",passwordShow:"显示",passwordHide:"隐藏",tokenNotSet:"— 未设置 —",mcpUrl:"MCP 地址",tokenGenerated:"已生成新令牌。请立即复制 — 之后不会再次完整显示。",monitoringTitle:"系统监控",monitoringFailed:"加载监控数据失败",monitorHeap:"堆内存",monitorRss:"RSS",monitorUptime:"运行时间",monitorNode:"Node",monitorRequests:"请求数",monitorToolCalls:"工具调用",monitorTokens:"Token",monitorFiles:"文件",monitorErrors:"错误",monitorMcpRunning:a=>`运行中 :${a}`,monitorMcpStopped:"已停止",cancel:"取消",mindRoot:"知识库根目录",mindRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",mindRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshBrief:"一次配置,无需令牌",httpsBrief:"通用性强,建议配令牌",sshHint:"需要本机已配置 SSH 密钥。验证命令:ssh -T git@github.com",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub:",tokenLink:"创建令牌(勾选 repo 权限)",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中...",stepConnecting:"正在连接远程仓库...",stepAuthenticating:"正在验证身份...",stepSyncing:"正在同步数据...",stepAlmostDone:"即将完成...",stepDone:"同步配置成功!",gitignoreTitle:"排除文件",gitignorePlaceholder:"# 不同步的文件\n*.tmp\nsecret/",gitignoreSave:"保存",gitignoreSaved:"已保存",conflictExplain:"这些文件在本机和远程都被修改了。请选择保留哪个版本。",keepLocal:"保留本地",keepRemote:"保留远程",keepLocalHint:"保留本机的版本",keepRemoteHint:"替换为远程版本",viewDiff:"点击查看两个版本的差异",localVersion:"本地(本机)",remoteVersion:"远程",emptyFile:"(空)",sectionTitle:"同步",labelProvider:"提供商",labelRemote:"远程",labelBranch:"分支",labelLastSync:"最后同步",labelUnpushed:"未推送",labelAutoSync:"自动同步",unpushedCommits:a=>`${a} 次提交`,syncNow:"立即同步",disableAutoSync:"禁用自动同步",enableAutoSync:"启用自动同步",syncComplete:"同步完成",syncFailed:"同步失败",autoSyncDisabled:"已禁用自动同步",autoSyncEnabled:"已启用自动同步",toggleFailed:"切换同步失败",conflictsTitle:a=>`冲突 (${a})`,conflictHint:"单击文件查看你的版本。悬停并单击",conflictHintSuffix:"查看远程版本。",timeNever:"从未",timeJustNow:"刚刚",timeMinAgo:a=>`${a} 分钟前`,timeHourAgo:a=>`${a} 小时前`,timeDayAgo:a=>`${a} 天前`},plugins:{title:"已安装渲染器",builtinBadge:"内置",coreBadge:"核心",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{modeCardTitle:"连接模式",modeCardDesc:"选择 Agent 如何连接到 MindOS。",cliLabel:"CLI",cliModeDesc:"Claude Code、Gemini CLI、Codex 等。",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop、Cursor、Windsurf 等。",alwaysOn:"始终开启",mcpRunning:"运行中",mcpStopped:"已停止",mcpEnabledHint:"MCP 模式已启用。若仅使用 CLI Agent,可禁用此项以简化界面。",mcpDisabledHint:"启用 MCP 以连接 Claude Desktop 或 Cursor 等桌面客户端。",serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"技能",skillsDesc:"教 Agent 如何操作你的知识库。",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加技能",cliInstallHint:"通过命令行安装:",skillPathHint:"技能文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名技能已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"技能语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索技能...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的技能`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON",connectionTitle:"连接 Agent",connectionHint:"选择 AI Agent 连接 MindOS 的方式。",tokenCardTitle:"认证令牌",tokenCardDesc:"用于 CLI 远程模式和 MCP 连接。",mcpHint:"适用于 Claude Desktop、Cursor 等使用 MCP 工具协议的 Agent。",tokenLabel:"认证令牌",tokenMasked:"点击「显示」查看完整令牌",tokenShow:"显示",tokenHide:"隐藏",tokenCopy:"复制",tokenCopied:"令牌已复制!",tokenNone:"未设置令牌 — MCP 服务对所有请求开放。",tokenNoneAction:"请在 设置 → 通用 → 安全 中生成令牌。",serverUrl:"MCP 服务地址",serverUrlCopy:"复制地址",howToConnect:"如何连接 AI 助手",howToStep1:"打开你的 AI 助手的 MCP 设置(如 Claude Code、Cursor)",howToStep2:"添加一个新的 MCP 服务,填入上方地址",howToStep3:"将认证令牌设为 Bearer Token",howToStep4:"保存并验证连接",cliSkillTitle:"CLI 技能",cliSkillHint:"适用于支持 bash 的 Agent(Claude Code、Gemini CLI、Codex)——更省 token,无需 MCP。",cliSkillDesc:"更省 token,技能内置——安装即可使用。",cliLocalDesc:"MindOS Skill 已内置,安装 CLI 即可直接使用。",cliRemoteDesc:"在其他设备上安装 CLI,远程连接到此 MindOS 服务器。",cliSkillInstall:"安装",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"远程",cliSkillVerify:"验证",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"配置",cliInstallSkill:"安装技能",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"需要逐个 Agent 配置 MCP,通过以下命令单独安装技能:",mcpLocalDesc:"复制下方配置代码,粘贴到你的 Agent 的 MCP 设置中。",mcpRunningLabel:"MCP 运行中",mcpServerStatus:"MCP 服务",autoInstallAgents:"自动安装到已检测的 Agent",detectedAgentsTitle:"检测到的 Agent",cliInstallDesc:"为你的 Agent 安装 MindOS Skill,让它能操作你的知识库。",mcpInstallDesc:"为本机检测到的 Agent 安装 MCP 配置和 Skill。",tokenCopyFullHint:"复制完整令牌",skillsInstalled:"个技能已安装",recommended:"推荐",localTitle:"本机",localReady:"可直接使用",remoteTitle:"远程访问",remoteSubtitle:"从其他设备连接",restarting:"重启中...",restart:"重启",portsCardTitle:"服务端口",portsCardDesc:"Web UI 和 MCP 服务端口。更改后重启生效。",webPortLabel:"Web UI 端口",webPortHint:"浏览器访问的端口。",mcpPortLabel:"MCP 服务端口",mcpPortHint:"Agent 和桌面客户端连接的端口。",portChecking:"检测中…",portAvailable:"可用",portSelf:"当前端口",portInUse:a=>`端口 ${a} 已被占用`,portSuggest:a=>`使用 ${a}`,portConflict:"Web 和 MCP 端口不能相同。",portUpdating:"保存中…",portWebRestarting:"正在重启服务…",portMcpRestarting:"正在重启 MCP…",portUpdateSuccess:"端口更新成功。",portUpdateFailed:"端口更新失败。",portRestartTimeout:"重启超时,请重试。",portRedirecting:"正在跳转到新地址…",portUpdateBtn:"更新端口",externalToolsTitle:"外部 MCP 工具",externalToolsDesc:"配置外部 MCP 服务器的工具访问模式。"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。",coreTitle:"MindOS Core",coreUpToDate:"核心已是最新",coreAvailable:a=>`有新版本可用(${a})`,coreDownloading:"下载中...",coreCancel:"取消",coreReady:"已就绪 — 重启服务即可生效",coreRestartServices:"重启服务",coreApplying:"正在应用更新...",coreApplied:"更新成功!正在刷新...",coreError:"核心更新失败。",coreRetry:"重试",coreDesktopTooOld:a=>`v${a} 需要更新版本的 Desktop。`,coreDesktopTooOldHint:"请先更新 MindOS Desktop。",coreHint:"核心更新只需重启服务,无需重启应用。",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} 可用`,titleMultiple:"有可用更新",desktopLabel:"桌面版",coreLabel:"运行时",viewDetails:"查看详情",skipVersion:"跳过此版本",skipAll:"全部跳过"}},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败。请刷新页面或尝试其他模板。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 连接","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathBrowse:"浏览...",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",listModels:"选择模型",noModelsFound:"未找到可用模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"认证令牌",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 连接",connectionModeTitle:"连接模式",connectionModeCliHint:"推荐 \xb7 更省 token",connectionModeMcpHint:"可选 \xb7 消耗更多 token",agentToolsHint:"选择要配置的 AI Agent。此步骤可选。",agentToolsHintCliOnly:"Agent 选择在 MCP 模式启用时生效。CLI 可直接用于所有支持 bash 的 Agent。",agentToolsHintNone:"未选择连接模式。请至少选择一种模式以连接 Agent。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 Agent。可稍后在设置中配置。",agentSkipLater:"清除选择",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentGetIt:"去安装 →",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"",skillAutoHint:()=>"",skillLabel:"技能",skillInstalling:"正在安装技能…",skillInstalled:"技能已安装",skillFailed:"技能安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → 连接 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",healthKb:"知识库",healthKbNone:"未配置",healthAi:"AI 服务",healthAiNone:"未配置 — AI 功能不可用",healthAiAction:"可在 设置 → AI 中添加 API 密钥。",healthAgents:"Agent 连接",healthAgentsOk:a=>`已配置 ${a} 个 Agent`,healthAgentsPartial:"正在配置中...",healthAgentsNone:"未配置 Agent",healthAgentsAction:"可稍后在 设置 → 连接 中添加。",healthSkills:"Skills",healthSkillsOk:"Skill 安装成功",healthSkillsError:"Skill 安装失败",healthSkillsSkipped:"已跳过",healthSkillsInstalling:"正在安装 Skill…",healthSkillsAction:"可稍后手动安装 Skill。",healthTokenTitle:"认证令牌",healthTokenCopy:"复制令牌",healthTokenHint:"CLI 远程模式和 MCP 连接时使用。也可在 设置 → 连接 中找到。",healthGoHome:"进入 MindOS",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。现在可以直接问 MindOS、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",stepLocked:"请先完成上一步",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"AI 帮你沉淀",cta:"试试",desc:"让 MindOS 把对话中的经验沉淀到知识库:",prompt:"帮我把这次对话的关键收获整理成一份可复用的 SOP,存到我的知识库里。",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"连接其他 Agent",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意 MCP Agent,粘贴以下提示词,让知识流入 MindOS:",copyPrompt:"把我们刚才讨论的内容总结一下,存到我的 MindOS 知识库里,形成可复用的 SOP。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS 会自动读取你的知识库。问它项目相关的事,不需要每次都重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你的本地知识助手。它把项目、决策、SOP 和偏好整理在同一处,让你和已连接的 Agent 都能基于同一份上下文工作。文件保留在本地,知识可以反复复用,也不用每次都从头交代背景。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如个人档案、笔记或项目。',step2Title:"和 MindOS 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 MindOS。你可以直接询问知识库相关问题,或用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → 连接 以连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 MindOS",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 MindOS 中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → 连接。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}}},54195:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>O});var d=c(48249),e=c(67484),f=c(33740);let g=/^##\s+(.+)/,h=/^#\s+/,i=/^#{3,6}\s+(.+)/,j=/^(\s*)- \[([ xX~])\]\s+(.*)$/,k=/`(P[012])`/,l=/`(\d{4}-\d{2}-\d{2}|\d{2}-\d{2})`/,m=/#([a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*)/g;function n(a,b){let c=[...a];return b(c),c.join("\n")}function o(a){let b=function(a){if(!a)return null;let b=new Date;return new Date(/^\d{2}-\d{2}$/.test(a)?`${b.getFullYear()}-${a}`:a)}(a);if(!b||isNaN(b.getTime()))return null;let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()),e=(new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-d.getTime())/864e5;return e<0?"overdue":0===e?"today":e<=3?"soon":"future"}function p(a,b){return a.reduce((a,c)=>a+ +(c.status===b)+p(c.children,b),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r(a,b){return("all"===b.status||a.status===b.status)&&("all"===b.priority||a.meta.priority===b.priority)&&("all"===b.tag||!!a.meta.tags.includes(b.tag))}let s={P0:{bg:"bg-red-500/10",text:"text-red-500",border:"border-red-500/20"},P1:{bg:"bg-amber-500/10",text:"text-amber-500",border:"border-amber-500/20"},P2:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/20"}},t={overdue:{text:"text-red-500",bg:"bg-red-500/10"},today:{text:"text-amber-500",bg:"bg-amber-500/10"},soon:{text:"text-amber-400",bg:"bg-amber-400/5"},future:{text:"text-muted-foreground",bg:""}},u={TODAY:{dot:"bg-red-400",label:"text-red-400"},"This Week":{dot:"bg-orange-400",label:"text-orange-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Done:{dot:"bg-emerald-400",label:"text-emerald-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};var v=c(56692),w=c(46674);function x({filters:a,onFilterChange:b,allTags:c,allPriorities:e,counts:f}){let g="all"!==a.priority||"all"!==a.tag||"all"!==a.status;return 0===c.length&&0===e.length?null:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,d.jsx)(v.A,{size:12,className:"text-muted-foreground shrink-0"}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden text-xs",children:[(0,d.jsxs)("button",{onClick:()=>b({...a,status:"all"}),className:`px-2.5 py-1 transition-colors ${"all"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["All ",f.total]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"todo"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"todo"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Todo ",f.todo]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"in-progress"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"in-progress"===a.status?"bg-[var(--amber)]/10 text-[var(--amber)] font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["In Progress ",f.inProgress]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"done"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"done"===a.status?"bg-emerald-500/10 text-emerald-500 font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Done ",f.done]})]}),e.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:e.map(c=>{if(!c)return null;let e=s[c],f=a.priority===c;return(0,d.jsx)("button",{onClick:()=>b({...a,priority:f?"all":c}),className:`px-2 py-0.5 rounded text-xs font-mono font-medium border transition-colors ${f?`${e.bg} ${e.text} ${e.border}`:"border-transparent text-muted-foreground hover:bg-muted"}`,children:c},c)})}),c.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:c.map(c=>{let e=a.tag===c;return(0,d.jsxs)("button",{onClick:()=>b({...a,tag:e?"all":c}),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${e?"bg-[var(--amber)]/15 text-[var(--amber)]":"text-muted-foreground hover:bg-muted"}`,children:["#",c]},c)})}),g&&(0,d.jsxs)("button",{onClick:()=>b({priority:"all",tag:"all",status:"all"}),className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(w.A,{size:10})," Clear"]})]})}var y=c(75154),z=c(99941),A=c(44643),B=c(24520),C=c(44218),D=c(19794),E=c(59347),F=c(13576);function G({priority:a}){if(!a)return null;let b=s[a];return(0,d.jsx)("span",{className:`inline-flex items-center px-1.5 py-0 rounded text-[10px] font-mono font-semibold leading-4 border shrink-0 ${b.bg} ${b.text} ${b.border}`,children:a})}function H({dateStr:a,status:b}){if(!a||"done"===b)return null;let c=o(a);if(!c)return null;let e=t[c];return(0,d.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0 rounded text-[10px] leading-4 shrink-0 ${e.text} ${e.bg}`,children:[(0,d.jsx)(y.A,{size:9}),a]})}function I({tag:a}){return(0,d.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0 rounded-full text-[10px] leading-4 text-muted-foreground bg-muted/60 shrink-0",children:["#",a]})}function J({status:a,onClick:b}){return(0,d.jsxs)("button",{onClick:b,className:"shrink-0 transition-colors",title:"Click to cycle status",children:["done"===a&&(0,d.jsx)(z.A,{size:15,style:{color:"var(--amber)"}}),"in-progress"===a&&(0,d.jsx)(f.A,{size:15,className:"text-[var(--amber)] fill-[var(--amber)]/20"}),"todo"===a&&(0,d.jsx)(A.A,{size:15,style:{color:"var(--muted-foreground)"}})]})}function K({text:a,status:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${"done"===b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function L({onAdd:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(""),h=(0,e.useRef)(null);function i(){let b=f.trim();b&&a(b),g(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(A.A,{size:15})}),(0,d.jsx)("input",{ref:h,value:f,onChange:a=>g(a.target.value),onBlur:i,onKeyDown:a=>{"Enter"===a.key&&i(),"Escape"===a.key&&(g(""),c(!1))},placeholder:"New item… (supports `P0` `03-28` #tag)",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(B.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function M({item:a,depth:b,filters:c,onCycleStatus:f,onRename:g,onDelete:h}){let[i,j]=(0,e.useState)(!0),k=a.children.length>0,l=r(a,c),m=a.children.some(a=>(function a(b,c){return!!r(b,c)||b.children.some(b=>a(b,c))})(a,c));if(("all"!==c.status||"all"!==c.priority||"all"!==c.tag)&&!l&&!m)return null;let n=o(a.meta.dueDate);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${"done"===a.status?"opacity-45":""} ${"overdue"===n&&"done"!==a.status?"bg-error/[0.03]":""}`,style:{paddingLeft:`${8+20*b}px`},children:[k?(0,d.jsx)("button",{onClick:()=>j(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:i?(0,d.jsx)(C.A,{size:13}):(0,d.jsx)(D.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)(J,{status:a.status,onClick:()=>{var b;return f(a.lineIndex,"todo"===(b=a.status)?"in-progress":"in-progress"===b?"done":"todo")}}),(0,d.jsx)(K,{text:a.text,status:a.status,onRename:b=>g(a.lineIndex,b)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(G,{priority:a.meta.priority}),(0,d.jsx)(H,{dateStr:a.meta.dueDate,status:a.status}),a.meta.tags.map(a=>(0,d.jsx)(I,{tag:a},a))]}),(0,d.jsx)("button",{onClick:()=>h(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(E.A,{size:12})})]}),k&&i&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(M,{item:a,depth:b+1,filters:c,onCycleStatus:f,onRename:g,onDelete:h},a.id))})]})}function N({name:a,meta:b,filters:c,defaultCollapsed:f,onCycleStatus:g,onRename:h,onDelete:i,onAdd:j}){let k,[l,m]=(0,e.useState)(f??!1),n=(k=Object.keys(u).find(b=>a.includes(b)))?u[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:o,lastLineIndex:r}=b,s=p(o,"done"),t=p(o,"in-progress"),v=q(o),w=a.includes("Done");return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:[s,"/",v]}),t>0&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-[var(--amber)]",children:[(0,d.jsx)(F.A,{size:9})," ",t]})]}),l?(0,d.jsx)(D.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(C.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:v?`${s/v*100}%`:"0%",background:w?"var(--success, #22c55e)":"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[o.map(a=>(0,d.jsx)(M,{item:a,depth:0,filters:c,onCycleStatus:g,onRename:h,onDelete:i},a.id)),0===o.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),!w&&(0,d.jsx)(L,{onAdd:a=>j(r,a)})]})]})}function O({content:a,saveAction:b}){let[c,o]=(0,e.useState)(a),[r,s]=(0,e.useState)({priority:"all",tag:"all",status:"all"}),{sections:t,lines:u,sectionOrder:v}=(0,e.useMemo)(()=>{let a,b,d,e,f,n,o;return a=c.split("\n"),b="General",d={},e=[],f=[],n=!1,o=!1,a.forEach((a,c)=>{if(!o){if(0===c&&"---"===a.trim()){n=!0;return}if(n){"---"===a.trim()&&(n=!1,o=!0);return}o=!0}if(h.test(a))return;let p=a.match(g);if(p){d[b=p[1].replace(/^[^\w\s\u4e00-\u9fff]+\s*/,"").trim()]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:c},e.push(b));return}if(i.test(a))return;let q=a.match(j);if(!q)return;let[,r,s,t]=q,u=Math.floor(r.length/2),v="~"===s?"in-progress":"x"===s.toLowerCase()?"done":"todo",{cleanText:w,meta:x}=function(a){let b,c=a,d=null,e=null,f=[],g=c.match(k);g&&(d=g[1],c=c.replace(k,"").trim());let h=c.match(l);h&&(e=h[1],c=c.replace(l,"").trim());let i=RegExp(m.source,"g");for(;null!==(b=i.exec(c));)f.push(b[1]);return f.length>0&&(c=c.replace(/#[a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*/g,"").trim()),{cleanText:c=c.replace(/\*\*(.*?)\*\*/g,"$1").trim(),meta:{priority:d,dueDate:e,tags:f}}}(t),y={id:`${c}`,text:w,rawText:t,status:v,indent:u,lineIndex:c,section:b,children:[],meta:x};for(;f.length>0&&f[f.length-1].indent>=u;)f.pop();d[b]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:-1},e.push(b)),f.length>0?f[f.length-1].children.push(y):d[b].items.push(y),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),f.push(y)}),{sections:d,lines:a,sectionOrder:e}},[c]),w=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"done"),0),[t]),y=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"in-progress"),0),[t]),z=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+q(b.items),0),[t]),A=z-w-y,B=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c){for(let a of d.meta.tags)b.add(a);a(d.children)}}(c.items);return[...b].sort()})(t),[t]),C=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c)d.meta.priority&&b.add(d.meta.priority),a(d.children)}(c.items);return["P0","P1","P2"].filter(a=>b.has(a))})(t),[t]),D=(0,e.useCallback)(async a=>{o(a),await b(a)},[b]),E=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/- \[[ xX~]\]/,`- [${"done"===b?"x":"in-progress"===b?"~":" "}]`)}))},[u,D]),F=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/(- \[[ xX~]\]\s*)(.*)$/,`$1${b}`)}))},[u,D]),G=(0,e.useCallback)(async a=>{await D(n(u,b=>{b.splice(a,1)}))},[u,D]),H=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[u,D]),I=v.filter(a=>t[a]).map(a=>[a,t[a]]),J=z?Math.round(w/z*100):0;return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsx)("div",{className:"mb-5 flex items-center gap-4",children:(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsxs)("span",{className:"text-lg font-semibold font-display text-foreground tabular-nums",children:[J,"%"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground font-display",children:[w,"/",z," completed"]}),y>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[var(--amber)]",children:[(0,d.jsx)(f.A,{size:8,className:"fill-[var(--amber)]/30"}),y," in progress"]})]}),(0,d.jsx)("div",{className:"mt-2 w-full max-w-xs h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${J}%`,background:"var(--amber)"}})})]})}),(0,d.jsx)(x,{filters:r,onFilterChange:s,allTags:B,allPriorities:C,counts:{todo:A,inProgress:y,done:w,total:z}}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[I.map(([a,b])=>(0,d.jsx)(N,{name:a,meta:b,filters:r,defaultCollapsed:a.includes("Done"),onCycleStatus:E,onRename:F,onDelete:G,onAdd:H},a)),0===I.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},54461:(a,b,c)=>{"use strict";c.d(b,{X:()=>l,d:()=>g});var d=c(67484),e=c(49223);function f(a){let b=Date.now();return{id:`${b}-${Math.random().toString(36).slice(2,8)}`,currentFile:a,createdAt:b,updatedAt:b,messages:[]}}function g(a){if(a.title)return a.title;let b=a.messages.find(a=>"user"===a.role);if(!b)return"(empty session)";let c=b.content.replace(/\s+/g," ").trim();return!c&&b.images&&b.images.length>0?`[${b.images.length} image${b.images.length>1?"s":""}]`:c.length>42?`${c.slice(0,42)}...`:c||"(empty session)"}async function h(){try{let a=await fetch("/api/ask-sessions",{cache:"no-store"});if(!a.ok)return[];let b=await a.json();if(!Array.isArray(b))return[];return b.slice(0,30)}catch{return[]}}async function i(a){try{let b={...a,messages:a.messages.map(a=>a.images&&0!==a.images.length?{...a,images:a.images.map(a=>({...a,data:""}))}:a)};await fetch("/api/ask-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b})})}catch{}}async function j(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})})}catch{}}async function k(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a})})}catch{}}function l(a){let[b,c]=(0,d.useState)([]),[g,l]=(0,d.useState)([]),[m,n]=(0,d.useState)(null),o=(0,d.useRef)(null),p=(0,d.useCallback)(async()=>{let b=(await h()).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30),d=b.filter(a=>0===a.messages.length).map(a=>a.id),e=d.length>0?b.filter(a=>!d.includes(a.id)):b;d.length>0&&k(d);let g=f(a),i=a?e.find(b=>b.currentFile===a):e[0];i?(n(i.id),c(i.messages),l([...e])):(n(g.id),c([]),l([g,...e].slice(0,30)))},[a]),q=(0,d.useCallback)((b,c)=>{if(!c||0===b.length)return;let d=null;l(e=>{let f=Date.now(),g=e.find(a=>a.id===c);d=g?{...g,currentFile:a,updatedAt:f,messages:b}:{id:c,currentFile:a,createdAt:f,updatedAt:f,messages:b};let h=e.filter(a=>a.id!==c);return[d,...h].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{d&&i(d)},600)},[a]),r=(0,d.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),s=(0,d.useCallback)(()=>{l(b=>{let d=b.find(a=>a.id===m);if(d&&0===d.messages.length)return b;let e=f(a);return n(e.id),c([]),[e,...b].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)})},[a,m]),t=(0,d.useCallback)(a=>{let b=g.find(b=>b.id===a);if(!b)return;let d=m?g.find(a=>a.id===m):null;d&&0===d.messages.length&&d.id!==a&&l(a=>a.filter(a=>a.id!==d.id)),n(b.id),c(b.messages)},[g,m]),u=(0,d.useCallback)(b=>{let d=g.find(a=>a.id===b);d&&d.messages.length>0&&j(b);let e=g.filter(a=>a.id!==b);if(l(e),m===b){let b=f(a);n(b.id),c([]),l([b,...e].slice(0,30))}},[m,a,g]),v=(0,d.useCallback)((a,b)=>{let c=b.trim();l(b=>{let d=b.findIndex(b=>b.id===a);if(d<0)return b;let e={...b[d],title:c||void 0},f=[...b];return f[d]=e,i(e),f})},[]),w=(0,d.useCallback)(a=>{l(b=>{let c=b.findIndex(b=>b.id===a);if(c<0)return b;let d={...b[c],pinned:!b[c].pinned},e=[...b];return e[c]=d,d.messages.length>0&&i(d),e})},[]),x=(0,d.useCallback)(b=>{if(!m)return;let c=g.find(a=>a.id===m);if(!c)return;let d=(0,e.R3)({...c,currentFile:c.currentFile??a,updatedAt:Date.now()},b);l(a=>[d,...a.filter(a=>a.id!==m)].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)),o.current&&clearTimeout(o.current),d.messages.length>0&&(o.current=setTimeout(()=>{i(d)},600))},[m,a,g]),y=(0,d.useCallback)(()=>{let b=g.filter(a=>a.messages.length>0).map(a=>a.id);b.length>0&&k(b);let d=f(a);n(d.id),c([]),l([d])},[a,g]);return{messages:b,setMessages:c,sessions:[...g].sort((a,b)=>a.pinned&&!b.pinned?-1:!a.pinned&&b.pinned?1:b.updatedAt-a.updatedAt),activeSession:g.find(a=>a.id===m)??null,activeSessionId:m,initSessions:p,persistSession:q,clearPersistTimer:r,resetSession:s,loadSession:t,deleteSession:u,renameSession:v,togglePinSession:w,setSessionDefaultAcpAgent:x,clearAllSessions:y}}},55038:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/global-error.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/app/app/global-error.tsx","default")},55232:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0),j=(0,d.useRef)(!1),k=(0,d.useCallback)(async()=>{b((await fetch("/api/skills").then(a=>a.ok?a.json():{skills:[]}).then(a=>Array.isArray(a?.skills)?a.skills:[]).catch(()=>[])).filter(a=>a.enabled)),j.current=!0},[]),l=(0,d.useCallback)((b,c)=>{let d=b.slice(0,c),f=d.lastIndexOf("/");if(-1===f||f>0&&" "!==d[f-1]&&"\n"!==d[f-1])return void e(null);let h=d.slice(f+1);if(h.includes(" "))return void e(null);if(!j.current){k(),e(null);return}let l=h.toLowerCase(),m=l?a.map(a=>{let b=a.name.toLowerCase(),c=0;return b.startsWith(l)?c=100:b.includes(l)?c=50:a.description.toLowerCase().includes(l)&&(c=10),{s:a,score:c}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,20).map(a=>({type:"skill",name:a.s.name,description:a.s.description})):a.slice(0,20).map(a=>({type:"skill",name:a.name,description:a.description}));if(0===m.length){e(null),g([]),i(0);return}e(h),g(m),i(0)},[a,k]),m=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{slashQuery:c,slashResults:f,slashIndex:h,updateSlashFromInput:l,navigateSlash:m,resetSlash:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},56606:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,30488)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,41829)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,47336)),Promise.resolve().then(c.bind(c,21416)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,54195)),Promise.resolve().then(c.bind(c,63956)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,49905)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,70137)),Promise.resolve().then(c.bind(c,5200))},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>v,DO:()=>l,KF:()=>j,Mv:()=>n,TM:()=>u,ZC:()=>t,lx:()=>s,md:()=>k,pp:()=>o,rA:()=>m});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484),i=c(10927);function j({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function k({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function l({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function m({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function n({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function o({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/40 bg-card/30 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let p=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function q(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function r(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function s({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=p[q(a)%p.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:r(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function t({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function u({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:j,variant:k="destructive"}){let l=(0,h.useRef)(null),m=(0,h.useRef)(null);return((0,i.r)(m,a),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:j,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{id:"confirm-dialog-title",className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:j,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===k?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function v({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=p[q(a.name)%p.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:r(a.name)})})(),a.name]},a.key))})}):null}},59238:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AudioRenderer() from the server but AudioRenderer is 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/app/components/renderers/audio/AudioRenderer.tsx","AudioRenderer")},59867:(a,b,c)=>{"use strict";c.d(b,{x:()=>u,A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(801),h=c(6079),i=c(8455),j=c(40560),k=c(42742),l=c(19794),m=c(44218),n=c(47223),o=c(95054),p=c(99101),q=c(90826),r=c(69593);function s(a,b,c=new Date){let d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=`> Saved session from MindOS Ask \xb7 ${d}-${e}-${f}`;if("full"===b){let b=a.map(a=>{let b=(0,r.Oo)(a.content).trim();if(!b)return null;let c="user"===a.role?"**User**":"**Assistant**";return`### ${c}
112
122
 
113
123
  ${b}`}).filter(Boolean);return`${g}
114
124
 
@@ -116,7 +126,24 @@ ${b.join("\n\n---\n\n")}`}if("ai-only"===b){let b=a.filter(a=>"assistant"===a.ro
116
126
 
117
127
  ${b.join("\n\n---\n\n")}`}return s(a,"full",c)}function t(a,b){let c="ai-only"===b?a.filter(a=>"assistant"===a.role):a,d=c.reduce((a,b)=>a+(0,r.Oo)(b.content).trim().length,0);return{msgCount:c.length,charCount:d}}function u({text:a}){let{t:b}=(0,n.Y)(),[c,f]=(0,e.useState)(!1),h=(0,e.useRef)(null),i=(0,r.Oo)(a).trim();return i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{ref:h,type:"button",onClick:a=>{a.stopPropagation(),f(a=>!a)},className:`p-1 rounded-md border transition-colors ${c?"border-[var(--amber)]/40 bg-[var(--amber)]/10 text-[var(--amber)]":"border-border/60 bg-card text-muted-foreground hover:text-[var(--amber)] shadow-sm"}`,title:b.ask?.saveToKB??"Save to knowledge base",children:(0,d.jsx)(g.A,{size:11})}),c&&(0,d.jsx)(v,{anchorRef:h,content:i,onClose:()=>f(!1)})]}):null}function v({anchorRef:a,content:b,onClose:c}){let{t:f}=(0,n.Y)(),g=f.ask,[h,i]=(0,e.useState)("select"),[j,k]=(0,e.useState)([]),l=[{role:"assistant",content:b}];return(0,d.jsxs)(y,{anchorRef:a,onClose:c,children:["select"===h&&(0,d.jsx)(w,{content:b,onSelect:i,onClose:c,ask:g}),"archive"===h&&(0,d.jsx)(z,{content:b,defaultFilenamePrefix:"insight",dirPaths:j,onClose:c,ask:g}),"digest"===h&&(0,d.jsx)(D,{messages:l,onClose:c,ask:g})]})}function w({content:a,onSelect:b,onClose:c,ask:e}){let f=a.length>1e3?`~${(a.length/1e3).toFixed(1)}k`:`${a.length}`;return(0,d.jsxs)("div",{className:"p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:e?.saveToKBTitle??"Save to KB"}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:["(",f," chars)"]})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"text-2xs text-muted-foreground hover:text-foreground",children:e?.cancelSave??"Cancel"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b("archive"),className:"flex flex-col items-center gap-1 p-2.5 border border-[var(--amber)]/30 rounded-lg hover:border-[var(--amber)]/60 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(g.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.saveDirectly??"Save directly"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.saveDirectlyDesc??"Save as-is"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>b("digest"),className:"flex flex-col items-center gap-1 p-2.5 border border-border rounded-lg hover:border-[var(--amber)]/50 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(h.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.organizeToNote??"Organize to note"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.organizeToNoteDesc??"AI organizes"})]})]})]})}function x({messages:a,disabled:b}){let{t:c}=(0,n.Y)(),[f,h]=(0,e.useState)(!1),i=(0,e.useRef)(null);return a.some(a=>"assistant"===a.role&&a.content.trim())?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{ref:i,type:"button",onClick:a=>{a.stopPropagation(),h(a=>!a)},disabled:b,className:`p-2 rounded-lg transition-colors ${f?"bg-[var(--amber)]/10 text-[var(--amber)]":"text-muted-foreground hover:text-foreground hover:bg-muted"} disabled:opacity-40`,title:c.ask?.saveSession??"Save session",children:(0,d.jsx)(g.A,{size:14})}),f&&(0,d.jsx)(A,{anchorRef:i,messages:a,onClose:()=>h(!1)})]}):null}function y({anchorRef:a,onClose:b,children:c}){let g=(0,e.useRef)(null),[h,i]=(0,e.useState)(null);return((0,e.useCallback)(()=>{if(!a.current)return;let b=a.current.getBoundingClientRect();i({top:b.bottom+6,right:Math.max(8,window.innerWidth-b.right)})},[a]),!h||"u"<typeof document)?null:(0,f.createPortal)((0,d.jsx)("div",{ref:g,className:"fixed z-50 rounded-xl border border-border bg-card shadow-lg animate-in fade-in-0 slide-in-from-top-1 duration-100",style:{top:h.top,right:h.right,width:300},children:c}),document.body)}function z({content:a,defaultFilenamePrefix:b,dirPaths:c,onClose:f,ask:h}){let l,m,n=new Date,r=`${b}-${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}.md`,[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(r),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),C=(0,e.useRef)(null),D=(m=(l=u.trim()||r).endsWith(".md")?l:`${l}.md`,s?`${s}/${m}`:m),E=(0,e.useCallback)(async()=>{x(!0),B("");try{await (0,o.n)("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:D,op:"create_file",content:function(a,b=new Date){let c=b.getFullYear(),d=String(b.getMonth()+1).padStart(2,"0"),e=String(b.getDate()).padStart(2,"0");return`> Saved from MindOS Ask \xb7 ${c}-${d}-${e}
118
128
 
119
- ${a}`}(a),source:"user"})}),z(!0),p.oR.success(h?.savedToKB?.replace("{path}",D.split("/").pop())??"Saved"),setTimeout(f,1e3)}catch(a){B(a?.message?.includes("exist")?h?.fileExistsSwitch??"File exists":a?.message??"Failed")}finally{x(!1)}},[a,D,h,f]);return(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold",children:h?.saveToKBTitle??"Save to KB"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.targetFolder??"Folder"}),(0,d.jsx)(q.A,{dirPaths:c,value:s,onChange:t,rootLabel:"Root"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.fileName??"Filename"}),(0,d.jsx)("input",{ref:C,type:"text",value:u,onChange:a=>v(a.target.value),onKeyDown:a=>{"Enter"===a.key&&E(),"Escape"===a.key&&f()},className:"w-full px-2 py-1 text-xs font-mono rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50"})]}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:D}),A&&(0,d.jsxs)("div",{className:"flex items-center gap-1 text-2xs text-error",children:[(0,d.jsx)(i.A,{size:10}),A]}),(0,d.jsxs)("div",{className:"flex justify-end gap-1.5 pt-1 border-t border-border/30",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-2 py-0.5 text-2xs rounded text-muted-foreground hover:bg-muted",children:h?.cancelSave??"Cancel"}),(0,d.jsxs)("button",{type:"button",onClick:E,disabled:w||y||!u.trim(),className:`flex items-center gap-1 px-2.5 py-0.5 text-2xs font-medium rounded transition-colors ${y?"bg-success/10 text-success":"bg-[var(--amber)] text-[var(--amber-foreground)]"} disabled:opacity-50`,children:[w&&(0,d.jsx)(j.A,{size:9,className:"animate-spin"}),y&&(0,d.jsx)(k.A,{size:9}),h?.confirmSave??"Save"]})]})]})}function A({anchorRef:a,messages:b,onClose:c}){let{t:f}=(0,n.Y)(),g=f.ask,[h,i]=(0,e.useState)("select"),[j,k]=(0,e.useState)([]);return(0,d.jsxs)(y,{anchorRef:a,onClose:c,children:["select"===h&&(0,d.jsx)(B,{messages:b,onSelect:i,onClose:c,ask:g}),"archive"===h&&(0,d.jsx)(C,{messages:b,dirPaths:j,onBack:()=>i("select"),onClose:c,ask:g}),"digest"===h&&(0,d.jsx)(D,{messages:b,onClose:c,ask:g})]})}function B({messages:a,onSelect:b,onClose:c,ask:e}){let f=t(a,"full");return(0,d.jsxs)("div",{className:"p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:e?.saveSession??"Save Session"}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:["(",f.msgCount,")"]})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"text-2xs text-muted-foreground hover:text-foreground",children:e?.cancelSave??"Cancel"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b("archive"),className:"flex flex-col items-center gap-1 p-2.5 border border-[var(--amber)]/30 rounded-lg hover:border-[var(--amber)]/60 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(g.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.saveDirectly??"Save directly"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.saveDirectlyDesc??"Save as-is"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>b("digest"),className:"flex flex-col items-center gap-1 p-2.5 border border-border rounded-lg hover:border-[var(--amber)]/50 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(h.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.organizeToNote??"Organize to note"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.organizeToNoteDesc??"AI extracts insights"})]})]})]})}function C({messages:a,dirPaths:b,onBack:c,onClose:f,ask:h}){let n,r,u=new Date,v=`session-${u.getFullYear()}-${String(u.getMonth()+1).padStart(2,"0")}-${String(u.getDate()).padStart(2,"0")}.md`,[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(v),[A,B]=(0,e.useState)("full"),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(""),K=(0,e.useRef)(null),L=(r=(n=y.trim()||v).endsWith(".md")?n:`${n}.md`,w?`${w}/${r}`:r),M=t(a,A),N=(0,e.useCallback)(async()=>{F(!0),J("");try{await (0,o.n)("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:L,op:"create_file",content:s(a,A),source:"user"})}),H(!0),p.oR.success(h?.savedToKB?.replace("{path}",L.split("/").pop())??"Saved"),setTimeout(f,1e3)}catch(a){J(a?.message?.includes("exist")?h?.fileExistsSwitch??"File exists":a?.message??"Failed")}finally{F(!1)}},[a,A,L,h,f]),O=s(a,A).slice(0,300);return(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(l.A,{size:11,className:"rotate-180"})}),(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold",children:h?.saveDirectly??"Save directly"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.targetFolder??"Folder"}),(0,d.jsx)(q.A,{dirPaths:b,value:w,onChange:x,rootLabel:"Root"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.fileName??"Filename"}),(0,d.jsx)("input",{ref:K,type:"text",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"===a.key&&N(),"Escape"===a.key&&f()},className:"w-full px-2 py-1 text-xs font-mono rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[["full","ai-only"].map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"fmt",checked:A===a,onChange:()=>B(a),className:"w-2.5 h-2.5 accent-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs",children:"full"===a?h?.formatFull??"Full":h?.formatAiOnly??"AI only"})]},a)),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground ml-auto",children:[M.msgCount," msgs"]})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>D(a=>!a),className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:[C?(0,d.jsx)(m.A,{size:9}):(0,d.jsx)(l.A,{size:9})," Preview"]}),C&&(0,d.jsxs)("pre",{className:"px-2 py-1 text-[10px] text-muted-foreground bg-muted/30 rounded-md max-h-24 overflow-auto whitespace-pre-wrap font-mono",children:[O,O.length>=300?"...":""]}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:L}),I&&(0,d.jsxs)("div",{className:"flex items-center gap-1 text-2xs text-error",children:[(0,d.jsx)(i.A,{size:10}),I]}),(0,d.jsxs)("div",{className:"flex justify-end gap-1.5 pt-1 border-t border-border/30",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-2 py-0.5 text-2xs rounded text-muted-foreground hover:bg-muted",children:h?.cancelSave??"Cancel"}),(0,d.jsxs)("button",{type:"button",onClick:N,disabled:E||G||!y.trim(),className:`flex items-center gap-1 px-2.5 py-0.5 text-2xs font-medium rounded transition-colors ${G?"bg-success/10 text-success":"bg-[var(--amber)] text-[var(--amber-foreground)]"} disabled:opacity-50`,children:[E&&(0,d.jsx)(j.A,{size:9,className:"animate-spin"}),G&&(0,d.jsx)(k.A,{size:9}),h?.confirmSave??"Save"]})]})]})}function D({messages:a,onClose:b,ask:c}){return(0,e.useCallback)(()=>{let d=s(a,"full");window.dispatchEvent(new CustomEvent("mindos:session-organize",{detail:{content:d,name:"conversation.md"}})),b(),p.oR.success(c?.organizing??"AI is organizing...")},[a,b,c]),null}},60442:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call CsvRenderer() from the server but CsvRenderer is 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/app/components/renderers/csv/CsvRenderer.tsx","CsvRenderer")},60725:(a,b,c)=>{"use strict";function d(a,b,c){let d,e,f;if("stdio"===c){var g,h;let b={type:"stdio",command:"mindos",args:["mcp"]};if("toml"===a.format){let b=`[${a.configKey}.mindos]
129
+ ${a}`}(a),source:"user"})}),z(!0),p.oR.success(h?.savedToKB?.replace("{path}",D.split("/").pop())??"Saved"),setTimeout(f,1e3)}catch(a){B(a?.message?.includes("exist")?h?.fileExistsSwitch??"File exists":a?.message??"Failed")}finally{x(!1)}},[a,D,h,f]);return(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold",children:h?.saveToKBTitle??"Save to KB"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.targetFolder??"Folder"}),(0,d.jsx)(q.A,{dirPaths:c,value:s,onChange:t,rootLabel:"Root"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.fileName??"Filename"}),(0,d.jsx)("input",{ref:C,type:"text",value:u,onChange:a=>v(a.target.value),onKeyDown:a=>{"Enter"===a.key&&E(),"Escape"===a.key&&f()},className:"w-full px-2 py-1 text-xs font-mono rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50"})]}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:D}),A&&(0,d.jsxs)("div",{className:"flex items-center gap-1 text-2xs text-error",children:[(0,d.jsx)(i.A,{size:10}),A]}),(0,d.jsxs)("div",{className:"flex justify-end gap-1.5 pt-1 border-t border-border/30",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-2 py-0.5 text-2xs rounded text-muted-foreground hover:bg-muted",children:h?.cancelSave??"Cancel"}),(0,d.jsxs)("button",{type:"button",onClick:E,disabled:w||y||!u.trim(),className:`flex items-center gap-1 px-2.5 py-0.5 text-2xs font-medium rounded transition-colors ${y?"bg-success/10 text-success":"bg-[var(--amber)] text-[var(--amber-foreground)]"} disabled:opacity-50`,children:[w&&(0,d.jsx)(j.A,{size:9,className:"animate-spin"}),y&&(0,d.jsx)(k.A,{size:9}),h?.confirmSave??"Save"]})]})]})}function A({anchorRef:a,messages:b,onClose:c}){let{t:f}=(0,n.Y)(),g=f.ask,[h,i]=(0,e.useState)("select"),[j,k]=(0,e.useState)([]);return(0,d.jsxs)(y,{anchorRef:a,onClose:c,children:["select"===h&&(0,d.jsx)(B,{messages:b,onSelect:i,onClose:c,ask:g}),"archive"===h&&(0,d.jsx)(C,{messages:b,dirPaths:j,onBack:()=>i("select"),onClose:c,ask:g}),"digest"===h&&(0,d.jsx)(D,{messages:b,onClose:c,ask:g})]})}function B({messages:a,onSelect:b,onClose:c,ask:e}){let f=t(a,"full");return(0,d.jsxs)("div",{className:"p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold text-foreground",children:e?.saveSession??"Save Session"}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:["(",f.msgCount,")"]})]}),(0,d.jsx)("button",{type:"button",onClick:c,className:"text-2xs text-muted-foreground hover:text-foreground",children:e?.cancelSave??"Cancel"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>b("archive"),className:"flex flex-col items-center gap-1 p-2.5 border border-[var(--amber)]/30 rounded-lg hover:border-[var(--amber)]/60 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(g.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.saveDirectly??"Save directly"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.saveDirectlyDesc??"Save as-is"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>b("digest"),className:"flex flex-col items-center gap-1 p-2.5 border border-border rounded-lg hover:border-[var(--amber)]/50 hover:shadow-sm active:scale-[0.98] transition-all",children:[(0,d.jsx)(h.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-foreground",children:e?.organizeToNote??"Organize to note"}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground text-center leading-tight",children:e?.organizeToNoteDesc??"AI extracts insights"})]})]})]})}function C({messages:a,dirPaths:b,onBack:c,onClose:f,ask:h}){let n,r,u=new Date,v=`session-${u.getFullYear()}-${String(u.getMonth()+1).padStart(2,"0")}-${String(u.getDate()).padStart(2,"0")}.md`,[w,x]=(0,e.useState)(""),[y,z]=(0,e.useState)(v),[A,B]=(0,e.useState)("full"),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(""),K=(0,e.useRef)(null),L=(r=(n=y.trim()||v).endsWith(".md")?n:`${n}.md`,w?`${w}/${r}`:r),M=t(a,A),N=(0,e.useCallback)(async()=>{F(!0),J("");try{await (0,o.n)("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:L,op:"create_file",content:s(a,A),source:"user"})}),H(!0),p.oR.success(h?.savedToKB?.replace("{path}",L.split("/").pop())??"Saved"),setTimeout(f,1e3)}catch(a){J(a?.message?.includes("exist")?h?.fileExistsSwitch??"File exists":a?.message??"Failed")}finally{F(!1)}},[a,A,L,h,f]),O=s(a,A).slice(0,300);return(0,d.jsxs)("div",{className:"p-3 space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("button",{type:"button",onClick:c,className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(l.A,{size:11,className:"rotate-180"})}),(0,d.jsx)(g.A,{size:11,className:"text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs font-semibold",children:h?.saveDirectly??"Save directly"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.targetFolder??"Folder"}),(0,d.jsx)(q.A,{dirPaths:b,value:w,onChange:x,rootLabel:"Root"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"text-2xs text-muted-foreground mb-0.5 block",children:h?.fileName??"Filename"}),(0,d.jsx)("input",{ref:K,type:"text",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"===a.key&&N(),"Escape"===a.key&&f()},className:"w-full px-2 py-1 text-xs font-mono rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[["full","ai-only"].map(a=>(0,d.jsxs)("label",{className:"flex items-center gap-1 cursor-pointer",children:[(0,d.jsx)("input",{type:"radio",name:"fmt",checked:A===a,onChange:()=>B(a),className:"w-2.5 h-2.5 accent-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-2xs",children:"full"===a?h?.formatFull??"Full":h?.formatAiOnly??"AI only"})]},a)),(0,d.jsxs)("span",{className:"text-[10px] text-muted-foreground ml-auto",children:[M.msgCount," msgs"]})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>D(a=>!a),className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",children:[C?(0,d.jsx)(m.A,{size:9}):(0,d.jsx)(l.A,{size:9})," Preview"]}),C&&(0,d.jsxs)("pre",{className:"px-2 py-1 text-[10px] text-muted-foreground bg-muted/30 rounded-md max-h-24 overflow-auto whitespace-pre-wrap font-mono",children:[O,O.length>=300?"...":""]}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate",children:L}),I&&(0,d.jsxs)("div",{className:"flex items-center gap-1 text-2xs text-error",children:[(0,d.jsx)(i.A,{size:10}),I]}),(0,d.jsxs)("div",{className:"flex justify-end gap-1.5 pt-1 border-t border-border/30",children:[(0,d.jsx)("button",{type:"button",onClick:f,className:"px-2 py-0.5 text-2xs rounded text-muted-foreground hover:bg-muted",children:h?.cancelSave??"Cancel"}),(0,d.jsxs)("button",{type:"button",onClick:N,disabled:E||G||!y.trim(),className:`flex items-center gap-1 px-2.5 py-0.5 text-2xs font-medium rounded transition-colors ${G?"bg-success/10 text-success":"bg-[var(--amber)] text-[var(--amber-foreground)]"} disabled:opacity-50`,children:[E&&(0,d.jsx)(j.A,{size:9,className:"animate-spin"}),G&&(0,d.jsx)(k.A,{size:9}),h?.confirmSave??"Save"]})]})]})}function D({messages:a,onClose:b,ask:c}){return(0,e.useCallback)(()=>{let d=s(a,"full");window.dispatchEvent(new CustomEvent("mindos:session-organize",{detail:{content:d,name:"conversation.md"}})),b(),p.oR.success(c?.organizing??"AI is organizing...")},[a,b,c]),null}},60407:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>ad,Fo:()=>K,gL:()=>L});var d=c(48249),e=c(67484),f=c(19099),g=c(93491),h=c(33191),i=c(83654),j=c(80600),k=c(40560),l=c(44218),m=c(28330),n=c(86718),o=c(7309),p=c(65032),q=c(24703),r=c(16944),s=c(15273),t=c(12625),u=c(59347),v=c(99829);let w=(0,v.createServerReference)("60ab0d3c84bb6d698ee12971c21f6045efa7949932",v.callServer,void 0,v.findSourceMapURL,"createFileAction"),x=(0,v.createServerReference)("60ef4ff13bf21f7c2b6c815665780901527192c5d5",v.callServer,void 0,v.findSourceMapURL,"renameSpaceAction");var y=c(85445);let z=(0,v.createServerReference)("40de74449dd799a41abfbf2a739413ccee995921bd",v.callServer,void 0,v.findSourceMapURL,"deleteSpaceAction"),A=(0,v.createServerReference)("405d040a570ac543784d25876f1b836d8b94d24834",v.callServer,void 0,v.findSourceMapURL,"deleteFolderAction");var B=c(98840),C=c(79241),D=c(99101),E=c(47223),F=c(57056),G=c(29713);let H="show-hidden-files";function I(a){let b=b=>{b.key===H&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function J(){return!1}function K(a){localStorage.setItem(H,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function L(){return(0,e.useSyncExternalStore)(I,J,()=>!1)}var M=c(24520),N=c(37917),O=c(801);let P=(0,v.createServerReference)("401cf69cdaa8002e224ae0ca52c1eb18701e71a01b",v.callServer,void 0,v.findSourceMapURL,"convertToSpaceAction");var Q=c(95054);async function R(){try{let a=await (0,Q.n)("/api/settings"),b=a.ai?.provider??"",c=(a.ai?.providers??{})[b];return!!c?.apiKey}catch{return!1}}async function S(a){try{await navigator.clipboard.writeText(a)}catch{}}let T="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",U="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",V="my-1 border-t border-border/50";function W({x:a,y:b,onClose:c,menuHeight:f,children:g}){let h=(0,e.useRef)(null),i=Math.min(b,window.innerHeight-(f??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}function X({x:a,y:b,node:c,onClose:e,onRename:g,onNewFile:i,onImport:j,onDelete:k}){let l=(0,f.useRouter)(),{t:m}=(0,E.Y)(),{isPinned:n,togglePin:o}=(0,G.Z)(),p=n(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:e,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),e()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,d.jsxs)("button",{className:T,onClick:()=>{l.push(`/view/${(0,h.O0)(`${c.path}/INSTRUCTION.md`)}`),e()},children:[(0,d.jsx)(N.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),j&&(0,d.jsxs)("button",{className:T,onClick:()=>{j(c.path),e()},children:[(0,d.jsx)(O.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{o(c.path),e()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),e()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{g(),e()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{e(),k()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function Y({x:a,y:b,node:c,onClose:g,onRename:h,onNewFile:i,onDelete:j}){let k=(0,f.useRouter)(),{t:l}=(0,E.Y)(),[m,o]=(0,e.useTransition)(),{isPinned:p,togglePin:q}=(0,G.Z)(),v=p(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:g,menuHeight:220,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),g()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",l.fileTree.newFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{q(c.path),g()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${v?"fill-[var(--amber)] text-[var(--amber)]":""}`}),v?l.fileTree.removeFromFavorites:l.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,disabled:m,onClick:()=>{o(async()=>{if((await P(c.path)).success){k.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let a=c.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||c.name;R().then(b=>{b&&function(a,b,c=""){let d="u">typeof document&&"zh"===document.documentElement.lang?`初始化新建的心智空间「${a}」,路径为「${b}/」。${c?`描述:「${c}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
130
+ 1. 「${b}/README.md」— 写入空间用途、结构概览、使用指南
131
+ 2. 「${b}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
132
+
133
+ 内容简洁实用,直接使用工具写入。`:`Initialize the new Mind Space "${a}" at "${b}/". ${c?`Description: "${c}". `:""}Both files already exist with templates — use write_file to overwrite:
134
+ 1. "${b}/README.md" — write purpose, structure overview, usage guidelines
135
+ 2. "${b}/INSTRUCTION.md" — write rules for AI agents operating in this space
136
+
137
+ Keep content concise and actionable. Write files directly using tools.`;window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spaceName:a,spacePath:b,description:c,state:"working"}})),fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:d}],currentFile:b+"/INSTRUCTION.md"})}).then(async a=>{if(!a.ok||!a.body)throw Error(`HTTP ${a.status}`);let c=a.body.getReader();try{for(;;){let{done:a}=await c.read();if(a)break}}finally{c.releaseLock()}window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"done"}})),window.dispatchEvent(new Event("mindos:files-changed"))}).catch(()=>{window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"error"}}))})}(a,c.path)})}g()})},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",l.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),g()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{h(),g()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",l.fileTree.rename]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{g(),j()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),l.fileTree.deleteFolder]})]})}var Z=c(63710);function $(){window.dispatchEvent(new Event("mindos:files-changed"))}async function _(a){try{await navigator.clipboard.writeText(a)}catch{}}function aa({dirPath:a,depth:b,onDone:c}){let[g,i]=(0,e.useState)(""),[j,l]=(0,e.useTransition)(),[m,n]=(0,e.useState)(""),o=(0,f.useRouter)(),{t:p}=(0,E.Y)(),q=(0,e.useRef)(null),r=(0,e.useCallback)(()=>{let b=g.trim();b?l(async()=>{let d=await w(a,b);d.success&&d.filePath?(c(),o.push(`/view/${(0,h.O0)(d.filePath)}`),o.refresh(),$()):n(d.error||p.fileTree.failed)}):n(p.fileTree.enterFileName)},[g,a,c,o,p]);return(0,d.jsxs)("div",{ref:q,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{i(a.target.value),n("")},onKeyDown:a=>{"Enter"===a.key&&r(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),j?(0,d.jsx)(k.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:r,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:p.fileTree.create})]}),m&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}function ab({node:a,depth:b,currentPath:c,onNavigate:i,maxOpenDepth:j,onImport:r}){let s=(0,f.useRouter)(),t=c.startsWith(a.path+"/")||c===a.path,u=!!a.isSpace,[v,w]=(0,e.useState)(0===b||t),[C,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(a.name),[L,M]=(0,e.useTransition)(),N=(0,e.useRef)(null),O=(0,e.useRef)(null),[P,Q]=(0,e.useState)(null),{t:R}=(0,E.Y)(),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useTransition)(),{isDragTarget:W,handleRowDragOver:_,handleRowDragEnter:ab,handleRowDragLeave:ac,handleRowDrop:ae}=function(a,b,c,d){let[f,g]=(0,e.useState)(!1),h=(0,e.useRef)(null),i=(0,e.useRef)(null),j=(0,e.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),k=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",i.current&&(clearTimeout(i.current),i.current=null),f||g(!0))},[f]),l=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),g(!0),j(),b||(h.current=setTimeout(()=>{c(!0),h.current=null},500)))},[b,j,c]);return{isDragTarget:f,handleRowDragOver:k,handleRowDragEnter:l,handleRowDragLeave:(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.stopPropagation(),i.current=setTimeout(()=>{g(!1),j(),i.current=null},50))},[j]),handleRowDrop:(0,e.useCallback)(b=>{b.preventDefault(),b.stopPropagation(),g(!1),j(),i.current&&(clearTimeout(i.current),i.current=null);let c=b.dataTransfer.files;c.length>0&&(0,Z.Nh)(Array.from(c),a.path,d)},[a.path,d,j])}}(a,v,w,R),af=(0,e.useCallback)(()=>w(a=>!a),[]);(0,e.useRef)(void 0);let ag=(0,e.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),O.current&&(clearTimeout(O.current),O.current=null),K(a.name),I(!0),setTimeout(()=>N.current?.select(),0)},[a.name]),ah=(0,e.useCallback)(()=>{let b=J.trim();b&&b!==a.name?M(async()=>{let c=u?x:y.f,d=await c(a.path,b);d.success&&d.newPath?(I(!1),s.push(`/view/${(0,h.O0)(d.newPath)}`),s.refresh(),$()):I(!1)}):I(!1)},[J,a.name,a.path,s,u]),ai=(0,e.useCallback)(()=>{H||(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{s.push(`/view/${(0,h.O0)(a.path)}`),i?.(),O.current=null},180))},[H,s,a.path,i]);(0,e.useCallback)(a=>{a.stopPropagation(),af()},[af]);let aj=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]),ak=u?function a(b){return"file"===b.type?+!g.C.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(H)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:N,autoFocus:!0,value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ah(),"Escape"===a.key&&I(!1)},onBlur:ah,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),L&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let al=u&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${W?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:aj,onDragEnter:ab,onDragOver:_,onDragLeave:ac,onDrop:ae,children:[(0,d.jsx)("button",{onClick:af,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":v?`Collapse ${a.name}`:`Expand ${a.name}`,"aria-expanded":v,children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:v?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(l.A,{size:10})})}),(0,d.jsxs)("button",{type:"button",onClick:ai,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.setData("text/mindos-type","directory"),b.dataTransfer.effectAllowed="copy"},className:`
138
+ flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
139
+ text-sm transition-colors duration-100
140
+ hover:bg-muted cursor-default
141
+ ${t?"text-foreground":"text-muted-foreground hover:text-foreground"}
142
+ `,children:[u?"Inbox"===a.name?(0,d.jsx)(m.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):v?(0,d.jsx)(o.A,{size:14,className:"text-yellow-400 shrink-0"}):(0,d.jsx)(p.A,{size:14,className:"text-yellow-400 shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),u&&!v&&(0,d.jsx)("span",{className:"ml-auto text-xs text-muted-foreground shrink-0 tabular-nums pr-1",children:ak})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/dir:flex items-center gap-0.5 z-10",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${v?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsxs)("div",{className:`overflow-hidden ${al?"border-l-2 ml-[18px]":""}`,style:al?{borderColor:"color-mix(in srgb, var(--amber) 30%, transparent)"}:void 0,...!v&&{inert:!0},children:[a.children&&(0,d.jsx)(ad,{nodes:a.children,depth:al?1:b+1,onNavigate:i,maxOpenDepth:j,parentIsSpace:u,onImport:r}),C&&(0,d.jsx)(aa,{dirPath:a.path,depth:al?0:b,onDone:()=>G(!1)})]})}),P&&(u?(0,d.jsx)(X,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onImport:r,onDelete:()=>T("space")}):(0,d.jsx)(Y,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onDelete:()=>T("folder")})),(0,d.jsx)(F.TM,{open:null!==S,title:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,message:"space"===S?R.fileTree.confirmDeleteSpace(a.name):R.fileTree.confirmDeleteFolder(a.name),confirmLabel:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,cancelLabel:R.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>T(null),onConfirm:()=>{T(null),V(async()=>{let b="space"===S?await z(a.path):await A(a.path);if(b.success&&b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${R.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(s.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:R.trash?.undo??"Undo"}),s.push("/"),s.refresh(),$()}})}})]})}function ac({node:a,depth:b,currentPath:c,onNavigate:l}){let m=(0,f.useRouter)(),n=c===a.path,[o,p]=(0,e.useState)(!1),[v,w]=(0,e.useState)(a.name),[x,z]=(0,e.useTransition)(),[,A]=(0,e.useTransition)(),H=(0,e.useRef)(null),{t:I}=(0,E.Y)(),{isPinned:J,togglePin:K}=(0,G.Z)(),L=J(a.path),M=!a.path.includes("/")&&g.A.has(a.name),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),R=(0,e.useCallback)(()=>{o||(m.push(`/view/${(0,h.O0)(a.path)}`),l?.())},[m,a.path,l,o]),S=(0,e.useCallback)(b=>{b.stopPropagation(),w(a.name),p(!0),setTimeout(()=>H.current?.select(),0)},[a.name]),X=(0,e.useCallback)(()=>{let b=v.trim();b&&b!==a.name?z(async()=>{let c=await (0,y.f)(a.path,b);c.success&&c.newPath?(p(!1),m.push(`/view/${(0,h.O0)(c.newPath)}`),m.refresh(),$()):p(!1)}):p(!1)},[v,a.name,a.path,m]),Y=(0,e.useCallback)(a=>{a.stopPropagation(),O(!0)},[]),Z=(0,e.useCallback)(b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.effectAllowed="copy"},[a.path]),aa=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]);return o?(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:H,autoFocus:!0,value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&X(),"Escape"===a.key&&p(!1)},onBlur:X,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]}):(0,d.jsxs)("div",{className:"relative group/file",children:[(0,d.jsxs)("button",{onClick:R,onContextMenu:aa,draggable:!0,onDragStart:Z,"data-filepath":a.path,className:`
143
+ w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
144
+ text-sm transition-colors duration-100 cursor-default pr-16
145
+ ${n?"bg-accent text-foreground":"hover:bg-muted text-muted-foreground hover:text-foreground"}
146
+ `,style:{paddingLeft:`${12*b+8}px`},children:["directory"===a.type?null:".csv"===a.extension?(0,d.jsx)(i.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(j.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),L&&(0,d.jsx)(r.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})}),P&&(0,d.jsxs)(W,{x:P.x,y:P.y,onClose:()=>Q(null),menuHeight:140,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{_(a.path),Q(null)},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",I.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{K(a.path),Q(null)},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${L?"fill-[var(--amber)] text-[var(--amber)]":""}`}),L?I.fileTree.removeFromFavorites:I.fileTree.pinToFavorites]}),!M&&(0,d.jsxs)("button",{className:T,onClick:a=>{Q(null),S(a)},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",I.fileTree.rename]}),!M&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:a=>{Q(null),Y(a)},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"})," ",I.fileTree.delete]})]})]}),(0,d.jsx)(F.TM,{open:N,title:I.fileTree.delete,message:I.fileTree.confirmDelete(a.name),confirmLabel:I.fileTree.delete,cancelLabel:I.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>O(!1),onConfirm:()=>{O(!1),A(async()=>{let b=await (0,C.i)(a.path);if(b.success){if(b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${I.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(m.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:I.trash?.undo??"Undo"})}m.refresh(),$()}})}})]})}function ad({nodes:a,depth:b=0,onNavigate:c,maxOpenDepth:e,parentIsSpace:h,onImport:i}){var j;let k,l=(k="/view/",(j=(0,f.usePathname)()).startsWith(k)?j.slice(k.length).split("/").map(decodeURIComponent).join("/"):""),m=L(),n=0===b,o=m?a:a.filter(a=>!(n&&a.name.startsWith(".")||"file"===a.type&&g.C.has(a.name)||"directory"===a.type&&a.name.startsWith("."))),p=n?o.filter(a=>"directory"!==a.type||"Inbox"!==a.name):o;return(0,d.jsx)("div",{className:"flex flex-col gap-0.5",children:p.map(a=>"directory"===a.type?(0,d.jsx)(ab,{node:a,depth:b,currentPath:l,onNavigate:c,maxOpenDepth:e,onImport:i},a.path):(0,d.jsx)(ac,{node:a,depth:b,currentPath:l,onNavigate:c},a.path))})}},60442:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call CsvRenderer() from the server but CsvRenderer is 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/app/components/renderers/csv/CsvRenderer.tsx","CsvRenderer")},60725:(a,b,c)=>{"use strict";function d(a,b,c){let d,e,f;if("stdio"===c){var g,h;let b={type:"stdio",command:"mindos",args:["mcp"]};if("toml"===a.format){let b=`[${a.configKey}.mindos]
120
147
  command = "mindos"
121
148
  args = ["mcp"]
122
149
 
@@ -126,12 +153,12 @@ MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if
126
153
  flex-col bg-background border-l border-border/40 shadow-[-4px_0_16px_rgba(0,0,0,0.04)]
127
154
  ${y?"":"transition-[width,transform] duration-200 ease-out"}
128
155
  ${a?"translate-x-0":"translate-x-full pointer-events-none"}
129
- `,style:{width:E,minWidth:`${o}px`},role:"complementary","aria-label":"MindOS panel",children:[(0,e.jsx)(i.default,{fallback:(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-6 text-center",children:[(0,e.jsx)(g.A,{size:20,className:"text-muted-foreground"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"MindOS encountered an error."}),(0,e.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:"Reload page"})]}),children:(0,e.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col overflow-hidden",children:(0,e.jsx)(h.A,{visible:a,variant:"panel",currentFile:a?c:void 0,initialMessage:d,initialAcpAgent:k,onFirstMessage:l,onClose:b,askMode:r,onModeSwitch:s,maximized:t,onMaximize:u})})}),(0,e.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:D,children:(0,e.jsx)("div",{className:"absolute left-[2px] top-0 w-[1px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity duration-150"})})]})}d()}catch(a){d(a)}})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is 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/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},63710:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>i,Nh:()=>k,QL:()=>f,TM:()=>g,h0:()=>h,lL:()=>j});var d=c(99101);function e(a){let b=new Uint8Array(a),c=[];for(let a=0;a<b.length;a+=8192)c.push(String.fromCharCode(...b.subarray(a,a+8192)));return btoa(c.join(""))}async function f(a,b){let c=[],f=0;for(let b of a){if(b.size>0xa00000){f++;continue}try{if(b.name.toLowerCase().endsWith(".pdf")){let a=await b.arrayBuffer();c.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();c.push({name:b.name,content:a})}}catch{}}if(0===c.length)return void(f>0?d.oR.error(b.inbox.tooLarge(f),4e3):a.length>0&&d.oR.error(b.inbox.saveFailed,4e3));try{var g;let a=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:c})});if(!a.ok){let c=await a.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",c.error),d.oR.error(b.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.saved?.length??0,i=e.skipped?.length??0;g=f,h>0&&g>0&&0===i?d.oR.success(b.inbox.savedWithOversized(h,g),4e3):h>0&&i+g>0?d.oR.success(b.inbox.savedWithSkipped(h,i+g),4e3):h>0?d.oR.success(b.inbox.savedToast(h),3e3):(g>0&&d.oR.error(b.inbox.tooLarge(g),4e3),i>0&&d.oR.error(b.inbox.savedWithSkipped(0,i),4e3),0===g&&0===i&&d.oR.error(b.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(a){console.error("[QuickDrop] Network error:",a),d.oR.error(b.inbox.saveFailed,4e3)}}async function g(a,b){try{let c=await fetch("/api/inbox/clip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),e=await c.json();if(!c.ok){let a=e.error||b.inbox.clipFailed;return d.oR.error(a,4e3),{ok:!1}}return d.oR.success(b.inbox.clipSuccess(e.title||a),3e3),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated")),{ok:!0,title:e.title}}catch(a){return console.error("[ClipURL] Network error:",a),d.oR.error(b.inbox.clipFailed,4e3),{ok:!1}}}function h(a){let b=a.trim();if(!b.startsWith("http://")&&!b.startsWith("https://"))return!1;try{return new URL(b),!0}catch{return!1}}function i(a){if(a.dataTransfer?.files&&a.dataTransfer.files.length>0)return null;let b=a.dataTransfer?.getData("text/uri-list");if(b){let a=b.split(/[\r\n]+/).find(a=>!a.startsWith("#")&&a.trim().length>0);if(a&&h(a))return a.trim()}let c=a.dataTransfer?.getData("text/plain");return c&&h(c)?c.trim():null}function j(a){let b=a.dataTransfer?.types??[];return!b.includes("Files")&&(b.includes("text/uri-list")||b.includes("text/plain"))}async function k(a,b,c){let f=[],g=0,h=new Set(["pdf","png","jpg","jpeg","gif","webp","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"]);for(let b of a){if(b.size>0xa00000){g++;continue}try{let a=(b.name.split(".").pop()??"").toLowerCase();if(h.has(a)){let a=await b.arrayBuffer();f.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();f.push({name:b.name,content:a})}}catch{}}if(0===f.length)return void(g>0?d.oR.error(c.inbox.tooLarge(g),4e3):a.length>0&&d.oR.error(c.inbox.saveFailed,4e3));let i=b.split("/").pop()||b;try{let a=await fetch("/api/file/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:f,targetSpace:b,organize:!1,conflict:"rename"})});if(!a.ok){let b=await a.json().catch(()=>({}));console.error("[TreeDrop] Save failed:",b.error),d.oR.error(c.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.created?.length??0,j=e.skipped?.length??0;h>0&&j+g>0?d.oR.success(c.inbox.savedWithSkipped(h,j+g),4e3):h>0?d.oR.success(c.inbox.savedToDir(h,i),3e3):(g>0&&d.oR.error(c.inbox.tooLarge(g),4e3),j>0&&d.oR.error(c.inbox.savedWithSkipped(0,j),4e3)),window.dispatchEvent(new Event("mindos:files-changed"))}catch(a){console.error("[TreeDrop] Network error:",a),d.oR.error(c.inbox.saveFailed,4e3)}}},63956:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"video",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useCallback)(()=>{let a=o.current;a&&n({w:a.videoWidth,h:a.videoHeight})},[]),q=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[m&&(0,d.jsxs)("span",{children:[m.w," x ",m.h]}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:f})]}),(0,d.jsx)("div",{className:"flex-1 min-h-[50vh] flex items-center justify-center bg-black rounded-b-lg overflow-hidden",children:g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-neutral-400",children:"Failed to load video"}),(0,d.jsx)("button",{onClick:q,className:"text-xs px-3 py-1.5 rounded-md bg-neutral-800 hover:bg-neutral-700 text-neutral-200 transition-colors",children:"Retry"})]}):(0,d.jsx)("video",{ref:o,controls:!0,preload:"metadata",className:"max-w-full max-h-[70vh]",onLoadedMetadata:p,onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)})]})}},65141:(a,b,c)=>{"use strict";c.d(b,{b:()=>g});var d=c(67484),e=c(97030),f=c(4615);function g(){let[a,b]=(0,d.useState)("files"),[c,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),l=(0,d.useCallback)(a=>g(a),[]),m=(0,d.useCallback)(a=>{try{localStorage.setItem("left-panel-width",String(a))}catch{}},[]),n=(0,d.useCallback)(()=>i(a=>!a),[]),o=(0,d.useCallback)(a=>{k(a);try{localStorage.setItem("rail-expanded",String(a))}catch{}},[]),p=j?f.we:f.SG,q=c??(a?e.iP[a]:280);return{activePanel:a,setActivePanel:b,panelWidth:c,panelMaximized:h,railExpanded:j,railWidth:p,panelOpen:null!==a,effectivePanelWidth:q,handlePanelWidthChange:l,handlePanelWidthCommit:m,handlePanelMaximize:n,handleExpandedChange:o}}},65965:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>H});var e=c(48249),f=c(67484),g=c(74429),h=c(24520),i=c(80600),j=c(33407),k=c(46674),l=c(51161),m=c(74118),n=c(47223),o=c(38957),p=c(54461),q=c(41297),r=c(45108),s=c(15330),t=c(55232),u=c(74356),v=c(6597),w=c(82110),x=c(42529),y=c(41739),z=c(33827),A=c(74190),B=c(4452),C=c(93574),D=c(49223),E=c(33191),F=c(17009),G=a([B]);function H({visible:a,currentFile:b,initialMessage:c,initialAcpAgent:d,onFirstMessage:G,variant:H,onClose:I,maximized:J,onMaximize:K,askMode:L,onModeSwitch:M,onDockToPanel:N}){let O="panel"===H,P="home"===H,Q=(0,f.useRef)(null),R=(0,f.useRef)(null),{t:S}=(0,n.Y)(),[T,U]=(0,f.useState)(!1),[V,W]=(0,f.useState)(""),X=(0,f.useRef)("");X.current=V;let[Y,Z]=(0,f.useState)([]),$=(0,f.useRef)(Y);$.current=Y;let[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(!1),af=(0,f.useRef)(null),ag=(0,f.useRef)(null),[ah,ai]=(0,f.useState)(null),[aj,ak]=(0,f.useState)(null),al=(0,f.useRef)(aj);al.current=aj;let[am,an]=(0,f.useState)(null),ao=(0,f.useRef)(am),ap=(0,f.useRef)(null);ao.current=am;let[aq,ar]=(0,f.useState)("agent"),[as,at]=(0,f.useState)(null),[au,av]=(0,f.useState)(null),aw=(0,p.X)(b),ax=(0,f.useRef)(aw);ax.current=aw;let ay=(0,f.useMemo)(()=>({unsupportedType:S.fileImport?.unsupported}),[S]),az=(0,q.l)(ay),aA=(0,f.useRef)(az);aA.current=az;let aB=(0,r.u)(),aC=(0,s.Q)(),aD=(0,t.C)(),aE=(0,F.z)(),aF=(0,f.useRef)(aB);aF.current=aB;let aG=(0,f.useRef)(aC);aG.current=aC;let aH=(0,f.useRef)(aD);aH.current=aD;let aI=(0,f.useCallback)(()=>{W(""),ak(null),Z(b?[b]:[]),aA.current.clearAttachments()},[b]),aJ=(0,f.useCallback)(a=>{W(a.content),a.images&&a.images.length>0&&aF.current.clearImages(),a.attachedFiles&&Z(a.attachedFiles),a.skillName&&aH.current.resetSlash(),an((0,D.EI)(a)),setTimeout(()=>Q.current?.focus(),50)},[]),aK=(0,f.useRef)({inputValueRef:X,mentionRef:aG,slashRef:aH,imageUploadRef:aF,sessionRef:ax,uploadRef:aA,selectedSkillRef:al,selectedAcpAgentRef:ao,attachedFilesRef:$}),aL=(0,C.t)({currentFile:b,chatMode:aq,providerOverride:as,modelOverride:au,onFirstMessage:G,refs:aK.current,errorLabels:{noResponse:S.ask.errorNoResponse,stopped:S.ask.stopped},resetInputState:aI,onRestoreInput:aJ}),{isLoading:aM,loadingPhase:aN,reconnectAttempt:aO,reconnectMaxRef:aP}=aL,aQ=aL.submit,aR=aL.stop,aS=(0,f.useCallback)(a=>{an(a),aw.setSessionDefaultAcpAgent(a)},[aw]),aT=az.localAttachments.some(a=>"loading"===a.status),aU=az.uploadError||aB.imageError||(aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":"");(0,f.useRef)(!1),(0,f.useRef)(b),(0,f.useRef)(aw.clearPersistTimer).current=aw.clearPersistTimer;let aV=(0,f.useRef)(null),aW=(0,f.useRef)(null),aX=(0,f.useRef)(null),aY=(0,f.useCallback)((a,b)=>{W(a);let c=b??a.length;aW.current&&clearTimeout(aW.current),aX.current&&clearTimeout(aX.current),aW.current=setTimeout(()=>aG.current.updateMentionFromInput(a,c),80),aX.current=setTimeout(()=>aH.current.updateSlashFromInput(a,c),80)},[]),aZ=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("@"),f=c.slice(0,e)+c.slice(d);W(f),aG.current.resetMention(),$.current.includes(a)||Z(b=>[...b,a]),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a$=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("/"),f=c.slice(0,e)+c.slice(d);W(f),ak(a),aH.current.resetSlash(),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a_=(0,f.useRef)(aZ);a_.current=aZ;let a0=(0,f.useRef)(a$);a0.current=a$;let a1=(0,f.useCallback)(a=>{let b=aG.current,c=aH.current;if(null!==b.mentionQuery){if("Escape"===a.key){a.preventDefault(),b.resetMention();return}if("ArrowDown"===a.key)a.preventDefault(),b.navigateMention("down");else if("ArrowUp"===a.key)a.preventDefault(),b.navigateMention("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;b.mentionResults.length>0&&(a.preventDefault(),a_.current(b.mentionResults[b.mentionIndex]))}return}if(null!==c.slashQuery){if("Escape"===a.key){a.preventDefault(),c.resetSlash();return}if("ArrowDown"===a.key)a.preventDefault(),c.navigateSlash("down");else if("ArrowUp"===a.key)a.preventDefault(),c.navigateSlash("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;c.slashResults.length>0&&(a.preventDefault(),a0.current(c.slashResults[c.slashIndex]))}return}"Enter"===a.key&&!a.shiftKey&&!a.nativeEvent.isComposing&&!aL.isLoadingRef.current&&(X.current.trim()||aF.current.images.length>0)&&(a.preventDefault(),a.currentTarget.form?.requestSubmit())},[]),a2=(0,f.useCallback)(()=>{aL.isLoadingRef.current||(ax.current.resetSession(),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(null),ap.current=null,aa(!1),aL.firstMessageFired.current=!1,setTimeout(()=>Q.current?.focus(),0))},[b]),a3=(0,f.useCallback)(a=>{(a.dataTransfer.types.includes("text/mindos-path")||a.dataTransfer.types.includes("Files"))&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",ac(!0))},[]),a4=(0,f.useCallback)(()=>ac(!1),[]),a5=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),ac(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b){let c=a.dataTransfer.getData("text/mindos-type"),d="directory"===c?b.replace(/\/?$/,"/"):b;$.current.includes(d)||Z(a=>[...a,d]);return}let c=a.dataTransfer.files;if(c.length>0){let b=Array.from(c).some(a=>a.type.startsWith("image/")),d=Array.from(c).filter(a=>!a.type.startsWith("image/"));(async()=>{try{if(b&&await aF.current.handleDrop(a),d.length>0){let a=new DataTransfer;d.forEach(b=>a.items.add(b)),await aA.current.pickFiles(a.files)}}catch(a){console.warn("[AskContent] Drop file processing failed:",a)}})()}},[]),a6=(0,f.useCallback)(a=>{let b=a.clipboardData?.items;!b||Array.from(b).some(a=>"file"===a.kind&&a.type.startsWith("image/"))&&(a.preventDefault(),aF.current.handlePaste(a))},[]),a7=(0,f.useCallback)(a=>{if(aL.isLoadingRef.current)return;let c=aw.sessions.find(b=>b.id===a)??null;ax.current.loadSession(a),aa(!1),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(c?.defaultAcpAgent??null),setTimeout(()=>Q.current?.focus(),0)},[b,aw.sessions]),a8=(0,f.useCallback)(()=>aa(a=>!a),[]),a9=(0,f.useMemo)(()=>({connecting:S.ask.connecting,thinking:S.ask.thinking,generating:S.ask.generating,reconnecting:aO>0?S.ask.reconnecting(aO,aP.current):void 0,copyMessage:S.ask.copyMessage}),[S,aO]),ba=(0,f.useCallback)(a=>{at(a),av(null)},[]);return(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-col h-full",children:[(0,e.jsx)(y.A,{isPanel:O||P,showHistory:_,onToggleHistory:a8,onReset:a2,isLoading:aM,maximized:J,onMaximize:K,askMode:P?void 0:L,onModeSwitch:P?void 0:M,onClose:P?void 0:I,onDockToPanel:J?N:void 0,sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoadSession:a7,onDeleteSession:aw.deleteSession,onRenameSession:aw.renameSession,onTogglePinSession:aw.togglePinSession,messages:aw.messages}),_&&(0,e.jsx)(x.A,{sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoad:a7,onDelete:aw.deleteSession,onRename:aw.renameSession,onTogglePin:aw.togglePinSession,onClearAll:aw.clearAllSessions,onClose:()=>aa(!1),onNewChat:a2}),!_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col",children:[!P&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:S.ask.suggestions,onSuggestionClick:W,labels:a9}),P&&(aw.messages.length>0||J)&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:J&&0===aw.messages.length?S.ask.suggestions:[],onSuggestionClick:W,labels:a9})]}),null!==aC.mentionQuery&&aC.mentionResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(v.A,{results:aC.mentionResults,selectedIndex:aC.mentionIndex,query:aC.mentionQuery??void 0,onSelect:aZ})}),null!==aD.slashQuery&&aD.slashResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(w.A,{results:aD.slashResults,selectedIndex:aD.slashIndex,query:aD.slashQuery??void 0,onSelect:a$})}),(0,e.jsx)("div",{className:(0,E.cn)("shrink-0",P?"px-2 pb-2 pt-0.5":"px-3 pb-2.5 pt-1"),children:(0,e.jsxs)("div",{className:(0,E.cn)("rounded-xl bg-muted/40 transition-all focus-within:bg-muted/60",ab&&"ring-2 ring-[var(--amber)] bg-[var(--amber-dim)]"),onDragOver:a3,onDragLeave:a4,onDrop:a5,children:[(Y.length>0||az.localAttachments.length>0||aB.images.length>0||aj||am||az.uploadError||aB.imageError)&&(0,e.jsxs)("div",{className:(0,E.cn)("px-3 pt-2.5 pb-1",O?"max-h-24 overflow-y-auto":"max-h-28 overflow-y-auto"),children:[(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[Y.map(a=>(0,e.jsx)(z.A,{path:a,variant:"kb",onRemove:()=>Z(b=>b.filter(b=>b!==a))},a)),az.localAttachments.map((a,b)=>(0,e.jsx)(z.A,{path:a.name,variant:"upload",status:a.status,error:a.error,truncatedInfo:a.truncatedInfo,onRemove:()=>az.removeAttachment(b)},`up-${a.name}-${b}`)),aB.images.map((a,b)=>(0,e.jsx)(z.A,{path:a.fileName||`Image ${b+1}`,variant:"image",imageData:a.data,imageMime:a.mimeType,onRemove:()=>aB.removeImage(b)},`img-${b}`)),aj&&(0,e.jsx)(z.A,{path:aj.name,variant:"skill",onRemove:()=>{ak(null),Q.current?.focus()}}),am&&(0,e.jsx)(z.A,{path:"object"==typeof am&&"name"in am?am.name:"Remote Agent",variant:"agent",onRemove:()=>{aS(null),Q.current?.focus()}})]}),aU&&(0,e.jsx)("div",{className:"mt-1 text-xs text-error",children:aU})]}),(0,e.jsxs)("form",{ref:aV,onSubmit:aQ,className:(0,E.cn)("flex items-end gap-1.5",P?"px-2 py-1.5":"px-3 py-2"),children:[(0,e.jsx)("div",{className:"relative shrink-0",children:(0,e.jsx)("button",{ref:af,type:"button",onClick:()=>ae(a=>!a),className:"p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",title:S.hints.attachFile,children:(0,e.jsx)(h.A,{size:15})})}),T&&ad&&ah&&(0,g.createPortal)((0,e.jsxs)("div",{ref:ag,className:"fixed py-1 rounded-xl border border-border/60 bg-card shadow-lg z-50 min-w-[150px] animate-in fade-in-0 slide-in-from-bottom-2 duration-150",style:{top:`${ah.top}px`,left:`${ah.left}px`,transform:"translateY(-100%)"},onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{az.uploadInputRef.current?.click(),ae(!1)},children:[(0,e.jsx)(i.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachFileLabel]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{R.current?.click(),ae(!1)},children:[(0,e.jsx)(j.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachImageLabel]})]}),document.body),(0,e.jsx)("input",{ref:az.uploadInputRef,type:"file",className:"hidden",multiple:!0,accept:".txt,.md,.markdown,.csv,.json,.yaml,.yml,.xml,.html,.htm,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf",onChange:async a=>{let b=a.currentTarget;await az.pickFiles(b.files),b.value=""}}),(0,e.jsx)("input",{ref:R,type:"file",className:"hidden",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp",onChange:async a=>{let b=a.currentTarget;await aB.handleFileSelect(b.files),b.value=""}}),(0,e.jsx)("textarea",{ref:a=>{Q.current=a},value:V,onChange:a=>aY(a.target.value,a.target.selectionStart??void 0),onKeyDown:a1,onPaste:a6,placeholder:S.ask.placeholder,rows:1,className:(0,E.cn)("min-w-0 flex-1 resize-none overflow-y-hidden bg-transparent py-2 leading-relaxed text-foreground placeholder:text-muted-foreground/50 outline-none focus-visible:ring-0",P?"text-xs":"text-sm")}),aM?(0,e.jsx)("button",{type:"button",onClick:aR,className:"p-2 rounded-xl transition-colors shrink-0 text-foreground bg-muted hover:bg-muted/80",title:"reconnecting"===aN?S.ask.cancelReconnect:S.ask.stopTitle,children:"reconnecting"===aN?(0,e.jsx)(k.A,{size:15}):(0,e.jsx)(l.A,{size:15})}):(0,e.jsx)("button",{type:"submit",title:aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":S.ask.send,disabled:aT||!V.trim()&&0===aB.images.length,className:"p-2 rounded-xl disabled:opacity-20 disabled:scale-95 disabled:cursor-not-allowed transition-all duration-150 shrink-0 bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/15 hover:shadow-md hover:shadow-[var(--amber)]/20 active:scale-95",children:(0,e.jsx)(m.A,{size:14})})]}),(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center justify-between border-t border-border/10",O?"px-2 pb-1.5 pt-1 gap-1":"px-3 pb-2 pt-1.5"),children:[(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center flex-wrap",O?"gap-1":"gap-2"),children:[(0,e.jsx)(o.Ay,{mode:aq,onChange:ar,disabled:aM}),T&&aE.installedAgents.length>0&&(0,e.jsx)(A.A,{selectedAgent:am,onSelect:aS,installedAgents:aE.installedAgents,loading:aE.loading}),T&&(0,e.jsx)(B.A,{providerValue:as,onProviderChange:ba,modelValue:au,onModelChange:av,disabled:aM})]}),!O&&!P&&(0,e.jsxs)("span",{className:"hidden md:inline text-2xs text-muted-foreground/40 select-none shrink-0",children:[(0,e.jsx)("kbd",{className:"font-mono",children:"Enter"})," ",S.ask.send," \xb7 ",(0,e.jsx)("kbd",{className:"font-mono",children:"Shift+Enter"})," ",S.ask.newlineHint]})]})]})})]})]})}B=(G.then?(await G)():G)[0],new WeakMap,d()}catch(a){d(a)}})},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"var(--tool-read)",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"var(--tool-search)",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[a.agentName&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.62rem",fontWeight:500,padding:"1px 6px",borderRadius:999,background:"var(--muted)",color:"var(--muted-foreground)",whiteSpace:"nowrap",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis"},title:a.agentName,children:a.agentName.length>30?a.agentName.slice(0,30)+"...":a.agentName}),"ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),a.agentName&&(0,d.jsxs)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.68rem",color:"var(--muted-foreground)"},children:["Agent: ",(0,d.jsx)("span",{style:{color:"var(--foreground)",fontWeight:500},children:a.agentName})]}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is 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/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is 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/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is 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/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is 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/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is 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/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is 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/app/components/ui/tooltip.tsx","TooltipProvider")},69593:(a,b,c)=>{"use strict";c.d(b,{Oo:()=>e,dB:()=>k});var d=c(67484);function e(a){let b=a.replace(/<(thinking|reasoning|scratchpad)>[\s\S]*?<\/\1>/gi,"");return(b=b.replace(/<(?:thinking|reasoning|scratchpad)>[\s\S]*$/gi,"")).trim()}let f=new Set(["create_file","write_file","batch_create_files","append_to_file","insert_after_heading","update_section","edit_lines","delete_file","rename_file","move_file","append_csv"]),g=new Set(["read_file","read_lines","search","list_files"]);function h(a,b){return b&&"object"==typeof b?"string"==typeof b.path?b.path:"string"==typeof b.from_path?b.from_path:"batch_create_files"===a&&Array.isArray(b.files)?b.files.map(a=>a.path??"").filter(Boolean).join(", "):"":""}async function i(a){try{let b=await fetch(`/api/file?path=${encodeURIComponent(a)}&op=read_file`);if(!b.ok)return"";return(await b.json()).content??""}catch{return""}}async function j(a,b,c,d){let j=a.getReader(),k=new TextDecoder,l="",m=[],n=new Map,o="",p=0,q=new Set;try{for(;!d?.aborted;){let{done:a,value:d}=await j.read();if(a)break;let u=(l+=k.decode(d,{stream:!0})).split("\n");for(let a of(l=u.pop()??"",u)){let d,j=a.trim();if(!j.startsWith("data:"))continue;let k=j.slice(5).trim();if(!k)continue;try{d=JSON.parse(k)}catch{continue}let l=d.type;switch(l){case"tool_start":{var r,s,t;let a=d.toolName,e=d.toolCallId,j=d.args;p++;let k=(r=l,s=a,t=j,"text_delta"===r?{stage:"analyzing"}:"tool_start"===r&&s?f.has(s)?{stage:"writing",detail:h(s,t)||void 0}:g.has(s)?{stage:"reading",detail:t&&"object"==typeof t&&"path"in t&&"string"==typeof t.path?t.path:void 0}:{stage:"analyzing"}:null);if(k&&b({stageHint:k}),f.has(a)){let d=h(a,j),f="update";"create_file"===a||"batch_create_files"===a?f="create":("delete_file"===a||"rename_file"===a||"move_file"===a)&&(f="unknown"),"update"===f&&d&&!q.has(d)&&(q.add(d),i(d).then(a=>{a&&c(d,a)})),n.set(e,{name:a,path:d,action:f}),b({currentTool:{name:a,path:d}})}break}case"tool_end":{let a=d.toolCallId,c=!!d.isError,e=n.get(a);if(e){if("batch_create_files"===e.name)for(let b of e.path.split(", ").filter(Boolean))m.push({action:e.action,path:b,toolCallId:a,ok:!c});else m.push({action:e.action,path:e.path,toolCallId:a,ok:!c});n.delete(a),b({changes:[...m],currentTool:null})}break}case"text_delta":o+=d.delta??"",b({stageHint:{stage:"analyzing"},summary:e(o)});break;case"error":throw Error(d.message||"AI organize failed")}}}}finally{j.releaseLock()}return{changes:m,summary:e(o),toolCallCount:p}}function k(){let[a,b]=(0,d.useState)("idle"),[c,e]=(0,d.useState)([]),[f,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(null),[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(null),[o,p]=(0,d.useState)(0),q=(0,d.useRef)(null),r=(0,d.useRef)(0),s=(0,d.useRef)(new Map),[t,u]=(0,d.useState)([]),[v,w]=(0,d.useState)("upload"),x=(0,d.useRef)(0),[y,z]=(0,d.useState)(0),A=(0,d.useCallback)(async(a,c,d="upload")=>{b("organizing"),e([]),g(null),i({stage:"connecting"}),l(""),n(null),p(0),u(a.map(a=>a.name)),w(d),x.current=Date.now(),z(0),s.current=new Map,r.current=Date.now();let f=new AbortController;q.current=f;let h=a.map(a=>({name:a.name,content:a.content.length>2e4?a.content.slice(0,2e4)+"\n\n[...truncated to first ~20000 chars]":a.content}));try{let a=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:c}],uploadedFiles:h,maxSteps:15,mode:"organize"}),signal:f.signal});if(!a.ok){let b=`Request failed (${a.status})`;try{let c=await a.json();"string"==typeof c?.error?b=c.error:"object"==typeof c?.error&&c.error?.message?b=c.error.message:c?.message&&(b=c.message)}catch{}throw Error(b)}if(!a.body)throw Error("No response body");let d=await j(a.body,a=>{r.current=Date.now(),a.changes&&e(a.changes),void 0!==a.currentTool&&g(a.currentTool),a.stageHint&&i(a.stageHint),void 0!==a.summary&&l(a.summary)},(a,b)=>{s.current.set(a,b)},f.signal);e(d.changes),l(d.summary),p(d.toolCallCount),g(null),z(Date.now()-x.current),b("done")}catch(a){"AbortError"===a.name?b("idle"):(n(a.message),b("error"))}finally{q.current=null}},[]),B=(0,d.useCallback)(()=>{q.current?.abort()},[]),C=(0,d.useCallback)(async a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);if(!b)return!1;try{if("create"===b.action){if(!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:b.path})})).ok)return!1}else{if("update"!==b.action)return!1;let c=s.current.get(a);if(!c||!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:b.path,content:c})})).ok)return!1}return e(b=>b.map(b=>b.path===a&&b.ok&&!b.undone?{...b,undone:!0}:b)),!0}catch{return!1}},[c]),D=(0,d.useCallback)(async()=>{let a=c.filter(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),b=0;for(let c of a)try{if("create"===c.action)(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:c.path})})).ok&&b++;else if("update"===c.action){let a=s.current.get(c.path);a&&(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:c.path,content:a})})).ok&&b++}}catch{}return b>0&&e(a=>a.map(a=>!a.ok||a.undone?a:"create"===a.action||"update"===a.action&&s.current.has(a.path)?{...a,undone:!0}:a)),b},[c]),E=(0,d.useCallback)(a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);return!!b&&("create"===b.action||"update"===b.action&&s.current.has(a))},[c]),F=c.some(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),G=(0,d.useCallback)(()=>{b("idle"),e([]),g(null),i(null),l(""),n(null),p(0),u([]),w("upload"),z(0),x.current=0,s.current=new Map,r.current=0},[]);return{phase:a,changes:c,currentTool:f,stageHint:h,summary:k,error:m,toolCallCount:o,sourceFileNames:t,source:v,durationMs:y,snapshots:s,start:A,abort:B,undoOne:C,undoAll:D,canUndo:E,hasAnyUndoable:F,reset:G}}},70137:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let{t:a}=(0,g.Y)(),b=a.settings.update.updateToast,[c,h]=(0,e.useState)("hidden"),[i,j]=(0,e.useState)({});(0,e.useRef)(null);let[k,l]=(0,e.useState)(!1),m=(0,e.useRef)(new Set);(0,e.useRef)({});let n=(0,e.useCallback)(()=>{m.current.forEach(clearTimeout),m.current.clear()},[]),o=(0,e.useCallback)((a,b)=>{let c=setTimeout(()=>{m.current.delete(c),h(a)},b);m.current.add(c)},[]),p=(0,e.useCallback)(()=>{n(),window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"update"}})),h("dismissing"),o("hidden",200)},[n,o]),q=(0,e.useCallback)(()=>{n(),i.desktop&&localStorage.setItem("mindos_update_skip_desktop",i.desktop.version),i.core&&localStorage.setItem("mindos_update_skip_core",i.core.version),h("dismissing"),o("hidden",200)},[i,n,o]);if(!k||"hidden"===c)return null;let r=!!(i.desktop&&i.core),s=r?b.titleMultiple:i.desktop?b.titleSingle(b.desktopLabel,i.desktop.version):i.core?b.titleSingle(b.coreLabel,i.core.version):"",t=r?`${b.desktopLabel} v${i.desktop.version} \u00B7 ${b.coreLabel} v${i.core.version}`:"";return(0,d.jsx)("div",{role:"status","aria-live":"polite",className:`
156
+ `,style:{width:E,minWidth:`${o}px`},role:"complementary","aria-label":"MindOS panel",children:[(0,e.jsx)(i.default,{fallback:(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-6 text-center",children:[(0,e.jsx)(g.A,{size:20,className:"text-muted-foreground"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"MindOS encountered an error."}),(0,e.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:"Reload page"})]}),children:(0,e.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col overflow-hidden",children:(0,e.jsx)(h.A,{visible:a,variant:"panel",currentFile:a?c:void 0,initialMessage:d,initialAcpAgent:k,onFirstMessage:l,onClose:b,askMode:r,onModeSwitch:s,maximized:t,onMaximize:u})})}),(0,e.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:D,children:(0,e.jsx)("div",{className:"absolute left-[2px] top-0 w-[1px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity duration-150"})})]})}d()}catch(a){d(a)}})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is 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/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},63710:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>i,Nh:()=>k,QL:()=>f,TM:()=>g,h0:()=>h,lL:()=>j});var d=c(99101);function e(a){let b=new Uint8Array(a),c=[];for(let a=0;a<b.length;a+=8192)c.push(String.fromCharCode(...b.subarray(a,a+8192)));return btoa(c.join(""))}async function f(a,b){let c=[],f=0;for(let b of a){if(b.size>0xa00000){f++;continue}try{if(b.name.toLowerCase().endsWith(".pdf")){let a=await b.arrayBuffer();c.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();c.push({name:b.name,content:a})}}catch{}}if(0===c.length)return void(f>0?d.oR.error(b.inbox.tooLarge(f),4e3):a.length>0&&d.oR.error(b.inbox.saveFailed,4e3));try{var g;let a=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:c})});if(!a.ok){let c=await a.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",c.error),d.oR.error(b.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.saved?.length??0,i=e.skipped?.length??0;g=f,h>0&&g>0&&0===i?d.oR.success(b.inbox.savedWithOversized(h,g),4e3):h>0&&i+g>0?d.oR.success(b.inbox.savedWithSkipped(h,i+g),4e3):h>0?d.oR.success(b.inbox.savedToast(h),3e3):(g>0&&d.oR.error(b.inbox.tooLarge(g),4e3),i>0&&d.oR.error(b.inbox.savedWithSkipped(0,i),4e3),0===g&&0===i&&d.oR.error(b.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(a){console.error("[QuickDrop] Network error:",a),d.oR.error(b.inbox.saveFailed,4e3)}}async function g(a,b){try{let c=await fetch("/api/inbox/clip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),e=await c.json();if(!c.ok){let a=e.error||b.inbox.clipFailed;return d.oR.error(a,4e3),{ok:!1}}return d.oR.success(b.inbox.clipSuccess(e.title||a),3e3),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated")),{ok:!0,title:e.title}}catch(a){return console.error("[ClipURL] Network error:",a),d.oR.error(b.inbox.clipFailed,4e3),{ok:!1}}}function h(a){let b=a.trim();if(!b.startsWith("http://")&&!b.startsWith("https://"))return!1;try{return new URL(b),!0}catch{return!1}}function i(a){if(a.dataTransfer?.files&&a.dataTransfer.files.length>0)return null;let b=a.dataTransfer?.getData("text/uri-list");if(b){let a=b.split(/[\r\n]+/).find(a=>!a.startsWith("#")&&a.trim().length>0);if(a&&h(a))return a.trim()}let c=a.dataTransfer?.getData("text/plain");return c&&h(c)?c.trim():null}function j(a){let b=a.dataTransfer?.types??[];return!b.includes("Files")&&(b.includes("text/uri-list")||b.includes("text/plain"))}async function k(a,b,c){let f=[],g=0,h=new Set(["pdf","png","jpg","jpeg","gif","webp","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"]);for(let b of a){if(b.size>0xa00000){g++;continue}try{let a=(b.name.split(".").pop()??"").toLowerCase();if(h.has(a)){let a=await b.arrayBuffer();f.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();f.push({name:b.name,content:a})}}catch{}}if(0===f.length)return void(g>0?d.oR.error(c.inbox.tooLarge(g),4e3):a.length>0&&d.oR.error(c.inbox.saveFailed,4e3));let i=b.split("/").pop()||b;try{let a=await fetch("/api/file/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:f,targetSpace:b,organize:!1,conflict:"rename"})});if(!a.ok){let b=await a.json().catch(()=>({}));console.error("[TreeDrop] Save failed:",b.error),d.oR.error(c.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.created?.length??0,j=e.skipped?.length??0;h>0&&j+g>0?d.oR.success(c.inbox.savedWithSkipped(h,j+g),4e3):h>0?d.oR.success(c.inbox.savedToDir(h,i),3e3):(g>0&&d.oR.error(c.inbox.tooLarge(g),4e3),j>0&&d.oR.error(c.inbox.savedWithSkipped(0,j),4e3)),window.dispatchEvent(new Event("mindos:files-changed"))}catch(a){console.error("[TreeDrop] Network error:",a),d.oR.error(c.inbox.saveFailed,4e3)}}},63956:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"video",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useCallback)(()=>{let a=o.current;a&&n({w:a.videoWidth,h:a.videoHeight})},[]),q=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[m&&(0,d.jsxs)("span",{children:[m.w," x ",m.h]}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:f})]}),(0,d.jsx)("div",{className:"flex-1 min-h-[50vh] flex items-center justify-center bg-black rounded-b-lg overflow-hidden",children:g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-neutral-400",children:"Failed to load video"}),(0,d.jsx)("button",{onClick:q,className:"text-xs px-3 py-1.5 rounded-md bg-neutral-800 hover:bg-neutral-700 text-neutral-200 transition-colors",children:"Retry"})]}):(0,d.jsx)("video",{ref:o,controls:!0,preload:"metadata",className:"max-w-full max-h-[70vh]",onLoadedMetadata:p,onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)})]})}},65141:(a,b,c)=>{"use strict";c.d(b,{b:()=>g});var d=c(67484),e=c(39139),f=c(4615);function g(){let[a,b]=(0,d.useState)("files"),[c,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),l=(0,d.useCallback)(a=>g(a),[]),m=(0,d.useCallback)(a=>{try{localStorage.setItem("left-panel-width",String(a))}catch{}},[]),n=(0,d.useCallback)(()=>i(a=>!a),[]),o=(0,d.useCallback)(a=>{k(a);try{localStorage.setItem("rail-expanded",String(a))}catch{}},[]),p=j?f.we:f.SG,q=c??(a?e.iP[a]:280);return{activePanel:a,setActivePanel:b,panelWidth:c,panelMaximized:h,railExpanded:j,railWidth:p,panelOpen:null!==a,effectivePanelWidth:q,handlePanelWidthChange:l,handlePanelWidthCommit:m,handlePanelMaximize:n,handleExpandedChange:o}}},65965:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>H});var e=c(48249),f=c(67484),g=c(74429),h=c(24520),i=c(80600),j=c(33407),k=c(46674),l=c(51161),m=c(74118),n=c(47223),o=c(38957),p=c(54461),q=c(41297),r=c(45108),s=c(15330),t=c(55232),u=c(74356),v=c(6597),w=c(82110),x=c(42529),y=c(41739),z=c(33827),A=c(74190),B=c(4452),C=c(93574),D=c(49223),E=c(33191),F=c(17009),G=a([B]);function H({visible:a,currentFile:b,initialMessage:c,initialAcpAgent:d,onFirstMessage:G,variant:H,onClose:I,maximized:J,onMaximize:K,askMode:L,onModeSwitch:M,onDockToPanel:N}){let O="panel"===H,P="home"===H,Q=(0,f.useRef)(null),R=(0,f.useRef)(null),{t:S}=(0,n.Y)(),[T,U]=(0,f.useState)(!1),[V,W]=(0,f.useState)(""),X=(0,f.useRef)("");X.current=V;let[Y,Z]=(0,f.useState)([]),$=(0,f.useRef)(Y);$.current=Y;let[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(!1),af=(0,f.useRef)(null),ag=(0,f.useRef)(null),[ah,ai]=(0,f.useState)(null),[aj,ak]=(0,f.useState)(null),al=(0,f.useRef)(aj);al.current=aj;let[am,an]=(0,f.useState)(null),ao=(0,f.useRef)(am),ap=(0,f.useRef)(null);ao.current=am;let[aq,ar]=(0,f.useState)("agent"),[as,at]=(0,f.useState)(null),[au,av]=(0,f.useState)(null),aw=(0,p.X)(b),ax=(0,f.useRef)(aw);ax.current=aw;let ay=(0,f.useMemo)(()=>({unsupportedType:S.fileImport?.unsupported}),[S]),az=(0,q.l)(ay),aA=(0,f.useRef)(az);aA.current=az;let aB=(0,r.u)(),aC=(0,s.Q)(),aD=(0,t.C)(),aE=(0,F.z)(),aF=(0,f.useRef)(aB);aF.current=aB;let aG=(0,f.useRef)(aC);aG.current=aC;let aH=(0,f.useRef)(aD);aH.current=aD;let aI=(0,f.useCallback)(()=>{W(""),ak(null),Z(b?[b]:[]),aA.current.clearAttachments()},[b]),aJ=(0,f.useCallback)(a=>{W(a.content),a.images&&a.images.length>0&&aF.current.clearImages(),a.attachedFiles&&Z(a.attachedFiles),a.skillName&&aH.current.resetSlash(),an((0,D.EI)(a)),setTimeout(()=>Q.current?.focus(),50)},[]),aK=(0,f.useRef)({inputValueRef:X,mentionRef:aG,slashRef:aH,imageUploadRef:aF,sessionRef:ax,uploadRef:aA,selectedSkillRef:al,selectedAcpAgentRef:ao,attachedFilesRef:$}),aL=(0,C.t)({currentFile:b,chatMode:aq,providerOverride:as,modelOverride:au,onFirstMessage:G,refs:aK.current,errorLabels:{noResponse:S.ask.errorNoResponse,stopped:S.ask.stopped},resetInputState:aI,onRestoreInput:aJ}),{isLoading:aM,loadingPhase:aN,reconnectAttempt:aO,reconnectMaxRef:aP}=aL,aQ=aL.submit,aR=aL.stop,aS=(0,f.useCallback)(a=>{an(a),aw.setSessionDefaultAcpAgent(a)},[aw]),aT=az.localAttachments.some(a=>"loading"===a.status),aU=az.uploadError||aB.imageError||"";(0,f.useRef)(!1),(0,f.useRef)(b),(0,f.useRef)(aw.clearPersistTimer).current=aw.clearPersistTimer;let aV=(0,f.useRef)(null),aW=(0,f.useRef)(null),aX=(0,f.useRef)(null),aY=(0,f.useCallback)((a,b)=>{W(a);let c=b??a.length;aW.current&&clearTimeout(aW.current),aX.current&&clearTimeout(aX.current),aW.current=setTimeout(()=>aG.current.updateMentionFromInput(a,c),80),aX.current=setTimeout(()=>aH.current.updateSlashFromInput(a,c),80)},[]),aZ=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("@"),f=c.slice(0,e)+c.slice(d);W(f),aG.current.resetMention(),$.current.includes(a)||Z(b=>[...b,a]),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a$=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("/"),f=c.slice(0,e)+c.slice(d);W(f),ak(a),aH.current.resetSlash(),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a_=(0,f.useRef)(aZ);a_.current=aZ;let a0=(0,f.useRef)(a$);a0.current=a$;let a1=(0,f.useCallback)(a=>{let b=aG.current,c=aH.current;if(null!==b.mentionQuery){if("Escape"===a.key){a.preventDefault(),b.resetMention();return}if("ArrowDown"===a.key)a.preventDefault(),b.navigateMention("down");else if("ArrowUp"===a.key)a.preventDefault(),b.navigateMention("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;b.mentionResults.length>0&&(a.preventDefault(),a_.current(b.mentionResults[b.mentionIndex]))}return}if(null!==c.slashQuery){if("Escape"===a.key){a.preventDefault(),c.resetSlash();return}if("ArrowDown"===a.key)a.preventDefault(),c.navigateSlash("down");else if("ArrowUp"===a.key)a.preventDefault(),c.navigateSlash("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;c.slashResults.length>0&&(a.preventDefault(),a0.current(c.slashResults[c.slashIndex]))}return}"Enter"===a.key&&!a.shiftKey&&!a.nativeEvent.isComposing&&!aL.isLoadingRef.current&&(X.current.trim()||aF.current.images.length>0)&&(a.preventDefault(),a.currentTarget.form?.requestSubmit())},[]),a2=(0,f.useCallback)(()=>{aL.isLoadingRef.current||(ax.current.resetSession(),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(null),ap.current=null,aa(!1),aL.firstMessageFired.current=!1,setTimeout(()=>Q.current?.focus(),0))},[b]),a3=(0,f.useCallback)(a=>{(a.dataTransfer.types.includes("text/mindos-path")||a.dataTransfer.types.includes("Files"))&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",ac(!0))},[]),a4=(0,f.useCallback)(()=>ac(!1),[]),a5=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),ac(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b){let c=a.dataTransfer.getData("text/mindos-type"),d="directory"===c?b.replace(/\/?$/,"/"):b;$.current.includes(d)||Z(a=>[...a,d]);return}let c=a.dataTransfer.files;if(c.length>0){let b=Array.from(c).some(a=>a.type.startsWith("image/")),d=Array.from(c).filter(a=>!a.type.startsWith("image/"));(async()=>{try{if(b&&await aF.current.handleDrop(a),d.length>0){let a=new DataTransfer;d.forEach(b=>a.items.add(b)),await aA.current.pickFiles(a.files)}}catch(a){console.warn("[AskContent] Drop file processing failed:",a)}})()}},[]),a6=(0,f.useCallback)(a=>{let b=a.clipboardData?.items;!b||Array.from(b).some(a=>"file"===a.kind&&a.type.startsWith("image/"))&&(a.preventDefault(),aF.current.handlePaste(a))},[]),a7=(0,f.useCallback)(a=>{if(aL.isLoadingRef.current)return;let c=aw.sessions.find(b=>b.id===a)??null;ax.current.loadSession(a),aa(!1),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(c?.defaultAcpAgent??null),setTimeout(()=>Q.current?.focus(),0)},[b,aw.sessions]),a8=(0,f.useCallback)(()=>aa(a=>!a),[]),a9=(0,f.useMemo)(()=>({connecting:S.ask.connecting,thinking:S.ask.thinking,generating:S.ask.generating,reconnecting:aO>0?S.ask.reconnecting(aO,aP.current):void 0,copyMessage:S.ask.copyMessage}),[S,aO]),ba=(0,f.useCallback)(a=>{at(a),av(null)},[]);return(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-col h-full",children:[(0,e.jsx)(y.A,{isPanel:O||P,showHistory:_,onToggleHistory:a8,onReset:a2,isLoading:aM,maximized:J,onMaximize:K,askMode:P?void 0:L,onModeSwitch:P?void 0:M,onClose:P?void 0:I,onDockToPanel:J?N:void 0,sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoadSession:a7,onDeleteSession:aw.deleteSession,onRenameSession:aw.renameSession,onTogglePinSession:aw.togglePinSession,messages:aw.messages}),_&&(0,e.jsx)(x.A,{sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoad:a7,onDelete:aw.deleteSession,onRename:aw.renameSession,onTogglePin:aw.togglePinSession,onClearAll:aw.clearAllSessions,onClose:()=>aa(!1),onNewChat:a2}),!_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col",children:[!P&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:S.ask.suggestions,onSuggestionClick:W,labels:a9}),P&&(aw.messages.length>0||J)&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:J&&0===aw.messages.length?S.ask.suggestions:[],onSuggestionClick:W,labels:a9})]}),null!==aC.mentionQuery&&aC.mentionResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(v.A,{results:aC.mentionResults,selectedIndex:aC.mentionIndex,query:aC.mentionQuery??void 0,onSelect:aZ})}),null!==aD.slashQuery&&aD.slashResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(w.A,{results:aD.slashResults,selectedIndex:aD.slashIndex,query:aD.slashQuery??void 0,onSelect:a$})}),(0,e.jsx)("div",{className:(0,E.cn)("shrink-0",P?"px-2 pb-2 pt-0.5":"px-3 pb-2.5 pt-1"),children:(0,e.jsxs)("div",{className:(0,E.cn)("rounded-xl bg-muted/40 transition-all focus-within:bg-muted/60",ab&&"ring-2 ring-[var(--amber)] bg-[var(--amber-dim)]"),onDragOver:a3,onDragLeave:a4,onDrop:a5,children:[(Y.length>0||az.localAttachments.length>0||aB.images.length>0||aj||am||az.uploadError||aB.imageError)&&(0,e.jsxs)("div",{className:(0,E.cn)("px-3 pt-2.5 pb-1",O?"max-h-24 overflow-y-auto":"max-h-28 overflow-y-auto"),children:[(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[Y.map(a=>(0,e.jsx)(z.A,{path:a,variant:"kb",onRemove:()=>Z(b=>b.filter(b=>b!==a))},a)),az.localAttachments.map((a,b)=>(0,e.jsx)(z.A,{path:a.name,variant:"upload",status:a.status,error:a.error,truncatedInfo:a.truncatedInfo,onRemove:()=>az.removeAttachment(b)},`up-${a.name}-${b}`)),aB.images.map((a,b)=>(0,e.jsx)(z.A,{path:a.fileName||`Image ${b+1}`,variant:"image",imageData:a.data,imageMime:a.mimeType,onRemove:()=>aB.removeImage(b)},`img-${b}`)),aj&&(0,e.jsx)(z.A,{path:aj.name,variant:"skill",onRemove:()=>{ak(null),Q.current?.focus()}}),am&&(0,e.jsx)(z.A,{path:"object"==typeof am&&"name"in am?am.name:"Remote Agent",variant:"agent",onRemove:()=>{aS(null),Q.current?.focus()}})]}),aU&&(0,e.jsx)("div",{className:"mt-1 text-xs text-error",children:aU})]}),(0,e.jsxs)("form",{ref:aV,onSubmit:aQ,className:(0,E.cn)("flex items-end gap-1.5",P?"px-2 py-1.5":"px-3 py-2"),children:[(0,e.jsx)("div",{className:"relative shrink-0",children:(0,e.jsx)("button",{ref:af,type:"button",onClick:()=>ae(a=>!a),className:"p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",title:S.hints.attachFile,children:(0,e.jsx)(h.A,{size:15})})}),T&&ad&&ah&&(0,g.createPortal)((0,e.jsxs)("div",{ref:ag,className:"fixed py-1 rounded-xl border border-border/60 bg-card shadow-lg z-50 min-w-[150px] animate-in fade-in-0 slide-in-from-bottom-2 duration-150",style:{top:`${ah.top}px`,left:`${ah.left}px`,transform:"translateY(-100%)"},onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{az.uploadInputRef.current?.click(),ae(!1)},children:[(0,e.jsx)(i.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachFileLabel]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{R.current?.click(),ae(!1)},children:[(0,e.jsx)(j.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachImageLabel]})]}),document.body),(0,e.jsx)("input",{ref:az.uploadInputRef,type:"file",className:"hidden",multiple:!0,accept:".txt,.md,.markdown,.csv,.json,.yaml,.yml,.xml,.html,.htm,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf",onChange:async a=>{let b=a.currentTarget;await az.pickFiles(b.files),b.value=""}}),(0,e.jsx)("input",{ref:R,type:"file",className:"hidden",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp",onChange:async a=>{let b=a.currentTarget;await aB.handleFileSelect(b.files),b.value=""}}),(0,e.jsx)("textarea",{ref:a=>{Q.current=a},value:V,onChange:a=>aY(a.target.value,a.target.selectionStart??void 0),onKeyDown:a1,onPaste:a6,placeholder:S.ask.placeholder,rows:1,className:(0,E.cn)("min-w-0 flex-1 resize-none overflow-y-hidden bg-transparent py-2 leading-relaxed text-foreground placeholder:text-muted-foreground/50 outline-none focus-visible:ring-0",P?"text-xs":"text-sm")}),aM?(0,e.jsx)("button",{type:"button",onClick:aR,className:"p-2 rounded-xl transition-colors shrink-0 text-foreground bg-muted hover:bg-muted/80",title:"reconnecting"===aN?S.ask.cancelReconnect:S.ask.stopTitle,children:"reconnecting"===aN?(0,e.jsx)(k.A,{size:15}):(0,e.jsx)(l.A,{size:15})}):(0,e.jsx)("button",{type:"submit",title:aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":S.ask.send,disabled:aT||!V.trim()&&0===aB.images.length,className:"p-2 rounded-xl disabled:opacity-20 disabled:scale-95 disabled:cursor-not-allowed transition-all duration-150 shrink-0 bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/15 hover:shadow-md hover:shadow-[var(--amber)]/20 active:scale-95",children:(0,e.jsx)(m.A,{size:14})})]}),(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center justify-between border-t border-border/10",O?"px-2 pb-1.5 pt-1 gap-1":"px-3 pb-2 pt-1.5"),children:[(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center flex-wrap",O?"gap-1":"gap-2"),children:[(0,e.jsx)(o.Ay,{mode:aq,onChange:ar,disabled:aM}),T&&(0,e.jsx)(A.A,{selectedAgent:am,onSelect:aS,installedAgents:aE.installedAgents,loading:aE.loading}),T&&(0,e.jsx)(B.A,{providerValue:as,onProviderChange:ba,modelValue:au,onModelChange:av,disabled:aM})]}),!O&&!P&&(0,e.jsxs)("span",{className:"hidden md:inline text-2xs text-muted-foreground/40 select-none shrink-0",children:[(0,e.jsx)("kbd",{className:"font-mono",children:"Enter"})," ",S.ask.send," \xb7 ",(0,e.jsx)("kbd",{className:"font-mono",children:"Shift+Enter"})," ",S.ask.newlineHint]})]})]})})]})]})}B=(G.then?(await G)():G)[0],new WeakMap,d()}catch(a){d(a)}})},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"var(--tool-read)",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"var(--tool-search)",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[a.agentName&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.62rem",fontWeight:500,padding:"1px 6px",borderRadius:999,background:"var(--muted)",color:"var(--muted-foreground)",whiteSpace:"nowrap",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis"},title:a.agentName,children:a.agentName.length>30?a.agentName.slice(0,30)+"...":a.agentName}),"ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),a.agentName&&(0,d.jsxs)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.68rem",color:"var(--muted-foreground)"},children:["Agent: ",(0,d.jsx)("span",{style:{color:"var(--foreground)",fontWeight:500},children:a.agentName})]}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is 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/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is 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/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is 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/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is 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/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is 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/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is 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/app/components/ui/tooltip.tsx","TooltipProvider")},69593:(a,b,c)=>{"use strict";c.d(b,{Oo:()=>e,dB:()=>k});var d=c(67484);function e(a){let b=a.replace(/<(thinking|reasoning|scratchpad)>[\s\S]*?<\/\1>/gi,"");return(b=b.replace(/<(?:thinking|reasoning|scratchpad)>[\s\S]*$/gi,"")).trim()}let f=new Set(["create_file","write_file","batch_create_files","append_to_file","insert_after_heading","update_section","edit_lines","delete_file","rename_file","move_file","append_csv"]),g=new Set(["read_file","read_lines","search","list_files"]);function h(a,b){return b&&"object"==typeof b?"string"==typeof b.path?b.path:"string"==typeof b.from_path?b.from_path:"batch_create_files"===a&&Array.isArray(b.files)?b.files.map(a=>a.path??"").filter(Boolean).join(", "):"":""}async function i(a){try{let b=await fetch(`/api/file?path=${encodeURIComponent(a)}&op=read_file`);if(!b.ok)return"";return(await b.json()).content??""}catch{return""}}async function j(a,b,c,d){let j=a.getReader(),k=new TextDecoder,l="",m=[],n=new Map,o="",p=0,q=new Set;try{for(;!d?.aborted;){let{done:a,value:d}=await j.read();if(a)break;let u=(l+=k.decode(d,{stream:!0})).split("\n");for(let a of(l=u.pop()??"",u)){let d,j=a.trim();if(!j.startsWith("data:"))continue;let k=j.slice(5).trim();if(!k)continue;try{d=JSON.parse(k)}catch{continue}let l=d.type;switch(l){case"tool_start":{var r,s,t;let a=d.toolName,e=d.toolCallId,j=d.args;p++;let k=(r=l,s=a,t=j,"text_delta"===r?{stage:"analyzing"}:"tool_start"===r&&s?f.has(s)?{stage:"writing",detail:h(s,t)||void 0}:g.has(s)?{stage:"reading",detail:t&&"object"==typeof t&&"path"in t&&"string"==typeof t.path?t.path:void 0}:{stage:"analyzing"}:null);if(k&&b({stageHint:k}),f.has(a)){let d=h(a,j),f="update";"create_file"===a||"batch_create_files"===a?f="create":("delete_file"===a||"rename_file"===a||"move_file"===a)&&(f="unknown"),"update"===f&&d&&!q.has(d)&&(q.add(d),i(d).then(a=>{a&&c(d,a)})),n.set(e,{name:a,path:d,action:f}),b({currentTool:{name:a,path:d}})}break}case"tool_end":{let a=d.toolCallId,c=!!d.isError,e=n.get(a);if(e){if("batch_create_files"===e.name)for(let b of e.path.split(", ").filter(Boolean))m.push({action:e.action,path:b,toolCallId:a,ok:!c});else m.push({action:e.action,path:e.path,toolCallId:a,ok:!c});n.delete(a),b({changes:[...m],currentTool:null})}break}case"text_delta":o+=d.delta??"",b({stageHint:{stage:"analyzing"},summary:e(o)});break;case"error":throw Error(d.message||"AI organize failed")}}}}finally{j.releaseLock()}return{changes:m,summary:e(o),toolCallCount:p}}function k(){let[a,b]=(0,d.useState)("idle"),[c,e]=(0,d.useState)([]),[f,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(null),[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(null),[o,p]=(0,d.useState)(0),q=(0,d.useRef)(null),r=(0,d.useRef)(0),s=(0,d.useRef)(new Map),[t,u]=(0,d.useState)([]),[v,w]=(0,d.useState)("upload"),x=(0,d.useRef)(0),[y,z]=(0,d.useState)(0),A=(0,d.useCallback)(async(a,c,d="upload")=>{b("organizing"),e([]),g(null),i({stage:"connecting"}),l(""),n(null),p(0),u(a.map(a=>a.name)),w(d),x.current=Date.now(),z(0),s.current=new Map,r.current=Date.now();let f=new AbortController;q.current=f;let h=a.map(a=>({name:a.name,content:a.content.length>2e4?a.content.slice(0,2e4)+"\n\n[...truncated to first ~20000 chars]":a.content}));try{let a=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:c}],uploadedFiles:h,maxSteps:15,mode:"organize"}),signal:f.signal});if(!a.ok){let b=`Request failed (${a.status})`;try{let c=await a.json();"string"==typeof c?.error?b=c.error:"object"==typeof c?.error&&c.error?.message?b=c.error.message:c?.message&&(b=c.message)}catch{}throw Error(b)}if(!a.body)throw Error("No response body");let d=await j(a.body,a=>{r.current=Date.now(),a.changes&&e(a.changes),void 0!==a.currentTool&&g(a.currentTool),a.stageHint&&i(a.stageHint),void 0!==a.summary&&l(a.summary)},(a,b)=>{s.current.set(a,b)},f.signal);e(d.changes),l(d.summary),p(d.toolCallCount),g(null),z(Date.now()-x.current),b("done")}catch(a){"AbortError"===a.name?b("idle"):(n(a.message),b("error"))}finally{q.current=null}},[]),B=(0,d.useCallback)(()=>{q.current?.abort()},[]),C=(0,d.useCallback)(async a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);if(!b)return!1;try{if("create"===b.action){if(!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:b.path})})).ok)return!1}else{if("update"!==b.action)return!1;let c=s.current.get(a);if(!c||!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:b.path,content:c})})).ok)return!1}return e(b=>b.map(b=>b.path===a&&b.ok&&!b.undone?{...b,undone:!0}:b)),!0}catch{return!1}},[c]),D=(0,d.useCallback)(async()=>{let a=c.filter(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),b=0;for(let c of a)try{if("create"===c.action)(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:c.path})})).ok&&b++;else if("update"===c.action){let a=s.current.get(c.path);a&&(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:c.path,content:a})})).ok&&b++}}catch{}return b>0&&e(a=>a.map(a=>!a.ok||a.undone?a:"create"===a.action||"update"===a.action&&s.current.has(a.path)?{...a,undone:!0}:a)),b},[c]),E=(0,d.useCallback)(a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);return!!b&&("create"===b.action||"update"===b.action&&s.current.has(a))},[c]),F=c.some(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),G=(0,d.useCallback)(()=>{b("idle"),e([]),g(null),i(null),l(""),n(null),p(0),u([]),w("upload"),z(0),x.current=0,s.current=new Map,r.current=0},[]);return{phase:a,changes:c,currentTool:f,stageHint:h,summary:k,error:m,toolCallCount:o,sourceFileNames:t,source:v,durationMs:y,snapshots:s,start:A,abort:B,undoOne:C,undoAll:D,canUndo:E,hasAnyUndoable:F,reset:G}}},70137:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let{t:a}=(0,g.Y)(),b=a.settings.update.updateToast,[c,h]=(0,e.useState)("hidden"),[i,j]=(0,e.useState)({});(0,e.useRef)(null);let[k,l]=(0,e.useState)(!1),m=(0,e.useRef)(new Set);(0,e.useRef)({});let n=(0,e.useCallback)(()=>{m.current.forEach(clearTimeout),m.current.clear()},[]),o=(0,e.useCallback)((a,b)=>{let c=setTimeout(()=>{m.current.delete(c),h(a)},b);m.current.add(c)},[]),p=(0,e.useCallback)(()=>{n(),window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"update"}})),h("dismissing"),o("hidden",200)},[n,o]),q=(0,e.useCallback)(()=>{n(),i.desktop&&localStorage.setItem("mindos_update_skip_desktop",i.desktop.version),i.core&&localStorage.setItem("mindos_update_skip_core",i.core.version),h("dismissing"),o("hidden",200)},[i,n,o]);if(!k||"hidden"===c)return null;let r=!!(i.desktop&&i.core),s=r?b.titleMultiple:i.desktop?b.titleSingle(b.desktopLabel,i.desktop.version):i.core?b.titleSingle(b.coreLabel,i.core.version):"",t=r?`${b.desktopLabel} v${i.desktop.version} \u00B7 ${b.coreLabel} v${i.core.version}`:"";return(0,d.jsx)("div",{role:"status","aria-live":"polite",className:`
130
157
  fixed bottom-14 right-4 z-40 pointer-events-none
131
158
  transition-all duration-200
132
159
  ${"visible"===c?"opacity-100 translate-y-0":"opacity-0 translate-y-2"}
133
160
  `,children:(0,d.jsxs)("div",{className:"pointer-events-auto flex flex-col gap-2.5 bg-card border border-border rounded-xl shadow-lg px-4 py-3 w-[290px]",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"mt-[5px] w-2 h-2 rounded-full bg-[var(--amber)] shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium text-foreground leading-snug",children:s}),t&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:t})]}),(0,d.jsx)("button",{type:"button",onClick:q,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":"Dismiss",children:(0,d.jsx)(f.A,{size:13})})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:p,className:"flex-1 px-3 py-1.5 text-xs font-medium rounded-lg text-[var(--amber-foreground)] bg-[var(--amber)] hover:opacity-90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:b.viewDetails}),(0,d.jsx)("button",{type:"button",onClick:q,className:"flex-1 px-3 py-1.5 text-xs rounded-lg text-muted-foreground border border-border hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r?b.skipAll:b.skipVersion})]})]})})}},70567:(a,b,c)=>{Promise.resolve().then(c.bind(c,55038))},72362:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>j});var d=c(48249),e=c(67484),f=c(40560),g=c(42742),h=c(46674),i=c(24520);function j({content:a,saveAction:b}){let c=(0,e.useMemo)(()=>{try{return JSON.parse(a)}catch{return null}},[a]),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)({}),t=j??{},u=t.uiSchema?.sections??[],v=t.keySpecs??{},w=(0,e.useCallback)(async a=>{m(!0),o(!1),q("");try{await b(`${JSON.stringify(a,null,2)}
134
- `),o(!0),setTimeout(()=>o(!1),1200)}catch(a){q(a instanceof Error?a.message:"Failed to save")}finally{m(!1)}},[b]),x=(0,e.useCallback)(async(a,b)=>{if(!j)return;let c=function(a,b,c){let d=b.split("."),e=structuredClone(a),f=e;for(let a=0;a<d.length-1;a++){let b=d[a],c=f[b];(!c||"object"!=typeof c||Array.isArray(c))&&(f[b]={}),f=f[b]}return f[d[d.length-1]]=c,e}(j,a,b);k(c),await w(c)},[j,w]);return c&&j?(0,d.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,d.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[l&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,d.jsx)(f.A,{size:12,className:"animate-spin"}),"Saving"]}),!l&&n&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,d.jsx)(g.A,{size:12}),"Saved"]})]})]}),p&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:p}),u.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),(0,d.jsx)("div",{className:"space-y-3",children:a.fields.map(a=>{let b=v[a]??{},c=function(a,b){let c=b.split("."),d=a;for(let a of c){if(!d||"object"!=typeof d||!(a in d))return null;d=d[a]}return d}(j,a),e=b.label||a;return(0,d.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:e}),b.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]}),"switch"===b.control&&"boolean"==typeof c&&(0,d.jsx)("button",{type:"button",onClick:()=>x(a,!c),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:c?"var(--amber)":"var(--muted)",color:c?"var(--amber-foreground)":"var(--muted-foreground)"},children:c?"ON":"OFF"})]}),"text"===b.control&&"string"==typeof c&&(0,d.jsx)("input",{defaultValue:c,onBlur:b=>x(a,b.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===b.control&&"number"==typeof c&&(0,d.jsx)("input",{type:"number",defaultValue:c,min:b.constraints?.min,max:b.constraints?.max,onBlur:d=>{let e=Number(d.target.value),f=b.constraints?.min,g=b.constraints?.max,h=Number.isFinite(e)?e:c;"number"==typeof f&&h<f&&(h=f),"number"==typeof g&&h>g&&(h=g),x(a,h)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===b.control&&Array.isArray(c)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.map((b,e)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(b),(0,d.jsx)("button",{type:"button",onClick:()=>x(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{size:11})})]},`${String(b)}-${e}`))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:r[a]??"",onChange:b=>s(c=>({...c,[a]:b.target.value})),onKeyDown:b=>{if("Enter"!==b.key)return;b.preventDefault();let d=(r[a]??"").trim();d&&(x(a,[...c,d]),s(b=>({...b,[a]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,d.jsxs)("button",{type:"button",onClick:()=>{let b=(r[a]??"").trim();b&&(x(a,[...c,b]),s(b=>({...b,[a]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:12})," Add"]})]})]})]},a)})})]},a.id))]}):(0,d.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},73778:(a,b,c)=>{"use strict";c.d(b,{A:()=>m});var d=c(48249),e=c(2116),f=c.n(e),g=c(67484),h=c(19099),i=c(96286),j=c(46674),k=c(95054),l=c(47223);function m(){let[a,b]=(0,g.useState)(0),[c,e]=(0,g.useState)(null),[m,n]=(0,g.useState)(!1);(0,g.useRef)(0);let[o,p]=(0,g.useState)(!1),[q,r]=(0,g.useState)(!1),s=(0,h.usePathname)(),{t}=(0,l.Y)();async function u(){try{await (0,k.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{b(0),e(0)}}return((0,g.useMemo)(()=>!(a<=0||s?.startsWith("/changes")||s?.startsWith("/changelog"))&&(null===c||!(a<=c))&&!m,[c,s,a,m]),o)?(0,d.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${q?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,d.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,d.jsx)(i.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-xs text-foreground font-medium whitespace-nowrap",children:t.changes.unreadBanner(a)}),(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,d.jsx)(f(),{href:"/changelog",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:t.changes.reviewNow}),(0,d.jsx)("button",{type:"button",onClick:()=>void u(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:t.changes.markAllRead})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>e(a),"aria-label":t.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(j.A,{size:14})})]})})}):null}},74190:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(65255),h=c(42742),i=c(46674),j=c(44218),k=c(47223);function l({selectedAgent:a,onSelect:b,installedAgents:c,loading:l=!1}){let{t:m}=(0,k.Y)(),n=m.panels.agents,[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useCallback)(()=>{b(null),p(!1)},[b]),v=(0,e.useCallback)(a=>{b({id:a.id,name:a.name}),p(!1)},[b]),w=(0,e.useCallback)(a=>{a.stopPropagation(),b(null)},[b]),x=!a,y=a?.name??n.acpDefaultAgent;if(!l&&0===c.length&&!a)return null;let z=o&&q?(0,d.jsxs)("div",{ref:t,role:"listbox","aria-label":n.acpSelectAgent,className:"fixed z-50 min-w-[180px] max-w-[240px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:q.left,..."up"===q.direction?{bottom:window.innerHeight-q.top}:{top:q.top}},children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":x,onClick:u,className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate font-medium",children:n.acpDefaultAgent}),x&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]}),c.length>0&&(0,d.jsx)("div",{className:"mx-2 my-1 border-t border-border/60"}),c.map(b=>{let c=a?.id===b.id;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>v(b),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full bg-[var(--success)] shrink-0"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:b.name}),c&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]},b.id)})]}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>p(a=>!a),className:`
161
+ `),o(!0),setTimeout(()=>o(!1),1200)}catch(a){q(a instanceof Error?a.message:"Failed to save")}finally{m(!1)}},[b]),x=(0,e.useCallback)(async(a,b)=>{if(!j)return;let c=function(a,b,c){let d=b.split("."),e=structuredClone(a),f=e;for(let a=0;a<d.length-1;a++){let b=d[a],c=f[b];(!c||"object"!=typeof c||Array.isArray(c))&&(f[b]={}),f=f[b]}return f[d[d.length-1]]=c,e}(j,a,b);k(c),await w(c)},[j,w]);return c&&j?(0,d.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,d.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[l&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,d.jsx)(f.A,{size:12,className:"animate-spin"}),"Saving"]}),!l&&n&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,d.jsx)(g.A,{size:12}),"Saved"]})]})]}),p&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:p}),u.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),(0,d.jsx)("div",{className:"space-y-3",children:a.fields.map(a=>{let b=v[a]??{},c=function(a,b){let c=b.split("."),d=a;for(let a of c){if(!d||"object"!=typeof d||!(a in d))return null;d=d[a]}return d}(j,a),e=b.label||a;return(0,d.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:e}),b.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]}),"switch"===b.control&&"boolean"==typeof c&&(0,d.jsx)("button",{type:"button",onClick:()=>x(a,!c),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:c?"var(--amber)":"var(--muted)",color:c?"var(--amber-foreground)":"var(--muted-foreground)"},children:c?"ON":"OFF"})]}),"text"===b.control&&"string"==typeof c&&(0,d.jsx)("input",{defaultValue:c,onBlur:b=>x(a,b.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===b.control&&"number"==typeof c&&(0,d.jsx)("input",{type:"number",defaultValue:c,min:b.constraints?.min,max:b.constraints?.max,onBlur:d=>{let e=Number(d.target.value),f=b.constraints?.min,g=b.constraints?.max,h=Number.isFinite(e)?e:c;"number"==typeof f&&h<f&&(h=f),"number"==typeof g&&h>g&&(h=g),x(a,h)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===b.control&&Array.isArray(c)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.map((b,e)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(b),(0,d.jsx)("button",{type:"button",onClick:()=>x(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{size:11})})]},`${String(b)}-${e}`))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:r[a]??"",onChange:b=>s(c=>({...c,[a]:b.target.value})),onKeyDown:b=>{if("Enter"!==b.key)return;b.preventDefault();let d=(r[a]??"").trim();d&&(x(a,[...c,d]),s(b=>({...b,[a]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,d.jsxs)("button",{type:"button",onClick:()=>{let b=(r[a]??"").trim();b&&(x(a,[...c,b]),s(b=>({...b,[a]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:12})," Add"]})]})]})]},a)})})]},a.id))]}):(0,d.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},73778:(a,b,c)=>{"use strict";c.d(b,{A:()=>m});var d=c(48249),e=c(2116),f=c.n(e),g=c(67484),h=c(19099),i=c(96286),j=c(46674),k=c(95054),l=c(47223);function m(){let[a,b]=(0,g.useState)(0),[c,e]=(0,g.useState)(null),[m,n]=(0,g.useState)(!1);(0,g.useRef)(0);let[o,p]=(0,g.useState)(!1),[q,r]=(0,g.useState)(!1),s=(0,h.usePathname)(),{t}=(0,l.Y)();async function u(){try{await (0,k.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{b(0),e(0)}}return((0,g.useMemo)(()=>!(a<=0||s?.startsWith("/changes")||s?.startsWith("/changelog"))&&(null===c||!(a<=c))&&!m,[c,s,a,m]),o)?(0,d.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${q?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,d.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,d.jsx)(i.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-xs text-foreground font-medium whitespace-nowrap",children:t.changes.unreadBanner(a)}),(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,d.jsx)(f(),{href:"/changelog",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:t.changes.reviewNow}),(0,d.jsx)("button",{type:"button",onClick:()=>void u(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:t.changes.markAllRead})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>e(a),"aria-label":t.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(j.A,{size:14})})]})})}):null}},74190:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(65255),h=c(42742),i=c(46674),j=c(44218),k=c(47223);function l({selectedAgent:a,onSelect:b,installedAgents:c,loading:l=!1}){let{t:m}=(0,k.Y)(),n=m.panels?.agents??{acpDefaultAgent:"MindOS",acpSelectAgent:"Select Agent",acpChangeAgent:"Change agent"},[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useCallback)(()=>{b(null),p(!1)},[b]),v=(0,e.useCallback)(a=>{b({id:a.id,name:a.name}),p(!1)},[b]),w=(0,e.useCallback)(a=>{a.stopPropagation(),b(null)},[b]),x=!a,y=a?.name??n.acpDefaultAgent,z=o&&q?(0,d.jsxs)("div",{ref:t,role:"listbox","aria-label":n.acpSelectAgent,className:"fixed z-50 min-w-[180px] max-w-[240px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:q.left,..."up"===q.direction?{bottom:window.innerHeight-q.top}:{top:q.top}},children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":x,onClick:u,className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate font-medium",children:n.acpDefaultAgent}),x&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]}),c.length>0&&(0,d.jsx)("div",{className:"mx-2 my-1 border-t border-border/60"}),c.map(b=>{let c=a?.id===b.id;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>v(b),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full bg-[var(--success)] shrink-0"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:b.name}),c&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]},b.id)})]}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>p(a=>!a),className:`
135
162
  inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
136
163
  text-2xs font-medium transition-colors
137
164
  border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
@@ -142,24 +169,7 @@ MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if
142
169
  `,children:[(0,d.jsxs)(x(),{href:e,className:"flex flex-1 min-w-0 items-center gap-2.5 text-left rounded-xl pl-2.5 pr-2 py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(A.lx,{name:a.name,status:b,size:"sm"}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground truncate leading-tight",children:a.name}),"connected"===b&&a.transport&&(0,d.jsx)("span",{className:"text-2xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-muted/90 text-muted-foreground shrink-0 border border-border/50",children:a.transport}),h&&(0,d.jsx)("span",{title:j,className:"shrink-0 text-muted-foreground/70",children:(0,d.jsx)(i.A,{size:12})}),(0,d.jsx)("span",{className:"flex-1 min-w-[4px]"}),(0,d.jsx)(v.A,{size:15,className:`shrink-0 transition-opacity duration-150 ${c?"text-[var(--amber)] opacity-90":"text-muted-foreground/45 group-hover:text-muted-foreground/80"}`,"aria-hidden":!0})]}),"detected"===b&&(0,d.jsx)("div",{className:"pr-2 py-2 shrink-0",children:(0,d.jsx)(C,{agentKey:a.key,agentName:a.name,onInstallAgent:f,copy:g})})]})}function C({agentKey:a,agentName:b,onInstallAgent:c,copy:f}){let[g,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)("idle"),l=async b=>{if(b.stopPropagation(),g)return;i(!0),k("idle");let d=await c(a);i(!1),k(d?"success":"error")},m="error"===j,n="success"===j,o=g?f.installing:n?f.installSuccess:m?f.retryInstall:f.install;return(0,d.jsxs)("button",{type:"button",onClick:l,disabled:g,className:`flex items-center gap-1 px-2 py-1.5 text-2xs rounded-lg font-medium text-white disabled:opacity-50 transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${m?"bg-error hover:bg-error/90":n?"bg-success hover:bg-success/90":"bg-[var(--amber)] hover:bg-[var(--amber)]/90"}`,"aria-label":`${b} ${o}`,children:[g?(0,d.jsx)(h.A,{size:10,className:"animate-spin"}):null,!g&&n?(0,d.jsx)(y.A,{size:10}):null,!g&&m?(0,d.jsx)(z.A,{size:10}):null,o,(0,d.jsx)("span",{className:"sr-only","aria-live":"polite",children:m?f.installFailed:""})]})}function D({connected:a,detected:b,notFound:c,selectedAgentKey:e,onInstallAgent:f,listCopy:g,showNotDetected:h,setShowNotDetected:i,p:j}){return(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-0 py-1.5 mb-1",children:(0,d.jsx)("span",{className:"text-2xs font-semibold text-muted-foreground/70 uppercase tracking-wider",children:j.rosterLabel})}),a.length>0&&(0,d.jsxs)("section",{className:"mb-3",children:[(0,d.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--success)]/50","aria-hidden":"true"}),j.sectionConnected," ",(0,d.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",a.length,")"]})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:a.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"connected",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]}),b.length>0&&(0,d.jsxs)("section",{className:"mb-3",children:[(0,d.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--amber)]/50","aria-hidden":"true"}),j.sectionDetected," ",(0,d.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",b.length,")"]})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:b.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"detected",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]}),c.length>0&&(0,d.jsxs)("section",{children:[(0,d.jsxs)("button",{type:"button",onClick:()=>i(!h),className:"flex items-center gap-1 text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm pl-0.5",children:[h?(0,d.jsx)(u.A,{size:12}):(0,d.jsx)(v.A,{size:12}),j.sectionNotDetected," (",c.length,")"]}),h&&(0,d.jsx)("div",{className:"space-y-1.5",children:c.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"notFound",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]})]})}var E=c(2887),F=c(8455),G=c(49681),H=c(33740),I=c(34545);function J(){let{t:a}=(0,m.Y)(),b=a.panels.im,c=(0,f.useSearchParams)().get("platform"),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!0),[n,o]=(0,e.useState)(!1),p=(0,e.useCallback)(async()=>{o(!1);try{let a=await fetch("/api/im/status");if(a.ok){let b=await a.json();j(b.platforms??[])}else o(!0)}catch{o(!0)}l(!1)},[]);if(k)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})});if(n)return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 px-3",children:[(0,d.jsx)(F.A,{size:16,className:"text-muted-foreground"}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:b.fetchError}),(0,d.jsxs)("button",{type:"button",onClick:()=>{l(!0),p()},className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(g.A,{size:11})," ",b.retry]})]});let q=i.filter(a=>a.connected).length;return(0,d.jsxs)("div",{className:"flex flex-col py-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mb-0.5",children:[(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:b.title}),q>0&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[q," ",b.connected]})]}),(0,d.jsx)("div",{className:"flex flex-col",children:I.P.map(({id:a,name:b,icon:e})=>{let f=i.find(b=>b.platform===a),g=f?.connected??!1,h=c===a;return(0,d.jsxs)(x(),{href:`/agents?tab=channels&platform=${a}`,className:`
143
170
  relative flex items-center gap-2.5 px-3 py-2 text-left rounded-sm transition-colors
144
171
  ${h?"bg-[var(--amber-dim)]/40 pl-3.5":"hover:bg-muted/50"}
145
- `,children:[h&&(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}),(0,d.jsx)("span",{className:"text-sm",children:e}),(0,d.jsx)("span",{className:"text-sm flex-1 truncate text-foreground",children:b}),g?(0,d.jsx)(G.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(H.A,{size:14,className:"text-border shrink-0"})]},a)})})]})}function K({active:a,maximized:b,onMaximize:c,selectedAgentKey:o=null}){let{t:p}=(0,m.Y)(),q=p.panels.agents,r=(0,f.useRouter)(),s=(0,k.kr)(),u=(0,f.usePathname)(),v=(0,f.useSearchParams)(),w="/agents"===u&&"channels"===v.get("tab"),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),F=(0,l.V)(),G=async()=>{y(!0),await s.refresh(),y(!1)},H=s.agents.filter(a=>a.present&&a.installed),I=s.agents.filter(a=>a.present&&!a.installed),K=s.agents.filter(a=>!a.present),L=async a=>{let b=await s.installAgent(a);return b&&await s.refresh(),b},M=u?.startsWith("/agents/")?decodeURIComponent(u.slice(8)):null,N={installing:q.installing,install:q.install,installSuccess:q.installSuccess,installFailed:q.installFailed,retryInstall:q.retryInstall},O={navOverview:q.navOverview,navMcp:q.navMcp,navSkills:q.navSkills,navChannels:q.channels,navNetwork:q.navNetwork,navSessions:q.navSessions,navActivity:q.navActivity},P=(0,d.jsx)(t,{copy:O,connectedCount:H.length,mcpEnabled:s.status?.connectionMode?.mcp??!1,channelsActive:w,onChannelsClick:()=>{r.push("/agents?tab=channels")}});return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(n.A,{title:q.title,maximized:b,onMaximize:c,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[!s.loading&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:[H.length," ",q.connected,F.agents.length>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",q.a2aLabel," ",F.agents.length]})]}),(0,d.jsx)("button",{onClick:G,disabled:x,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":q.refresh,title:q.refresh,type:"button",children:(0,d.jsx)(g.A,{size:12,className:x?"animate-spin":""})})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:s.loading?(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})}):0===s.agents.length&&0===s.skills.length?(0,d.jsxs)("div",{className:"flex flex-col gap-2 py-4 px-0",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"mx-3 rounded-lg border border-border/40 bg-card/30 px-3 py-5 text-center",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:q.noAgents}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mb-3",children:q.skillsEmptyHint}),(0,d.jsxs)("button",{onClick:G,type:"button",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(g.A,{size:11})," ",q.retry]})]})]}):(0,d.jsxs)("div",{className:"pb-3",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),w?(0,d.jsx)(J,{}):(0,d.jsx)("div",{className:"px-3 py-3 space-y-4",children:(0,d.jsx)(D,{connected:H,detected:I,notFound:K,selectedAgentKey:M??o,listCopy:N,onInstallAgent:L,showNotDetected:z,setShowNotDetected:A,p:{rosterLabel:q.rosterLabel,sectionConnected:q.sectionConnected,sectionDetected:q.sectionDetected,sectionNotDetected:q.sectionNotDetected}})})]})}),(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border shrink-0 space-y-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(i.A,{size:11}),q.a2aDiscover]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"mcp"}}))},className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(j.A,{size:11}),q.advancedConfig]})]}),(0,d.jsx)(E.A,{open:B,onClose:()=>C(!1),onDiscover:F.discover,discovering:F.discovering,error:F.error})]})}},78335:()=>{},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},78890:(a,b,c)=>{"use strict";c.d(b,{G:()=>i,M:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(19794),h=c(33191);function i({icon:a,title:b,subtitle:c,badge:e,href:i,onClick:j,active:k}){let l=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:a}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-left text-sm font-medium text-foreground truncate",title:b,children:b}),c?(0,d.jsx)("span",{className:"block text-left text-2xs text-muted-foreground truncate",title:c,children:c}):null]}),e,(0,d.jsx)(g.A,{size:14,className:"shrink-0 text-muted-foreground"})]}),m=!!k,n=(0,h.cn)("relative flex items-center gap-3 py-2.5 transition-[background-color] duration-150 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"bg-[var(--amber-dim)]/40 pl-3.5 pr-4 text-foreground":"px-4",!m&&"cursor-pointer hover:bg-muted/50",m&&"cursor-default"),o=m?(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}):null;return i?(0,d.jsxs)(f(),{href:i,className:n,"aria-current":k?"page":void 0,children:[o,l]}):(0,d.jsxs)("button",{type:"button",onClick:j,className:(0,h.cn)(n,"w-full"),children:[o,l]})}function j({label:a}){return(0,d.jsx)("span",{className:"text-2xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:a})}},80829:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(46674),g=c(49681),h=c(2797),i=c(69924),j=c(9311),k=c(81285);function l({open:a,onClose:b,anchorRect:c,railWidth:l,onOpenSyncSettings:m,syncStatus:n,onSyncStatusRefresh:o}){let p=(0,e.useRef)(null);(0,e.useRef)(b).current=b;let{syncing:q,syncResult:r,syncNow:s}=(0,j.bj)(o);if(!a||!c)return null;let t=(0,j.Bq)(n,q),{label:u}=(0,j.ky)(t,n),v=Math.max(8,c.bottom-180);return(0,d.jsxs)("div",{ref:p,className:"fixed z-40 w-[240px] border rounded-lg bg-card shadow-lg border-border animate-in fade-in slide-in-from-left-2 duration-150",style:{top:v,left:l},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Sync"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,d.jsx)(f.A,{size:14})})]}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${j.BG[t]} ${"syncing"===t||"conflicts"===t||"error"===t?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:u}),"success"===r&&(0,d.jsx)(g.A,{size:14,className:"text-success shrink-0"}),"error"===r&&(0,d.jsx)(h.A,{size:14,className:"text-error shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:["off"!==t&&(0,d.jsxs)(k.jn,{onClick:s,disabled:q,className:"text-xs px-3 py-1.5 flex items-center gap-1.5",children:[(0,d.jsx)(i.A,{size:12,className:q?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{onClick:()=>{m(),b()},className:"text-xs text-muted-foreground hover:text-foreground transition-colors rounded px-1 py-0.5 focus-visible:ring-2 focus-visible:ring-ring",children:"Settings →"})]})]})]})}},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(96103),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{D0:()=>k,jn:()=>p,l6:()=>n,lM:()=>o,pd:()=>l,yA:()=>m});var d=c(48249),e=c(67484),f=c.n(e),g=c(41479),h=c(61075),i=c(44218),j=c(42742);function k({label:a,hint:b,hintError:c,children:e}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),e,b&&(0,d.jsx)("p",{className:`text-xs ${c?"text-destructive":"text-muted-foreground"}`,children:b})]})}function l({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function m({value:a,onChange:b,placeholder:c,disabled:f,className:i="",size:j="md"}){let[k,l]=(0,e.useState)(!1),m="sm"===j;return(0,d.jsxs)("div",{className:`flex items-center border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring overflow-hidden ${i}`,children:[(0,d.jsx)("input",{type:k?"text":"password",value:a,onChange:a=>b(a.target.value),placeholder:c??"••••••••",disabled:f,className:`flex-1 bg-transparent text-foreground placeholder:text-muted-foreground outline-none disabled:opacity-50 ${m?"px-2.5 py-1.5 text-xs font-mono":"px-3 py-2 text-sm"}`}),!!a&&(0,d.jsx)("button",{type:"button",tabIndex:-1,onMouseDown:a=>a.preventDefault(),onClick:()=>l(a=>!a),disabled:f,className:`shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 ${m?"p-1.5":"p-2"}`,title:k?"Hide":"Show",children:k?(0,d.jsx)(g.A,{size:m?14:16}):(0,d.jsx)(h.A,{size:m?14:16})})]})}function n({value:a,onChange:b,children:c,className:g="",disabled:h}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${g}`,children:[(0,d.jsxs)("button",{type:"button",disabled:h,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(i.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(j.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function o({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}},82110:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(95801),g=c(93096);function h({results:a,selectedIndex:b,query:c,onSelect:h}){let i=(0,e.useRef)(null),j=(0,e.useRef)(null),[k,l]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:j,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-[var(--amber)]/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Skills"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:i,className:"overflow-y-auto",style:{maxHeight:k},children:a.map((a,e)=>(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),h(a)},className:`w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(f.A,{size:13,className:"text-[var(--amber)] shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium shrink-0",children:["/",(0,d.jsx)(g.A,{text:a.name,query:c})]}),a.description&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50 truncate min-w-0 flex-1",title:a.description,children:a.description})]},a.name))}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ / Tab select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},82626:(a,b,c)=>{"use strict";c.d(b,{A:()=>r});var d=c(48249),e=c(19099),f=c(4815),g=c(46218),h=c(61075),i=c(4140),j=c(78890),k=c(67484),l=c(70971),m=c(8455),n=c(22341);c(95054);var o=c(47223);function p(){let[a,b]=(0,k.useState)(null),[c,e]=(0,k.useState)([]),[f,g]=(0,k.useState)(!0),{t:h}=(0,o.Y)();return f||!a?(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:(0,d.jsx)("div",{className:"h-2 w-20 bg-muted rounded animate-pulse"})}):(0,d.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-3 border-t border-border",children:[(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.fileCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Files"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.unreadChanges}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Changes"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.sessionCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Chats"})]})]}),c.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("div",{className:"text-xs font-medium text-muted-foreground px-0.5",children:"Recent"}),c.map(a=>{let b=function(a){try{let b=new Date(a),c=new Date().getTime()-b.getTime(),d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);if(d<1)return"now";if(d<60)return`${d}m ago`;if(e<24)return`${e}h ago`;if(f<7)return`${f}d ago`;return b.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return"recently"}}(a.ts),c=function(a){switch(a){case"create":return(0,d.jsx)(l.A,{size:12,className:"text-success"});case"write":case"append":return(0,d.jsx)(m.A,{size:12,className:"text-foreground"});case"delete":return(0,d.jsx)(m.A,{size:12,className:"text-destructive"});case"rename":case"move":return(0,d.jsx)(n.A,{size:12,className:"text-muted-foreground"});default:return(0,d.jsx)(m.A,{size:12,className:"text-muted-foreground"})}}(a.op),e=a.path.split("/").pop()||a.path;return(0,d.jsxs)("div",{className:"flex items-start gap-2 p-1.5 rounded hover:bg-muted/40 transition-colors text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 mt-0.5",children:c}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-foreground truncate font-medium",title:e,children:e}),(0,d.jsx)("p",{className:"text-muted-foreground text-2xs",children:b})]})]},a.id)})]})]})}var q=c(10072);function r({active:a,maximized:b,onMaximize:c}){let{t:k}=(0,o.Y)(),l=k.panels.echo,m=(0,e.usePathname)()??"",n={imprint:{icon:(0,d.jsx)(f.A,{size:14}),title:l.imprintTitle},growth:{icon:(0,d.jsx)(g.A,{size:14}),title:l.growthTitle},self:{icon:(0,d.jsx)(h.A,{size:14}),title:l.selfTitle}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(i.A,{title:l.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:[(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:q.RS.map(a=>{let b=n[a],c=q.AI[a],e=m===c||m.startsWith(`${c}/`);return(0,d.jsx)(j.G,{href:c,icon:b.icon,title:b.title,active:e},a)})}),(0,d.jsx)("div",{className:"mt-auto",children:(0,d.jsx)(p,{})})]})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is 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/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},84197:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(24520),i=c(40560),j=c(95801),k=c(31675),l=c(4140),m=c(47223),n=c(33191);function o({active:a,maximized:b,onMaximize:c}){let{t:f}=(0,m.Y)(),o=f.panels.workflows,[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/workflows");if(!a.ok)return;let b=await a.json();q(b.workflows??[])}catch{}finally{s(!1)}},[]),C=async()=>{let a=v.trim();if(a&&!x){y(!0),A("");try{let b=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),c=await b.json();if(!b.ok)return void A(409===b.status?o.exists:c.error||"Error");u(!1),w(""),await B(),window.location.href=`/view/${(0,n.O0)(c.path)}`}catch{A("Network error")}finally{y(!1)}}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(l.A,{title:o.title,maximized:b,onMaximize:c,children:(0,d.jsx)("button",{onClick:()=>u(a=>!a),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":o.newWorkflow,title:o.newWorkflow,children:(0,d.jsx)(h.A,{size:13})})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t&&(0,d.jsxs)("div",{className:"px-3 py-3 border-b border-border",children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o.name}),(0,d.jsx)("input",{type:"text",value:v,onChange:a=>{w(a.target.value),A("")},onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o.namePlaceholder,autoFocus:!0,className:"w-full px-2.5 py-1.5 text-sm rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),z&&(0,d.jsx)("p",{className:"text-xs text-[var(--error)] mt-1",children:z}),(0,d.jsxs)("div",{className:"flex gap-2 mt-2.5",children:[(0,d.jsx)("button",{onClick:()=>{u(!1),w(""),A("")},className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:bg-muted transition-colors",children:o.cancel}),(0,d.jsx)("button",{onClick:C,disabled:!v.trim()||x,className:"flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors disabled:opacity-50 bg-[var(--amber)] text-[var(--amber-foreground)]",children:x?o.creating:o.create})]})]}),r&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,d.jsx)(i.A,{size:16,className:"animate-spin"})}),!r&&0===p.length&&!t&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:[(0,d.jsx)(j.A,{size:24,className:"text-muted-foreground/40 mb-3"}),(0,d.jsx)("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:o.empty}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-4 max-w-[200px]",children:o.emptyDesc}),(0,d.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:[(0,d.jsx)(h.A,{size:12}),o.newWorkflow]})]}),!r&&p.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:p.map(a=>(0,d.jsxs)(g(),{href:`/view/${(0,n.O0)(a.path)}`,className:`flex items-start gap-2.5 px-3 py-2 mx-1 rounded-lg transition-colors hover:bg-muted ${a.error?"opacity-70":""}`,children:[(0,d.jsx)(j.A,{size:14,className:"shrink-0 mt-0.5 text-[var(--amber)]"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:a.title}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[a.error?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-[var(--error)]",children:[(0,d.jsx)(k.A,{size:10}),o.parseError]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:o.nSteps(a.stepCount)}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/60",suppressHydrationWarning:!0,children:(0,n.KW)(a.mtime,f.home?.relativeTime)})]})]})]},a.path))})]})]})}},84276:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14 animate-pulse","aria-busy":"true","aria-label":"Loading",children:[(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,d.jsx)("div",{className:"w-1 h-7 rounded-full bg-muted"}),(0,d.jsx)("div",{className:"h-6 w-28 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-4 w-64 bg-muted rounded ml-4 mb-6"}),(0,d.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 ml-4",children:[(0,d.jsx)("div",{className:"flex-1 h-12 rounded-xl bg-muted"}),(0,d.jsx)("div",{className:"h-12 w-16 rounded-xl bg-muted shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-4 ml-4",children:[(0,d.jsx)("div",{className:"h-9 w-28 rounded-lg bg-muted"}),(0,d.jsx)("div",{className:"h-9 w-40 rounded-lg bg-muted"})]})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-16 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-start gap-3 px-3.5 py-3 rounded-xl border border-border",children:[(0,d.jsx)("div",{className:"w-5 h-5 rounded bg-muted shrink-0 mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,d.jsx)("div",{className:"h-4 w-20 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-full bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded"})]})]},b))})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((a,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:Array.from({length:2}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded bg-muted shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,d.jsx)("div",{className:"h-4 w-40 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded shrink-0"})]},b))})]},b))})]})]})}},84668:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(31417),g=c(21245);let h="mindos_walkthrough_done";function i(a,b){if(a>=g.g.length||b)try{localStorage.setItem(h,"1")}catch{}fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{walkthroughStep:a,walkthroughDismissed:b}})}).catch(a=>{console.warn("[walkthrough-store] persist failed:",a)})}let j=(0,f.v)((a,b)=>{let c=g.g.length;return{status:"idle",currentStep:0,totalSteps:c,start:()=>{a({currentStep:0,status:"active"}),i(0,!1)},next:()=>{let d=b().currentStep+1;d>=c?(a({status:"completed"}),i(c,!1)):(a({currentStep:d}),i(d,!1))},back:()=>{let c=b().currentStep;c>0&&(a({currentStep:c-1}),i(c-1,!1))},skip:()=>{a({status:"dismissed"}),i(b().currentStep,!0)},_init:()=>{let b="1"===new URLSearchParams(window.location.search).get("welcome");if(b){let a=new URL(window.location.href);a.searchParams.delete("welcome"),window.history.replaceState({},"",a.pathname+(a.search||"")),window.dispatchEvent(new Event("mindos:first-visit"))}return window.innerWidth<768||function(){try{return"1"===localStorage.getItem(h)}catch{return!1}}()?()=>{}:(fetch("/api/setup").then(a=>a.json()).then(d=>{let e=d.guideState;if(e){if(e.walkthroughDismissed||"number"==typeof e.walkthroughStep&&e.walkthroughStep>=c){try{localStorage.setItem(h,"1")}catch{}return}e.active&&!e.dismissed&&void 0===e.walkthroughStep?b&&a({status:"active",currentStep:0}):"number"==typeof e.walkthroughStep&&e.walkthroughStep>=0&&e.walkthroughStep<c&&!e.walkthroughDismissed&&a({status:"active",currentStep:e.walkthroughStep})}}).catch(a=>{console.warn("[walkthrough-store] guideState read failed:",a)}),()=>{})}}});var k=c(47223);function l({stepIndex:a,rect:b,position:c}){let f,g,h=j(),{t:i}=(0,k.Y)(),[l,m]=(0,e.useState)({width:1024,height:768});if(!h)return null;let n=i.walkthrough.steps[a];if(!n)return null;"right"===c?(f=b.top+b.height/2,g=b.right+12):(f=b.bottom+12,g=b.left+b.width/2);let o=l.width-320,p=l.height-200;return g=Math.min(g,o),f=Math.max(f=Math.min(f,p),8),(0,d.jsxs)("div",{className:`fixed z-[102] w-[280px] rounded-xl border shadow-lg animate-in fade-in duration-200 ${"right"===c?"slide-in-from-left-2":"slide-in-from-top-2"}`,style:{top:`${f}px`,left:`${g}px`,transform:"right"===c?"translateY(-50%)":"translateX(-50%)",background:"var(--card)",borderColor:"var(--amber)"},children:[(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:i.walkthrough.step(a+1,h.totalSteps)})}),(0,d.jsx)("h3",{className:"text-sm font-semibold mb-1",style:{color:"var(--foreground)"},children:n.title}),(0,d.jsx)("p",{className:"text-xs leading-relaxed",style:{color:"var(--muted-foreground)"},children:n.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3",style:{borderTop:"1px solid var(--border)"},children:[(0,d.jsx)("button",{onClick:h.skip,className:"text-xs transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:i.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a>0&&(0,d.jsx)("button",{onClick:h.back,className:"text-xs px-2.5 py-1 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:i.walkthrough.back}),(0,d.jsx)("button",{onClick:h.next,className:"text-xs px-3 py-1.5 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a===h.totalSteps-1?i.walkthrough.done:i.walkthrough.next})]})]})]}),(0,d.jsx)("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:Array.from({length:h.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-all duration-200",style:{background:c===a?"var(--amber)":"var(--border)",transform:c===a?"scale(1.3)":void 0}},c))})]})}function m(){let a=j(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!1),i=(0,e.useId)(),k=a?g.g[a.currentStep]:null;return((0,e.useCallback)(()=>{if(!k)return;let a=document.querySelector(`[data-walkthrough="${k.anchor}"]`);a?c(a.getBoundingClientRect()):c(null)},[k]),a?.skip,a?.currentStep,a&&k)?f?(0,d.jsx)(n,{}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"fixed inset-0 z-[100] pointer-events-auto",width:"100%",height:"100%",onClick:c=>{if(b){let d=c.clientX,e=c.clientY;d>=b.left-6&&d<=b.right+6&&e>=b.top-6&&e<=b.bottom+6||a.skip()}else a.skip()},children:[(0,d.jsx)("defs",{children:(0,d.jsxs)("mask",{id:i,children:[(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),b&&(0,d.jsx)("rect",{x:b.left-6,y:b.top-6,width:b.width+12,height:b.height+12,rx:8,ry:8,fill:"black"})]})}),(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0, 0, 0, 0.5)",mask:`url(#${i})`})]}),b&&(0,d.jsx)(l,{stepIndex:a.currentStep,rect:b,position:k.position}),!b&&(0,d.jsx)("div",{className:"fixed inset-0 z-[101] flex items-center justify-center pointer-events-none",children:(0,d.jsx)("button",{onClick:a.skip,className:"pointer-events-auto px-4 py-2 text-sm rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?"✓":"→"})})]}):null}function n(){let a=j(),{t:b}=(0,k.Y)();if(!a)return null;let c=b.walkthrough.steps[a.currentStep];return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-sm",onClick:a.skip}),(0,d.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[101] rounded-t-2xl border-t shadow-lg p-5 pb-8 animate-in slide-in-from-bottom duration-300",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:b.walkthrough.step(a.currentStep+1,a.totalSteps)}),(0,d.jsx)("div",{className:"flex items-center gap-1 ml-auto",children:Array.from({length:a.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:c===a.currentStep?"var(--amber)":"var(--border)"}},c))})]}),(0,d.jsx)("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--foreground)"},children:c.title}),(0,d.jsx)("p",{className:"text-sm leading-relaxed mb-5",style:{color:"var(--muted-foreground)"},children:c.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("button",{onClick:a.skip,className:"text-sm transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:b.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.currentStep>0&&(0,d.jsx)("button",{onClick:a.back,className:"text-sm px-3 py-2 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:b.walkthrough.back}),(0,d.jsx)("button",{onClick:a.next,className:"text-sm px-4 py-2 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?b.walkthrough.done:b.walkthrough.next})]})]})]})]}):null}function o(){return"active"===j(a=>a.status)?(0,d.jsx)(m,{}):null}},84981:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>ad,Fo:()=>K,gL:()=>L});var d=c(48249),e=c(67484),f=c(19099),g=c(93491),h=c(33191),i=c(83654),j=c(80600),k=c(40560),l=c(44218),m=c(28330),n=c(86718),o=c(7309),p=c(65032),q=c(24703),r=c(16944),s=c(15273),t=c(12625),u=c(59347),v=c(99829);let w=(0,v.createServerReference)("604903a2fe3cd113d3d1d05372af719553df91591b",v.callServer,void 0,v.findSourceMapURL,"createFileAction"),x=(0,v.createServerReference)("60449e8de4e2810249421acaf5fadcd3e20f2315dc",v.callServer,void 0,v.findSourceMapURL,"renameSpaceAction");var y=c(221);let z=(0,v.createServerReference)("40898088554399c1fc02a656fadc5d505bfc7da878",v.callServer,void 0,v.findSourceMapURL,"deleteSpaceAction"),A=(0,v.createServerReference)("40e87752ea69e369c50589bf51647917bdfcdb21bd",v.callServer,void 0,v.findSourceMapURL,"deleteFolderAction");var B=c(53825),C=c(17233),D=c(99101),E=c(47223),F=c(57056),G=c(29713);let H="show-hidden-files";function I(a){let b=b=>{b.key===H&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function J(){return!1}function K(a){localStorage.setItem(H,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function L(){return(0,e.useSyncExternalStore)(I,J,()=>!1)}var M=c(24520),N=c(37917),O=c(801);let P=(0,v.createServerReference)("40dc85fff8b96f85308caf916596bf8d19b0036983",v.callServer,void 0,v.findSourceMapURL,"convertToSpaceAction");var Q=c(95054);async function R(){try{let a=await (0,Q.n)("/api/settings"),b=a.ai?.provider??"",c=(a.ai?.providers??{})[b];return!!c?.apiKey}catch{return!1}}async function S(a){try{await navigator.clipboard.writeText(a)}catch{}}let T="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",U="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",V="my-1 border-t border-border/50";function W({x:a,y:b,onClose:c,menuHeight:f,children:g}){let h=(0,e.useRef)(null),i=Math.min(b,window.innerHeight-(f??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}function X({x:a,y:b,node:c,onClose:e,onRename:g,onNewFile:i,onImport:j,onDelete:k}){let l=(0,f.useRouter)(),{t:m}=(0,E.Y)(),{isPinned:n,togglePin:o}=(0,G.Z)(),p=n(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:e,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),e()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,d.jsxs)("button",{className:T,onClick:()=>{l.push(`/view/${(0,h.O0)(`${c.path}/INSTRUCTION.md`)}`),e()},children:[(0,d.jsx)(N.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),j&&(0,d.jsxs)("button",{className:T,onClick:()=>{j(c.path),e()},children:[(0,d.jsx)(O.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{o(c.path),e()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),e()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{g(),e()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{e(),k()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function Y({x:a,y:b,node:c,onClose:g,onRename:h,onNewFile:i,onDelete:j}){let k=(0,f.useRouter)(),{t:l}=(0,E.Y)(),[m,o]=(0,e.useTransition)(),{isPinned:p,togglePin:q}=(0,G.Z)(),v=p(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:g,menuHeight:220,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),g()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",l.fileTree.newFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{q(c.path),g()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${v?"fill-[var(--amber)] text-[var(--amber)]":""}`}),v?l.fileTree.removeFromFavorites:l.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,disabled:m,onClick:()=>{o(async()=>{if((await P(c.path)).success){k.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let a=c.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||c.name;R().then(b=>{b&&function(a,b,c=""){let d="u">typeof document&&"zh"===document.documentElement.lang?`初始化新建的心智空间「${a}」,路径为「${b}/」。${c?`描述:「${c}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
146
- 1. 「${b}/README.md」— 写入空间用途、结构概览、使用指南
147
- 2. 「${b}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
148
-
149
- 内容简洁实用,直接使用工具写入。`:`Initialize the new Mind Space "${a}" at "${b}/". ${c?`Description: "${c}". `:""}Both files already exist with templates — use write_file to overwrite:
150
- 1. "${b}/README.md" — write purpose, structure overview, usage guidelines
151
- 2. "${b}/INSTRUCTION.md" — write rules for AI agents operating in this space
152
-
153
- Keep content concise and actionable. Write files directly using tools.`;window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spaceName:a,spacePath:b,description:c,state:"working"}})),fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:d}],currentFile:b+"/INSTRUCTION.md"})}).then(async a=>{if(!a.ok||!a.body)throw Error(`HTTP ${a.status}`);let c=a.body.getReader();try{for(;;){let{done:a}=await c.read();if(a)break}}finally{c.releaseLock()}window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"done"}})),window.dispatchEvent(new Event("mindos:files-changed"))}).catch(()=>{window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"error"}}))})}(a,c.path)})}g()})},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",l.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),g()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{h(),g()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",l.fileTree.rename]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{g(),j()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),l.fileTree.deleteFolder]})]})}var Z=c(63710);function $(){window.dispatchEvent(new Event("mindos:files-changed"))}async function _(a){try{await navigator.clipboard.writeText(a)}catch{}}function aa({dirPath:a,depth:b,onDone:c}){let[g,i]=(0,e.useState)(""),[j,l]=(0,e.useTransition)(),[m,n]=(0,e.useState)(""),o=(0,f.useRouter)(),{t:p}=(0,E.Y)(),q=(0,e.useRef)(null),r=(0,e.useCallback)(()=>{let b=g.trim();b?l(async()=>{let d=await w(a,b);d.success&&d.filePath?(c(),o.push(`/view/${(0,h.O0)(d.filePath)}`),o.refresh(),$()):n(d.error||p.fileTree.failed)}):n(p.fileTree.enterFileName)},[g,a,c,o,p]);return(0,d.jsxs)("div",{ref:q,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{i(a.target.value),n("")},onKeyDown:a=>{"Enter"===a.key&&r(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),j?(0,d.jsx)(k.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:r,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:p.fileTree.create})]}),m&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}function ab({node:a,depth:b,currentPath:c,onNavigate:i,maxOpenDepth:j,onImport:r}){let s=(0,f.useRouter)(),t=c.startsWith(a.path+"/")||c===a.path,u=!!a.isSpace,[v,w]=(0,e.useState)(0===b||t),[C,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(a.name),[L,M]=(0,e.useTransition)(),N=(0,e.useRef)(null),O=(0,e.useRef)(null),[P,Q]=(0,e.useState)(null),{t:R}=(0,E.Y)(),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useTransition)(),{isDragTarget:W,handleRowDragOver:_,handleRowDragEnter:ab,handleRowDragLeave:ac,handleRowDrop:ae}=function(a,b,c,d){let[f,g]=(0,e.useState)(!1),h=(0,e.useRef)(null),i=(0,e.useRef)(null),j=(0,e.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),k=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",i.current&&(clearTimeout(i.current),i.current=null),f||g(!0))},[f]),l=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),g(!0),j(),b||(h.current=setTimeout(()=>{c(!0),h.current=null},500)))},[b,j,c]);return{isDragTarget:f,handleRowDragOver:k,handleRowDragEnter:l,handleRowDragLeave:(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.stopPropagation(),i.current=setTimeout(()=>{g(!1),j(),i.current=null},50))},[j]),handleRowDrop:(0,e.useCallback)(b=>{b.preventDefault(),b.stopPropagation(),g(!1),j(),i.current&&(clearTimeout(i.current),i.current=null);let c=b.dataTransfer.files;c.length>0&&(0,Z.Nh)(Array.from(c),a.path,d)},[a.path,d,j])}}(a,v,w,R),af=(0,e.useCallback)(()=>w(a=>!a),[]);(0,e.useRef)(void 0);let ag=(0,e.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),O.current&&(clearTimeout(O.current),O.current=null),K(a.name),I(!0),setTimeout(()=>N.current?.select(),0)},[a.name]),ah=(0,e.useCallback)(()=>{let b=J.trim();b&&b!==a.name?M(async()=>{let c=u?x:y.f,d=await c(a.path,b);d.success&&d.newPath?(I(!1),s.push(`/view/${(0,h.O0)(d.newPath)}`),s.refresh(),$()):I(!1)}):I(!1)},[J,a.name,a.path,s,u]),ai=(0,e.useCallback)(()=>{H||(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{s.push(`/view/${(0,h.O0)(a.path)}`),i?.(),O.current=null},180))},[H,s,a.path,i]);(0,e.useCallback)(a=>{a.stopPropagation(),af()},[af]);let aj=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]),ak=u?function a(b){return"file"===b.type?+!g.C.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(H)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:N,autoFocus:!0,value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ah(),"Escape"===a.key&&I(!1)},onBlur:ah,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),L&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let al=u&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${W?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:aj,onDragEnter:ab,onDragOver:_,onDragLeave:ac,onDrop:ae,children:[(0,d.jsx)("button",{onClick:af,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":v?`Collapse ${a.name}`:`Expand ${a.name}`,"aria-expanded":v,children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:v?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(l.A,{size:10})})}),(0,d.jsxs)("button",{type:"button",onClick:ai,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.setData("text/mindos-type","directory"),b.dataTransfer.effectAllowed="copy"},className:`
154
- flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
155
- text-sm transition-colors duration-100
156
- hover:bg-muted cursor-default
157
- ${t?"text-foreground":"text-muted-foreground hover:text-foreground"}
158
- `,children:[u?"Inbox"===a.name?(0,d.jsx)(m.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):v?(0,d.jsx)(o.A,{size:14,className:"text-yellow-400 shrink-0"}):(0,d.jsx)(p.A,{size:14,className:"text-yellow-400 shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),u&&!v&&(0,d.jsx)("span",{className:"ml-auto text-xs text-muted-foreground shrink-0 tabular-nums pr-1",children:ak})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/dir:flex items-center gap-0.5 z-10",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${v?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsxs)("div",{className:`overflow-hidden ${al?"border-l-2 ml-[18px]":""}`,style:al?{borderColor:"color-mix(in srgb, var(--amber) 30%, transparent)"}:void 0,...!v&&{inert:!0},children:[a.children&&(0,d.jsx)(ad,{nodes:a.children,depth:al?1:b+1,onNavigate:i,maxOpenDepth:j,parentIsSpace:u,onImport:r}),C&&(0,d.jsx)(aa,{dirPath:a.path,depth:al?0:b,onDone:()=>G(!1)})]})}),P&&(u?(0,d.jsx)(X,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onImport:r,onDelete:()=>T("space")}):(0,d.jsx)(Y,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onDelete:()=>T("folder")})),(0,d.jsx)(F.TM,{open:null!==S,title:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,message:"space"===S?R.fileTree.confirmDeleteSpace(a.name):R.fileTree.confirmDeleteFolder(a.name),confirmLabel:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,cancelLabel:R.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>T(null),onConfirm:()=>{T(null),V(async()=>{let b="space"===S?await z(a.path):await A(a.path);if(b.success&&b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${R.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(s.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:R.trash?.undo??"Undo"}),s.push("/"),s.refresh(),$()}})}})]})}function ac({node:a,depth:b,currentPath:c,onNavigate:l}){let m=(0,f.useRouter)(),n=c===a.path,[o,p]=(0,e.useState)(!1),[v,w]=(0,e.useState)(a.name),[x,z]=(0,e.useTransition)(),[,A]=(0,e.useTransition)(),H=(0,e.useRef)(null),{t:I}=(0,E.Y)(),{isPinned:J,togglePin:K}=(0,G.Z)(),L=J(a.path),M=!a.path.includes("/")&&g.A.has(a.name),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),R=(0,e.useCallback)(()=>{o||(m.push(`/view/${(0,h.O0)(a.path)}`),l?.())},[m,a.path,l,o]),S=(0,e.useCallback)(b=>{b.stopPropagation(),w(a.name),p(!0),setTimeout(()=>H.current?.select(),0)},[a.name]),X=(0,e.useCallback)(()=>{let b=v.trim();b&&b!==a.name?z(async()=>{let c=await (0,y.f)(a.path,b);c.success&&c.newPath?(p(!1),m.push(`/view/${(0,h.O0)(c.newPath)}`),m.refresh(),$()):p(!1)}):p(!1)},[v,a.name,a.path,m]),Y=(0,e.useCallback)(a=>{a.stopPropagation(),O(!0)},[]),Z=(0,e.useCallback)(b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.effectAllowed="copy"},[a.path]),aa=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]);return o?(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:H,autoFocus:!0,value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&X(),"Escape"===a.key&&p(!1)},onBlur:X,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]}):(0,d.jsxs)("div",{className:"relative group/file",children:[(0,d.jsxs)("button",{onClick:R,onContextMenu:aa,draggable:!0,onDragStart:Z,"data-filepath":a.path,className:`
159
- w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
160
- text-sm transition-colors duration-100 cursor-default pr-16
161
- ${n?"bg-accent text-foreground":"hover:bg-muted text-muted-foreground hover:text-foreground"}
162
- `,style:{paddingLeft:`${12*b+8}px`},children:["directory"===a.type?null:".csv"===a.extension?(0,d.jsx)(i.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(j.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),L&&(0,d.jsx)(r.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})}),P&&(0,d.jsxs)(W,{x:P.x,y:P.y,onClose:()=>Q(null),menuHeight:140,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{_(a.path),Q(null)},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",I.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{K(a.path),Q(null)},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${L?"fill-[var(--amber)] text-[var(--amber)]":""}`}),L?I.fileTree.removeFromFavorites:I.fileTree.pinToFavorites]}),!M&&(0,d.jsxs)("button",{className:T,onClick:a=>{Q(null),S(a)},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",I.fileTree.rename]}),!M&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:a=>{Q(null),Y(a)},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"})," ",I.fileTree.delete]})]})]}),(0,d.jsx)(F.TM,{open:N,title:I.fileTree.delete,message:I.fileTree.confirmDelete(a.name),confirmLabel:I.fileTree.delete,cancelLabel:I.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>O(!1),onConfirm:()=>{O(!1),A(async()=>{let b=await (0,C.i)(a.path);if(b.success){if(b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${I.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(m.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:I.trash?.undo??"Undo"})}m.refresh(),$()}})}})]})}function ad({nodes:a,depth:b=0,onNavigate:c,maxOpenDepth:e,parentIsSpace:h,onImport:i}){var j;let k,l=(k="/view/",(j=(0,f.usePathname)()).startsWith(k)?j.slice(k.length).split("/").map(decodeURIComponent).join("/"):""),m=L(),n=0===b,o=m?a:a.filter(a=>!(n&&a.name.startsWith(".")||"file"===a.type&&g.C.has(a.name)||"directory"===a.type&&a.name.startsWith("."))),p=n?o.filter(a=>"directory"!==a.type||"Inbox"!==a.name):o;return(0,d.jsx)("div",{className:"flex flex-col gap-0.5",children:p.map(a=>"directory"===a.type?(0,d.jsx)(ab,{node:a,depth:b,currentPath:l,onNavigate:c,maxOpenDepth:e,onImport:i},a.path):(0,d.jsx)(ac,{node:a,depth:b,currentPath:l,onNavigate:c},a.path))})}},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.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/app/app/error.tsx","default")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},89119:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>P});var e=c(48249),f=c(67484),g=c(19099),h=c(2116),i=c.n(h),j=c(9915),k=c(10316),l=c(95581),m=c(46674),n=c(801),o=c(4615),p=c(97030),q=c(84981),r=c(20892),s=c(99791),t=c(74434),u=c(29820),v=c(82626),w=c(84197),x=c(61112),y=c(96716),z=c(2923),A=c(80829),B=c(23017),C=c(73778),D=c(99632),E=c(4949),F=c(9311),G=c(47223),H=c(90314),I=c(2518),J=c(84668);c(4246);var K=c(65141),L=c(13859),M=c(69593);c(99101);var N=c(63710),O=a([x,L]);[x,L]=O.then?(await O)():O;let Q=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SearchModal"]},ssr:!1}),R=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./AskModal"]},ssr:!1}),S=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SettingsModal"]},ssr:!1}),T=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./CreateSpaceModal"]},ssr:!1}),U=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./ImportModal"]},ssr:!1});function P({fileTree:a,children:b}){let c=(0,K.b)(),d=(0,L.$)(),[h,H]=(0,f.useState)(!1),[O,P]=(0,f.useState)(void 0),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(null),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(()=>y.wl),ab=(0,M.dB)(),[ac,ad]=(0,f.useState)(!1),[ae,af]=(0,f.useState)(0),ag=(0,f.useCallback)(()=>{ad(!1),"organizing"!==ab.phase||ab.abort(),ab.reset()},[ab]),ah=(0,f.useCallback)(()=>{af(a=>a+1),window.dispatchEvent(new Event("mindos:organize-history-update"))},[]),[ai,aj]=(0,f.useState)(!1),[ak,al]=(0,f.useState)(void 0),[am,an]=(0,f.useState)(void 0),[ao,ap]=(0,f.useState)(!1),aq=(0,f.useRef)(0),ar=(0,f.useCallback)(a=>{al(a),an(void 0),aj(!0)},[]),as=(0,f.useCallback)(()=>{aj(!1),al(void 0),an(void 0)},[]),[at,au]=(0,f.useState)(!1),[av,aw]=(0,f.useState)(!1),[ax,ay]=(0,f.useState)(!1),{t:az}=(0,G.Y)(),aA=(0,g.useRouter)(),aB=(0,g.usePathname)(),aC=(0,f.useMemo)(()=>(function a(b,c=""){let d=[];for(let e of b)if("directory"===e.type&&!e.name.startsWith(".")){let b=c?`${c}/${e.name}`:e.name;d.push(b),e.children&&d.push(...a(e.children,b))}return d})(a),[a]),{status:aD,fetchStatus:aE}=(0,F.dW)(),aF=aB.startsWith("/view/")?aB.slice(6).split("/").map(decodeURIComponent).join("/"):void 0,aG=(0,f.useCallback)(()=>{d.askMaximized&&d.toggleAskMaximized()},[d.askMaximized,d.toggleAskMaximized]),aH=aB?.startsWith("/agents"),aI=c.activePanel??(aH?"agents":null);(0,f.useRef)([]);let aJ=(0,f.useCallback)(()=>{let a=()=>window.dispatchEvent(new Event("guide-state-updated"));"guide"===d.askOpenSource?fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{askedAI:!0}})}).then(a).catch(a=>console.warn("Guide state update failed:",a)):"guide-next"===d.askOpenSource&&a()},[d.askOpenSource]),aK=(0,f.useCallback)(a=>{aa(a);try{localStorage.setItem("right-agent-detail-panel-width",String(a))}catch{}},[]),aL=(0,f.useCallback)(()=>$(null),[]),aM=null!==Z&&"agents"===c.activePanel,aN=(0,f.useCallback)(()=>{P("sync"),W(!1),H(!0)},[]),aO=(0,f.useCallback)(()=>{H(!0),P(void 0)},[]),aP=(0,f.useCallback)(()=>{H(!1),P(void 0)},[]),aQ=(0,f.useCallback)(a=>{Y(a),W(a=>!a)},[]),aR=(0,f.useCallback)(a=>{c.handleExpandedChange(a),W(!1)},[c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I.A,{}),(0,e.jsx)(J.A,{}),(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus-visible:not-sr-only focus-visible:fixed focus-visible:top-2 focus-visible:left-2 focus-visible:z-[60] focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:text-sm focus-visible:font-medium bg-[var(--amber)] text-[var(--amber-foreground)]",children:"Skip to main content"}),(0,e.jsx)(o.Ay,{activePanel:aI,onPanelChange:c.setActivePanel,onEchoClick:()=>{aG();let a="echo"===c.activePanel,b=aB?.startsWith("/echo");a?b?c.setActivePanel(null):aA.push("/echo/about-you"):(c.setActivePanel("echo"),aA.push("/echo/about-you"))},onAgentsClick:()=>{aG();let a="agents"===c.activePanel,b=aB?.startsWith("/agents");a?b?c.setActivePanel(null):aA.push("/agents"):(c.setActivePanel("agents"),aA.push("/agents")),$(null)},onDiscoverClick:()=>{aG();let a="discover"===c.activePanel,b=aB?.startsWith("/explore");a?b?c.setActivePanel(null):aA.push("/explore"):(c.setActivePanel("discover"),aA.push("/explore"))},onSpacesClick:()=>{aG();let a="/"===aB,b="files"===c.activePanel,d="/wiki"===aB||aB?.startsWith("/view/")||aB?.startsWith("/wiki/");a||!b?(c.setActivePanel("files"),aA.push("/wiki")):d?c.setActivePanel(null):aA.push("/wiki")},syncStatus:aD,expanded:c.railExpanded,onExpandedChange:aR,onSettingsClick:aO,onSyncClick:aQ}),(0,e.jsxs)(p.Ay,{activePanel:c.activePanel,fileTree:a,onNavigate:()=>{},onOpenSyncSettings:aN,railWidth:c.railWidth,panelWidth:c.panelWidth??void 0,onWidthChange:c.handlePanelWidthChange,onWidthCommit:c.handlePanelWidthCommit,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,onImport:ar,children:[(0,e.jsx)("div",{className:`flex flex-col h-full ${"echo"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(v.A,{active:"echo"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"search"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(s.A,{active:"search"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"agents"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(t.A,{active:"agents"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,selectedAgentKey:aM?Z:null})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"discover"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(u.A,{active:"discover"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"workflows"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(w.A,{active:"workflows"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})})]}),(0,e.jsx)(x.Ay,{open:d.askPanelOpen,onClose:d.closeAskPanel,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,width:d.askPanelWidth,onWidthChange:d.handleAskWidthChange,onWidthCommit:d.handleAskWidthCommit,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch,maximized:d.askMaximized,onMaximize:d.toggleAskMaximized,sidebarOffset:c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}),(0,e.jsx)(y.Ay,{open:aM,agentKey:Z,onClose:aL,rightOffset:d.askPanelOpen?d.askPanelWidth:0,width:_,onWidthChange:aa,onWidthCommit:aK}),(0,e.jsx)(R,{open:d.desktopAskPopupOpen,onClose:d.closeDesktopAskPopup,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch}),(0,e.jsx)(z.A,{onToggle:d.toggleAskPanel,askPanelOpen:d.askPanelOpen||d.desktopAskPopupOpen}),(0,e.jsx)(B.A,{}),(0,e.jsx)(S,{open:h,onClose:aP,initialTab:O}),(0,e.jsx)(A.A,{open:V,onClose:()=>W(!1),anchorRect:X,railWidth:c.railWidth,onOpenSyncSettings:aN,syncStatus:aD,onSyncStatusRefresh:aE}),(0,e.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 z-30 bg-card border-b border-border flex items-center justify-between px-3 py-2",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,e.jsx)("button",{onClick:()=>au(!0),className:"p-3 -ml-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":"Open menu",children:(0,e.jsx)(j.A,{size:20})}),(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"mobile"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:aN,className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent flex items-center justify-center","aria-label":"Sync status",children:(0,e.jsx)(F.jc,{status:aD})}),(0,e.jsx)("button",{onClick:()=>aw(!0),className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.searchTitle,children:(0,e.jsx)(k.A,{size:20})}),(0,e.jsx)("button",{onClick:()=>{H(!0),P(void 0)},className:"p-3 -mr-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.settingsTitle,children:(0,e.jsx)(l.A,{size:20})})]})]}),at&&(0,e.jsx)("div",{className:"md:hidden fixed inset-0 z-40 overlay-backdrop",onClick:()=>au(!1)}),(0,e.jsxs)("aside",{className:`md:hidden fixed top-0 left-0 h-screen w-[85vw] max-w-[320px] z-50 bg-card border-r border-border flex flex-col transition-transform duration-300 ease-in-out ${at?"translate-x-0":"-translate-x-full"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"drawer"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsx)("button",{onClick:()=>au(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,e.jsx)(m.A,{size:16})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",children:(0,e.jsx)(q.Ay,{nodes:a,onNavigate:()=>au(!1),onImport:ar})})]}),(0,e.jsx)(Q,{open:av,onClose:()=>aw(!1)}),(0,e.jsx)(R,{open:ax,onClose:()=>ay(!1),currentFile:aF}),(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen transition-all duration-200 pt-[52px] md:pt-0",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),aq.current++,1===aq.current&&ap(!0))},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&a.preventDefault()},onDragLeave:()=>{aq.current=Math.max(0,aq.current-1),0===aq.current&&ap(!1)},onDrop:a=>{a.preventDefault(),aq.current=0,ap(!1),a.dataTransfer.files.length>0&&!ai&&(0,N.QL)(Array.from(a.dataTransfer.files),az)},children:[(0,e.jsxs)("div",{className:"min-h-screen bg-background",style:{overflowX:"clip"},children:[(0,e.jsx)(C.A,{}),b]}),(0,e.jsx)(D.A,{}),(0,e.jsx)(T,{t:az,dirPaths:aC}),ao&&!ai&&(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm transition-opacity duration-200",children:(0,e.jsxs)("div",{className:"border-2 border-dashed border-[var(--amber)]/50 rounded-xl p-12 flex flex-col items-center gap-3",children:[(0,e.jsx)(n.A,{size:48,className:"text-[var(--amber)]/60"}),(0,e.jsx)("p",{className:"text-sm text-foreground font-medium",children:az.inbox.dropOverlay}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:az.inbox.dropOverlayFormats})]})})]}),(0,e.jsx)(U,{open:ai,onClose:as,defaultSpace:ak,initialFiles:am,aiOrganize:ab,dirPaths:aC}),ac&&(0,e.jsx)(E.A,{aiOrganize:ab,onDismiss:ag,onCancel:()=>{ab.abort(),ab.reset(),ad(!1)},onHistoryUpdate:ah}),(0,e.jsx)("style",{children:`
172
+ `,children:[h&&(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}),(0,d.jsx)("span",{className:"text-sm",children:e}),(0,d.jsx)("span",{className:"text-sm flex-1 truncate text-foreground",children:b}),g?(0,d.jsx)(G.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(H.A,{size:14,className:"text-border shrink-0"})]},a)})})]})}function K({active:a,maximized:b,onMaximize:c,selectedAgentKey:o=null}){let{t:p}=(0,m.Y)(),q=p.panels.agents,r=(0,f.useRouter)(),s=(0,k.kr)(),u=(0,f.usePathname)(),v=(0,f.useSearchParams)(),w="/agents"===u&&"channels"===v.get("tab"),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),F=(0,l.V)(),G=async()=>{y(!0),await s.refresh(),y(!1)},H=s.agents.filter(a=>a.present&&a.installed),I=s.agents.filter(a=>a.present&&!a.installed),K=s.agents.filter(a=>!a.present),L=async a=>{let b=await s.installAgent(a);return b&&await s.refresh(),b},M=u?.startsWith("/agents/")?decodeURIComponent(u.slice(8)):null,N={installing:q.installing,install:q.install,installSuccess:q.installSuccess,installFailed:q.installFailed,retryInstall:q.retryInstall},O={navOverview:q.navOverview,navMcp:q.navMcp,navSkills:q.navSkills,navChannels:q.channels,navNetwork:q.navNetwork,navSessions:q.navSessions,navActivity:q.navActivity},P=(0,d.jsx)(t,{copy:O,connectedCount:H.length,mcpEnabled:s.status?.connectionMode?.mcp??!1,channelsActive:w,onChannelsClick:()=>{r.push("/agents?tab=channels")}});return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(n.A,{title:q.title,maximized:b,onMaximize:c,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[!s.loading&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:[H.length," ",q.connected,F.agents.length>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",q.a2aLabel," ",F.agents.length]})]}),(0,d.jsx)("button",{onClick:G,disabled:x,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":q.refresh,title:q.refresh,type:"button",children:(0,d.jsx)(g.A,{size:12,className:x?"animate-spin":""})})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:s.loading?(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})}):0===s.agents.length&&0===s.skills.length?(0,d.jsxs)("div",{className:"flex flex-col gap-2 py-4 px-0",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"mx-3 rounded-lg border border-border/40 bg-card/30 px-3 py-5 text-center",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:q.noAgents}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mb-3",children:q.skillsEmptyHint}),(0,d.jsxs)("button",{onClick:G,type:"button",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(g.A,{size:11})," ",q.retry]})]})]}):(0,d.jsxs)("div",{className:"pb-3",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),w?(0,d.jsx)(J,{}):(0,d.jsx)("div",{className:"px-3 py-3 space-y-4",children:(0,d.jsx)(D,{connected:H,detected:I,notFound:K,selectedAgentKey:M??o,listCopy:N,onInstallAgent:L,showNotDetected:z,setShowNotDetected:A,p:{rosterLabel:q.rosterLabel,sectionConnected:q.sectionConnected,sectionDetected:q.sectionDetected,sectionNotDetected:q.sectionNotDetected}})})]})}),(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border shrink-0 space-y-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(i.A,{size:11}),q.a2aDiscover]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"mcp"}}))},className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(j.A,{size:11}),q.advancedConfig]})]}),(0,d.jsx)(E.A,{open:B,onClose:()=>C(!1),onDiscover:F.discover,discovering:F.discovering,error:F.error})]})}},78335:()=>{},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},78890:(a,b,c)=>{"use strict";c.d(b,{G:()=>i,M:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(19794),h=c(33191);function i({icon:a,title:b,subtitle:c,badge:e,href:i,onClick:j,active:k}){let l=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:a}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-left text-sm font-medium text-foreground truncate",title:b,children:b}),c?(0,d.jsx)("span",{className:"block text-left text-2xs text-muted-foreground truncate",title:c,children:c}):null]}),e,(0,d.jsx)(g.A,{size:14,className:"shrink-0 text-muted-foreground"})]}),m=!!k,n=(0,h.cn)("relative flex items-center gap-3 py-2.5 transition-[background-color] duration-150 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"bg-[var(--amber-dim)]/40 pl-3.5 pr-4 text-foreground":"px-4",!m&&"cursor-pointer hover:bg-muted/50",m&&"cursor-default"),o=m?(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}):null;return i?(0,d.jsxs)(f(),{href:i,className:n,"aria-current":k?"page":void 0,children:[o,l]}):(0,d.jsxs)("button",{type:"button",onClick:j,className:(0,h.cn)(n,"w-full"),children:[o,l]})}function j({label:a}){return(0,d.jsx)("span",{className:"text-2xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:a})}},79241:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("405aedd2151a7e91866f880ea819b1fa2244244d8d",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},80829:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(46674),g=c(49681),h=c(2797),i=c(69924),j=c(9311),k=c(81285);function l({open:a,onClose:b,anchorRect:c,railWidth:l,onOpenSyncSettings:m,syncStatus:n,onSyncStatusRefresh:o}){let p=(0,e.useRef)(null);(0,e.useRef)(b).current=b;let{syncing:q,syncResult:r,syncNow:s}=(0,j.bj)(o);if(!a||!c)return null;let t=(0,j.Bq)(n,q),{label:u}=(0,j.ky)(t,n),v=Math.max(8,c.bottom-180);return(0,d.jsxs)("div",{ref:p,className:"fixed z-40 w-[240px] border rounded-lg bg-card shadow-lg border-border animate-in fade-in slide-in-from-left-2 duration-150",style:{top:v,left:l},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Sync"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,d.jsx)(f.A,{size:14})})]}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${j.BG[t]} ${"syncing"===t||"conflicts"===t||"error"===t?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:u}),"success"===r&&(0,d.jsx)(g.A,{size:14,className:"text-success shrink-0"}),"error"===r&&(0,d.jsx)(h.A,{size:14,className:"text-error shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:["off"!==t&&(0,d.jsxs)(k.jn,{onClick:s,disabled:q,className:"text-xs px-3 py-1.5 flex items-center gap-1.5",children:[(0,d.jsx)(i.A,{size:12,className:q?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{onClick:()=>{m(),b()},className:"text-xs text-muted-foreground hover:text-foreground transition-colors rounded px-1 py-0.5 focus-visible:ring-2 focus-visible:ring-ring",children:"Settings →"})]})]})]})}},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(96103),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{D0:()=>k,jn:()=>p,l6:()=>n,lM:()=>o,pd:()=>l,yA:()=>m});var d=c(48249),e=c(67484),f=c.n(e),g=c(41479),h=c(61075),i=c(44218),j=c(42742);function k({label:a,hint:b,hintError:c,children:e}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),e,b&&(0,d.jsx)("p",{className:`text-xs ${c?"text-destructive":"text-muted-foreground"}`,children:b})]})}function l({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function m({value:a,onChange:b,placeholder:c,disabled:f,className:i="",size:j="md"}){let[k,l]=(0,e.useState)(!1),m="sm"===j;return(0,d.jsxs)("div",{className:`flex items-center border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring overflow-hidden ${i}`,children:[(0,d.jsx)("input",{type:k?"text":"password",value:a,onChange:a=>b(a.target.value),placeholder:c??"••••••••",disabled:f,className:`flex-1 bg-transparent text-foreground placeholder:text-muted-foreground outline-none disabled:opacity-50 ${m?"px-2.5 py-1.5 text-xs font-mono":"px-3 py-2 text-sm"}`}),!!a&&(0,d.jsx)("button",{type:"button",tabIndex:-1,onMouseDown:a=>a.preventDefault(),onClick:()=>l(a=>!a),disabled:f,className:`shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 ${m?"p-1.5":"p-2"}`,title:k?"Hide":"Show",children:k?(0,d.jsx)(g.A,{size:m?14:16}):(0,d.jsx)(h.A,{size:m?14:16})})]})}function n({value:a,onChange:b,children:c,className:g="",disabled:h}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${g}`,children:[(0,d.jsxs)("button",{type:"button",disabled:h,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(i.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(j.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function o({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}},82110:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(95801),g=c(93096);function h({results:a,selectedIndex:b,query:c,onSelect:h}){let i=(0,e.useRef)(null),j=(0,e.useRef)(null),[k,l]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:j,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-[var(--amber)]/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Skills"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:i,className:"overflow-y-auto",style:{maxHeight:k},children:a.map((a,e)=>(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),h(a)},className:`w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(f.A,{size:13,className:"text-[var(--amber)] shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium shrink-0",children:["/",(0,d.jsx)(g.A,{text:a.name,query:c})]}),a.description&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50 truncate min-w-0 flex-1",title:a.description,children:a.description})]},a.name))}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ / Tab select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},82626:(a,b,c)=>{"use strict";c.d(b,{A:()=>r});var d=c(48249),e=c(19099),f=c(4815),g=c(46218),h=c(61075),i=c(4140),j=c(78890),k=c(67484),l=c(70971),m=c(8455),n=c(22341);c(95054);var o=c(47223);function p(){let[a,b]=(0,k.useState)(null),[c,e]=(0,k.useState)([]),[f,g]=(0,k.useState)(!0),{t:h}=(0,o.Y)();return f||!a?(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:(0,d.jsx)("div",{className:"h-2 w-20 bg-muted rounded animate-pulse"})}):(0,d.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-3 border-t border-border",children:[(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.fileCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Files"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.unreadChanges}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Changes"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.sessionCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Chats"})]})]}),c.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("div",{className:"text-xs font-medium text-muted-foreground px-0.5",children:"Recent"}),c.map(a=>{let b=function(a){try{let b=new Date(a),c=new Date().getTime()-b.getTime(),d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);if(d<1)return"now";if(d<60)return`${d}m ago`;if(e<24)return`${e}h ago`;if(f<7)return`${f}d ago`;return b.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return"recently"}}(a.ts),c=function(a){switch(a){case"create":return(0,d.jsx)(l.A,{size:12,className:"text-success"});case"write":case"append":return(0,d.jsx)(m.A,{size:12,className:"text-foreground"});case"delete":return(0,d.jsx)(m.A,{size:12,className:"text-destructive"});case"rename":case"move":return(0,d.jsx)(n.A,{size:12,className:"text-muted-foreground"});default:return(0,d.jsx)(m.A,{size:12,className:"text-muted-foreground"})}}(a.op),e=a.path.split("/").pop()||a.path;return(0,d.jsxs)("div",{className:"flex items-start gap-2 p-1.5 rounded hover:bg-muted/40 transition-colors text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 mt-0.5",children:c}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-foreground truncate font-medium",title:e,children:e}),(0,d.jsx)("p",{className:"text-muted-foreground text-2xs",children:b})]})]},a.id)})]})]})}var q=c(10072);function r({active:a,maximized:b,onMaximize:c}){let{t:k}=(0,o.Y)(),l=k.panels.echo,m=(0,e.usePathname)()??"",n={imprint:{icon:(0,d.jsx)(f.A,{size:14}),title:l.imprintTitle},growth:{icon:(0,d.jsx)(g.A,{size:14}),title:l.growthTitle},self:{icon:(0,d.jsx)(h.A,{size:14}),title:l.selfTitle}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(i.A,{title:l.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:[(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:q.RS.map(a=>{let b=n[a],c=q.AI[a],e=m===c||m.startsWith(`${c}/`);return(0,d.jsx)(j.G,{href:c,icon:b.icon,title:b.title,active:e},a)})}),(0,d.jsx)("div",{className:"mt-auto",children:(0,d.jsx)(p,{})})]})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is 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/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},84197:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(24520),i=c(40560),j=c(95801),k=c(31675),l=c(4140),m=c(47223),n=c(33191);function o({active:a,maximized:b,onMaximize:c}){let{t:f}=(0,m.Y)(),o=f.panels.workflows,[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/workflows");if(!a.ok)return;let b=await a.json();q(b.workflows??[])}catch{}finally{s(!1)}},[]),C=async()=>{let a=v.trim();if(a&&!x){y(!0),A("");try{let b=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),c=await b.json();if(!b.ok)return void A(409===b.status?o.exists:c.error||"Error");u(!1),w(""),await B(),window.location.href=`/view/${(0,n.O0)(c.path)}`}catch{A("Network error")}finally{y(!1)}}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(l.A,{title:o.title,maximized:b,onMaximize:c,children:(0,d.jsx)("button",{onClick:()=>u(a=>!a),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":o.newWorkflow,title:o.newWorkflow,children:(0,d.jsx)(h.A,{size:13})})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t&&(0,d.jsxs)("div",{className:"px-3 py-3 border-b border-border",children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o.name}),(0,d.jsx)("input",{type:"text",value:v,onChange:a=>{w(a.target.value),A("")},onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o.namePlaceholder,autoFocus:!0,className:"w-full px-2.5 py-1.5 text-sm rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),z&&(0,d.jsx)("p",{className:"text-xs text-[var(--error)] mt-1",children:z}),(0,d.jsxs)("div",{className:"flex gap-2 mt-2.5",children:[(0,d.jsx)("button",{onClick:()=>{u(!1),w(""),A("")},className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:bg-muted transition-colors",children:o.cancel}),(0,d.jsx)("button",{onClick:C,disabled:!v.trim()||x,className:"flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors disabled:opacity-50 bg-[var(--amber)] text-[var(--amber-foreground)]",children:x?o.creating:o.create})]})]}),r&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,d.jsx)(i.A,{size:16,className:"animate-spin"})}),!r&&0===p.length&&!t&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:[(0,d.jsx)(j.A,{size:24,className:"text-muted-foreground/40 mb-3"}),(0,d.jsx)("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:o.empty}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-4 max-w-[200px]",children:o.emptyDesc}),(0,d.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:[(0,d.jsx)(h.A,{size:12}),o.newWorkflow]})]}),!r&&p.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:p.map(a=>(0,d.jsxs)(g(),{href:`/view/${(0,n.O0)(a.path)}`,className:`flex items-start gap-2.5 px-3 py-2 mx-1 rounded-lg transition-colors hover:bg-muted ${a.error?"opacity-70":""}`,children:[(0,d.jsx)(j.A,{size:14,className:"shrink-0 mt-0.5 text-[var(--amber)]"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:a.title}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[a.error?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-[var(--error)]",children:[(0,d.jsx)(k.A,{size:10}),o.parseError]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:o.nSteps(a.stepCount)}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/60",suppressHydrationWarning:!0,children:(0,n.KW)(a.mtime,f.home?.relativeTime)})]})]})]},a.path))})]})]})}},84276:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14 animate-pulse","aria-busy":"true","aria-label":"Loading",children:[(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,d.jsx)("div",{className:"w-1 h-7 rounded-full bg-muted"}),(0,d.jsx)("div",{className:"h-6 w-28 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-4 w-64 bg-muted rounded ml-4 mb-6"}),(0,d.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 ml-4",children:[(0,d.jsx)("div",{className:"flex-1 h-12 rounded-xl bg-muted"}),(0,d.jsx)("div",{className:"h-12 w-16 rounded-xl bg-muted shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-4 ml-4",children:[(0,d.jsx)("div",{className:"h-9 w-28 rounded-lg bg-muted"}),(0,d.jsx)("div",{className:"h-9 w-40 rounded-lg bg-muted"})]})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-16 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-start gap-3 px-3.5 py-3 rounded-xl border border-border",children:[(0,d.jsx)("div",{className:"w-5 h-5 rounded bg-muted shrink-0 mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,d.jsx)("div",{className:"h-4 w-20 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-full bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded"})]})]},b))})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((a,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:Array.from({length:2}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded bg-muted shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,d.jsx)("div",{className:"h-4 w-40 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded shrink-0"})]},b))})]},b))})]})]})}},84668:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(31417),g=c(21245);let h="mindos_walkthrough_done";function i(a,b){if(a>=g.g.length||b)try{localStorage.setItem(h,"1")}catch{}fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{walkthroughStep:a,walkthroughDismissed:b}})}).catch(a=>{console.warn("[walkthrough-store] persist failed:",a)})}let j=(0,f.v)((a,b)=>{let c=g.g.length;return{status:"idle",currentStep:0,totalSteps:c,start:()=>{a({currentStep:0,status:"active"}),i(0,!1)},next:()=>{let d=b().currentStep+1;d>=c?(a({status:"completed"}),i(c,!1)):(a({currentStep:d}),i(d,!1))},back:()=>{let c=b().currentStep;c>0&&(a({currentStep:c-1}),i(c-1,!1))},skip:()=>{a({status:"dismissed"}),i(b().currentStep,!0)},_init:()=>{let b="1"===new URLSearchParams(window.location.search).get("welcome");if(b){let a=new URL(window.location.href);a.searchParams.delete("welcome"),window.history.replaceState({},"",a.pathname+(a.search||"")),window.dispatchEvent(new Event("mindos:first-visit"))}return window.innerWidth<768||function(){try{return"1"===localStorage.getItem(h)}catch{return!1}}()?()=>{}:(fetch("/api/setup").then(a=>a.json()).then(d=>{let e=d.guideState;if(e){if(e.walkthroughDismissed||"number"==typeof e.walkthroughStep&&e.walkthroughStep>=c){try{localStorage.setItem(h,"1")}catch{}return}e.active&&!e.dismissed&&void 0===e.walkthroughStep?b&&a({status:"active",currentStep:0}):"number"==typeof e.walkthroughStep&&e.walkthroughStep>=0&&e.walkthroughStep<c&&!e.walkthroughDismissed&&a({status:"active",currentStep:e.walkthroughStep})}}).catch(a=>{console.warn("[walkthrough-store] guideState read failed:",a)}),()=>{})}}});var k=c(47223);function l({stepIndex:a,rect:b,position:c}){let f,g,h=j(),{t:i}=(0,k.Y)(),[l,m]=(0,e.useState)({width:1024,height:768});if(!h)return null;let n=i.walkthrough.steps[a];if(!n)return null;"right"===c?(f=b.top+b.height/2,g=b.right+12):(f=b.bottom+12,g=b.left+b.width/2);let o=l.width-320,p=l.height-200;return g=Math.min(g,o),f=Math.max(f=Math.min(f,p),8),(0,d.jsxs)("div",{className:`fixed z-[102] w-[280px] rounded-xl border shadow-lg animate-in fade-in duration-200 ${"right"===c?"slide-in-from-left-2":"slide-in-from-top-2"}`,style:{top:`${f}px`,left:`${g}px`,transform:"right"===c?"translateY(-50%)":"translateX(-50%)",background:"var(--card)",borderColor:"var(--amber)"},children:[(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:i.walkthrough.step(a+1,h.totalSteps)})}),(0,d.jsx)("h3",{className:"text-sm font-semibold mb-1",style:{color:"var(--foreground)"},children:n.title}),(0,d.jsx)("p",{className:"text-xs leading-relaxed",style:{color:"var(--muted-foreground)"},children:n.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3",style:{borderTop:"1px solid var(--border)"},children:[(0,d.jsx)("button",{onClick:h.skip,className:"text-xs transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:i.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a>0&&(0,d.jsx)("button",{onClick:h.back,className:"text-xs px-2.5 py-1 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:i.walkthrough.back}),(0,d.jsx)("button",{onClick:h.next,className:"text-xs px-3 py-1.5 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a===h.totalSteps-1?i.walkthrough.done:i.walkthrough.next})]})]})]}),(0,d.jsx)("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:Array.from({length:h.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-all duration-200",style:{background:c===a?"var(--amber)":"var(--border)",transform:c===a?"scale(1.3)":void 0}},c))})]})}function m(){let a=j(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!1),i=(0,e.useId)(),k=a?g.g[a.currentStep]:null;return((0,e.useCallback)(()=>{if(!k)return;let a=document.querySelector(`[data-walkthrough="${k.anchor}"]`);a?c(a.getBoundingClientRect()):c(null)},[k]),a?.skip,a?.currentStep,a&&k)?f?(0,d.jsx)(n,{}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"fixed inset-0 z-[100] pointer-events-auto",width:"100%",height:"100%",onClick:c=>{if(b){let d=c.clientX,e=c.clientY;d>=b.left-6&&d<=b.right+6&&e>=b.top-6&&e<=b.bottom+6||a.skip()}else a.skip()},children:[(0,d.jsx)("defs",{children:(0,d.jsxs)("mask",{id:i,children:[(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),b&&(0,d.jsx)("rect",{x:b.left-6,y:b.top-6,width:b.width+12,height:b.height+12,rx:8,ry:8,fill:"black"})]})}),(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0, 0, 0, 0.5)",mask:`url(#${i})`})]}),b&&(0,d.jsx)(l,{stepIndex:a.currentStep,rect:b,position:k.position}),!b&&(0,d.jsx)("div",{className:"fixed inset-0 z-[101] flex items-center justify-center pointer-events-none",children:(0,d.jsx)("button",{onClick:a.skip,className:"pointer-events-auto px-4 py-2 text-sm rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?"✓":"→"})})]}):null}function n(){let a=j(),{t:b}=(0,k.Y)();if(!a)return null;let c=b.walkthrough.steps[a.currentStep];return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-sm",onClick:a.skip}),(0,d.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[101] rounded-t-2xl border-t shadow-lg p-5 pb-8 animate-in slide-in-from-bottom duration-300",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:b.walkthrough.step(a.currentStep+1,a.totalSteps)}),(0,d.jsx)("div",{className:"flex items-center gap-1 ml-auto",children:Array.from({length:a.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:c===a.currentStep?"var(--amber)":"var(--border)"}},c))})]}),(0,d.jsx)("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--foreground)"},children:c.title}),(0,d.jsx)("p",{className:"text-sm leading-relaxed mb-5",style:{color:"var(--muted-foreground)"},children:c.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("button",{onClick:a.skip,className:"text-sm transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:b.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.currentStep>0&&(0,d.jsx)("button",{onClick:a.back,className:"text-sm px-3 py-2 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:b.walkthrough.back}),(0,d.jsx)("button",{onClick:a.next,className:"text-sm px-4 py-2 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?b.walkthrough.done:b.walkthrough.next})]})]})]})]}):null}function o(){return"active"===j(a=>a.status)?(0,d.jsx)(m,{}):null}},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.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/app/app/error.tsx","default")},85445:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("60f73022b80fe6341f846867a83401d51ae7d5be3a",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},89119:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>P});var e=c(48249),f=c(67484),g=c(19099),h=c(2116),i=c.n(h),j=c(9915),k=c(10316),l=c(95581),m=c(46674),n=c(801),o=c(4615),p=c(39139),q=c(60407),r=c(20892),s=c(99791),t=c(74434),u=c(29820),v=c(82626),w=c(84197),x=c(61112),y=c(96716),z=c(2923),A=c(80829),B=c(23017),C=c(73778),D=c(39876),E=c(4949),F=c(9311),G=c(47223),H=c(90314),I=c(2518),J=c(84668);c(4246);var K=c(65141),L=c(13859),M=c(69593);c(99101);var N=c(63710),O=a([x,L]);[x,L]=O.then?(await O)():O;let Q=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SearchModal"]},ssr:!1}),R=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./AskModal"]},ssr:!1}),S=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SettingsModal"]},ssr:!1}),T=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./CreateSpaceModal"]},ssr:!1}),U=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./ImportModal"]},ssr:!1});function P({fileTree:a,children:b}){let c=(0,K.b)(),d=(0,L.$)(),[h,H]=(0,f.useState)(!1),[O,P]=(0,f.useState)(void 0),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(null),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(()=>y.wl),ab=(0,M.dB)(),[ac,ad]=(0,f.useState)(!1),[ae,af]=(0,f.useState)(0),ag=(0,f.useCallback)(()=>{ad(!1),"organizing"!==ab.phase||ab.abort(),ab.reset()},[ab]),ah=(0,f.useCallback)(()=>{af(a=>a+1),window.dispatchEvent(new Event("mindos:organize-history-update"))},[]),[ai,aj]=(0,f.useState)(!1),[ak,al]=(0,f.useState)(void 0),[am,an]=(0,f.useState)(void 0),[ao,ap]=(0,f.useState)(!1),aq=(0,f.useRef)(0),ar=(0,f.useCallback)(a=>{al(a),an(void 0),aj(!0)},[]),as=(0,f.useCallback)(()=>{aj(!1),al(void 0),an(void 0)},[]),[at,au]=(0,f.useState)(!1),[av,aw]=(0,f.useState)(!1),[ax,ay]=(0,f.useState)(!1),{t:az}=(0,G.Y)(),aA=(0,g.useRouter)(),aB=(0,g.usePathname)(),aC=(0,f.useMemo)(()=>(function a(b,c=""){let d=[];for(let e of b)if("directory"===e.type&&!e.name.startsWith(".")){let b=c?`${c}/${e.name}`:e.name;d.push(b),e.children&&d.push(...a(e.children,b))}return d})(a),[a]),{status:aD,fetchStatus:aE}=(0,F.dW)(),aF=aB.startsWith("/view/")?aB.slice(6).split("/").map(decodeURIComponent).join("/"):void 0,aG=(0,f.useCallback)(()=>{d.askMaximized&&d.toggleAskMaximized()},[d.askMaximized,d.toggleAskMaximized]),aH=aB?.startsWith("/agents"),aI=c.activePanel??(aH?"agents":null);(0,f.useRef)([]);let aJ=(0,f.useCallback)(()=>{let a=()=>window.dispatchEvent(new Event("guide-state-updated"));"guide"===d.askOpenSource?fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{askedAI:!0}})}).then(a).catch(a=>console.warn("Guide state update failed:",a)):"guide-next"===d.askOpenSource&&a()},[d.askOpenSource]),aK=(0,f.useCallback)(a=>{aa(a);try{localStorage.setItem("right-agent-detail-panel-width",String(a))}catch{}},[]),aL=(0,f.useCallback)(()=>$(null),[]),aM=null!==Z&&"agents"===c.activePanel,aN=(0,f.useCallback)(()=>{P("sync"),W(!1),H(!0)},[]),aO=(0,f.useCallback)(()=>{H(!0),P(void 0)},[]),aP=(0,f.useCallback)(()=>{H(!1),P(void 0)},[]),aQ=(0,f.useCallback)(a=>{Y(a),W(a=>!a)},[]),aR=(0,f.useCallback)(a=>{c.handleExpandedChange(a),W(!1)},[c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I.A,{}),(0,e.jsx)(J.A,{}),(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus-visible:not-sr-only focus-visible:fixed focus-visible:top-2 focus-visible:left-2 focus-visible:z-[60] focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:text-sm focus-visible:font-medium bg-[var(--amber)] text-[var(--amber-foreground)]",children:"Skip to main content"}),(0,e.jsx)(o.Ay,{activePanel:aI,onPanelChange:c.setActivePanel,onEchoClick:()=>{aG();let a="echo"===c.activePanel,b=aB?.startsWith("/echo");a?b?c.setActivePanel(null):aA.push("/echo/about-you"):(c.setActivePanel("echo"),aA.push("/echo/about-you"))},onAgentsClick:()=>{aG();let a="agents"===c.activePanel,b=aB?.startsWith("/agents");a?b?c.setActivePanel(null):aA.push("/agents"):(c.setActivePanel("agents"),aA.push("/agents")),$(null)},onDiscoverClick:()=>{aG();let a="discover"===c.activePanel,b=aB?.startsWith("/explore");a?b?c.setActivePanel(null):aA.push("/explore"):(c.setActivePanel("discover"),aA.push("/explore"))},onSpacesClick:()=>{aG();let a="/"===aB,b="files"===c.activePanel,d="/wiki"===aB||aB?.startsWith("/view/")||aB?.startsWith("/wiki/");a||!b?(c.setActivePanel("files"),aA.push("/wiki")):d?c.setActivePanel(null):aA.push("/wiki")},syncStatus:aD,expanded:c.railExpanded,onExpandedChange:aR,onSettingsClick:aO,onSyncClick:aQ}),(0,e.jsxs)(p.Ay,{activePanel:c.activePanel,fileTree:a,onNavigate:()=>{},onOpenSyncSettings:aN,railWidth:c.railWidth,panelWidth:c.panelWidth??void 0,onWidthChange:c.handlePanelWidthChange,onWidthCommit:c.handlePanelWidthCommit,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,onImport:ar,children:[(0,e.jsx)("div",{className:`flex flex-col h-full ${"echo"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(v.A,{active:"echo"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"search"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(s.A,{active:"search"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"agents"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(t.A,{active:"agents"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,selectedAgentKey:aM?Z:null})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"discover"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(u.A,{active:"discover"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"workflows"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(w.A,{active:"workflows"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})})]}),(0,e.jsx)(x.Ay,{open:d.askPanelOpen,onClose:d.closeAskPanel,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,width:d.askPanelWidth,onWidthChange:d.handleAskWidthChange,onWidthCommit:d.handleAskWidthCommit,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch,maximized:d.askMaximized,onMaximize:d.toggleAskMaximized,sidebarOffset:c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}),(0,e.jsx)(y.Ay,{open:aM,agentKey:Z,onClose:aL,rightOffset:d.askPanelOpen?d.askPanelWidth:0,width:_,onWidthChange:aa,onWidthCommit:aK}),(0,e.jsx)(R,{open:d.desktopAskPopupOpen,onClose:d.closeDesktopAskPopup,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch}),(0,e.jsx)(z.A,{onToggle:d.toggleAskPanel,askPanelOpen:d.askPanelOpen||d.desktopAskPopupOpen}),(0,e.jsx)(B.A,{}),(0,e.jsx)(S,{open:h,onClose:aP,initialTab:O}),(0,e.jsx)(A.A,{open:V,onClose:()=>W(!1),anchorRect:X,railWidth:c.railWidth,onOpenSyncSettings:aN,syncStatus:aD,onSyncStatusRefresh:aE}),(0,e.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 z-30 bg-card border-b border-border flex items-center justify-between px-3 py-2",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,e.jsx)("button",{onClick:()=>au(!0),className:"p-3 -ml-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":"Open menu",children:(0,e.jsx)(j.A,{size:20})}),(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"mobile"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:aN,className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent flex items-center justify-center","aria-label":"Sync status",children:(0,e.jsx)(F.jc,{status:aD})}),(0,e.jsx)("button",{onClick:()=>aw(!0),className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.searchTitle,children:(0,e.jsx)(k.A,{size:20})}),(0,e.jsx)("button",{onClick:()=>{H(!0),P(void 0)},className:"p-3 -mr-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.settingsTitle,children:(0,e.jsx)(l.A,{size:20})})]})]}),at&&(0,e.jsx)("div",{className:"md:hidden fixed inset-0 z-40 overlay-backdrop",onClick:()=>au(!1)}),(0,e.jsxs)("aside",{className:`md:hidden fixed top-0 left-0 h-screen w-[85vw] max-w-[320px] z-50 bg-card border-r border-border flex flex-col transition-transform duration-300 ease-in-out ${at?"translate-x-0":"-translate-x-full"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"drawer"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsx)("button",{onClick:()=>au(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,e.jsx)(m.A,{size:16})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",children:(0,e.jsx)(q.Ay,{nodes:a,onNavigate:()=>au(!1),onImport:ar})})]}),(0,e.jsx)(Q,{open:av,onClose:()=>aw(!1)}),(0,e.jsx)(R,{open:ax,onClose:()=>ay(!1),currentFile:aF}),(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen transition-all duration-200 pt-[52px] md:pt-0",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),aq.current++,1===aq.current&&ap(!0))},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&a.preventDefault()},onDragLeave:()=>{aq.current=Math.max(0,aq.current-1),0===aq.current&&ap(!1)},onDrop:a=>{a.preventDefault(),aq.current=0,ap(!1),a.dataTransfer.files.length>0&&!ai&&(0,N.QL)(Array.from(a.dataTransfer.files),az)},children:[(0,e.jsxs)("div",{className:"min-h-screen bg-background",style:{overflowX:"clip"},children:[(0,e.jsx)(C.A,{}),b]}),(0,e.jsx)(D.A,{}),(0,e.jsx)(T,{t:az,dirPaths:aC}),ao&&!ai&&(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm transition-opacity duration-200",children:(0,e.jsxs)("div",{className:"border-2 border-dashed border-[var(--amber)]/50 rounded-xl p-12 flex flex-col items-center gap-3",children:[(0,e.jsx)(n.A,{size:48,className:"text-[var(--amber)]/60"}),(0,e.jsx)("p",{className:"text-sm text-foreground font-medium",children:az.inbox.dropOverlay}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:az.inbox.dropOverlayFormats})]})})]}),(0,e.jsx)(U,{open:ai,onClose:as,defaultSpace:ak,initialFiles:am,aiOrganize:ab,dirPaths:aC}),ac&&(0,e.jsx)(E.A,{aiOrganize:ab,onDismiss:ag,onCancel:()=>{ab.abort(),ab.reset(),ad(!1)},onHistoryUpdate:ah}),(0,e.jsx)("style",{children:`
163
173
  @media (min-width: 768px) {
164
174
  :root {
165
175
  --right-panel-width: ${d.askMaximized?`calc(100vw - ${c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}px)`:`${d.askPanelOpen?d.askPanelWidth:0}px`};
@@ -175,17 +185,7 @@ Keep content concise and actionable. Write files directly using tools.`;window.d
175
185
  hidden md:flex fixed top-0 h-screen z-[31] flex-col bg-card border-l border-border shadow-sm
176
186
  transition-transform duration-200 ease-out
177
187
  ${a?"translate-x-0":"translate-x-full pointer-events-none"}
178
- `,style:{width:`${j}px`,right:`${i}px`},role:"complementary","aria-label":q.agentDetailPanelAria,"aria-hidden":!a||!v,children:[v&&(0,d.jsx)("div",{className:"flex flex-col flex-1 min-h-0 overflow-y-auto",children:(0,d.jsx)(t,{agent:v.agent,agentStatus:v.status,mcpStatus:n,onBack:c,onInstallAgent:o,copy:A,headerVariant:"dock"})}),(0,d.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:z,children:(0,d.jsx)("div",{className:"absolute left-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity"})})]})}},97030:(a,b,c)=>{"use strict";c.d(b,{SQ:()=>D,Ld:()=>B,iP:()=>A,Ay:()=>E});var d=c(48249),e=c(67484),f=c(19099),g=c(24520),h=c(80600),i=c(86718),j=c(7817),k=c(84699),l=c(12417),m=c(24703),n=c(28330),o=c(96286),p=c(59347),q=c(41479),r=c(61075),s=c(84981),t=c(9311),u=c(4140),v=c(2548),w=c(47223),x=c(99829);x.callServer,x.findSourceMapURL;var y=c(1108);let z=()=>{},A=y.qQ,B=y.Dp.MIN,C=y.Dp.MAX_RATIO,D=y.Dp.MAX_ABS;function E({activePanel:a,fileTree:b,onNavigate:c,onOpenSyncSettings:x,railWidth:y=48,panelWidth:E,onWidthChange:F,onWidthCommit:G,maximized:H=!1,onMaximize:I,onImport:J,children:K}){let L=a?A[a]:280,M=H?void 0:E??L,{t:N}=(0,w.Y)(),O=(0,f.useRouter)(),P=(0,f.usePathname)(),Q="/view/Inbox"===P||"/view/Inbox/"===P,[R,S]=(0,e.useState)(null),T=(0,e.useMemo)(()=>(function a(b,c=0){let d=c;for(let e of b)"directory"===e.type&&(d=Math.max(d,a(e.children??[],c+1)));return d})(b),[b]),[U,V]=(0,e.useState)(!1),W=(0,e.useRef)(null),X=(0,e.useRef)(null),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(null),_=(0,e.useRef)(null),aa=(0,s.gL)(),[ab,ac]=(0,e.useState)(0),[ad,ae]=(0,e.useState)(0),[af,ag]=(0,e.useState)(!1),ah=(0,e.useCallback)(()=>{if(!af){ag(!0);try{localStorage.setItem("mindos-tree-dblclick-hint","1")}catch{}}},[af]),ai=(0,v._)({width:E??L,minWidth:B,maxWidth:D,maxWidthRatio:C,direction:"right",disabled:H,onResize:F??z,onResizeEnd:G??z});return(0,d.jsxs)("aside",{className:`
179
- hidden md:flex fixed top-0 h-screen z-30
180
- flex-col bg-card border-r border-border
181
- transition-[transform,left,width] duration-200 ease-out
182
- ${null!==a?"translate-x-0":"-translate-x-full pointer-events-none"}
183
- `,style:{width:H?`calc(100vw - ${y}px)`:`${M}px`,left:`${y}px`},role:"region","aria-label":a?`${a} panel`:void 0,children:[(0,d.jsxs)("div",{className:`flex flex-col h-full ${"files"===a?"":"hidden"}`,children:[(0,d.jsx)(u.A,{title:N.sidebar.files,children:(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:W,type:"button",onClick:()=>{Z(!1),V(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.new,title:N.sidebar.new,children:(0,d.jsx)(g.A,{size:13})}),U&&(0,d.jsxs)("div",{ref:X,className:"absolute top-full right-0 mt-1 min-w-[152px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{V(!1),O.push("/view/Untitled.md")},children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0"}),N.sidebar.newFile]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{V(!1),window.dispatchEvent(new Event("mindos:create-space"))},children:[(0,d.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),N.sidebar.newSpace]})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>J?.(),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.importFile,title:N.sidebar.importFile,children:(0,d.jsx)(j.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsx)("button",{onClick:()=>S(a=>Math.max(-1,(a??T)-1)),onDoubleClick:()=>{S(-1),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.collapseLevel,title:af?N.sidebar.collapseLevel:N.sidebar.collapseLevelHint??N.sidebar.collapseLevel,children:(0,d.jsx)(k.A,{size:13})}),(0,d.jsx)("button",{onClick:()=>S(a=>{let b=(a??0)+1;return b>T?null:b}),onDoubleClick:()=>{S(null),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.expandLevel,title:af?N.sidebar.expandLevel:N.sidebar.expandLevelHint??N.sidebar.expandLevel,children:(0,d.jsx)(l.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:$,type:"button",onClick:()=>{V(!1),Z(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.more,title:N.sidebar.more,children:(0,d.jsx)(m.A,{size:13})}),Y&&(0,d.jsxs)("div",{ref:_,className:"absolute top-full right-0 mt-1 min-w-[172px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/view/Inbox/")},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:"text-2xs font-medium tabular-nums px-1.5 py-px rounded-full bg-[var(--amber)]/10 text-[var(--amber)]/70",children:ad})]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/view/.mindos/change-log.json")},children:[(0,d.jsx)(o.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.changes.title})]}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{Z(!1),O.push("/trash")},children:[(0,d.jsx)(p.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.trash.title}),ab>0&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:ab})]}),(0,d.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,d.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{(0,s.Fo)(!aa)},children:[aa?(0,d.jsx)(q.A,{size:14,className:"shrink-0"}):(0,d.jsx)(r.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.showHiddenFiles}),aa&&(0,d.jsx)("span",{className:"text-[var(--amber)] text-xs",children:"✓"})]})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&a.stopPropagation()},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},onDrop:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},children:(0,d.jsx)(s.Ay,{nodes:b,onNavigate:c,maxOpenDepth:R,onImport:J})}),(0,d.jsxs)("button",{type:"button",onClick:()=>O.push("/view/Inbox/"),className:`flex items-center gap-2 mx-2 px-2 py-1.5 text-sm rounded-lg transition-all duration-150 group shrink-0 ${Q?"bg-[var(--amber-dim)] text-[var(--amber)]":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("div",{className:`flex items-center justify-center w-5 h-5 rounded-md shrink-0 transition-colors ${Q?"bg-[var(--amber)]/15":"bg-transparent"}`,children:(0,d.jsx)(n.A,{size:13,className:`shrink-0 transition-colors ${Q?"text-[var(--amber)]":"text-[var(--amber)]/60 group-hover:text-[var(--amber)]"}`})}),(0,d.jsx)("span",{className:`flex-1 text-left text-xs transition-colors ${Q?"font-medium text-[var(--amber)]":"text-muted-foreground group-hover:text-foreground"}`,children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:`text-2xs font-medium tabular-nums px-1.5 py-px rounded-full transition-colors ${Q?"bg-[var(--amber)]/15 text-[var(--amber)]":"bg-[var(--amber)]/10 text-[var(--amber)]/70"}`,children:ad})]}),(0,d.jsx)(t.Ay,{collapsed:!1,onOpenSyncSettings:x})]}),K,!H&&F&&(0,d.jsx)("div",{className:"absolute top-0 -right-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:ai,children:(0,d.jsx)("div",{className:"absolute right-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/60 transition-opacity"})})]})}},98610:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ot:()=>k,T_:()=>l,Ux:()=>j,bf:()=>h,jt:()=>m,rl:()=>g});var e=c(14270),f=a([e]);e=(f.then?(await f)():f)[0];let l={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"}},m=Object.keys(l);function g(a){return a in l}function h(){let a=[],b=[],c=[];for(let d of m){let e=l[d].category;"primary"===e?a.push(d):"local"===e?b.push(d):c.push(d)}return b.sort((a,b)=>l[a].name.localeCompare(l[b].name)),c.sort((a,b)=>l[a].name.localeCompare(l[b].name)),{primary:a,local:b,more:c}}function i(a){return l[a].piProviderOverride??a}let n={deepseek:"DEEPSEEK_API_KEY"};function j(a){return n[a]?n[a]:o[i(a)]}function k(a){let b=l[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}let o={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",google:"GEMINI_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",openrouter:"OPENROUTER_API_KEY",zai:"ZAI_API_KEY","zai-cn":"ZAI_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_API_KEY",huggingface:"HF_TOKEN","kimi-coding":"KIMI_API_KEY"};d()}catch(a){d(a)}})},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})},99632:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(97621),g=c(42742),h=c(6079),i=c(46674),j=c(19099),k=c(47223),l=c(33191),m=c(99829);let n=(0,m.createServerReference)("70962bcd592145a441e5a2594dd3fe58dbe73c8bfd",m.callServer,void 0,m.findSourceMapURL,"revertSpaceInitAction");function o(){let[a,b]=(0,e.useState)(null),[c,m]=(0,e.useState)(!1),[o,q]=(0,e.useTransition)(),r=(0,j.useRouter)(),{t:s}=(0,k.Y)(),t=(0,e.useCallback)(()=>{m(!1),setTimeout(()=>b(null),200)},[]);(0,e.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>m(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),r.refresh()):t()},[r,t]);let u=(0,e.useCallback)(()=>{a&&(t(),r.push(`/view/${(0,l.O0)(a.spacePath+"/")}`))},[a,t,r]),v=(0,e.useCallback)(()=>{a&&q(async()=>{await n(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),r.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(t,2e3)})},[a,r,t]),w=(0,e.useCallback)(()=>{t()},[t]);if(!a)return null;let x=s.home,{state:y}=a,z="done"===y,A="reverted"===y;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:z?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${A?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===y?"animate-pulse":""}`,children:A?(0,d.jsx)(f.A,{size:12}):z?(0,d.jsx)(g.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(h.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:A?x.aiInitReverted(a.spaceName):z?x.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[x.aiInitGenerating(a.spaceName),(0,d.jsx)(p,{})]})}),z&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:u,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:x.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:v,disabled:o,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:x.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:w,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(i.A,{size:12})})]})]})})}function p(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
184
- @keyframes dotBounce {
185
- 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
186
- 30% { opacity: 1; transform: translateY(-2px); }
187
- }
188
- `})]})}},99713:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},99791:(a,b,c)=>{"use strict";c.d(b,{A:()=>q});var d=c(48249),e=c(67484),f=c(19099),g=c(10316),h=c(46674),i=c(83654),j=c(80600),k=c(19794),l=c(33191),m=c(95054),n=c(47223),o=c(4140),p=c(95657);function q({active:a,onNavigate:b,maximized:c,onMaximize:q}){let[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(0),[z,A]=(0,e.useState)(null),B=(0,e.useRef)(null),C=(0,f.useRouter)(),D=(0,e.useRef)(null),{t:E}=(0,n.Y)(),F=(0,e.useCallback)(a=>{if(D.current&&clearTimeout(D.current),!a.trim()){u([]),w(!1);return}w(!0),D.current=setTimeout(async()=>{try{let b=await (0,m.n)(`/api/search?q=${encodeURIComponent(a)}`);u(Array.isArray(b)?b:[]),y(0)}catch{u([])}finally{w(!1)}},300)},[]),G=(0,e.useCallback)(a=>{let b=a.target.value;s(b),F(b)},[F]),H=(0,e.useCallback)(a=>{C.push(`/view/${(0,l.O0)(a.path)}`),b?.()},[C,b]),I=(0,e.useCallback)(a=>{"ArrowDown"===a.key?(a.preventDefault(),y(a=>Math.min(a+1,t.length-1))):"ArrowUp"===a.key?(a.preventDefault(),y(a=>Math.max(a-1,0))):"Enter"===a.key&&t[x]&&H(t[x])},[t,x,H]),J=(0,e.useCallback)((a,b)=>{a.dataTransfer.effectAllowed="copy",a.dataTransfer.setData("text/mindos-path",b.path),a.dataTransfer.setData("text/mindos-type","file");let c=new Image;a.dataTransfer.setDragImage(c,0,0)},[]),K=(0,e.useCallback)(()=>{A(null)},[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{title:"Search",maximized:c,onMaximize:q}),(0,d.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border shrink-0 overflow-hidden",children:[(0,d.jsx)(g.A,{size:16,className:"text-muted-foreground shrink-0 flex-none"}),(0,d.jsx)("input",{ref:B,type:"text",value:r,onChange:G,onKeyDown:I,placeholder:E.search.placeholder,"aria-label":E.search.placeholder,className:"flex-1 min-w-0 bg-transparent text-foreground text-base font-medium placeholder:text-muted-foreground/60 outline-none"}),v&&(0,d.jsx)("div",{className:"w-4 h-4 border-2 border-muted-foreground/30 border-t-foreground rounded-full animate-spin shrink-0 flex-none"}),!v&&r&&(0,d.jsx)("button",{onClick:()=>{s(""),u([]),B.current?.focus()},className:"shrink-0 flex-none p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":E.search.clear,children:(0,d.jsx)(h.A,{size:16})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",role:"listbox","aria-label":"Search results",children:[0===t.length&&!r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.emptyTitle}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.emptyHint})]}),0===t.length&&r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.noResults}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.noResultsHint})]}),v&&0===t.length&&(0,d.jsx)("div",{className:"space-y-2 p-3",children:[1,2,3].map(a=>(0,d.jsxs)("div",{className:"px-3 py-2.5 space-y-2 animate-pulse",children:[(0,d.jsx)("div",{className:"h-4 bg-muted rounded-md w-3/4"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-1/2"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-2/3"})]},a))}),t.length>0&&(0,d.jsx)(p.aY,{totalCount:t.length,overscan:100,itemContent:a=>{let b,c=t[a],e=c.path.endsWith(".csv")?".csv":".md",{name:f,breadcrumb:g}={name:(b=c.path.split("/").filter(Boolean))[b.length-1],breadcrumb:b.slice(0,-1)},h=a===x,l=a===z;return(0,d.jsxs)("button",{role:"option","aria-selected":h,draggable:!0,onDragStart:a=>J(a,c),onDragEnd:K,onDragEnter:()=>A(a),onDragLeave:()=>A(null),onClick:()=>H(c),onMouseEnter:()=>y(a),className:`
188
+ `,style:{width:`${j}px`,right:`${i}px`},role:"complementary","aria-label":q.agentDetailPanelAria,"aria-hidden":!a||!v,children:[v&&(0,d.jsx)("div",{className:"flex flex-col flex-1 min-h-0 overflow-y-auto",children:(0,d.jsx)(t,{agent:v.agent,agentStatus:v.status,mcpStatus:n,onBack:c,onInstallAgent:o,copy:A,headerVariant:"dock"})}),(0,d.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:z,children:(0,d.jsx)("div",{className:"absolute left-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity"})})]})}},98610:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ot:()=>k,T_:()=>l,Ux:()=>j,bf:()=>h,jt:()=>m,rl:()=>g});var e=c(14270),f=a([e]);e=(f.then?(await f)():f)[0];let l={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"}},m=Object.keys(l);function g(a){return a in l}function h(){let a=[],b=[],c=[];for(let d of m){let e=l[d].category;"primary"===e?a.push(d):"local"===e?b.push(d):c.push(d)}return b.sort((a,b)=>l[a].name.localeCompare(l[b].name)),c.sort((a,b)=>l[a].name.localeCompare(l[b].name)),{primary:a,local:b,more:c}}function i(a){return l[a].piProviderOverride??a}let n={deepseek:"DEEPSEEK_API_KEY"};function j(a){return n[a]?n[a]:o[i(a)]}function k(a){let b=l[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}let o={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",google:"GEMINI_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",openrouter:"OPENROUTER_API_KEY",zai:"ZAI_API_KEY","zai-cn":"ZAI_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_API_KEY",huggingface:"HF_TOKEN","kimi-coding":"KIMI_API_KEY"};d()}catch(a){d(a)}})},98840:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("40bf825815eb8b675c2f4109e77f425ad7dab8aae9",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})},99713:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},99791:(a,b,c)=>{"use strict";c.d(b,{A:()=>q});var d=c(48249),e=c(67484),f=c(19099),g=c(10316),h=c(46674),i=c(83654),j=c(80600),k=c(19794),l=c(33191),m=c(95054),n=c(47223),o=c(4140),p=c(95657);function q({active:a,onNavigate:b,maximized:c,onMaximize:q}){let[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(0),[z,A]=(0,e.useState)(null),B=(0,e.useRef)(null),C=(0,f.useRouter)(),D=(0,e.useRef)(null),{t:E}=(0,n.Y)(),F=(0,e.useCallback)(a=>{if(D.current&&clearTimeout(D.current),!a.trim()){u([]),w(!1);return}w(!0),D.current=setTimeout(async()=>{try{let b=await (0,m.n)(`/api/search?q=${encodeURIComponent(a)}`);u(Array.isArray(b)?b:[]),y(0)}catch{u([])}finally{w(!1)}},300)},[]),G=(0,e.useCallback)(a=>{let b=a.target.value;s(b),F(b)},[F]),H=(0,e.useCallback)(a=>{C.push(`/view/${(0,l.O0)(a.path)}`),b?.()},[C,b]),I=(0,e.useCallback)(a=>{"ArrowDown"===a.key?(a.preventDefault(),y(a=>Math.min(a+1,t.length-1))):"ArrowUp"===a.key?(a.preventDefault(),y(a=>Math.max(a-1,0))):"Enter"===a.key&&t[x]&&H(t[x])},[t,x,H]),J=(0,e.useCallback)((a,b)=>{a.dataTransfer.effectAllowed="copy",a.dataTransfer.setData("text/mindos-path",b.path),a.dataTransfer.setData("text/mindos-type","file");let c=new Image;a.dataTransfer.setDragImage(c,0,0)},[]),K=(0,e.useCallback)(()=>{A(null)},[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{title:"Search",maximized:c,onMaximize:q}),(0,d.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border shrink-0 overflow-hidden",children:[(0,d.jsx)(g.A,{size:16,className:"text-muted-foreground shrink-0 flex-none"}),(0,d.jsx)("input",{ref:B,type:"text",value:r,onChange:G,onKeyDown:I,placeholder:E.search.placeholder,"aria-label":E.search.placeholder,className:"flex-1 min-w-0 bg-transparent text-foreground text-base font-medium placeholder:text-muted-foreground/60 outline-none"}),v&&(0,d.jsx)("div",{className:"w-4 h-4 border-2 border-muted-foreground/30 border-t-foreground rounded-full animate-spin shrink-0 flex-none"}),!v&&r&&(0,d.jsx)("button",{onClick:()=>{s(""),u([]),B.current?.focus()},className:"shrink-0 flex-none p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":E.search.clear,children:(0,d.jsx)(h.A,{size:16})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",role:"listbox","aria-label":"Search results",children:[0===t.length&&!r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.emptyTitle}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.emptyHint})]}),0===t.length&&r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.noResults}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.noResultsHint})]}),v&&0===t.length&&(0,d.jsx)("div",{className:"space-y-2 p-3",children:[1,2,3].map(a=>(0,d.jsxs)("div",{className:"px-3 py-2.5 space-y-2 animate-pulse",children:[(0,d.jsx)("div",{className:"h-4 bg-muted rounded-md w-3/4"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-1/2"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-2/3"})]},a))}),t.length>0&&(0,d.jsx)(p.aY,{totalCount:t.length,overscan:100,itemContent:a=>{let b,c=t[a],e=c.path.endsWith(".csv")?".csv":".md",{name:f,breadcrumb:g}={name:(b=c.path.split("/").filter(Boolean))[b.length-1],breadcrumb:b.slice(0,-1)},h=a===x,l=a===z;return(0,d.jsxs)("button",{role:"option","aria-selected":h,draggable:!0,onDragStart:a=>J(a,c),onDragEnd:K,onDragEnter:()=>A(a),onDragLeave:()=>A(null),onClick:()=>H(c),onMouseEnter:()=>y(a),className:`
189
189
  w-full px-3 py-2.5 flex items-start gap-3 text-left transition-colors duration-100
190
190
  border-b border-border/50
191
191
  ${h?"bg-[var(--amber-dim)] border-l-2 border-[var(--amber)]":"border-l-2 border-transparent"}