@geminilight/mindos 0.6.41 → 0.6.43

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 (282) 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 +20 -19
  4. package/_standalone/.next/build-manifest.json +2 -2
  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/routes-manifest.json +6 -0
  10. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  11. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/_standalone/.next/server/app/_global-error.html +2 -2
  13. package/_standalone/.next/server/app/_global-error.rsc +1 -1
  14. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  15. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  21. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  24. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  25. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  26. package/_standalone/.next/server/app/agents/page.js +2 -2
  27. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  28. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  29. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  30. package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  31. package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  32. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  33. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  37. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  39. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  40. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  41. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  42. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  43. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  44. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  45. package/_standalone/.next/server/app/api/export/route.js +1 -1
  46. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  47. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  48. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  49. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  51. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  52. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  53. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  54. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  55. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  56. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/mcp/install/route.js +1 -1
  58. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  59. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  61. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  62. package/_standalone/.next/server/app/api/mcp/uninstall/route.js +1 -0
  63. package/_standalone/.next/server/app/api/mcp/uninstall/route.js.nft.json +1 -0
  64. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -0
  65. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  66. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  67. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  68. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  69. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  70. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  71. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  72. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  74. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  75. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  77. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/skills/route.js +4 -4
  79. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  81. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  84. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  85. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  86. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  87. package/_standalone/.next/server/app/changes/page.js +1 -1
  88. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  89. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  90. package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
  91. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  92. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  93. package/_standalone/.next/server/app/echo/page.js +1 -1
  94. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  95. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  96. package/_standalone/.next/server/app/explore/page.js +1 -1
  97. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  98. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  99. package/_standalone/.next/server/app/help/page.js +1 -1
  100. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  101. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  102. package/_standalone/.next/server/app/login/page.js +1 -1
  103. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  104. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  105. package/_standalone/.next/server/app/page.js +1 -1
  106. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  107. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  108. package/_standalone/.next/server/app/setup/page.js +1 -1
  109. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  110. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  111. package/_standalone/.next/server/app/trash/page.js +2 -2
  112. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  113. package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
  114. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  115. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  116. package/_standalone/.next/server/app-paths-manifest.json +20 -19
  117. package/_standalone/.next/server/chunks/6539.js +1 -1
  118. package/_standalone/.next/server/chunks/{2536.js → 66.js} +2 -2
  119. package/_standalone/.next/server/chunks/9539.js +30 -30
  120. package/_standalone/.next/server/instrumentation.js +1 -1
  121. package/_standalone/.next/server/next-font-manifest.js +1 -1
  122. package/_standalone/.next/server/next-font-manifest.json +1 -1
  123. package/_standalone/.next/server/pages/500.html +2 -2
  124. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  125. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  126. package/_standalone/.next/static/chunks/{1053-b70535785cc5aaee.js → 1053-67f0ce444d1227e2.js} +2 -2
  127. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-84943536516b00b2.js +1 -0
  128. package/_standalone/.next/static/chunks/app/_global-error/page-84943536516b00b2.js +1 -0
  129. package/_standalone/.next/static/chunks/app/agents/page-eac6c5f6650dbf62.js +5 -0
  130. package/_standalone/.next/static/chunks/app/api/a2a/agents/route-84943536516b00b2.js +1 -0
  131. package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-84943536516b00b2.js +1 -0
  132. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-84943536516b00b2.js +1 -0
  133. package/_standalone/.next/static/chunks/app/api/a2a/route-84943536516b00b2.js +1 -0
  134. package/_standalone/.next/static/chunks/app/api/acp/config/route-84943536516b00b2.js +1 -0
  135. package/_standalone/.next/static/chunks/app/api/acp/detect/route-84943536516b00b2.js +1 -0
  136. package/_standalone/.next/static/chunks/app/api/acp/install/route-84943536516b00b2.js +1 -0
  137. package/_standalone/.next/static/chunks/app/api/acp/registry/route-84943536516b00b2.js +1 -0
  138. package/_standalone/.next/static/chunks/app/api/acp/session/route-84943536516b00b2.js +1 -0
  139. package/_standalone/.next/static/chunks/app/api/agent-activity/route-84943536516b00b2.js +1 -0
  140. package/_standalone/.next/static/chunks/app/api/ask/route-84943536516b00b2.js +1 -0
  141. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-84943536516b00b2.js +1 -0
  142. package/_standalone/.next/static/chunks/app/api/auth/route-84943536516b00b2.js +1 -0
  143. package/_standalone/.next/static/chunks/app/api/backlinks/route-84943536516b00b2.js +1 -0
  144. package/_standalone/.next/static/chunks/app/api/bootstrap/route-84943536516b00b2.js +1 -0
  145. package/_standalone/.next/static/chunks/app/api/changes/route-84943536516b00b2.js +1 -0
  146. package/_standalone/.next/static/chunks/app/api/export/route-84943536516b00b2.js +1 -0
  147. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-84943536516b00b2.js +1 -0
  148. package/_standalone/.next/static/chunks/app/api/file/import/route-84943536516b00b2.js +1 -0
  149. package/_standalone/.next/static/chunks/app/api/file/route-84943536516b00b2.js +1 -0
  150. package/_standalone/.next/static/chunks/app/api/files/route-84943536516b00b2.js +1 -0
  151. package/_standalone/.next/static/chunks/app/api/git/route-84943536516b00b2.js +1 -0
  152. package/_standalone/.next/static/chunks/app/api/graph/route-84943536516b00b2.js +1 -0
  153. package/_standalone/.next/static/chunks/app/api/health/route-84943536516b00b2.js +1 -0
  154. package/_standalone/.next/static/chunks/app/api/inbox/route-84943536516b00b2.js +1 -0
  155. package/_standalone/.next/static/chunks/app/api/init/route-84943536516b00b2.js +1 -0
  156. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-84943536516b00b2.js +1 -0
  157. package/_standalone/.next/static/chunks/app/api/mcp/install/route-84943536516b00b2.js +1 -0
  158. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-84943536516b00b2.js +1 -0
  159. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-84943536516b00b2.js +1 -0
  160. package/_standalone/.next/static/chunks/app/api/mcp/status/route-84943536516b00b2.js +1 -0
  161. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-84943536516b00b2.js +1 -0
  162. package/_standalone/.next/static/chunks/app/api/monitoring/route-84943536516b00b2.js +1 -0
  163. package/_standalone/.next/static/chunks/app/api/recent-files/route-84943536516b00b2.js +1 -0
  164. package/_standalone/.next/static/chunks/app/api/restart/route-84943536516b00b2.js +1 -0
  165. package/_standalone/.next/static/chunks/app/api/search/route-84943536516b00b2.js +1 -0
  166. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-84943536516b00b2.js +1 -0
  167. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-84943536516b00b2.js +1 -0
  168. package/_standalone/.next/static/chunks/app/api/settings/route-84943536516b00b2.js +1 -0
  169. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-84943536516b00b2.js +1 -0
  170. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-84943536516b00b2.js +1 -0
  171. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-84943536516b00b2.js +1 -0
  172. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-84943536516b00b2.js +1 -0
  173. package/_standalone/.next/static/chunks/app/api/setup/ls/route-84943536516b00b2.js +1 -0
  174. package/_standalone/.next/static/chunks/app/api/setup/route-84943536516b00b2.js +1 -0
  175. package/_standalone/.next/static/chunks/app/api/skills/route-84943536516b00b2.js +1 -0
  176. package/_standalone/.next/static/chunks/app/api/sync/route-84943536516b00b2.js +1 -0
  177. package/_standalone/.next/static/chunks/app/api/tree-version/route-84943536516b00b2.js +1 -0
  178. package/_standalone/.next/static/chunks/app/api/uninstall/route-84943536516b00b2.js +1 -0
  179. package/_standalone/.next/static/chunks/app/api/update/route-84943536516b00b2.js +1 -0
  180. package/_standalone/.next/static/chunks/app/api/update-check/route-84943536516b00b2.js +1 -0
  181. package/_standalone/.next/static/chunks/app/api/update-status/route-84943536516b00b2.js +1 -0
  182. package/_standalone/.next/static/chunks/app/api/workflows/route-84943536516b00b2.js +1 -0
  183. package/_standalone/.next/static/chunks/app/echo/page-84943536516b00b2.js +1 -0
  184. package/_standalone/.next/static/chunks/app/{layout-42cdbce19f404567.js → layout-67c50f39fffd6c36.js} +45 -45
  185. package/_standalone/.next/static/chunks/app/{page-8c9643b649e01735.js → page-ea1bff5e0ba77c16.js} +2 -2
  186. package/_standalone/.next/static/chunks/app/setup/{page-d158b8cb533feb1e.js → page-6132ea7632e08a9b.js} +1 -1
  187. package/_standalone/.next/static/chunks/app/trash/page-6ee0637660fb00e9.js +1 -0
  188. package/_standalone/.next/static/chunks/app/view/[...path]/loading-84943536516b00b2.js +1 -0
  189. package/_standalone/.next/static/chunks/app/view/[...path]/page-182494955ef70870.js +12 -0
  190. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-84943536516b00b2.js +1 -0
  191. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-84943536516b00b2.js +1 -0
  192. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-84943536516b00b2.js +1 -0
  193. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-84943536516b00b2.js +1 -0
  194. package/_standalone/.next/static/lpSyd-exxbKPK2GO1oNDZ/_buildManifest.js +1 -0
  195. package/_standalone/.next/trace +63 -63
  196. package/_standalone/.next/types/routes.d.ts +2 -1
  197. package/_standalone/.next/types/validator.ts +9 -0
  198. package/_standalone/components/agents/AgentsMcpSection.tsx +24 -5
  199. package/_standalone/components/setup/types.ts +1 -0
  200. package/_standalone/instrumentation.ts +21 -0
  201. package/_standalone/lib/i18n/modules/panels.ts +6 -2
  202. package/_standalone/tsconfig.tsbuildinfo +1 -1
  203. package/app/app/api/mcp/install/route.ts +13 -2
  204. package/app/app/api/mcp/uninstall/route.ts +130 -0
  205. package/app/app/api/skills/route.ts +14 -1
  206. package/app/components/agents/AgentsMcpSection.tsx +24 -5
  207. package/app/components/setup/index.tsx +4 -3
  208. package/app/components/setup/types.ts +1 -0
  209. package/app/instrumentation.ts +21 -0
  210. package/app/lib/i18n/modules/panels.ts +6 -2
  211. package/app/lib/settings.ts +32 -0
  212. package/bin/commands/start.js +10 -0
  213. package/bin/lib/skill-check.js +116 -20
  214. package/package.json +1 -1
  215. package/scripts/setup.js +28 -0
  216. package/skills/mindos/SKILL.md +5 -6
  217. package/skills/mindos-zh/SKILL.md +5 -4
  218. package/_standalone/.next/static/Ij3PFh-a0zi5K_ANoSAW0/_buildManifest.js +0 -1
  219. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/route-400c3c09b1540c14.js +0 -1
  220. package/_standalone/.next/static/chunks/app/_global-error/page-400c3c09b1540c14.js +0 -1
  221. package/_standalone/.next/static/chunks/app/agents/page-6102a884b2cb3cfe.js +0 -5
  222. package/_standalone/.next/static/chunks/app/api/a2a/agents/route-400c3c09b1540c14.js +0 -1
  223. package/_standalone/.next/static/chunks/app/api/a2a/delegations/route-400c3c09b1540c14.js +0 -1
  224. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-400c3c09b1540c14.js +0 -1
  225. package/_standalone/.next/static/chunks/app/api/a2a/route-400c3c09b1540c14.js +0 -1
  226. package/_standalone/.next/static/chunks/app/api/acp/config/route-400c3c09b1540c14.js +0 -1
  227. package/_standalone/.next/static/chunks/app/api/acp/detect/route-400c3c09b1540c14.js +0 -1
  228. package/_standalone/.next/static/chunks/app/api/acp/install/route-400c3c09b1540c14.js +0 -1
  229. package/_standalone/.next/static/chunks/app/api/acp/registry/route-400c3c09b1540c14.js +0 -1
  230. package/_standalone/.next/static/chunks/app/api/acp/session/route-400c3c09b1540c14.js +0 -1
  231. package/_standalone/.next/static/chunks/app/api/agent-activity/route-400c3c09b1540c14.js +0 -1
  232. package/_standalone/.next/static/chunks/app/api/ask/route-400c3c09b1540c14.js +0 -1
  233. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-400c3c09b1540c14.js +0 -1
  234. package/_standalone/.next/static/chunks/app/api/auth/route-400c3c09b1540c14.js +0 -1
  235. package/_standalone/.next/static/chunks/app/api/backlinks/route-400c3c09b1540c14.js +0 -1
  236. package/_standalone/.next/static/chunks/app/api/bootstrap/route-400c3c09b1540c14.js +0 -1
  237. package/_standalone/.next/static/chunks/app/api/changes/route-400c3c09b1540c14.js +0 -1
  238. package/_standalone/.next/static/chunks/app/api/export/route-400c3c09b1540c14.js +0 -1
  239. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-400c3c09b1540c14.js +0 -1
  240. package/_standalone/.next/static/chunks/app/api/file/import/route-400c3c09b1540c14.js +0 -1
  241. package/_standalone/.next/static/chunks/app/api/file/route-400c3c09b1540c14.js +0 -1
  242. package/_standalone/.next/static/chunks/app/api/files/route-400c3c09b1540c14.js +0 -1
  243. package/_standalone/.next/static/chunks/app/api/git/route-400c3c09b1540c14.js +0 -1
  244. package/_standalone/.next/static/chunks/app/api/graph/route-400c3c09b1540c14.js +0 -1
  245. package/_standalone/.next/static/chunks/app/api/health/route-400c3c09b1540c14.js +0 -1
  246. package/_standalone/.next/static/chunks/app/api/inbox/route-400c3c09b1540c14.js +0 -1
  247. package/_standalone/.next/static/chunks/app/api/init/route-400c3c09b1540c14.js +0 -1
  248. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-400c3c09b1540c14.js +0 -1
  249. package/_standalone/.next/static/chunks/app/api/mcp/install/route-400c3c09b1540c14.js +0 -1
  250. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-400c3c09b1540c14.js +0 -1
  251. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-400c3c09b1540c14.js +0 -1
  252. package/_standalone/.next/static/chunks/app/api/mcp/status/route-400c3c09b1540c14.js +0 -1
  253. package/_standalone/.next/static/chunks/app/api/monitoring/route-400c3c09b1540c14.js +0 -1
  254. package/_standalone/.next/static/chunks/app/api/recent-files/route-400c3c09b1540c14.js +0 -1
  255. package/_standalone/.next/static/chunks/app/api/restart/route-400c3c09b1540c14.js +0 -1
  256. package/_standalone/.next/static/chunks/app/api/search/route-400c3c09b1540c14.js +0 -1
  257. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-400c3c09b1540c14.js +0 -1
  258. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-400c3c09b1540c14.js +0 -1
  259. package/_standalone/.next/static/chunks/app/api/settings/route-400c3c09b1540c14.js +0 -1
  260. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-400c3c09b1540c14.js +0 -1
  261. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-400c3c09b1540c14.js +0 -1
  262. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-400c3c09b1540c14.js +0 -1
  263. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-400c3c09b1540c14.js +0 -1
  264. package/_standalone/.next/static/chunks/app/api/setup/ls/route-400c3c09b1540c14.js +0 -1
  265. package/_standalone/.next/static/chunks/app/api/setup/route-400c3c09b1540c14.js +0 -1
  266. package/_standalone/.next/static/chunks/app/api/skills/route-400c3c09b1540c14.js +0 -1
  267. package/_standalone/.next/static/chunks/app/api/sync/route-400c3c09b1540c14.js +0 -1
  268. package/_standalone/.next/static/chunks/app/api/tree-version/route-400c3c09b1540c14.js +0 -1
  269. package/_standalone/.next/static/chunks/app/api/uninstall/route-400c3c09b1540c14.js +0 -1
  270. package/_standalone/.next/static/chunks/app/api/update/route-400c3c09b1540c14.js +0 -1
  271. package/_standalone/.next/static/chunks/app/api/update-check/route-400c3c09b1540c14.js +0 -1
  272. package/_standalone/.next/static/chunks/app/api/update-status/route-400c3c09b1540c14.js +0 -1
  273. package/_standalone/.next/static/chunks/app/api/workflows/route-400c3c09b1540c14.js +0 -1
  274. package/_standalone/.next/static/chunks/app/echo/page-400c3c09b1540c14.js +0 -1
  275. package/_standalone/.next/static/chunks/app/trash/page-e9ab74ffeb96af41.js +0 -1
  276. package/_standalone/.next/static/chunks/app/view/[...path]/loading-400c3c09b1540c14.js +0 -1
  277. package/_standalone/.next/static/chunks/app/view/[...path]/page-764a69a1c8bd4eef.js +0 -12
  278. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-400c3c09b1540c14.js +0 -1
  279. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-400c3c09b1540c14.js +0 -1
  280. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-400c3c09b1540c14.js +0 -1
  281. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-400c3c09b1540c14.js +0 -1
  282. /package/_standalone/.next/static/{Ij3PFh-a0zi5K_ANoSAW0 → lpSyd-exxbKPK2GO1oNDZ}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>o,X8:()=>d,dV:()=>l,oR:()=>m});let r=[],n=[],a=0;function i(){for(let e of n)e()}function o(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function l(){return r}function d(e){r=r.filter(t=>t.id!==e),i()}function c(e){let t=`toast-${++a}`,s={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};r=[...r,s].slice(-3),i(),s.duration>0&&setTimeout(()=>d(t),s.duration)}function m(e,t){c({message:e,...t})}m.success=(e,t)=>c({message:e,type:"success",duration:t}),m.undo=(e,t,s)=>c({message:e,type:"info",duration:s?.duration??5e3,action:{label:s?.label??"Undo",onClick:t}}),m.error=(e,t)=>c({message:e,type:"error",duration:t}),m.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6496:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var r=s(95155),n=s(12115),a=s(98500),i=s.n(a),o=s(93219),l=s(21628),d=s(12651),c=s(13545),m=s(66088),u=s(91337),x=s(91053),p=s(42833);function h(){let{t:e,locale:t}=(0,x.Y)(),[s,a]=(0,n.useState)([]),[h,f]=(0,n.useState)(!0),[g,b]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=!1,t=()=>{fetch("/api/agent-activity?limit=20").then(e=>e.json()).then(t=>{e||a(t.events??[])}).catch(()=>{}).finally(()=>{e||f(!1)})};t();let s=()=>{"visible"===document.visibilityState&&t()};return document.addEventListener("visibilitychange",s),()=>{e=!0,document.removeEventListener("visibilitychange",s)}},[]);let v=(0,n.useMemo)(()=>{let e=s.filter(e=>{let t=(0,p.wT)(e.tool);return"write"===t||"create"===t||"delete"===t});return e.length>=3?e:s},[s]),j=g?v:v.slice(0,5),N=v.length-5;if(h)return(0,r.jsxs)("section",{className:"animate-pulse","aria-label":"Recent Activity",children:[(0,r.jsx)("div",{className:"h-4 w-36 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]});if(0===s.length)return null;let y=e.agentsContent?.overview;return(0,r.jsxs)("section",{"aria-label":"Recent Activity",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(o.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:y?.recentActivity??"Recent Activity"}),(0,r.jsx)("div",{className:"ml-auto",children:(0,r.jsxs)(i(),{href:"/agents?tab=activity",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors font-display",children:[(0,r.jsx)(l.A,{size:12}),(0,r.jsx)("span",{children:y?.viewAll??"View all"})]})})]}),(0,r.jsx)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:j.map((e,s)=>{let n=(0,p.wT)(e.tool),a=(0,p.oK)(e.params);return(0,r.jsxs)("div",{className:`flex items-center gap-3 px-3.5 py-2.5 ${s>0?"border-t border-border/30":""} hover:bg-muted/30 transition-colors`,children:[(0,r.jsx)(p.g,{kind:n,locale:t,size:"sm"}),a?(0,r.jsx)(i(),{href:`/view/${(0,u.O0)(a)}`,className:"text-xs text-[var(--amber)]/80 hover:text-[var(--amber)] truncate min-w-0 flex-1 font-display transition-colors",title:a,children:a}):(0,r.jsx)("span",{className:"flex-1"}),e.agentName&&(0,r.jsx)("span",{className:"text-[0.6rem] font-medium text-muted-foreground/70 bg-muted/60 px-1.5 py-0.5 rounded-full shrink-0 font-display",title:e.agentName,children:e.agentName.length>20?e.agentName.slice(0,20)+"...":e.agentName}),"ok"===e.result?(0,r.jsx)(d.A,{size:11,className:"shrink-0 text-[var(--success)]/60"}):(0,r.jsx)(c.A,{size:11,className:"shrink-0 text-[var(--error)]/60"}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums shrink-0 font-display",title:e.ts,children:(0,p.MZ)(e.ts)})]},e.id??s)})}),N>0&&(0,r.jsxs)("button",{onClick:()=>b(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(m.A,{size:12,className:`transition-transform duration-200 ${g?"rotate-180":""}`}),(0,r.jsx)("span",{children:g?y?.showLess??"Show less":`${N} more`})]})]})}},7834:(e,t,s)=>{"use strict";async function r(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}catch{return!1}}s.d(t,{l:()=>r})},10377:(e,t,s)=>{"use strict";s.d(t,{Z:()=>h});var r=s(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function o(){return c}let l=[];function d(){return l}let c=[],m=!1;function u(){m||(c=i(),m=!0)}function x(e){u();let t=t=>{t.key===n&&(c=i(),e())},s=()=>{c=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,s),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,s)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){u();let e=(0,r.useSyncExternalStore)(x,o,d),t=(0,r.useCallback)(t=>e.includes(t),[e]),s=(0,r.useCallback)(e=>{let t=i(),s=t.indexOf(e);s>=0?t.splice(s,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:s,reorderPins:(0,r.useCallback)(e=>{p(e)},[]),removePin:(0,r.useCallback)(e=>{p(i().filter(t=>t!==e))},[])}}},14153:(e,t,s)=>{Promise.resolve().then(s.bind(s,46515))},22356:(e,t,s)=>{"use strict";s.d(t,{h:()=>r,n:()=>n});class r extends Error{constructor(e,t,s){super(e),this.name="ApiError",this.status=t,this.code=s}}async function n(e,t={}){let s,a,i,{timeout:o=3e4,signal:l,...d}=t;if((o>0||l)&&(s=new AbortController),o>0&&s&&(a=setTimeout(()=>{s.abort(Error(`Request timed out after ${Math.round(o/1e3)}s`))},o)),l&&s)if(l.aborted)s.abort();else{let e=()=>s?.abort();l.addEventListener("abort",e,{once:!0}),i=()=>{l.removeEventListener("abort",e)}}let c=s?.signal??l;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,s=`Request failed (${t.status})`;try{let r=await t.json();r?.error?.code&&r?.error?.message?(s=r.error.message,e=r.error.code):r?.error&&(s="string"==typeof r.error?r.error:r.error.message??s)}catch{}throw new r(s,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),i&&i()}}},27318:(e,t,s)=>{"use strict";s.d(t,{KT:()=>c,NH:()=>d});var r=s(12115);let n={open:!1,initialMessage:"",source:"user",acpAgent:null},a=new Set;function i(){a.forEach(e=>e())}function o(e){return a.add(e),()=>{a.delete(e)}}function l(){return n}function d(e="",t="user",s=null){n={open:!0,initialMessage:e,source:t,acpAgent:s},i()}function c(){let e=(0,r.useSyncExternalStore)(o,l,l);return{open:e.open,initialMessage:e.initialMessage,source:e.source,acpAgent:e.acpAgent,openWith:(0,r.useCallback)((e,t="user",s=null)=>d(e,t,s),[]),close:(0,r.useCallback)(()=>void(n={open:!1,initialMessage:"",source:"user",acpAgent:null},i()),[])}}},29494:(e,t,s)=>{"use strict";s.d(t,{Q:()=>n});var r=s(4235);async function n(e,t){let s=[],n=0;for(let t of e){if(t.size>0xa00000){n++;continue}try{if(t.name.toLowerCase().endsWith(".pdf")){let e=await t.arrayBuffer();s.push({name:t.name,content:function(e){let t=new Uint8Array(e),s=[];for(let e=0;e<t.length;e+=8192)s.push(String.fromCharCode(...t.subarray(e,e+8192)));return btoa(s.join(""))}(e),encoding:"base64"})}else{let e=await t.text();s.push({name:t.name,content:e})}}catch{}}if(0===s.length)return void(n>0?r.oR.error(t.inbox.tooLarge(n),4e3):e.length>0&&r.oR.error(t.inbox.saveFailed,4e3));try{var a;let e=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:s})});if(!e.ok){let s=await e.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",s.error),r.oR.error(t.inbox.saveFailed,4e3);return}let i=await e.json(),o=i.saved?.length??0,l=i.skipped?.length??0;a=n,o>0&&a>0&&0===l?r.oR.success(t.inbox.savedWithOversized(o,a),4e3):o>0&&l+a>0?r.oR.success(t.inbox.savedWithSkipped(o,l+a),4e3):o>0?r.oR.success(t.inbox.savedToast(o),3e3):(a>0&&r.oR.error(t.inbox.tooLarge(a),4e3),l>0&&r.oR.error(t.inbox.savedWithSkipped(0,l),4e3),0===a&&0===l&&r.oR.error(t.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(e){console.error("[QuickDrop] Network error:",e),r.oR.error(t.inbox.saveFailed,4e3)}}},42833:(e,t,s)=>{"use strict";s.d(t,{$2:()=>p,CF:()=>m,MZ:()=>h,g:()=>g,hf:()=>x,oK:()=>f,wT:()=>c,zR:()=>u});var r=s(95155),n=s(84980),a=s(3926),i=s(93631),o=s(68459),l=s(61878),d=s(10762);function c(e){return/search/.test(e)?"search":/read|list|get/.test(e)?"read":/create/.test(e)?"create":/delete/.test(e)?"delete":/write|update|insert|append/.test(e)?"write":"other"}let m={en:{read:"Read",write:"Write",create:"Create",delete:"Delete",search:"Search",other:"Other"},zh:{read:"读取",write:"写入",create:"创建",delete:"删除",search:"搜索",other:"其他"}},u={read:{bg:"rgba(138,180,216,0.10)",text:"#8ab4d8",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:"#c8a0d8",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function x({kind:e,size:t=13}){return"read"===e?(0,r.jsx)(n.A,{size:t}):"write"===e?(0,r.jsx)(a.A,{size:t}):"create"===e?(0,r.jsx)(i.A,{size:t}):"delete"===e?(0,r.jsx)(o.A,{size:t}):"search"===e?(0,r.jsx)(l.A,{size:t}):(0,r.jsx)(d.A,{size:t})}function p(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function h(e){let t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4),r=Math.floor(t/36e5),n=Math.floor(t/864e5);return s<1?"<1m":s<60?`${s}m`:r<24?`${r}h`:`${n}d`}function f(e){return"string"==typeof e.path?e.path:null}function g({kind:e,locale:t,size:s="md"}){let n=u[e],a=m[t?.startsWith("zh")?"zh":"en"][e];return(0,r.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:3,padding:"sm"===s?"1px 6px":"2px 8px",borderRadius:999,fontSize:"sm"===s?"0.6rem":"0.68rem",fontWeight:600,background:n.bg,color:n.text,border:`1px solid ${n.border}`,flexShrink:0,whiteSpace:"nowrap"},children:[(0,r.jsx)(x,{kind:e,size:"sm"===s?9:10}),a]})}},46515:(e,t,s)=>{"use strict";s.d(t,{default:()=>eo});var r=s(95155),n=s(98500),a=s.n(n),i=s(66088),o=s(33078),l=s(48368),d=s(86901),c=s(61878),m=s(93631),u=s(21628),x=s(90718),p=s(38798),h=s(84980),f=s(50538),g=s(94290),b=s(33210),v=s(51914),j=s(94514),N=s(6296),y=s(68459),w=s(12115),k=s(91053),A=s(91337),z=s(10377),C=s(73321),E=s(92451),S=s(97810),T=s(13545),L=s(31025);let M=[{id:"en",icon:(0,r.jsx)(E.A,{size:20}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,r.jsx)(S.A,{size:20}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,r.jsx)(l.A,{size:20}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];function $(){let{t:e}=(0,k.Y)(),t=(0,C.useRouter)(),[s,n]=(0,w.useState)(null),[a,i]=(0,w.useState)(null),o=e.onboarding;async function l(e){n(e),i(null);try{let s=await fetch("/api/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`HTTP ${s.status}`)}t.refresh()}catch(e){console.error("[Onboarding] init failed:",e),i(e instanceof Error?e.message:"Unknown error"),n(null)}}return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-12 md:py-20",children:[(0,r.jsxs)("div",{className:"text-center mb-10",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 mb-4",children:[(0,r.jsx)(d.A,{size:18,className:"text-[var(--amber)]"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed max-w-md mx-auto text-muted-foreground",children:o.subtitle})]}),a&&(0,r.jsxs)("div",{role:"alert",className:"max-w-2xl mx-auto mb-6 flex items-center gap-2.5 px-4 py-3 rounded-lg border border-destructive/30 bg-destructive/5 text-sm text-destructive",children:[(0,r.jsx)(T.A,{size:16,className:"shrink-0"}),(0,r.jsx)("span",{className:"flex-1",children:o.initError??"Initialization failed. Please try again."}),(0,r.jsx)("button",{onClick:()=>i(null),className:"text-xs underline shrink-0 hover:opacity-80",children:o.dismiss??"Dismiss"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-2xl mx-auto mb-10",children:M.map(t=>{let n=s===t.id,a=null!==s;return(0,r.jsxs)("button",{disabled:a,title:a?e.hints.templateInitializing:void 0,onClick:()=>l(t.id),className:"group relative flex flex-col items-start gap-3 p-5 rounded-xl border border-border bg-card text-left transition-all duration-150 hover:border-[var(--amber)]/50 hover:bg-[var(--amber)]/5 disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 w-full",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground",children:o.templates[t.id].title}),n&&(0,r.jsx)(N.A,{size:14,className:"animate-spin ml-auto text-[var(--amber)]"})]}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:o.templates[t.id].desc}),(0,r.jsx)("div",{className:"w-full rounded-lg px-3 py-2 text-xs leading-relaxed font-display bg-muted text-muted-foreground opacity-80",children:t.dirs.map(e=>(0,r.jsx)("div",{children:e},e))})]},t.id)})}),(0,r.jsx)("p",{className:"text-center text-xs leading-relaxed max-w-sm mx-auto font-display text-muted-foreground opacity-60",children:o.importHint}),(0,r.jsx)("p",{className:"text-center mt-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("mindos:open-import")),className:"text-xs text-[var(--amber-text)] hover:underline transition-colors",children:e.fileImport.onboardingHint})}),(0,r.jsxs)("div",{className:"max-w-md mx-auto mt-6 flex items-center gap-3 px-4 py-3 rounded-lg border border-border bg-card text-left",children:[(0,r.jsx)(L.A,{size:16,className:"text-muted-foreground shrink-0"}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[o.syncHint??"Want cross-device sync? Run"," ",(0,r.jsx)("code",{className:"font-mono px-1 py-0.5 rounded select-all bg-muted text-[11px]",children:"mindos sync init"})," ",o.syncHintSuffix??"in the terminal after setup."]})})]})]})}var R=s(21362),D=s(21975),O=s(92564),W=s(22164),P=s(67635),I=s(7834),H=s(4235),F=s(27318),K=s(76449);function U(){let{t:e}=(0,k.Y)(),t=e.guide,[s,n]=(0,w.useState)(null),[i,o]=(0,w.useState)(null),[l,c]=(0,w.useState)(!1),[m,u]=(0,w.useState)(!1),x=(0,w.useCallback)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{let t=e.guideState;t?.active&&!t.dismissed?n(t):n(null)}).catch(e=>{console.warn("[GuideCard] Fetch guide state failed:",e)})},[]);(0,w.useEffect)(()=>{x();let e=()=>{c(!0)};window.addEventListener("mindos:first-visit",e);let t=()=>x();return window.addEventListener("focus",t),window.addEventListener("guide-state-updated",t),()=>{window.removeEventListener("mindos:first-visit",e),window.removeEventListener("focus",t),window.removeEventListener("guide-state-updated",t)}},[x]);let p=(0,w.useCallback)(e=>{n(t=>t?{...t,...e}:t),fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:e})}).catch(e=>{console.warn("[GuideCard] PATCH guide state failed:",e)})},[]),h=(0,w.useCallback)(()=>{p({dismissed:!0}),n(null)},[p]),f=(0,w.useCallback)(()=>{window.dispatchEvent(new CustomEvent("mindos:open-import"))},[]),g=(0,w.useCallback)(()=>{p({step1Done:!0}),o(null)},[p]);(0,w.useEffect)(()=>{if(!s||s.step1Done)return;let e=()=>p({step1Done:!0});return window.addEventListener("mindos:files-changed",e),()=>window.removeEventListener("mindos:files-changed",e)},[s,s?.step1Done,p]);let v=(0,w.useCallback)(()=>{let e=s?.template==="empty"?t.ai.promptEmpty:t.ai.prompt;(0,F.NH)(e,"guide")},[s,t]),j=(0,w.useCallback)(async()=>{await (0,I.l)(t.agent.copyPrompt)&&H.oR.copy()},[t]),N=(0,w.useCallback)(()=>{u(!0),o(null),p({nextStepIndex:0})},[p]),y=(0,w.useCallback)(()=>{if(!s)return;let e=s.nextStepIndex,r=t.done.steps;e<r.length&&((0,F.NH)(r[e].prompt,"guide-next"),p({nextStepIndex:e+1}))},[s,t,p]);(0,w.useEffect)(()=>{l&&s&&!s.step1Done&&o("import")},[l,s]);let A=(0,w.useRef)({s1:!1,s2:!1});(0,w.useEffect)(()=>{if(!s)return;let e=A.current;s.step1Done&&!e.s1&&(o("ai"),e.s1=!0),s.askedAI&&!e.s2&&(o("agent"),e.s2=!0)},[s?.step1Done,s?.askedAI,s]);let z=s?.step1Done??!1,C=s?.askedAI??!1,E=s?.nextStepIndex??0,S=z&&C&&m,T=S&&E>=t.done.steps.length,L=(0,w.useRef)(null);if((0,w.useEffect)(()=>(T&&(L.current=setTimeout(()=>h(),8e3)),()=>{L.current&&clearTimeout(L.current)}),[T,h]),!s||void 0!==s.walkthroughStep&&s.walkthroughStep>=0&&s.walkthroughStep<K.g.length&&!s.walkthroughDismissed)return null;let M=z&&C&&!m;if(S&&T)return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 flex items-center gap-3 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsx)(d.A,{size:16,className:"animate-spin-slow text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.titleFinal}),(0,r.jsx)(a(),{href:"/explore",className:"text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80",children:e.walkthrough.exploreCta}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]});if(S){let e=t.done.steps[E];return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),e&&(0,r.jsxs)("button",{onClick:y,className:"mt-3 flex items-center gap-2 text-sm text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer animate-in fade-in slide-in-from-left-2 duration-300",children:[(0,r.jsx)(R.A,{size:14}),(0,r.jsx)("span",{children:e.hint})]})]})}return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] overflow-hidden bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 px-5 pt-4 pb-2",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 font-display text-foreground",children:t.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 px-5 py-3",children:[(0,r.jsx)(_,{icon:(0,r.jsx)(D.A,{size:16}),title:t.import.title,cta:t.import.cta,done:z,active:"import"===i,onClick:()=>z?null:o("import"===i?null:"import")}),(0,r.jsx)(_,{icon:(0,r.jsx)(O.A,{size:16}),title:t.ai.title,cta:t.ai.cta,done:C,active:"ai"===i,dimmed:!z,onClick:()=>{!C&&z&&o("ai"===i?null:"ai")}}),(0,r.jsx)(_,{icon:(0,r.jsx)(W.A,{size:16}),title:t.agent.title,cta:t.agent.cta,done:m,active:"agent"===i,dimmed:!z||!C,onClick:()=>{z&&C&&o("agent"===i?null:"agent")}})]}),"import"===i&&!z&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.import.desc}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("button",{onClick:f,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:t.import.button}),(0,r.jsx)("button",{onClick:g,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})]})]})}),"ai"===i&&z&&!C&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.ai.desc}),(0,r.jsxs)("button",{onClick:v,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.ai.cta," →"]})]})}),"agent"===i&&M&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.agent.desc}),(0,r.jsxs)("div",{className:"relative rounded-lg border border-border bg-muted/50 p-3 pr-16",children:[(0,r.jsx)("p",{className:"text-xs font-mono text-foreground leading-relaxed whitespace-pre-wrap",children:t.agent.copyPrompt}),(0,r.jsxs)("button",{onClick:j,className:"absolute top-2 right-2 flex items-center gap-1 text-2xs font-medium px-2.5 py-1.5 rounded-md border transition-all border-border bg-card text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30",children:[(0,r.jsx)(P.A,{size:11}),t.agent.copy]})]}),(0,r.jsx)("div",{className:"flex items-center justify-end mt-3 pt-3 border-t border-border",children:(0,r.jsx)("button",{onClick:N,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})})]})})]})}function _({icon:e,title:t,cta:s,done:n,active:a,dimmed:i,onClick:o}){return(0,r.jsxs)("button",{onClick:o,disabled:n||i,className:`
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{4235:(e,t,s)=>{"use strict";s.d(t,{B1:()=>o,X8:()=>d,dV:()=>l,oR:()=>m});let r=[],n=[],a=0;function i(){for(let e of n)e()}function o(e){return n=[...n,e],()=>{n=n.filter(t=>t!==e)}}function l(){return r}function d(e){r=r.filter(t=>t.id!==e),i()}function c(e){let t=`toast-${++a}`,s={id:t,message:e.message,type:e.type??"info",duration:e.duration??2e3,action:e.action};r=[...r,s].slice(-3),i(),s.duration>0&&setTimeout(()=>d(t),s.duration)}function m(e,t){c({message:e,...t})}m.success=(e,t)=>c({message:e,type:"success",duration:t}),m.undo=(e,t,s)=>c({message:e,type:"info",duration:s?.duration??5e3,action:{label:s?.label??"Undo",onClick:t}}),m.error=(e,t)=>c({message:e,type:"error",duration:t}),m.copy=(e="Copied")=>c({message:e,type:"success",duration:1500})},6496:(e,t,s)=>{"use strict";s.d(t,{A:()=>h});var r=s(95155),n=s(12115),a=s(98500),i=s.n(a),o=s(93219),l=s(21628),d=s(12651),c=s(13545),m=s(66088),u=s(91337),x=s(91053),p=s(42833);function h(){let{t:e,locale:t}=(0,x.Y)(),[s,a]=(0,n.useState)([]),[h,f]=(0,n.useState)(!0),[g,b]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=!1,t=()=>{fetch("/api/agent-activity?limit=20").then(e=>e.json()).then(t=>{e||a(t.events??[])}).catch(()=>{}).finally(()=>{e||f(!1)})};t();let s=()=>{"visible"===document.visibilityState&&t()};return document.addEventListener("visibilitychange",s),()=>{e=!0,document.removeEventListener("visibilitychange",s)}},[]);let v=(0,n.useMemo)(()=>{let e=s.filter(e=>{let t=(0,p.wT)(e.tool);return"write"===t||"create"===t||"delete"===t});return e.length>=3?e:s},[s]),j=g?v:v.slice(0,5),N=v.length-5;if(h)return(0,r.jsxs)("section",{className:"animate-pulse","aria-label":"Recent Activity",children:[(0,r.jsx)("div",{className:"h-4 w-36 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]});if(0===s.length)return null;let y=e.agentsContent?.overview;return(0,r.jsxs)("section",{"aria-label":"Recent Activity",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(o.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:y?.recentActivity??"Recent Activity"}),(0,r.jsx)("div",{className:"ml-auto",children:(0,r.jsxs)(i(),{href:"/agents?tab=activity",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors font-display",children:[(0,r.jsx)(l.A,{size:12}),(0,r.jsx)("span",{children:y?.viewAll??"View all"})]})})]}),(0,r.jsx)("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:j.map((e,s)=>{let n=(0,p.wT)(e.tool),a=(0,p.oK)(e.params);return(0,r.jsxs)("div",{className:`flex items-center gap-3 px-3.5 py-2.5 ${s>0?"border-t border-border/30":""} hover:bg-muted/30 transition-colors`,children:[(0,r.jsx)(p.g,{kind:n,locale:t,size:"sm"}),a?(0,r.jsx)(i(),{href:`/view/${(0,u.O0)(a)}`,className:"text-xs text-[var(--amber)]/80 hover:text-[var(--amber)] truncate min-w-0 flex-1 font-display transition-colors",title:a,children:a}):(0,r.jsx)("span",{className:"flex-1"}),e.agentName&&(0,r.jsx)("span",{className:"text-[0.6rem] font-medium text-muted-foreground/70 bg-muted/60 px-1.5 py-0.5 rounded-full shrink-0 font-display",title:e.agentName,children:e.agentName.length>20?e.agentName.slice(0,20)+"...":e.agentName}),"ok"===e.result?(0,r.jsx)(d.A,{size:11,className:"shrink-0 text-[var(--success)]/60"}):(0,r.jsx)(c.A,{size:11,className:"shrink-0 text-[var(--error)]/60"}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums shrink-0 font-display",title:e.ts,children:(0,p.MZ)(e.ts)})]},e.id??s)})}),N>0&&(0,r.jsxs)("button",{onClick:()=>b(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(m.A,{size:12,className:`transition-transform duration-200 ${g?"rotate-180":""}`}),(0,r.jsx)("span",{children:g?y?.showLess??"Show less":`${N} more`})]})]})}},7834:(e,t,s)=>{"use strict";async function r(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let s=document.execCommand("copy");return document.body.removeChild(t),s}catch{return!1}}s.d(t,{l:()=>r})},10377:(e,t,s)=>{"use strict";s.d(t,{Z:()=>h});var r=s(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function i(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function o(){return c}let l=[];function d(){return l}let c=[],m=!1;function u(){m||(c=i(),m=!0)}function x(e){u();let t=t=>{t.key===n&&(c=i(),e())},s=()=>{c=i(),e()};return window.addEventListener("storage",t),window.addEventListener(a,s),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,s)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function h(){u();let e=(0,r.useSyncExternalStore)(x,o,d),t=(0,r.useCallback)(t=>e.includes(t),[e]),s=(0,r.useCallback)(e=>{let t=i(),s=t.indexOf(e);s>=0?t.splice(s,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:s,reorderPins:(0,r.useCallback)(e=>{p(e)},[]),removePin:(0,r.useCallback)(e=>{p(i().filter(t=>t!==e))},[])}}},14153:(e,t,s)=>{Promise.resolve().then(s.bind(s,46515))},22356:(e,t,s)=>{"use strict";s.d(t,{h:()=>r,n:()=>n});class r extends Error{constructor(e,t,s){super(e),this.name="ApiError",this.status=t,this.code=s}}async function n(e,t={}){let s,a,i,{timeout:o=3e4,signal:l,...d}=t;if((o>0||l)&&(s=new AbortController),o>0&&s&&(a=setTimeout(()=>{s.abort(Error(`Request timed out after ${Math.round(o/1e3)}s`))},o)),l&&s)if(l.aborted)s.abort();else{let e=()=>s?.abort();l.addEventListener("abort",e,{once:!0}),i=()=>{l.removeEventListener("abort",e)}}let c=s?.signal??l;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,s=`Request failed (${t.status})`;try{let r=await t.json();r?.error?.code&&r?.error?.message?(s=r.error.message,e=r.error.code):r?.error&&(s="string"==typeof r.error?r.error:r.error.message??s)}catch{}throw new r(s,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),i&&i()}}},25478:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var r=s(9339);let n=(0,r.createServerReference)("00fd29dd1ca8c4396db8b8eed1105f6a77dc877cfe",r.callServer,void 0,r.findSourceMapURL,"scanExampleFilesAction")},27318:(e,t,s)=>{"use strict";s.d(t,{KT:()=>c,NH:()=>d});var r=s(12115);let n={open:!1,initialMessage:"",source:"user",acpAgent:null},a=new Set;function i(){a.forEach(e=>e())}function o(e){return a.add(e),()=>{a.delete(e)}}function l(){return n}function d(e="",t="user",s=null){n={open:!0,initialMessage:e,source:t,acpAgent:s},i()}function c(){let e=(0,r.useSyncExternalStore)(o,l,l);return{open:e.open,initialMessage:e.initialMessage,source:e.source,acpAgent:e.acpAgent,openWith:(0,r.useCallback)((e,t="user",s=null)=>d(e,t,s),[]),close:(0,r.useCallback)(()=>void(n={open:!1,initialMessage:"",source:"user",acpAgent:null},i()),[])}}},29494:(e,t,s)=>{"use strict";s.d(t,{Q:()=>n});var r=s(4235);async function n(e,t){let s=[],n=0;for(let t of e){if(t.size>0xa00000){n++;continue}try{if(t.name.toLowerCase().endsWith(".pdf")){let e=await t.arrayBuffer();s.push({name:t.name,content:function(e){let t=new Uint8Array(e),s=[];for(let e=0;e<t.length;e+=8192)s.push(String.fromCharCode(...t.subarray(e,e+8192)));return btoa(s.join(""))}(e),encoding:"base64"})}else{let e=await t.text();s.push({name:t.name,content:e})}}catch{}}if(0===s.length)return void(n>0?r.oR.error(t.inbox.tooLarge(n),4e3):e.length>0&&r.oR.error(t.inbox.saveFailed,4e3));try{var a;let e=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:s})});if(!e.ok){let s=await e.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",s.error),r.oR.error(t.inbox.saveFailed,4e3);return}let i=await e.json(),o=i.saved?.length??0,l=i.skipped?.length??0;a=n,o>0&&a>0&&0===l?r.oR.success(t.inbox.savedWithOversized(o,a),4e3):o>0&&l+a>0?r.oR.success(t.inbox.savedWithSkipped(o,l+a),4e3):o>0?r.oR.success(t.inbox.savedToast(o),3e3):(a>0&&r.oR.error(t.inbox.tooLarge(a),4e3),l>0&&r.oR.error(t.inbox.savedWithSkipped(0,l),4e3),0===a&&0===l&&r.oR.error(t.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(e){console.error("[QuickDrop] Network error:",e),r.oR.error(t.inbox.saveFailed,4e3)}}},42833:(e,t,s)=>{"use strict";s.d(t,{$2:()=>p,CF:()=>m,MZ:()=>h,g:()=>g,hf:()=>x,oK:()=>f,wT:()=>c,zR:()=>u});var r=s(95155),n=s(84980),a=s(3926),i=s(93631),o=s(68459),l=s(61878),d=s(10762);function c(e){return/search/.test(e)?"search":/read|list|get/.test(e)?"read":/create/.test(e)?"create":/delete/.test(e)?"delete":/write|update|insert|append/.test(e)?"write":"other"}let m={en:{read:"Read",write:"Write",create:"Create",delete:"Delete",search:"Search",other:"Other"},zh:{read:"读取",write:"写入",create:"创建",delete:"删除",search:"搜索",other:"其他"}},u={read:{bg:"rgba(138,180,216,0.10)",text:"#8ab4d8",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:"#c8a0d8",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function x({kind:e,size:t=13}){return"read"===e?(0,r.jsx)(n.A,{size:t}):"write"===e?(0,r.jsx)(a.A,{size:t}):"create"===e?(0,r.jsx)(i.A,{size:t}):"delete"===e?(0,r.jsx)(o.A,{size:t}):"search"===e?(0,r.jsx)(l.A,{size:t}):(0,r.jsx)(d.A,{size:t})}function p(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}function h(e){let t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4),r=Math.floor(t/36e5),n=Math.floor(t/864e5);return s<1?"<1m":s<60?`${s}m`:r<24?`${r}h`:`${n}d`}function f(e){return"string"==typeof e.path?e.path:null}function g({kind:e,locale:t,size:s="md"}){let n=u[e],a=m[t?.startsWith("zh")?"zh":"en"][e];return(0,r.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:3,padding:"sm"===s?"1px 6px":"2px 8px",borderRadius:999,fontSize:"sm"===s?"0.6rem":"0.68rem",fontWeight:600,background:n.bg,color:n.text,border:`1px solid ${n.border}`,flexShrink:0,whiteSpace:"nowrap"},children:[(0,r.jsx)(x,{kind:e,size:"sm"===s?9:10}),a]})}},46515:(e,t,s)=>{"use strict";s.d(t,{default:()=>eo});var r=s(95155),n=s(98500),a=s.n(n),i=s(66088),o=s(33078),l=s(48368),d=s(86901),c=s(61878),m=s(93631),u=s(21628),x=s(90718),p=s(38798),h=s(84980),f=s(50538),g=s(94290),b=s(33210),v=s(51914),j=s(94514),N=s(6296),y=s(68459),w=s(12115),k=s(91053),A=s(91337),z=s(10377),C=s(73321),E=s(92451),S=s(97810),T=s(13545),L=s(31025);let M=[{id:"en",icon:(0,r.jsx)(E.A,{size:20}),dirs:["Profile/","Connections/","Notes/","Workflows/","Resources/","Projects/"]},{id:"zh",icon:(0,r.jsx)(S.A,{size:20}),dirs:["画像/","关系/","笔记/","流程/","资源/","项目/"]},{id:"empty",icon:(0,r.jsx)(l.A,{size:20}),dirs:["README.md","CONFIG.json","INSTRUCTION.md"]}];function $(){let{t:e}=(0,k.Y)(),t=(0,C.useRouter)(),[s,n]=(0,w.useState)(null),[a,i]=(0,w.useState)(null),o=e.onboarding;async function l(e){n(e),i(null);try{let s=await fetch("/api/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||`HTTP ${s.status}`)}t.refresh()}catch(e){console.error("[Onboarding] init failed:",e),i(e instanceof Error?e.message:"Unknown error"),n(null)}}return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-12 md:py-20",children:[(0,r.jsxs)("div",{className:"text-center mb-10",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 mb-4",children:[(0,r.jsx)(d.A,{size:18,className:"text-[var(--amber)]"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed max-w-md mx-auto text-muted-foreground",children:o.subtitle})]}),a&&(0,r.jsxs)("div",{role:"alert",className:"max-w-2xl mx-auto mb-6 flex items-center gap-2.5 px-4 py-3 rounded-lg border border-destructive/30 bg-destructive/5 text-sm text-destructive",children:[(0,r.jsx)(T.A,{size:16,className:"shrink-0"}),(0,r.jsx)("span",{className:"flex-1",children:o.initError??"Initialization failed. Please try again."}),(0,r.jsx)("button",{onClick:()=>i(null),className:"text-xs underline shrink-0 hover:opacity-80",children:o.dismiss??"Dismiss"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-2xl mx-auto mb-10",children:M.map(t=>{let n=s===t.id,a=null!==s;return(0,r.jsxs)("button",{disabled:a,title:a?e.hints.templateInitializing:void 0,onClick:()=>l(t.id),className:"group relative flex flex-col items-start gap-3 p-5 rounded-xl border border-border bg-card text-left transition-all duration-150 hover:border-[var(--amber)]/50 hover:bg-[var(--amber)]/5 disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5 w-full",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:t.icon}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground",children:o.templates[t.id].title}),n&&(0,r.jsx)(N.A,{size:14,className:"animate-spin ml-auto text-[var(--amber)]"})]}),(0,r.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:o.templates[t.id].desc}),(0,r.jsx)("div",{className:"w-full rounded-lg px-3 py-2 text-xs leading-relaxed font-display bg-muted text-muted-foreground opacity-80",children:t.dirs.map(e=>(0,r.jsx)("div",{children:e},e))})]},t.id)})}),(0,r.jsx)("p",{className:"text-center text-xs leading-relaxed max-w-sm mx-auto font-display text-muted-foreground opacity-60",children:o.importHint}),(0,r.jsx)("p",{className:"text-center mt-2",children:(0,r.jsx)("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent("mindos:open-import")),className:"text-xs text-[var(--amber-text)] hover:underline transition-colors",children:e.fileImport.onboardingHint})}),(0,r.jsxs)("div",{className:"max-w-md mx-auto mt-6 flex items-center gap-3 px-4 py-3 rounded-lg border border-border bg-card text-left",children:[(0,r.jsx)(L.A,{size:16,className:"text-muted-foreground shrink-0"}),(0,r.jsx)("div",{className:"min-w-0",children:(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:[o.syncHint??"Want cross-device sync? Run"," ",(0,r.jsx)("code",{className:"font-mono px-1 py-0.5 rounded select-all bg-muted text-[11px]",children:"mindos sync init"})," ",o.syncHintSuffix??"in the terminal after setup."]})})]})]})}var R=s(21362),D=s(21975),O=s(92564),W=s(22164),P=s(67635),I=s(7834),H=s(4235),F=s(27318),K=s(76449);function U(){let{t:e}=(0,k.Y)(),t=e.guide,[s,n]=(0,w.useState)(null),[i,o]=(0,w.useState)(null),[l,c]=(0,w.useState)(!1),[m,u]=(0,w.useState)(!1),x=(0,w.useCallback)(()=>{fetch("/api/setup").then(e=>e.json()).then(e=>{let t=e.guideState;t?.active&&!t.dismissed?n(t):n(null)}).catch(e=>{console.warn("[GuideCard] Fetch guide state failed:",e)})},[]);(0,w.useEffect)(()=>{x();let e=()=>{c(!0)};window.addEventListener("mindos:first-visit",e);let t=()=>x();return window.addEventListener("focus",t),window.addEventListener("guide-state-updated",t),()=>{window.removeEventListener("mindos:first-visit",e),window.removeEventListener("focus",t),window.removeEventListener("guide-state-updated",t)}},[x]);let p=(0,w.useCallback)(e=>{n(t=>t?{...t,...e}:t),fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:e})}).catch(e=>{console.warn("[GuideCard] PATCH guide state failed:",e)})},[]),h=(0,w.useCallback)(()=>{p({dismissed:!0}),n(null)},[p]),f=(0,w.useCallback)(()=>{window.dispatchEvent(new CustomEvent("mindos:open-import"))},[]),g=(0,w.useCallback)(()=>{p({step1Done:!0}),o(null)},[p]);(0,w.useEffect)(()=>{if(!s||s.step1Done)return;let e=()=>p({step1Done:!0});return window.addEventListener("mindos:files-changed",e),()=>window.removeEventListener("mindos:files-changed",e)},[s,s?.step1Done,p]);let v=(0,w.useCallback)(()=>{let e=s?.template==="empty"?t.ai.promptEmpty:t.ai.prompt;(0,F.NH)(e,"guide")},[s,t]),j=(0,w.useCallback)(async()=>{await (0,I.l)(t.agent.copyPrompt)&&H.oR.copy()},[t]),N=(0,w.useCallback)(()=>{u(!0),o(null),p({nextStepIndex:0})},[p]),y=(0,w.useCallback)(()=>{if(!s)return;let e=s.nextStepIndex,r=t.done.steps;e<r.length&&((0,F.NH)(r[e].prompt,"guide-next"),p({nextStepIndex:e+1}))},[s,t,p]);(0,w.useEffect)(()=>{l&&s&&!s.step1Done&&o("import")},[l,s]);let A=(0,w.useRef)({s1:!1,s2:!1});(0,w.useEffect)(()=>{if(!s)return;let e=A.current;s.step1Done&&!e.s1&&(o("ai"),e.s1=!0),s.askedAI&&!e.s2&&(o("agent"),e.s2=!0)},[s?.step1Done,s?.askedAI,s]);let z=s?.step1Done??!1,C=s?.askedAI??!1,E=s?.nextStepIndex??0,S=z&&C&&m,T=S&&E>=t.done.steps.length,L=(0,w.useRef)(null);if((0,w.useEffect)(()=>(T&&(L.current=setTimeout(()=>h(),8e3)),()=>{L.current&&clearTimeout(L.current)}),[T,h]),!s||void 0!==s.walkthroughStep&&s.walkthroughStep>=0&&s.walkthroughStep<K.g.length&&!s.walkthroughDismissed)return null;let M=z&&C&&!m;if(S&&T)return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 flex items-center gap-3 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsx)(d.A,{size:16,className:"animate-spin-slow text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.titleFinal}),(0,r.jsx)(a(),{href:"/explore",className:"text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80",children:e.walkthrough.exploreCta}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]});if(S){let e=t.done.steps[E];return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] px-5 py-4 animate-in fade-in duration-300 bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 text-foreground",children:t.done.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),e&&(0,r.jsxs)("button",{onClick:y,className:"mt-3 flex items-center gap-2 text-sm text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer animate-in fade-in slide-in-from-left-2 duration-300",children:[(0,r.jsx)(R.A,{size:14}),(0,r.jsx)("span",{children:e.hint})]})]})}return(0,r.jsxs)("div",{className:"mb-6 rounded-xl border border-[var(--amber)] overflow-hidden bg-[var(--amber-subtle)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 px-5 pt-4 pb-2",children:[(0,r.jsx)(d.A,{size:16,className:"text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-sm font-semibold flex-1 font-display text-foreground",children:t.title}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground",children:(0,r.jsx)(b.A,{size:14})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 px-5 py-3",children:[(0,r.jsx)(_,{icon:(0,r.jsx)(D.A,{size:16}),title:t.import.title,cta:t.import.cta,done:z,active:"import"===i,onClick:()=>z?null:o("import"===i?null:"import")}),(0,r.jsx)(_,{icon:(0,r.jsx)(O.A,{size:16}),title:t.ai.title,cta:t.ai.cta,done:C,active:"ai"===i,dimmed:!z,onClick:()=>{!C&&z&&o("ai"===i?null:"ai")}}),(0,r.jsx)(_,{icon:(0,r.jsx)(W.A,{size:16}),title:t.agent.title,cta:t.agent.cta,done:m,active:"agent"===i,dimmed:!z||!C,onClick:()=>{z&&C&&o("agent"===i?null:"agent")}})]}),"import"===i&&!z&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.import.desc}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("button",{onClick:f,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:t.import.button}),(0,r.jsx)("button",{onClick:g,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})]})]})}),"ai"===i&&z&&!C&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.ai.desc}),(0,r.jsxs)("button",{onClick:v,className:"text-xs font-medium px-4 py-2 rounded-lg transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[t.ai.cta," →"]})]})}),"agent"===i&&M&&(0,r.jsx)("div",{className:"px-5 pb-4 animate-in slide-in-from-top-2 duration-200",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:t.agent.desc}),(0,r.jsxs)("div",{className:"relative rounded-lg border border-border bg-muted/50 p-3 pr-16",children:[(0,r.jsx)("p",{className:"text-xs font-mono text-foreground leading-relaxed whitespace-pre-wrap",children:t.agent.copyPrompt}),(0,r.jsxs)("button",{onClick:j,className:"absolute top-2 right-2 flex items-center gap-1 text-2xs font-medium px-2.5 py-1.5 rounded-md border transition-all border-border bg-card text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30",children:[(0,r.jsx)(P.A,{size:11}),t.agent.copy]})]}),(0,r.jsx)("div",{className:"flex items-center justify-end mt-3 pt-3 border-t border-border",children:(0,r.jsx)("button",{onClick:N,className:"text-xs px-3 py-1 rounded-lg text-muted-foreground transition-colors hover:bg-muted",children:t.skip})})]})})]})}function _({icon:e,title:t,cta:s,done:n,active:a,dimmed:i,onClick:o}){return(0,r.jsxs)("button",{onClick:o,disabled:n||i,className:`
2
2
  flex flex-col items-center gap-1.5 px-3 py-3 rounded-lg border text-center
3
3
  transition-all duration-150
4
4
  ${n?"opacity-60":i?"opacity-40 cursor-default":"hover:border-[var(--amber)]/30 hover:bg-muted/50 cursor-pointer"}
5
5
  ${a?"border-[var(--amber)]/40 bg-muted/50":""}
6
6
  ${n||a?"border-[var(--amber)]":"border-border"}
7
- `,children:[(0,r.jsx)("span",{className:`${n?"animate-in zoom-in-50 duration-300 text-success":"text-[var(--amber)]"}`,children:n?(0,r.jsx)(j.A,{size:16}):e}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:t}),!n&&!i&&(0,r.jsxs)("span",{className:"text-2xs text-[var(--amber-text)]",children:[s," →"]})]})}var Y=s(49619),J=s(70617);let B="mindos:pulse-collapsed";function Q(){let e=(0,J.cd)(),{t}=(0,k.Y)(),s=t.pulse,[n,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=localStorage.getItem(B);null!==e&&o("1"===e)},[]);let c=e?.agents??[],m=e?.status??null,x=(0,w.useMemo)(()=>[...c].sort((e,t)=>{let s=e=>e.installed?3:2*!!e.present,r=s(t)-s(e);if(0!==r)return r;let n=e.runtimeLastActivityAt?new Date(e.runtimeLastActivityAt).getTime():0;return(t.runtimeLastActivityAt?new Date(t.runtimeLastActivityAt).getTime():0)-n}),[c]).filter(e=>e.installed),p=m?.running??!1,h=()=>{let e=!n;o(e),localStorage.setItem(B,e?"1":"0")};if(!e||e.loading)return(0,r.jsxs)("section",{className:"mb-8 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-32 bg-muted rounded mb-3"}),(0,r.jsx)("div",{className:"h-16 bg-muted/50 rounded-xl"})]});if(c.every(e=>!e.present))return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title})]}),(0,r.jsx)("div",{className:"rounded-xl border border-dashed border-border/60 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,r.jsx)(Y.A,{size:16,className:"text-[var(--amber)]"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:s.connectTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.connectDesc})]}),(0,r.jsxs)(a(),{href:"/agents",className:"shrink-0 inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.connectAction,(0,r.jsx)(u.A,{size:11})]})]})})]});let f=x.length;if(n)return(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("button",{onClick:h,className:"w-full flex items-center gap-2 group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-1",children:[x.slice(0,3).map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/60",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.name})]},e.key)),f>3&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/40",children:["+",f-3]})]}),(0,r.jsx)(i.A,{size:12,className:"ml-auto text-muted-foreground/30 group-hover:text-[var(--amber)] transition-colors"})]})});let g=l?x:x.slice(0,3),b=x.length-3;return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),p&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/50 ml-1",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s.running})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,r.jsx)(a(),{href:"/agents",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:s.manage}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Collapse",children:(0,r.jsx)(i.A,{size:12,className:"rotate-180"})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:g.map(e=>{var t;let n,i=function(e){if(!e)return null;let t=Date.now()-new Date(e).getTime();return t<6e4?"<1m":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`}(e.runtimeLastActivityAt);return(0,r.jsxs)(a(),{href:`/agents/${encodeURIComponent(e.key)}`,className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border hover:border-[var(--amber)]/30 hover:shadow-sm transition-all duration-150 hover:bg-muted/30 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,r.jsxs)("div",{className:"relative w-8 h-8 rounded-lg bg-[var(--amber)]/8 text-[var(--amber-text)] ring-1 ring-[var(--amber)]/15 flex items-center justify-center text-xs font-semibold font-display shrink-0",children:[(n=(t=e.name).split(/[\s-]+/)).length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase(),(0,r.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-500 ring-[1.5px] ring-card"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:e.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/60 block",children:[s.active,i?` \xb7 ${i}`:""]})]})]},e.key)})}),b>0&&(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${l?"rotate-180":""}`}),(0,r.jsx)("span",{children:l?s.showLess:s.showMore(b)})]})]})}var Z=s(15282),G=s(29494);function X({isOrganizing:e=!1}){let{t}=(0,k.Y)(),[s,n]=(0,w.useState)([]),[a,i]=(0,w.useState)(!0),[o,l]=(0,w.useState)(!1),[c,m]=(0,w.useState)(!1),u=(0,w.useRef)(null),x=e||c,p=(0,w.useCallback)(()=>{0===s.length||x||(m(!0),window.dispatchEvent(new CustomEvent("mindos:inbox-organize",{detail:{files:s}})))},[s,x]),h=(0,w.useCallback)(e=>{e&&0!==e.length&&((0,G.Q)(Array.from(e),t),u.current&&(u.current.value=""))},[t]),f=(0,w.useCallback)(async()=>{try{let e=await fetch("/api/inbox");if(!e.ok)return;let t=await e.json();Array.isArray(t.files)&&n(t.files)}catch(e){console.warn("[InboxSection] Failed to fetch inbox:",e)}finally{i(!1)}},[]),g=(0,w.useRef)(void 0),b=(0,w.useCallback)(()=>{clearTimeout(g.current),g.current=setTimeout(f,80)},[f]);(0,w.useEffect)(()=>{f();let e=()=>{m(!1),b()};return window.addEventListener("mindos:files-changed",b),window.addEventListener("mindos:inbox-updated",b),window.addEventListener("mindos:organize-done",e),()=>{clearTimeout(g.current),window.removeEventListener("mindos:files-changed",b),window.removeEventListener("mindos:inbox-updated",b),window.removeEventListener("mindos:organize-done",e)}},[f,b]);let v=(0,w.useMemo)(()=>o?s:s.slice(0,5),[s,o]),j=s.length-5;return a?(0,r.jsxs)("section",{className:"mb-10 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-24 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]}):(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Z.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.inbox.title}),s.length>0&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 text-2xs font-semibold rounded-full bg-[var(--amber)]/15 text-[var(--amber)] tabular-nums font-display",children:t.inbox.count(s.length)}),s.length>0&&(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>u.current?.click(),className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground cursor-pointer font-display",title:t.inbox.uploadButton,children:(0,r.jsx)(D.A,{size:12})}),(0,r.jsxs)("button",{onClick:p,disabled:x,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display disabled:opacity-50 disabled:cursor-not-allowed",title:x?t.inbox.organizing:void 0,children:[x?(0,r.jsx)(N.A,{size:12,className:"animate-spin"}):(0,r.jsx)(d.A,{size:12}),(0,r.jsx)("span",{children:x?t.inbox.organizing:t.inbox.organizeButton})]})]})]}),(0,r.jsx)("input",{ref:u,type:"file",multiple:!0,accept:".md,.txt,.csv,.json,.pdf",className:"hidden",onChange:e=>h(e.target.files)}),0===s.length?(0,r.jsxs)("div",{className:"rounded-xl border-2 border-dashed border-border px-4 py-8 text-center",children:[(0,r.jsx)(Z.A,{size:24,className:"mx-auto mb-2 text-muted-foreground/30"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground/70 font-display",children:t.inbox.emptyTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.inbox.emptyDesc}),(0,r.jsxs)("button",{type:"button",onClick:()=>u.current?.click(),className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,r.jsx)(D.A,{size:12}),t.inbox.uploadButton]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:v.map(e=>(0,r.jsx)(q,{file:e},e.path))}),j>0&&(0,r.jsxs)("button",{onClick:()=>l(e=>!e),className:"flex items-center gap-1 mt-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer font-display",children:[(0,r.jsx)(R.A,{size:12,className:`transition-transform duration-150 ${o?"rotate-90":""}`}),o?t.home.showLess:t.inbox.more(j)]})]})]})}function q({file:e}){let{t}=(0,k.Y)(),s=e.name.endsWith(".csv"),n=function(e,t){let s=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(s<1)return t.justNow;if(s<60)return t.minutesAgo(s);let r=Math.floor(s/60);if(r<24)return t.hoursAgo(r);let n=Math.floor(r/24);return t.daysAgo(n)}(e.modifiedAt,t.home.relativeTime);return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.isAging?"bg-[var(--amber)]/60":"bg-[var(--amber)]"}`}),s?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm truncate flex-1 text-foreground",title:e.name,suppressHydrationWarning:!0,children:e.name}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0 font-display",children:n}),e.isAging&&(0,r.jsx)("span",{title:"7+ days",children:(0,r.jsx)(T.A,{size:11,className:"shrink-0 text-[var(--amber)]/60"})})]})}var V=s(87087),ee=s(82019),et=s(6496);function es(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function er(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function en({icon:e,children:t,count:s,action:n}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:e}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t}),null!=s&&s>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:s}),n?(0,r.jsx)("div",{className:"ml-auto",children:n}):null]})}function ea({expanded:e,onToggle:t,showLabel:s,hideLabel:n,className:a=""}){return(0,r.jsxs)("button",{onClick:t,"aria-expanded":e,className:`flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display ${a}`,children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${e?"rotate-180":""}`}),(0,r.jsx)("span",{children:e?n:s})]})}function ei({filePath:e,mtime:t,formatTime:s,subPath:n}){let i=e.endsWith(".csv"),d=e.split("/").pop()||e;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[i?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:d}),n&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:n})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground opacity-40",suppressHydrationWarning:!0,children:s(t)})]})}function eo({recent:e,existingFiles:t,spaces:s}){let{t:n}=(0,k.Y)(),[i,g]=(0,w.useState)(!1),[b,v]=(0,w.useState)(!1),[j,N]=(0,w.useState)(0),y=n.ask?.suggestions??["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"];(0,w.useEffect)(()=>{let e=setInterval(()=>{N(e=>(e+1)%y.length)},4e3);return()=>clearInterval(e)},[y.length]);let z=s??[],{groups:C,rootFiles:E}=(0,w.useMemo)(()=>(function(e,t){let s=new Map,r=[];for(let n of e){let e=n.path.split("/");if(e.length<2){r.push(n);continue}let a=e[0],i=t.find(e=>e.name===a);s.has(a)||s.set(a,{space:a,spacePath:a+"/",files:[],latestMtime:0,totalFiles:i?.fileCount??0});let o=s.get(a);o.files.push(n),o.latestMtime=Math.max(o.latestMtime,n.mtime)}return{groups:[...s.values()].sort((e,t)=>t.latestMtime-e.latestMtime),rootFiles:r}})(e,z),[e,z]);if(0===e.length)return(0,r.jsx)($,{});let S=e=>(0,A.KW)(e,n.home.relativeTime),T=e[0];return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14",children:[(0,r.jsx)(U,{}),(0,r.jsx)(ec,{}),(0,r.jsxs)("div",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("div",{className:"w-1 h-7 rounded-full bg-gradient-to-b from-[var(--amber)] to-[var(--amber)]/20"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground pl-4 max-w-lg mb-6",children:n.app.tagline}),(0,r.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 pl-4",children:[(0,r.jsxs)("button",{onClick:er,title:"⌘/","data-walkthrough":"ask-button",className:"flex-1 flex items-center gap-3 px-4 py-3 rounded-xl border border-border/60 shadow-sm bg-card transition-all duration-150 hover:border-[var(--amber)]/50 hover:shadow-md group",children:[(0,r.jsx)(d.A,{size:15,className:"shrink-0 text-[var(--amber)] group-hover:scale-110 transition-transform duration-150"}),(0,r.jsx)("div",{className:"flex-1 min-h-[1.5rem] flex items-center",children:(0,r.jsx)("span",{className:"text-sm text-left text-muted-foreground animate-in fade-in duration-300",children:y[j]},j)}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-mono font-medium bg-[var(--amber-dim)] text-[var(--amber-text)]",children:"⌘/"})]}),(0,r.jsxs)("button",{onClick:es,title:"⌘K",className:"flex items-center gap-2 px-3.5 py-3 rounded-xl border border-border/60 text-sm text-muted-foreground transition-all duration-150 shrink-0 hover:bg-muted hover:shadow-sm",children:[(0,r.jsx)(c.A,{size:14}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-mono bg-muted",children:"⌘K"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-4 pl-4",children:[(0,r.jsxs)(a(),{href:"/view/Untitled.md",className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150 hover:shadow-sm bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,r.jsx)(m.A,{size:14}),(0,r.jsx)("span",{children:n.home.newNote})]}),T&&(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(T.path)}`,className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,r.jsx)(u.A,{size:14,className:"text-[var(--amber)]/60"}),(0,r.jsx)("span",{children:n.home.continueEditing}),(0,r.jsx)("span",{className:"text-xs opacity-40 truncate max-w-32",suppressHydrationWarning:!0,children:T.path.split("/").pop()})]})]})]}),(0,r.jsx)(Q,{}),(0,r.jsx)("div",{className:"mb-10",children:(0,r.jsx)(et.A,{})}),(0,r.jsx)(X,{}),(z.length,(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(x.A,{size:13}),count:z.length>0?z.length:void 0,action:(0,r.jsx)(ed,{t:n}),children:n.home.spaces}),z.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:(b?z:z.slice(0,6)).map(e=>{let t=(0,A.IX)(e.name),s=(0,A.vr)(e.name),i=0===e.fileCount;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:`flex items-start gap-3 px-3.5 py-3 rounded-xl border transition-all duration-150 ${i?"border-dashed border-border/50 opacity-50 hover:opacity-70":"border-border hover:border-[var(--amber)]/30 hover:shadow-sm"}`,children:[t?(0,r.jsx)("span",{className:"text-lg leading-none shrink-0 mt-0.5",suppressHydrationWarning:!0,children:t}):(0,r.jsx)(p.A,{size:16,className:"shrink-0 text-[var(--amber)] mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate block text-foreground",children:s}),e.description&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",suppressHydrationWarning:!0,children:e.description}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 mt-0.5 block tabular-nums",children:n.home.nFiles(e.fileCount)})]})]},e.name)})}),z.length>6&&(0,r.jsx)(ea,{expanded:b,onToggle:()=>v(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2"})]}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:n.home.noSpacesYet??"No spaces yet. Create one to organize your knowledge."})]})),(0,r.jsx)(el,{formatTime:S}),e.length>0&&(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(h.A,{size:13}),count:e.length,action:(0,r.jsxs)(a(),{href:"/changes",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 font-display",children:[(0,r.jsx)(f.A,{size:12}),(0,r.jsx)("span",{children:n.home.changeHistory})]}),children:n.home.recentlyEdited}),C.length>0?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[C.map(e=>{let t=i?e.files:e.files.slice(0,3),s=e.files.length>3;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.spacePath)}`,className:"flex items-center gap-2 px-1 py-1.5 rounded-lg group transition-colors hover:bg-muted/50",children:[(0,r.jsx)(p.A,{size:13,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-foreground group-hover:text-[var(--amber)] transition-colors",suppressHydrationWarning:!0,children:e.space}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/50 tabular-nums",suppressHydrationWarning:!0,children:[n.home.nFiles(e.totalFiles)," \xb7 ",S(e.latestMtime)]}),s&&!i&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/30 tabular-nums",children:["+",e.files.length-3]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:t.map(({path:e,mtime:t})=>(0,r.jsx)(ei,{filePath:e,mtime:t,formatTime:S,subPath:e.split("/").slice(1,-1).join("/")},e))})]},e.space)}),E.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,r.jsx)(l.A,{size:13,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-muted-foreground/60",children:n.home.other})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:E.map(({path:e,mtime:t})=>(0,r.jsx)(ei,{filePath:e,mtime:t,formatTime:S},e))})]}),C.some(e=>e.files.length>3)&&(0,r.jsx)(ea,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-1 ml-1"})]}):(0,r.jsxs)("div",{className:"relative pl-4",children:[(0,r.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-px bg-border/40"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:(i?e:e.slice(0,5)).map(({path:e,mtime:t},s)=>{let n=e.endsWith(".csv"),i=e.split("/").pop()||e,d=e.split("/").slice(0,-1).join("/");return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:`absolute -left-4 top-1/2 -translate-y-1/2 rounded-full transition-all duration-150 group-hover:scale-150 ${0===s?"w-2 h-2 bg-[var(--amber)] ring-2 ring-[var(--amber)]/20":"w-1.5 h-1.5 bg-muted-foreground/20"}`}),(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 group-hover:translate-x-0.5 hover:bg-muted",children:[n?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:i}),d&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground/40",suppressHydrationWarning:!0,children:d})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground/40",suppressHydrationWarning:!0,children:S(t)})]})]},e)})}),e.length>5&&(0,r.jsx)(ea,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2 ml-3"})]})]}),(0,r.jsxs)("div",{className:"py-6 border-t border-border/20 flex items-center gap-1.5 text-xs font-display text-muted-foreground/30",children:[(0,r.jsx)(d.A,{size:10,className:"text-[var(--amber)]/40"}),(0,r.jsx)("span",{children:n.app.footer})]})]})}function el({formatTime:e}){let{t}=(0,k.Y)(),{pinnedFiles:s,removePin:n}=(0,z.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-12",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(g.A,{size:13}),count:s.length,children:t.pinnedFiles.title}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:s.map(e=>{let s=e.split("/").pop()||e,i=e.split("/").slice(0,-1).join("/"),d=e.endsWith(".csv");return(0,r.jsxs)("div",{className:"group/pin relative",children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted",children:[(0,r.jsx)(g.A,{size:12,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)]"}),d?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:s}),i&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:i})]})]}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e)},className:"absolute right-2 top-1/2 -translate-y-1/2 hidden group-hover/pin:flex p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:t.pinnedFiles.removedToast,children:(0,r.jsx)(b.A,{size:12})})]},e)})})]})}function ed({t:e}){return(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display",children:[(0,r.jsx)(v.A,{size:12}),(0,r.jsx)("span",{children:e.home.newSpace})]})}function ec(){let{t:e}=(0,k.Y)(),[t,s]=(0,w.useState)(null),[n,a]=(0,w.useState)(!1),[i,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{(0,V.D)().then(e=>{e.files.length>0&&s(e.files.length)}).catch(e=>{console.warn("[HomeContent] scanExampleFilesAction failed:",e)})},[]);let c=(0,w.useCallback)(async()=>{if(null!==t){a(!0);try{(await (0,ee.E)()).success&&(o(!0),setTimeout(()=>d(!0),2500))}catch{}a(!1)}},[t]);return l||null===t||0===t?null:i?(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-2.5 px-4 py-3 rounded-xl border border-success/30 bg-success/5 animate-in fade-in duration-300",children:[(0,r.jsx)(j.A,{size:14,className:"text-success shrink-0"}),(0,r.jsx)("span",{className:"text-xs text-success",children:e.home.cleanupExamplesDone})]}):(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-3 px-4 py-3 rounded-xl border border-border bg-muted/30 animate-in fade-in duration-300",children:[(0,r.jsx)("span",{className:"text-sm leading-none shrink-0",children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:e.home.cleanupExamples(t)}),(0,r.jsxs)("button",{onClick:c,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors shrink-0 disabled:opacity-50 bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80",children:[n?(0,r.jsx)(N.A,{size:11,className:"animate-spin"}):(0,r.jsx)(y.A,{size:11}),e.home.cleanupExamplesButton]}),(0,r.jsx)("button",{onClick:()=>d(!0),className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground shrink-0",children:(0,r.jsx)(b.A,{size:12})})]})}},70617:(e,t,s)=>{"use strict";s.d(t,{cd:()=>d,kr:()=>l,zd:()=>o});var r=s(1934),n=s(22356);let a=null;async function i(e){a?.abort();let t=new AbortController;a=t;try{let[s,r,a]=await Promise.all([(0,n.n)("/api/mcp/status",{signal:t.signal}),(0,n.n)("/api/mcp/agents",{signal:t.signal}),(0,n.n)("/api/skills",{signal:t.signal})]);t.signal.aborted||e({status:s,agents:r.agents,skills:a.skills})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}finally{t.signal.aborted||e({loading:!1})}}let o=(0,r.v)((e,t)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>i(e),toggleSkill:async(s,r)=>{e({skills:t().skills.map(e=>e.name===s?{...e,enabled:r}:e)});try{return await (0,n.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:s,enabled:r})}),!0}catch{return e({skills:t().skills.map(e=>e.name===s?{...e,enabled:!r}:e)}),!1}},installAgent:async(s,r)=>{let a=t().agents.find(e=>e.key===s);if(!a)return!1;try{let t=await (0,n.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:s,scope:r?.scope??(a.hasProjectScope?"project":"global"),transport:r?.transport??a.preferredTransport}],transport:"auto"})}),o=t.results?.[0],l=o?.ok===!0||o?.status==="ok";return l&&await i(e),l}catch{return!1}},_init:()=>{let t;i(e);let s=()=>{clearTimeout(t),t=setTimeout(()=>i(e),500)};window.addEventListener("mindos:skills-changed",s);let r=setInterval(()=>{"visible"===document.visibilityState&&i(e)},3e4);return()=>{a?.abort(),clearTimeout(t),clearInterval(r),window.removeEventListener("mindos:skills-changed",s)}}}));function l(){return o()}function d(){return o()}},76449:(e,t,s)=>{"use strict";s.d(t,{g:()=>r});let r=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},82019:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(9339);let n=(0,r.createServerReference)("003ae5a055ed899c98dcb39ae8c0814c40c3475972",r.callServer,void 0,r.findSourceMapURL,"cleanupExamplesAction")},87087:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var r=s(9339);let n=(0,r.createServerReference)("000080ce55228f528c381a8b2445ab60789d69b915",r.callServer,void 0,r.findSourceMapURL,"scanExampleFilesAction")},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>l,KW:()=>o,O0:()=>i,cn:()=>a,vr:()=>d});var r=s(29722),n=s(622);function a(...e){return(0,n.QP)((0,r.$)(e))}function i(e){return e.split("/").map(encodeURIComponent).join("/")}function o(e,t){let s=Date.now()-e,r=Math.floor(s/6e4),n=Math.floor(s/36e5),a=Math.floor(s/864e5);return r<1?t.justNow:r<60?t.minutesAgo(r):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function l(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}}},e=>{e.O(0,[6926,9602,3160,1053,8441,3794,7358],()=>e(e.s=14153)),_N_E=e.O()}]);
7
+ `,children:[(0,r.jsx)("span",{className:`${n?"animate-in zoom-in-50 duration-300 text-success":"text-[var(--amber)]"}`,children:n?(0,r.jsx)(j.A,{size:16}):e}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:t}),!n&&!i&&(0,r.jsxs)("span",{className:"text-2xs text-[var(--amber-text)]",children:[s," →"]})]})}var Y=s(49619),J=s(70617);let B="mindos:pulse-collapsed";function Q(){let e=(0,J.cd)(),{t}=(0,k.Y)(),s=t.pulse,[n,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=localStorage.getItem(B);null!==e&&o("1"===e)},[]);let c=e?.agents??[],m=e?.status??null,x=(0,w.useMemo)(()=>[...c].sort((e,t)=>{let s=e=>e.installed?3:2*!!e.present,r=s(t)-s(e);if(0!==r)return r;let n=e.runtimeLastActivityAt?new Date(e.runtimeLastActivityAt).getTime():0;return(t.runtimeLastActivityAt?new Date(t.runtimeLastActivityAt).getTime():0)-n}),[c]).filter(e=>e.installed),p=m?.running??!1,h=()=>{let e=!n;o(e),localStorage.setItem(B,e?"1":"0")};if(!e||e.loading)return(0,r.jsxs)("section",{className:"mb-8 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-32 bg-muted rounded mb-3"}),(0,r.jsx)("div",{className:"h-16 bg-muted/50 rounded-xl"})]});if(c.every(e=>!e.present))return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title})]}),(0,r.jsx)("div",{className:"rounded-xl border border-dashed border-border/60 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,r.jsx)(Y.A,{size:16,className:"text-[var(--amber)]"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:s.connectTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.connectDesc})]}),(0,r.jsxs)(a(),{href:"/agents",className:"shrink-0 inline-flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.connectAction,(0,r.jsx)(u.A,{size:11})]})]})})]});let f=x.length;if(n)return(0,r.jsx)("section",{className:"mb-10",children:(0,r.jsxs)("button",{onClick:h,className:"w-full flex items-center gap-2 group cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-1",children:[x.slice(0,3).map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/60",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:e.name})]},e.key)),f>3&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/40",children:["+",f-3]})]}),(0,r.jsx)(i.A,{size:12,className:"ml-auto text-muted-foreground/30 group-hover:text-[var(--amber)] transition-colors"})]})});let g=l?x:x.slice(0,3),b=x.length-3;return(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Y.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:s.title}),f>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:f}),p&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/50 ml-1",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:s.running})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,r.jsx)(a(),{href:"/agents",className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity font-display",children:s.manage}),(0,r.jsx)("button",{onClick:h,className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground/40 hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Collapse",children:(0,r.jsx)(i.A,{size:12,className:"rotate-180"})})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:g.map(e=>{var t;let n,i=function(e){if(!e)return null;let t=Date.now()-new Date(e).getTime();return t<6e4?"<1m":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`}(e.runtimeLastActivityAt);return(0,r.jsxs)(a(),{href:`/agents/${encodeURIComponent(e.key)}`,className:"flex items-center gap-3 px-3.5 py-3 rounded-xl border border-border hover:border-[var(--amber)]/30 hover:shadow-sm transition-all duration-150 hover:bg-muted/30 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,r.jsxs)("div",{className:"relative w-8 h-8 rounded-lg bg-[var(--amber)]/8 text-[var(--amber-text)] ring-1 ring-[var(--amber)]/15 flex items-center justify-center text-xs font-semibold font-display shrink-0",children:[(n=(t=e.name).split(/[\s-]+/)).length>=2?(n[0][0]+n[1][0]).toUpperCase():t.slice(0,2).toUpperCase(),(0,r.jsx)("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-500 ring-[1.5px] ring-card"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:e.name}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/60 block",children:[s.active,i?` \xb7 ${i}`:""]})]})]},e.key)})}),b>0&&(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-1.5 mt-2 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${l?"rotate-180":""}`}),(0,r.jsx)("span",{children:l?s.showLess:s.showMore(b)})]})]})}var Z=s(15282),G=s(29494);function X({isOrganizing:e=!1}){let{t}=(0,k.Y)(),[s,n]=(0,w.useState)([]),[a,i]=(0,w.useState)(!0),[o,l]=(0,w.useState)(!1),[c,m]=(0,w.useState)(!1),u=(0,w.useRef)(null),x=e||c,p=(0,w.useCallback)(()=>{0===s.length||x||(m(!0),window.dispatchEvent(new CustomEvent("mindos:inbox-organize",{detail:{files:s}})))},[s,x]),h=(0,w.useCallback)(e=>{e&&0!==e.length&&((0,G.Q)(Array.from(e),t),u.current&&(u.current.value=""))},[t]),f=(0,w.useCallback)(async()=>{try{let e=await fetch("/api/inbox");if(!e.ok)return;let t=await e.json();Array.isArray(t.files)&&n(t.files)}catch(e){console.warn("[InboxSection] Failed to fetch inbox:",e)}finally{i(!1)}},[]),g=(0,w.useRef)(void 0),b=(0,w.useCallback)(()=>{clearTimeout(g.current),g.current=setTimeout(f,80)},[f]);(0,w.useEffect)(()=>{f();let e=()=>{m(!1),b()};return window.addEventListener("mindos:files-changed",b),window.addEventListener("mindos:inbox-updated",b),window.addEventListener("mindos:organize-done",e),()=>{clearTimeout(g.current),window.removeEventListener("mindos:files-changed",b),window.removeEventListener("mindos:inbox-updated",b),window.removeEventListener("mindos:organize-done",e)}},[f,b]);let v=(0,w.useMemo)(()=>o?s:s.slice(0,5),[s,o]),j=s.length-5;return a?(0,r.jsxs)("section",{className:"mb-10 animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 w-24 bg-muted rounded mb-3"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"}),(0,r.jsx)("div",{className:"h-10 bg-muted/50 rounded-lg"})]})]}):(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:(0,r.jsx)(Z.A,{size:13})}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t.inbox.title}),s.length>0&&(0,r.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 text-2xs font-semibold rounded-full bg-[var(--amber)]/15 text-[var(--amber)] tabular-nums font-display",children:t.inbox.count(s.length)}),s.length>0&&(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:()=>u.current?.click(),className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground cursor-pointer font-display",title:t.inbox.uploadButton,children:(0,r.jsx)(D.A,{size:12})}),(0,r.jsxs)("button",{onClick:p,disabled:x,className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display disabled:opacity-50 disabled:cursor-not-allowed",title:x?t.inbox.organizing:void 0,children:[x?(0,r.jsx)(N.A,{size:12,className:"animate-spin"}):(0,r.jsx)(d.A,{size:12}),(0,r.jsx)("span",{children:x?t.inbox.organizing:t.inbox.organizeButton})]})]})]}),(0,r.jsx)("input",{ref:u,type:"file",multiple:!0,accept:".md,.txt,.csv,.json,.pdf",className:"hidden",onChange:e=>h(e.target.files)}),0===s.length?(0,r.jsxs)("div",{className:"rounded-xl border-2 border-dashed border-border px-4 py-8 text-center",children:[(0,r.jsx)(Z.A,{size:24,className:"mx-auto mb-2 text-muted-foreground/30"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground/70 font-display",children:t.inbox.emptyTitle}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground/40 mt-1",children:t.inbox.emptyDesc}),(0,r.jsxs)("button",{type:"button",onClick:()=>u.current?.click(),className:"mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80",children:[(0,r.jsx)(D.A,{size:12}),t.inbox.uploadButton]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:v.map(e=>(0,r.jsx)(q,{file:e},e.path))}),j>0&&(0,r.jsxs)("button",{onClick:()=>l(e=>!e),className:"flex items-center gap-1 mt-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer font-display",children:[(0,r.jsx)(R.A,{size:12,className:`transition-transform duration-150 ${o?"rotate-90":""}`}),o?t.home.showLess:t.inbox.more(j)]})]})]})}function q({file:e}){let{t}=(0,k.Y)(),s=e.name.endsWith(".csv"),n=function(e,t){let s=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(s<1)return t.justNow;if(s<60)return t.minutesAgo(s);let r=Math.floor(s/60);if(r<24)return t.hoursAgo(r);let n=Math.floor(r/24);return t.daysAgo(n)}(e.modifiedAt,t.home.relativeTime);return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.isAging?"bg-[var(--amber)]/60":"bg-[var(--amber)]"}`}),s?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm truncate flex-1 text-foreground",title:e.name,suppressHydrationWarning:!0,children:e.name}),(0,r.jsx)("span",{className:"text-2xs text-muted-foreground/50 tabular-nums shrink-0 font-display",children:n}),e.isAging&&(0,r.jsx)("span",{title:"7+ days",children:(0,r.jsx)(T.A,{size:11,className:"shrink-0 text-[var(--amber)]/60"})})]})}var V=s(25478),ee=s(99254),et=s(6496);function es(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0}))}function er(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"/",metaKey:!0,bubbles:!0}))}function en({icon:e,children:t,count:s,action:n}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,r.jsx)("span",{className:"text-[var(--amber)]",children:e}),(0,r.jsx)("h2",{className:"text-sm font-semibold font-display text-foreground",children:t}),null!=s&&s>0&&(0,r.jsx)("span",{className:"text-xs tabular-nums text-muted-foreground font-display",children:s}),n?(0,r.jsx)("div",{className:"ml-auto",children:n}):null]})}function ea({expanded:e,onToggle:t,showLabel:s,hideLabel:n,className:a=""}){return(0,r.jsxs)("button",{onClick:t,"aria-expanded":e,className:`flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display ${a}`,children:[(0,r.jsx)(i.A,{size:12,className:`transition-transform duration-200 ${e?"rotate-180":""}`}),(0,r.jsx)("span",{children:e?n:s})]})}function ei({filePath:e,mtime:t,formatTime:s,subPath:n}){let i=e.endsWith(".csv"),d=e.split("/").pop()||e;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted group",children:[i?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:d}),n&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:n})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground opacity-40",suppressHydrationWarning:!0,children:s(t)})]})}function eo({recent:e,existingFiles:t,spaces:s}){let{t:n}=(0,k.Y)(),[i,g]=(0,w.useState)(!1),[b,v]=(0,w.useState)(!1),[j,N]=(0,w.useState)(0),y=n.ask?.suggestions??["Summarize this document","List all action items and TODOs","What are the key points?","Find related notes on this topic"];(0,w.useEffect)(()=>{let e=setInterval(()=>{N(e=>(e+1)%y.length)},4e3);return()=>clearInterval(e)},[y.length]);let z=s??[],{groups:C,rootFiles:E}=(0,w.useMemo)(()=>(function(e,t){let s=new Map,r=[];for(let n of e){let e=n.path.split("/");if(e.length<2){r.push(n);continue}let a=e[0],i=t.find(e=>e.name===a);s.has(a)||s.set(a,{space:a,spacePath:a+"/",files:[],latestMtime:0,totalFiles:i?.fileCount??0});let o=s.get(a);o.files.push(n),o.latestMtime=Math.max(o.latestMtime,n.mtime)}return{groups:[...s.values()].sort((e,t)=>t.latestMtime-e.latestMtime),rootFiles:r}})(e,z),[e,z]);if(0===e.length)return(0,r.jsx)($,{});let S=e=>(0,A.KW)(e,n.home.relativeTime),T=e[0];return(0,r.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14",children:[(0,r.jsx)(U,{}),(0,r.jsx)(ec,{}),(0,r.jsxs)("div",{className:"mb-10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsx)("div",{className:"w-1 h-7 rounded-full bg-gradient-to-b from-[var(--amber)] to-[var(--amber)]/20"}),(0,r.jsx)("h1",{className:"text-2xl font-semibold tracking-tight font-display text-foreground",children:"MindOS"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground pl-4 max-w-lg mb-6",children:n.app.tagline}),(0,r.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 pl-4",children:[(0,r.jsxs)("button",{onClick:er,title:"⌘/","data-walkthrough":"ask-button",className:"flex-1 flex items-center gap-3 px-4 py-3 rounded-xl border border-border/60 shadow-sm bg-card transition-all duration-150 hover:border-[var(--amber)]/50 hover:shadow-md group",children:[(0,r.jsx)(d.A,{size:15,className:"shrink-0 text-[var(--amber)] group-hover:scale-110 transition-transform duration-150"}),(0,r.jsx)("div",{className:"flex-1 min-h-[1.5rem] flex items-center",children:(0,r.jsx)("span",{className:"text-sm text-left text-muted-foreground animate-in fade-in duration-300",children:y[j]},j)}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-mono font-medium bg-[var(--amber-dim)] text-[var(--amber-text)]",children:"⌘/"})]}),(0,r.jsxs)("button",{onClick:es,title:"⌘K",className:"flex items-center gap-2 px-3.5 py-3 rounded-xl border border-border/60 text-sm text-muted-foreground transition-all duration-150 shrink-0 hover:bg-muted hover:shadow-sm",children:[(0,r.jsx)(c.A,{size:14}),(0,r.jsx)("kbd",{className:"hidden sm:inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-mono bg-muted",children:"⌘K"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-4 pl-4",children:[(0,r.jsxs)(a(),{href:"/view/Untitled.md",className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-all duration-150 hover:shadow-sm bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,r.jsx)(m.A,{size:14}),(0,r.jsx)("span",{children:n.home.newNote})]}),T&&(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(T.path)}`,className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-lg text-sm font-medium transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,r.jsx)(u.A,{size:14,className:"text-[var(--amber)]/60"}),(0,r.jsx)("span",{children:n.home.continueEditing}),(0,r.jsx)("span",{className:"text-xs opacity-40 truncate max-w-32",suppressHydrationWarning:!0,children:T.path.split("/").pop()})]})]})]}),(0,r.jsx)(Q,{}),(0,r.jsx)("div",{className:"mb-10",children:(0,r.jsx)(et.A,{})}),(0,r.jsx)(X,{}),(z.length,(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(x.A,{size:13}),count:z.length>0?z.length:void 0,action:(0,r.jsx)(ed,{t:n}),children:n.home.spaces}),z.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:(b?z:z.slice(0,6)).map(e=>{let t=(0,A.IX)(e.name),s=(0,A.vr)(e.name),i=0===e.fileCount;return(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.path)}`,className:`flex items-start gap-3 px-3.5 py-3 rounded-xl border transition-all duration-150 ${i?"border-dashed border-border/50 opacity-50 hover:opacity-70":"border-border hover:border-[var(--amber)]/30 hover:shadow-sm"}`,children:[t?(0,r.jsx)("span",{className:"text-lg leading-none shrink-0 mt-0.5",suppressHydrationWarning:!0,children:t}):(0,r.jsx)(p.A,{size:16,className:"shrink-0 text-[var(--amber)] mt-0.5"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate block text-foreground",children:s}),e.description&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-0.5",suppressHydrationWarning:!0,children:e.description}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground/50 mt-0.5 block tabular-nums",children:n.home.nFiles(e.fileCount)})]})]},e.name)})}),z.length>6&&(0,r.jsx)(ea,{expanded:b,onToggle:()=>v(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2"})]}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:n.home.noSpacesYet??"No spaces yet. Create one to organize your knowledge."})]})),(0,r.jsx)(el,{formatTime:S}),e.length>0&&(0,r.jsxs)("section",{className:"mb-10",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(h.A,{size:13}),count:e.length,action:(0,r.jsxs)(a(),{href:"/changes",className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 font-display",children:[(0,r.jsx)(f.A,{size:12}),(0,r.jsx)("span",{children:n.home.changeHistory})]}),children:n.home.recentlyEdited}),C.length>0?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[C.map(e=>{let t=i?e.files:e.files.slice(0,3),s=e.files.length>3;return(0,r.jsxs)("div",{children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e.spacePath)}`,className:"flex items-center gap-2 px-1 py-1.5 rounded-lg group transition-colors hover:bg-muted/50",children:[(0,r.jsx)(p.A,{size:13,className:"shrink-0 text-[var(--amber)]"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-foreground group-hover:text-[var(--amber)] transition-colors",suppressHydrationWarning:!0,children:e.space}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/50 tabular-nums",suppressHydrationWarning:!0,children:[n.home.nFiles(e.totalFiles)," \xb7 ",S(e.latestMtime)]}),s&&!i&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground/30 tabular-nums",children:["+",e.files.length-3]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:t.map(({path:e,mtime:t})=>(0,r.jsx)(ei,{filePath:e,mtime:t,formatTime:S,subPath:e.split("/").slice(1,-1).join("/")},e))})]},e.space)}),E.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,r.jsx)(l.A,{size:13,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsx)("span",{className:"text-xs font-semibold font-display text-muted-foreground/60",children:n.home.other})]}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:E.map(({path:e,mtime:t})=>(0,r.jsx)(ei,{filePath:e,mtime:t,formatTime:S},e))})]}),C.some(e=>e.files.length>3)&&(0,r.jsx)(ea,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-1 ml-1"})]}):(0,r.jsxs)("div",{className:"relative pl-4",children:[(0,r.jsx)("div",{className:"absolute left-0 top-1 bottom-1 w-px bg-border/40"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:(i?e:e.slice(0,5)).map(({path:e,mtime:t},s)=>{let n=e.endsWith(".csv"),i=e.split("/").pop()||e,d=e.split("/").slice(0,-1).join("/");return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("div",{"aria-hidden":"true",className:`absolute -left-4 top-1/2 -translate-y-1/2 rounded-full transition-all duration-150 group-hover:scale-150 ${0===s?"w-2 h-2 bg-[var(--amber)] ring-2 ring-[var(--amber)]/20":"w-1.5 h-1.5 bg-muted-foreground/20"}`}),(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 group-hover:translate-x-0.5 hover:bg-muted",children:[n?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground/50"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:i}),d&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground/40",suppressHydrationWarning:!0,children:d})]}),(0,r.jsx)("span",{className:"text-xs shrink-0 tabular-nums font-display text-muted-foreground/40",suppressHydrationWarning:!0,children:S(t)})]})]},e)})}),e.length>5&&(0,r.jsx)(ea,{expanded:i,onToggle:()=>g(e=>!e),showLabel:n.home.showMore,hideLabel:n.home.showLess,className:"mt-2 ml-3"})]})]}),(0,r.jsxs)("div",{className:"py-6 border-t border-border/20 flex items-center gap-1.5 text-xs font-display text-muted-foreground/30",children:[(0,r.jsx)(d.A,{size:10,className:"text-[var(--amber)]/40"}),(0,r.jsx)("span",{children:n.app.footer})]})]})}function el({formatTime:e}){let{t}=(0,k.Y)(),{pinnedFiles:s,removePin:n}=(0,z.Z)();return 0===s.length?null:(0,r.jsxs)("section",{className:"mb-12",children:[(0,r.jsx)(en,{icon:(0,r.jsx)(g.A,{size:13}),count:s.length,children:t.pinnedFiles.title}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:s.map(e=>{let s=e.split("/").pop()||e,i=e.split("/").slice(0,-1).join("/"),d=e.endsWith(".csv");return(0,r.jsxs)("div",{className:"group/pin relative",children:[(0,r.jsxs)(a(),{href:`/view/${(0,A.O0)(e)}`,className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-all duration-100 hover:translate-x-0.5 hover:bg-muted",children:[(0,r.jsx)(g.A,{size:12,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)]"}),d?(0,r.jsx)(o.A,{size:12,className:"shrink-0 text-success"}):(0,r.jsx)(l.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-sm truncate block text-foreground",suppressHydrationWarning:!0,children:s}),i&&(0,r.jsx)("span",{className:"text-xs truncate block text-muted-foreground opacity-50",suppressHydrationWarning:!0,children:i})]})]}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(e)},className:"absolute right-2 top-1/2 -translate-y-1/2 hidden group-hover/pin:flex p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:t.pinnedFiles.removedToast,children:(0,r.jsx)(b.A,{size:12})})]},e)})})]})}function ed({t:e}){return(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new Event("mindos:create-space")),className:"flex items-center gap-1.5 text-xs font-medium text-[var(--amber)] transition-colors hover:opacity-80 cursor-pointer font-display",children:[(0,r.jsx)(v.A,{size:12}),(0,r.jsx)("span",{children:e.home.newSpace})]})}function ec(){let{t:e}=(0,k.Y)(),[t,s]=(0,w.useState)(null),[n,a]=(0,w.useState)(!1),[i,o]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1);(0,w.useEffect)(()=>{(0,V.D)().then(e=>{e.files.length>0&&s(e.files.length)}).catch(e=>{console.warn("[HomeContent] scanExampleFilesAction failed:",e)})},[]);let c=(0,w.useCallback)(async()=>{if(null!==t){a(!0);try{(await (0,ee.E)()).success&&(o(!0),setTimeout(()=>d(!0),2500))}catch{}a(!1)}},[t]);return l||null===t||0===t?null:i?(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-2.5 px-4 py-3 rounded-xl border border-success/30 bg-success/5 animate-in fade-in duration-300",children:[(0,r.jsx)(j.A,{size:14,className:"text-success shrink-0"}),(0,r.jsx)("span",{className:"text-xs text-success",children:e.home.cleanupExamplesDone})]}):(0,r.jsxs)("div",{className:"mb-6 flex items-center gap-3 px-4 py-3 rounded-xl border border-border bg-muted/30 animate-in fade-in duration-300",children:[(0,r.jsx)("span",{className:"text-sm leading-none shrink-0",children:"\uD83E\uDDEA"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:e.home.cleanupExamples(t)}),(0,r.jsxs)("button",{onClick:c,disabled:n,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors shrink-0 disabled:opacity-50 bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80",children:[n?(0,r.jsx)(N.A,{size:11,className:"animate-spin"}):(0,r.jsx)(y.A,{size:11}),e.home.cleanupExamplesButton]}),(0,r.jsx)("button",{onClick:()=>d(!0),className:"p-1 rounded hover:bg-muted transition-colors text-muted-foreground shrink-0",children:(0,r.jsx)(b.A,{size:12})})]})}},70617:(e,t,s)=>{"use strict";s.d(t,{cd:()=>d,kr:()=>l,zd:()=>o});var r=s(1934),n=s(22356);let a=null;async function i(e){a?.abort();let t=new AbortController;a=t;try{let[s,r,a]=await Promise.all([(0,n.n)("/api/mcp/status",{signal:t.signal}),(0,n.n)("/api/mcp/agents",{signal:t.signal}),(0,n.n)("/api/skills",{signal:t.signal})]);t.signal.aborted||e({status:s,agents:r.agents,skills:a.skills})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}finally{t.signal.aborted||e({loading:!1})}}let o=(0,r.v)((e,t)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>i(e),toggleSkill:async(s,r)=>{e({skills:t().skills.map(e=>e.name===s?{...e,enabled:r}:e)});try{return await (0,n.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:s,enabled:r})}),!0}catch{return e({skills:t().skills.map(e=>e.name===s?{...e,enabled:!r}:e)}),!1}},installAgent:async(s,r)=>{let a=t().agents.find(e=>e.key===s);if(!a)return!1;try{let t=await (0,n.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:s,scope:r?.scope??(a.hasProjectScope?"project":"global"),transport:r?.transport??a.preferredTransport}],transport:"auto"})}),o=t.results?.[0],l=o?.ok===!0||o?.status==="ok";return l&&await i(e),l}catch{return!1}},_init:()=>{let t;i(e);let s=()=>{clearTimeout(t),t=setTimeout(()=>i(e),500)};window.addEventListener("mindos:skills-changed",s);let r=setInterval(()=>{"visible"===document.visibilityState&&i(e)},3e4);return()=>{a?.abort(),clearTimeout(t),clearInterval(r),window.removeEventListener("mindos:skills-changed",s)}}}));function l(){return o()}function d(){return o()}},76449:(e,t,s)=>{"use strict";s.d(t,{g:()=>r});let r=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"right"},{anchor:"agents-panel",position:"right"},{anchor:"echo-panel",position:"right"}]},91337:(e,t,s)=>{"use strict";s.d(t,{IX:()=>l,KW:()=>o,O0:()=>i,cn:()=>a,vr:()=>d});var r=s(29722),n=s(622);function a(...e){return(0,n.QP)((0,r.$)(e))}function i(e){return e.split("/").map(encodeURIComponent).join("/")}function o(e,t){let s=Date.now()-e,r=Math.floor(s/6e4),n=Math.floor(s/36e5),a=Math.floor(s/864e5);return r<1?t.justNow:r<60?t.minutesAgo(r):n<24?t.hoursAgo(n):a<7?t.daysAgo(a):new Date(e).toLocaleDateString()}function l(e){let t=e.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return t?.[0]??""}function d(e){return e.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||e}},99254:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(9339);let n=(0,r.createServerReference)("007362c1a101a503359a715970a6388507825de1cf",r.callServer,void 0,r.findSourceMapURL,"cleanupExamplesAction")}},e=>{e.O(0,[6926,9602,3160,1053,8441,3794,7358],()=>e(e.s=14153)),_N_E=e.O()}]);