@geminilight/mindos-windows-arm64 1.0.7 → 1.0.8

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 (496) 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 +32 -32
  4. package/_standalone/__next/build-manifest.json +4 -4
  5. package/_standalone/__next/prerender-manifest.json +3 -3
  6. package/_standalone/__next/react-loadable-manifest.json +48 -7
  7. package/_standalone/__next/required-server-files.json +4 -4
  8. package/_standalone/__next/server/app/.well-known/agent-card.json/route.js +1 -1
  9. package/_standalone/__next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  10. package/_standalone/__next/server/app/_global-error/page.js +3 -3
  11. package/_standalone/__next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/_standalone/__next/server/app/_global-error.html +2 -2
  13. package/_standalone/__next/server/app/_global-error.rsc +3 -3
  14. package/_standalone/__next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  15. package/_standalone/__next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/_standalone/__next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/_standalone/__next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/_standalone/__next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  19. package/_standalone/__next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/_standalone/__next/server/app/_not-found/page.js +2 -2
  21. package/_standalone/__next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/_standalone/__next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/_standalone/__next/server/app/agents/[agentKey]/page.js +2 -2
  24. package/_standalone/__next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  25. package/_standalone/__next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  26. package/_standalone/__next/server/app/agents/page.js +2 -2
  27. package/_standalone/__next/server/app/agents/page.js.nft.json +1 -1
  28. package/_standalone/__next/server/app/agents/page_client-reference-manifest.js +1 -1
  29. package/_standalone/__next/server/app/api/a2a/agents/route.js +1 -1
  30. package/_standalone/__next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  31. package/_standalone/__next/server/app/api/a2a/delegations/route.js +1 -1
  32. package/_standalone/__next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  33. package/_standalone/__next/server/app/api/a2a/discover/route.js +1 -1
  34. package/_standalone/__next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  35. package/_standalone/__next/server/app/api/a2a/route.js +1 -1
  36. package/_standalone/__next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  37. package/_standalone/__next/server/app/api/acp/config/route.js +1 -1
  38. package/_standalone/__next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  39. package/_standalone/__next/server/app/api/acp/detect/route.js +1 -1
  40. package/_standalone/__next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  41. package/_standalone/__next/server/app/api/acp/install/route.js +1 -1
  42. package/_standalone/__next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  43. package/_standalone/__next/server/app/api/acp/registry/route.js +1 -1
  44. package/_standalone/__next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  45. package/_standalone/__next/server/app/api/acp/session/route.js +1 -1
  46. package/_standalone/__next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  47. package/_standalone/__next/server/app/api/agent-activity/route.js +1 -1
  48. package/_standalone/__next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  49. package/_standalone/__next/server/app/api/agents/copy-skill/route.js +1 -1
  50. package/_standalone/__next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
  51. package/_standalone/__next/server/app/api/agents/custom/detect/route.js +1 -1
  52. package/_standalone/__next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
  53. package/_standalone/__next/server/app/api/agents/custom/route.js +1 -1
  54. package/_standalone/__next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
  55. package/_standalone/__next/server/app/api/ask/route.js +3 -3
  56. package/_standalone/__next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  57. package/_standalone/__next/server/app/api/ask-sessions/route.js +1 -1
  58. package/_standalone/__next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  59. package/_standalone/__next/server/app/api/auth/route.js +1 -1
  60. package/_standalone/__next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  61. package/_standalone/__next/server/app/api/backlinks/route.js +1 -1
  62. package/_standalone/__next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  63. package/_standalone/__next/server/app/api/bootstrap/route.js +1 -1
  64. package/_standalone/__next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  65. package/_standalone/__next/server/app/api/changes/route.js +1 -1
  66. package/_standalone/__next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  67. package/_standalone/__next/server/app/api/channels/verify/route.js +1 -1
  68. package/_standalone/__next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
  69. package/_standalone/__next/server/app/api/connect/route.js +1 -1
  70. package/_standalone/__next/server/app/api/connect/route_client-reference-manifest.js +1 -1
  71. package/_standalone/__next/server/app/api/embedding/route.js +1 -1
  72. package/_standalone/__next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
  73. package/_standalone/__next/server/app/api/export/route.js +1 -1
  74. package/_standalone/__next/server/app/api/export/route_client-reference-manifest.js +1 -1
  75. package/_standalone/__next/server/app/api/extract-docx/route.js +1 -1
  76. package/_standalone/__next/server/app/api/extract-docx/route_client-reference-manifest.js +1 -1
  77. package/_standalone/__next/server/app/api/extract-pdf/route.js +2 -2
  78. package/_standalone/__next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  79. package/_standalone/__next/server/app/api/file/import/route.js +1 -1
  80. package/_standalone/__next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  81. package/_standalone/__next/server/app/api/file/raw/route.js +1 -1
  82. package/_standalone/__next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
  83. package/_standalone/__next/server/app/api/file/route.js +1 -1
  84. package/_standalone/__next/server/app/api/file/route_client-reference-manifest.js +1 -1
  85. package/_standalone/__next/server/app/api/files/route.js +1 -1
  86. package/_standalone/__next/server/app/api/files/route_client-reference-manifest.js +1 -1
  87. package/_standalone/__next/server/app/api/git/route.js +1 -1
  88. package/_standalone/__next/server/app/api/git/route_client-reference-manifest.js +1 -1
  89. package/_standalone/__next/server/app/api/graph/route.js +1 -1
  90. package/_standalone/__next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  91. package/_standalone/__next/server/app/api/health/route.js +1 -1
  92. package/_standalone/__next/server/app/api/health/route_client-reference-manifest.js +1 -1
  93. package/_standalone/__next/server/app/api/im/activity/route.js +1 -1
  94. package/_standalone/__next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
  95. package/_standalone/__next/server/app/api/im/config/route.js +1 -1
  96. package/_standalone/__next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
  97. package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route.js +1 -1
  98. package/_standalone/__next/server/app/api/im/feishu/long-connection/event/route_client-reference-manifest.js +1 -1
  99. package/_standalone/__next/server/app/api/im/feishu/long-connection/route.js +1 -1
  100. package/_standalone/__next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
  101. package/_standalone/__next/server/app/api/im/status/route.js +1 -1
  102. package/_standalone/__next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
  103. package/_standalone/__next/server/app/api/im/test/route.js +1 -1
  104. package/_standalone/__next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
  105. package/_standalone/__next/server/app/api/im/webhook/feishu/route.js +1 -1
  106. package/_standalone/__next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
  107. package/_standalone/__next/server/app/api/im/webhook-status/route.js +1 -1
  108. package/_standalone/__next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
  109. package/_standalone/__next/server/app/api/inbox/clip/route.js +2 -2
  110. package/_standalone/__next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
  111. package/_standalone/__next/server/app/api/inbox/route.js +1 -1
  112. package/_standalone/__next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  113. package/_standalone/__next/server/app/api/init/route.js +1 -1
  114. package/_standalone/__next/server/app/api/init/route_client-reference-manifest.js +1 -1
  115. package/_standalone/__next/server/app/api/lint/route.js +1 -1
  116. package/_standalone/__next/server/app/api/lint/route_client-reference-manifest.js +1 -1
  117. package/_standalone/__next/server/app/api/mcp/agents/route.js +1 -1
  118. package/_standalone/__next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  119. package/_standalone/__next/server/app/api/mcp/direct-tools/route.js +1 -1
  120. package/_standalone/__next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
  121. package/_standalone/__next/server/app/api/mcp/install/route.js +1 -1
  122. package/_standalone/__next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  123. package/_standalone/__next/server/app/api/mcp/install-skill/route.js +1 -1
  124. package/_standalone/__next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  125. package/_standalone/__next/server/app/api/mcp/restart/route.js +1 -1
  126. package/_standalone/__next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  127. package/_standalone/__next/server/app/api/mcp/status/route.js +1 -1
  128. package/_standalone/__next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  129. package/_standalone/__next/server/app/api/mcp/tools/route.js +1 -1
  130. package/_standalone/__next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  131. package/_standalone/__next/server/app/api/mcp/uninstall/route.js +1 -1
  132. package/_standalone/__next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  133. package/_standalone/__next/server/app/api/monitoring/route.js +1 -1
  134. package/_standalone/__next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  135. package/_standalone/__next/server/app/api/obsidian/compat-report/route.js +1 -1
  136. package/_standalone/__next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -1
  137. package/_standalone/__next/server/app/api/obsidian/import/route.js +1 -1
  138. package/_standalone/__next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -1
  139. package/_standalone/__next/server/app/api/obsidian-plugins/settings/route.js +2 -2
  140. package/_standalone/__next/server/app/api/obsidian-plugins/settings/route_client-reference-manifest.js +1 -1
  141. package/_standalone/__next/server/app/api/recent-files/route.js +1 -1
  142. package/_standalone/__next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  143. package/_standalone/__next/server/app/api/restart/route.js +1 -1
  144. package/_standalone/__next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  145. package/_standalone/__next/server/app/api/search/prewarm/route.js +1 -1
  146. package/_standalone/__next/server/app/api/search/prewarm/route_client-reference-manifest.js +1 -1
  147. package/_standalone/__next/server/app/api/search/route.js +1 -1
  148. package/_standalone/__next/server/app/api/search/route_client-reference-manifest.js +1 -1
  149. package/_standalone/__next/server/app/api/settings/list-models/route.js +1 -1
  150. package/_standalone/__next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  151. package/_standalone/__next/server/app/api/settings/reset-token/route.js +1 -1
  152. package/_standalone/__next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  153. package/_standalone/__next/server/app/api/settings/route.js +1 -1
  154. package/_standalone/__next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  155. package/_standalone/__next/server/app/api/settings/test-key/route.js +1 -1
  156. package/_standalone/__next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  157. package/_standalone/__next/server/app/api/setup/check-path/route.js +1 -1
  158. package/_standalone/__next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  159. package/_standalone/__next/server/app/api/setup/check-port/route.js +1 -1
  160. package/_standalone/__next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  161. package/_standalone/__next/server/app/api/setup/generate-token/route.js +1 -1
  162. package/_standalone/__next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  163. package/_standalone/__next/server/app/api/setup/ls/route.js +1 -1
  164. package/_standalone/__next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  165. package/_standalone/__next/server/app/api/setup/route.js +1 -1
  166. package/_standalone/__next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  167. package/_standalone/__next/server/app/api/skills/route.js +1 -1
  168. package/_standalone/__next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  169. package/_standalone/__next/server/app/api/space-overview/route.js +1 -1
  170. package/_standalone/__next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
  171. package/_standalone/__next/server/app/api/sync/route.js +1 -1
  172. package/_standalone/__next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  173. package/_standalone/__next/server/app/api/tree-version/route.js +1 -1
  174. package/_standalone/__next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  175. package/_standalone/__next/server/app/api/uninstall/route.js +1 -1
  176. package/_standalone/__next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  177. package/_standalone/__next/server/app/api/update/route.js +1 -1
  178. package/_standalone/__next/server/app/api/update/route_client-reference-manifest.js +1 -1
  179. package/_standalone/__next/server/app/api/update-check/route.js +1 -1
  180. package/_standalone/__next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  181. package/_standalone/__next/server/app/api/update-status/route.js +1 -1
  182. package/_standalone/__next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  183. package/_standalone/__next/server/app/api/workflows/route.js +1 -1
  184. package/_standalone/__next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  185. package/_standalone/__next/server/app/capture/history/page.js +2 -2
  186. package/_standalone/__next/server/app/capture/history/page.js.nft.json +1 -1
  187. package/_standalone/__next/server/app/capture/history/page_client-reference-manifest.js +1 -1
  188. package/_standalone/__next/server/app/capture/page.js +2 -2
  189. package/_standalone/__next/server/app/capture/page.js.nft.json +1 -1
  190. package/_standalone/__next/server/app/capture/page_client-reference-manifest.js +1 -1
  191. package/_standalone/__next/server/app/changelog/page.js +2 -2
  192. package/_standalone/__next/server/app/changelog/page.js.nft.json +1 -1
  193. package/_standalone/__next/server/app/changelog/page_client-reference-manifest.js +1 -1
  194. package/_standalone/__next/server/app/changes/page.js +2 -2
  195. package/_standalone/__next/server/app/changes/page.js.nft.json +1 -1
  196. package/_standalone/__next/server/app/changes/page_client-reference-manifest.js +1 -1
  197. package/_standalone/__next/server/app/echo/[segment]/page.js +5 -5
  198. package/_standalone/__next/server/app/echo/[segment]/page.js.nft.json +1 -1
  199. package/_standalone/__next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  200. package/_standalone/__next/server/app/echo/page.js +2 -2
  201. package/_standalone/__next/server/app/echo/page.js.nft.json +1 -1
  202. package/_standalone/__next/server/app/echo/page_client-reference-manifest.js +1 -1
  203. package/_standalone/__next/server/app/explore/page.js +3 -3
  204. package/_standalone/__next/server/app/explore/page.js.nft.json +1 -1
  205. package/_standalone/__next/server/app/explore/page_client-reference-manifest.js +1 -1
  206. package/_standalone/__next/server/app/help/page.js +2 -2
  207. package/_standalone/__next/server/app/help/page.js.nft.json +1 -1
  208. package/_standalone/__next/server/app/help/page_client-reference-manifest.js +1 -1
  209. package/_standalone/__next/server/app/icon.svg/route.js +1 -1
  210. package/_standalone/__next/server/app/inbox/history/page.js +2 -2
  211. package/_standalone/__next/server/app/inbox/history/page.js.nft.json +1 -1
  212. package/_standalone/__next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
  213. package/_standalone/__next/server/app/login/page.js +2 -2
  214. package/_standalone/__next/server/app/login/page.js.nft.json +1 -1
  215. package/_standalone/__next/server/app/login/page_client-reference-manifest.js +1 -1
  216. package/_standalone/__next/server/app/page.js +2 -2
  217. package/_standalone/__next/server/app/page.js.nft.json +1 -1
  218. package/_standalone/__next/server/app/page_client-reference-manifest.js +1 -1
  219. package/_standalone/__next/server/app/settings/page.js +8 -3
  220. package/_standalone/__next/server/app/settings/page.js.nft.json +1 -1
  221. package/_standalone/__next/server/app/settings/page_client-reference-manifest.js +1 -1
  222. package/_standalone/__next/server/app/setup/page.js +2 -2
  223. package/_standalone/__next/server/app/setup/page.js.nft.json +1 -1
  224. package/_standalone/__next/server/app/setup/page_client-reference-manifest.js +1 -1
  225. package/_standalone/__next/server/app/todo/page.js +2 -2
  226. package/_standalone/__next/server/app/todo/page.js.nft.json +1 -1
  227. package/_standalone/__next/server/app/todo/page_client-reference-manifest.js +1 -1
  228. package/_standalone/__next/server/app/trash/page.js +3 -3
  229. package/_standalone/__next/server/app/trash/page.js.nft.json +1 -1
  230. package/_standalone/__next/server/app/trash/page_client-reference-manifest.js +1 -1
  231. package/_standalone/__next/server/app/view/[...path]/page.js +3 -3
  232. package/_standalone/__next/server/app/view/[...path]/page.js.nft.json +1 -1
  233. package/_standalone/__next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  234. package/_standalone/__next/server/app/wiki/page.js +2 -2
  235. package/_standalone/__next/server/app/wiki/page.js.nft.json +1 -1
  236. package/_standalone/__next/server/app/wiki/page_client-reference-manifest.js +1 -1
  237. package/_standalone/__next/server/app-paths-manifest.json +32 -32
  238. package/_standalone/__next/server/chunks/103.js +1 -1
  239. package/_standalone/__next/server/chunks/1976.js +1 -1
  240. package/_standalone/__next/server/chunks/3466.js +1 -1
  241. package/_standalone/__next/server/chunks/3727.js +1 -1
  242. package/_standalone/__next/server/chunks/4793.js +1 -1
  243. package/_standalone/__next/server/chunks/6377.js +3 -3
  244. package/_standalone/__next/server/chunks/6602.js +187 -0
  245. package/_standalone/__next/server/chunks/6646.js +16 -0
  246. package/_standalone/__next/server/chunks/8461.js +7 -7
  247. package/_standalone/__next/server/chunks/9868.js +2 -0
  248. package/_standalone/__next/server/chunks/{9773.js → 9969.js} +3 -3
  249. package/_standalone/__next/server/middleware-build-manifest.js +1 -1
  250. package/_standalone/__next/server/middleware-react-loadable-manifest.js +1 -1
  251. package/_standalone/__next/server/middleware.js +2 -2
  252. package/_standalone/__next/server/pages/500.html +2 -2
  253. package/_standalone/__next/server/server-reference-manifest.js +1 -1
  254. package/_standalone/__next/server/server-reference-manifest.json +1 -1
  255. package/_standalone/__next/static/chunks/{1430-c4ffa328888515c1.js → 1104-0822d9349a412b9b.js} +7 -2
  256. package/_standalone/__next/static/chunks/1655.0a559759973b42e9.js +1 -0
  257. package/_standalone/__next/static/chunks/{2073-3f913ebb13702b7e.js → 2073-fadffc82a27afdc7.js} +2 -2
  258. package/{static-web/_next/static/chunks/6728.e1841cddb63308b0.js → _standalone/__next/static/chunks/2245.ef71edb24c5232c2.js} +1 -1
  259. package/_standalone/__next/static/chunks/2258-2d3b5aac6a1fa92a.js +53 -0
  260. package/{static-web/_next/static/chunks/4937-4101fcdadacf46e3.js → _standalone/__next/static/chunks/2409-244f9b90dceb0c04.js} +1 -1
  261. package/_standalone/__next/static/chunks/3279-b49c25a4f2964b16.js +1 -0
  262. package/_standalone/__next/static/chunks/3807-115388f118106ca8.js +1 -0
  263. package/_standalone/__next/static/chunks/3966.ea75f9c5490955de.js +1 -0
  264. package/_standalone/__next/static/chunks/4010.48b219cb22dfa5d8.js +10 -0
  265. package/_standalone/__next/static/chunks/5026-7fed7ca22272c18f.js +1 -0
  266. package/_standalone/__next/static/chunks/5152-87e6ed56dfd7d17d.js +1 -0
  267. package/_standalone/__next/static/chunks/577.5e448c99068f1323.js +1 -0
  268. package/_standalone/__next/static/chunks/5913.a0a734f87b13f81a.js +1 -0
  269. package/_standalone/__next/static/chunks/596.9cbaf6ba90cb204f.js +7 -0
  270. package/_standalone/__next/static/chunks/6223-3fb90852221bda56.js +1 -0
  271. package/_standalone/__next/static/chunks/6343.582d063078c45d73.js +6 -0
  272. package/_standalone/__next/static/chunks/8174-50048777dc2469c0.js +1 -0
  273. package/_standalone/__next/static/chunks/{5913.3cee388e26959b62.js → 8294.cc9f9ff2f8b219ed.js} +1 -1
  274. package/_standalone/__next/static/chunks/8626-7da79d9ab2504eed.js +1 -0
  275. package/_standalone/__next/static/chunks/{8732.9002f42201b06fe8.js → 8732.87554c78e8825fac.js} +4 -4
  276. package/_standalone/__next/static/chunks/8922-3babcd35e18e9e4f.js +1 -0
  277. package/_standalone/__next/static/chunks/9440-eee639175695be7d.js +33 -0
  278. package/_standalone/__next/static/chunks/9479-b48d19e3588823c1.js +34 -0
  279. package/_standalone/__next/static/chunks/{9602.4e99e3525e5f062c.js → 9602.218427fc7b3d6b11.js} +1 -1
  280. package/_standalone/__next/static/chunks/app/_not-found/{page-eaedcec1b693c03c.js → page-ec6fa498a07e6fd9.js} +1 -1
  281. package/_standalone/__next/static/chunks/app/agents/[agentKey]/page-ef111ea0a3368752.js +1 -0
  282. package/_standalone/__next/static/chunks/app/agents/page-aacead0f47cedb0d.js +1 -0
  283. package/_standalone/__next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +1 -0
  284. package/_standalone/__next/static/chunks/app/capture/page-ae4d683afdc7a7b2.js +1 -0
  285. package/_standalone/__next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +1 -0
  286. package/_standalone/__next/static/chunks/app/changes/page-64cf8d751245eee9.js +1 -0
  287. package/{static-web/_next/static/chunks/app/echo/[segment]/page-44b6b8e7fd0bbe31.js → _standalone/__next/static/chunks/app/echo/[segment]/page-c5ea40ac04f2dc29.js} +2 -2
  288. package/_standalone/__next/static/chunks/app/echo/page-64cf8d751245eee9.js +1 -0
  289. package/_standalone/__next/static/chunks/app/{error-1cfcd6abd93c3837.js → error-c46d1b03d5e3289c.js} +1 -1
  290. package/{static-web/_next/static/chunks/app/explore/page-117fcf54b8b9765c.js → _standalone/__next/static/chunks/app/explore/page-5d6dd4af8d1bb468.js} +1 -1
  291. package/_standalone/__next/static/chunks/app/global-error-d42727c6c6c48879.js +1 -0
  292. package/_standalone/__next/static/chunks/app/help/{page-6efb8aa3a3c169fa.js → page-3f0a1a8e51249cb2.js} +1 -1
  293. package/_standalone/__next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +1 -0
  294. package/_standalone/__next/static/chunks/app/layout-ed608bbf9585e78f.js +99 -0
  295. package/_standalone/__next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +1 -0
  296. package/_standalone/__next/static/chunks/app/page-d22928276c36528c.js +1 -0
  297. package/_standalone/__next/static/chunks/app/settings/{page-f816f13a34613538.js → page-045afd8c0908f923.js} +1 -1
  298. package/{static-web/_next/static/chunks/app/setup/page-a1027871dc33ffbd.js → _standalone/__next/static/chunks/app/setup/page-034a608f19d04653.js} +1 -1
  299. package/_standalone/__next/static/chunks/app/todo/page-c7629a0c102c634f.js +1 -0
  300. package/_standalone/__next/static/chunks/app/trash/page-251aaf5aac9d5a0b.js +1 -0
  301. package/_standalone/__next/static/chunks/app/view/[...path]/{error-c9a3f6de7c963c74.js → error-f73092e638a4e999.js} +1 -1
  302. package/_standalone/__next/static/chunks/app/view/[...path]/{not-found-5a4f2b4fbe28d617.js → not-found-80e5f4054819b372.js} +1 -1
  303. package/_standalone/__next/static/chunks/app/view/[...path]/page-7e17c3d13fe2e275.js +12 -0
  304. package/{static-web/_next/static/chunks/app/wiki/page-7afd3b97c1ea1b8c.js → _standalone/__next/static/chunks/app/wiki/page-4c9bc816069b6f2a.js} +2 -2
  305. package/_standalone/__next/static/chunks/{main-app-8a6081b103b8f494.js → main-app-23adfdc06470abb6.js} +1 -1
  306. package/_standalone/__next/static/chunks/webpack-1decda0633a8a874.js +1 -0
  307. package/_standalone/__next/static/css/5f000212c8b2e09a.css +1 -0
  308. package/_standalone/__node_modules/@aws-sdk/xml-builder/node_modules/.bin/fxparser +2 -2
  309. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/.bin/pi-ai +2 -2
  310. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  311. package/_standalone/__node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  312. package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  313. package/_standalone/__node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  314. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/extract-zip +2 -2
  315. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/highlight +2 -2
  316. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/jiti +2 -2
  317. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/marked +2 -2
  318. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/pi-ai +2 -2
  319. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/.bin/yaml +2 -2
  320. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/anthropic-ai-sdk +2 -2
  321. package/_standalone/__node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-ai/node_modules/.bin/openai +2 -2
  322. package/_standalone/__node_modules/@mariozechner/pi-tui/node_modules/.bin/marked +2 -2
  323. package/_standalone/__node_modules/degenerator/node_modules/.bin/escodegen +2 -2
  324. package/_standalone/__node_modules/degenerator/node_modules/.bin/esgenerate +2 -2
  325. package/_standalone/__node_modules/degenerator/node_modules/.bin/esparse +2 -2
  326. package/_standalone/__node_modules/degenerator/node_modules/.bin/esvalidate +2 -2
  327. package/_standalone/__node_modules/escodegen/node_modules/.bin/esparse +2 -2
  328. package/_standalone/__node_modules/escodegen/node_modules/.bin/esvalidate +2 -2
  329. package/_standalone/__node_modules/global-agent/node_modules/.bin/semver +2 -2
  330. package/_standalone/__node_modules/jsdom/node_modules/.bin/specificity +2 -2
  331. package/_standalone/__node_modules/postcss/node_modules/.bin/nanoid +2 -2
  332. package/_standalone/__node_modules/tough-cookie/node_modules/.bin/tldts +2 -2
  333. package/_standalone/public/agent-icons/claude.svg +1 -0
  334. package/_standalone/public/agent-icons/cursor.svg +1 -0
  335. package/_standalone/public/agent-icons/github-copilot.svg +1 -0
  336. package/_standalone/public/agent-icons/google.svg +1 -0
  337. package/_standalone/public/agent-icons/openai.svg +1 -0
  338. package/_standalone/public/agent-icons/windsurf.svg +1 -0
  339. package/_standalone/server.js +1 -1
  340. package/bin/lib/stop.js +45 -0
  341. package/bin/lib/sync.js +32 -19
  342. package/dist/server/handlers/file.js +5 -2
  343. package/dist/server/handlers/file.js.map +1 -1
  344. package/dist/server/handlers/mcp-restart.d.ts +2 -0
  345. package/dist/server/handlers/mcp-restart.d.ts.map +1 -1
  346. package/dist/server/handlers/mcp-restart.js +45 -2
  347. package/dist/server/handlers/mcp-restart.js.map +1 -1
  348. package/dist/server/handlers/skills.d.ts.map +1 -1
  349. package/dist/server/handlers/skills.js +17 -3
  350. package/dist/server/handlers/skills.js.map +1 -1
  351. package/dist/server/handlers/sync.d.ts.map +1 -1
  352. package/dist/server/handlers/sync.js +28 -10
  353. package/dist/server/handlers/sync.js.map +1 -1
  354. package/dist/server/index.d.ts +1 -1
  355. package/dist/server/index.d.ts.map +1 -1
  356. package/dist/server/index.js +1 -1
  357. package/dist/server/index.js.map +1 -1
  358. package/dist/server/runtime.d.ts.map +1 -1
  359. package/dist/server/runtime.js +20 -21
  360. package/dist/server/runtime.js.map +1 -1
  361. package/package.json +1 -1
  362. package/runtime-manifest.json +1 -1
  363. package/scripts/build-bun-binary.mjs +139 -6
  364. package/scripts/prepare-static-web.mjs +52 -4
  365. package/scripts/release.sh +1 -1
  366. package/scripts/setup.js +115 -2
  367. package/static-web/.mindos-build-version +1 -1
  368. package/static-web/_next/static/chunks/{1430-c4ffa328888515c1.js → 1104-0822d9349a412b9b.js} +7 -2
  369. package/static-web/_next/static/chunks/1655.0a559759973b42e9.js +1 -0
  370. package/static-web/_next/static/chunks/{2073-3f913ebb13702b7e.js → 2073-fadffc82a27afdc7.js} +2 -2
  371. package/{_standalone/__next/static/chunks/6728.e1841cddb63308b0.js → static-web/_next/static/chunks/2245.ef71edb24c5232c2.js} +1 -1
  372. package/static-web/_next/static/chunks/2258-2d3b5aac6a1fa92a.js +53 -0
  373. package/{_standalone/__next/static/chunks/4937-4101fcdadacf46e3.js → static-web/_next/static/chunks/2409-244f9b90dceb0c04.js} +1 -1
  374. package/static-web/_next/static/chunks/3279-b49c25a4f2964b16.js +1 -0
  375. package/static-web/_next/static/chunks/3807-115388f118106ca8.js +1 -0
  376. package/static-web/_next/static/chunks/3966.ea75f9c5490955de.js +1 -0
  377. package/static-web/_next/static/chunks/4010.48b219cb22dfa5d8.js +10 -0
  378. package/static-web/_next/static/chunks/5026-7fed7ca22272c18f.js +1 -0
  379. package/static-web/_next/static/chunks/5152-87e6ed56dfd7d17d.js +1 -0
  380. package/static-web/_next/static/chunks/577.5e448c99068f1323.js +1 -0
  381. package/static-web/_next/static/chunks/5913.a0a734f87b13f81a.js +1 -0
  382. package/static-web/_next/static/chunks/596.9cbaf6ba90cb204f.js +7 -0
  383. package/static-web/_next/static/chunks/6223-3fb90852221bda56.js +1 -0
  384. package/static-web/_next/static/chunks/6343.582d063078c45d73.js +6 -0
  385. package/static-web/_next/static/chunks/8174-50048777dc2469c0.js +1 -0
  386. package/static-web/_next/static/chunks/{5913.3cee388e26959b62.js → 8294.cc9f9ff2f8b219ed.js} +1 -1
  387. package/static-web/_next/static/chunks/8626-7da79d9ab2504eed.js +1 -0
  388. package/static-web/_next/static/chunks/{8732.9002f42201b06fe8.js → 8732.87554c78e8825fac.js} +4 -4
  389. package/static-web/_next/static/chunks/8922-3babcd35e18e9e4f.js +1 -0
  390. package/static-web/_next/static/chunks/9440-eee639175695be7d.js +33 -0
  391. package/static-web/_next/static/chunks/9479-b48d19e3588823c1.js +34 -0
  392. package/static-web/_next/static/chunks/{9602.4e99e3525e5f062c.js → 9602.218427fc7b3d6b11.js} +1 -1
  393. package/static-web/_next/static/chunks/app/_not-found/{page-eaedcec1b693c03c.js → page-ec6fa498a07e6fd9.js} +1 -1
  394. package/static-web/_next/static/chunks/app/agents/[agentKey]/page-ef111ea0a3368752.js +1 -0
  395. package/static-web/_next/static/chunks/app/agents/page-aacead0f47cedb0d.js +1 -0
  396. package/static-web/_next/static/chunks/app/capture/history/page-d157ce945ad84c23.js +1 -0
  397. package/static-web/_next/static/chunks/app/capture/page-ae4d683afdc7a7b2.js +1 -0
  398. package/static-web/_next/static/chunks/app/changelog/page-5a39d8fe531f4d45.js +1 -0
  399. package/static-web/_next/static/chunks/app/changes/page-64cf8d751245eee9.js +1 -0
  400. package/{_standalone/__next/static/chunks/app/echo/[segment]/page-44b6b8e7fd0bbe31.js → static-web/_next/static/chunks/app/echo/[segment]/page-c5ea40ac04f2dc29.js} +2 -2
  401. package/static-web/_next/static/chunks/app/echo/page-64cf8d751245eee9.js +1 -0
  402. package/static-web/_next/static/chunks/app/{error-1cfcd6abd93c3837.js → error-c46d1b03d5e3289c.js} +1 -1
  403. package/{_standalone/__next/static/chunks/app/explore/page-117fcf54b8b9765c.js → static-web/_next/static/chunks/app/explore/page-5d6dd4af8d1bb468.js} +1 -1
  404. package/static-web/_next/static/chunks/app/global-error-d42727c6c6c48879.js +1 -0
  405. package/static-web/_next/static/chunks/app/help/{page-6efb8aa3a3c169fa.js → page-3f0a1a8e51249cb2.js} +1 -1
  406. package/static-web/_next/static/chunks/app/inbox/history/page-b2930c2ef04e00b0.js +1 -0
  407. package/static-web/_next/static/chunks/app/layout-ed608bbf9585e78f.js +99 -0
  408. package/static-web/_next/static/chunks/app/login/page-a4f9f9053c75ae8d.js +1 -0
  409. package/static-web/_next/static/chunks/app/page-d22928276c36528c.js +1 -0
  410. package/static-web/_next/static/chunks/app/settings/{page-f816f13a34613538.js → page-045afd8c0908f923.js} +1 -1
  411. package/{_standalone/__next/static/chunks/app/setup/page-a1027871dc33ffbd.js → static-web/_next/static/chunks/app/setup/page-034a608f19d04653.js} +1 -1
  412. package/static-web/_next/static/chunks/app/todo/page-c7629a0c102c634f.js +1 -0
  413. package/static-web/_next/static/chunks/app/trash/page-251aaf5aac9d5a0b.js +1 -0
  414. package/static-web/_next/static/chunks/app/view/[...path]/{error-c9a3f6de7c963c74.js → error-f73092e638a4e999.js} +1 -1
  415. package/static-web/_next/static/chunks/app/view/[...path]/{not-found-5a4f2b4fbe28d617.js → not-found-80e5f4054819b372.js} +1 -1
  416. package/static-web/_next/static/chunks/app/view/[...path]/page-7e17c3d13fe2e275.js +12 -0
  417. package/{_standalone/__next/static/chunks/app/wiki/page-7afd3b97c1ea1b8c.js → static-web/_next/static/chunks/app/wiki/page-4c9bc816069b6f2a.js} +2 -2
  418. package/static-web/_next/static/chunks/{main-app-8a6081b103b8f494.js → main-app-23adfdc06470abb6.js} +1 -1
  419. package/static-web/_next/static/chunks/webpack-1decda0633a8a874.js +1 -0
  420. package/static-web/_next/static/css/5f000212c8b2e09a.css +1 -0
  421. package/static-web/agent-icons/claude.svg +1 -0
  422. package/static-web/agent-icons/cursor.svg +1 -0
  423. package/static-web/agent-icons/github-copilot.svg +1 -0
  424. package/static-web/agent-icons/google.svg +1 -0
  425. package/static-web/agent-icons/openai.svg +1 -0
  426. package/static-web/agent-icons/windsurf.svg +1 -0
  427. package/static-web/help/index.html +5 -20
  428. package/static-web/index.html +8 -22
  429. package/static-web/setup/index.html +5 -20
  430. package/static-web/static-web-manifest.json +1 -1
  431. package/static-web/wiki/index.html +5 -20
  432. package/_standalone/__next/server/chunks/1834.js +0 -210
  433. package/_standalone/__next/server/chunks/2037.js +0 -2
  434. package/_standalone/__next/server/chunks/9350.js +0 -11
  435. package/_standalone/__next/static/chunks/1957-723ac4eb5200214c.js +0 -33
  436. package/_standalone/__next/static/chunks/2288-4dcb8ad3ccbd651e.js +0 -1
  437. package/_standalone/__next/static/chunks/2737-f4970f0684c334d6.js +0 -48
  438. package/_standalone/__next/static/chunks/3424-060f01a8983e438d.js +0 -1
  439. package/_standalone/__next/static/chunks/4172-4fc551f07f7d082f.js +0 -1
  440. package/_standalone/__next/static/chunks/4454-f582e17b76ccf1d1.js +0 -1
  441. package/_standalone/__next/static/chunks/5152-2db55438be7ecb94.js +0 -1
  442. package/_standalone/__next/static/chunks/5200-6c82e5ce54a95b4b.js +0 -6
  443. package/_standalone/__next/static/chunks/6274-f173cb227ad1ef21.js +0 -1
  444. package/_standalone/__next/static/chunks/6947.fb89346ef2f6be17.js +0 -1
  445. package/_standalone/__next/static/chunks/725-3b648bf7929ff78d.js +0 -1
  446. package/_standalone/__next/static/chunks/9479-7b304601a56304cd.js +0 -32
  447. package/_standalone/__next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js +0 -1
  448. package/_standalone/__next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js +0 -1
  449. package/_standalone/__next/static/chunks/app/capture/history/page-51db96203209a441.js +0 -1
  450. package/_standalone/__next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +0 -1
  451. package/_standalone/__next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +0 -1
  452. package/_standalone/__next/static/chunks/app/changes/page-c9f8d5632a001849.js +0 -1
  453. package/_standalone/__next/static/chunks/app/echo/page-c9f8d5632a001849.js +0 -1
  454. package/_standalone/__next/static/chunks/app/global-error-11b333dcf222bc09.js +0 -1
  455. package/_standalone/__next/static/chunks/app/inbox/history/page-913645bbd6161116.js +0 -1
  456. package/_standalone/__next/static/chunks/app/layout-24a31ea28c556e82.js +0 -114
  457. package/_standalone/__next/static/chunks/app/login/page-7f9aca3d51266bec.js +0 -1
  458. package/_standalone/__next/static/chunks/app/page-35662964020c0ea9.js +0 -1
  459. package/_standalone/__next/static/chunks/app/todo/page-54c3ec77f662ff73.js +0 -1
  460. package/_standalone/__next/static/chunks/app/trash/page-50622e3df2047204.js +0 -1
  461. package/_standalone/__next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js +0 -12
  462. package/_standalone/__next/static/chunks/webpack-7d8c24c6af17dd51.js +0 -1
  463. package/_standalone/__next/static/css/0d2fd378b5449176.css +0 -1
  464. package/static-web/_next/static/chunks/1957-723ac4eb5200214c.js +0 -33
  465. package/static-web/_next/static/chunks/2288-4dcb8ad3ccbd651e.js +0 -1
  466. package/static-web/_next/static/chunks/2737-f4970f0684c334d6.js +0 -48
  467. package/static-web/_next/static/chunks/3424-060f01a8983e438d.js +0 -1
  468. package/static-web/_next/static/chunks/4172-4fc551f07f7d082f.js +0 -1
  469. package/static-web/_next/static/chunks/4454-f582e17b76ccf1d1.js +0 -1
  470. package/static-web/_next/static/chunks/5152-2db55438be7ecb94.js +0 -1
  471. package/static-web/_next/static/chunks/5200-6c82e5ce54a95b4b.js +0 -6
  472. package/static-web/_next/static/chunks/6274-f173cb227ad1ef21.js +0 -1
  473. package/static-web/_next/static/chunks/6947.fb89346ef2f6be17.js +0 -1
  474. package/static-web/_next/static/chunks/725-3b648bf7929ff78d.js +0 -1
  475. package/static-web/_next/static/chunks/9479-7b304601a56304cd.js +0 -32
  476. package/static-web/_next/static/chunks/app/agents/[agentKey]/page-1dac12945bfbaf35.js +0 -1
  477. package/static-web/_next/static/chunks/app/agents/page-7ff2e39ca12eb20a.js +0 -1
  478. package/static-web/_next/static/chunks/app/capture/history/page-51db96203209a441.js +0 -1
  479. package/static-web/_next/static/chunks/app/capture/page-3bf09d1f5e1c379c.js +0 -1
  480. package/static-web/_next/static/chunks/app/changelog/page-01dc22b6d2230c7f.js +0 -1
  481. package/static-web/_next/static/chunks/app/changes/page-c9f8d5632a001849.js +0 -1
  482. package/static-web/_next/static/chunks/app/echo/page-c9f8d5632a001849.js +0 -1
  483. package/static-web/_next/static/chunks/app/global-error-11b333dcf222bc09.js +0 -1
  484. package/static-web/_next/static/chunks/app/inbox/history/page-913645bbd6161116.js +0 -1
  485. package/static-web/_next/static/chunks/app/layout-24a31ea28c556e82.js +0 -114
  486. package/static-web/_next/static/chunks/app/login/page-7f9aca3d51266bec.js +0 -1
  487. package/static-web/_next/static/chunks/app/page-35662964020c0ea9.js +0 -1
  488. package/static-web/_next/static/chunks/app/todo/page-54c3ec77f662ff73.js +0 -1
  489. package/static-web/_next/static/chunks/app/trash/page-50622e3df2047204.js +0 -1
  490. package/static-web/_next/static/chunks/app/view/[...path]/page-b10d3819827da1c2.js +0 -12
  491. package/static-web/_next/static/chunks/webpack-7d8c24c6af17dd51.js +0 -1
  492. package/static-web/_next/static/css/0d2fd378b5449176.css +0 -1
  493. /package/_standalone/__next/static/{3FkuJxcda957EywJ5ZWWG → apol5mbXb7N_sqaKgpXN1}/_buildManifest.js +0 -0
  494. /package/_standalone/__next/static/{3FkuJxcda957EywJ5ZWWG → apol5mbXb7N_sqaKgpXN1}/_ssgManifest.js +0 -0
  495. /package/static-web/_next/static/{3FkuJxcda957EywJ5ZWWG → apol5mbXb7N_sqaKgpXN1}/_buildManifest.js +0 -0
  496. /package/static-web/_next/static/{3FkuJxcda957EywJ5ZWWG → apol5mbXb7N_sqaKgpXN1}/_ssgManifest.js +0 -0
