@geminilight/mindos 0.6.59 → 0.6.61

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 (360) 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 +23 -22
  4. package/_standalone/.next/build-manifest.json +2 -2
  5. package/_standalone/.next/cache/.previewinfo +1 -1
  6. package/_standalone/.next/cache/.rscinfo +1 -1
  7. package/_standalone/.next/cache/config.json +3 -3
  8. package/_standalone/.next/prerender-manifest.json +3 -3
  9. package/_standalone/.next/routes-manifest.json +6 -0
  10. package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
  11. package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/_standalone/.next/server/app/_global-error.html +2 -2
  13. package/_standalone/.next/server/app/_global-error.rsc +1 -1
  14. package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  15. package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/_standalone/.next/server/app/_not-found/page.js +1 -1
  21. package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
  24. package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
  25. package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
  26. package/_standalone/.next/server/app/agents/page.js +1 -1
  27. package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
  28. package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  29. package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
  30. package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
  31. package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
  32. package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
  33. package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
  34. package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
  35. package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
  36. package/_standalone/.next/server/app/api/acp/registry/route.js +1 -1
  37. package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
  38. package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
  39. package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
  40. package/_standalone/.next/server/app/api/agents/copy-skill/route.js +1 -0
  41. package/_standalone/.next/server/app/api/agents/copy-skill/route.js.nft.json +1 -0
  42. package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -0
  43. package/_standalone/.next/server/app/api/agents/custom/detect/route.js +1 -1
  44. package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
  45. package/_standalone/.next/server/app/api/agents/custom/route.js +1 -1
  46. package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
  47. package/_standalone/.next/server/app/api/ask/route.js +20 -9
  48. package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
  49. package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
  50. package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
  51. package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
  52. package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
  53. package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  54. package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
  55. package/_standalone/.next/server/app/api/extract-pdf/route.js +2 -2
  56. package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
  57. package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
  58. package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
  59. package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
  60. package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  61. package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  62. package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
  63. package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  64. package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
  65. package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  66. package/_standalone/.next/server/app/api/mcp/agents/route.js +1 -1
  67. package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
  68. package/_standalone/.next/server/app/api/mcp/install/route.js +1 -1
  69. package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
  70. package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
  71. package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
  72. package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  73. package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
  74. package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
  75. package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
  76. package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  77. package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  78. package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
  79. package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
  80. package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  81. package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
  82. package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
  83. package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
  84. package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
  85. package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
  86. package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
  87. package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  88. package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
  89. package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
  90. package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
  91. package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  92. package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
  93. package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
  94. package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  95. package/_standalone/.next/server/app/changes/page.js +2 -2
  96. package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
  97. package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
  98. package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
  99. package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
  100. package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
  101. package/_standalone/.next/server/app/echo/page.js +1 -1
  102. package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
  103. package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
  104. package/_standalone/.next/server/app/explore/page.js +1 -1
  105. package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
  106. package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
  107. package/_standalone/.next/server/app/help/page.js +1 -1
  108. package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
  109. package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  110. package/_standalone/.next/server/app/inbox/history/page.js +1 -1
  111. package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
  112. package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
  113. package/_standalone/.next/server/app/login/page.js +1 -1
  114. package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
  115. package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  116. package/_standalone/.next/server/app/page.js +1 -1
  117. package/_standalone/.next/server/app/page.js.nft.json +1 -1
  118. package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  119. package/_standalone/.next/server/app/setup/page.js +1 -1
  120. package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
  121. package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  122. package/_standalone/.next/server/app/trash/page.js +3 -3
  123. package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
  124. package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
  125. package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
  126. package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
  127. package/_standalone/.next/server/app/wiki/page.js +1 -1
  128. package/_standalone/.next/server/app/wiki/page.js.nft.json +1 -1
  129. package/_standalone/.next/server/app/wiki/page_client-reference-manifest.js +1 -1
  130. package/_standalone/.next/server/app-paths-manifest.json +23 -22
  131. package/_standalone/.next/server/chunks/1550.js +1 -1
  132. package/_standalone/.next/server/chunks/1750.js +1 -1
  133. package/_standalone/.next/server/chunks/3484.js +1 -1
  134. package/_standalone/.next/server/chunks/530.js +33 -33
  135. package/_standalone/.next/server/chunks/6539.js +1 -1
  136. package/_standalone/.next/server/chunks/{8343.js → 8955.js} +3 -3
  137. package/_standalone/.next/server/pages/500.html +2 -2
  138. package/_standalone/.next/server/server-reference-manifest.js +1 -1
  139. package/_standalone/.next/server/server-reference-manifest.json +1 -1
  140. package/_standalone/.next/static/5GmVArEG8OX03azKICsGq/_buildManifest.js +1 -0
  141. package/_standalone/.next/static/chunks/1369-7d0ac5d1564eed1e.js +1 -0
  142. package/_standalone/.next/static/chunks/{5581-dac72e9f16e5ea29.js → 5581-0c700c20718bd916.js} +4 -4
  143. package/_standalone/.next/static/chunks/7249-b0a9c77b9a84b11c.js +11 -0
  144. package/_standalone/.next/static/chunks/7637-904b0a381dc3ec02.js +1 -0
  145. package/_standalone/.next/static/chunks/8520-76d1b05072178b43.js +22 -0
  146. package/_standalone/.next/static/chunks/9186-ead47513192f658b.js +1 -0
  147. package/_standalone/.next/static/chunks/app/.well-known/agent-card.json/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  148. package/_standalone/.next/static/chunks/app/_global-error/{page-2f4705aa66819b86.js → page-2ceea6eabf25b1f2.js} +1 -1
  149. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-0ea3571c8fbae823.js +1 -0
  150. package/_standalone/.next/static/chunks/app/agents/{page-b172ea3743adb047.js → page-66858acbcd1d4bf8.js} +1 -1
  151. package/_standalone/.next/static/chunks/app/api/a2a/agents/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  152. package/_standalone/.next/static/chunks/app/api/a2a/delegations/{route-2f4705aa66819b86.js → route-2ceea6eabf25b1f2.js} +1 -1
  153. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-2ceea6eabf25b1f2.js +1 -0
  154. package/_standalone/.next/static/chunks/app/api/a2a/route-2ceea6eabf25b1f2.js +1 -0
  155. package/_standalone/.next/static/chunks/app/api/acp/config/route-2ceea6eabf25b1f2.js +1 -0
  156. package/_standalone/.next/static/chunks/app/api/acp/detect/route-2ceea6eabf25b1f2.js +1 -0
  157. package/_standalone/.next/static/chunks/app/api/acp/install/route-2ceea6eabf25b1f2.js +1 -0
  158. package/_standalone/.next/static/chunks/app/api/acp/registry/route-2ceea6eabf25b1f2.js +1 -0
  159. package/_standalone/.next/static/chunks/app/api/acp/session/route-2ceea6eabf25b1f2.js +1 -0
  160. package/_standalone/.next/static/chunks/app/api/agent-activity/route-2ceea6eabf25b1f2.js +1 -0
  161. package/_standalone/.next/static/chunks/app/api/agents/copy-skill/route-2ceea6eabf25b1f2.js +1 -0
  162. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-2ceea6eabf25b1f2.js +1 -0
  163. package/_standalone/.next/static/chunks/app/api/agents/custom/route-2ceea6eabf25b1f2.js +1 -0
  164. package/_standalone/.next/static/chunks/app/api/ask/route-2ceea6eabf25b1f2.js +1 -0
  165. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-2ceea6eabf25b1f2.js +1 -0
  166. package/_standalone/.next/static/chunks/app/api/auth/route-2ceea6eabf25b1f2.js +1 -0
  167. package/_standalone/.next/static/chunks/app/api/backlinks/route-2ceea6eabf25b1f2.js +1 -0
  168. package/_standalone/.next/static/chunks/app/api/bootstrap/route-2ceea6eabf25b1f2.js +1 -0
  169. package/_standalone/.next/static/chunks/app/api/changes/route-2ceea6eabf25b1f2.js +1 -0
  170. package/_standalone/.next/static/chunks/app/api/export/route-2ceea6eabf25b1f2.js +1 -0
  171. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-2ceea6eabf25b1f2.js +1 -0
  172. package/_standalone/.next/static/chunks/app/api/file/import/route-2ceea6eabf25b1f2.js +1 -0
  173. package/_standalone/.next/static/chunks/app/api/file/raw/route-2ceea6eabf25b1f2.js +1 -0
  174. package/_standalone/.next/static/chunks/app/api/file/route-2ceea6eabf25b1f2.js +1 -0
  175. package/_standalone/.next/static/chunks/app/api/files/route-2ceea6eabf25b1f2.js +1 -0
  176. package/_standalone/.next/static/chunks/app/api/git/route-2ceea6eabf25b1f2.js +1 -0
  177. package/_standalone/.next/static/chunks/app/api/graph/route-2ceea6eabf25b1f2.js +1 -0
  178. package/_standalone/.next/static/chunks/app/api/health/route-2ceea6eabf25b1f2.js +1 -0
  179. package/_standalone/.next/static/chunks/app/api/inbox/route-2ceea6eabf25b1f2.js +1 -0
  180. package/_standalone/.next/static/chunks/app/api/init/route-2ceea6eabf25b1f2.js +1 -0
  181. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-2ceea6eabf25b1f2.js +1 -0
  182. package/_standalone/.next/static/chunks/app/api/mcp/install/route-2ceea6eabf25b1f2.js +1 -0
  183. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-2ceea6eabf25b1f2.js +1 -0
  184. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-2ceea6eabf25b1f2.js +1 -0
  185. package/_standalone/.next/static/chunks/app/api/mcp/status/route-2ceea6eabf25b1f2.js +1 -0
  186. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-2ceea6eabf25b1f2.js +1 -0
  187. package/_standalone/.next/static/chunks/app/api/monitoring/route-2ceea6eabf25b1f2.js +1 -0
  188. package/_standalone/.next/static/chunks/app/api/recent-files/route-2ceea6eabf25b1f2.js +1 -0
  189. package/_standalone/.next/static/chunks/app/api/restart/route-2ceea6eabf25b1f2.js +1 -0
  190. package/_standalone/.next/static/chunks/app/api/search/route-2ceea6eabf25b1f2.js +1 -0
  191. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-2ceea6eabf25b1f2.js +1 -0
  192. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-2ceea6eabf25b1f2.js +1 -0
  193. package/_standalone/.next/static/chunks/app/api/settings/route-2ceea6eabf25b1f2.js +1 -0
  194. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-2ceea6eabf25b1f2.js +1 -0
  195. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-2ceea6eabf25b1f2.js +1 -0
  196. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-2ceea6eabf25b1f2.js +1 -0
  197. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-2ceea6eabf25b1f2.js +1 -0
  198. package/_standalone/.next/static/chunks/app/api/setup/ls/route-2ceea6eabf25b1f2.js +1 -0
  199. package/_standalone/.next/static/chunks/app/api/setup/route-2ceea6eabf25b1f2.js +1 -0
  200. package/_standalone/.next/static/chunks/app/api/skills/route-2ceea6eabf25b1f2.js +1 -0
  201. package/_standalone/.next/static/chunks/app/api/sync/route-2ceea6eabf25b1f2.js +1 -0
  202. package/_standalone/.next/static/chunks/app/api/tree-version/route-2ceea6eabf25b1f2.js +1 -0
  203. package/_standalone/.next/static/chunks/app/api/uninstall/route-2ceea6eabf25b1f2.js +1 -0
  204. package/_standalone/.next/static/chunks/app/api/update/route-2ceea6eabf25b1f2.js +1 -0
  205. package/_standalone/.next/static/chunks/app/api/update-check/route-2ceea6eabf25b1f2.js +1 -0
  206. package/_standalone/.next/static/chunks/app/api/update-status/route-2ceea6eabf25b1f2.js +1 -0
  207. package/_standalone/.next/static/chunks/app/api/workflows/route-2ceea6eabf25b1f2.js +1 -0
  208. package/_standalone/.next/static/chunks/app/changes/page-dd0b00a7b81f74e2.js +1 -0
  209. package/_standalone/.next/static/chunks/app/echo/[segment]/{page-84b95256f6e38aae.js → page-bf5c290fa3ccff09.js} +1 -1
  210. package/_standalone/.next/static/chunks/app/echo/page-2ceea6eabf25b1f2.js +1 -0
  211. package/_standalone/.next/static/chunks/app/inbox/history/{page-26e71fb6f716a4c4.js → page-3279585360df132c.js} +1 -1
  212. package/_standalone/.next/static/chunks/app/{layout-b89b0d955f39a753.js → layout-a5d5925b47e87cc3.js} +24 -24
  213. package/_standalone/.next/static/chunks/app/loading-2ceea6eabf25b1f2.js +1 -0
  214. package/_standalone/.next/static/chunks/app/{page-a8e6f085f38388bf.js → page-6a1f8d21c12b829e.js} +1 -1
  215. package/_standalone/.next/static/chunks/app/trash/page-40bc7316806acd62.js +1 -0
  216. package/_standalone/.next/static/chunks/app/view/[...path]/loading-2ceea6eabf25b1f2.js +1 -0
  217. package/_standalone/.next/static/chunks/app/view/[...path]/{page-f87f4901b5e1a88f.js → page-6fbb14b8f322d0f0.js} +1 -1
  218. package/_standalone/.next/static/chunks/app/wiki/page-ba36eccf4fe62cfe.js +1 -0
  219. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-2ceea6eabf25b1f2.js +1 -0
  220. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-2ceea6eabf25b1f2.js +1 -0
  221. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-2ceea6eabf25b1f2.js +1 -0
  222. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2ceea6eabf25b1f2.js +1 -0
  223. package/_standalone/.next/static/css/b57c4eb3cc88308b.css +1 -0
  224. package/_standalone/.next/trace +65 -64
  225. package/_standalone/.next/types/routes.d.ts +2 -1
  226. package/_standalone/.next/types/validator.ts +9 -0
  227. package/_standalone/__tests__/api/mcp-install.test.ts +5 -2
  228. package/_standalone/components/AskFab.tsx +7 -1
  229. package/_standalone/components/FileTree.tsx +83 -1
  230. package/_standalone/components/Panel.tsx +20 -1
  231. package/_standalone/components/agents/AgentsOverviewSection.tsx +13 -11
  232. package/_standalone/components/agents/CustomAgentModal.tsx +72 -18
  233. package/_standalone/components/ask/AskContent.tsx +19 -3
  234. package/_standalone/components/ask/FileChip.tsx +93 -12
  235. package/_standalone/components/changes/ChangesBanner.tsx +1 -1
  236. package/_standalone/components/home/InboxSection.tsx +148 -32
  237. package/_standalone/components/walkthrough/WalkthroughTooltip.tsx +3 -1
  238. package/_standalone/components/walkthrough/steps.ts +1 -1
  239. package/_standalone/hooks/useAskChat.ts +10 -8
  240. package/_standalone/hooks/useFileUpload.ts +97 -43
  241. package/_standalone/hooks/useImageUpload.ts +1 -1
  242. package/_standalone/lib/inbox-upload.ts +86 -0
  243. package/_standalone/package-lock.json +2 -2
  244. package/_standalone/package.json +1 -1
  245. package/_standalone/scripts/extract-pdf.cjs +110 -3
  246. package/_standalone/tsconfig.tsbuildinfo +1 -1
  247. package/app/app/api/agents/copy-skill/route.ts +110 -0
  248. package/app/app/api/agents/custom/detect/route.ts +16 -1
  249. package/app/app/api/ask/route.ts +9 -3
  250. package/app/app/api/extract-pdf/route.ts +12 -5
  251. package/app/app/api/mcp/agents/route.ts +64 -2
  252. package/app/app/api/mcp/install/route.ts +17 -1
  253. package/app/components/AskFab.tsx +7 -1
  254. package/app/components/FileTree.tsx +83 -1
  255. package/app/components/HomeContent.tsx +14 -6
  256. package/app/components/Panel.tsx +20 -1
  257. package/app/components/agents/AgentDetailContent.tsx +58 -1
  258. package/app/components/agents/AgentsOverviewSection.tsx +13 -11
  259. package/app/components/agents/CustomAgentModal.tsx +72 -18
  260. package/app/components/ask/AskContent.tsx +19 -3
  261. package/app/components/ask/FileChip.tsx +93 -12
  262. package/app/components/changes/ChangesBanner.tsx +1 -1
  263. package/app/components/changes/ChangesContentPage.tsx +368 -168
  264. package/app/components/home/InboxSection.tsx +148 -32
  265. package/app/components/walkthrough/WalkthroughTooltip.tsx +3 -1
  266. package/app/components/walkthrough/steps.ts +1 -1
  267. package/app/hooks/useAskChat.ts +10 -8
  268. package/app/hooks/useFileUpload.ts +97 -43
  269. package/app/hooks/useImageUpload.ts +1 -1
  270. package/app/lib/acp/agent-descriptors.ts +3 -0
  271. package/app/lib/acp/subprocess.ts +56 -8
  272. package/app/lib/agent/prompt.ts +15 -4
  273. package/app/lib/custom-agents.ts +109 -1
  274. package/app/lib/file-ops.ts +58 -0
  275. package/app/lib/i18n/modules/ai-chat.ts +37 -0
  276. package/app/lib/i18n/modules/knowledge.ts +12 -0
  277. package/app/lib/inbox-upload.ts +86 -0
  278. package/app/lib/mcp-agents.ts +30 -1
  279. package/app/lib/types.ts +12 -0
  280. package/app/package.json +1 -1
  281. package/app/scripts/extract-pdf.cjs +110 -3
  282. package/bin/lib/mcp-agents.js +34 -1
  283. package/bin/lib/mcp-install.js +94 -20
  284. package/bin/lib/toml.js +125 -0
  285. package/package.json +1 -1
  286. package/scripts/build-runtime-archive.sh +5 -1
  287. package/scripts/setup.js +19 -0
  288. package/_standalone/.next/static/chunks/4237-ffc6e7c15d4007b6.js +0 -1
  289. package/_standalone/.next/static/chunks/6878-e2c5459e1c608f89.js +0 -1
  290. package/_standalone/.next/static/chunks/7249-6cf8f2b78718c59e.js +0 -11
  291. package/_standalone/.next/static/chunks/8520-56ec9ff087c15204.js +0 -22
  292. package/_standalone/.next/static/chunks/9286-5b09baa5200318c2.js +0 -1
  293. package/_standalone/.next/static/chunks/app/agents/[agentKey]/page-35ea6de1af2be3b5.js +0 -1
  294. package/_standalone/.next/static/chunks/app/api/a2a/discover/route-2f4705aa66819b86.js +0 -1
  295. package/_standalone/.next/static/chunks/app/api/a2a/route-2f4705aa66819b86.js +0 -1
  296. package/_standalone/.next/static/chunks/app/api/acp/config/route-2f4705aa66819b86.js +0 -1
  297. package/_standalone/.next/static/chunks/app/api/acp/detect/route-2f4705aa66819b86.js +0 -1
  298. package/_standalone/.next/static/chunks/app/api/acp/install/route-2f4705aa66819b86.js +0 -1
  299. package/_standalone/.next/static/chunks/app/api/acp/registry/route-2f4705aa66819b86.js +0 -1
  300. package/_standalone/.next/static/chunks/app/api/acp/session/route-2f4705aa66819b86.js +0 -1
  301. package/_standalone/.next/static/chunks/app/api/agent-activity/route-2f4705aa66819b86.js +0 -1
  302. package/_standalone/.next/static/chunks/app/api/agents/custom/detect/route-2f4705aa66819b86.js +0 -1
  303. package/_standalone/.next/static/chunks/app/api/agents/custom/route-2f4705aa66819b86.js +0 -1
  304. package/_standalone/.next/static/chunks/app/api/ask/route-2f4705aa66819b86.js +0 -1
  305. package/_standalone/.next/static/chunks/app/api/ask-sessions/route-2f4705aa66819b86.js +0 -1
  306. package/_standalone/.next/static/chunks/app/api/auth/route-2f4705aa66819b86.js +0 -1
  307. package/_standalone/.next/static/chunks/app/api/backlinks/route-2f4705aa66819b86.js +0 -1
  308. package/_standalone/.next/static/chunks/app/api/bootstrap/route-2f4705aa66819b86.js +0 -1
  309. package/_standalone/.next/static/chunks/app/api/changes/route-2f4705aa66819b86.js +0 -1
  310. package/_standalone/.next/static/chunks/app/api/export/route-2f4705aa66819b86.js +0 -1
  311. package/_standalone/.next/static/chunks/app/api/extract-pdf/route-2f4705aa66819b86.js +0 -1
  312. package/_standalone/.next/static/chunks/app/api/file/import/route-2f4705aa66819b86.js +0 -1
  313. package/_standalone/.next/static/chunks/app/api/file/raw/route-2f4705aa66819b86.js +0 -1
  314. package/_standalone/.next/static/chunks/app/api/file/route-2f4705aa66819b86.js +0 -1
  315. package/_standalone/.next/static/chunks/app/api/files/route-2f4705aa66819b86.js +0 -1
  316. package/_standalone/.next/static/chunks/app/api/git/route-2f4705aa66819b86.js +0 -1
  317. package/_standalone/.next/static/chunks/app/api/graph/route-2f4705aa66819b86.js +0 -1
  318. package/_standalone/.next/static/chunks/app/api/health/route-2f4705aa66819b86.js +0 -1
  319. package/_standalone/.next/static/chunks/app/api/inbox/route-2f4705aa66819b86.js +0 -1
  320. package/_standalone/.next/static/chunks/app/api/init/route-2f4705aa66819b86.js +0 -1
  321. package/_standalone/.next/static/chunks/app/api/mcp/agents/route-2f4705aa66819b86.js +0 -1
  322. package/_standalone/.next/static/chunks/app/api/mcp/install/route-2f4705aa66819b86.js +0 -1
  323. package/_standalone/.next/static/chunks/app/api/mcp/install-skill/route-2f4705aa66819b86.js +0 -1
  324. package/_standalone/.next/static/chunks/app/api/mcp/restart/route-2f4705aa66819b86.js +0 -1
  325. package/_standalone/.next/static/chunks/app/api/mcp/status/route-2f4705aa66819b86.js +0 -1
  326. package/_standalone/.next/static/chunks/app/api/mcp/uninstall/route-2f4705aa66819b86.js +0 -1
  327. package/_standalone/.next/static/chunks/app/api/monitoring/route-2f4705aa66819b86.js +0 -1
  328. package/_standalone/.next/static/chunks/app/api/recent-files/route-2f4705aa66819b86.js +0 -1
  329. package/_standalone/.next/static/chunks/app/api/restart/route-2f4705aa66819b86.js +0 -1
  330. package/_standalone/.next/static/chunks/app/api/search/route-2f4705aa66819b86.js +0 -1
  331. package/_standalone/.next/static/chunks/app/api/settings/list-models/route-2f4705aa66819b86.js +0 -1
  332. package/_standalone/.next/static/chunks/app/api/settings/reset-token/route-2f4705aa66819b86.js +0 -1
  333. package/_standalone/.next/static/chunks/app/api/settings/route-2f4705aa66819b86.js +0 -1
  334. package/_standalone/.next/static/chunks/app/api/settings/test-key/route-2f4705aa66819b86.js +0 -1
  335. package/_standalone/.next/static/chunks/app/api/setup/check-path/route-2f4705aa66819b86.js +0 -1
  336. package/_standalone/.next/static/chunks/app/api/setup/check-port/route-2f4705aa66819b86.js +0 -1
  337. package/_standalone/.next/static/chunks/app/api/setup/generate-token/route-2f4705aa66819b86.js +0 -1
  338. package/_standalone/.next/static/chunks/app/api/setup/ls/route-2f4705aa66819b86.js +0 -1
  339. package/_standalone/.next/static/chunks/app/api/setup/route-2f4705aa66819b86.js +0 -1
  340. package/_standalone/.next/static/chunks/app/api/skills/route-2f4705aa66819b86.js +0 -1
  341. package/_standalone/.next/static/chunks/app/api/sync/route-2f4705aa66819b86.js +0 -1
  342. package/_standalone/.next/static/chunks/app/api/tree-version/route-2f4705aa66819b86.js +0 -1
  343. package/_standalone/.next/static/chunks/app/api/uninstall/route-2f4705aa66819b86.js +0 -1
  344. package/_standalone/.next/static/chunks/app/api/update/route-2f4705aa66819b86.js +0 -1
  345. package/_standalone/.next/static/chunks/app/api/update-check/route-2f4705aa66819b86.js +0 -1
  346. package/_standalone/.next/static/chunks/app/api/update-status/route-2f4705aa66819b86.js +0 -1
  347. package/_standalone/.next/static/chunks/app/api/workflows/route-2f4705aa66819b86.js +0 -1
  348. package/_standalone/.next/static/chunks/app/changes/page-6d2f49651c0061f7.js +0 -1
  349. package/_standalone/.next/static/chunks/app/echo/page-2f4705aa66819b86.js +0 -1
  350. package/_standalone/.next/static/chunks/app/loading-2f4705aa66819b86.js +0 -1
  351. package/_standalone/.next/static/chunks/app/trash/page-f92b728b78ac0f7e.js +0 -1
  352. package/_standalone/.next/static/chunks/app/view/[...path]/loading-2f4705aa66819b86.js +0 -1
  353. package/_standalone/.next/static/chunks/app/wiki/page-641edb1f3cff2f93.js +0 -1
  354. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-2f4705aa66819b86.js +0 -1
  355. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-2f4705aa66819b86.js +0 -1
  356. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-2f4705aa66819b86.js +0 -1
  357. package/_standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2f4705aa66819b86.js +0 -1
  358. package/_standalone/.next/static/css/6c104b118d3bc9b7.css +0 -1
  359. package/_standalone/.next/static/u8p6oIRTcr_ns-ElNZ9rl/_buildManifest.js +0 -1
  360. /package/_standalone/.next/static/{u8p6oIRTcr_ns-ElNZ9rl → 5GmVArEG8OX03azKICsGq}/_ssgManifest.js +0 -0
@@ -1,10 +1,62 @@
1
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
- import { CONFIG_PATH } from './constants.js';
1
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, copyFileSync } from 'node:fs';
2
+ import { resolve, join } from 'node:path';
3
+ import { CONFIG_PATH, ROOT } from './constants.js';
4
4
  import { bold, dim, cyan, green, red, yellow } from './colors.js';
5
5
  import { expandHome } from './path-expand.js';
6
6
  import { parseJsonc } from './jsonc.js';
7
- import { MCP_AGENTS, detectAgentPresence } from './mcp-agents.js';
7
+ import { MCP_AGENTS, SKILL_AGENT_REGISTRY, detectAgentPresence } from './mcp-agents.js';
8
+ import { mergeTomlEntry } from './toml.js';
9
+
10
+ /**
11
+ * Recursively copy a directory using pure Node.js (cross-platform).
12
+ * Uses cpSync on Node >=16.7, falls back to manual walk otherwise.
13
+ */
14
+ function copyDirSync(src, dst) {
15
+ mkdirSync(dst, { recursive: true });
16
+ for (const entry of readdirSync(src, { withFileTypes: true })) {
17
+ const s = join(src, entry.name);
18
+ const d = join(dst, entry.name);
19
+ if (entry.isDirectory()) {
20
+ copyDirSync(s, d);
21
+ } else {
22
+ copyFileSync(s, d);
23
+ }
24
+ }
25
+ }
26
+
27
+ /**
28
+ * Auto-copy skill folder for agents with mode 'unsupported'.
29
+ * Called after MCP config is written. Best-effort, never throws.
30
+ */
31
+ function autoInstallSkillForAgent(agentKey, skillName) {
32
+ const reg = SKILL_AGENT_REGISTRY[agentKey];
33
+ if (!reg || reg.mode !== 'unsupported') return null;
34
+
35
+ const agent = MCP_AGENTS[agentKey];
36
+ if (!agent) return null;
37
+
38
+ // Resolve skill source: project skills/ or app/data/skills/
39
+ const candidates = [
40
+ join(ROOT, 'skills', skillName),
41
+ join(ROOT, 'app', 'data', 'skills', skillName),
42
+ ];
43
+ const skillSrc = candidates.find(p => existsSync(p));
44
+ if (!skillSrc) return null;
45
+
46
+ // Resolve target: agent's presenceDirs[0]/skills/<skillName>
47
+ const agentRoot = (agent.presenceDirs ?? []).map(d => expandHome(d)).find(d => existsSync(d))
48
+ || resolve(expandHome(agent.global), '..');
49
+ const targetDir = join(agentRoot, 'skills', skillName);
50
+
51
+ if (existsSync(targetDir)) return 'exists';
52
+
53
+ try {
54
+ copyDirSync(skillSrc, targetDir);
55
+ return 'copied';
56
+ } catch {
57
+ return null;
58
+ }
59
+ }
8
60
 