@@ -1,114 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{6478:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BacklinksRenderer:()=>m});var s=r(66839),n=r(44223),a=r(56261),i=r(30401),o=r(4373),l=r(58221),d=r(65264);function c(e){return e.split("/").pop()?.replace(/\.md$/,"")??e}function u({text:e}){let t=e.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,s.jsx)("span",{children:t.map((e,t)=>/^\[\[/.test(e)||/^\[/.test(e)?(0,s.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:e},t):(0,s.jsx)("span",{children:e},t))})}function m({filePath:e}){let t=(0,a.useRouter)(),[r,m]=(0,n.useState)(null),[x,p]=(0,n.useState)(!0);if((0,n.useEffect)(()=>{p(!0),(0,d.n)(`/api/backlinks?path=${encodeURIComponent(e)}`).then(e=>{m(e),p(!1)}).catch(()=>p(!1))},[e]),x)return(0,s.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let g=r??[];return(0,s.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,s.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,s.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===g.length?"No backlinks found":`${g.length} file${1===g.length?"":"s"} link here`})}),0===g.length?(0,s.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,s.jsx)(i.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,s.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,s.jsx)("strong",{style:{color:"var(--foreground)"},children:c(e)})," yet."]})]}):(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:g.map(({filePath:e,snippets:r})=>{let n,a=c(e),d=(n=e.split("/")).length>1?n.slice(0,-1).join("/"):"";return(0,s.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>t.push("/view/"+(0,l.O0)(e)),onMouseEnter:e=>e.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:e=>e.currentTarget.style.borderColor="var(--border)",children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:r.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,s.jsx)(i.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,s.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}),d&&(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:d}),(0,s.jsx)(o.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),r.map((e,t)=>(0,s.jsx)("div",{style:{padding:"8px 14px",borderBottom:t<r.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:e.split("\n").map((e,t)=>(0,s.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,s.jsx)(u,{text:e})},t))},t))]},e)})})]})}},7625:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(66839),n=r(44223),a=r(31082),i=r(72799),o=r(44361),l=r(21082),d=r(38688),c=r(2073);function u({open:e,onClose:t,onDiscover:r,discovering:u,error:m}){let{t:x}=(0,c.Y)(),p=x.panels.agents,[g,h]=(0,n.useState)(""),[f,b]=(0,n.useState)(null);if(!e)return null;let v=async()=>{if(!g.trim()||u)return;b(null);let e=await r(g.trim());e&&b(e)},y=()=>{h(""),b(null),t()};return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center overlay-backdrop",onClick:y,children:(0,s.jsxs)("div",{className:"bg-popover border border-border rounded-xl shadow-lg w-full max-w-md mx-4 p-5",onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":p.a2aDiscover,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,s.jsx)(a.A,{size:15,className:"text-muted-foreground"}),p.a2aDiscover]}),(0,s.jsx)("button",{type:"button",onClick:y,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,s.jsx)(i.A,{size:14})})]}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground mb-3",children:p.a2aDiscoverHint}),(0,s.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,s.jsx)("input",{type:"url",value:g,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v(),"Escape"===e.key&&t()},placeholder:p.a2aDiscoverPlaceholder,disabled:u,className:"flex-1 px-3 py-2 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",autoFocus:!0}),(0,s.jsxs)("button",{type:"button",onClick:v,disabled:u||!g.trim(),className:"px-3 py-2 text-xs font-medium rounded-lg bg-foreground text-background hover:bg-foreground/90 disabled:opacity-50 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-1.5 shrink-0",children:[u&&(0,s.jsx)(o.A,{size:12,className:"animate-spin"}),u?p.a2aDiscovering:p.a2aDiscover]})]}),m&&!f&&(0,s.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/5 px-3 py-2.5 mb-3",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(l.A,{size:14,className:"text-error mt-0.5 shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-medium text-error",children:p.a2aDiscoverFailed}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground mt-0.5",children:p.a2aDiscoverFailedHint})]})]})}),f&&(0,s.jsx)("div",{className:"rounded-lg border border-success/30 bg-success/5 px-3 py-2.5",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(d.A,{size:14,className:"text-success mt-0.5 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-success mb-1.5",children:p.a2aDiscoverSuccess}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-xs font-medium text-foreground truncate",title:f.card.name,children:[f.card.name,(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground ml-1.5",children:["v",f.card.version]})]}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground truncate",title:f.card.description,children:f.card.description}),f.card.skills.length>0&&(0,s.jsxs)("div",{className:"mt-1.5",children:[(0,s.jsxs)("p",{className:"text-2xs text-muted-foreground mb-1",children:[p.a2aSkills,":"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:f.card.skills.map(e=>(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted/80 text-muted-foreground border border-border/50",title:e.description,children:e.name},e.id))})]}),(0,s.jsxs)("p",{className:"text-2xs text-muted-foreground mt-1 truncate",title:f.endpoint,children:[p.a2aEndpoint,": ",f.endpoint]})]})]})]})})]})})}},19114:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ImageRenderer:()=>i});var s=r(66839),n=r(44223);let a=[.25,.5,.75,1,1.5,2,3,4];function i({filePath:e}){let t=`/api/file/raw?path=${encodeURIComponent(e)}`,r=e.split("/").pop()??"image",i=r.split(".").pop()?.toLowerCase()??"",o=["png","svg","webp","ico","gif"].includes(i),[l,d]=(0,n.useState)(!0),[c,u]=(0,n.useState)(!1),[m,x]=(0,n.useState)(0),[p,g]=(0,n.useState)("fit"),[h,f]=(0,n.useState)(null),[b,v]=(0,n.useState)(null),y=(0,n.useRef)(null),j=(0,n.useRef)(null),w=(0,n.useCallback)(()=>{d(!1);let e=y.current;e&&f({w:e.naturalWidth,h:e.naturalHeight})},[]),k=(0,n.useCallback)(()=>{d(!1),u(!0)},[]),N=(0,n.useCallback)(()=>{u(!1),d(!0),x(e=>e+1)},[]);(0,n.useEffect)(()=>{l||c||null!==b||fetch(t,{method:"HEAD"}).then(e=>{let t=e.headers.get("Content-Length");t&&v(parseInt(t,10))}).catch(()=>{})},[t,l,c,b]);let S=(0,n.useCallback)(()=>{g(e=>{let t="fit"===e?1:e;return a.find(e=>e>t)??t})},[]),C=(0,n.useCallback)(()=>{g(e=>{let t="fit"===e?1:e;return[...a].reverse().find(e=>e<t)??t})},[]),z=(0,n.useCallback)(()=>{g(e=>"fit"===e?1:"fit")},[]);(0,n.useEffect)(()=>{let e=j.current;if(!e)return;let t=t=>{t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||(document.activeElement===document.body||e.contains(document.activeElement))&&(("+"===t.key||"="===t.key)&&(t.preventDefault(),S()),"-"===t.key&&(t.preventDefault(),C()),"0"===t.key&&(t.preventDefault(),g("fit")),"1"===t.key&&(t.preventDefault(),g(1)))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[S,C]);let A="fit"===p?"Fit":`${Math.round(100*p)}%`,E="fit"===p?{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"}:h?{width:h.w*p,height:"auto"}:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"};return(0,s.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[h&&(0,s.jsxs)("span",{children:[h.w," x ",h.h]}),null!==b&&(0,s.jsx)("span",{children:b<1024?`${b} B`:b<1048576?`${(b/1024).toFixed(1)} KB`:`${(b/1048576).toFixed(1)} MB`}),(0,s.jsx)("span",{className:"uppercase opacity-60",children:i})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("button",{onClick:C,disabled:!h,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom out (-)",children:"-"}),(0,s.jsx)("button",{onClick:z,disabled:!h,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors min-w-[48px] text-center disabled:opacity-30",title:"fit"===p?"Actual size (1)":"Fit to view (0)",children:A}),(0,s.jsx)("button",{onClick:S,disabled:!h,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom in (+)",children:"+"})]})]}),(0,s.jsxs)("div",{ref:j,tabIndex:-1,className:`relative flex-1 min-h-[70vh] overflow-auto flex items-center justify-center outline-none ${o?"bg-checkerboard":"bg-[var(--bg-secondary)]"}`,children:[l&&!c&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:(0,s.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading..."})}),c&&(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center z-10 gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load image"}),(0,s.jsx)("button",{onClick:N,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,s.jsx)("img",{ref:y,src:t,alt:r,onLoad:w,onError:k,draggable:!1,className:"select-none",style:{display:c?"none":"block",...E}},m)]})]})}},28632:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});var s=r(44223);function n(){return(0,s.useEffect)(()=>{!("u">typeof navigator&&/electron/i.test(navigator.userAgent))&&"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(e=>{console.warn("[SW] Registration failed:",e)})},[]),null}},28760:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,38604,23)),Promise.resolve().then(r.bind(r,28632)),Promise.resolve().then(r.bind(r,74179)),Promise.resolve().then(r.bind(r,29803)),Promise.resolve().then(r.bind(r,61882)),Promise.resolve().then(r.bind(r,6478)),Promise.resolve().then(r.bind(r,22669)),Promise.resolve().then(r.bind(r,39580)),Promise.resolve().then(r.bind(r,34045)),Promise.resolve().then(r.bind(r,84962)),Promise.resolve().then(r.bind(r,19114)),Promise.resolve().then(r.bind(r,56514)),Promise.resolve().then(r.bind(r,94866)),Promise.resolve().then(r.bind(r,90454)),Promise.resolve().then(r.bind(r,10763)),Promise.resolve().then(r.bind(r,76782)),Promise.resolve().then(r.bind(r,34959)),Promise.resolve().then(r.bind(r,79114)),Promise.resolve().then(r.bind(r,79726)),Promise.resolve().then(r.bind(r,57679)),Promise.resolve().then(r.bind(r,80250)),Promise.resolve().then(r.bind(r,98163)),Promise.resolve().then(r.bind(r,95878))},29803:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AgentInspectorRenderer:()=>j});var s=r(66839),n=r(44223),a=r(56261),i=r(12361),o=r(75157),l=r(86386),d=r(31606),c=r(38325),u=r(19777),m=r(38688),x=r(21082),p=r(72615);function g(e){return/read|list|get|search/.test(e)?/search/.test(e)?"search":"read":/create/.test(e)?"create":/delete/.test(e)?"delete":/write|update|insert|append/.test(e)?"write":"other"}let h={read:{bg:"rgba(138,180,216,0.10)",text:"var(--tool-read)",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"var(--tool-search)",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function f({kind:e,size:t=13}){return"read"===e?(0,s.jsx)(i.A,{size:t}):"write"===e?(0,s.jsx)(o.A,{size:t}):"create"===e?(0,s.jsx)(l.A,{size:t}):"delete"===e?(0,s.jsx)(d.A,{size:t}):"search"===e?(0,s.jsx)(c.A,{size:t}):(0,s.jsx)(u.A,{size:t})}function b(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 v({op:e}){var t,r;let i,o,l,d,c=(0,a.useRouter)(),[u,v]=(0,n.useState)(!1),y=g(e.tool),j=h[y],w="string"==typeof(t=e.params).path?t.path:null,k=e.tool.replace("mindos_","");return(0,s.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>v(e=>!e),children:[(0,s.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:j.bg,color:j.text,border:`1px solid ${j.border}`,flexShrink:0},children:[(0,s.jsx)(f,{kind:y,size:10}),y]}),(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:k}),w&&(0,s.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:e=>{e.stopPropagation(),c.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,s.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.agentName&&(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.62rem",fontWeight:500,padding:"1px 6px",borderRadius:999,background:"var(--muted)",color:"var(--muted-foreground)",whiteSpace:"nowrap",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis"},title:e.agentName,children:e.agentName.length>30?e.agentName.slice(0,30)+"...":e.agentName}),"ok"===e.result?(0,s.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,s.jsx)(x.A,{size:13,style:{color:"var(--error)"}}),(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:b(e.ts),children:(r=e.ts,o=Math.floor((i=Date.now()-new Date(r).getTime())/6e4),l=Math.floor(i/36e5),d=Math.floor(i/864e5),o<1?"just now":o<60?`${o}m ago`:l<24?`${l}h ago`:`${d}d ago`)}),(0,s.jsx)(p.A,{size:12,style:{color:"var(--muted-foreground)",transform:u?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),u&&(0,s.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,s.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!e.message},children:Object.entries(e.params).map(([e,t])=>(0,s.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:e}),(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(e,t=120){let r="string"==typeof e?e:JSON.stringify(e);return r.length>t?r.slice(0,t)+"…":r}(t)})]},e))}),e.message&&(0,s.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===e.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===e.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===e.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:e.message}),e.agentName&&(0,s.jsxs)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.68rem",color:"var(--muted-foreground)"},children:["Agent: ",(0,s.jsx)("span",{style:{color:"var(--foreground)",fontWeight:500},children:e.agentName})]}),(0,s.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:b(e.ts)})]})]})}let y=["all","write","create","delete","read","search"];function j({content:e}){let[t,r]=(0,n.useState)("all"),a=(0,n.useMemo)(()=>(function(e){try{let t=JSON.parse(e);if(Array.isArray(t.events))return t.events.filter(e=>!!e?.tool&&!!e?.ts).sort((e,t)=>new Date(t.ts).getTime()-new Date(e.ts).getTime())}catch{}return(function(e){let t=[];for(let r of e.split("\n")){let e=r.trim();if(!(!e||e.startsWith("#")||e.startsWith("//")))try{let r=JSON.parse(e);r.tool&&r.ts&&t.push(r)}catch{}}return t})(e).sort((e,t)=>new Date(t.ts).getTime()-new Date(e.ts).getTime())})(e),[e]),i=(0,n.useMemo)(()=>"all"===t?a:a.filter(e=>g(e.tool)===t),[a,t]),o=(0,n.useMemo)(()=>{let e={all:a.length};for(let t of a){let r=g(t.tool);e[r]=(e[r]??0)+1}return e},[a]);return 0===a.length?(0,s.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,s.jsx)(u.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,s.jsx)("p",{children:"No agent operations logged yet."}),(0,s.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,s.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,s.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:y.map(e=>{let n=o[e]??0;if("all"!==e&&!n)return null;let a="all"!==e?h[e]:void 0,i=t===e;return(0,s.jsxs)("button",{onClick:()=>r(e),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:i?a?.bg??"var(--accent)":"var(--muted)",color:i?a?.text??"var(--foreground)":"var(--muted-foreground)",outline:i?`1px solid ${a?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==e&&(0,s.jsx)(f,{kind:e,size:10}),e," ",(0,s.jsxs)("span",{style:{opacity:.6},children:["(",n,")"]})]},e)})}),(0,s.jsx)("div",{children:i.map((e,t)=>(0,s.jsx)(v,{op:e},t))})]})}},30292:(e,t,r)=>{"use strict";r.d(t,{D4:()=>x,FB:()=>u,W8:()=>p,g4:()=>g,jQ:()=>f});let s="mindos:organize-history",n=new Set(["create","update","unknown"]),a=new Set(["completed","partial","undone"]),i=new Set(["upload","drag-drop","inbox-organize","import-modal","plugin","web-clipper","conversation"]);function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){return o(e)&&"string"==typeof e.path&&"boolean"==typeof e.ok&&"string"==typeof e.action&&n.has(e.action)&&(void 0===e.undone||"boolean"==typeof e.undone)}function d(e){return o(e)&&"string"==typeof e.id&&Number.isFinite(e.timestamp)&&Array.isArray(e.sourceFiles)&&e.sourceFiles.every(e=>"string"==typeof e)&&Array.isArray(e.files)&&e.files.every(l)&&"string"==typeof e.status&&a.has(e.status)&&(void 0===e.source||"string"==typeof e.source&&i.has(e.source))&&(void 0===e.durationMs||Number.isFinite(e.durationMs))}function c(e){return Array.isArray(e)?e.filter(d).slice(0,50):[]}function u(){try{let e=localStorage.getItem(s);if(!e)return[];return c(JSON.parse(e))}catch{return[]}}function m(e){try{localStorage.setItem(s,JSON.stringify(c(e)))}catch{}}function x(e){let t=u();t.unshift(e);let r=t.slice(0,50);return m(r),r}function p(e,t){let r=u(),s=r.findIndex(t=>t.id===e);return s>=0&&(r[s]={...r[s],...t},m(r)),r}function g(){try{localStorage.removeItem(s)}catch{}}let h=0;function f(){return`org-${Date.now()}-${++h}`}},31156:(e,t,r)=>{"use strict";r.d(t,{G:()=>S});var s=r(66839),n=r(44223),a=r(64948),i=r(49925),o=r(53499),l=r(65637),d=r(21073),c=r(52229),u=r(31349),m=r(58221),x=r(47934);let p=(0,r(61549).F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:e,variant:t="default",size:r="default",...n}){return(0,s.jsx)(x.$,{"data-slot":"button",className:(0,m.cn)(p({variant:t,size:r,className:e})),...n})}var h=r(72799);function f({...e}){return(0,s.jsx)(a.D,{"data-slot":"dialog",...e})}function b({...e}){return(0,s.jsx)(i.Z,{"data-slot":"dialog-portal",...e})}function v({className:e,...t}){return(0,s.jsx)(o.X,{"data-slot":"dialog-overlay",className:(0,m.cn)("fixed inset-0 isolate z-50 overlay-backdrop duration-100 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function y({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(b,{children:[(0,s.jsx)(v,{}),(0,s.jsxs)(l.h,{"data-slot":"dialog-content",className:(0,m.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n,children:[t,r&&(0,s.jsxs)(d.H,{"data-slot":"dialog-close",render:(0,s.jsx)(g,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,s.jsx)(h.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function j({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,m.cn)("flex flex-col gap-2",e),...t})}function w({className:e,showCloseButton:t=!1,children:r,...n}){return(0,s.jsxs)("div",{"data-slot":"dialog-footer",className:(0,m.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...n,children:[r,t&&(0,s.jsx)(d.H,{render:(0,s.jsx)(g,{variant:"outline"}),children:"Close"})]})}function k({className:e,...t}){return(0,s.jsx)(c.L,{"data-slot":"dialog-title",className:(0,m.cn)("text-base leading-none font-medium",e),...t})}function N({className:e,...t}){return(0,s.jsx)(u.r,{"data-slot":"dialog-description",className:(0,m.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function S(){let[e,t]=(0,n.useState)(!1),[r,a]=(0,n.useState)({title:""}),i=(0,n.useRef)(null),o=(0,n.useCallback)(e=>(a(e),t(!0),new Promise(e=>{i.current=e})),[]),l=(0,n.useCallback)(e=>{t(!1),i.current?.(e),i.current=null},[]);return{confirm:o,ConfirmDialog:(0,s.jsx)(f,{open:e,onOpenChange:e=>{e||l(!1)},children:(0,s.jsxs)(y,{showCloseButton:!1,className:"sm:max-w-[400px]",children:[(0,s.jsxs)(j,{children:[(0,s.jsx)(k,{children:r.title}),r.description&&(0,s.jsx)(N,{children:r.description})]}),(0,s.jsxs)(w,{children:[(0,s.jsx)(g,{variant:"outline",onClick:()=>l(!1),children:r.cancelLabel??"Cancel"}),(0,s.jsx)(g,{variant:"destructive"===r.variant?"destructive":"default",onClick:()=>l(!0),children:r.confirmLabel??"Confirm"})]})]})})}}},34045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CsvRenderer:()=>A});var s=r(66839),n=r(44223),a=r(75740),i=r(67294),o=r(82079),l=r(46743),d=r(96737),c=r.n(d);function u(e,t){return c().unparse([e,...t])}let m=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"},{bg:"rgba(200,96,96,0.12)",text:"var(--error)"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function x(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)&65535;return m[t%m.length]}var p=r(91216),g=r(39966),h=r(72615),f=r(31606),b=r(73601);function v({value:e,onCommit:t}){let[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(e),l=(0,n.useRef)(null);function d(){a(!1),i!==e?t(i):o(e)}return((0,n.useEffect)(()=>{o(e)},[e]),(0,n.useEffect)(()=>{r&&l.current?.select()},[r]),r)?(0,s.jsx)("input",{ref:l,value:i,onChange:e=>o(e.target.value),onBlur:d,onKeyDown:t=>{"Enter"===t.key&&d(),"Escape"===t.key&&(o(e),a(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:e=>e.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,s.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>a(!0),title:e,children:e||(0,s.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function y({headers:e,visibleIndices:t,onAdd:r,onCancel:a}){let[i,o]=(0,n.useState)(()=>Array(e.length).fill(""));return(0,s.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[t.map((t,n)=>(0,s.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)("input",{autoFocus:0===n,value:i[t],onChange:e=>{var r;return r=e.target.value,void o(e=>{let s=[...e];return s[t]=r,s})},onKeyDown:e=>{"Enter"===e.key&&r(i),"Escape"===e.key&&a()},placeholder:e[t],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},t)),(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function j({headers:e,rows:t,cfg:r,saveAction:a}){let[i,o]=(0,n.useState)(t),[l,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{o(t)},[t]);let c=(0,n.useMemo)(()=>e.map((e,t)=>t).filter(t=>!r.hiddenFields.includes(e[t])),[e,r.hiddenFields]),m=e.indexOf(r.sortField),x=(0,n.useMemo)(()=>{let e=[...i];return m>=0&&e.sort((e,t)=>{let s=e[m]??"",n=t[m]??"",a=parseFloat(s),i=parseFloat(n),o=isNaN(a)||isNaN(i)?s.localeCompare(n):a-i;return"asc"===r.sortDir?o:-o}),e},[i,m,r.sortDir]),p=e.indexOf(r.groupField),j=(0,n.useMemo)(()=>{if(p<0)return[{key:null,rows:x.map(e=>({row:e,orig:e}))}];let e=new Map;for(let t of x){let r=t[p]||"(empty)";e.has(r)||e.set(r,[]),e.get(r).push(t)}return[...e.entries()].map(([e,t])=>({key:e,rows:t.map(e=>({row:e,orig:e}))}))},[x,p]);async function w(t,r,s){let n=i.map(e=>e===t?e.map((e,t)=>t===r?s:e):e);o(n),await a(u(e,n))}async function k(t){let r=i.filter(e=>e!==t);o(r),await a(u(e,r))}async function N(t){let r=[...i,t];o(r),d(!1),await a(u(e,r))}let S={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},C=0;return(0,s.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{style:{background:"var(--muted)"},children:[c.map(t=>(0,s.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:S,children:(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[e[t],r.sortField===e[t]&&("asc"===r.sortDir?(0,s.jsx)(g.A,{size:10,style:{color:"var(--amber)"}}):(0,s.jsx)(h.A,{size:10,style:{color:"var(--amber)"}}))]})},t)),(0,s.jsx)("th",{className:"w-8",style:{...S,background:"var(--muted)"}})]})}),(0,s.jsxs)("tbody",{children:[j.map((e,t)=>(0,s.jsxs)(n.Fragment,{children:[null!==e.key&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:c.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,s.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[e.key," \xb7 ",e.rows.length]})})},`grp-${e.key}`),e.rows.map(({row:e,orig:t})=>{let r=C++;return(0,s.jsxs)("tr",{className:"group transition-colors",style:{background:r%2==0?"var(--background)":"var(--card)"},onMouseEnter:e=>e.currentTarget.style.background="var(--muted)",onMouseLeave:e=>e.currentTarget.style.background=r%2==0?"var(--background)":"var(--card)",children:[c.map(r=>(0,s.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)(v,{value:e[r]??"",onCommit:e=>w(t,r,e)})},r)),(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)("button",{onClick:()=>k(t),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,s.jsx)(f.A,{size:12})})})]},r)})]},e.key??`section-${t}`)),l&&(0,s.jsx)(y,{headers:e,visibleIndices:c,onAdd:N,onCancel:()=>d(!1)})]})]})}),(0,s.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[i.length," rows \xb7 ",e.length," cols"]}),l?(0,s.jsx)("button",{onClick:()=>d(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,s.jsxs)("button",{onClick:()=>d(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,s.jsx)(b.A,{size:12})," Add row"]})]})]})}function w({headers:e,rows:t,cfg:r}){let n=e.indexOf(r.titleField),a=e.indexOf(r.descField),i=e.indexOf(r.tagField);return(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map((t,r)=>{let o=n>=0?t[n]:t[0]??"",l=a>=0?t[a]:"",d=i>=0?t[i]:"",c=d?x(d):null;return(0,s.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[d&&c&&(0,s.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:c.bg,color:c.text},children:d}),(0,s.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:o}),l&&(0,s.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:l}),(0,s.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:e.map((e,r)=>{if(r===n||r===a||r===i)return null;let o=t[r];return o?(0,s.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,s.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:e}),(0,s.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:o})]},r):null})})]},r)})})}function k({headers:e,rows:t,cfg:r,saveAction:a}){let[i,o]=(0,n.useState)(t),[l,d]=(0,n.useState)(null),[c,m]=(0,n.useState)(""),[p,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{o(t)},[t]);let h=e.indexOf(r.groupField),f=e.indexOf(r.titleField),v=e.indexOf(r.descField),{groups:y,groupKeys:j}=(0,n.useMemo)(()=>{let e=new Map;return i.forEach((t,r)=>{let s=(h>=0?t[h]:"")||"(empty)";e.has(s)||e.set(s,[]),e.get(s).push({row:t,origIdx:r})}),{groups:e,groupKeys:[...e.keys()]}},[i,h]);async function w(t,r){let s=i.map((e,s)=>{if(s!==t)return e;let n=[...e];return h>=0&&(n[h]=r),n});o(s),await a(u(e,s))}function k({group:t}){let r=y.get(t)??[],n=x(t),a=l===t;return(0,s.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,s.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:n.text}}),(0,s.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:n.text},children:t}),(0,s.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:r.length})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:a?"var(--amber-dim)":"var(--muted)",border:`1px solid ${a?"var(--amber)":"transparent"}`},onDragOver:e=>{e.preventDefault(),d(t)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||d(null)},onDrop:e=>{d(null);let r=parseInt(e.dataTransfer.getData("origIdx"),10);isNaN(r)||w(r,t)},children:[r.map(({row:t,origIdx:r})=>{let n=f>=0?t[f]:t[0]??"",a=v>=0?t[v]:"";return(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData("origIdx",String(r)),d(null)},onDragEnd:()=>d(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,s.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:n}),a&&(0,s.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:a}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:e.map((e,r)=>{if(r===h||r===f||r===v)return null;let n=t[r];return n?(0,s.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[e,": ",n]},r):null})})]},r)}),0===r.length&&(0,s.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,s.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,s.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[j.map(e=>(0,s.jsx)(k,{group:e},e)),(0,s.jsx)("div",{className:"flex-shrink-0 w-64",children:p?(0,s.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"===e.key&&c.trim()&&(m(""),g(!1)),"Escape"===e.key&&(m(""),g(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{m(""),g(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,s.jsx)("button",{onClick:()=>{m(""),g(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,s.jsxs)("button",{onClick:()=>g(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,s.jsx)(b.A,{size:12})," Add column"]})})]})}var N=r(72799),S=r(3824);function C({headers:e,cfg:t,view:r,onClose:n,onChange:a}){let i={color:"var(--muted-foreground)",fontSize:"0.72rem"};function o({label:t,value:r,onChange:n}){return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-display",style:i,children:t}),(0,s.jsx)(S.A,{value:r,onChange:n,size:"sm",options:[{value:"",label:"— none —"},...e.map(e=>({value:e,label:e}))]})]})}return(0,s.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:i,children:[r," settings"]}),(0,s.jsx)("button",{onClick:n,style:{color:"var(--muted-foreground)"},children:(0,s.jsx)(N.A,{size:13})})]}),"table"===r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:i,children:"Sort"}),(0,s.jsx)(o,{label:"Sort by",value:t.table.sortField,onChange:e=>a({...t,table:{...t.table,sortField:e}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{style:i,children:"Direction"}),(0,s.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(e=>(0,s.jsx)("button",{onClick:()=>a({...t,table:{...t.table,sortDir:e}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:t.table.sortDir===e?"var(--amber)":"var(--background)",color:t.table.sortDir===e?"var(--amber-foreground)":"var(--muted-foreground)"},children:e},e))})]}),(0,s.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:i,children:"Group"}),(0,s.jsx)(o,{label:"Group by",value:t.table.groupField,onChange:e=>a({...t,table:{...t.table,groupField:e}})}),(0,s.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:i,children:"Columns"}),(0,s.jsx)("div",{className:"flex flex-col gap-1.5",children:e.map(e=>{let r=t.table.hiddenFields.includes(e);return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{style:i,children:e}),(0,s.jsx)("button",{onClick:()=>{let s=r?t.table.hiddenFields.filter(t=>t!==e):[...t.table.hiddenFields,e];a({...t,table:{...t.table,hiddenFields:s}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:r?"var(--muted)":"var(--amber-dim)",color:r?"var(--muted-foreground)":"var(--amber)"},children:r?"Hidden":"Visible"})]},e)})})]}),"gallery"===r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{label:"Title",value:t.gallery.titleField,onChange:e=>a({...t,gallery:{...t.gallery,titleField:e}})}),(0,s.jsx)(o,{label:"Description",value:t.gallery.descField,onChange:e=>a({...t,gallery:{...t.gallery,descField:e}})}),(0,s.jsx)(o,{label:"Tag / Badge",value:t.gallery.tagField,onChange:e=>a({...t,gallery:{...t.gallery,tagField:e}})})]}),"board"===r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{label:"Group by",value:t.board.groupField,onChange:e=>a({...t,board:{...t.board,groupField:e}})}),(0,s.jsx)(o,{label:"Card title",value:t.board.titleField,onChange:e=>a({...t,board:{...t.board,titleField:e}})}),(0,s.jsx)(o,{label:"Card desc",value:t.board.descField,onChange:e=>a({...t,board:{...t.board,descField:e}})})]})]})}let z=[{id:"table",icon:(0,s.jsx)(a.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,s.jsx)(i.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,s.jsx)(o.A,{size:13}),label:"Board"}];function A({filePath:e,content:t,saveAction:r}){let{headers:a,rows:i}=(0,n.useMemo)(()=>{let e;return{headers:(e=c().parse(t,{skipEmptyLines:!0}).data)[0]??[],rows:e.slice(1)}},[t]),o=(0,n.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:a[0]??"",descField:a[1]??"",tagField:a[2]??""},board:{groupField:a[a.length-1]??"",titleField:a[0]??"",descField:a[1]??""}}),[a]),[d,u]=(0,p.Un)("csv",e,o),[m,x]=(0,n.useState)(!1),g=(0,n.useCallback)(e=>{u(e)},[u]),h=d.activeView;return(0,s.jsxs)("div",{className:"w-full py-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,s.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:z.map(e=>(0,s.jsxs)("button",{onClick:()=>g({...d,activeView:e.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:h===e.id?"var(--card)":"transparent",color:h===e.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:h===e.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[e.icon,e.label]},e.id))}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[i.length," rows"]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{onClick:()=>x(e=>!e),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,s.jsx)(l.A,{size:13})}),m&&(0,s.jsx)(C,{headers:a,cfg:d,view:h,onClose:()=>x(!1),onChange:g})]})]}),"table"===h&&(0,s.jsx)(j,{headers:a,rows:i,cfg:d.table,saveAction:r}),"gallery"===h&&(0,s.jsx)(w,{headers:a,rows:i,cfg:d.gallery}),"board"===h&&(0,s.jsx)(k,{headers:a,rows:i,cfg:d.board,saveAction:r})]})}},34959:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WorkflowYamlRenderer:()=>ee});var s=r(66839),n=r(44223),a=r(2408),i=r(455),o=r(29696),l=r(21082),d=r(36334),c=r(27636),u=r(73601),m=r(44361),x=r(80772),p=r(38688),g=r(72615),h=r(39966),f=r(31606),b=r(46743),v=r(38325),y=r(72799),j=r(30401),w=r(61017),k=r(98327);function N({trigger:e,children:t,open:r,onClose:a}){let i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!r)return;let e=e=>{i.current&&!i.current.contains(e.target)&&a()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r,a]),(0,s.jsxs)("div",{ref:i,className:"relative",children:[e,r&&(0,s.jsx)("div",{className:"absolute top-full left-0 mt-1 w-full min-w-[220px] max-h-[260px] overflow-y-auto bg-card border border-border rounded-lg shadow-lg z-50",children:t})]})}let S=null,C=!1,z=[];function A({value:e,onChange:t}){let[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(""),[l,d]=(0,n.useState)(S??[]),[c,u]=(0,n.useState)("");(0,n.useEffect)(()=>{S?d(S):(z.push(d),C||(C=!0,fetch("/api/acp/registry").then(e=>e.json()).then(e=>{let t=(e.registry?.agents??[]).map(e=>({id:e.id,name:e.name||e.id}));S=t,z.forEach(e=>e(t)),z.length=0}).catch(()=>{S=[],z.forEach(e=>e([])),z.length=0})))},[]);let m=c?l.filter(e=>e.id.toLowerCase().includes(c.toLowerCase())||e.name.toLowerCase().includes(c.toLowerCase())):l,x=e=>{t(e),a(!1),u("")},p=e?l.find(t=>t.id===e)?.name||e:void 0;return(0,s.jsxs)(N,{open:r,onClose:()=>{a(!1),u("")},trigger:(0,s.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,s.jsx)("span",{className:e?"text-foreground truncate":"text-muted-foreground",children:p||"MindOS"}),(0,s.jsx)(g.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,s.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,s.jsx)(v.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("input",{type:"text",value:c,onChange:e=>u(e.target.value),autoFocus:!0,placeholder:"Search agents...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),(0,s.jsxs)("button",{onClick:()=>x(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!e?"text-[var(--amber)] font-medium":"text-foreground"}`,children:["MindOS ",(0,s.jsx)("span",{className:"text-muted-foreground/50 ml-1",children:"(default)"})]}),m.slice(0,30).map(t=>(0,s.jsxs)("button",{onClick:()=>x(t.id),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${e===t.id?"text-[var(--amber)] font-medium":"text-foreground"}`,children:[t.name," ",t.name!==t.id&&(0,s.jsxs)("span",{className:"text-muted-foreground/50 ml-1",children:["(",t.id,")"]})]},t.id)),0===l.length&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),l.length>0&&0===m.length&&!c&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No ACP agents found"}),(0,s.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,s.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&i.trim()&&(x(i.trim()),o(""))},placeholder:"Custom agent ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}let E=[{group:"Anthropic",models:["claude-sonnet-4-6","claude-opus-4","claude-3.5-sonnet","claude-3.5-haiku"]},{group:"OpenAI",models:["gpt-4o","gpt-4o-mini","o3","o4-mini"]},{group:"Google",models:["gemini-2.5-pro","gemini-2.5-flash"]}];function $({value:e,onChange:t}){let[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(""),l=e=>{t(e),a(!1)};return(0,s.jsxs)(N,{open:r,onClose:()=>a(!1),trigger:(0,s.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,s.jsx)("span",{className:e?"text-foreground truncate":"text-muted-foreground",children:e||"Default model"}),e?(0,s.jsx)(y.A,{size:12,className:"text-muted-foreground shrink-0 hover:text-foreground cursor-pointer",onClick:e=>{e.stopPropagation(),l(void 0)}}):(0,s.jsx)(g.A,{size:12,className:"text-muted-foreground shrink-0"})]}),children:[(0,s.jsx)("button",{onClick:()=>l(void 0),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${!e?"text-[var(--amber)] font-medium":"text-muted-foreground"}`,children:"(default)"}),E.map(t=>(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"px-3 py-1 text-2xs font-semibold text-muted-foreground/60 uppercase tracking-wide bg-muted/30",children:t.group}),t.models.map(t=>(0,s.jsx)("button",{onClick:()=>l(t),className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors ${e===t?"text-[var(--amber)] font-medium":"text-foreground"}`,children:t},t))]},t.group)),(0,s.jsx)("div",{className:"border-t border-border px-2.5 py-1.5",children:(0,s.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&i.trim()&&(l(i.trim()),o(""))},placeholder:"Custom model ID...",className:"w-full px-2 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}let D=null,M=!1,T=[];function P({value:e,onChange:t}){let[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(D??[]),[l,d]=(0,n.useState)("");(0,n.useEffect)(()=>{D?o(D):(T.push(o),M||(M=!0,fetch("/api/skills").then(e=>e.json()).then(e=>{D=(e.skills??[]).map(e=>({name:e.name,description:e.description})),T.forEach(e=>e(D)),T.length=0}).catch(()=>{D=[],T.forEach(e=>e([])),T.length=0})))},[]);let c=l?i.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())):i;return(0,s.jsxs)("div",{children:[e.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mb-1.5",children:e.map(r=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-md text-2xs bg-[var(--amber)]/10 text-[var(--amber)] border border-[var(--amber)]/20",children:[r,(0,s.jsx)("button",{onClick:()=>t(e.filter(e=>e!==r)),className:"p-0.5 rounded hover:bg-[var(--amber)]/20 transition-colors",children:(0,s.jsx)(y.A,{size:10})})]},r))}),(0,s.jsxs)(N,{open:r,onClose:()=>{a(!1),d("")},trigger:(0,s.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground hover:bg-muted transition-colors",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:0===e.length?"Add skills...":`${e.length} selected`}),(0,s.jsx)(g.A,{size:12,className:"text-muted-foreground"})]}),children:[(0,s.jsx)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-1.5",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-background",children:[(0,s.jsx)(v.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("input",{type:"text",value:l,onChange:e=>d(e.target.value),autoFocus:!0,placeholder:"Search skills...",className:"flex-1 text-xs bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none"})]})}),c.slice(0,60).map(r=>{let n=e.includes(r.name);return(0,s.jsxs)("button",{onClick:()=>{var s;return s=r.name,void(e.includes(s)?t(e.filter(e=>e!==s)):t([...e,s]))},className:`w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors flex items-center gap-2 ${n?"bg-[var(--amber)]/5":""}`,children:[(0,s.jsx)("span",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 transition-colors ${n?"bg-[var(--amber)] border-[var(--amber)] text-[var(--amber-foreground)]":"border-border"}`,children:n&&(0,s.jsx)("span",{className:"text-[9px]",children:"✓"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block truncate",children:r.name}),r.description&&(0,s.jsx)("span",{className:"block text-2xs text-muted-foreground truncate mt-0.5",children:r.description})]})]},r.name)}),0===i.length&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),i.length>0&&0===c.length&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No skills found"})]})]})}function R({value:e,onChange:t}){let[r,a]=(0,n.useState)(!1),[i,o]=(0,n.useState)(""),l=(0,n.useCallback)(r=>{let s=r.trim();s&&!e.includes(s)&&t([...e,s])},[e,t]),d=(0,n.useCallback)(e=>{e.preventDefault(),a(!1);let t=e.dataTransfer.getData("text/mindos-path");if(t)return void l(t);let r=e.dataTransfer.getData("text/plain");r&&l(r)},[l]),u=(0,n.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",a(!0)},[]),m=(0,n.useCallback)(()=>a(!1),[]);return(0,s.jsxs)("div",{children:[e.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-1 mb-1.5",children:e.map(r=>(0,s.jsxs)("div",{className:"flex items-center gap-1.5 pl-2 pr-1 py-1 rounded-md text-2xs bg-muted/60 border border-border group",children:[(0,s.jsx)(j.A,{size:11,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-foreground truncate flex-1",title:r,children:r}),(0,s.jsx)("button",{onClick:()=>t(e.filter(e=>e!==r)),className:"p-0.5 rounded hover:bg-[var(--error)]/10 text-muted-foreground hover:text-[var(--error)] opacity-0 group-hover:opacity-100 transition-all",children:(0,s.jsx)(y.A,{size:10})})]},r))}),(0,s.jsxs)("div",{onDrop:d,onDragOver:u,onDragLeave:m,className:`flex items-center gap-2 px-3 py-2.5 rounded-lg border-2 border-dashed transition-colors ${r?"border-[var(--amber)] bg-[var(--amber)]/5":"border-border hover:border-muted-foreground/30"}`,children:[(0,s.jsx)(c.A,{size:14,className:`shrink-0 ${r?"text-[var(--amber)]":"text-muted-foreground/40"}`}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:"Drag files here from the sidebar"})]}),(0,s.jsx)("div",{className:"mt-1.5",children:(0,s.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&i.trim()&&(l(i.trim()),o(""))},placeholder:"Or type a file path...",className:"w-full px-2.5 py-1 text-2xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})})]})}async function I(e){try{let t=await fetch("/api/setup/ls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e||"~"})});if(!t.ok)return[];return(await t.json()).dirs??[]}catch{return[]}}function F({value:e,onChange:t}){let[r,a]=(0,n.useState)([]),[i,o]=(0,n.useState)(!1),[l,d]=(0,n.useState)(-1),u=(0,n.useRef)(!1),m=(0,n.useRef)(null),[x,p]=(0,n.useState)(!1),[g,h]=(0,n.useState)(e||"~"),[f,b]=(0,n.useState)([]),[v,y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(u.current){u.current=!1;return}if(!e.trim()){a([]),o(!1);return}let t=setTimeout(async()=>{let t=function(e){let t=e.trim();if(!t)return"";if(t.endsWith("/")||t.endsWith("\\"))return t;let r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return r>=0?t.slice(0,r+1):""}(e)||"~",r=await I(t);if(!r.length){a([]),o(!1);return}let s=t.includes("\\")?"\\":"/",n=t.endsWith("/")||t.endsWith("\\")?t:t+s,i=r.map(e=>n+e),l=e.endsWith("/")||e.endsWith("\\")?i:i.filter(t=>t.startsWith(e.trim()));a(l.slice(0,15)),o(l.length>0),d(-1)},300);return()=>clearTimeout(t)},[e]);let j=()=>{a([]),o(!1),d(-1)},S=e=>{u.current=!0,t(e),j(),m.current?.focus()},C=(0,n.useCallback)(async e=>{y(!0),b(await I(e)),y(!1)},[]);return(0,n.useEffect)(()=>{x&&C(g)},[x,g,C]),(0,s.jsxs)("div",{className:"relative flex gap-1.5",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)("input",{ref:m,type:"text",value:e,onChange:e=>{t(e.target.value),o(!0)},onKeyDown:e=>{i&&0!==r.length&&("ArrowDown"===e.key?(e.preventDefault(),d(e=>Math.min(e+1,r.length-1))):"ArrowUp"===e.key?(e.preventDefault(),d(e=>Math.max(e-1,-1))):"Enter"===e.key&&l>=0?(e.preventDefault(),S(r[l])):"Escape"===e.key?j():"Tab"===e.key&&l>=0&&(e.preventDefault(),S(r[l])))},onBlur:()=>setTimeout(j,150),onFocus:()=>r.length>0&&o(!0),placeholder:"~/projects/my-app",className:"w-full px-2.5 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground font-mono placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),i&&r.length>0&&(0,s.jsx)("div",{role:"listbox",className:"absolute z-50 left-0 right-0 top-full mt-1 rounded-lg border border-border bg-card shadow-lg overflow-auto max-h-[200px]",children:r.map((e,t)=>(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":t===l,onMouseDown:()=>S(e),className:`w-full text-left px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 ${t===l?"bg-muted text-foreground":"text-foreground hover:bg-muted/50"}`,children:[(0,s.jsx)(w.A,{size:11,className:"text-[var(--amber)] shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:e})]},e))})]}),(0,s.jsxs)(N,{open:x,onClose:()=>p(!1),trigger:(0,s.jsx)("button",{type:"button",onClick:()=>{h(e||"~"),p(e=>!e)},className:"px-2 py-1.5 rounded-lg border border-border bg-background text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Browse directories",children:(0,s.jsx)(c.A,{size:13})}),children:[(0,s.jsxs)("div",{className:"sticky top-0 bg-card border-b border-border px-2.5 py-2 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-2xs font-mono text-muted-foreground truncate flex-1",title:g,children:g}),(0,s.jsx)("button",{onClick:()=>{t(g),p(!1)},className:"px-2 py-0.5 text-2xs rounded font-medium bg-[var(--amber)] text-[var(--amber-foreground)] shrink-0",children:"Select"})]}),"~"!==g&&(0,s.jsxs)("button",{onClick:()=>{let e=g.split("/");e.length<=1||(e.pop(),h(e.join("/")||"~"))},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-muted-foreground flex items-center gap-1.5",children:[(0,s.jsx)(w.A,{size:12,className:"shrink-0"})," .."]}),v&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading..."}),!v&&0===f.length&&(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No subdirectories"}),f.map(e=>(0,s.jsxs)("button",{onClick:()=>{h("~"===g?`~/${e}`:`${g.replace(/\/+$/,"")}/${e}`)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-muted transition-colors text-foreground flex items-center gap-1.5",children:[(0,s.jsx)(w.A,{size:12,className:"text-[var(--amber)] shrink-0"}),(0,s.jsx)("span",{className:"truncate flex-1",children:e}),(0,s.jsx)(k.A,{size:10,className:"text-muted-foreground/40 shrink-0"})]},e))]})]})}function L({step:e,index:t,onChange:r,onDelete:a,onMoveUp:i,onMoveDown:o}){let[l,d]=(0,n.useState)(!e.prompt),[c,u]=(0,n.useState)(!1),m=t=>r({...e,...t}),x=e.skills?.length?e.skills:e.skill?[e.skill]:[],p=!!(e.agent||e.model||x.length||e.context?.length||e.description||e.timeout);return l?(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--amber)]/20 bg-card overflow-hidden shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 bg-muted/20",children:[(0,s.jsx)("span",{className:`text-xs font-medium flex-1 truncate ${e.name?"text-foreground":"text-muted-foreground/50 italic"}`,children:e.name||"Untitled step"}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[i&&(0,s.jsx)("button",{onClick:i,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move up",children:(0,s.jsx)(h.A,{size:12})}),o&&(0,s.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-muted text-muted-foreground/50 hover:text-foreground transition-colors",title:"Move down",children:(0,s.jsx)(g.A,{size:12})}),(0,s.jsx)("button",{onClick:a,className:"p-1 rounded hover:bg-[var(--error)]/10 text-muted-foreground/50 hover:text-[var(--error)] transition-colors",title:"Delete",children:(0,s.jsx)(f.A,{size:11})}),(0,s.jsx)("button",{onClick:()=>d(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground/50 transition-colors",title:"Collapse",children:(0,s.jsx)(h.A,{size:12})})]})]}),(0,s.jsxs)("div",{className:"px-3 py-3 space-y-3",children:[(0,s.jsx)("input",{type:"text",value:e.name,onChange:e=>m({name:e.target.value}),placeholder:"Step name...",autoFocus:!e.name,className:"w-full text-sm font-medium bg-transparent text-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,s.jsx)("textarea",{value:e.prompt,onChange:e=>m({prompt:e.target.value}),placeholder:"What should the AI do?",rows:3,className:"w-full px-3 py-2.5 text-sm rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-y leading-relaxed"}),(0,s.jsxs)("div",{className:`grid ${e.agent?"grid-cols-2":"grid-cols-1"} gap-2`,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Agent"}),(0,s.jsx)(A,{value:e.agent,onChange:t=>m({agent:t,model:t?e.model:void 0})})]}),e.agent&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Model"}),(0,s.jsx)($,{value:e.model,onChange:e=>m({model:e})})]})]}),(0,s.jsxs)("button",{onClick:()=>u(e=>!e),className:`flex items-center gap-1.5 text-2xs transition-colors ${c||p?"text-muted-foreground":"text-muted-foreground/40 hover:text-muted-foreground"}`,children:[(0,s.jsx)(b.A,{size:11}),c?"Less options":"More options",!c&&p&&(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"})]}),c&&(0,s.jsxs)("div",{className:"space-y-3 pt-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Skills"}),(0,s.jsx)(P,{value:x,onChange:e=>m({skills:e,skill:void 0})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Context files"}),(0,s.jsx)(R,{value:e.context??[],onChange:e=>m({context:e.length?e:void 0})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-[1fr,auto] gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Description"}),(0,s.jsx)("input",{type:"text",value:e.description||"",onChange:e=>m({description:e.target.value||void 0}),placeholder:"Optional note...",className:"w-full px-2.5 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-2xs text-muted-foreground/60 mb-1",children:"Timeout"}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("input",{type:"number",min:0,value:e.timeout||"",onChange:e=>m({timeout:e.target.value?Number(e.target.value):void 0}),placeholder:"120",className:"w-16 px-2 py-1.5 text-xs rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground/30 focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/40",children:"s"})]})]})]})]})]})]}):(0,s.jsxs)("div",{className:"group flex items-start gap-2 px-3 py-2 rounded-lg hover:bg-muted/40 transition-colors cursor-pointer -ml-1",onClick:()=>d(!0),children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:`text-sm leading-tight block ${e.name?"text-foreground font-medium":"text-muted-foreground/50 italic"}`,children:e.name||"Untitled step"}),p&&(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[e.agent&&(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground",children:e.agent}),x.slice(0,2).map(e=>(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded-full bg-[var(--amber)]/8 text-[var(--amber)]",children:e},e)),x.length>2&&(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:["+",x.length-2]}),e.context?.length?(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground/50",children:[e.context.length," files"]}):null]}),e.prompt&&(0,s.jsx)("p",{className:"text-2xs text-muted-foreground/50 mt-1 line-clamp-1 leading-relaxed",children:e.prompt})]}),(0,s.jsx)(g.A,{size:12,className:"text-muted-foreground/30 mt-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"})]})}var O=r(31156);function W({workflow:e,filePath:t,onChange:r,onSaved:a}){let[i,l]=(0,n.useState)(!1),[g,h]=(0,n.useState)(""),[f,b]=(0,n.useState)(!1),{confirm:v,ConfirmDialog:y}=(0,O.G)();(0,n.useEffect)(()=>{if(!f)return;let e=setTimeout(()=>b(!1),3e3);return()=>clearTimeout(e)},[f]);let j=t=>r({...e,...t}),w=(0,n.useCallback)((t,s)=>{let n=[...e.steps];n[t]=s,r({...e,steps:n})},[e,r]),k=(0,n.useCallback)(async t=>{let s=e.steps[t];(!s.name&&!s.prompt||await v({title:`Delete step "${s.name||"Untitled"}"?`,variant:"destructive",confirmLabel:"Delete"}))&&r({...e,steps:e.steps.filter((e,r)=>r!==t)})},[e,r,v]),N=(0,n.useCallback)(()=>{let t=e.steps.map(e=>e.id),s=e.steps.length+1,n={id:function(e,t){let r=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"step",s=r,n=2;for(;t.includes(s);)s=`${r}-${n}`,n++;return s}(`step-${s}`,t),name:`Step ${s}`,prompt:""};r({...e,steps:[...e.steps,n]})},[e,r]),S=(0,n.useCallback)((t,s)=>{if(s<0||s>=e.steps.length)return;let n=[...e.steps],[a]=n.splice(t,1);n.splice(s,0,a),r({...e,steps:n})},[e,r]),C=async()=>{l(!0),h(""),b(!1);try{let r,s=(r={title:e.title},e.description&&(r.description=e.description),e.workDir&&(r.workDir=e.workDir),e.skills?.length&&(r.skills=e.skills),e.tools?.length&&(r.tools=e.tools),r.steps=e.steps.map(e=>{let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.agent&&(t.agent=e.agent),e.model&&(t.model=e.model),e.skill&&(t.skill=e.skill),e.skills?.length&&(t.skills=e.skills),e.tools?.length&&(t.tools=e.tools),e.context?.length&&(t.context=e.context),t.prompt=e.prompt,e.timeout&&(t.timeout=e.timeout),t}),d.Ay.dump(r,{lineWidth:-1,noRefs:!0,quotingType:'"',forceQuotes:!1})),n=await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,op:"save_file",content:s})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||`Save failed (HTTP ${n.status})`)}b(!0),a?.()}catch(e){h(e instanceof Error?e.message:"Save failed")}finally{l(!1)}};(0,n.useEffect)(()=>{let t=t=>{(t.metaKey||t.ctrlKey)&&"s"===t.key&&(t.preventDefault(),!i&&e.title.trim()&&e.steps.length>0&&C())};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)});let z=!i&&!!e.title.trim()&&e.steps.length>0;return(0,s.jsxs)("div",{children:[y,(0,s.jsxs)("div",{className:"space-y-3 mb-8",children:[(0,s.jsx)("input",{type:"text",value:e.title,onChange:e=>j({title:e.target.value}),placeholder:"Flow title...",className:"w-full text-lg font-semibold bg-transparent text-foreground placeholder:text-muted-foreground/40 focus:outline-none border-none p-0 leading-tight"}),(0,s.jsx)("input",{type:"text",value:e.description||"",onChange:e=>j({description:e.target.value||void 0}),placeholder:"Add a description...",className:"w-full text-sm bg-transparent text-muted-foreground placeholder:text-muted-foreground/30 focus:outline-none border-none p-0"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{size:12,className:"text-muted-foreground/40 shrink-0"}),(0,s.jsx)(F,{value:e.workDir||"",onChange:e=>j({workDir:e||void 0})})]})]}),e.steps.length>0?(0,s.jsxs)("div",{className:"relative",children:[e.steps.length>1&&(0,s.jsx)("div",{className:"absolute left-[19px] top-6 bottom-16 w-px bg-border"}),(0,s.jsx)("div",{className:"flex flex-col gap-3 mb-5 relative",children:e.steps.map((t,r)=>(0,s.jsxs)("div",{className:"relative pl-11",children:[(0,s.jsx)("div",{className:"absolute left-[7px] top-3 w-[22px] h-[22px] rounded-full border-2 border-border bg-background z-10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-[10px] font-bold text-muted-foreground/60",children:r+1})}),(0,s.jsx)(L,{step:t,index:r,onChange:e=>w(r,e),onDelete:()=>k(r),onMoveUp:r>0?()=>S(r,r-1):void 0,onMoveDown:r<e.steps.length-1?()=>S(r,r+1):void 0})]},t.id))}),(0,s.jsxs)("div",{className:"relative pl-11",children:[(0,s.jsx)("div",{className:"absolute left-[7px] top-2.5 w-[22px] h-[22px] rounded-full border-2 border-dashed border-border bg-background z-10 flex items-center justify-center",children:(0,s.jsx)(u.A,{size:9,className:"text-muted-foreground/40"})}),(0,s.jsx)("button",{onClick:N,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-muted-foreground/60 hover:text-muted-foreground hover:bg-muted/40 transition-colors",children:"Add step..."})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-2xl bg-[var(--amber)]/8 flex items-center justify-center mb-4",children:(0,s.jsx)(o.A,{size:22,className:"text-[var(--amber)]/60"})}),(0,s.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:"Build your flow"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60 mb-5 max-w-[240px]",children:"Each step is a task for an AI agent. Chain them together to automate complex workflows."}),(0,s.jsxs)("button",{onClick:N,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity",children:[(0,s.jsx)(u.A,{size:12}),"Add first step"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-8 pt-4 border-t border-border/50",children:[(0,s.jsxs)("button",{onClick:C,disabled:!z,title:e.title.trim()?0===e.steps.length?"Add at least one step":void 0:"Title is required",className:`flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium transition-all disabled:opacity-40 disabled:cursor-not-allowed ${z?"bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90":"bg-muted text-muted-foreground"}`,children:[i?(0,s.jsx)(m.A,{size:12,className:"animate-spin"}):(0,s.jsx)(x.A,{size:12}),i?"Saving...":"Save"]}),g&&(0,s.jsx)("span",{className:"text-xs text-[var(--error)]",children:g}),f&&!g&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-2xs text-[var(--success)]",children:[(0,s.jsx)(p.A,{size:11}),"Saved"]}),(0,s.jsx)("kbd",{className:"text-2xs text-muted-foreground/30 ml-auto font-mono",children:"Ctrl+S"})]})]})}var B=r(38070),_=r(52364),U=r(19378),H=r(8973),X=r(52212);let K=new Map;async function G(e,t){if(K.has(e))return K.get(e);try{let r=await fetch("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:e}),signal:t});if(!r.ok)return K.set(e,null),null;let s=(await r.json()).content;return K.set(e,s??null),s??null}catch{return null}}async function Y(e,t){try{let r=await fetch(`/api/acp/registry?agent=${encodeURIComponent(e)}`,{signal:t});if(!r.ok)return null;let s=await r.json();if(s.agent?.id)return{id:s.agent.id,name:s.agent.name||e};return null}catch{return null}}async function Z(e,t,r,s,n){let a=function(e,t){let r=[];if(e.skills?.length)for(let t of e.skills)r.includes(t)||r.push(t);else e.skill&&r.push(e.skill);for(let e of t.skills??[])r.includes(e)||r.push(e);return r}(e,t),i=new Map;if(a.length>0)for(let[e,t]of(await Promise.all(a.map(async e=>{let t=await G(e,n);return[e,t]}))))t&&i.set(e,t);let o=null;e.agent&&(o=await Y(e.agent,n));let l={messages:[{role:"user",content:function(e,t,r){let s=t.steps.map((e,t)=>`${t+1}. ${e.name}`).join("\n"),n=e.skills?.length?e.skills[0]:e.skill,a="";if(r.size>0){let e=[];for(let[t,s]of r){let r=t===n;e.push(`### ${r?"[Primary] ":""}Skill: ${t}
2
-
3
- ${s}`)}a=`
4
-
5
- ---
6
- ## Skill Reference
7
-
8
- Follow the guidelines from these skills when executing this step:
9
-
10
- ${e.join("\n\n---\n\n")}`}return`You are executing step ${e.index+1} of a workflow: "${e.name}".
11
-
12
- Context of the full workflow "${t.title}":
13
- ${s}
14
-
15
- Current step instructions:
16
- ${e.prompt||"(No specific instructions — use common sense.)"}${a}
17
-
18
- Execute concisely. Provide:
19
- 1. What you did / what the output is
20
- 2. Any decisions made
21
- 3. What the next step should watch out for
22
-
23
- Be specific and actionable. Format in Markdown.`}(e,t,i)}],currentFile:r};o&&(l.selectedAcpAgent=o);let d=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),signal:n});if(!d.ok)throw Error(`Request failed (HTTP ${d.status})`);if(!d.body)throw Error("No response body");let c=d.body.getReader(),u=new TextDecoder,m="",x="";function p(e){let t=e.match(/^data:(.+)$/);if(t){let r;try{r=JSON.parse(t[1])}catch{let t=e.match(/^0:"((?:[^"\\]|\\.)*)"$/);t&&s(m+=t[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"));return}if(r&&"object"==typeof r&&"type"in r){let e=r;if("text_delta"===e.type&&"string"==typeof e.delta)s(m+=e.delta);else if("thinking_delta"===e.type&&"string"==typeof e.delta)s(m+=e.delta);else if("error"===e.type&&e.message)throw Error(String(e.message))}return}let r=e.match(/^0:"((?:[^"\\]|\\.)*)"$/);r&&s(m+=r[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"))}for(;;){let{done:e,value:t}=await c.read();if(e)break;let r=(x+=u.decode(t,{stream:!0})).split("\n");for(let e of(x=r.pop()??"",r))p(e)}x&&p(x)}function q(e){return e.steps.map((e,t)=>({...e,index:t,status:"pending",output:"",error:void 0}))}function V({status:e,index:t}){let r="w-[26px] h-[26px] rounded-full flex items-center justify-center shrink-0 transition-all";return"running"===e?(0,s.jsx)("div",{className:`${r} bg-[var(--amber)]/15 ring-2 ring-[var(--amber)]/30`,children:(0,s.jsx)(m.A,{size:12,className:"text-[var(--amber)] animate-spin"})}):"done"===e?(0,s.jsx)("div",{className:`${r} bg-[var(--success)]/15`,children:(0,s.jsx)(p.A,{size:13,className:"text-[var(--success)]"})}):"error"===e?(0,s.jsx)("div",{className:`${r} bg-[var(--error)]/15`,children:(0,s.jsx)(l.A,{size:13,className:"text-[var(--error)]"})}):"skipped"===e?(0,s.jsx)("div",{className:`${r} bg-muted/50`,children:(0,s.jsx)(B.A,{size:11,className:"text-muted-foreground/40"})}):(0,s.jsx)("div",{className:`${r} border-2 border-border bg-background`,children:(0,s.jsx)("span",{className:"text-[11px] font-bold text-muted-foreground/50",children:t+1})})}function J({step:e,canRun:t,onRun:r,onSkip:a,onCancel:o}){let[d,c]=(0,n.useState)(!1),u=!!(e.output||e.error),m=e.skills?.length?e.skills:e.skill?[e.skill]:[];return"running"===e.status||e.status,(0,s.jsx)("div",{className:`transition-opacity ${"skipped"===e.status?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(V,{status:e.status,index:e.index}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-between",children:[(0,s.jsx)("span",{className:`text-sm font-medium truncate ${"done"===e.status?"text-foreground":"running"===e.status?"text-[var(--amber)]":"error"===e.status?"text-[var(--error)]":"text-foreground/70"}`,children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[null!=e.durationMs&&("done"===e.status||"error"===e.status)&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/40 font-mono",children:function(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}(e.durationMs)}),"pending"===e.status&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:r,disabled:!t,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-2xs font-medium transition-all disabled:opacity-30 bg-[var(--amber)] text-[var(--amber-foreground)]",children:[(0,s.jsx)(i.A,{size:9})," Run"]}),(0,s.jsx)("button",{onClick:a,className:"px-1.5 py-0.5 rounded-md text-2xs text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted transition-colors",children:"Skip"})]}),"running"===e.status&&(0,s.jsxs)("button",{onClick:o,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-2xs text-[var(--error)]/70 hover:text-[var(--error)] hover:bg-[var(--error)]/10 transition-colors",children:[(0,s.jsx)(_.A,{size:9})," Stop"]}),u&&"running"!==e.status&&(0,s.jsx)("button",{onClick:()=>c(e=>!e),className:"p-0.5 rounded text-muted-foreground/30 hover:text-muted-foreground transition-colors",children:(0,s.jsx)(g.A,{size:12,className:`transition-transform ${d?"rotate-180":""}`})})]})]}),(e.agent||m.length>0)&&(0,s.jsxs)("div",{className:"flex gap-1 mt-0.5 flex-wrap",children:[e.agent&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/50",children:e.agent}),e.agent&&m.length>0&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/20",children:"/"}),m.map(e=>(0,s.jsx)("span",{className:"text-2xs text-[var(--amber)]/60",children:e},e))]}),(d||"running"===e.status)&&u&&(0,s.jsxs)("div",{className:"mt-2 rounded-lg overflow-hidden border border-border/50",children:[e.error&&(0,s.jsxs)("div",{className:"px-3 py-2.5 bg-[var(--error)]/5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,s.jsx)(l.A,{size:10,className:"text-[var(--error)]"}),(0,s.jsx)("span",{className:"text-2xs font-medium text-[var(--error)]",children:"Error"})]}),(0,s.jsx)("div",{className:"text-xs text-[var(--error)]/80 whitespace-pre-wrap break-words leading-relaxed",children:e.error})]}),e.output&&(0,s.jsxs)("div",{className:"px-3 py-2.5 bg-muted/20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,s.jsx)(U.A,{size:10,className:"text-[var(--amber)]"}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/50 uppercase tracking-wider font-medium",children:"Output"}),"running"===e.status&&(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse"})]}),(0,s.jsx)("div",{className:"text-xs leading-relaxed text-foreground/80 whitespace-pre-wrap break-words",children:e.output})]})]})]})]})})}function Q({workflow:e,filePath:t}){let[r,a]=(0,n.useState)(()=>q(e)),[i,o]=(0,n.useState)(!1),d=(0,n.useRef)(null);(0,n.useEffect)(()=>{a(q(e)),o(!1)},[e]);let u=(0,n.useCallback)(()=>{d.current?.abort(),d.current=null,o(!1),a(e=>e.map(e=>"running"===e.status?{...e,status:"error",error:"Cancelled"}:e))},[]),x=(0,n.useCallback)(async r=>{if(i)return;d.current?.abort();let s=new AbortController;d.current=s,o(!0);let n=Date.now();a(e=>e.map((e,t)=>t===r?{...e,status:"running",output:"",error:void 0,startedAt:new Date}:e));try{let i={...e.steps[r],index:r,status:"running",output:""};await Z(i,e,t,e=>a(t=>t.map((t,s)=>s===r?{...t,output:e}:t)),s.signal);let o=Date.now()-n;a(e=>e.map((e,t)=>t===r?{...e,status:"done",completedAt:new Date,durationMs:o}:e))}catch(t){if(t instanceof Error&&"AbortError"===t.name)return;let e=Date.now()-n;a(s=>s.map((s,n)=>n===r?{...s,status:"error",error:t instanceof Error?t.message:String(t),durationMs:e}:s))}finally{o(!1)}},[i,e,t]),g=(0,n.useCallback)(e=>{a(t=>t.map((t,r)=>r===e?{...t,status:"skipped"}:t))},[]),h=(0,n.useCallback)(()=>{d.current?.abort(),d.current=null,o(!1),K.clear(),a(q(e))},[e]),f=r.filter(e=>"done"===e.status).length,b=r.length>0?Math.round(f/r.length*100):0,v=f===r.length&&r.length>0,y=r.findIndex(e=>"pending"===e.status),j=r.some(e=>"error"===e.status);return(0,s.jsxs)("div",{children:[(e.workDir||e.description)&&(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4 text-xs text-muted-foreground flex-wrap",children:[e.workDir&&(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-2xs bg-muted/50 px-2 py-0.5 rounded",children:[(0,s.jsx)(c.A,{size:10,className:"shrink-0"}),e.workDir]}),e.description&&(0,s.jsx)("span",{className:"leading-relaxed",children:e.description})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("div",{className:"flex items-center gap-2",children:v?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-[var(--success)]",children:[(0,s.jsx)(p.A,{size:13}),"Complete"]}):j?(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-[var(--error)]",children:[(0,s.jsx)(l.A,{size:13}),f,"/",r.length," done"]}):(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[f,"/",r.length]})}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[y>=0&&(0,s.jsxs)("button",{onClick:()=>x(y),disabled:i,className:"flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all disabled:opacity-40 bg-[var(--amber)] text-[var(--amber-foreground)]",children:[i?(0,s.jsx)(m.A,{size:11,className:"animate-spin"}):(0,s.jsx)(H.A,{size:11}),i?"Running...":"Run next"]}),(0,s.jsxs)("button",{onClick:h,className:"flex items-center gap-1 px-2 py-1 rounded-md text-2xs text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted transition-colors",children:[(0,s.jsx)(X.A,{size:10}),"Reset"]})]})]}),(0,s.jsx)("div",{className:"h-1 rounded-full bg-border/50 overflow-hidden",children:(0,s.jsx)("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${v?"bg-[var(--success)]":j?"bg-[var(--error)]":"bg-[var(--amber)]"}`,style:{width:`${b}%`}})})]}),(0,s.jsxs)("div",{className:"relative",children:[r.length>1&&(0,s.jsx)("div",{className:"absolute left-[12px] top-5 bottom-5 w-px bg-border/50"}),(0,s.jsx)("div",{className:"flex flex-col gap-4",children:r.map((e,t)=>(0,s.jsx)(J,{step:e,canRun:!i,onRun:()=>x(t),onSkip:()=>g(t),onCancel:u},e.id))})]})]})}function ee({filePath:e,content:t}){let r=(0,n.useMemo)(()=>(function(e){try{let t=d.Ay.load(e,{schema:d.Ay.JSON_SCHEMA});if(!t)return{workflow:null,errors:["File is empty"]};if("object"!=typeof t)return{workflow:null,errors:["Content is not valid YAML"]};let r=function(e){let t=[];if(!e||"object"!=typeof e)return{valid:!1,errors:["Must be a valid YAML object"]};if(e.title&&"string"==typeof e.title&&e.title.trim()||t.push("Missing required field 'title' (string)"),void 0!==e.description&&"string"!=typeof e.description&&t.push("'description' must be a string"),void 0!==e.skills&&(Array.isArray(e.skills)?e.skills.every(e=>"string"==typeof e)||t.push("'skills' must contain only strings"):t.push("'skills' must be an array of strings")),void 0!==e.tools&&(Array.isArray(e.tools)?e.tools.every(e=>"string"==typeof e)||t.push("'tools' must contain only strings"):t.push("'tools' must be an array of strings")),e.steps)if(Array.isArray(e.steps))if(0===e.steps.length)t.push("'steps' must have at least 1 step");else{let r=new Set;e.steps.forEach((e,s)=>{var n,a;let i,o,l=(n=e,a=s,i=[],o=`steps[${a}]`,n&&"object"==typeof n?(n.id&&"string"==typeof n.id&&n.id.trim()?/^[a-z0-9_-]+$/.test(n.id)||i.push(`${o}.id: '${n.id}' is invalid — use only lowercase letters, numbers, hyphens, underscores (e.g., 'run-tests')`):i.push(`${o}: missing required field 'id' (non-empty string)`),n.name&&"string"==typeof n.name&&n.name.trim()||i.push(`${o}: missing required field 'name' (non-empty string)`),void 0!==n.description&&"string"!=typeof n.description&&i.push(`${o}.description: must be a string`),void 0===n.agent||"string"==typeof n.agent&&n.agent.trim()||i.push(`${o}.agent: must be a non-empty string`),void 0===n.skill||"string"==typeof n.skill&&n.skill.trim()||i.push(`${o}.skill: must be a non-empty string`),void 0!==n.tools&&(Array.isArray(n.tools)?n.tools.every(e=>"string"==typeof e)||i.push(`${o}.tools: must contain only strings`):i.push(`${o}.tools: must be an array of strings`)),n.prompt&&"string"==typeof n.prompt&&n.prompt.trim()||i.push(`${o}: missing required field 'prompt' (non-empty string)`),void 0!==n.timeout&&("number"!=typeof n.timeout||n.timeout<=0)&&i.push(`${o}.timeout: must be a positive number (seconds)`)):i.push(`${o}: must be a valid object`),i);t.push(...l);let d=e?.id;"string"==typeof d&&d.trim()&&(r.has(d)&&t.push(`steps[${s}].id: duplicate id '${d}' (each step must have a unique id)`),r.add(d))})}else t.push("'steps' must be an array");else t.push("Missing required field 'steps' (array)");return{valid:0===t.length,errors:t}}(t);if(!r.valid)return{workflow:null,errors:r.errors};return{workflow:t,errors:[]}}catch(e){return{workflow:null,errors:[e instanceof Error?e.message:String(e)]}}})(t),[t]),[c,u]=(0,n.useState)("edit"),[m,x]=(0,n.useState)(!1),[p,g]=(0,n.useState)(()=>r.workflow?structuredClone(r.workflow):{title:"",description:"",steps:[]});(0,n.useRef)(t);let h=(0,n.useMemo)(()=>r.workflow??null,[r.workflow]),f=(0,n.useCallback)(e=>{g(e),x(!0)},[]),b=(0,n.useCallback)(()=>x(!1),[]),v=h??p,y=v.steps.length>0&&!!v.title,j=r.errors.length>0,w=v.title?0===v.steps.length?"Add at least one step":m?"Save changes first":void 0:"Add a title first",k=e=>{("run"!==e||y)&&u(e)};return(0,s.jsxs)("div",{className:"max-w-[720px] mx-auto py-8 px-2",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 p-0.5 rounded-lg bg-muted/50",children:[(0,s.jsxs)("button",{onClick:()=>k("edit"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all ${"edit"===c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(a.A,{size:11}),"Edit"]}),(0,s.jsxs)("button",{onClick:()=>k("run"),disabled:!y,title:w,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all disabled:opacity-30 disabled:cursor-not-allowed ${"run"===c?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)(i.A,{size:11}),"Run"]})]}),p.steps.length>0&&(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground/60 font-mono",children:[p.steps.length," step",1!==p.steps.length?"s":""]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-1 w-8 h-8 rounded-lg bg-[var(--amber)]/10 flex items-center justify-center shrink-0",children:(0,s.jsx)(o.A,{size:16,className:"text-[var(--amber)]"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("h1",{className:"text-lg font-semibold text-foreground truncate leading-tight",children:[p.title||"Untitled Flow",m&&(0,s.jsx)("span",{className:"text-[var(--amber)] ml-1.5 text-sm",title:"Unsaved changes",children:"*"})]}),p.description&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:p.description})]})]})]}),j&&"edit"===c&&(0,s.jsxs)("div",{className:"mb-5 px-3.5 py-3 rounded-lg bg-[var(--error)]/8 border border-[var(--error)]/20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,s.jsx)(l.A,{size:13,className:"text-[var(--error)] shrink-0"}),(0,s.jsx)("span",{className:"text-xs font-medium text-[var(--error)]",children:"Parse issues found"})]}),(0,s.jsx)("ul",{className:"text-2xs text-[var(--error)]/70 pl-5 list-disc space-y-0.5",children:r.errors.slice(0,3).map((e,t)=>(0,s.jsx)("li",{children:e},t))})]}),"edit"===c?(0,s.jsx)(W,{workflow:p,filePath:e,onChange:f,onSaved:b}):(0,s.jsx)(Q,{workflow:v,filePath:e})]})}},38604:()=>{},39580:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConfigRenderer:()=>d});var s=r(66839),n=r(44223),a=r(44361),i=r(76723),o=r(72799),l=r(73601);function d({content:e,saveAction:t}){let r=(0,n.useMemo)(()=>{try{return JSON.parse(e)}catch{return null}},[e]),[d,c]=(0,n.useState)(r),[u,m]=(0,n.useState)(!1),[x,p]=(0,n.useState)(!1),[g,h]=(0,n.useState)(""),[f,b]=(0,n.useState)({});(0,n.useEffect)(()=>{c(r),h("")},[r]);let v=d??{},y=v.uiSchema?.sections??[],j=v.keySpecs??{},w=(0,n.useCallback)(async e=>{m(!0),p(!1),h("");try{await t(`${JSON.stringify(e,null,2)}
24
- `),p(!0),setTimeout(()=>p(!1),1200)}catch(e){h(e instanceof Error?e.message:"Failed to save")}finally{m(!1)}},[t]),k=(0,n.useCallback)(async(e,t)=>{if(!d)return;let r=function(e,t,r){let s=t.split("."),n=structuredClone(e),a=n;for(let e=0;e<s.length-1;e++){let t=s[e],r=a[t];(!r||"object"!=typeof r||Array.isArray(r))&&(a[t]={}),a=a[t]}return a[s[s.length-1]]=r,n}(d,e,t);c(r),await w(r)},[d,w]);return r&&d?(0,s.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,s.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[u&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,s.jsx)(a.A,{size:12,className:"animate-spin"}),"Saving"]}),!u&&x&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,s.jsx)(i.A,{size:12}),"Saved"]})]})]}),g&&(0,s.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:g}),y.map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),e.description&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.description})]}),(0,s.jsx)("div",{className:"space-y-3",children:e.fields.map(e=>{let t=j[e]??{},r=function(e,t){let r=t.split("."),s=e;for(let e of r){if(!s||"object"!=typeof s||!(e in s))return null;s=s[e]}return s}(d,e),n=t.label||e;return(0,s.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-foreground",children:n}),t.description&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:t.description})]}),"switch"===t.control&&"boolean"==typeof r&&(0,s.jsx)("button",{type:"button",onClick:()=>k(e,!r),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:r?"var(--amber)":"var(--muted)",color:r?"var(--amber-foreground)":"var(--muted-foreground)"},children:r?"ON":"OFF"})]}),"text"===t.control&&"string"==typeof r&&(0,s.jsx)("input",{defaultValue:r,onBlur:t=>k(e,t.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===t.control&&"number"==typeof r&&(0,s.jsx)("input",{type:"number",defaultValue:r,min:t.constraints?.min,max:t.constraints?.max,onBlur:s=>{let n=Number(s.target.value),a=t.constraints?.min,i=t.constraints?.max,o=Number.isFinite(n)?n:r;"number"==typeof a&&o<a&&(o=a),"number"==typeof i&&o>i&&(o=i),k(e,o)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===t.control&&Array.isArray(r)&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.map((t,n)=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(t),(0,s.jsx)("button",{type:"button",onClick:()=>k(e,r.filter((e,t)=>t!==n)),className:"text-muted-foreground hover:text-foreground",children:(0,s.jsx)(o.A,{size:11})})]},`${String(t)}-${n}`))}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{value:f[e]??"",onChange:t=>b(r=>({...r,[e]:t.target.value})),onKeyDown:t=>{if("Enter"!==t.key)return;t.preventDefault();let s=(f[e]??"").trim();s&&(k(e,[...r,s]),b(t=>({...t,[e]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,s.jsxs)("button",{type:"button",onClick:()=>{let t=(f[e]??"").trim();t&&(k(e,[...r,t]),b(t=>({...t,[e]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,s.jsx)(l.A,{size:12})," Add"]})]})]})]},e)})})]},e.id))]}):(0,s.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},41209:(e,t,r)=>{"use strict";r.d(t,{P:()=>s,u:()=>n});let s=[{id:"telegram",name:"Telegram",icon:"\uD83D\uDCF1",guide:"1. Open Telegram → search @BotFather\n2. Send /newbot → follow prompts\n3. Copy the token below",purpose:"Receive MindOS notifications and quick updates in Telegram.",purposeZh:"通过 Telegram 接收 MindOS 的通知和快速更新。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. chat ID like 123456789 or -1001234567890",recipientExampleZh:"例如 123456789 或 -1001234567890 这样的 chat ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456789:AABBccDD-EeFfGgHh...",hint:"Format: number:alphanumeric"}]},{id:"feishu",name:"Feishu",icon:"\uD83D\uDC26",guide:"1. open.feishu.cn → Create App\n2. Credentials page → copy App ID & Secret\n3. Enable Bot capability + add permissions",guideUrl:"https://open.feishu.cn/",editHint:"Need to update credentials? Edit and save below — MindOS will reconnect automatically.",purpose:"Receive MindOS results in Feishu, or let users message the bot directly when conversations are enabled.",purposeZh:"通过飞书接收 MindOS 的结果;开启对话后,也可以让用户直接在飞书里给机器人发消息。",useCases:["Agent completion alerts","Error notifications","Test messages","Direct bot conversations in Feishu"],useCasesZh:["Agent 完成提醒","错误通知","测试消息","在飞书里直接与机器人对话"],recipientExample:"e.g. ou_xxx, oc_xxx, or a work email",recipientExampleZh:"例如 ou_xxx、oc_xxx,或企业邮箱",fields:[{key:"app_id",label:"App ID",placeholder:"CLI_XXXXXXXXXXXXXXXXX",hint:"From Credentials page on open.feishu.cn"},{key:"app_secret",label:"App Secret",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXX",hint:"Keep this secret — do not share"}]},{id:"discord",name:"Discord",icon:"\uD83D\uDCAC",guide:"1. discord.com/developers → New Application\n2. Bot tab → Reset Token → copy\n3. Enable Message Content Intent",purpose:"Send MindOS updates into Discord channels and DMs.",purposeZh:"把 MindOS 的更新发送到 Discord 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Discord channel or user ID",recipientExampleZh:"例如 Discord 频道 ID 或用户 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"MTIxNzM..."}]},{id:"slack",name:"Slack",icon:"\uD83D\uDCBC",guide:"1. api.slack.com/apps → Create New App\n2. OAuth & Permissions → add chat:write scope\n3. Install to Workspace → copy Bot Token",purpose:"Route MindOS notifications into Slack channels and direct messages.",purposeZh:"把 MindOS 的通知发送到 Slack 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Slack channel or user ID like C123... or U123...",recipientExampleZh:"例如 Slack 频道 ID 或用户 ID(如 C123... / U123...)",fields:[{key:"bot_token",label:"Bot Token",placeholder:"xoxb-xxxx-xxxx-xxxx",hint:"Starts with xoxb-"}]},{id:"wecom",name:"WeCom",icon:"\uD83C\uDFE2",guide:"1. Group chat → Add Robot → Custom\n2. Copy Webhook URL\n3. Extract the key parameter from URL",purpose:"Deliver MindOS notifications into WeCom group chats.",purposeZh:"把 MindOS 通知投递到企业微信群聊。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured robot or WeCom target",recipientExampleZh:"使用你配置好的机器人或企业微信目标",fields:[{key:"webhook_key",label:"Webhook Key",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",hint:"The key= value from webhook URL"}]},{id:"dingtalk",name:"DingTalk",icon:"\uD83D\uDD14",guide:"1. Group → Settings → Smart Assistant → Add Robot\n2. Select Custom (Webhook)\n3. Copy the full Webhook URL",purpose:"Push MindOS notifications into DingTalk groups.",purposeZh:"把 MindOS 通知发送到钉钉群。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured DingTalk robot target",recipientExampleZh:"使用你配置好的钉钉机器人目标",fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",hint:"Full URL including access_token"}]},{id:"wechat",name:"WeChat",icon:"\uD83D\uDC9A",guide:"1. Visit ilinkai.weixin.qq.com\n2. Register & create a bot application\n3. QR login in the console → copy Bot Token from dashboard",purpose:"Send MindOS updates to WeChat via your configured bot.",purposeZh:"通过你配置好的机器人把 MindOS 更新发送到微信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the WeChat user or chat ID supported by your bot",recipientExampleZh:"使用你的机器人支持的微信用户或群聊 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"wx_xxxxxxxxxxxxxxxx",hint:"From iLink Bot console after QR login"}]},{id:"qq",name:"QQ",icon:"\uD83D\uDC27",guide:"1. q.qq.com → Create Bot\n2. Development tab → copy App ID & Secret\n3. Add group/C2C intents as needed",purpose:"Deliver MindOS notifications through QQ bot channels.",purposeZh:"通过 QQ 机器人频道接收 MindOS 通知。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the QQ openid or group_openid for your target",recipientExampleZh:"使用目标 QQ 的 openid 或 group_openid",fields:[{key:"app_id",label:"App ID",placeholder:"102xxxxxx"},{key:"app_secret",label:"App Secret",placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx"}]}];function n(e){return s.find(t=>t.id===e)}},50567:(e,t,r)=>{"use strict";r.d(t,{LD:()=>s,LZ:()=>n,qQ:()=>a});let s=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],n=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],a=["first-day","daily","project","advanced"]},51117:(e,t,r)=>{"use strict";r.d(t,{V:()=>n});var s=r(44223);function n(){let[e,t]=(0,s.useState)([]),[r,n]=(0,s.useState)(!1),[a,i]=(0,s.useState)(null),o=(0,s.useCallback)(async e=>{n(!0),i(null);try{let r=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),s=await r.json();if(s.agent)return t(e=>e.some(e=>e.id===s.agent.id)?e.map(e=>e.id===s.agent.id?s.agent:e):[...e,s.agent]),s.agent;return i(s.error||"Discovery failed"),null}catch(e){return i(e.message),null}finally{n(!1)}},[]);return{agents:e,discovering:r,error:a,discover:o,remove:(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),refresh:(0,s.useCallback)(()=>{t([]),i(null)},[])}}},56514:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PdfRenderer:()=>a});var s=r(66839),n=r(44223);function a({filePath:e}){let t=`/api/file/raw?path=${encodeURIComponent(e)}`,[r,a]=(0,n.useState)(!0),[i,o]=(0,n.useState)(!1),[l,d]=(0,n.useState)(0),c=(0,n.useCallback)(()=>{o(!1),a(!0),d(e=>e+1)},[]);return(0,s.jsxs)("div",{className:"w-full h-full min-h-[80vh] flex flex-col relative",children:[r&&!i&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10",children:(0,s.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading PDF..."})}),i&&(0,s.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10 gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load PDF"}),(0,s.jsx)("button",{onClick:c,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,s.jsx)("iframe",{src:t,className:"w-full flex-1 min-h-[80vh] border-0 rounded-lg bg-[var(--bg-secondary)]",title:e.split("/").pop()??"PDF",onLoad:()=>a(!1),onError:()=>{a(!1),o(!0)},style:{display:i?"none":"block"}},l)]})}},56848:(e,t,r)=>{"use strict";r.d(t,{NT:()=>a,uC:()=>i});var s=r(44223),n=r(65264);function a(e,t,r={preparing:"Preparing search...",fallbackWarmHint:"Search will prepare on first query."}){return t.trim()?null:"warming"===e?r.preparing:"fallback"===e?r.fallbackWarmHint:null}function i(e){let[t,r]=(0,s.useState)("idle"),a=(0,s.useRef)(!1),i=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{(function({active:e,hasAttemptedPrewarm:t,warmState:r}){return e&&!t&&"idle"===r})({active:e,hasAttemptedPrewarm:a.current,warmState:t})&&(a.current=!0,r("warming"),(0,n.n)("/api/search/prewarm").then(()=>{i.current&&r("ready")}).catch(()=>{i.current&&r("fallback")}))},[e,t]),(0,s.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]),(0,s.useEffect)(()=>{let e=()=>{a.current=!1,r("idle")};return window.addEventListener("mindos:files-changed",e),()=>window.removeEventListener("mindos:files-changed",e)},[]),(0,s.useEffect)(()=>{e||"fallback"!==t||(a.current=!1,r("idle"))},[e,t]),t}},57679:(e,t,r)=>{"use strict";r.d(t,{TooltipProvider:()=>m,ZI:()=>g,k$:()=>p,m_:()=>x});var s=r(66839),n=r(36445),a=r(77615),i=r(16623),o=r(88419),l=r(29883),d=r(62198),c=r(47591),u=r(58221);function m({delay:e=0,...t}){return(0,s.jsx)(n.B,{"data-slot":"tooltip-provider",delay:e,...t})}function x({...e}){return(0,s.jsx)(a.s,{"data-slot":"tooltip",...e})}function p({...e}){return(0,s.jsx)(i.k,{"data-slot":"tooltip-trigger",...e})}function g({className:e,side:t="top",sideOffset:r=4,align:n="center",alignOffset:a=0,children:i,...m}){return(0,s.jsx)(o.K,{children:(0,s.jsx)(l.o,{align:n,alignOffset:a,side:t,sideOffset:r,className:"isolate z-50",children:(0,s.jsxs)(d.o,{"data-slot":"tooltip-content",className:(0,u.cn)("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...m,children:[i,(0,s.jsx)(c.P,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}},61882:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AudioRenderer:()=>a});var s=r(66839),n=r(44223);function a({filePath:e}){let t=`/api/file/raw?path=${encodeURIComponent(e)}`,r=e.split("/").pop()??"audio",a=r.split(".").pop()?.toLowerCase()??"",[i,o]=(0,n.useState)(!1),[l,d]=(0,n.useState)(0),[c,u]=(0,n.useState)(null);(0,n.useEffect)(()=>{fetch(t,{method:"HEAD"}).then(e=>{let t=e.headers.get("Content-Length");t&&u(parseInt(t,10))}).catch(()=>{})},[t]);let m=(0,n.useCallback)(()=>{o(!1),d(e=>e+1)},[]);return(0,s.jsxs)("div",{className:"w-full flex flex-col items-center gap-6 py-12 px-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--text-secondary)]",children:[(0,s.jsx)("span",{className:"text-4xl opacity-40",children:"\uD83C\uDFB5"}),(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"uppercase opacity-60",children:a}),null!==c&&(0,s.jsx)("span",{children:c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1048576).toFixed(1)} MB`})]})]})]}),i?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load audio"}),(0,s.jsx)("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}):(0,s.jsx)("audio",{controls:!0,preload:"metadata",className:"w-full max-w-lg",onError:()=>o(!0),children:(0,s.jsx)("source",{src:t})},l)]})}},74179:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(66839),n=r(44223);class a extends n.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,s.jsxs)("div",{className:"text-center max-w-md",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,s.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},76782:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VideoRenderer:()=>a});var s=r(66839),n=r(44223);function a({filePath:e}){let t=`/api/file/raw?path=${encodeURIComponent(e)}`,r=e.split("/").pop()??"video",a=r.split(".").pop()?.toLowerCase()??"",[i,o]=(0,n.useState)(!1),[l,d]=(0,n.useState)(0),[c,u]=(0,n.useState)(null),[m,x]=(0,n.useState)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{fetch(t,{method:"HEAD"}).then(e=>{let t=e.headers.get("Content-Length");t&&u(parseInt(t,10))}).catch(()=>{})},[t]);let g=(0,n.useCallback)(()=>{let e=p.current;e&&x({w:e.videoWidth,h:e.videoHeight})},[]),h=(0,n.useCallback)(()=>{o(!1),d(e=>e+1)},[]);return(0,s.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[m&&(0,s.jsxs)("span",{children:[m.w," x ",m.h]}),null!==c&&(0,s.jsx)("span",{children:c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1048576).toFixed(1)} MB`}),(0,s.jsx)("span",{className:"uppercase opacity-60",children:a})]}),(0,s.jsx)("div",{className:"flex-1 min-h-[50vh] flex items-center justify-center bg-black rounded-b-lg overflow-hidden",children:i?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-neutral-400",children:"Failed to load video"}),(0,s.jsx)("button",{onClick:h,className:"text-xs px-3 py-1.5 rounded-md bg-neutral-800 hover:bg-neutral-700 text-neutral-200 transition-colors",children:"Retry"})]}):(0,s.jsx)("video",{ref:p,controls:!0,preload:"metadata",className:"max-w-full max-h-[70vh]",onLoadedMetadata:g,onError:()=>o(!0),children:(0,s.jsx)("source",{src:t})},l)})]})}},79114:(e,t,r)=>{"use strict";r.d(t,{default:()=>tX});var s=r(66839),n=r(56261),a=r(44223),i=r(18016),o=r.n(i),l=r(23990),d=r(38325),c=r(77932),u=r(72799),m=r(10952),x=r(77520),p=r(46708),g=r(78610),h=r(29696),f=r(82023),b=r(67885),v=r(39086),y=r(98327),j=r(2073),w=r(38688),k=r(52364),N=r(65264),S=r(75579);function C(e,t){return t?"syncing":e&&e.enabled?e.lastError?"error":e.conflicts&&e.conflicts.length>0?"conflicts":parseInt(e.unpushed||"0",10)>0?"unpushed":"synced":"off"}let z={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function A(){let[e,t]=(0,a.useState)(null),[r,s]=(0,a.useState)(!1),n=(0,a.useRef)(void 0),i=(0,a.useCallback)(async()=>{try{let e=await (0,N.n)("/api/sync");t(e)}catch{t(null)}finally{s(!0)}},[]);return(0,a.useEffect)(()=>{i();let e=()=>{n.current&&clearInterval(n.current),n.current=setInterval(i,3e4)},t=()=>{n.current&&clearInterval(n.current),n.current=void 0};e();let r=()=>{"visible"===document.visibilityState?(i(),e()):t()};return document.addEventListener("visibilitychange",r),()=>{t(),document.removeEventListener("visibilitychange",r)}},[i]),{status:e,loaded:r,fetchStatus:i}}function E(e){let[t,r]=(0,a.useState)(!1),[s,n]=(0,a.useState)(null),i=(0,a.useCallback)(async()=>{if(!t){r(!0),n(null);try{await (0,N.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await e(),n("success")}catch{await e(),n("error")}finally{r(!1),setTimeout(()=>n(null),2500)}}},[t,e]);return{syncing:t,syncResult:s,syncNow:i}}function $(e,t,r){switch(e){case"syncing":{let e=r?.syncing??"Syncing...";return{label:e,tooltip:e}}case"synced":{let e=`${r?.synced??"Synced"} \xb7 ${(0,S.fF)(t?.lastSync)}`;return{label:e,tooltip:e}}case"unpushed":{let e=parseInt(t?.unpushed||"0",10);return{label:`${e} ${r?.unpushed??"awaiting push"}`,tooltip:r?.unpushedHint??`${e} commit(s) not yet pushed to remote`}}case"conflicts":{let e=t?.conflicts?.length||0;return{label:`${e} ${r?.conflicts??"conflicts"}`,tooltip:r?.conflictsHint??`${e} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:r?.syncError??"Sync error",tooltip:t?.lastError||(r?.syncError??"Sync error")};default:{let e=r?.syncOff??"Sync off";return{label:e,tooltip:e}}}}function D({collapsed:e,onOpenSyncSettings:t}){let{status:r,loaded:n,fetchStatus:i}=A(),{syncing:o,syncResult:l,syncNow:d}=E(i),[c,u]=(0,a.useState)(null),m=(0,a.useRef)("off"),[x,p]=(0,a.useState)(()=>{try{return!!localStorage.getItem("sync-hint-dismissed")}catch(e){console.warn("[SyncStatusBar] localStorage read failed:",e)}return!1}),{t:g}=(0,j.Y)();if(!function(e){let[,t]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),6e4);return()=>clearInterval(e)},[6e4])}(0),(0,a.useEffect)(()=>{if(!n||o)return;let e=C(r,!1),t=m.current;if(t!==e){let r=g.sidebar?.sync;("error"===t||"conflicts"===t)&&"synced"===e&&setTimeout(()=>{u(r?.syncRestored??"Sync restored"),setTimeout(()=>u(null),3e3)},0),m.current=e}},[r,n,o,g]),!n||e)return null;let h=C(r,o);if("off"===h){if(x)return null;let e=g.sidebar?.sync;return(0,s.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,s.jsxs)("button",{onClick:t,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:e?.enableHint??"Set up cross-device sync",children:[(0,s.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,s.jsxs)("span",{className:"truncate",children:[e?.enableSync??"Enable sync"," →"]})]}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(e){console.warn("[SyncStatusBar] localStorage write dismissed:",e)}p(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,s.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let f=g.sidebar?.sync,{label:v,tooltip:y}=$(h,r,f);return(0,s.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,s.jsxs)("button",{onClick:t,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:y,children:[(0,s.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${z[h]} ${"syncing"===h||"conflicts"===h?"animate-pulse":""}`}),(0,s.jsx)("span",{className:"truncate",children:c||v})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===l||c)&&(0,s.jsx)(w.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===l&&(0,s.jsx)(k.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),d()},disabled:o,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:f?.syncNow??"Sync now",children:(0,s.jsx)(b.A,{size:12,className:o?"animate-spin":""})})]})]})}function M({status:e,syncing:t}){let r=C(e,t??!1);return"off"===r||"synced"===r?null:(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${z[r]} ${"conflicts"===r||"error"===r?"animate-pulse":""}`})}var T=r(51740),P=r(57679);function R({icon:e,label:t,shortcut:r,active:n=!1,expanded:a,onClick:i,buttonRef:o,badge:l,walkthroughId:d}){let c=r?`${t} (${r})`:t,u=(0,s.jsxs)("button",{ref:o,onClick:i,"aria-pressed":n,"aria-label":t,title:void 0,"data-walkthrough":d,className:`
25
- relative flex items-center ${a?"justify-start px-3 w-full":"justify-center w-10"} h-10 rounded-md transition-colors
26
- ${n?"text-[var(--amber)] bg-[var(--amber-dim)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}
27
- focus-visible:ring-2 focus-visible:ring-ring
28
- `,children:[n&&(0,s.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,s.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:e}),l,a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:t}),r&&(0,s.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:r})]})]});return a?u:(0,s.jsxs)(P.m_,{children:[(0,s.jsx)(P.k$,{render:u}),(0,s.jsx)(P.ZI,{side:"right",sideOffset:8,children:c})]})}function I({activePanel:e,onPanelChange:t,onEchoClick:r,onAgentsClick:i,onDiscoverClick:o,onWorkflowsClick:l,onSpacesClick:u,syncStatus:m,expanded:w,onExpandedChange:k,onSettingsClick:N,onSyncClick:S}){let A=(0,a.useRef)(0),E=(0,a.useRef)(null),{t:$}=(0,j.Y)(),D=(0,n.usePathname)(),[M,I]=(0,a.useTransition)(),F=(0,n.useRouter)(),L="/"===D,[O,W]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=window.mindos;if(e?.checkUpdate){let t=e.checkUpdate.bind(e),r=setTimeout(async()=>{try{(await t()).available&&W(!0)}catch{}},1e4),s=e.onUpdateAvailable?.(()=>W(!0));return()=>{clearTimeout(r),s?.()}}let t=localStorage.getItem("mindos_update_dismissed"),r=localStorage.getItem("mindos_update_latest");r&&r!==t&&W(!0);let s=setTimeout(async()=>{try{let e=await fetch("/api/update-check",{signal:AbortSignal.timeout(5e3)});if(!e.ok)return;let t=await e.json();if(!t.hasUpdate){localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),W(!1);return}let r=localStorage.getItem("mindos_update_dismissed");if(t.latest===r)return;localStorage.setItem("mindos_update_latest",t.latest),W(!0)}catch{}},5e3),n=()=>W(!0),a=()=>W(!1);return window.addEventListener("mindos:update-available",n),window.addEventListener("mindos:update-dismissed",a),()=>{clearTimeout(s),window.removeEventListener("mindos:update-available",n),window.removeEventListener("mindos:update-dismissed",a)}},[]);let[B,_]=(0,a.useState)(!1),[U,H]=(0,a.useState)(!1);(0,a.useEffect)(()=>{_("1"===localStorage.getItem("mindos:labs-echo")),H("1"===localStorage.getItem("mindos:labs-workflows"));let e=()=>{_("1"===localStorage.getItem("mindos:labs-echo")),H("1"===localStorage.getItem("mindos:labs-workflows"))};return window.addEventListener("mindos:labs-changed",e),()=>window.removeEventListener("mindos:labs-changed",e)},[]);let X=(0,a.useCallback)(e=>{let t=Date.now();t-A.current<300||(A.current=t,e())},[]),K=(0,a.useCallback)(r=>{X(()=>t(e===r?null:r))},[e,t,X]),G=C(m,!1),Y=w?180:48,Z="off"!==G&&"synced"!==G?(0,s.jsx)("span",{className:`absolute ${w?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${z[G]} ${"error"===G||"conflicts"===G?"animate-pulse":""}`}):void 0;return(0,s.jsx)(P.TooltipProvider,{delay:2e3,children:(0,s.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${Y}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,s.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{I(()=>{L?t("files"===e?null:"files"):(t("files"),F.push("/"))})},className:`flex items-center ${w?"px-3 gap-2":"justify-center"} w-full h-[46px] shrink-0 transition-opacity cursor-pointer ${L?"opacity-100":"opacity-50 hover:opacity-80"}`,"aria-label":"MindOS Home",children:[(0,s.jsx)(T.A,{id:"rail",className:"w-7 h-3.5 shrink-0"}),w&&(0,s.jsx)("span",{className:"text-sm text-foreground font-brand whitespace-nowrap",children:"MindOS"})]}),(0,s.jsx)("div",{className:`${w?"mx-3":"mx-2"} border-t border-border`}),(0,s.jsxs)("div",{className:`flex flex-col ${w?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,s.jsx)(R,{icon:(0,s.jsx)(x.A,{size:18}),label:$.sidebar.files,active:!L&&"files"===e,expanded:w,onClick:()=>u?X(u):K("files"),walkthroughId:"files-panel"}),B&&(0,s.jsx)(R,{icon:(0,s.jsx)(p.A,{size:18}),label:$.sidebar.echo,active:"echo"===e,expanded:w,onClick:()=>r?X(r):K("echo"),walkthroughId:"echo-panel"}),(0,s.jsx)(R,{icon:(0,s.jsx)(d.A,{size:18}),label:$.sidebar.searchTitle,shortcut:"⌘K",active:"search"===e,expanded:w,onClick:()=>K("search")}),(0,s.jsx)(R,{icon:(0,s.jsx)(g.A,{size:18}),label:$.sidebar.agents,active:"agents"===e,expanded:w,onClick:()=>i?X(i):K("agents"),walkthroughId:"agents-panel"}),U&&(0,s.jsx)(R,{icon:(0,s.jsx)(h.A,{size:18}),label:$.sidebar.workflows??"Flows",active:"workflows"===e,expanded:w,onClick:()=>l?X(l):K("workflows")})]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("div",{className:`${w?"mx-3":"mx-2"} border-t border-border`}),(0,s.jsx)("div",{className:`flex flex-col ${w?"px-1.5":"items-center"} gap-1 py-2`,children:(0,s.jsx)(R,{icon:(0,s.jsx)(f.A,{size:18}),label:$.sidebar.discover,active:"discover"===e,expanded:w,onClick:()=>o?X(o):K("discover")})}),(0,s.jsx)("div",{className:`${w?"mx-3":"mx-2"} border-t border-border`}),(0,s.jsxs)("div",{className:`flex flex-col ${w?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,s.jsx)(R,{icon:(0,s.jsx)(c.A,{size:18}),label:$.sidebar.settingsTitle,shortcut:"⌘,",expanded:w,onClick:()=>X(N),badge:O?(0,s.jsx)("span",{className:`absolute ${w?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),m?.enabled&&m?.remote&&"(not configured)"!==m.remote&&(0,s.jsx)(R,{icon:(0,s.jsx)(b.A,{size:18}),label:$.sidebar.syncLabel,expanded:w,buttonRef:E,badge:Z,onClick:()=>X(()=>{let e=E.current?.getBoundingClientRect();e&&S(e)})})]})]}),(0,s.jsx)("button",{onClick:()=>k(!w),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":w?"Collapse sidebar":"Expand sidebar",title:w?"Collapse":"Expand",children:w?(0,s.jsx)(v.A,{size:10}):(0,s.jsx)(y.A,{size:10})})]})})}var F=r(73601),L=r(30401),O=r(14987),W=r(9280),B=r(13326),_=r(76728),U=r(52954),H=r(95991),X=r(11235),K=r(31606),G=r(9986),Y=r(55798),Z=r(10195),q=r(71114),V=r(64728);function J({title:e,children:t,maximized:r,onMaximize:n}){return(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 h-[46px] border-b border-border shrink-0",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[t,n&&(0,s.jsx)("button",{onClick:n,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":r?"Restore panel":"Maximize panel",children:r?(0,s.jsx)(q.A,{size:13}):(0,s.jsx)(V.A,{size:13})})]})]})}function Q({width:e,minWidth:t,maxWidth:r,maxWidthRatio:s,direction:n,disabled:i,onResize:o,onResizeEnd:l}){let d=(0,a.useRef)(!1),c=(0,a.useRef)(0),u=(0,a.useRef)(0),m=(0,a.useRef)(e),x=(0,a.useRef)(o),p=(0,a.useRef)(l);return(0,a.useLayoutEffect)(()=>{m.current=e,x.current=o,p.current=l},[e,o,l]),(0,a.useCallback)(a=>{if(i)return;a.preventDefault(),d.current=!0,c.current=a.clientX,u.current=e,document.body.classList.add("select-none"),document.body.style.cursor="col-resize";let o=e=>{if(!d.current)return;let a="right"===n?e.clientX-c.current:c.current-e.clientX,i=Math.round(Math.max(t,Math.min(Math.min(r,window.innerWidth*s),u.current+a)));x.current(i)},l=()=>{d.current=!1,document.body.classList.remove("select-none"),document.body.style.cursor="",p.current(m.current),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)},[e,t,r,s,n,i])}var ee=r(65799);let et=(0,ee.createServerReference)("00b5f0099bcaa0f90da6629ff61608e5d8d984c57e",ee.callServer,void 0,ee.findSourceMapURL,"listTrashAction"),er=()=>{},es={files:280,search:320,echo:340,agents:300,discover:300,workflows:320};function en({activePanel:e,fileTree:t,onNavigate:r,onOpenSyncSettings:i,railWidth:o=48,panelWidth:l,onWidthChange:d,onWidthCommit:c,maximized:u=!1,onMaximize:m,onImport:x,children:p}){let g=e?es[e]:280,h=u?void 0:l??g,{t:f}=(0,j.Y)(),[b,v]=(0,a.useTransition)(),y=(0,n.useRouter)(),w=(0,n.usePathname)(),k="/capture"===w||"/capture/"===w,[N,S]=(0,a.useState)(null),C=(0,a.useMemo)(()=>(function e(t,r=0){let s=r;for(let n of t)"directory"===n.type&&(s=Math.max(s,e(n.children??[],r+1)));return s})(t),[t]),[z,A]=(0,a.useState)(!1),E=(0,a.useRef)(null),$=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!z)return;let e=e=>{E.current&&!E.current.contains(e.target)&&$.current&&!$.current.contains(e.target)&&A(!1)},t=e=>{"Escape"===e.key&&A(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[z]);let[M,T]=(0,a.useState)(!1),P=(0,a.useRef)(null),R=(0,a.useRef)(null),I=(0,Z.gL)(),[q,V]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(!M)return;let e=e=>{P.current&&!P.current.contains(e.target)&&R.current&&!R.current.contains(e.target)&&T(!1)},t=e=>{"Escape"===e.key&&T(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[M]);let[ee,en]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=()=>{et().then(e=>V(e.length)).catch(()=>{})},t=()=>{fetch("/api/inbox").then(e=>e.json()).then(e=>{Array.isArray(e.files)&&en(e.files.length)}).catch(()=>{})};return e(),t(),window.addEventListener("mindos:files-changed",e),window.addEventListener("mindos:inbox-updated",t),()=>{window.removeEventListener("mindos:files-changed",e),window.removeEventListener("mindos:inbox-updated",t)}},[]);let[ea,ei]=(0,a.useState)(!1);(0,a.useEffect)(()=>{try{"1"===localStorage.getItem("mindos-tree-dblclick-hint")&&ei(!0)}catch{}},[]);let eo=(0,a.useCallback)(()=>{if(!ea){ei(!0);try{localStorage.setItem("mindos-tree-dblclick-hint","1")}catch{}}},[ea]),el=Q({width:l??g,minWidth:240,maxWidth:600,maxWidthRatio:.45,direction:"right",disabled:u,onResize:d??er,onResizeEnd:c??er});return(0,s.jsxs)("aside",{className:`
29
- hidden md:flex fixed top-0 h-screen z-30
30
- flex-col bg-card border-r border-border
31
- transition-[transform,left,width] duration-200 ease-out
32
- ${null!==e?"translate-x-0":"-translate-x-full pointer-events-none"}
33
- `,style:{width:u?`calc(100vw - ${o}px)`:`${h}px`,left:`${o}px`},role:"region","aria-label":e?`${e} panel`:void 0,children:[(0,s.jsxs)("div",{className:`flex flex-col h-full ${"files"===e?"":"hidden"}`,children:[(0,s.jsx)(J,{title:f.sidebar.files,children:(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{ref:E,type:"button",onClick:()=>{v(()=>{T(!1),A(e=>!e)})},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":f.sidebar.new,title:f.sidebar.new,children:(0,s.jsx)(F.A,{size:13})}),z&&(0,s.jsxs)("div",{ref:$,className:"absolute top-full right-0 mt-1 min-w-[152px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{v(()=>{A(!1),y.push("/view/Untitled.md")})},children:[(0,s.jsx)(L.A,{size:14,className:"shrink-0"}),f.sidebar.newFile]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{A(!1),window.dispatchEvent(new Event("mindos:create-space"))},children:[(0,s.jsx)(O.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),f.sidebar.newSpace]})]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>x?.(),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":f.sidebar.importFile,title:f.sidebar.importFile,children:(0,s.jsx)(W.A,{size:13})}),(0,s.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,s.jsx)("button",{onClick:()=>S(e=>Math.max(-1,(e??C)-1)),onDoubleClick:()=>{S(-1),eo()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":f.sidebar.collapseLevel,title:ea?f.sidebar.collapseLevel:f.sidebar.collapseLevelHint??f.sidebar.collapseLevel,children:(0,s.jsx)(B.A,{size:13})}),(0,s.jsx)("button",{onClick:()=>S(e=>{let t=(e??0)+1;return t>C?null:t}),onDoubleClick:()=>{S(null),eo()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":f.sidebar.expandLevel,title:ea?f.sidebar.expandLevel:f.sidebar.expandLevelHint??f.sidebar.expandLevel,children:(0,s.jsx)(_.A,{size:13})}),(0,s.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{ref:P,type:"button",onClick:()=>{v(()=>{A(!1),T(e=>!e)})},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":f.sidebar.more,title:f.sidebar.more,children:(0,s.jsx)(U.A,{size:13})}),M&&(0,s.jsxs)("div",{ref:R,className:"absolute top-full right-0 mt-1 min-w-[172px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{v(()=>{T(!1),y.push("/capture")})},children:[(0,s.jsx)(H.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1",children:f.sidebar.capture}),ee>0&&(0,s.jsx)("span",{className:"text-2xs font-medium tabular-nums px-1.5 py-px rounded-full bg-[var(--amber)]/10 text-[var(--amber)]/70",children:ee})]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{v(()=>{T(!1),y.push("/view/.mindos/change-log.json")})},children:[(0,s.jsx)(X.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1",children:f.changes.title})]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{v(()=>{T(!1),y.push("/trash")})},children:[(0,s.jsx)(K.A,{size:14,className:"shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f.trash.title}),q>0&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:q})]}),(0,s.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{(0,Z.Fo)(!I)},children:[I?(0,s.jsx)(G.A,{size:14,className:"shrink-0"}):(0,s.jsx)(Y.A,{size:14,className:"shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f.sidebar.showHiddenFiles}),I&&(0,s.jsx)("span",{className:"text-[var(--amber)] text-xs",children:"✓"})]})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",onDragEnter:e=>{e.dataTransfer.types.includes("Files")&&e.stopPropagation()},onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation())},onDrop:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation())},children:(0,s.jsx)(Z.Ay,{nodes:t,onNavigate:r,maxOpenDepth:N,onImport:x})}),(0,s.jsxs)("button",{type:"button",onClick:()=>y.push("/capture"),className:`flex items-center gap-2 mx-2 px-2 py-1.5 text-sm rounded-lg transition-all duration-150 group shrink-0 ${k?"bg-[var(--amber-dim)] text-[var(--amber)]":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,children:[(0,s.jsx)("div",{className:`flex items-center justify-center w-5 h-5 rounded-md shrink-0 transition-colors ${k?"bg-[var(--amber)]/15":"bg-transparent"}`,children:(0,s.jsx)(H.A,{size:13,className:`shrink-0 transition-colors ${k?"text-[var(--amber)]":"text-[var(--amber)]/60 group-hover:text-[var(--amber)]"}`})}),(0,s.jsx)("span",{className:`flex-1 text-left text-xs transition-colors ${k?"font-medium text-[var(--amber)]":"text-muted-foreground group-hover:text-foreground"}`,children:f.sidebar.capture}),ee>0&&(0,s.jsx)("span",{className:`text-2xs font-medium tabular-nums px-1.5 py-px rounded-full transition-colors ${k?"bg-[var(--amber)]/15 text-[var(--amber)]":"bg-[var(--amber)]/10 text-[var(--amber)]/70"}`,children:ee})]}),(0,s.jsx)(D,{collapsed:!1,onOpenSyncSettings:i})]}),p,!u&&d&&(0,s.jsx)("div",{className:"absolute top-0 -right-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:el,children:(0,s.jsx)("div",{className:"absolute right-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/60 transition-opacity"})})]})}var ea=r(18659),ei=r(58221),eo=r(58626),el=r(56848);function ed({active:e,onNavigate:t,maximized:r,onMaximize:i}){let[o,l]=(0,a.useState)(""),[c,m]=(0,a.useState)([]),[x,p]=(0,a.useState)(!1),[g,h]=(0,a.useState)(0),[f,b]=(0,a.useState)(null),v=(0,a.useRef)(null),w=(0,n.useRouter)(),k=(0,a.useRef)(null),{t:S}=(0,j.Y)();(0,a.useEffect)(()=>{e&&setTimeout(()=>v.current?.focus(),50)},[e]);let C=(0,el.uC)(e),[z,A]=(0,a.useState)(null),[E,$]=(0,a.useState)(null),[D,M]=(0,a.useState)(!1),T=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(T.current&&clearTimeout(T.current),0===c.length||g<0||g>=c.length){A(null),$(null);return}let e=c[g];if(e.path!==E||null===z)return T.current=setTimeout(async()=>{M(!0);try{let t=await (0,N.n)(`/api/file?path=${encodeURIComponent(e.path)}`);A("string"==typeof t.content?t.content.slice(0,2e3):null),$(e.path)}catch{A(null),$(null)}finally{M(!1)}},150),()=>{T.current&&clearTimeout(T.current)}},[c,g]),(0,a.useEffect)(()=>{A(null),$(null)},[o]);let P=(0,a.useCallback)(e=>{if(k.current&&clearTimeout(k.current),!e.trim()){m([]),p(!1);return}p(!0),k.current=setTimeout(async()=>{try{let t=await (0,N.n)(`/api/search?q=${encodeURIComponent(e)}`);m(Array.isArray(t)?t:[]),h(0)}catch{m([])}finally{p(!1)}},300)},[]),R=(0,a.useCallback)(e=>{let t=e.target.value;l(t),P(t)},[P]),I=(0,a.useCallback)(e=>{w.push(`/view/${(0,ei.O0)(e.path)}`),t?.()},[w,t]),F=(0,a.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),h(e=>Math.min(e+1,c.length-1))):"ArrowUp"===e.key?(e.preventDefault(),h(e=>Math.max(e-1,0))):"Enter"===e.key&&c[g]&&I(c[g])},[c,g,I]),O=(0,a.useCallback)((e,t)=>{e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("text/mindos-path",t.path),e.dataTransfer.setData("text/mindos-type","file");let r=new Image;e.dataTransfer.setDragImage(r,0,0)},[]),W=(0,a.useCallback)(()=>{b(null)},[]),B=(0,el.NT)(C,o,{preparing:S.search.preparing,fallbackWarmHint:S.search.fallbackWarmHint});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J,{title:"Search",maximized:r,onMaximize:i}),(0,s.jsxs)("div",{className:"px-4 py-3 border-b border-border shrink-0 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 overflow-hidden",children:[(0,s.jsx)(d.A,{size:16,className:"text-muted-foreground shrink-0 flex-none"}),(0,s.jsx)("input",{ref:v,type:"text",value:o,onChange:R,onKeyDown:F,placeholder:S.search.placeholder,"aria-label":S.search.placeholder,className:"flex-1 min-w-0 bg-transparent text-foreground text-base font-medium placeholder:text-muted-foreground/60 outline-none"}),x&&(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-muted-foreground/30 border-t-foreground rounded-full animate-spin shrink-0 flex-none"}),!x&&o&&(0,s.jsx)("button",{onClick:()=>{l(""),m([]),v.current?.focus()},className:"shrink-0 flex-none p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":S.search.clear,children:(0,s.jsx)(u.A,{size:16})})]}),B&&(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:B})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",role:"listbox","aria-label":"Search results",children:[0===c.length&&!o&&!x&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,s.jsx)(d.A,{size:20,className:"text-muted-foreground/60"})}),(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:S.search.emptyTitle}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70",children:S.search.emptyHint})]}),0===c.length&&o&&!x&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,s.jsx)(d.A,{size:20,className:"text-muted-foreground/60"})}),(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:S.search.noResults}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70",children:S.search.noResultsHint})]}),x&&0===c.length&&(0,s.jsx)("div",{className:"space-y-2 p-3",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"px-3 py-2.5 space-y-2 animate-pulse",children:[(0,s.jsx)("div",{className:"h-4 bg-muted rounded-md w-3/4"}),(0,s.jsx)("div",{className:"h-3 bg-muted rounded-md w-1/2"}),(0,s.jsx)("div",{className:"h-3 bg-muted rounded-md w-2/3"})]},e))}),c.length>0&&(0,s.jsx)(eo.aY,{totalCount:c.length,overscan:100,itemContent:e=>{let t,r=c[e],n=r.path.endsWith(".csv")?".csv":".md",{name:a,breadcrumb:i}={name:(t=r.path.split("/").filter(Boolean))[t.length-1],breadcrumb:t.slice(0,-1)},l=e===g,d=e===f;return(0,s.jsxs)("button",{role:"option","aria-selected":l,draggable:!0,onDragStart:e=>O(e,r),onDragEnd:W,onDragEnter:()=>b(e),onDragLeave:()=>b(null),onClick:()=>I(r),onMouseEnter:()=>h(e),className:`
34
- w-full px-3 py-2.5 flex items-start gap-3 text-left transition-colors duration-100
35
- border-b border-border/50
36
- ${l?"bg-[var(--amber-dim)] border-l-2 border-[var(--amber)]":"border-l-2 border-transparent"}
37
- ${d?"bg-muted/70":l?"":"hover:bg-muted/60"}
38
- `,children:[(0,s.jsx)("div",{className:"shrink-0 flex-none mt-0.5",children:".csv"===n?(0,s.jsx)(ea.A,{size:14,className:"text-success"}):(0,s.jsx)(L.A,{size:14,className:"text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-foreground truncate",title:a,children:a}),i.length>0&&(0,s.jsx)("div",{className:"flex items-center gap-1 mt-0.5 text-xs text-muted-foreground/70 truncate",children:i.map((e,t)=>(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[t>0&&(0,s.jsx)(y.A,{size:10,className:"shrink-0 flex-none"}),(0,s.jsx)("span",{className:"truncate",children:e})]},t))}),r.snippet&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 leading-relaxed",title:r.snippet,children:function(e,t){if(!t.trim())return e;let r=t.trim().split(/\s+/).filter(Boolean).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),n=RegExp(`(${r.join("|")})`,"gi");return e.split(n).map((e,t)=>n.test(e)?(0,s.jsx)("mark",{className:"bg-[var(--amber)]/25 text-foreground rounded-sm px-0.5",children:e},t):e)}(r.snippet,o)})]}),l&&!d&&(0,s.jsx)("div",{className:"shrink-0 flex-none text-[10px] text-muted-foreground/50 font-mono pt-0.5",children:"⬆ Drag"})]})}})]}),c.length>0&&(z||D)&&(0,s.jsxs)("div",{className:"border-t border-border shrink-0 max-h-[30%] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-muted-foreground border-b border-border/50 sticky top-0 bg-card z-10",children:[(0,s.jsx)(Y.A,{size:12,className:"shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:E??""})]}),D&&!z?(0,s.jsxs)("div",{className:"px-3 py-4 space-y-2 animate-pulse",children:[(0,s.jsx)("div",{className:"h-3 bg-muted rounded w-full"}),(0,s.jsx)("div",{className:"h-3 bg-muted rounded w-5/6"}),(0,s.jsx)("div",{className:"h-3 bg-muted rounded w-4/6"})]}):z?(0,s.jsxs)("pre",{className:"px-3 py-2 text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap break-words font-sans",children:[z,z.length>=2e3&&(0,s.jsx)("span",{className:"text-muted-foreground/40",children:" …"})]}):null]}),c.length>0&&(0,s.jsxs)("div",{className:"px-3 py-2 border-t border-border/50 flex items-center gap-2 text-xs text-muted-foreground/60 shrink-0",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("kbd",{className:"font-mono text-[10px] px-1 py-0.5 bg-muted/40 rounded",children:"↑↓"})," ",S.search.navigate]}),(0,s.jsxs)("span",{children:[(0,s.jsx)("kbd",{className:"font-mono text-[10px] px-1 py-0.5 bg-muted/40 rounded",children:"↵"})," ",S.search.open]}),(0,s.jsx)("span",{className:"text-muted-foreground/40 mx-0.5",children:"•"}),(0,s.jsxs)("span",{children:[(0,s.jsx)("kbd",{className:"font-mono text-[10px] px-1 py-0.5 bg-muted/40 rounded",children:"Drag"})," ",S.search.dragToChat]})]})]})}var ec=r(44361),eu=r(31082),em=r(20677),ex=r(51117),ep=r(33866),eg=r(30626),eh=r(78132);function ef({icon:e,title:t,subtitle:r,badge:n,href:a,onClick:i,active:l}){let d=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e}),(0,s.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"block text-left text-sm font-medium text-foreground truncate",title:t,children:t}),r?(0,s.jsx)("span",{className:"block text-left text-2xs text-muted-foreground truncate",title:r,children:r}):null]}),n,(0,s.jsx)(y.A,{size:14,className:"shrink-0 text-muted-foreground"})]}),c=!!l,u=(0,ei.cn)("relative flex items-center gap-3 py-2.5 transition-[background-color] duration-150 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c?"bg-[var(--amber-dim)]/40 pl-3.5 pr-4 text-foreground":"px-4",!c&&"cursor-pointer hover:bg-muted/50",c&&"cursor-default"),m=c?(0,s.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}):null;return a?(0,s.jsxs)(o(),{href:a,className:u,"aria-current":l?"page":void 0,children:[m,d]}):(0,s.jsxs)("button",{type:"button",onClick:i,className:(0,ei.cn)(u,"w-full"),children:[m,d]})}function eb({label:e}){return(0,s.jsx)("span",{className:"text-2xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:e})}function ev({copy:e,connectedCount:t,mcpEnabled:r=!0,channelsActive:a=!1,onChannelsClick:i}){let o=(0,n.usePathname)(),l=(0,n.useSearchParams)().get("tab"),d="/agents"===o,c=!a;return(0,s.jsxs)("div",{className:"py-2",children:[(0,s.jsx)(ef,{icon:(0,s.jsx)(ep.A,{size:14,className:c&&d&&(null===l||"overview"===l)?"text-[var(--amber)]":"text-muted-foreground"}),title:e.navOverview,badge:(0,s.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground/60 px-1.5 py-0.5 rounded bg-muted/40 font-medium",children:t}),href:"/agents",active:c&&d&&(null===l||"overview"===l)}),r&&(0,s.jsx)(ef,{icon:(0,s.jsx)(eg.A,{size:14,className:c&&d&&"mcp"===l?"text-[var(--amber)]":"text-muted-foreground"}),title:e.navMcp,href:"/agents?tab=mcp",active:c&&d&&"mcp"===l}),(0,s.jsx)(ef,{icon:(0,s.jsx)(h.A,{size:14,className:c&&d&&"skills"===l?"text-[var(--amber)]":"text-muted-foreground"}),title:e.navSkills,href:"/agents?tab=skills",active:c&&d&&"skills"===l}),(0,s.jsx)(ef,{icon:(0,s.jsx)(eh.A,{size:14,className:a?"text-[var(--amber)]":"text-muted-foreground"}),title:e.navChannels,onClick:i,active:a}),(0,s.jsx)(ef,{icon:(0,s.jsx)(eu.A,{size:14,className:c&&d&&"a2a"===l?"text-[var(--amber)]":"text-muted-foreground"}),title:e.navNetwork,href:"/agents?tab=a2a",active:c&&d&&"a2a"===l})]})}var ey=r(72615),ej=r(76723),ew=r(98479),ek=r(84734);function eN({agent:e,agentStatus:t,selected:r=!1,detailHref:n,onInstallAgent:a,copy:i,isA2aReady:l=!1,a2aTooltip:d}){return(0,s.jsxs)("div",{className:`
39
- group flex items-center gap-0 rounded-xl border transition-all duration-150
40
- ${r?"border-border ring-2 ring-ring/50 bg-[var(--amber-dim)]/45":"border-border/70 bg-card/50 hover:border-border hover:bg-muted/25"}
41
- `,children:[(0,s.jsxs)(o(),{href:n,className:"flex flex-1 min-w-0 items-center gap-2.5 text-left rounded-xl pl-2.5 pr-2 py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(ek.lx,{name:e.name,status:t,size:"sm"}),(0,s.jsx)("span",{className:"text-sm font-medium text-foreground truncate leading-tight",children:e.name}),"connected"===t&&e.transport&&(0,s.jsx)("span",{className:"text-2xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-muted/90 text-muted-foreground shrink-0 border border-border/50",children:e.transport}),l&&(0,s.jsx)("span",{title:d,className:"shrink-0 text-muted-foreground/70",children:(0,s.jsx)(eu.A,{size:12})}),(0,s.jsx)("span",{className:"flex-1 min-w-[4px]"}),(0,s.jsx)(y.A,{size:15,className:`shrink-0 transition-opacity duration-150 ${r?"text-[var(--amber)] opacity-90":"text-muted-foreground/45 group-hover:text-muted-foreground/80"}`,"aria-hidden":!0})]}),"detected"===t&&(0,s.jsx)("div",{className:"pr-2 py-2 shrink-0",children:(0,s.jsx)(eS,{agentKey:e.key,agentName:e.name,onInstallAgent:a,copy:i})})]})}function eS({agentKey:e,agentName:t,onInstallAgent:r,copy:n}){let[i,o]=(0,a.useState)(!1),[l,d]=(0,a.useState)("idle"),c=async t=>{if(t.stopPropagation(),i)return;o(!0),d("idle");let s=await r(e);o(!1),d(s?"success":"error")},u="error"===l,m="success"===l,x=i?n.installing:m?n.installSuccess:u?n.retryInstall:n.install;return(0,s.jsxs)("button",{type:"button",onClick:c,disabled:i,className:`flex items-center gap-1 px-2 py-1.5 text-2xs rounded-lg font-medium text-white disabled:opacity-50 transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${u?"bg-error hover:bg-error/90":m?"bg-success hover:bg-success/90":"bg-[var(--amber)] hover:bg-[var(--amber)]/90"}`,"aria-label":`${t} ${x}`,children:[i?(0,s.jsx)(ec.A,{size:10,className:"animate-spin"}):null,!i&&m?(0,s.jsx)(ej.A,{size:10}):null,!i&&u?(0,s.jsx)(ew.A,{size:10}):null,x,(0,s.jsx)("span",{className:"sr-only","aria-live":"polite",children:u?n.installFailed:""})]})}function eC({connected:e,detected:t,notFound:r,selectedAgentKey:n,onInstallAgent:a,listCopy:i,showNotDetected:o,setShowNotDetected:l,p:d}){return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"px-0 py-1.5 mb-1",children:(0,s.jsx)("span",{className:"text-2xs font-semibold text-muted-foreground/70 uppercase tracking-wider",children:d.rosterLabel})}),e.length>0&&(0,s.jsxs)("section",{className:"mb-3",children:[(0,s.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,s.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--success)]/50","aria-hidden":"true"}),d.sectionConnected," ",(0,s.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",e.length,")"]})]}),(0,s.jsx)("div",{className:"space-y-1.5",children:e.map(e=>(0,s.jsx)(eN,{agent:e,agentStatus:"connected",selected:n===e.key,detailHref:`/agents/${encodeURIComponent(e.key)}`,onInstallAgent:a,copy:i},e.key))})]}),t.length>0&&(0,s.jsxs)("section",{className:"mb-3",children:[(0,s.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,s.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--amber)]/50","aria-hidden":"true"}),d.sectionDetected," ",(0,s.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",t.length,")"]})]}),(0,s.jsx)("div",{className:"space-y-1.5",children:t.map(e=>(0,s.jsx)(eN,{agent:e,agentStatus:"detected",selected:n===e.key,detailHref:`/agents/${encodeURIComponent(e.key)}`,onInstallAgent:a,copy:i},e.key))})]}),r.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>l(!o),className:"flex items-center gap-1 text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm pl-0.5",children:[o?(0,s.jsx)(ey.A,{size:12}):(0,s.jsx)(y.A,{size:12}),d.sectionNotDetected," (",r.length,")"]}),o&&(0,s.jsx)("div",{className:"space-y-1.5",children:r.map(e=>(0,s.jsx)(eN,{agent:e,agentStatus:"notFound",selected:n===e.key,detailHref:`/agents/${encodeURIComponent(e.key)}`,onInstallAgent:a,copy:i},e.key))})]})]})}var ez=r(7625),eA=r(21082),eE=r(3837),e$=r(41209);function eD(){let{t:e}=(0,j.Y)(),t=e.panels.im,r=(0,n.useSearchParams)().get("platform"),[i,l]=(0,a.useState)([]),[d,c]=(0,a.useState)(!0),[u,m]=(0,a.useState)(!1),x=(0,a.useCallback)(async()=>{m(!1);try{let e=await fetch("/api/im/status");if(e.ok){let t=await e.json();l(t.platforms??[])}else m(!0)}catch{m(!0)}c(!1)},[]);if((0,a.useEffect)(()=>{x()},[x]),d)return(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(ec.A,{size:16,className:"animate-spin text-muted-foreground"})});if(u)return(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 px-3",children:[(0,s.jsx)(eA.A,{size:16,className:"text-muted-foreground"}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground",children:t.fetchError}),(0,s.jsxs)("button",{type:"button",onClick:()=>{c(!0),x()},className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,s.jsx)(b.A,{size:11})," ",t.retry]})]});let p=i.filter(e=>e.connected).length;return(0,s.jsxs)("div",{className:"flex flex-col py-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mb-0.5",children:[(0,s.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:t.title}),p>0&&(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[p," ",t.connected]})]}),(0,s.jsx)("div",{className:"flex flex-col",children:e$.P.map(({id:e,name:t,icon:n})=>{let a=i.find(t=>t.platform===e),l=a?.connected??!1,d=r===e;return(0,s.jsxs)(o(),{href:`/agents?tab=channels&platform=${e}`,className:`
42
- relative flex items-center gap-2.5 px-3 py-2 text-left rounded-sm transition-colors
43
- ${d?"bg-[var(--amber-dim)]/40 pl-3.5":"hover:bg-muted/50"}
44
- `,children:[d&&(0,s.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}),(0,s.jsx)("span",{className:"text-sm",children:n}),(0,s.jsx)("span",{className:"text-sm flex-1 truncate text-foreground",children:t}),l?(0,s.jsx)(w.A,{size:14,className:"text-success shrink-0"}):(0,s.jsx)(eE.A,{size:14,className:"text-border shrink-0"})]},e)})})]})}function eM({active:e,maximized:t,onMaximize:r,selectedAgentKey:i=null}){let{t:o}=(0,j.Y)(),l=o.panels.agents,d=(0,n.useRouter)(),u=(0,em.kr)(),m=(0,n.usePathname)(),x=(0,n.useSearchParams)(),p="/agents"===m&&"channels"===x.get("tab"),[g,h]=(0,a.useState)(!1),[f,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(!1),k=(0,ex.V)(),N=async()=>{h(!0),await u.refresh(),h(!1)},S=u.agents.filter(e=>e.present&&e.installed),C=u.agents.filter(e=>e.present&&!e.installed),z=u.agents.filter(e=>!e.present),A=async e=>{let t=await u.installAgent(e);return t&&await u.refresh(),t},E=m?.startsWith("/agents/")?decodeURIComponent(m.slice(8)):null,$={installing:l.installing,install:l.install,installSuccess:l.installSuccess,installFailed:l.installFailed,retryInstall:l.retryInstall},D={navOverview:l.navOverview,navMcp:l.navMcp,navSkills:l.navSkills,navChannels:l.channels,navNetwork:l.navNetwork,navSessions:l.navSessions,navActivity:l.navActivity},M=(0,s.jsx)(ev,{copy:D,connectedCount:S.length,mcpEnabled:u.status?.connectionMode?.mcp??!1,channelsActive:p,onChannelsClick:()=>{d.push("/agents?tab=channels")}});return(0,s.jsxs)("div",{className:`flex flex-col h-full ${e?"":"hidden"}`,children:[(0,s.jsx)(J,{title:l.title,maximized:t,onMaximize:r,children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[!u.loading&&(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground",children:[S.length," ",l.connected,k.agents.length>0&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",l.a2aLabel," ",k.agents.length]})]}),(0,s.jsx)("button",{onClick:N,disabled:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":l.refresh,title:l.refresh,type:"button",children:(0,s.jsx)(b.A,{size:12,className:g?"animate-spin":""})})]})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:u.loading?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(ec.A,{size:16,className:"animate-spin text-muted-foreground"})}):0===u.agents.length&&0===u.skills.length?(0,s.jsxs)("div",{className:"flex flex-col gap-2 py-4 px-0",children:[M,(0,s.jsx)("div",{className:"mx-4 border-t border-border"}),(0,s.jsxs)("div",{className:"mx-3 rounded-lg border border-border/40 bg-card/30 px-3 py-5 text-center",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:l.noAgents}),(0,s.jsx)("p",{className:"text-2xs text-muted-foreground/40 mb-3",children:l.skillsEmptyHint}),(0,s.jsxs)("button",{onClick:N,type:"button",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(b.A,{size:11})," ",l.retry]})]})]}):(0,s.jsxs)("div",{className:"pb-3",children:[M,(0,s.jsx)("div",{className:"mx-4 border-t border-border"}),p?(0,s.jsx)(eD,{}):(0,s.jsx)("div",{className:"px-3 py-3 space-y-4",children:(0,s.jsx)(eC,{connected:S,detected:C,notFound:z,selectedAgentKey:E??i,listCopy:$,onInstallAgent:A,showNotDetected:f,setShowNotDetected:v,p:{rosterLabel:l.rosterLabel,sectionConnected:l.sectionConnected,sectionDetected:l.sectionDetected,sectionNotDetected:l.sectionNotDetected}})})]})}),(0,s.jsxs)("div",{className:"px-3 py-2 border-t border-border shrink-0 space-y-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,s.jsx)(eu.A,{size:11}),l.a2aDiscover]}),(0,s.jsxs)("button",{type:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"mcp"}}))},className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,s.jsx)(c.A,{size:11}),l.advancedConfig]})]}),(0,s.jsx)(ez.A,{open:y,onClose:()=>w(!1),onDiscover:k.discover,discovering:k.discovering,error:k.error})]})}var eT=r(90266),eP=r(71481),eR=r(98334),eI=r(93960),eF=r(6037),eL=r(89798),eO=r(73033),eW=r(6523),eB=r(73260),e_=r(50567),eU=r(48234),eH=r(46354),eX=r(69527);function eK({icon:e,title:t,prompt:r,tryLabel:n}){return(0,s.jsxs)("div",{className:"group flex items-center gap-2.5 px-4 py-1.5 hover:bg-muted/50 transition-colors rounded-sm mx-1",children:[(0,s.jsx)("span",{className:"text-muted-foreground shrink-0",children:e}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:t,children:t}),(0,s.jsx)("button",{onClick:()=>(0,eU.NH)(r,"user"),className:"opacity-0 group-hover:opacity-100 text-2xs px-2 py-0.5 rounded text-[var(--amber-text)] bg-[var(--amber-dim)] hover:opacity-80 transition-all duration-150 shrink-0",children:n})]})}let eG={c1:(0,s.jsx)(eT.A,{size:12}),c2:(0,s.jsx)(eP.A,{size:12}),c3:(0,s.jsx)(b.A,{size:12}),c4:(0,s.jsx)(eR.A,{size:12}),c5:(0,s.jsx)(eI.A,{size:12}),c6:(0,s.jsx)(eF.A,{size:12}),c7:(0,s.jsx)(d.A,{size:12}),c8:(0,s.jsx)(eL.A,{size:12}),c9:(0,s.jsx)(eO.A,{size:12})};function eY({active:e,maximized:t,onMaximize:r}){let{t:i}=(0,j.Y)(),o=i.panels.discover,l=i.explore,d=i.panels.plugins,c=(0,n.useRouter)(),[u,m]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[,g]=(0,a.useState)(0),[f,b]=(0,a.useState)(new Set),v=(0,a.useRef)(!1);(0,a.useEffect)(()=>{(0,eH.UG)(),m(!0)},[]),(0,a.useEffect)(()=>{if(!u||v.current)return;v.current=!0;let e=(0,eH.MZ)().map(e=>e.entryPath).filter(e=>!!e);0!==e.length&&fetch("/api/files").then(e=>e.ok?e.json():[]).then(t=>{let r=new Set(t);b(new Set(e.filter(e=>r.has(e))))}).catch(e=>{console.warn("[DiscoverPanel] fetch /api/files failed:",e)})},[u]);let y=(0,a.useCallback)((e,t)=>{(0,eH.$7)(e,t),g(e=>e+1),window.dispatchEvent(new Event("renderer-state-changed"))},[]),w=(0,a.useCallback)(e=>{c.push(`/view/${e.split("/").map(encodeURIComponent).join("/")}`)},[c]),k=u?(0,eH.MZ)():[],N=u?k.filter(e=>(0,eH.pl)(e.id)).length:0;return(0,s.jsxs)("div",{className:`flex flex-col h-full ${e?"":"hidden"}`,children:[(0,s.jsx)(J,{title:o.title,maximized:t,onMaximize:r}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[(0,s.jsxs)("div",{className:"py-2",children:[(0,s.jsx)(ef,{icon:(0,s.jsx)(eI.A,{size:14,className:"text-[var(--amber)]"}),title:o.useCases,badge:(0,s.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground",children:e_.LD.length}),href:"/explore"}),(0,s.jsx)(ef,{icon:(0,s.jsx)(eW.A,{size:14,className:"text-muted-foreground"}),title:o.pluginMarket,badge:(0,s.jsx)(eb,{label:o.comingSoon})}),(0,s.jsx)(ef,{icon:(0,s.jsx)(h.A,{size:14,className:"text-muted-foreground"}),title:o.skillMarket,badge:(0,s.jsx)(eb,{label:o.comingSoon})}),(0,s.jsx)(ef,{icon:(0,s.jsx)(eB.A,{size:14,className:"text-muted-foreground"}),title:o.spaceTemplates,badge:(0,s.jsx)(eb,{label:o.comingSoon})})]}),(0,s.jsx)("div",{className:"mx-4 border-t border-border"}),(0,s.jsxs)("div",{className:"py-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>p(e=>!e),className:"w-full flex items-center gap-1.5 px-4 py-1.5 text-left",children:[(0,s.jsx)(ey.A,{size:11,className:`text-muted-foreground transition-transform duration-150 ${x?"":"-rotate-90"}`}),(0,s.jsx)(eW.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider flex-1",children:d.title}),(0,s.jsxs)("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[N,"/",k.length]})]}),(0,s.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${x?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,s.jsx)("div",{className:"overflow-hidden",...!x&&{inert:!0},children:k.map(e=>{let t=(0,eH.pl)(e.id),r=!!e.entryPath&&f.has(e.entryPath),n=t&&e.entryPath&&r;return(0,s.jsxs)("div",{className:`flex items-center gap-2 px-4 py-1.5 mx-1 rounded-sm transition-colors ${n?"cursor-pointer hover:bg-muted/50":""} ${!t?"opacity-50":""}`,onClick:n?()=>w(e.entryPath):void 0,role:n?"link":void 0,tabIndex:n?0:void 0,onKeyDown:n?t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),w(e.entryPath))}:void 0,children:[(0,s.jsx)("span",{className:"text-sm shrink-0",suppressHydrationWarning:!0,children:e.icon}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:e.name,children:e.name}),e.core?(0,s.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:d.core}):(0,s.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,s.jsx)(eX.lM,{checked:t,onChange:t=>y(e.id,t),size:"sm"})})]},e.id)})})})]}),(0,s.jsx)("div",{className:"mx-4 border-t border-border"}),(0,s.jsxs)("div",{className:"py-2",children:[(0,s.jsx)("div",{className:"px-4 py-1.5",children:(0,s.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:o.useCases})}),e_.LD.map(e=>{var t;let r=(t=e.id,({c1:l.c1,c2:l.c2,c3:l.c3,c4:l.c4,c5:l.c5,c6:l.c6,c7:l.c7,c8:l.c8,c9:l.c9})[t]);return r?(0,s.jsx)(eK,{icon:eG[e.id]||(0,s.jsx)(eI.A,{size:12}),title:r.title,prompt:r.prompt,tryLabel:o.tryIt},e.id):null})]})]})]})}var eZ=r(13229),eq=r(32959),eV=r(71710);function eJ(){let[e,t]=(0,a.useState)(null),[r,n]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),{t:l}=(0,j.Y)();return((0,a.useEffect)(()=>{let e=async()=>{try{o(!0);let[e,r,s]=await Promise.all([(0,N.n)("/api/monitoring"),(0,N.n)("/api/changes?op=list&limit=3"),(0,N.n)("/api/ask-sessions")]);t({fileCount:e?.knowledgeBase?.fileCount??0,unreadChanges:r?.events?.length??0,sessionCount:Array.isArray(s)?s.length:0}),n((r?.events??[]).slice(0,3))}catch(e){console.warn("[EchoSidebarStats] Failed to load stats:",e),t({fileCount:0,unreadChanges:0,sessionCount:0}),n([])}finally{o(!1)}};e();let r=setInterval(e,1e4);return()=>clearInterval(r)},[]),i||!e)?(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:(0,s.jsx)("div",{className:"h-2 w-20 bg-muted rounded animate-pulse"})}):(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-3 border-t border-border",children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.fileCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Files"})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.unreadChanges}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Changes"})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.sessionCount}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Chats"})]})]}),r.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-muted-foreground px-0.5",children:"Recent"}),r.map(e=>{let t=function(e){try{let t=new Date(e),r=new Date().getTime()-t.getTime(),s=Math.floor(r/6e4),n=Math.floor(r/36e5),a=Math.floor(r/864e5);if(s<1)return"now";if(s<60)return`${s}m ago`;if(n<24)return`${n}h ago`;if(a<7)return`${a}d ago`;return t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return"recently"}}(e.ts),r=function(e){switch(e){case"create":return(0,s.jsx)(eV.A,{size:12,className:"text-success"});case"write":case"append":return(0,s.jsx)(eA.A,{size:12,className:"text-foreground"});case"delete":return(0,s.jsx)(eA.A,{size:12,className:"text-destructive"});case"rename":case"move":return(0,s.jsx)(eh.A,{size:12,className:"text-muted-foreground"});default:return(0,s.jsx)(eA.A,{size:12,className:"text-muted-foreground"})}}(e.op),n=e.path.split("/").pop()||e.path;return(0,s.jsxs)("div",{className:"flex items-start gap-2 p-1.5 rounded hover:bg-muted/40 transition-colors text-xs",children:[(0,s.jsx)("span",{className:"text-muted-foreground shrink-0 mt-0.5",children:r}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-foreground truncate font-medium",title:n,children:n}),(0,s.jsx)("p",{className:"text-muted-foreground text-2xs",children:t})]})]},e.id)})]})]})}var eQ=r(85130);function e0({active:e,maximized:t,onMaximize:r}){let{t:a}=(0,j.Y)(),i=a.panels.echo,o=(0,n.usePathname)()??"",l={imprint:{icon:(0,s.jsx)(eZ.A,{size:14}),title:i.imprintTitle},growth:{icon:(0,s.jsx)(eq.A,{size:14}),title:i.growthTitle},self:{icon:(0,s.jsx)(Y.A,{size:14}),title:i.selfTitle}};return(0,s.jsxs)("div",{className:`flex flex-col h-full ${e?"":"hidden"}`,children:[(0,s.jsx)(J,{title:i.title,maximized:t,onMaximize:r}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:[(0,s.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:eQ.RS.map(e=>{let t=l[e],r=eQ.AI[e],n=o===r||o.startsWith(`${r}/`);return(0,s.jsx)(ef,{href:r,icon:t.icon,title:t.title,active:n},e)})}),(0,s.jsx)("div",{className:"mt-auto",children:(0,s.jsx)(eJ,{})})]})]})}var e1=r(5038);function e2({active:e,maximized:t,onMaximize:r}){let{t:n}=(0,j.Y)(),i=n.panels.workflows,[l,d]=(0,a.useState)([]),[c,u]=(0,a.useState)(!0),[m,x]=(0,a.useState)(!1),[p,g]=(0,a.useState)(""),[f,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(""),w=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/workflows");if(!e.ok)return;let t=await e.json();d(t.workflows??[])}catch{}finally{u(!1)}},[]);(0,a.useEffect)(()=>{e&&w()},[e,w]);let k=async()=>{let e=p.trim();if(e&&!f){b(!0),y("");try{let t=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})}),r=await t.json();if(!t.ok)return void y(409===t.status?i.exists:r.error||"Error");x(!1),g(""),await w(),window.location.href=`/view/${(0,ei.O0)(r.path)}`}catch{y("Network error")}finally{b(!1)}}};return(0,s.jsxs)("div",{className:`flex flex-col h-full ${e?"":"hidden"}`,children:[(0,s.jsx)(J,{title:i.title,maximized:t,onMaximize:r,children:(0,s.jsx)("button",{onClick:()=>x(e=>!e),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":i.newWorkflow,title:i.newWorkflow,children:(0,s.jsx)(F.A,{size:13})})}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[m&&(0,s.jsxs)("div",{className:"px-3 py-3 border-b border-border",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:i.name}),(0,s.jsx)("input",{type:"text",value:p,onChange:e=>{g(e.target.value),y("")},onKeyDown:e=>"Enter"===e.key&&k(),placeholder:i.namePlaceholder,autoFocus:!0,className:"w-full px-2.5 py-1.5 text-sm rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),v&&(0,s.jsx)("p",{className:"text-xs text-[var(--error)] mt-1",children:v}),(0,s.jsxs)("div",{className:"flex gap-2 mt-2.5",children:[(0,s.jsx)("button",{onClick:()=>{x(!1),g(""),y("")},className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:bg-muted transition-colors",children:i.cancel}),(0,s.jsx)("button",{onClick:k,disabled:!p.trim()||f,className:"flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors disabled:opacity-50 bg-[var(--amber)] text-[var(--amber-foreground)]",children:f?i.creating:i.create})]})]}),c&&(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,s.jsx)(ec.A,{size:16,className:"animate-spin"})}),!c&&0===l.length&&!m&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:[(0,s.jsx)(h.A,{size:24,className:"text-muted-foreground/40 mb-3"}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:i.empty}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-4 max-w-[200px]",children:i.emptyDesc}),(0,s.jsxs)("button",{onClick:()=>x(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:[(0,s.jsx)(F.A,{size:12}),i.newWorkflow]})]}),!c&&l.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:l.map(e=>(0,s.jsxs)(o(),{href:`/view/${(0,ei.O0)(e.path)}`,className:`flex items-start gap-2.5 px-3 py-2 mx-1 rounded-lg transition-colors hover:bg-muted ${e.error?"opacity-70":""}`,children:[(0,s.jsx)(h.A,{size:14,className:"shrink-0 mt-0.5 text-[var(--amber)]"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:e.title}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[e.error?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-[var(--error)]",children:[(0,s.jsx)(e1.A,{size:10}),i.parseError]}):(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:i.nSteps(e.stepCount)}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60",suppressHydrationWarning:!0,children:(0,ei.KW)(e.mtime,n.home?.relativeTime)})]})]})]},e.path))})]})]})}var e5=r(37227),e3=r(74179);function e4({open:e,onClose:t,currentFile:r,initialMessage:n,initialAcpAgent:i,onFirstMessage:o,width:l,onWidthChange:d,onWidthCommit:c,askMode:u,onModeSwitch:m,maximized:x=!1,onMaximize:p,sidebarOffset:g=0}){let h=(0,a.useRef)(!1),f=(0,a.useRef)(!1),b=window.innerWidth-g,[v,y]=(0,a.useState)(!1),j=(0,a.useCallback)(e=>{if(h.current)return;let t=Math.min(e,b);if(x&&t<b-16&&p){f.current=!0,p(),d(Math.min(t,window.innerWidth-g-200));return}let r=window.innerWidth-g-t,s=t>=b-80||!f.current&&r<200;if(!x&&s&&p){h.current=!0,p();return}x||d(t)},[b,g,p,x,d]),w=Q({width:x?b:l,minWidth:320,maxWidth:b,maxWidthRatio:1,direction:"left",onResize:j,onResizeEnd:(0,a.useCallback)(e=>{y(!1),h.current||c(e)},[c])}),k=(0,a.useCallback)(e=>{h.current=!1,y(!0),f.current&&window.innerWidth-g-l>=200&&(f.current=!1),w(e)},[w,g,l]),N=x?`calc(100vw - ${g}px)`:`${l}px`;return(0,s.jsxs)("aside",{className:`
45
- hidden md:flex fixed top-0 right-0 h-screen z-40
46
- flex-col bg-background border-l border-border/40 shadow-[-4px_0_16px_rgba(0,0,0,0.04)]
47
- ${v?"":"transition-[width,transform] duration-200 ease-out"}
48
- ${e?"translate-x-0":"translate-x-full pointer-events-none"}
49
- `,style:{width:N,minWidth:"320px"},role:"complementary","aria-label":"MindOS panel",children:[(0,s.jsx)(e3.default,{fallback:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-6 text-center",children:[(0,s.jsx)(eA.A,{size:20,className:"text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"MindOS encountered an error."}),(0,s.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:"Reload page"})]}),children:(0,s.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col overflow-hidden",children:(0,s.jsx)(e5.A,{visible:e,variant:"panel",currentFile:e?r:void 0,initialMessage:n,initialAcpAgent:i,onFirstMessage:o,onClose:t,askMode:u,onModeSwitch:m,maximized:x,onMaximize:p})})}),(0,s.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:k,children:(0,s.jsx)("div",{className:"absolute left-[2px] top-0 w-[1px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity duration-150"})})]})}var e6=r(40517),e8=r(24336),e7=r(79455),e9=r(98641),te=r(46990);function tt({agent:e,agentStatus:t,mcpStatus:r,onBack:n,onInstallAgent:i,copy:o,headerVariant:l="inline"}){let[d,c]=(0,a.useState)(!1),[m,x]=(0,a.useState)(null),[p,g]=(0,a.useState)(()=>e.preferredTransport),h=(0,a.useMemo)(()=>"notFound"===t?null:(0,e9.$k)(e,r,p),[e,r,p,t]),f=async()=>{c(!0),x(null),x(await i(e.key)?{type:"success",text:`${e.name} ${o.connected}`}:{type:"error",text:o.installFailed}),c(!1)},b=async()=>{!h||await (0,te.l)(h.snippet)&&e7.oR.copy()},y="connected"===t?"bg-[var(--success)]":"detected"===t?"bg-[var(--amber)]":"bg-muted-foreground";return(0,s.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:["dock"===l?(0,s.jsxs)("header",{className:"shrink-0 flex items-center justify-between gap-3 border-b border-border px-4 py-3 bg-card",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,s.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${y}`}),(0,s.jsx)("h2",{className:"text-sm font-semibold text-foreground truncate",title:e.name,children:e.name})]}),(0,s.jsx)("button",{type:"button",onClick:n,className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring shrink-0","aria-label":o.closeDetail??"Close",children:(0,s.jsx)(u.A,{size:16})})]}):(0,s.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 border-b border-border bg-background/95 px-3 py-2.5 backdrop-blur-sm shrink-0",children:[(0,s.jsxs)("button",{type:"button",onClick:n,className:"flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground rounded-md px-1 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring shrink-0",children:[(0,s.jsx)(v.A,{size:16}),o.backToList]}),(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${y}`}),(0,s.jsx)("span",{className:"text-sm font-medium text-foreground truncate",title:e.name,children:e.name})]}),(0,s.jsxs)("div",{className:"px-4 py-4 space-y-4 flex-1 min-h-0 overflow-y-auto",children:["detected"===t&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("button",{type:"button",onClick:f,disabled:d,className:"inline-flex items-center gap-1.5 px-3 py-2 text-xs rounded-lg font-medium text-[var(--amber-foreground)] disabled:opacity-50 bg-[var(--amber)] hover:bg-[var(--amber)]/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[d?(0,s.jsx)(ec.A,{size:14,className:"animate-spin"}):null,d?o.installing:o.install]}),m&&(0,s.jsxs)("span",{className:`flex items-center gap-1 text-2xs ${"success"===m.type?"text-success":"text-destructive"}`,children:["success"===m.type?(0,s.jsx)(w.A,{size:12}):(0,s.jsx)(eA.A,{size:12}),m.text]})]}),"notFound"===t&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o.notFoundDetail}),"notFound"!==t&&h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider mb-1",children:o.configPath}),(0,s.jsx)("p",{className:"text-xs font-mono text-foreground break-all",children:h.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:o.agentDetailTransport}),(0,s.jsxs)("div",{className:"flex items-center gap-1 p-0.5 rounded-lg bg-muted/40 w-fit",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>g("stdio"),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${"stdio"===p?"bg-card shadow-sm text-foreground":"text-muted-foreground"}`,children:[(0,s.jsx)(e6.A,{size:13}),o.transportLocal]}),(0,s.jsxs)("button",{type:"button",onClick:()=>g("http"),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${"http"===p?"bg-card shadow-sm text-foreground":"text-muted-foreground"}`,children:[(0,s.jsx)(eu.A,{size:13}),o.transportRemote]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:o.agentDetailSnippet}),(0,s.jsx)("pre",{className:"text-[11px] font-mono bg-muted/50 border border-border rounded-lg p-3 overflow-x-auto whitespace-pre max-h-[min(320px,50vh)] overflow-y-auto select-all",children:h.displaySnippet})]}),(0,s.jsxs)("button",{type:"button",onClick:b,className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,s.jsx)(e8.A,{size:14}),o.copyConfig]})]})]})]})}function tr({open:e,agentKey:t,onClose:r,rightOffset:n,width:i,onWidthChange:o,onWidthCommit:l}){let d=(0,em.oc)(),c=(0,em.av)(),u=(0,em.u_)(),{t:m}=(0,j.Y)(),x=m.panels.agents,p=d.filter(e=>e.present&&e.installed),g=d.filter(e=>e.present&&!e.installed),h=d.filter(e=>!e.present),f=(0,a.useMemo)(()=>{if(!t)return null;let e=d.find(e=>e.key===t);if(!e)return null;let r=p.some(e=>e.key===t)?"connected":g.some(e=>e.key===t)?"detected":h.some(e=>e.key===t)?"notFound":null;return r?{agent:e,status:r}:null},[t,d,p,g,h]);(0,a.useEffect)(()=>{if(t&&!f){let e=requestAnimationFrame(()=>r());return()=>cancelAnimationFrame(e)}},[t,f,r]);let b=Q({width:i,minWidth:300,maxWidth:640,maxWidthRatio:.42,direction:"left",onResize:o,onResizeEnd:l}),v={connected:x.connected,installing:x.installing,install:x.install,installFailed:x.installFailed,copyConfig:x.copyConfig,copied:x.copied,transportLocal:x.transportLocal,transportRemote:x.transportRemote,configPath:x.configPath,notFoundDetail:x.notFoundDetail,backToList:x.backToList,closeDetail:x.closeAgentDetail,agentDetailTransport:x.agentDetailTransport,agentDetailSnippet:x.agentDetailSnippet};return(0,s.jsxs)("aside",{className:`
50
- hidden md:flex fixed top-0 h-screen z-[31] flex-col bg-card border-l border-border shadow-sm
51
- transition-transform duration-200 ease-out
52
- ${e?"translate-x-0":"translate-x-full pointer-events-none"}
53
- `,style:{width:`${i}px`,right:`${n}px`},role:"complementary","aria-label":x.agentDetailPanelAria,"aria-hidden":!e||!f,children:[f&&(0,s.jsx)("div",{className:"flex flex-col flex-1 min-h-0 overflow-y-auto",children:(0,s.jsx)(tt,{agent:f.agent,agentStatus:f.status,mcpStatus:c,onBack:r,onInstallAgent:u,copy:v,headerVariant:"dock"})}),(0,s.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:b,children:(0,s.jsx)("div",{className:"absolute left-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity"})})]})}var ts=r(19378);function tn({onToggle:e,askPanelOpen:t}){let{t:r}=(0,j.Y)(),a=(0,n.usePathname)(),i=`${r.ask?.fabLabel??"Ask MindOS"} (⌘/)`;return(0,s.jsxs)("button",{onClick:e,className:`
54
- group hidden md:flex
55
- fixed z-40 bottom-5 right-5
56
- items-center justify-center
57
- gap-0 hover:gap-2
58
- p-3 rounded-2xl
59
- text-[var(--amber-foreground)] font-medium text-[13px]
60
- shadow-md shadow-[var(--amber)]/15
61
- transition-all duration-200 ease-out
62
- hover:shadow-lg hover:shadow-[var(--amber)]/20
63
- active:scale-95 cursor-pointer overflow-hidden
64
- ${t||"/"===a||""===a?"opacity-0 pointer-events-none translate-y-2":"opacity-100 translate-y-0"}
65
- `,style:{background:"var(--amber)"},title:i,"aria-label":i,children:[(0,s.jsx)(ts.A,{size:16,className:"relative z-10 shrink-0"}),(0,s.jsx)("span",{className:" relative z-10 max-w-0 group-hover:max-w-[120px] opacity-0 group-hover:opacity-100 transition-all duration-200 ease-out whitespace-nowrap overflow-hidden ",children:r.ask?.fabLabel??"Ask MindOS"})]})}function ta({open:e,onClose:t,anchorRect:r,railWidth:n,onOpenSyncSettings:i,syncStatus:o,onSyncStatusRefresh:l}){let d=(0,a.useRef)(null),{syncing:c,syncResult:m,syncNow:x}=E(l);if((0,a.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),t())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,e]),(0,a.useEffect)(()=>{if(!e)return;let r=e=>{d.current&&!d.current.contains(e.target)&&t()},s=setTimeout(()=>window.addEventListener("mousedown",r),0);return()=>{clearTimeout(s),window.removeEventListener("mousedown",r)}},[t,e]),!e||!r)return null;let p=C(o,c),{label:g}=$(p,o),h=Math.max(8,r.bottom-180);return(0,s.jsxs)("div",{ref:d,className:"fixed z-40 w-[240px] border rounded-lg bg-card shadow-lg border-border animate-in fade-in slide-in-from-left-2 duration-150",style:{top:h,left:n},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Sync"}),(0,s.jsx)("button",{onClick:t,className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,s.jsx)(u.A,{size:14})})]}),(0,s.jsxs)("div",{className:"p-3 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${z[p]} ${"syncing"===p||"conflicts"===p||"error"===p?"animate-pulse":""}`}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:g}),"success"===m&&(0,s.jsx)(w.A,{size:14,className:"text-success shrink-0"}),"error"===m&&(0,s.jsx)(k.A,{size:14,className:"text-error shrink-0"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:["off"!==p&&(0,s.jsxs)(eX.jn,{onClick:x,disabled:c,className:"text-xs px-3 py-1.5 flex items-center gap-1.5",children:[(0,s.jsx)(b.A,{size:12,className:c?"animate-spin":""}),"Sync Now"]}),(0,s.jsx)("button",{onClick:()=>{i(),t()},className:"text-xs text-muted-foreground hover:text-foreground transition-colors rounded px-1 py-0.5 focus-visible:ring-2 focus-visible:ring-ring",children:"Settings →"})]})]})]})}function ti(){let[e,t]=(0,a.useState)(!1),{t:r}=(0,j.Y)(),n=r.shortcutPanel,i="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",o=(0,a.useMemo)(()=>[{keys:`${i} K`,label:n.toggleSearch,section:n.navigation},{keys:`${i} /`,label:n.toggleAskAI,section:n.navigation},{keys:`${i} ,`,label:n.openSettings,section:n.navigation},{keys:`${i} ?`,label:n.keyboardShortcuts,section:n.navigation},{keys:"Esc",label:n.closePanel,section:n.panelsSection},{keys:`${i} S`,label:n.saveFile,section:n.editor},{keys:`${i} Z`,label:n.undo,section:n.editor},{keys:`${i} Shift Z`,label:n.redo,section:n.editor}],[i,n]);if((0,a.useEffect)(()=>{let r=r=>{(r.metaKey||r.ctrlKey)&&r.shiftKey&&"/"===r.key&&(r.preventDefault(),t(e=>!e)),"Escape"===r.key&&e&&t(!1)};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),!e)return null;let l=[...new Set(o.map(e=>e.section))];return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:e=>e.target===e.currentTarget&&t(!1),children:(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":n.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:n.title}),(0,s.jsx)("button",{onClick:()=>t(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,s.jsx)(u.A,{size:15})})]}),(0,s.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:l.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:e}),(0,s.jsx)("div",{className:"space-y-1",children:o.filter(t=>t.section===e).map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-foreground",children:e.label}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:e.keys.split(" ").map((e,t)=>(0,s.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:e},t))})]},e.keys))})]},e))}),(0,s.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,s.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,s.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:i}),(0,s.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",n.toggleHint]})})]})})}function to(){let[e,t]=(0,a.useState)(0),[r,i]=(0,a.useState)(null),[l,d]=(0,a.useState)(!1),c=(0,a.useRef)(0),[m,x]=(0,a.useState)(!1),[p,g]=(0,a.useState)(!1),h=(0,n.usePathname)(),{t:f}=(0,j.Y)();(0,a.useEffect)(()=>{let e=!0,r=async()=>{try{let r=await (0,N.n)("/api/changes?op=summary");e&&t(r.unreadCount)}catch{e&&t(0)}};r();let s=setInterval(()=>void r(),15e3);return()=>{e=!1,clearInterval(s)}},[]),(0,a.useEffect)(()=>{e>c.current&&l&&d(!1),c.current=e},[e,l]);let b=(0,a.useMemo)(()=>!(e<=0||h?.startsWith("/changes")||h?.startsWith("/changelog"))&&(null===r||!(e<=r))&&!l,[r,h,e,l]);async function v(){try{await (0,N.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{t(0),i(0)}}return((0,a.useEffect)(()=>{if(!b)return;let e=setTimeout(()=>d(!0),1e4);return()=>clearTimeout(e)},[b]),(0,a.useEffect)(()=>{if(b){x(!0);let e=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(e)}g(!1);let e=setTimeout(()=>x(!1),160);return()=>clearTimeout(e)},[b]),m)?(0,s.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${p?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,s.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,s.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,s.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,s.jsx)(X.A,{size:14})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-xs text-foreground font-medium whitespace-nowrap",children:f.changes.unreadBanner(e)}),(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,s.jsx)(o(),{href:"/changelog",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:f.changes.reviewNow}),(0,s.jsx)("button",{type:"button",onClick:()=>void v(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:f.changes.markAllRead})]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>i(e),"aria-label":f.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,s.jsx)(u.A,{size:14})})]})})}):null}var tl=r(68868);let td=(0,ee.createServerReference)("70dab5cb045d9de16e55d41546ce34073d3b791bab",ee.callServer,void 0,ee.findSourceMapURL,"revertSpaceInitAction");function tc(){let[e,t]=(0,a.useState)(null),[r,i]=(0,a.useState)(!1),[o,l]=(0,a.useTransition)(),d=(0,n.useRouter)(),{t:c}=(0,j.Y)(),m=(0,a.useCallback)(()=>{i(!1),setTimeout(()=>t(null),200)},[]),x=(0,a.useCallback)(e=>{let r=e.detail;"working"===r.state?(t(r),requestAnimationFrame(()=>i(!0))):"done"===r.state?(t(e=>e?{...e,state:"done"}:null),d.refresh()):m()},[d,m]);(0,a.useEffect)(()=>(window.addEventListener("mindos:ai-init",x),()=>window.removeEventListener("mindos:ai-init",x)),[x]);let p=(0,a.useCallback)(()=>{e&&(m(),d.push(`/view/${(0,ei.O0)(e.spacePath+"/")}`))},[e,m,d]),g=(0,a.useCallback)(()=>{e&&l(async()=>{await td(e.spacePath,e.spaceName,e.description),t(e=>e?{...e,state:"reverted"}:null),d.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(m,2e3)})},[e,d,m]),h=(0,a.useCallback)(()=>{m()},[m]);if(!e)return null;let f=c.home,{state:b}=e,v="done"===b,y="reverted"===b;return(0,s.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${r?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:v?"0.5rem":"1rem"},children:[(0,s.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${y?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===b?"animate-pulse":""}`,children:y?(0,s.jsx)(tl.A,{size:12}):v?(0,s.jsx)(ej.A,{size:13,strokeWidth:2.5}):(0,s.jsx)(ts.A,{size:13})}),(0,s.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:y?f.aiInitReverted(e.spaceName):v?f.aiInitReady(e.spaceName):(0,s.jsxs)(s.Fragment,{children:[f.aiInitGenerating(e.spaceName),(0,s.jsx)(tu,{})]})}),v&&(0,s.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,s.jsx)("button",{type:"button",onClick:p,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:f.aiInitReview}),(0,s.jsx)("button",{type:"button",onClick:g,disabled:o,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:f.aiInitDiscard}),(0,s.jsx)("button",{type:"button",onClick:h,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,s.jsx)(u.A,{size:12})})]})]})})}function tu(){return(0,s.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,s.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,s.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,s.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,s.jsx)("style",{children:`
66
- @keyframes dotBounce {
67
- 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
68
- 30% { opacity: 1; transform: translateY(-2px); }
69
- }
70
- `})]})}var tm=r(86386),tx=r(75157),tp=r(4373),tg=r(87203),th=r(30292);function tf(e,t){let r=e.fileImport;if(!t)return r.organizeProcessing;switch(t.stage){case"connecting":return r.organizeConnecting;case"analyzing":return r.organizeAnalyzing;case"reading":return r.organizeReading(t.detail);case"thinking":return r.organizeThinking;case"writing":return r.organizeWriting(t.detail);default:return r.organizeProcessing}}function tb({aiOrganize:e,onDismiss:t,onCancel:r,onHistoryUpdate:i}){let{t:o}=(0,j.Y)(),l=(0,n.useRouter)(),d=o.fileImport,c="organizing"===e.phase,{elapsed:m,displayHint:x}=function(e,t){let[r,s]=(0,a.useState)(0),[n,i]=(0,a.useState)(!1),o=(0,a.useRef)(Date.now());return(0,a.useEffect)(()=>{o.current=Date.now(),i(!1)},[t]),(0,a.useEffect)(()=>{if(!e){s(0),i(!1);return}let t=setInterval(()=>{s(e=>e+1),Date.now()-o.current>=5e3&&i(!0)},1e3);return()=>clearInterval(t)},[e]),{elapsed:r,displayHint:n?{stage:"thinking"}:t}}(c,e.stageHint),[p,g]=(0,a.useState)(!1),[h,f]=(0,a.useState)(!1),[b,v]=(0,a.useState)(!1),y=(0,a.useRef)(null),w=(0,a.useRef)(null),k="done"===e.phase,N="error"===e.phase,S=c||k||N,C=e.changes.filter(e=>e.ok&&!e.undone).length;(0,a.useEffect)(()=>{c&&(w.current=null)},[c]),(0,a.useEffect)(()=>{if(k&&!w.current){let t=(0,th.jQ)();w.current=t,(0,th.D4)({id:t,timestamp:Date.now(),sourceFiles:e.sourceFileNames,files:e.changes.map(e=>({action:e.action,path:e.path,ok:e.ok,undone:e.undone})),status:"completed",source:e.source,durationMs:e.durationMs}),i?.()}},[k,e.changes,e.sourceFileNames,e.source,e.durationMs,i]);let z=(0,a.useCallback)(()=>{y.current&&clearTimeout(y.current),(k||N)&&(y.current=setTimeout(()=>{t()},18e4))},[k,N,t]);(0,a.useEffect)(()=>(z(),()=>{y.current&&clearTimeout(y.current)}),[z]);let A=(0,a.useCallback)(()=>{z()},[z]),E=(0,a.useCallback)(async t=>{A(),v(!0);let r=await e.undoOne(t);v(!1),r&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(w.current){let r=e.changes.map(e=>({action:e.action,path:e.path,ok:e.ok,undone:e.path===t||e.undone})),s=r.every(e=>!e.ok||e.undone);(0,th.W8)(w.current,{files:r,status:s?"undone":"partial"}),i?.()}},0))},[e,A,i]),$=(0,a.useCallback)(async()=>{A(),v(!0);let t=await e.undoAll();v(!1),t>0&&(window.dispatchEvent(new Event("mindos:files-changed")),w.current&&((0,th.W8)(w.current,{files:e.changes.map(e=>({action:e.action,path:e.path,ok:e.ok,undone:!!e.ok||e.undone})),status:"undone"}),i?.()))},[e,A,i]),D=(0,a.useCallback)(e=>{A(),l.push(`/view/${(0,ei.O0)(e)}`)},[l,A]),M=(0,a.useCallback)(()=>{t()},[t]);if(!S)return null;function T(t,r){let n=t.undone,a=e.canUndo(t.path),i=t.path.split("/").pop()??t.path;return(0,s.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${n?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[n?(0,s.jsx)(tl.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===t.action?(0,s.jsx)(tm.A,{size:14,className:"text-success shrink-0"}):(0,s.jsx)(tx.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,s.jsx)("span",{className:`truncate flex-1 ${n?"line-through text-muted-foreground":"text-foreground"}`,children:i}),n?(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:d.organizeUndone}):(0,s.jsx)("span",{className:`text-xs shrink-0 ${t.ok?"text-muted-foreground":"text-error"}`,children:t.ok?"create"===t.action?d.organizeCreated:d.organizeUpdated:d.organizeFailed}),a&&(0,s.jsx)("button",{type:"button",onClick:()=>E(t.path),disabled:b,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:d.organizeUndoOne,children:(0,s.jsx)(tl.A,{size:12})}),t.ok&&!t.undone&&(0,s.jsx)("button",{type:"button",onClick:()=>D(t.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:d.organizeViewFile,children:(0,s.jsx)(tp.A,{size:12})})]},`${t.path}-${r}`)}function P(){return(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[k&&e.hasAnyUndoable&&(0,s.jsxs)("button",{onClick:$,disabled:b,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[b?(0,s.jsx)(ec.A,{size:12,className:"animate-spin"}):(0,s.jsx)(tl.A,{size:12}),d.organizeUndoAll]}),(0,s.jsxs)("button",{onClick:M,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,s.jsx)(ej.A,{size:12}),d.organizeDone]})]})}return h?(0,s.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:e=>{e.target===e.currentTarget&&f(!1)},children:(0,s.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:A,role:"dialog","aria-modal":"true","aria-label":d.organizeDetailTitle,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[c?(0,s.jsxs)("div",{className:"relative shrink-0",children:[(0,s.jsx)(ts.A,{size:16,className:"text-[var(--amber)]"}),(0,s.jsx)(ec.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):k?(0,s.jsx)(ej.A,{size:16,className:"text-success"}):(0,s.jsx)(eA.A,{size:16,className:"text-error"}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:d.organizeDetailTitle}),c&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:d.organizeElapsed(m)})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>f(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:d.organizeMinimizeModal,children:(0,s.jsx)(q.A,{size:14})}),(0,s.jsx)("button",{type:"button",onClick:M,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,s.jsx)(u.A,{size:14})})]})]}),(0,s.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[c&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,s.jsx)(ec.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-foreground",children:tf(o,x)})]}),e.sourceFileNames.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:d.organizeSourceFiles}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.sourceFileNames.map((e,t)=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,s.jsx)(tg.A,{size:11,className:"text-muted-foreground shrink-0"}),e]},t))})]}),(e.summary||c)&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:d.organizeSummaryLabel}),(0,s.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:e.summary||d.organizeNoSummary})]}),e.changes.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:d.organizeChangesLabel(e.changes.length)}),(0,s.jsx)("div",{className:"space-y-0.5",children:e.changes.map((e,t)=>T(e,t))})]}),N&&(0,s.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:e.error})]}),(k||N)&&P()]})}):p&&(k||N)?(0,s.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:A,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[k?(0,s.jsx)(ej.A,{size:14,className:"text-success"}):(0,s.jsx)(eA.A,{size:14,className:"text-error"}),(0,s.jsx)("span",{className:"text-xs font-medium text-foreground",children:k?d.organizeReviewTitle:d.organizeErrorTitle})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{g(!1),f(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:d.organizeDetailTitle,children:(0,s.jsx)(V.A,{size:13})}),(0,s.jsx)("button",{type:"button",onClick:()=>g(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,s.jsx)(ey.A,{size:14})})]})]}),k&&(0,s.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:e.changes.map((e,t)=>T(e,t))}),N&&(0,s.jsx)("div",{className:"p-4 text-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.error})}),P()]}):(0,s.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:A,children:k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ej.A,{size:16,className:"text-success shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate",children:d.organizeReviewDesc(C)}),e.changes.length>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>{g(!0),A()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,s.jsx)(ey.A,{size:12,className:"rotate-180"}),d.organizeExpand]}),(0,s.jsxs)("button",{type:"button",onClick:M,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,s.jsx)(ej.A,{size:12}),d.organizeDone]})]}):N?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eA.A,{size:16,className:"text-error shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate",children:d.organizeError}),(0,s.jsx)("button",{type:"button",onClick:()=>{g(!0),A()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:d.organizeExpand}),(0,s.jsx)("button",{type:"button",onClick:M,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,s.jsx)(u.A,{size:14})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"relative shrink-0",children:[(0,s.jsx)(ts.A,{size:16,className:"text-[var(--amber)]"}),(0,s.jsx)(ec.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,s.jsx)("span",{className:"text-xs text-foreground truncate",children:tf(o,x)}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:d.organizeElapsed(m)}),(0,s.jsx)("button",{type:"button",onClick:()=>{f(!0),A()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:d.organizeDetailTitle,children:(0,s.jsx)(V.A,{size:13})}),(0,s.jsx)("button",{type:"button",onClick:M,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,s.jsx)(u.A,{size:14})})]})})}var tv=r(37811);class ty{track(e,t){this.record({name:e,ts:Date.now(),props:t})}startTimer(e,t){let r=Date.now();return s=>{this.record({name:e,ts:r,durationMs:Date.now()-r,props:{...t??{},...s??{}}})}}getEvents(){return this.history.map(e=>({...e,props:e.props?{...e.props}:void 0}))}reset(){this.history=[],this.pending=[]}async flush(){if(0===this.pending.length)return 0;let e=this.pending.splice(0),t=tv.env.MINDOS_TELEMETRY_ENDPOINT?.trim();if(!t)return e.length;try{return await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),e.length}catch{return this.pending.unshift(...e),0}}record(e){this.history.push(e),this.history.length>200&&this.history.splice(0,this.history.length-200),this.pending.push(e),this.log(e)}log(e){}constructor(){this.history=[],this.pending=[]}}let tj=new ty;var tw=r(93738);function tk(){return(0,a.useEffect)(()=>em.zd.getState()._init(),[]),null}var tN=r(59029),tS=r(52445);let tC="mindos_walkthrough_done";function tz(e,t){if(e>=tS.g.length||t)try{localStorage.setItem(tC,"1")}catch{}fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{walkthroughStep:e,walkthroughDismissed:t}})}).catch(e=>{console.warn("[walkthrough-store] persist failed:",e)})}let tA=(0,tN.v)((e,t)=>{let r=tS.g.length;return{status:"idle",currentStep:0,totalSteps:r,start:()=>{e({currentStep:0,status:"active"}),tz(0,!1)},next:()=>{let s=t().currentStep+1;s>=r?(e({status:"completed"}),tz(r,!1)):(e({currentStep:s}),tz(s,!1))},back:()=>{let r=t().currentStep;r>0&&(e({currentStep:r-1}),tz(r-1,!1))},skip:()=>{e({status:"dismissed"}),tz(t().currentStep,!0)},_init:()=>{let t="1"===new URLSearchParams(window.location.search).get("welcome");if(t){let e=new URL(window.location.href);e.searchParams.delete("welcome"),window.history.replaceState({},"",e.pathname+(e.search||"")),window.dispatchEvent(new Event("mindos:first-visit"))}return window.innerWidth<768||function(){try{return"1"===localStorage.getItem(tC)}catch{return!1}}()?()=>{}:(fetch("/api/setup").then(e=>e.json()).then(s=>{let n=s.guideState;if(n){if(n.walkthroughDismissed||"number"==typeof n.walkthroughStep&&n.walkthroughStep>=r){try{localStorage.setItem(tC,"1")}catch{}return}n.active&&!n.dismissed&&void 0===n.walkthroughStep?t&&e({status:"active",currentStep:0}):"number"==typeof n.walkthroughStep&&n.walkthroughStep>=0&&n.walkthroughStep<r&&!n.walkthroughDismissed&&e({status:"active",currentStep:n.walkthroughStep})}}).catch(e=>{console.warn("[walkthrough-store] guideState read failed:",e)}),()=>{})}}});function tE({stepIndex:e,rect:t,position:r}){let n,i,o=tA(),{t:l}=(0,j.Y)(),[d,c]=(0,a.useState)({width:1024,height:768});if((0,a.useEffect)(()=>{let e=()=>c({width:window.innerWidth,height:window.innerHeight});return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!o)return null;let u=l.walkthrough.steps[e];if(!u)return null;"right"===r?(n=t.top+t.height/2,i=t.right+12):(n=t.bottom+12,i=t.left+t.width/2);let m=d.width-320,x=d.height-200;return i=Math.min(i,m),n=Math.max(n=Math.min(n,x),8),(0,s.jsxs)("div",{className:`fixed z-[102] w-[280px] rounded-xl border shadow-lg animate-in fade-in duration-200 ${"right"===r?"slide-in-from-left-2":"slide-in-from-top-2"}`,style:{top:`${n}px`,left:`${i}px`,transform:"right"===r?"translateY(-50%)":"translateX(-50%)",background:"var(--card)",borderColor:"var(--amber)"},children:[(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,s.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:l.walkthrough.step(e+1,o.totalSteps)})}),(0,s.jsx)("h3",{className:"text-sm font-semibold mb-1",style:{color:"var(--foreground)"},children:u.title}),(0,s.jsx)("p",{className:"text-xs leading-relaxed",style:{color:"var(--muted-foreground)"},children:u.body}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3",style:{borderTop:"1px solid var(--border)"},children:[(0,s.jsx)("button",{onClick:o.skip,className:"text-xs transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:l.walkthrough.skip}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e>0&&(0,s.jsx)("button",{onClick:o.back,className:"text-xs px-2.5 py-1 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:l.walkthrough.back}),(0,s.jsx)("button",{onClick:o.next,className:"text-xs px-3 py-1.5 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:e===o.totalSteps-1?l.walkthrough.done:l.walkthrough.next})]})]})]}),(0,s.jsx)("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:Array.from({length:o.totalSteps},(t,r)=>(0,s.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-all duration-200",style:{background:r===e?"var(--amber)":"var(--border)",transform:r===e?"scale(1.3)":void 0}},r))})]})}function t$(){let e=tA(),[t,r]=(0,a.useState)(null),[n,i]=(0,a.useState)(!1),o=(0,a.useId)(),l=e?tS.g[e.currentStep]:null,d=(0,a.useCallback)(()=>{if(!l)return;let e=document.querySelector(`[data-walkthrough="${l.anchor}"]`);e?r(e.getBoundingClientRect()):r(null)},[l]);(0,a.useEffect)(()=>{i(window.innerWidth<768),d();let e=()=>{i(window.innerWidth<768),d()};return window.addEventListener("resize",e),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",d,!0)}},[d]),(0,a.useEffect)(()=>{d();let e=setTimeout(d,100);return()=>clearTimeout(e)},[e?.currentStep,d]);let c=e?.skip;(0,a.useEffect)(()=>{if(!c)return;let e=e=>{"Escape"===e.key&&(e.stopPropagation(),c())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[c]);let u=e?.currentStep??0;return((0,a.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>{document.querySelector(`[data-walkthrough="${l.anchor}"]`)||tA.getState().next()},500);return()=>clearTimeout(e)},[u]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{tA.getState().skip()},6e4);return()=>clearTimeout(e)},[u]),e&&l)?n?(0,s.jsx)(tD,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{className:"fixed inset-0 z-[100] pointer-events-auto",width:"100%",height:"100%",onClick:r=>{if(t){let s=r.clientX,n=r.clientY;s>=t.left-6&&s<=t.right+6&&n>=t.top-6&&n<=t.bottom+6||e.skip()}else e.skip()},children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("mask",{id:o,children:[(0,s.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),t&&(0,s.jsx)("rect",{x:t.left-6,y:t.top-6,width:t.width+12,height:t.height+12,rx:8,ry:8,fill:"black"})]})}),(0,s.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0, 0, 0, 0.5)",mask:`url(#${o})`})]}),t&&(0,s.jsx)(tE,{stepIndex:e.currentStep,rect:t,position:l.position}),!t&&(0,s.jsx)("div",{className:"fixed inset-0 z-[101] flex items-center justify-center pointer-events-none",children:(0,s.jsx)("button",{onClick:e.skip,className:"pointer-events-auto px-4 py-2 text-sm rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:e.currentStep===e.totalSteps-1?"✓":"→"})})]}):null}function tD(){let e=tA(),{t}=(0,j.Y)();if(!e)return null;let r=t.walkthrough.steps[e.currentStep];return r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-sm",onClick:e.skip}),(0,s.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[101] rounded-t-2xl border-t shadow-lg p-5 pb-8 animate-in slide-in-from-bottom duration-300",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:t.walkthrough.step(e.currentStep+1,e.totalSteps)}),(0,s.jsx)("div",{className:"flex items-center gap-1 ml-auto",children:Array.from({length:e.totalSteps},(t,r)=>(0,s.jsx)("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:r===e.currentStep?"var(--amber)":"var(--border)"}},r))})]}),(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--foreground)"},children:r.title}),(0,s.jsx)("p",{className:"text-sm leading-relaxed mb-5",style:{color:"var(--muted-foreground)"},children:r.body}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("button",{onClick:e.skip,className:"text-sm transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:t.walkthrough.skip}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.currentStep>0&&(0,s.jsx)("button",{onClick:e.back,className:"text-sm px-3 py-2 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:t.walkthrough.back}),(0,s.jsx)("button",{onClick:e.next,className:"text-sm px-4 py-2 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:e.currentStep===e.totalSteps-1?t.walkthrough.done:t.walkthrough.next})]})]})]})]}):null}function tM(){return(0,a.useEffect)(()=>tA.getState()._init(),[]),"active"===tA(e=>e.status)?(0,s.jsx)(t$,{}):null}let tT=new Set(["mp3","wav","m4a","ogg","flac","aac"]),tP=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico"]),tR=new Set(["mp4","webm","mov","mkv"]);for(let e of[{id:"agent-inspector",name:"Agent Inspector",description:"Visualizes agent tool-call logs as a filterable timeline. Auto-activates on .mindos/agent-audit-log.json and supports legacy .agent-log.json.",author:"MindOS",icon:"\uD83D\uDD0D",tags:["agent","inspector","log","mcp","tools"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/agent-audit-log.json",match:({filePath:e})=>/(^|\/)\.mindos\/agent-audit-log\.json$/i.test(e)||/\.agent-log\.json$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,29803)).then(e=>({default:e.AgentInspectorRenderer}))},{id:"audio",name:"Audio Player",description:"Plays audio files with native browser controls.",author:"MindOS",icon:"\uD83C\uDFB5",tags:["audio","music","voice","mp3","wav"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:e})=>tT.has(e),load:()=>Promise.resolve().then(r.bind(r,61882)).then(e=>({default:e.AudioRenderer}))},{id:"backlinks",name:"Backlinks Explorer",description:"Shows all files that link to the current page via wikilinks or markdown links, with highlighted snippet context.",author:"MindOS",icon:"\uD83D\uDD17",tags:["backlinks","wiki","links","references"],builtin:!0,entryPath:"BACKLINKS.md",match:({filePath:e})=>/\bBACKLINKS\b.*\.md$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,6478)).then(e=>({default:e.BacklinksRenderer}))},{id:"change-log",name:"Content Changes",description:"Renders the .mindos/change-log.json file as a searchable timeline of content edits.",author:"MindOS",icon:"\uD83D\uDCCB",tags:["changelog","history","changes"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({filePath:e})=>/\.mindos\/change-log\.json$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,22669)).then(e=>({default:e.ChangeLogRenderer}))},{id:"config-panel",name:"Config Panel",description:"Renders CONFIG.json as an editable control panel based on uiSchema/keySpecs. Changes are written back to the JSON file directly.",author:"MindOS",icon:"\uD83E\uDDE9",tags:["config","json","settings","schema"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"CONFIG.json",match:({filePath:e,extension:t})=>"json"===t&&/(^|\/)CONFIG\.json$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,39580)).then(e=>({default:e.ConfigRenderer}))},{id:"csv",name:"CSV Views",description:"Renders any CSV file as Table, Gallery, or Board. Each view is independently configurable — choose which columns map to title, description, tag, and group.",author:"MindOS",icon:"\uD83D\uDCCA",tags:["csv","table","gallery","board","data"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"Resources/Products.csv",match:({extension:e,filePath:t})=>"csv"===e&&!/\bTODO\b/i.test(t),load:()=>Promise.resolve().then(r.bind(r,34045)).then(e=>({default:e.CsvRenderer}))},{id:"image",name:"Image Viewer",description:"Renders image files with zoom, fit-to-view, and transparency support.",author:"MindOS",icon:"\uD83D\uDDBC",tags:["image","photo","viewer","png","jpg","svg"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:e})=>tP.has(e),load:()=>Promise.resolve().then(r.bind(r,19114)).then(e=>({default:e.ImageRenderer}))},{id:"pdf",name:"PDF Viewer",description:"Renders PDF files using the browser built-in PDF viewer.",author:"MindOS",icon:"\uD83D\uDCC4",tags:["pdf","document","viewer"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:e})=>"pdf"===e,load:()=>Promise.resolve().then(r.bind(r,56514)).then(e=>({default:e.PdfRenderer}))},{id:"summary",name:"AI Briefing",description:"Streams an AI-generated daily briefing summarizing your most recently modified files — key changes, recurring themes, and suggested next actions.",author:"MindOS",icon:"✨",tags:["ai","summary","briefing","daily"],builtin:!0,entryPath:"DAILY.md",match:({filePath:e})=>/\b(SUMMARY|summary|Summary|BRIEFING|briefing|Briefing|DAILY|daily|Daily)\b.*\.md$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,94866)).then(e=>({default:e.SummaryRenderer}))},{id:"timeline",name:"Timeline",description:"Renders changelog and journal files as a vertical timeline. Any markdown with ## date headings (e.g. ## 2025-01-15) becomes a card in the feed.",author:"MindOS",icon:"\uD83D\uDCC5",tags:["timeline","changelog","journal","history"],builtin:!0,entryPath:"CHANGELOG.md",match:({filePath:e})=>/\b(CHANGELOG|changelog|TIMELINE|timeline|journal|Journal|diary|Diary)\b.*\.md$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,90454)).then(e=>({default:e.TimelineRenderer}))},{id:"todo",name:"TODO Board",description:"Renders TODO.md/TODO.csv as an interactive kanban board grouped by section. Check items off directly — changes are written back to the source file.",author:"MindOS",icon:"✅",tags:["productivity","tasks","markdown"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"TODO.md",match:({filePath:e})=>/\bTODO\b.*\.(md|csv)$/i.test(e),load:()=>Promise.resolve().then(r.bind(r,10763)).then(e=>({default:e.TodoRenderer}))},{id:"video",name:"Video Player",description:"Plays video files with native browser controls.",author:"MindOS",icon:"\uD83C\uDFAC",tags:["video","movie","recording","mp4","webm"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:e})=>tR.has(e),load:()=>Promise.resolve().then(r.bind(r,76782)).then(e=>({default:e.VideoRenderer}))},{id:"workflow-yaml",name:"Workflow Runner",description:"Execute step-by-step YAML workflows with Skills & Agent support.",author:"MindOS",icon:"⚡",tags:["workflow","automation","steps","ai","yaml"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/workflows/",match:({extension:e,filePath:t})=>("yaml"===e||"yml"===e)&&/\.flow\.(yaml|yml)$/i.test(t),load:()=>Promise.resolve().then(r.bind(r,34959)).then(e=>({default:e.WorkflowYamlRenderer}))},{id:"graph",name:"Wiki Graph",description:"Force-directed graph of wikilink references across all markdown files. Supports Global and Local (2-hop) scope filters.",author:"MindOS",icon:"\uD83D\uDD78️",tags:["graph","wiki","links","visualization"],builtin:!0,match:()=>!1,load:()=>Promise.resolve().then(r.bind(r,84962)).then(e=>({default:e.GraphRenderer}))}])(0,eH.TS)(e);var tI=r(40235),tF=r(72466);let tL=(0,tw.default)(()=>r.e(8732).then(r.bind(r,48732)),{loadableGenerated:{webpack:()=>[48732]},ssr:!1}),tO=(0,tw.default)(()=>r.e(9947).then(r.bind(r,19947)),{loadableGenerated:{webpack:()=>[19947]},ssr:!1}),tW=(0,tw.default)(()=>Promise.all([r.e(2851),r.e(2737),r.e(6947)]).then(r.bind(r,52285)),{loadableGenerated:{webpack:()=>[52285]},ssr:!1}),tB=(0,tw.default)(()=>r.e(6728).then(r.bind(r,54347)),{loadableGenerated:{webpack:()=>[54347]},ssr:!1}),t_=(0,tw.default)(()=>r.e(5840).then(r.bind(r,85840)),{loadableGenerated:{webpack:()=>[85840]},ssr:!1}),tU=()=>{};function tH({fileTree:e,children:t}){let r=function(){let[e,t]=(0,a.useState)("files"),[r,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{try{"true"===localStorage.getItem("rail-expanded")&&l(!0)}catch{}},[]),(0,a.useEffect)(()=>{if(e){try{let e=localStorage.getItem("left-panel-width");if(e){let t=parseInt(e,10);if(t>=240&&t<=600)return void s(t)}}catch{}s(280)}},[e]),(0,a.useEffect)(()=>{i(!1)},[e]);let d=(0,a.useCallback)(e=>s(e),[]),c=(0,a.useCallback)(e=>{try{localStorage.setItem("left-panel-width",String(e))}catch{}},[]),u=(0,a.useCallback)(()=>i(e=>!e),[]),m=(0,a.useCallback)(e=>{l(e);try{localStorage.setItem("rail-expanded",String(e))}catch{}},[]),x=null!==e,p=r??(e?es[e]:280);return{activePanel:e,setActivePanel:t,panelWidth:r,panelMaximized:n,railExpanded:o,railWidth:o?180:48,panelOpen:x,effectivePanelWidth:p,handlePanelWidthChange:d,handlePanelWidthCommit:c,handlePanelMaximize:u,handleExpandedChange:m}}(),i=function(){let[e,t]=(0,a.useState)(!1),[r,s]=(0,a.useState)(380),[n,i]=(0,a.useState)("panel"),[o,l]=(0,a.useState)(!1),[d,c]=(0,a.useState)(""),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(!1);(0,a.useLayoutEffect)(()=>{x.current=u},[u]);let[p,g]=(0,a.useState)("user"),[h,f]=(0,a.useState)(null),b=(0,a.useRef)(380),v=(0,eU.KT)();(0,a.useEffect)(()=>{try{let e=localStorage.getItem("right-ask-panel-width");if(e){let t=parseInt(e,10);t>=320&&t<=4e3?(s(t),b.current=t):t>4e3&&(s(380),b.current=380)}let t=localStorage.getItem("ask-mode");"popup"===t&&i("popup")}catch{}let e=e=>{"ask-mode"===e.key&&("panel"===e.newValue||"popup"===e.newValue)&&i(e.newValue)};window.addEventListener("storage",e);let r=()=>{t(!0),x.current&&(m(!1),s(b.current))};return window.addEventListener("mindos:open-ask-panel",r),()=>{window.removeEventListener("storage",e),window.removeEventListener("mindos:open-ask-panel",r)}},[]),(0,a.useEffect)(()=>{v.open&&(c(v.initialMessage),g(v.source),f(v.acpAgent),"popup"===n?l(!0):t(!0),v.close())},[v.open,v.initialMessage,v.source,v.acpAgent,v.close,n]);let y=(0,a.useCallback)(()=>{"popup"===n?l(e=>(e||(c(""),g("user"),f(null)),!e)):t(e=>(e||(c(""),g("user"),f(null)),!e))},[n]),j=(0,a.useCallback)(()=>{t(!1),u&&(s(b.current),m(!1))},[u]),w=(0,a.useCallback)(()=>{m(e=>(e?s(b.current):b.current=r,!e))},[r]),k=(0,a.useCallback)(()=>l(!1),[]),N=(0,a.useCallback)(e=>s(e),[]);return{askPanelOpen:e,askPanelWidth:r,askMaximized:u,askMode:n,desktopAskPopupOpen:o,askInitialMessage:d,askOpenSource:p,askAcpAgent:h,toggleAskPanel:y,closeAskPanel:j,closeDesktopAskPopup:k,handleAskWidthChange:N,handleAskWidthCommit:(0,a.useCallback)(e=>{try{localStorage.setItem("right-ask-panel-width",String(e))}catch{}},[]),handleAskModeSwitch:(0,a.useCallback)(()=>{i(e=>{let r="panel"===e?"popup":"panel";try{localStorage.setItem("ask-mode",r),window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:r}))}catch{}return"popup"===r?(t(!1),l(!0)):(l(!1),t(!0)),r})},[]),toggleAskMaximized:w}}(),[x,p]=(0,a.useState)(!1),[g,h]=(0,a.useState)(void 0),[f,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),[w,k]=(0,a.useState)(null),[N,S]=(0,a.useState)(()=>{try{let e=localStorage.getItem("right-agent-detail-panel-width");if(e){let t=parseInt(e,10);if(t>=300&&t<=640)return t}}catch{}return 400}),C=(0,tI.dB)(),[z,E]=(0,a.useState)(!1),[$,D]=(0,a.useState)(0);(0,a.useEffect)(()=>{("organizing"===C.phase||"done"===C.phase||"error"===C.phase)&&E(!0)},[C.phase]);let P=(0,a.useCallback)(()=>{E(!1),"organizing"!==C.phase||C.abort(),C.reset()},[C]),R=(0,a.useCallback)(()=>{D(e=>e+1),window.dispatchEvent(new Event("mindos:organize-history-update"))},[]),[F,L]=(0,a.useState)(!1),[O,W]=(0,a.useState)(void 0),[B,_]=(0,a.useState)(void 0),[U,H]=(0,a.useState)(!1),X=(0,a.useRef)(0),K=(0,a.useCallback)(e=>{W(e),_(void 0),L(!0)},[]),G=(0,a.useCallback)(()=>{L(!1),W(void 0),_(void 0)},[]),[Y,q]=(0,a.useState)(!1),[V,J]=(0,a.useState)(!1),[Q,ee]=(0,a.useState)(!1),{t:et}=(0,j.Y)(),er=(0,n.useRouter)(),ea=(0,n.usePathname)(),ei=(0,a.useMemo)(()=>{let t=tj.startTimer("sidebar.collect_dir_paths"),r=function e(t,r=""){let s=[];for(let n of t)if("directory"===n.type&&!n.name.startsWith(".")){let t=r?`${r}/${n.name}`:n.name;s.push(t),n.children&&s.push(...e(n.children,t))}return s}(e);return t({nodeCount:e.length,pathCount:r.length}),r},[e]),{status:eo,fetchStatus:el}=A(),ec=ea.startsWith("/view/")?ea.slice(6).split("/").map(decodeURIComponent).join("/"):void 0;(0,a.useEffect)(()=>{i.askMaximized&&i.toggleAskMaximized()},[ea,r.panelOpen]);let eu=(0,a.useCallback)(()=>{i.askMaximized&&i.toggleAskMaximized()},[i.askMaximized,i.toggleAskMaximized]);(0,a.useEffect)(()=>{"/"===ea&&i.askPanelOpen&&i.closeAskPanel()},[ea]);let em=ea?.startsWith("/agents"),ex=r.activePanel??(em?"agents":null);(0,a.useEffect)(()=>{let e=e=>{let t=e.detail?.tab;t&&h(t),p(!0)};return window.addEventListener("mindos:open-settings",e),()=>window.removeEventListener("mindos:open-settings",e)},[]),(0,a.useEffect)(()=>{let e=()=>K();return window.addEventListener("mindos:open-import",e),()=>window.removeEventListener("mindos:open-import",e)},[K]);let ep=(0,a.useRef)([]);(0,a.useEffect)(()=>{let e=e=>{let t=e.detail?.files;if(!t||0===t.length||"organizing"===C.phase)return;let r=et.inbox.organizePrompt(t.map(e=>e.name));ep.current=t.map(e=>e.name),(async()=>{let e=[];for(let r of t)try{let t=await fetch(`/api/file?path=${encodeURIComponent(r.path)}`);if(t.ok){let s=await t.json();e.push({name:r.name,content:s.content??""})}}catch{}e.length>0?C.start(e,r,"inbox-organize"):(e7.oR.error(et.inbox.organizeFailed,4e3),window.dispatchEvent(new Event("mindos:organize-done")))})()};return window.addEventListener("mindos:inbox-organize",e),()=>window.removeEventListener("mindos:inbox-organize",e)},[C,et]),(0,a.useEffect)(()=>{let e=e=>{let t=e.detail;if(!t?.content||"organizing"===C.phase)return;let r={name:t.name,content:t.content};C.start([r],"Organize this conversation into well-structured notes in my knowledge base. Extract key insights, decisions, action items, and important details. Create appropriate files with clear titles. Write in the same language as the content.","conversation")};return window.addEventListener("mindos:session-organize",e),()=>window.removeEventListener("mindos:session-organize",e)},[C]),(0,a.useEffect)(()=>{if("done"===C.phase){let e=C.changes.some(e=>e.ok),t=ep.current;e&&t.length>0&&(fetch("/api/inbox",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:t})}).then(()=>{window.dispatchEvent(new Event("mindos:inbox-updated"))}).catch(()=>{}),ep.current=[]),window.dispatchEvent(new Event("mindos:organize-done"))}else"error"===C.phase&&window.dispatchEvent(new Event("mindos:organize-done"))},[C.phase,C.changes]),(0,a.useEffect)(()=>{let e=e=>{let t=e.detail?.panel;t&&r.setActivePanel(t)};return window.addEventListener("mindos:open-panel",e),()=>window.removeEventListener("mindos:open-panel",e)},[r]);let eg=(0,a.useCallback)(()=>{let e=()=>window.dispatchEvent(new Event("guide-state-updated"));"guide"===i.askOpenSource?fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{askedAI:!0}})}).then(e).catch(e=>console.warn("Guide state update failed:",e)):"guide-next"===i.askOpenSource&&e()},[i.askOpenSource]);(0,a.useEffect)(()=>{let e=requestAnimationFrame(()=>q(!1));return()=>cancelAnimationFrame(e)},[ea]),(0,a.useEffect)(()=>{ea?.startsWith("/echo")&&r.setActivePanel("echo")},[ea,r.setActivePanel]);let eh=(0,a.useCallback)(e=>{S(e);try{localStorage.setItem("right-agent-detail-panel-width",String(e))}catch{}},[]),ef=(0,a.useCallback)(()=>k(null),[]),eb=null!==w&&"agents"===r.activePanel;(0,a.useEffect)(()=>{let e=-1,t=!1,r=0,s=null,n=(e,t)=>{r=Date.now();let s=tj.startTimer("tree.refresh.trigger");(0,a.startTransition)(()=>{er.refresh()}),s({previousVersion:t,version:e,reason:"tree_version_changed"}),window.dispatchEvent(new Event("mindos:files-changed"))},i=async()=>{if(t||"hidden"===document.visibilityState)return;let a=tj.startTimer("tree.version.poll");try{let i=await fetch("/api/tree-version");if(!i.ok)return void a({ok:!1,changed:!1});let{v:o}=await i.json();if(-1===e){e=o,a({ok:!0,changed:!1,version:o,initial:!0});return}if(o!==e){let i=e;e=o;let l=Date.now()-r;l<2e3?(s&&clearTimeout(s),s=setTimeout(()=>{s=null,t||n(o,i)},2e3-l),a({ok:!0,changed:!0,previousVersion:i,version:o,deferred:!0})):(n(o,i),a({ok:!0,changed:!0,previousVersion:i,version:o}));return}a({ok:!0,changed:!1,version:o})}catch(e){a({ok:!1,changed:!1}),console.debug("[tree-version] poll failed",e)}},o=()=>{"visible"===document.visibilityState&&i()};i();let l=setInterval(()=>void i(),5e3);return document.addEventListener("visibilitychange",o),()=>{t=!0,clearInterval(l),s&&clearTimeout(s),document.removeEventListener("visibilitychange",o)}},[er]),(0,a.useEffect)(()=>{let e=e=>{if("Escape"===e.key){if(r.panelMaximized)return void r.handlePanelMaximize();if(eb)return void k(null);if(i.askPanelOpen)return void i.closeAskPanel();if(i.desktopAskPopupOpen)return void i.closeDesktopAskPopup()}(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),window.innerWidth>=768?r.setActivePanel(e=>"search"===e?null:"search"):J(e=>!e)),(e.metaKey||e.ctrlKey)&&"/"===e.key&&(e.preventDefault(),window.innerWidth>=768?i.toggleAskPanel():ee(e=>!e)),(e.metaKey||e.ctrlKey)&&","===e.key&&(e.preventDefault(),p(e=>!e)),(e.metaKey||e.ctrlKey)&&"i"===e.key&&(e.preventDefault(),L(e=>!e))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eb,r,i]);let ev=(0,a.useCallback)(()=>{h("sync"),b(!1),p(!0)},[]),ey=(0,a.useCallback)(()=>{p(!0),h(void 0)},[]),ej=(0,a.useCallback)(()=>{p(!1),h(void 0)},[]),ew=(0,a.useCallback)(e=>{y(e),b(e=>!e)},[]),ek=(0,a.useCallback)(e=>{r.handleExpandedChange(e),b(!1)},[r]),eN=(0,a.useCallback)(()=>q(!1),[]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tk,{}),(0,s.jsx)(tM,{}),(0,s.jsx)("a",{href:"#main-content",className:"sr-only focus-visible:not-sr-only focus-visible:fixed focus-visible:top-2 focus-visible:left-2 focus-visible:z-[60] focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:text-sm focus-visible:font-medium bg-[var(--amber)] text-[var(--amber-foreground)]",children:"Skip to main content"}),(0,s.jsx)(I,{activePanel:ex,onPanelChange:r.setActivePanel,onEchoClick:()=>{eu();let e="echo"===r.activePanel,t=ea?.startsWith("/echo");e?t?r.setActivePanel(null):er.push("/echo/about-you"):(r.setActivePanel("echo"),er.push("/echo/about-you"))},onAgentsClick:()=>{eu();let e="agents"===r.activePanel,t=ea?.startsWith("/agents");e?t?r.setActivePanel(null):er.push("/agents"):(r.setActivePanel("agents"),er.push("/agents")),k(null)},onDiscoverClick:()=>{eu();let e="discover"===r.activePanel,t=ea?.startsWith("/explore");e?t?r.setActivePanel(null):er.push("/explore"):(r.setActivePanel("discover"),er.push("/explore"))},onSpacesClick:()=>{eu();let e="/"===ea,t="files"===r.activePanel,s="/wiki"===ea||ea?.startsWith("/view/")||ea?.startsWith("/wiki/");e||!t?(r.setActivePanel("files"),er.push("/wiki")):s?r.setActivePanel(null):er.push("/wiki")},syncStatus:eo,expanded:r.railExpanded,onExpandedChange:ek,onSettingsClick:ey,onSyncClick:ew}),(0,s.jsxs)(en,{activePanel:r.activePanel,fileTree:e,onNavigate:tU,onOpenSyncSettings:ev,railWidth:r.railWidth,panelWidth:r.panelWidth??void 0,onWidthChange:r.handlePanelWidthChange,onWidthCommit:r.handlePanelWidthCommit,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize,onImport:K,children:[(0,s.jsx)("div",{className:`flex flex-col h-full ${"echo"===r.activePanel?"":"hidden"}`,children:(0,s.jsx)(e0,{active:"echo"===r.activePanel,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize})}),(0,s.jsx)("div",{className:`flex flex-col h-full ${"search"===r.activePanel?"":"hidden"}`,children:(0,s.jsx)(ed,{active:"search"===r.activePanel,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize})}),(0,s.jsx)("div",{className:`flex flex-col h-full ${"agents"===r.activePanel?"":"hidden"}`,children:(0,s.jsx)(eM,{active:"agents"===r.activePanel,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize,selectedAgentKey:eb?w:null})}),(0,s.jsx)("div",{className:`flex flex-col h-full ${"discover"===r.activePanel?"":"hidden"}`,children:(0,s.jsx)(eY,{active:"discover"===r.activePanel,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize})}),(0,s.jsx)("div",{className:`flex flex-col h-full ${"workflows"===r.activePanel?"":"hidden"}`,children:(0,s.jsx)(e2,{active:"workflows"===r.activePanel,maximized:r.panelMaximized,onMaximize:r.handlePanelMaximize})})]}),(0,s.jsx)(e4,{open:i.askPanelOpen,onClose:i.closeAskPanel,currentFile:ec,initialMessage:i.askInitialMessage,initialAcpAgent:i.askAcpAgent,onFirstMessage:eg,width:i.askPanelWidth,onWidthChange:i.handleAskWidthChange,onWidthCommit:i.handleAskWidthCommit,askMode:i.askMode,onModeSwitch:i.handleAskModeSwitch,maximized:i.askMaximized,onMaximize:i.toggleAskMaximized,sidebarOffset:r.panelOpen?r.railWidth+r.effectivePanelWidth:r.railWidth}),(0,s.jsx)(tr,{open:eb,agentKey:w,onClose:ef,rightOffset:i.askPanelOpen?i.askPanelWidth:0,width:N,onWidthChange:S,onWidthCommit:eh}),(0,s.jsx)(tO,{open:i.desktopAskPopupOpen,onClose:i.closeDesktopAskPopup,currentFile:ec,initialMessage:i.askInitialMessage,initialAcpAgent:i.askAcpAgent,onFirstMessage:eg,askMode:i.askMode,onModeSwitch:i.handleAskModeSwitch}),(0,s.jsx)(tn,{onToggle:i.toggleAskPanel,askPanelOpen:i.askPanelOpen||i.desktopAskPopupOpen}),(0,s.jsx)(ti,{}),(0,s.jsx)(tW,{open:x,onClose:ej,initialTab:g}),(0,s.jsx)(ta,{open:f,onClose:()=>b(!1),anchorRect:v,railWidth:r.railWidth,onOpenSyncSettings:ev,syncStatus:eo,onSyncStatusRefresh:el}),(0,s.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 z-30 bg-card border-b border-border flex items-center justify-between px-3 py-2",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,s.jsx)("button",{onClick:()=>q(!0),className:"p-3 -ml-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":"Open menu",children:(0,s.jsx)(l.A,{size:20})}),(0,s.jsxs)(o(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,s.jsx)(T.A,{id:"mobile"}),(0,s.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:ev,className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent flex items-center justify-center","aria-label":"Sync status",children:(0,s.jsx)(M,{status:eo})}),(0,s.jsx)("button",{onClick:()=>J(!0),className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":et.sidebar.searchTitle,children:(0,s.jsx)(d.A,{size:20})}),(0,s.jsx)("button",{onClick:()=>{p(!0),h(void 0)},className:"p-3 -mr-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":et.sidebar.settingsTitle,children:(0,s.jsx)(c.A,{size:20})})]})]}),Y&&(0,s.jsx)("div",{className:"md:hidden fixed inset-0 z-40 overlay-backdrop",onClick:()=>q(!1)}),(0,s.jsxs)("aside",{className:`md:hidden fixed top-0 left-0 h-screen w-[85vw] max-w-[320px] z-50 bg-card border-r border-border flex flex-col transition-transform duration-300 ease-in-out ${Y?"translate-x-0":"-translate-x-full"}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[(0,s.jsxs)(o(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,s.jsx)(T.A,{id:"drawer"}),(0,s.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,s.jsx)("button",{onClick:()=>q(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,s.jsx)(u.A,{size:16})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",children:(0,s.jsx)(Z.Ay,{nodes:e,onNavigate:eN,onImport:K})})]}),(0,s.jsx)(tL,{open:V,onClose:()=>J(!1)}),(0,s.jsx)(tO,{open:Q,onClose:()=>ee(!1),currentFile:ec}),(0,s.jsxs)("main",{id:"main-content",className:"min-h-screen transition-all duration-200 pt-[52px] md:pt-0",onDragEnter:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),X.current++,1===X.current&&H(!0))},onDragOver:e=>{e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDragLeave:()=>{X.current=Math.max(0,X.current-1),0===X.current&&H(!1)},onDrop:e=>{e.preventDefault(),X.current=0,H(!1),e.dataTransfer.files.length>0&&!F&&(0,tF.QL)(Array.from(e.dataTransfer.files),et)},children:[(0,s.jsxs)("div",{className:"min-h-screen bg-background",style:{overflowX:"clip"},children:[(0,s.jsx)(to,{}),t]}),(0,s.jsx)(tc,{}),(0,s.jsx)(tB,{t:et,dirPaths:ei}),U&&!F&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm transition-opacity duration-200",children:(0,s.jsxs)("div",{className:"border-2 border-dashed border-[var(--amber)]/50 rounded-xl p-12 flex flex-col items-center gap-3",children:[(0,s.jsx)(m.A,{size:48,className:"text-[var(--amber)]/60"}),(0,s.jsx)("p",{className:"text-sm text-foreground font-medium",children:et.inbox.dropOverlay}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:et.inbox.dropOverlayFormats})]})})]}),(0,s.jsx)(t_,{open:F,onClose:G,defaultSpace:O,initialFiles:B,aiOrganize:C,dirPaths:ei}),z&&(0,s.jsx)(tb,{aiOrganize:C,onDismiss:P,onCancel:()=>{C.abort(),C.reset(),E(!1)},onHistoryUpdate:R}),(0,s.jsx)("style",{children:`
71
- @media (min-width: 768px) {
72
- :root {
73
- --right-panel-width: ${i.askMaximized?`calc(100vw - ${r.panelOpen?r.railWidth+r.effectivePanelWidth:r.railWidth}px)`:`${i.askPanelOpen?i.askPanelWidth:0}px`};
74
- --right-agent-detail-width: ${eb?N:0}px;
75
- }
76
- #main-content {
77
- padding-left: ${r.panelOpen&&r.panelMaximized?"100vw":`${r.panelOpen?r.railWidth+r.effectivePanelWidth:r.railWidth}px`} !important;
78
- padding-right: calc(var(--right-panel-width) + var(--right-agent-detail-width) + var(--toc-extra-right, 0px)) !important;
79
- padding-top: 0;
80
- }
81
- }
82
- `})]})}function tX({fileTree:e,children:t}){let r=(0,n.usePathname)(),[i,o]=(0,a.useState)(e);return((0,a.useLayoutEffect)(()=>{o(t=>(function e(t,r){if(t===r)return r;let s=new Map;for(let e of r)s.set(e.path,e);let n=!0,a=Array(t.length);for(let i=0;i<t.length;i++){let o=i<r.length&&r[i].path===t[i].path?r[i]:s.get(t[i].path),l=function(t,r){if(!r||t.path!==r.path||t.type!==r.type||t.name!==r.name||t.extension!==r.extension||t.isSpace!==r.isSpace)return t;if(t.children&&r.children){let s=e(t.children,r.children);return s===r.children&&t.name===r.name&&(t.spacePreview===r.spacePreview||t.spacePreview&&r.spacePreview&&t.spacePreview.lastCompiled===r.spacePreview.lastCompiled&&t.spacePreview.isTemplate===r.spacePreview.isTemplate)?r:{...t,children:s}}return r}(t[i],o);a[i]=l,l!==r[i]&&(n=!1)}return n&&t.length===r.length?r:a})(e,t))},[e]),"/login"===r)?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsx)(tH,{fileTree:i,children:t})}},79726:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var s=r(66839),n=r(44223),a=r(76723),i=r(21082),o=r(53097),l=r(72799),d=r(79455);let c={success:(0,s.jsx)(a.A,{size:15,className:"text-success shrink-0"}),error:(0,s.jsx)(i.A,{size:15,className:"text-error shrink-0"}),info:(0,s.jsx)(o.A,{size:15,className:"text-muted-foreground shrink-0"})};function u(){let e=(0,n.useSyncExternalStore)(d.B1,d.dV,d.dV);return 0===e.length?null:(0,s.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none",role:"status","aria-live":"polite","aria-atomic":"false",children:e.map(e=>(0,s.jsxs)("div",{className:"pointer-events-auto flex items-center gap-2.5 bg-card border border-border rounded-lg shadow-lg px-4 py-2.5 min-w-[180px] max-w-[320px] animate-in slide-in-from-right-4 fade-in duration-200",children:[c[e.type],(0,s.jsx)("span",{className:"text-sm text-foreground flex-1 truncate",children:e.message}),e.action&&(0,s.jsx)("button",{type:"button",onClick:()=>{e.action.onClick(),(0,d.X8)(e.id)},className:"shrink-0 px-2.5 py-1 rounded text-xs font-medium text-[var(--amber)] hover:bg-[var(--amber-dim)] transition-colors min-h-[28px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:e.action.label}),(0,s.jsx)("button",{type:"button",onClick:()=>(0,d.X8)(e.id),className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":e.action?.label?"Close":"Dismiss",children:(0,s.jsx)(l.A,{size:13})})]},e.id))})}},80250:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var s=r(66839),n=r(44223),a=r(38688),i=r(44361),o=r(2073);let l="mindos_update_in_progress";function d(){let[e,t]=(0,n.useState)(!1),[r,d]=(0,n.useState)(!1),c=(0,n.useRef)(void 0),{locale:u}=(0,o.Y)(),m="zh"===u,x=(0,n.useCallback)(()=>{c.current=setInterval(async()=>{try{if((await fetch("/api/health",{signal:AbortSignal.timeout(3e3)})).ok){clearInterval(c.current),c.current=void 0;try{let e=localStorage.getItem(l);if(e){let{originalVer:t}=JSON.parse(e),r=await fetch("/api/update-check",{signal:AbortSignal.timeout(5e3)}).then(e=>e.json());if(r.current&&r.current!==t){d(!0),localStorage.removeItem(l),localStorage.removeItem("mindos_update_latest"),localStorage.removeItem("mindos_update_dismissed"),setTimeout(()=>window.location.reload(),1500);return}}}catch{}localStorage.removeItem(l),window.location.reload()}}catch{}},3e3)},[]);return((0,n.useEffect)(()=>{let e=()=>{localStorage.getItem(l)&&(t(!0),c.current||x())};e();let r=()=>e();return window.addEventListener("mindos:update-started",r),window.addEventListener("storage",r),()=>{clearInterval(c.current),c.current=void 0,window.removeEventListener("mindos:update-started",r),window.removeEventListener("storage",r)}},[x]),e)?(0,s.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:99999,background:"rgba(0,0,0,0.7)",backdropFilter:"blur(8px)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-ui)"},children:[r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.A,{size:32,style:{color:"var(--success)",marginBottom:12}}),(0,s.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"更新成功!":"Update Complete!"}),(0,s.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6},children:m?"正在刷新页面...":"Reloading..."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{size:32,style:{color:"var(--amber)",marginBottom:12,animation:"spin 1s linear infinite"}}),(0,s.jsx)("div",{style:{color:"var(--foreground)",fontSize:18,fontWeight:600},children:m?"MindOS 正在更新...":"MindOS is Updating..."}),(0,s.jsx)("div",{style:{color:"var(--muted-foreground)",fontSize:13,marginTop:6,textAlign:"center",maxWidth:300,lineHeight:1.5},children:m?"服务正在重启,请勿关闭此页面。完成后将自动刷新。":"The server is restarting. Please do not close this page. It will auto-reload when ready."})]}),(0,s.jsx)("style",{children:"@keyframes spin { to { transform: rotate(360deg) } }"})]}):null}},82977:(e,t,r)=>{"use strict";r.d(t,{Gj:()=>a,ZD:()=>n,v7:()=>i});let s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function n(e){return e.replace(/[&<>"']/g,e=>s[e])}function a(e){return n(e).replace(/`/g,"&#96;")}function i(e){let t=e.replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim(),r=t.replace(/[\u0000-\u001f\u007f\s]+/g,"").toLowerCase();return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("mailto:")||t.startsWith("/")&&!t.startsWith("//")||t.startsWith("#")?a(t):"#"}},84962:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GraphRenderer:()=>c});var s=r(66839),n=r(44223),a=r(56261),i=r(33378),o=r(28128);r(34071);var l=r(65264);let d=(0,n.memo)(function({data:e}){let t=(0,a.useRouter)(),{label:r,id:l,isCurrent:d,isOrphan:c,size:u=1}=e,m=(0,n.useCallback)(()=>{let e=l.split("/").map(encodeURIComponent).join("/");t.push("/view/"+e)},[l,t]),x=.8+Math.min(.1*u,1.2);return(0,s.jsxs)("div",{onClick:m,title:l,className:"group font-display",style:{fontSize:10*x,padding:`${4*x}px ${12*x}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:c?.4:1,background:d?"var(--amber)":"var(--card)",color:d?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${d?"var(--amber)":"var(--border)"}`,boxShadow:d?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:d?10:1},onMouseEnter:e=>{d||(e.currentTarget.style.borderColor="var(--amber)",e.currentTarget.style.background="var(--accent)")},onMouseLeave:e=>{d||(e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.background="var(--card)")},children:[(0,s.jsx)(i.h7,{type:"target",position:o.yX.Top,style:{opacity:0}}),r,(0,s.jsx)(i.h7,{type:"source",position:o.yX.Bottom,style:{opacity:0}})]})});function c({filePath:e}){let[t,r]=(0,n.useState)(null),[a,o]=(0,n.useState)(!0),[c,u]=(0,n.useState)("local"),[m,x]=(0,n.useState)(!1);(0,n.useEffect)(()=>{x(!0)},[]),(0,n.useEffect)(()=>{(0,l.n)("/api/graph").then(e=>{r(e),o(!1)}).catch(()=>o(!1))},[]);let p=(0,n.useMemo)(()=>{if(!t)return new Map;let e=new Map;for(let r of t.edges)e.set(r.source,(e.get(r.source)||0)+1),e.set(r.target,(e.get(r.target)||0)+1);return e},[t]),g=(0,n.useMemo)(()=>{if(!t)return null;let e=new Map;for(let r of t.edges)e.has(r.source)||e.set(r.source,new Set),e.has(r.target)||e.set(r.target,new Set),e.get(r.source).add(r.target),e.get(r.target).add(r.source);return e},[t]),{filteredNodes:h,filteredEdges:f}=(0,n.useMemo)(()=>{let r,s;if(!t)return{filteredNodes:[],filteredEdges:[]};if("global"===c)r=t.nodes,s=t.edges;else{let n=new Set,a=[{id:e,depth:0}];for(n.add(e);a.length>0;){let{id:e,depth:t}=a.shift();if(!(t>=2))for(let r of g?.get(e)??new Set)n.has(r)||(n.add(r),a.push({id:r,depth:t+1}))}let i=new Set((r=t.nodes.filter(e=>n.has(e.id))).map(e=>e.id));s=t.edges.filter(e=>i.has(e.source)&&i.has(e.target))}return{filteredNodes:r,filteredEdges:s}},[t,c,e,g]),b=(0,n.useMemo)(()=>{let e=new Set;for(let t of f)e.add(t.source),e.add(t.target);return e},[f]),{rfNodes:v,rfEdges:y}=(0,n.useMemo)(()=>{if(0===h.length)return{rfNodes:[],rfEdges:[]};let t=function(e,t,r){let s=e.length;if(0===s)return{};let n=(void 0)??(s>100?80:150),a=.6*Math.sqrt(108e4/Math.max(s,1)),i={};e.forEach((e,t)=>{let r=2*Math.PI*t/s,n=360*Math.random();i[e]={x:600+Math.cos(r)*n,y:450+Math.sin(r)*n}});let o={};for(let r=0;r<n;r++){let l=120*(1-r/n);for(let t of e)o[t]={x:0,y:0};for(let t=0;t<s;t++)for(let r=t+1;r<s;r++){let s=e[t],n=e[r],l=i[s].x-i[n].x,d=i[s].y-i[n].y,c=Math.sqrt(l*l+d*d||.01),u=a*a/c;o[s].x+=l/c*u,o[s].y+=d/c*u,o[n].x-=l/c*u,o[n].y-=d/c*u}for(let e of t){let t=e.source,r=e.target;if(!i[t]||!i[r])continue;let s=i[t].x-i[r].x,n=i[t].y-i[r].y,l=Math.sqrt(s*s+n*n||.01),d=l*l/a;o[t].x-=s/l*d,o[t].y-=n/l*d,o[r].x+=s/l*d,o[r].y+=n/l*d}for(let t of e){let e=i[t].x-600,r=i[t].y-450,s=Math.sqrt(e*e+r*r)||.01,n=.05*s;o[t].x-=e/s*n,o[t].y-=r/s*n}for(let t of e){let e=o[t],r=Math.sqrt(e.x*e.x+e.y*e.y)||.01;i[t].x+=e.x/r*Math.min(r,l),i[t].y+=e.y/r*Math.min(r,l),i[t].x=Math.max(0,Math.min(1200,i[t].x)),i[t].y=Math.max(0,Math.min(900,i[t].y))}}return i}(h.map(e=>e.id),f);return{rfNodes:h.map(r=>({id:r.id,type:"wiki",position:t[r.id]??{x:0,y:0},data:{label:r.label,id:r.id,isCurrent:r.id===e,isOrphan:!b.has(r.id),size:p.get(r.id)||1}})),rfEdges:f.map((t,r)=>{let s=t.source===e||t.target===e;return{id:`e-${r}`,source:t.source,target:t.target,type:"default",markerEnd:{type:"arrowclosed",color:s?"var(--amber)":"var(--border)"},style:{stroke:s?"var(--amber)":"var(--border)",strokeWidth:s?1.5:1,opacity:s?.8:.4},animated:s}})}},[h,f,e,b,p]),j=(0,n.useMemo)(()=>({wiki:d}),[]);return!m||a?(0,s.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:a?"Building graph…":"Loading…"})}):(0,s.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,s.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[h.length," nodes \xb7 ",f.length," edges"]}),(0,s.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(e=>(0,s.jsx)("button",{onClick:()=>u(e.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:c===e.id?"var(--card)":"transparent",color:c===e.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:c===e.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:e.label},e.id))})]}),(0,s.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,s.jsxs)(i.Gc,{nodes:v,edges:y,nodeTypes:j,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,s.jsx)(i.VS,{color:"var(--border)",gap:24,size:1,variant:i._5.Dots}),(0,s.jsx)(i.H2,{showInteractive:!1}),(0,s.jsx)(i.of,{nodeColor:e=>e.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},85130:(e,t,r)=>{"use strict";r.d(t,{AI:()=>n,RS:()=>s});let s=["imprint","growth","self"],n={imprint:"/echo/imprint",growth:"/echo/growth",self:"/echo/self"}},90454:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TimelineRenderer:()=>c,renderBody:()=>l});var s=r(66839),n=r(44223),a=r(82977);let i=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function o(e){return(0,a.ZD)(e).replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,t,r)=>`<span style="color:var(--amber);cursor:pointer" title="${(0,a.Gj)(t)}">${r??t}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,r)=>`<a href="${(0,a.v7)(r)}" style="color:var(--amber)">${t}</a>`)}function l(e){let t=e.split("\n"),r=[],s=!1,n=()=>{s&&(r.push("</ul>"),s=!1)};for(let e of t){let t=e.trimEnd();if(!t){n(),r.push("<br/>");continue}if(/^### /.test(t)){n(),r.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${o(t.slice(4))}</h3>`);continue}if(/^- /.test(t)||/^\* /.test(t)){s||(r.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),s=!0),r.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${o(t.slice(2))}</li>`);continue}if(/^\d+\. /.test(t)){s||(r.push('<ol style="margin:.3em 0;padding-left:1.2em">'),s=!0),r.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${o(t.replace(/^\d+\. /,""))}</li>`);continue}n(),r.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${o(t)}</p>`)}return n(),r.join("")}let d=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"}];function c({content:e}){let t=(0,n.useMemo)(()=>(function(e){let t=e.split("\n"),r=[],s=null,n=[],a=()=>{let e,t;if(!s)return;let a=n.join("\n").trim();s.body=a,s.tags=(e=[],(t=a.match(/#([\w\u4e00-\u9fff]+)/g))&&e.push(...t.map(e=>e.slice(1))),[...new Set(e)]),r.push(s),s=null,n=[]};for(let e of t)if(!/^# /.test(e)){if(/^## /.test(e)){a();let t=e.slice(3).trim();s={heading:t,date:function(e){let t=i.exec(e);if(!t)return null;let r=new Date(t[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(r.getTime())?null:r}(t),body:"",tags:[]};continue}s&&n.push(e)}return a(),r})(e),[e]);return 0===t.length?(0,s.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,s.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,s.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,s.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,s.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[t.length," ",1===t.length?"entry":"entries"]})}),(0,s.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,s.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),t.map((e,t)=>(0,s.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,s.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:e.date?"var(--amber)":"var(--border)",outline:e.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,s.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,s.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:e.heading}),e.date&&(0,s.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:e.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),e.body&&(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:l(e.body)}}),e.tags.length>0&&(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:e.tags.map(e=>{let t=function(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)&65535;return d[t%d.length]}(e);return(0,s.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:t.bg,color:t.text},children:["#",e]},e)})})]})]},t))]})]})}},91216:(e,t,r)=>{"use strict";r.d(t,{Un:()=>a});var s=r(44223);let n="mindos-renderer-state-change";function a(e,t,r){let a=`mindos-renderer:${e}:${t}`,i=(0,s.useRef)({key:a,raw:null,parsed:r});return[(0,s.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(n,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(n,t)}},()=>{try{i.current.key!==a&&(i.current={key:a,raw:null,parsed:r});let e=localStorage.getItem(a);if(e===i.current.raw)return i.current.parsed;if(null===e)return i.current={key:a,raw:null,parsed:r},r;let t=JSON.parse(e);return i.current={key:a,raw:e,parsed:t},t}catch{return r}},()=>r),(0,s.useCallback)(e=>{try{let t=(()=>{try{let e=localStorage.getItem(a);return null!==e?JSON.parse(e):r}catch{return r}})(),s="function"==typeof e?e(t):e,n=JSON.stringify(s);localStorage.setItem(a,n),i.current={key:a,raw:n,parsed:s}}catch{}window.dispatchEvent(new Event(n))},[a,r])]}},94866:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SummaryRenderer:()=>h,appendSummaryStreamChunk:()=>g,renderMarkdown:()=>p});var s=r(66839),n=r(44223),a=r(67885),i=r(19378),o=r(30401),l=r(12361),d=r(58221),c=r(65264),u=r(82977);function m(e){let t=Date.now()-e,r=Math.floor(t/6e4),s=Math.floor(t/36e5),n=Math.floor(t/864e5);return r<1?"just now":r<60?`${r}m ago`:s<24?`${s}h ago`:`${n}d ago`}function x(e){return e.split("/").pop()?.replace(/\.(md|csv)$/,"")??e}function p(e){return(0,u.ZD)(e).replace(/^### (.+)$/gm,'<h3 style="font-size:.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:1em 0 .3em">$1</h3>').replace(/^## (.+)$/gm,'<h2 style="font-size:.9rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h2>').replace(/^# (.+)$/gm,'<h1 style="font-size:1rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h1>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:.82em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/^[-*] (.+)$/gm,'<li style="margin:.2em 0;padding-left:.3em">$1</li>').replace(/(<li[^>]*>.*<\/li>\n?)+/g,e=>`<ul style="margin:.4em 0;padding-left:1.4em;list-style:disc">${e}</ul>`).replace(/\n{2,}/g,'</p><p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">').replace(/^(?!<[hulo])(.+)$/gm,'<p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">$1</p>')}function g(e,t){let r=e;for(let e of t.split("\n")){let t=e.match(/^data:(.+)$/);if(t){let e;try{e=JSON.parse(t[1])}catch{continue}if(e&&"object"==typeof e&&"type"in e){let t=e;if(("text_delta"===t.type||"thinking_delta"===t.type)&&"string"==typeof t.delta)r+=t.delta;else if("error"===t.type)throw Error(String(t.message||"Stream error"))}continue}let s=e.match(/^0:"((?:[^"\\]|\\.)*)"$/);s?r+=s[1].replace(/\\n/g,"\n").replace(/\\"/g,'"').replace(/\\\\/g,"\\"):!e||e.startsWith("d:")||e.startsWith("e:")||e.startsWith("0:")||(r+=e)}return r}function h({filePath:e}){let[t,r]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[f,b]=(0,n.useState)(!1),[v,y]=(0,n.useState)(""),[j,w]=(0,n.useState)(!1),k=(0,n.useRef)(null),N=(0,n.useMemo)(()=>p(u),[u]);async function S(){if(0===t.length)return;k.current?.abort();let e=new AbortController;k.current=e,h(""),y(""),b(!0),w(!1);let r=t.map(e=>e.path),s=t.map(e=>`- **${x(e.path)}** (${e.path}, modified ${m(e.mtime)})`).join("\n"),n=`You are summarizing recent changes in a personal knowledge base (MindOS).
83
-
84
- The following files were recently modified:
85
- ${s}
86
-
87
- Please provide a concise daily briefing in this format:
88
- 1. **Key changes**: What was added or updated in each file (1–2 sentences per file)
89
- 2. **Themes**: Any patterns or recurring topics across the changes
90
- 3. **Suggested next actions**: 2–3 actionable follow-ups based on the content
91
-
92
- Be specific. Reference actual content from the files. Keep the total response under 300 words.`;try{let t=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:n}],attachedFiles:r}),signal:e.signal});if(!t.ok)throw Error(`HTTP ${t.status}`);if(!t.body)throw Error("No response body");let s=t.body.getReader(),a=new TextDecoder,i="",o="";for(;;){let{done:e,value:t}=await s.read();if(e)break;let r=(o+=a.decode(t,{stream:!0})).split("\n");o=r.pop()??"",i=g(i,r.join("\n")),h(i)}o&&(i=g(i,o),h(i)),w(!0)}catch(e){e instanceof Error&&"AbortError"!==e.name&&y(e.message||"Failed to generate summary")}finally{b(!1)}}return(0,n.useEffect)(()=>{(0,c.n)("/api/recent-files?limit=8").then(e=>r(e.filter(e=>e.path.endsWith(".md")))).catch(e=>{console.warn("[SummaryRenderer] fetch recent-files failed:",e)})},[e]),(0,n.useEffect)(()=>()=>{k.current?.abort()},[]),(0,s.jsxs)("div",{className:"max-w-[720px] mx-auto py-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5 mb-6 flex-wrap",children:[(0,s.jsx)("span",{className:"font-display text-[11px] text-muted-foreground",children:t.length>0?`${t.length} recently modified files`:"Loading recent files…"}),(0,s.jsxs)("button",{onClick:S,disabled:f||0===t.length,className:`font-display summary-gen-btn ${f?"summary-gen-btn--busy":""}`,children:[f?(0,s.jsx)(a.A,{size:12,className:"animate-spin"}):(0,s.jsx)(i.A,{size:12}),f?"Generating…":j?"Regenerate":"Generate briefing"]})]}),t.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-6",children:t.map(e=>(0,s.jsxs)("a",{href:`/view/${(0,d.O0)(e.path)}`,className:"font-display summary-source-chip",title:e.path,children:[(0,s.jsx)(o.A,{size:10}),x(e.path),(0,s.jsxs)("span",{className:"opacity-50",children:[(0,s.jsx)(l.A,{size:9,className:"inline ml-0.5"})," ",m(e.mtime)]})]},e.path))}),v&&(0,s.jsx)("div",{className:"font-display px-3.5 py-2.5 rounded-lg bg-[var(--error)]/10 border border-[var(--error)]/30 text-[var(--error)] text-xs mb-4",children:v}),u?(0,s.jsxs)("div",{className:"bg-card border border-border rounded-[10px] px-5 py-[18px] relative",children:[f&&(0,s.jsx)("div",{className:"absolute top-3 right-3.5 w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse"}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:N}})]}):f||j||!(t.length>0)?null:(0,s.jsxs)("div",{className:"border border-dashed border-border rounded-[10px] px-6 py-10 text-center text-muted-foreground",children:[(0,s.jsx)(i.A,{size:28,className:"mx-auto mb-2.5 opacity-30 text-[var(--amber)]"}),(0,s.jsxs)("p",{className:"font-display text-xs",children:["Click ",(0,s.jsx)("strong",{className:"text-foreground",children:"Generate briefing"})," to summarize recent changes with AI."]})]}),(0,s.jsx)("style",{children:`
93
- .summary-gen-btn {
94
- display: flex; align-items: center; gap: 6px;
95
- padding: 5px 14px; border-radius: 7px; font-size: 12px;
96
- cursor: pointer; border: none;
97
- background: var(--amber); color: var(--amber-foreground);
98
- transition: opacity .15s;
99
- }
100
- .summary-gen-btn:disabled { cursor: not-allowed; opacity: 0.5; }
101
- .summary-gen-btn--busy { background: var(--muted); color: var(--muted-foreground); }
102
- .summary-source-chip {
103
- display: inline-flex; align-items: center; gap: 5px;
104
- padding: 3px 10px; border-radius: 999px; font-size: 0.7rem;
105
- background: var(--muted); color: var(--muted-foreground);
106
- text-decoration: none; border: 1px solid var(--border);
107
- transition: color .15s;
108
- }
109
- .summary-source-chip:hover { color: var(--foreground); }
110
- `})]})}},95878:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var s=r(44223),n=r(2073),a=r(54708);function i({ssrLocale:e}){return(0,s.useState)(()=>(n.D.getState().locale!==e&&n.D.setState({locale:e,t:a.D[e]}),null)),(0,s.useEffect)(()=>n.D.getState()._init(e),[e]),null}},98163:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var s=r(66839),n=r(44223),a=r(72799),i=r(2073);let o="mindos_update_skip_desktop",l="mindos_update_skip_core";function d(){let{t:e}=(0,i.Y)(),t=e.settings.update.updateToast,[r,d]=(0,n.useState)("hidden"),[c,u]=(0,n.useState)({}),m=(0,n.useRef)(null),[x,p]=(0,n.useState)(!1),g=(0,n.useRef)(new Set),h=(0,n.useRef)({}),f=(0,n.useCallback)(()=>{g.current.forEach(clearTimeout),g.current.clear()},[]),b=(0,n.useCallback)((e,t)=>{let r=setTimeout(()=>{g.current.delete(r),d(e)},t);g.current.add(r)},[]);(0,n.useEffect)(()=>{let e,t=(e=window,e.mindos?.checkUpdate?e.mindos:null);m.current=t,p(!!t)},[]),(0,n.useEffect)(()=>{let e=m.current;if(!e)return;f();let t=[],r=(e,t,r)=>{let s=localStorage.getItem(r);s&&!function(e,t){let r=e.split(".").map(Number),s=t.split(".").map(Number);for(let e=0;e<Math.max(r.length,s.length);e++){let t=r[e]??0,n=s[e]??0;if(t>n)return!0;if(t<n)break}return!1}(t,s)||h.current[e]!==t&&(h.current[e]=t,u(r=>({...r,[e]:{type:e,version:t}})),b("visible",1e4))};return e.onUpdateAvailable&&t.push(e.onUpdateAvailable(e=>{e?.version&&r("desktop",e.version,o)})),e.onCoreUpdateAvailable&&t.push(e.onCoreUpdateAvailable(e=>{e?.latest&&!e.ready&&r("core",e.latest,l)})),()=>{t.forEach(e=>e()),f()}},[x,f,b]),(0,n.useEffect)(()=>()=>f(),[f]);let v=(0,n.useCallback)(()=>{f(),window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"update"}})),d("dismissing"),b("hidden",200)},[f,b]),y=(0,n.useCallback)(()=>{f(),c.desktop&&localStorage.setItem(o,c.desktop.version),c.core&&localStorage.setItem(l,c.core.version),d("dismissing"),b("hidden",200)},[c,f,b]);if(!x||"hidden"===r)return null;let j=!!(c.desktop&&c.core),w=j?t.titleMultiple:c.desktop?t.titleSingle(t.desktopLabel,c.desktop.version):c.core?t.titleSingle(t.coreLabel,c.core.version):"",k=j?`${t.desktopLabel} v${c.desktop.version} \u00B7 ${t.coreLabel} v${c.core.version}`:"";return(0,s.jsx)("div",{role:"status","aria-live":"polite",className:`
111
- fixed bottom-14 left-14 z-40 pointer-events-none
112
- transition-all duration-200
113
- ${"visible"===r?"opacity-100 translate-y-0":"opacity-0 translate-y-2"}
114
- `,children:(0,s.jsxs)("div",{className:"pointer-events-auto flex flex-col gap-2.5 bg-card border border-border rounded-xl shadow-lg px-4 py-3 w-[290px]",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"mt-[5px] w-2 h-2 rounded-full bg-[var(--amber)] shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground leading-snug",children:w}),k&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:k})]}),(0,s.jsx)("button",{type:"button",onClick:y,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":"Dismiss",children:(0,s.jsx)(a.A,{size:13})})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:v,className:"flex-1 px-3 py-1.5 text-xs font-medium rounded-lg text-[var(--amber-foreground)] bg-[var(--amber)] hover:opacity-90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:t.viewDetails}),(0,s.jsx)("button",{type:"button",onClick:y,className:"flex-1 px-3 py-1.5 text-xs rounded-lg text-muted-foreground border border-border hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:j?t.skipAll:t.skipVersion})]})]})})}}},e=>{e.O(0,[4361,8738,5883,6435,3940,2130,8225,7156,7368,4937,4172,878,2288,4454,2073,5152,5191,5200,9479,1957,763,2669,5018,2330,7358],()=>e(e.s=28760)),_N_E=e.O()}]);