9
61
  export { MCP_AGENTS };
10
62
 
@@ -195,8 +247,15 @@ export async function mcpInstall() {
195
247
  const abs = expandHome(cfgPath);
196
248
  if (!existsSync(abs)) continue;
197
249
  try {
198
- const config = parseJsonc(readFileSync(abs, 'utf-8'));
199
- if (config[agent.key]?.mindos) { installed = true; break; }
250
+ const content = readFileSync(abs, 'utf-8');
251
+ if (agent.format === 'toml') {
252
+ // TOML: look for [section.mindos] header
253
+ installed = content.includes(`[${agent.key}.mindos]`);
254
+ } else {
255
+ const config = parseJsonc(content);
256
+ if (config[agent.key]?.mindos) installed = true;
257
+ }
258
+ if (installed) break;
200
259
  } catch {}
201
260
  }
202
261
  const hint = installed ? 'configured' : present ? 'detected' : 'not found';
@@ -312,24 +371,39 @@ export async function mcpInstall() {
312
371
 
313
372
  // read + merge — resolve to absolute path for cross-platform safety
314
373
  const absPath = resolve(expandHome(configPath));
315
- let config = {};
316
- if (existsSync(absPath)) {
317
- try { config = parseJsonc(readFileSync(absPath, 'utf-8')); } catch {
318
- console.error(red(` Failed to parse existing config: ${absPath} — skipping.`));
319
- continue;
320
- }
321
- }
322
-
323
- if (!config[agent.key]) config[agent.key] = {};
324
- const existed = !!config[agent.key].mindos;
325
- config[agent.key].mindos = entry;
326
-
327
- // write
328
374
  const dir = resolve(absPath, '..');
329
375
  if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
330
- writeFileSync(absPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
376
+
377
+ let existed = false;
378
+
379
+ if (agent.format === 'toml') {
380
+ // TOML format (e.g. Codex): line-based merge preserving existing content
381
+ const existing = existsSync(absPath) ? readFileSync(absPath, 'utf-8') : '';
382
+ existed = existing.includes(`[${agent.key}.mindos]`);
383
+ const merged = mergeTomlEntry(existing, agent.key, 'mindos', entry);
384
+ writeFileSync(absPath, merged, 'utf-8');
385
+ } else {
386
+ // JSON format (default)
387
+ let config = {};
388
+ if (existsSync(absPath)) {
389
+ try { config = parseJsonc(readFileSync(absPath, 'utf-8')); } catch {
390
+ console.error(red(` Failed to parse existing config: ${absPath} — skipping.`));
391
+ continue;
392
+ }
393
+ }
394
+ if (!config[agent.key]) config[agent.key] = {};
395
+ existed = !!config[agent.key].mindos;
396
+ config[agent.key].mindos = entry;
397
+ writeFileSync(absPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
398
+ }
331
399
 
332
400
  console.log(`${green('✔')} ${existed ? 'Updated' : 'Installed'} MindOS MCP for ${bold(agent.name)} ${dim(`→ ${absPath}`)}`);
401
+
402
+ // Auto-copy skill for unsupported agents
403
+ const skillResult = autoInstallSkillForAgent(agentKey, 'mindos');
404
+ if (skillResult === 'copied') {
405
+ console.log(`${green('✔')} Copied MindOS Skill for ${bold(agent.name)}`);
406
+ }
333
407
  }
334
408
 
335
409
  console.log(`\n${green('Done!')} ${agentKeys.length} agent(s) configured.`);
@@ -0,0 +1,125 @@
1
+ /**
2
+ * TOML utilities for MCP agent configuration.
3
+ *
4
+ * Used by agents whose config format is 'toml' (currently: Codex).
5
+ * Mirrors the TypeScript implementation in:
6
+ * app/app/api/mcp/install/route.ts (buildTomlEntry, mergeTomlEntry)
7
+ *
8
+ * No external TOML library — hand-rolled for the narrow MCP config use case.
9
+ *
10
+ * @module toml
11
+ */
12
+
13
+ /**
14
+ * Generate a TOML section string for an MCP server entry.
15
+ *
16
+ * @param {string} sectionKey Top-level table name, e.g. 'mcp_servers'
17
+ * @param {string} serverName Server name, e.g. 'mindos'
18
+ * @param {Record<string, unknown>} entry MCP entry object
19
+ * @returns {string} TOML block (without trailing newline)
20
+ *
21
+ * @example
22
+ * buildTomlEntry('mcp_servers', 'mindos', {
23
+ * type: 'stdio', command: 'mindos', args: ['mcp'],
24
+ * env: { MCP_TRANSPORT: 'stdio' },
25
+ * })
26
+ * // →
27
+ * // [mcp_servers.mindos]
28
+ * // type = "stdio"
29
+ * // command = "mindos"
30
+ * // args = ["mcp"]
31
+ * //
32
+ * // [mcp_servers.mindos.env]
33
+ * // MCP_TRANSPORT = "stdio"
34
+ */
35
+ export function buildTomlEntry(sectionKey, serverName, entry) {
36
+ const lines = [];
37
+
38
+ // Main section header
39
+ lines.push(`[${sectionKey}.${serverName}]`);
40
+
41
+ // Scalar + array fields (order matches TS version)
42
+ if (entry.type != null) lines.push(`type = "${entry.type}"`);
43
+ if (entry.command != null) lines.push(`command = "${entry.command}"`);
44
+ if (entry.url != null) lines.push(`url = "${entry.url}"`);
45
+ if (Array.isArray(entry.args)) {
46
+ lines.push(`args = [${entry.args.map(a => `"${a}"`).join(', ')}]`);
47
+ }
48
+
49
+ // Nested [section.server.env] sub-table
50
+ if (entry.env && typeof entry.env === 'object') {
51
+ lines.push('');
52
+ lines.push(`[${sectionKey}.${serverName}.env]`);
53
+ for (const [k, v] of Object.entries(entry.env)) {
54
+ lines.push(`${k} = "${v}"`);
55
+ }
56
+ }
57
+
58
+ // Nested [section.server.headers] sub-table
59
+ if (entry.headers && typeof entry.headers === 'object') {
60
+ lines.push('');
61
+ lines.push(`[${sectionKey}.${serverName}.headers]`);
62
+ for (const [k, v] of Object.entries(entry.headers)) {
63
+ lines.push(`${k} = "${v}"`);
64
+ }
65
+ }
66
+
67
+ return lines.join('\n');
68
+ }
69
+
70
+ /**
71
+ * Replace or append a [section.server] block in existing TOML content.
72
+ *
73
+ * Algorithm:
74
+ * 1. Walk existing lines; skip lines belonging to the target section
75
+ * (main header, .env sub-header, .headers sub-header).
76
+ * 2. Strip trailing blank lines.
77
+ * 3. Append the new block generated by buildTomlEntry().
78
+ *
79
+ * @param {string} existing Current file content (may be empty)
80
+ * @param {string} sectionKey Top-level table name, e.g. 'mcp_servers'
81
+ * @param {string} serverName Server name, e.g. 'mindos'
82
+ * @param {Record<string, unknown>} entry MCP entry object
83
+ * @returns {string} Merged TOML content
84
+ */
85
+ export function mergeTomlEntry(existing, sectionKey, serverName, entry) {
86
+ const sectionHeader = `[${sectionKey}.${serverName}]`;
87
+ const envHeader = `[${sectionKey}.${serverName}.env]`;
88
+ const headersHeader = `[${sectionKey}.${serverName}.headers]`;
89
+ const newBlock = buildTomlEntry(sectionKey, serverName, entry);
90
+
91
+ const lines = existing.split('\n');
92
+ const result = [];
93
+ let skipping = false;
94
+
95
+ for (const line of lines) {
96
+ const trimmed = line.trim();
97
+
98
+ // Entering one of the target sections → start skipping
99
+ if (trimmed === sectionHeader || trimmed === envHeader || trimmed === headersHeader) {
100
+ skipping = true;
101
+ continue;
102
+ }
103
+
104
+ // A new [section] header that is NOT ours → stop skipping
105
+ if (skipping && trimmed.startsWith('[')) {
106
+ skipping = false;
107
+ }
108
+
109
+ if (!skipping) {
110
+ result.push(line);
111
+ }
112
+ }
113
+
114
+ // Remove trailing blank lines before appending
115
+ while (result.length > 0 && result[result.length - 1].trim() === '') {
116
+ result.pop();
117
+ }
118
+
119
+ // Append new block with surrounding blank lines
120
+ result.push('');
121
+ result.push(newBlock);
122
+ result.push('');
123
+
124
+ return result.join('\n');
125
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminilight/mindos",
3
- "version": "0.6.59",
3
+ "version": "0.6.61",
4
4
  "description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
5
5
  "keywords": [
6
6
  "mindos",
@@ -60,7 +60,11 @@ cp package.json "$WORK/"
60
60
 
61
61
  # ── Package (flat, no outer directory) ──
62
62
  echo " Creating archive..."
63
- tar czf "$ARCHIVE" -C "$WORK" .
63
+ # Use POSIX format to avoid GNU @LongLink extensions that our Windows JS
64
+ # tar parser must handle. --posix uses pax headers for paths > 100 chars,
65
+ # which the parser also supports, but keeping paths representable in ustar
66
+ # prefix+name (up to 255 chars) is preferred for maximum compatibility.
67
+ tar czf "$ARCHIVE" --posix -C "$WORK" .
64
68
 
65
69
  # ── Self-validation ──
66
70
  echo " Validating..."
package/scripts/setup.js CHANGED
@@ -823,6 +823,25 @@ function runSkillInstallStep(template, selectedAgents) {
823
823
  return [reg.skillAgentName || key];
824
824
  });
825
825
 
826
+ // Direct-copy skill for 'unsupported' agents (e.g., QClaw, WorkBuddy, Lingma)
827
+ const unsupportedAgents = selectedAgents.filter((key) => {
828
+ const reg = SKILL_AGENT_REGISTRY[key];
829
+ return reg?.mode === 'unsupported';
830
+ });
831
+ for (const key of unsupportedAgents) {
832
+ const agent = MCP_AGENTS[key];
833
+ if (!agent) continue;
834
+ const skillSourceDir = resolve(ROOT, 'skills', skillName);
835
+ if (!existsSync(skillSourceDir)) continue;
836
+ const targetDir = expandHomePath(agent.presenceDirs?.[0] ?? agent.global.replace(/\/[^/]+$/, '/'));
837
+ const targetSkillDir = resolve(targetDir, 'skills', skillName);
838
+ try {
839
+ if (!existsSync(targetSkillDir)) {
840
+ cpSync(skillSourceDir, targetSkillDir, { recursive: true });
841
+ }
842
+ } catch { /* best-effort copy for unsupported agents */ }
843
+ }
844
+
826
845
  const agentFlags = additionalAgents.length > 0
827
846
  ? additionalAgents.map(a => `-a ${a}`).join(' ')
828
847
  : '-a universal';
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4237],{1934:(e,t,r)=>{r.d(t,{v:()=>a});var n=r(12115);let o=e=>{let t,r=new Set,n=(e,n)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=n?n:"object"!=typeof o||null===o)?o:Object.assign({},t,o),r.forEach(r=>r(t,e))}},o=()=>t,u={setState:n,getState:o,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,o,u);return u},u=e=>{let t=e?o(e):o,r=e=>(function(e,t=e=>e){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},a=e=>e?u(e):u},10857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return E},MissingStaticPage:function(){return v},NormalizeError:function(){return m},PageNotFoundError:function(){return b},SP:function(){return h},ST:function(){return y},WEB_VITALS:function(){return o},execOnce:function(){return u},getDisplayName:function(){return s},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return i},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return _}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>a.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function d(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${s(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let h="u">typeof performance,y=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class m extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class E extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function _(e){return JSON.stringify({message:e.message,stack:e.stack})}},20091:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let u=r(66388)._(r(31393)),a=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",i=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(u.urlQueryToSearchParams(l)));let s=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),s&&"?"!==s[0]&&(s="?"+s),o=o.replace(/[?#]/g,encodeURIComponent),s=s.replace("#","%23"),`${n}${c}${o}${s}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},21172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=r(12115);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=u(e,n)),t&&(o.current=u(t,n))},[e,t])}function u(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29842:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},31393:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={assign:function(){return i},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return a}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,u(e));else t.set(r,u(n));return t}function i(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},66088:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(90425).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},69470:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return u}});let n=r(10857),o=r(48512);function u(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},90425:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(12115);let o=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),u=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:i="",children:l,iconNode:c,...s},f)=>(0,n.createElement)("svg",{ref:f,...a,width:t,height:t,stroke:e,strokeWidth:u?24*Number(r)/Number(t):r,className:o("lucide",i),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(s)&&{"aria-hidden":"true"},...s},[...c.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(l)?l:[l]])),l=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...a},l)=>(0,n.createElement)(i,{ref:l,iconNode:t,className:o(`lucide-${u(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...a}));return r.displayName=u(e),r}},94514:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(90425).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},98500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return m},useLinkStatus:function(){return v}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let u=r(66388),a=r(95155),i=u._(r(12115)),l=r(20091),c=r(22909),s=r(21172),f=r(10857),d=r(70127);r(47284);let p=r(24972),h=r(69470),y=r(77565);function g(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function m(e){var t;let n,o,u,[l,m]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:E,as:_,children:P,prefetch:O=null,passHref:j,replace:C,shallow:S,scroll:w,onClick:k,onMouseEnter:N,onTouchStart:A,legacyBehavior:R=!1,onNavigate:T,ref:L,unstable_dynamicOnHover:x,...$}=e;n=P,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,a.jsx)("a",{children:n}));let M=i.default.useContext(c.AppRouterContext),I=!1!==O,U=!1!==O?null===(t=O)||"auto"===t?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,{href:F,as:D}=i.default.useMemo(()=>{let e=g(E);return{href:e,as:_?g(_):e}},[E,_]);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(n)}let B=R?o&&"object"==typeof o&&o.ref:L,z=i.default.useCallback(e=>(null!==M&&(v.current=(0,p.mountLinkInstance)(e,F,M,U,I,m)),()=>{v.current&&((0,p.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,F,M,U,m]),K={ref:(0,s.useMergedRef)(z,B),onClick(e){R||"function"!=typeof k||k(e),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),!M||e.defaultPrevented||function(e,t,n,o,u,a,l){{let c,{nodeName:s}=e.currentTarget;if("A"===s.toUpperCase()&&((c=e.currentTarget.getAttribute("target"))&&"_self"!==c||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(t)){u&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=r(70156);i.default.startTransition(()=>{f(n||t,u?"replace":"push",a??!0,o.current)})}}(e,F,D,v,C,w,T)},onMouseEnter(e){R||"function"!=typeof N||N(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),M&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===x)},onTouchStart:function(e){R||"function"!=typeof A||A(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),M&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===x)}};return(0,f.isAbsoluteUrl)(D)?K.href=D:R&&!j&&("a"!==o.type||"href"in o.props)||(K.href=(0,d.addBasePath)(D)),u=R?i.default.cloneElement(o,K):(0,a.jsx)("a",{...$,...K,children:n}),(0,a.jsx)(b.Provider,{value:l,children:u})}r(29842);let b=(0,i.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(b);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6878],{439:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},3926:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]])},6296:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},10762:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},12651:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},13545:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},15573:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},21362:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},33210:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},33591:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]])},44478:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},48368:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},49387:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},51914:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},52905:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},53961:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},61878:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},67635:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},68459:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},68822:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},73035:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]])},77800:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]])},80723:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},84755:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},84980:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},92451:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},93219:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},93631:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]])},97810:(e,a,y)=>{y.d(a,{A:()=>t});let t=(0,y(90425).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}}]);
@@ -1,11 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7249],{3590:(e,t,r)=>{function s(e){return{connected:e.filter(e=>e.present&&e.installed),detected:e.filter(e=>e.present&&!e.installed),notFound:e.filter(e=>!e.present)}}function n(e){return e.present&&e.installed?"connected":e.present?"detected":"notFound"}function i(e){return f(`${e.name} ${e.description}`)}function o(e){let t=[];return e.mcpEnabled&&!e.mcpRunning&&t.push({id:"mcp-stopped",severity:"error",title:e.copy.riskMcpStopped}),e.detectedCount>0&&t.push({id:"detected-unconfigured",severity:"warn",title:e.copy.riskDetected(e.detectedCount)}),e.allSkillsDisabled&&t.push({id:"skills-disabled",severity:"warn",title:e.copy.riskSkillsDisabled}),t}function l(e){return new Set(e.filter(e=>!e.enabled&&"user"===e.source||0===e.description.trim().length).map(e=>e.name))}function a(e){let t=e.filter(e=>!e.ok).map(e=>e.skillName);return{total:e.length,succeeded:e.length-t.length,failed:t.length,failedSkills:t}}function d(e,t){let r=t.query.trim().toLowerCase();return e.filter(e=>{let s;return("all"===t.status||n(e)===t.status)&&("all"===t.transport||("stdio"===(s=(e.transport??e.preferredTransport??"").toLowerCase())||"http"===s?s:"other")===t.transport)&&(!r||`${e.name} ${e.key} ${e.configPath??""}`.toLowerCase().includes(r))})}function c(e){let t=e.filter(e=>!e.ok).length;return{total:e.length,succeeded:e.length-t,failed:t}}function u(e){let t=new Map;for(let r of e)for(let e of r.configuredMcpServers??[]){let s=t.get(e);s?s.push(r.name):t.set(e,[r.name])}return[...t.entries()].map(([e,t])=>({serverName:e,agents:t})).sort((e,t)=>t.agents.length-e.agents.length||e.serverName.localeCompare(t.serverName))}function m(e){let t=new Map;for(let r of e)for(let e of r.installedSkillNames??[]){let s=t.get(e);s?s.push(r.name):t.set(e,[r.name])}return[...t.entries()].map(([e,t])=>({skillName:e,agents:t})).sort((e,t)=>t.agents.length-e.agents.length||e.skillName.localeCompare(t.skillName))}r.d(t,{$2:()=>i,$t:()=>s,G9:()=>j,GU:()=>h,HL:()=>u,IK:()=>l,Ri:()=>v,ag:()=>b,fH:()=>d,gJ:()=>g,qC:()=>x,x3:()=>m,xJ:()=>c,xR:()=>a,yQ:()=>f,yv:()=>n,zK:()=>o});let p={connected:0,detected:1,notFound:2};function g(e){return[...e].sort((e,t)=>{let r=p[n(e)],s=p[n(t)];return r!==s?r-s:e.name.localeCompare(t.name)})}function x(e,t){let r=t.query.trim().toLowerCase();return e.filter(e=>("all"===t.source||e.source===t.source)&&(!r||`${e.name} ${e.description} ${e.path}`.toLowerCase().includes(r)))}function f(e){let t=e.toLowerCase();return t.includes("search")||t.includes("research")||t.includes("arxiv")||t.includes("paper")?"research":t.includes("doc")||t.includes("write")||t.includes("readme")||t.includes("copy")||t.includes("slide")||t.includes("ppt")?"docs":t.includes("deploy")||t.includes("ops")||t.includes("ci")||t.includes("ship")||t.includes("qa")||t.includes("review")||t.includes("test")?"ops":t.includes("memory")||t.includes("mind")||t.includes("handoff")||t.includes("session")?"memory":"coding"}function b(e,t){let r=new Set(e.map(e=>e.name)),s=new Map;for(let e of t)s.set(e.skillName,e.agents);let n=[];for(let t of e)n.push({name:t.name,kind:"mindos",mindosSkill:t,agents:s.get(t.name)??[],capability:i(t),enabled:t.enabled,source:t.source,description:t.description});for(let e of t)r.has(e.skillName)||n.push({name:e.skillName,kind:"native",agents:e.agents,capability:f(e.skillName),enabled:!0,source:"native",description:""});return n}function h(e){return{research:e.filter(e=>"research"===e.capability),coding:e.filter(e=>"coding"===e.capability),docs:e.filter(e=>"docs"===e.capability),ops:e.filter(e=>"ops"===e.capability),memory:e.filter(e=>"memory"===e.capability)}}function v(e,t){let r=t.query.trim().toLowerCase(),s=new Set(e.filter(e=>"mindos"===e.kind&&(!e.enabled&&"user"===e.source||0===e.description.trim().length)).map(e=>e.name));return e.filter(e=>("all"===t.source||("native"!==t.source||"native"===e.kind)&&("builtin"!==t.source||"builtin"===e.source)&&("user"!==t.source||"user"===e.source))&&("enabled"!==t.status||!!e.enabled)&&("disabled"!==t.status||!e.enabled)&&("attention"!==t.status||!!s.has(e.name))&&("all"===t.capability||e.capability===t.capability)&&(!r||!!`${e.name} ${e.description}`.toLowerCase().includes(r))&&!0)}function j(e,t){return e.filter(e=>"mindos"===e.kind&&e.enabled!==t).map(e=>e.name)}},85641:(e,t,r)=>{r.d(t,{A:()=>w});var s=r(95155),n=r(12115),i=r(61878),o=r(33591),l=r(48368),a=r(15573),d=r(97810),c=r(53961),u=r(33210),m=r(51914),p=r(67635),g=r(6296),x=r(66088),f=r(77800),b=r(68459),h=r(22356),v=r(7834),j=r(4235),y=r(20171),k=r(39498),N=r(3590);let C={research:i.A,coding:o.A,docs:l.A,ops:a.A,memory:d.A};function A({text:e,className:t=""}){let r=(0,n.useMemo)(()=>{let t;return(t=(t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,r)=>`<pre><code>${r.trimEnd().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</code></pre>`).replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^#### (.+)$/gm,"<h4>$1</h4>").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/^---$/gm,"<hr/>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/^\* (.+)$/gm,"<li>$1</li>").replace(/^\d+\. (.+)$/gm,"<li>$1</li>")).replace(/((?:<li>.*<\/li>\n?)+)/g,"<ul>$1</ul>")).split("\n").map(e=>{let t=e.trim();return t?/^<(h[1-4]|ul|ol|li|pre|hr|div|p|blockquote)/.test(t)?e:`<p>${t}</p>`:""}).join("\n")},[e]);return(0,s.jsx)("div",{className:`prose prose-sm prose-invert max-w-none
2
- prose-headings:text-foreground prose-headings:font-semibold prose-headings:mt-4 prose-headings:mb-2
3
- prose-h1:text-sm prose-h2:text-xs prose-h3:text-xs
4
- prose-p:text-xs prose-p:text-foreground/80 prose-p:leading-relaxed prose-p:my-1.5
5
- prose-li:text-xs prose-li:text-foreground/80 prose-li:my-0.5
6
- prose-strong:text-foreground prose-strong:font-semibold
7
- prose-code:text-[var(--amber)] prose-code:bg-muted/50 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-2xs prose-code:font-mono
8
- prose-pre:bg-muted/30 prose-pre:border prose-pre:border-border/50 prose-pre:rounded-lg prose-pre:p-3 prose-pre:text-2xs prose-pre:overflow-x-auto
9
- prose-ul:my-1 prose-ol:my-1
10
- prose-hr:border-border/30 prose-hr:my-3
11
- ${t}`,dangerouslySetInnerHTML:{__html:r}})}function w({open:e,skillName:t,skill:r,agentNames:i=[],allAgentNames:o=[],isNative:l=!1,nativeSourcePath:a,copy:d,onClose:w,onToggle:$,onDelete:T,onRefresh:z,onAddAgent:L,onRemoveAgent:K}){let E,F,[M,P]=(0,n.useState)(null),[O,R]=(0,n.useState)(""),[_,H]=(0,n.useState)(!1),[J,q]=(0,n.useState)(!1),[W,B]=(0,n.useState)(!1),[I,U]=(0,n.useState)(!1),[Q,G]=(0,n.useState)(null),[V,Y]=(0,n.useState)(!1),[X,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(!1),er=(0,n.useCallback)(async()=>{if(t){H(!0),q(!1);try{if(l&&a){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read-native",name:t,sourcePath:a})});P(e.content),R(e.description||"")}else if(!l){let e=await (0,h.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"read",name:t})});P(e.content)}}catch{q(!0)}finally{H(!1)}}},[t,l,a]);(0,n.useEffect)(()=>{e&&t&&(P(null),R(""),q(!1),G(null),U(!1),Y(!1),Z(!1),et(!1),er())},[e,t,er]),(0,n.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&w()}},[e,w]);let es=(0,n.useCallback)(async()=>{!M||await (0,v.l)(M)&&j.oR.copy()},[M]),en=(0,n.useCallback)(async e=>{if(t&&$){Y(!0);try{await $(t,e)}finally{Y(!1)}}},[t,$]),ei=(0,n.useCallback)(async()=>{if(t&&T){B(!1),U(!0);try{await T(t),G(d.deleted),await z?.(),setTimeout(()=>w(),800)}catch{G(d.deleteFailed),U(!1)}}},[t,T,z,w,d.deleted,d.deleteFailed]);if(!e||!t)return null;let eo=r?(0,N.yQ)(`${r.name} ${r.description}`):(0,N.yQ)(t),el=C[eo]??c.A,ea=r?.source==="user",ed=l?d.sourceNative:r?.source==="builtin"?d.sourceBuiltin:d.sourceUser,ec=r?.description||O||"",eu=r?.path||(l&&a?`${a}/${t}/SKILL.md`:""),em=M?(E=M,(F=M.match(/^---\n[\s\S]*?\n---\n?/))&&(E=M.slice(F[0].length).trim()),{triggerConditions:ec||"",instructions:E}):null,ep=o.filter(e=>!i.includes(e));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 overlay-backdrop",onClick:w,"aria-hidden":"true"}),(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":t,className:"fixed right-0 top-0 z-50 h-full w-full max-w-md border-l border-border bg-card shadow-2xl flex flex-col animate-in slide-in-from-right duration-200",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/60 bg-gradient-to-r from-card to-card/80 shrink-0",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-xl bg-[var(--amber)]/[0.08] flex items-center justify-center text-[var(--amber)] shrink-0",children:(0,s.jsx)(el,{size:18})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-foreground truncate",children:t}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("span",{className:`text-2xs px-2 py-0.5 rounded-full font-medium select-none ${l||r?.source==="builtin"?"bg-muted text-muted-foreground":"bg-[var(--amber-dim)] text-[var(--amber-text)]"}`,children:ed}),(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 capitalize",children:eo})]})]}),(0,s.jsx)("button",{type:"button",onClick:w,className:"shrink-0 p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":d.close,children:(0,s.jsx)(u.A,{size:16})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[ec&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:"Trigger Conditions"}),(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-muted/[0.03] p-3.5",children:(0,s.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:ec})})]}),!ec&&!l&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:d.noDescription}),(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[!l&&r&&(0,s.jsx)(S,{label:d.enabled,value:r.enabled?"✓":"—",tone:r.enabled?"ok":"muted"}),(0,s.jsx)(S,{label:d.capability,value:eo}),(0,s.jsx)(S,{label:d.source,value:ed}),(0,s.jsx)(S,{label:d.agents,value:String(i.length)})]})}),(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:d.agents,noMargin:!0}),L&&ep.length>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>Z(!X),className:"inline-flex items-center gap-1 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(m.A,{size:12}),(0,s.jsx)("span",{children:"Add"})]})]}),X&&ep.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2 p-2 rounded-lg border border-dashed border-[var(--amber)]/30 bg-[var(--amber)]/[0.03]",children:ep.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{L?.(t,e),Z(!1)},className:"inline-flex items-center gap-1 px-2 py-1 text-2xs rounded-md border border-border bg-card hover:bg-muted cursor-pointer transition-colors",children:[(0,s.jsx)(m.A,{size:10,className:"text-[var(--amber)]"}),(0,s.jsx)("span",{className:"text-foreground/80",children:e})]},e))}),i.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(e=>(0,s.jsx)(k.lx,{name:e,size:"sm",onRemove:K?()=>K(t,e):void 0},e))}):(0,s.jsx)("div",{className:"rounded-lg border border-border/40 bg-card/30 p-3 text-center",children:(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.noAgents})})]}),(null!==M||_||J)&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)(D,{label:"Instructions",noMargin:!0}),(0,s.jsx)("div",{className:"flex items-center gap-2",children:M&&(0,s.jsxs)("button",{type:"button",onClick:es,className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1.5 py-0.5","aria-label":d.copyContent,children:[(0,s.jsx)(p.A,{size:11}),d.copyContent]})})]}),_&&(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-background p-6 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(g.A,{size:14,className:"animate-spin"}),d.loading]}),J&&(0,s.jsxs)("div",{className:"rounded-lg border border-destructive/20 bg-destructive/[0.03] p-4 text-center space-y-2",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:d.loadFailed}),(0,s.jsx)("button",{type:"button",onClick:er,className:"text-xs text-foreground underline hover:no-underline cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:d.retry})]}),em&&!_&&!J&&(0,s.jsx)("div",{className:`rounded-lg border border-border/50 bg-muted/[0.02] p-4 overflow-hidden transition-all duration-200 ${!ee?"max-h-60":""}`,children:(0,s.jsx)(A,{text:em.instructions})}),em&&!_&&!J&&em.instructions.split("\n").length>15&&(0,s.jsxs)("button",{type:"button",onClick:()=>et(!ee),className:"inline-flex items-center gap-1 mt-2 text-2xs font-medium text-[var(--amber)] hover:opacity-80 transition-opacity cursor-pointer",children:[(0,s.jsx)(x.A,{size:12,className:`transition-transform duration-200 ${ee?"rotate-180":""}`}),(0,s.jsx)("span",{children:ee?"Collapse":"View All"})]})]}),eu&&(0,s.jsxs)("section",{children:[(0,s.jsx)(D,{label:d.path}),(0,s.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/[0.03] p-3",children:(0,s.jsx)("code",{className:"text-2xs text-foreground/60 font-mono break-all leading-relaxed",children:eu})})]}),Q&&(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"rounded-md border border-border bg-muted/50 px-3 py-2 text-xs text-muted-foreground animate-in fade-in duration-200",children:Q})]}),!l&&r&&(0,s.jsxs)("div",{className:"shrink-0 border-t border-border px-5 py-3 flex items-center gap-2",children:[$&&(0,s.jsxs)("div",{className:"flex items-center gap-2 mr-auto",children:[(0,s.jsx)(f.A,{size:14,className:"text-muted-foreground","aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:r.enabled?d.enabled:d.disabled}),(0,s.jsx)(y.lM,{size:"sm",checked:r.enabled,onChange:e=>void en(e),disabled:V})]}),ea&&T&&(0,s.jsxs)("button",{type:"button",onClick:()=>B(!0),disabled:I,className:"inline-flex items-center gap-1.5 px-2.5 min-h-[32px] text-xs rounded-md border border-destructive/30 text-destructive hover:bg-destructive/10 cursor-pointer disabled:opacity-50 transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[I?(0,s.jsx)(g.A,{size:12,className:"animate-spin"}):(0,s.jsx)(b.A,{size:12}),d.deleteSkill]})]})]}),(0,s.jsx)(k.TM,{open:W,title:d.confirmDeleteTitle,message:t?d.confirmDeleteMessage(t):"",confirmLabel:d.confirmDeleteAction,cancelLabel:d.cancelAction,onConfirm:()=>void ei(),onCancel:()=>B(!1),variant:"destructive"})]})}function D({label:e,noMargin:t}){return(0,s.jsx)("h3",{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider ${t?"":"mb-2"}`,children:e})}function S({label:e,value:t,tone:r="default"}){return(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-muted/[0.03] px-3.5 py-3 hover:bg-muted/[0.06] transition-colors duration-100",children:[(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/60 block mb-1 uppercase tracking-wider",children:e}),(0,s.jsx)("span",{className:`text-sm font-semibold capitalize ${"ok"===r?"text-[var(--success)]":"muted"===r?"text-muted-foreground":"text-foreground"}`,children:t})]})}},90777:(e,t,r)=>{r.d(t,{A:()=>f});var s=r(95155),n=r(12115),i=r(33210),o=r(13545),l=r(12651),a=r(68822),d=r(66088),c=r(21362),u=r(6296),m=r(35581),p=r(15631),g=r(4235),x=r(20171);function f({open:e,onClose:t,onSuccess:r,existingAgents:f,editAgent:h}){let{t:v}=(0,m.Y)(),j=v.agentsContent.overview,y=(0,n.useRef)(null),k=(0,n.useRef)(null),N=!!h,[C,A]=(0,n.useState)("input"),[w,D]=(0,n.useState)(!1),[S,$]=(0,n.useState)(!1),[T,z]=(0,n.useState)(null),[L,K]=(0,n.useState)(null),[E,F]=(0,n.useState)(!1),[M,P]=(0,n.useState)(!1),[O,R]=(0,n.useState)({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""});(0,n.useEffect)(()=>{e&&(h?(R({name:h.name,baseDir:h.customBaseDir||"",global:h.globalPath||"",configKey:h.configKey||"mcpServers",format:h.format||"json",preferredTransport:h.preferredTransport||"stdio",project:h.projectPath||"",presenceCli:"",skillDir:h.skillWorkspacePath||""}),A("result"),P(!0),K(null),z(null)):(R({name:"",baseDir:"",global:"",configKey:"mcpServers",format:"json",preferredTransport:"stdio",project:"",presenceCli:"",skillDir:""}),A("input"),P(!1),K(null),z(null),F(!1)))},[e,h]),(0,n.useEffect)(()=>{e&&"input"===C&&setTimeout(()=>k.current?.focus(),100)},[e,C]),(0,p.r)(y,e),(0,n.useEffect)(()=>{if(!e)return;let r=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]);let _=(0,n.useMemo)(()=>{let e=new Set(f.map(e=>e.key));return N&&h&&e.delete(h.key),e},[f,N,h]),H=(0,n.useMemo)(()=>O.name.toLowerCase().replace(/[^\x20-\x7E]/g,"").replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-|-$/g,""),[O.name]),J=(0,n.useMemo)(()=>{if(N||!O.name.trim())return null;let e=H||"";if(!e)return null;if(_.has(e)){let t=f.find(t=>t.key===e);return t?.isCustom?j.customAgentKeyConflict?.(e)??`An agent with key "${e}" already exists`:j.customAgentBuiltinConflict?.(t?.name||e)??`Conflicts with built-in agent "${t?.name||e}"`}return null},[N,H,_,f,O.name,j]),q=O.name.trim()&&O.baseDir.trim()&&!J,W=(0,n.useCallback)((e,t)=>{R(r=>({...r,[e]:t}))},[]),B=(0,n.useCallback)(async()=>{if(!q)return;z(null),D(!0);let e=O.baseDir.trim();if(!e.startsWith("~/")){let t=e.endsWith("/")?e:e+"/";W("global",t+"mcp.json"),W("skillDir",t+"skills/"),K({exists:!1,hasSkillsDir:!1}),A("result"),D(!1);return}let t=new AbortController,r=setTimeout(()=>t.abort(),3e3);try{let s=await fetch("/api/agents/custom/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseDir:e}),signal:t.signal});clearTimeout(r);let n=await s.json();if(!s.ok)return void z(n.error||j.customAgentFailedSave);K(n),n.detectedConfig?W("global",n.detectedConfig):W("global",(e.endsWith("/")?e:e+"/")+"mcp.json"),n.detectedFormat&&W("format",n.detectedFormat),n.detectedConfigKey&&W("configKey",n.detectedConfigKey),W("skillDir",n.detectedSkillDir||(e.endsWith("/")?e:e+"/")+"skills/"),A("result")}catch{clearTimeout(r);let t=e.endsWith("/")?e:e+"/";W("global",t+"mcp.json"),W("skillDir",t+"skills/"),K({exists:!1,hasSkillsDir:!1}),F(!0),A("result")}finally{D(!1)}},[q,O.baseDir,W,j]),I=(0,n.useCallback)(async()=>{$(!0),z(null);let e=N?{key:h.key,name:O.name.trim(),baseDir:O.baseDir.trim(),global:O.global.trim()||void 0,configKey:O.configKey.trim()||void 0,format:O.format,preferredTransport:O.preferredTransport,project:O.project.trim()||null,presenceCli:O.presenceCli.trim()||void 0,skillDir:O.skillDir.trim()||void 0}:{name:O.name.trim(),baseDir:O.baseDir.trim(),global:O.global.trim()||void 0,configKey:O.configKey.trim()||void 0,format:O.format,preferredTransport:O.preferredTransport,project:O.project.trim()||null,presenceCli:O.presenceCli.trim()||void 0,skillDir:O.skillDir.trim()||void 0};try{let s=await fetch("/api/agents/custom",{method:N?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await s.json();if(!s.ok){z(n.error||j.customAgentFailedSave),$(!1);return}let i=N?j.customAgentUpdated(O.name.trim()):j.customAgentAdded(O.name.trim());g.oR.success(i),r(),t()}catch{z(j.customAgentNetworkError)}finally{$(!1)}},[N,h,O,r,t,j]),U=(0,n.useCallback)(e=>{"Enter"===e.key&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),"input"===C&&q&&!w?B():"result"!==C||S||I())},[C,q,w,S,B,I]);if(!e)return null;let Q=N?j.editCustomAgentTitle(h.name):j.addCustomAgentTitle;return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"custom-agent-modal-title",children:[(0,s.jsx)("div",{className:"absolute inset-0 modal-backdrop",onClick:t,"aria-hidden":"true"}),(0,s.jsxs)("div",{ref:y,className:"relative bg-card border border-border rounded-xl shadow-2xl max-w-md w-full mx-4 animate-in fade-in zoom-in-95 duration-200 max-h-[85vh] overflow-y-auto",onKeyDown:U,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-1",children:[(0,s.jsx)("h2",{id:"custom-agent-modal-title",className:"text-base font-semibold text-foreground",children:Q}),(0,s.jsx)("button",{type:"button",onClick:t,className:"w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,s.jsx)(i.A,{size:16})})]}),(0,s.jsxs)("div",{className:"px-5 py-4 space-y-4",children:[(0,s.jsxs)(x.D0,{label:j.customAgentName,children:[(0,s.jsx)("input",{ref:k,value:O.name,onChange:e=>W("name",e.target.value),placeholder:j.customAgentNamePlaceholder,"aria-invalid":!!J,className:`w-full px-3 py-2 text-sm bg-background border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${J?"border-[var(--error)] focus-visible:ring-[var(--error)]":"border-border"}`,autoComplete:"off"}),J?(0,s.jsxs)("p",{className:"text-xs text-[var(--error)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(o.A,{size:12}),J]}):O.name.trim()&&H?(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:j.customAgentKeyPreview(H)}):null]}),(0,s.jsxs)(x.D0,{label:j.customAgentDir,hint:"input"===C?j.customAgentDirHint:void 0,children:[(0,s.jsx)(x.pd,{value:O.baseDir,onChange:e=>{W("baseDir",e.target.value),"result"===C&&(A("input"),K(null))},placeholder:j.customAgentDirPlaceholder,autoComplete:"off"}),"result"===C&&L?.exists&&(0,s.jsxs)("p",{className:"text-xs text-[var(--success)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(l.A,{size:12}),j.customAgentDirFound]}),"result"===C&&L&&!L.exists&&!E&&(0,s.jsxs)("p",{className:"text-xs text-[var(--info,var(--muted-foreground))] mt-1 flex items-center gap-1",children:[(0,s.jsx)(a.A,{size:12}),j.customAgentDirNotFound]}),"result"===C&&E&&(0,s.jsxs)("p",{className:"text-xs text-[var(--amber)] mt-1 flex items-center gap-1",children:[(0,s.jsx)(o.A,{size:12}),j.customAgentDetectTimeout]})]}),"result"===C&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:`rounded-lg p-4 space-y-2 ${L?.exists?"border border-[var(--success)]/20 bg-[var(--success)]/5":"border border-border bg-muted/30"}`,children:[(0,s.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:L?.exists?j.customAgentDetectedTitle:j.customAgentDefaultTitle}),(0,s.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:j.customAgentConfigLabel}),(0,s.jsx)("span",{className:"text-foreground font-mono text-xs truncate",children:O.global}),(0,s.jsx)("span",{className:"text-muted-foreground",children:j.customAgentFormatLabel}),(0,s.jsxs)("span",{className:"text-foreground",children:[O.format.toUpperCase()," \xb7 ",O.configKey]}),(0,s.jsx)("span",{className:"text-muted-foreground",children:j.customAgentTransportLabel}),(0,s.jsx)("span",{className:"text-foreground",children:O.preferredTransport}),(0,s.jsx)("span",{className:"text-muted-foreground",children:j.customAgentSkillsLabel}),(0,s.jsx)("span",{className:"text-foreground",children:L?.hasSkillsDir?j.customAgentSkillsFound(L.skillCount??0):j.customAgentSkillsNone??"—"})]})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>P(e=>!e),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors duration-150 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded",children:[M?(0,s.jsx)(d.A,{size:14}):(0,s.jsx)(c.A,{size:14}),j.customAgentCustomize]}),(0,s.jsx)("div",{className:"grid transition-[grid-template-rows] duration-200 ease-out",style:{gridTemplateRows:M?"1fr":"0fr"},children:(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card/50 p-5 space-y-4",children:[(0,s.jsx)(x.D0,{label:j.customAgentConfigPath,children:(0,s.jsx)(x.pd,{value:O.global,onChange:e=>W("global",e.target.value),autoComplete:"off"})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsx)(x.D0,{label:j.customAgentConfigKey,children:(0,s.jsx)(x.pd,{value:O.configKey,onChange:e=>W("configKey",e.target.value),autoComplete:"off"})}),(0,s.jsx)(x.D0,{label:j.customAgentFormat,children:(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(b,{label:"JSON",checked:"json"===O.format,onChange:()=>W("format","json"),name:"format"}),(0,s.jsx)(b,{label:"TOML",checked:"toml"===O.format,onChange:()=>W("format","toml"),name:"format"})]})})]}),(0,s.jsx)(x.D0,{label:j.customAgentTransport,children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(b,{label:"stdio",checked:"stdio"===O.preferredTransport,onChange:()=>W("preferredTransport","stdio"),name:"transport"}),(0,s.jsx)(b,{label:"http",checked:"http"===O.preferredTransport,onChange:()=>W("preferredTransport","http"),name:"transport"})]})}),(0,s.jsx)(x.D0,{label:j.customAgentSkillDir,hint:j.customAgentSkillDirHint,children:(0,s.jsx)(x.pd,{value:O.skillDir,onChange:e=>W("skillDir",e.target.value),placeholder:j.customAgentSkillDirPlaceholder,autoComplete:"off"})}),(0,s.jsx)(x.D0,{label:j.customAgentProjectConfig,children:(0,s.jsx)(x.pd,{value:O.project,onChange:e=>W("project",e.target.value),autoComplete:"off"})}),(0,s.jsx)(x.D0,{label:j.customAgentCliBinary,children:(0,s.jsx)(x.pd,{value:O.presenceCli,onChange:e=>W("presenceCli",e.target.value),placeholder:j.customAgentCliBinaryPlaceholder,autoComplete:"off"})})]})})})]}),T&&(0,s.jsxs)("div",{className:"rounded-lg border border-[var(--error)]/30 bg-[var(--error)]/5 p-3 flex items-start gap-2",children:[(0,s.jsx)(o.A,{size:14,className:"text-[var(--error)] mt-0.5 shrink-0"}),(0,s.jsx)("p",{className:"text-sm text-[var(--error)]",children:T})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 px-5 pb-5 pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:t,className:"px-4 min-h-[36px] text-sm rounded-lg border border-border hover:bg-muted cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:j.customAgentCancel}),"input"===C?(0,s.jsx)("button",{type:"button",onClick:B,disabled:!q||w,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.A,{size:14,className:"animate-spin"}),j.customAgentDetecting]}):(0,s.jsxs)(s.Fragment,{children:[j.customAgentContinue,(0,s.jsx)(c.A,{size:14})]})}):(0,s.jsx)("button",{type:"button",onClick:I,disabled:S,className:"px-4 min-h-[36px] text-sm rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring flex items-center gap-2",children:S?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.A,{size:14,className:"animate-spin"}),N?j.customAgentSaving:j.customAgentAdding]}):T?j.customAgentRetry:N?j.customAgentSave:j.customAgentAdd})]})]})]})}function b({label:e,checked:t,onChange:r,name:n}){return(0,s.jsxs)("label",{className:`px-3 py-1.5 text-sm rounded-md border cursor-pointer transition-all duration-150 select-none ${t?"border-[var(--amber)]/40 bg-[var(--amber-dim)] text-foreground font-medium":"border-border bg-background text-muted-foreground hover:bg-muted"}`,children:[(0,s.jsx)("input",{type:"radio",name:n,checked:t,onChange:r,className:"sr-only"}),e]})}}}]);