sparkecoder 0.1.130 → 0.1.132

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 (216) hide show
  1. package/README.md +3 -3
  2. package/dist/agent/index.d.ts +3 -3
  3. package/dist/agent/index.js +1480 -638
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/cli.js +2281 -808
  6. package/dist/cli.js.map +1 -1
  7. package/dist/db/index.d.ts +2 -2
  8. package/dist/db/index.js.map +1 -1
  9. package/dist/{index-Bcz0aCAR.d.ts → index-BM99kjgq.d.ts} +177 -103
  10. package/dist/index.d.ts +5 -5
  11. package/dist/index.js +2215 -780
  12. package/dist/index.js.map +1 -1
  13. package/dist/{schema-BWbWmfDQ.d.ts → schema-Dz-wABVY.d.ts} +27 -4
  14. package/dist/{search-DOzC4ojH.d.ts → search-CVVfuBPZ.d.ts} +4 -4
  15. package/dist/server/index.js +2215 -780
  16. package/dist/server/index.js.map +1 -1
  17. package/dist/skills/default/build-context-and-solve-issue.md +74 -0
  18. package/dist/skills/default/doublecheck.md +95 -0
  19. package/dist/tools/index.d.ts +3 -3
  20. package/dist/tools/index.js +11 -2
  21. package/dist/tools/index.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/skills/default/build-context-and-solve-issue.md +74 -0
  24. package/src/skills/default/doublecheck.md +95 -0
  25. package/web/.next/BUILD_ID +1 -1
  26. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  27. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  28. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  29. package/web/.next/standalone/web/.next/server/app/(main)/agents/page/next-font-manifest.json +1 -1
  30. package/web/.next/standalone/web/.next/server/app/(main)/agents/page_client-reference-manifest.js +1 -1
  31. package/web/.next/standalone/web/.next/server/app/(main)/page/next-font-manifest.json +1 -1
  32. package/web/.next/standalone/web/.next/server/app/(main)/page_client-reference-manifest.js +1 -1
  33. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page/next-font-manifest.json +1 -1
  34. package/web/.next/standalone/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  35. package/web/.next/standalone/web/.next/server/app/(main)/settings/page/next-font-manifest.json +1 -1
  36. package/web/.next/standalone/web/.next/server/app/(main)/settings/page_client-reference-manifest.js +1 -1
  37. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  38. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/_not-found/page/next-font-manifest.json +1 -1
  45. package/web/.next/standalone/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  46. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  47. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +3 -3
  48. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  49. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  51. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  54. package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
  55. package/web/.next/standalone/web/.next/server/app/agents.rsc +6 -6
  56. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +2 -2
  57. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +2 -2
  59. package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +6 -6
  60. package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +3 -3
  62. package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +3 -3
  63. package/web/.next/standalone/web/.next/server/app/api/config/route.js.nft.json +1 -1
  64. package/web/.next/standalone/web/.next/server/app/api/health/route.js.nft.json +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs/installation/page/next-font-manifest.json +1 -1
  66. package/web/.next/standalone/web/.next/server/app/docs/installation/page_client-reference-manifest.js +1 -1
  67. package/web/.next/standalone/web/.next/server/app/docs/installation.html +4 -4
  68. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +6 -6
  69. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +6 -6
  70. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +3 -3
  72. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +2 -2
  73. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +20 -21
  74. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +2 -2
  76. package/web/.next/standalone/web/.next/server/app/docs/page/next-font-manifest.json +1 -1
  77. package/web/.next/standalone/web/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  78. package/web/.next/standalone/web/.next/server/app/docs/skills/page/next-font-manifest.json +1 -1
  79. package/web/.next/standalone/web/.next/server/app/docs/skills/page_client-reference-manifest.js +1 -1
  80. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  81. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +4 -4
  82. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +4 -4
  83. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  84. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +3 -3
  85. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +2 -2
  86. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  87. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  88. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +2 -2
  89. package/web/.next/standalone/web/.next/server/app/docs/tools/page/next-font-manifest.json +1 -1
  90. package/web/.next/standalone/web/.next/server/app/docs/tools/page_client-reference-manifest.js +1 -1
  91. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  92. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +4 -4
  93. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +4 -4
  94. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  95. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +3 -3
  96. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +2 -2
  97. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +2 -2
  98. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  99. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +2 -2
  100. package/web/.next/standalone/web/.next/server/app/docs.html +3 -3
  101. package/web/.next/standalone/web/.next/server/app/docs.rsc +5 -5
  102. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +5 -5
  103. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  104. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +3 -3
  105. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  106. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +3 -3
  107. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +2 -2
  108. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  109. package/web/.next/standalone/web/.next/server/app/index.rsc +6 -6
  110. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +2 -2
  111. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +2 -2
  112. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +6 -6
  113. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  114. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +3 -3
  115. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +3 -3
  116. package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
  117. package/web/.next/standalone/web/.next/server/app/settings.rsc +6 -6
  118. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +2 -2
  119. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
  120. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +2 -2
  121. package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +6 -6
  122. package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  123. package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +3 -3
  124. package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +3 -3
  125. package/web/.next/standalone/web/.next/server/chunks/[root-of-the-server]__36edac7c._.js +1 -1
  126. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__397fadd4._.js +1 -1
  127. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__70cecda8._.js +1 -1
  128. package/web/.next/standalone/web/.next/server/chunks/ssr/[root-of-the-server]__be5e2967._.js +1 -1
  129. package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_layout_tsx_453f6492._.js +1 -1
  130. package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_page_tsx_5ac4794b._.js +1 -1
  131. package/web/.next/standalone/web/.next/server/chunks/ssr/web_src_app_(main)_settings_page_tsx_eb320e07._.js +2 -2
  132. package/web/.next/standalone/web/.next/server/next-font-manifest.js +1 -1
  133. package/web/.next/standalone/web/.next/server/next-font-manifest.json +9 -9
  134. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  135. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  136. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  137. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  138. package/web/.next/standalone/web/.next/static/chunks/185f69f6478ba713.js +1 -0
  139. package/web/.next/standalone/web/.next/static/chunks/20ca4e35e9bb3e94.js +3 -0
  140. package/web/.next/standalone/web/.next/static/chunks/{a7d5d0791c8c6223.css → 34d933785a17edf3.css} +1 -1
  141. package/web/.next/standalone/web/.next/static/chunks/7549a5b7c7f6786e.js +1 -0
  142. package/web/.next/standalone/web/.next/static/{static/chunks/c5dd884b71007965.js → chunks/a839c83078c56476.js} +1 -1
  143. package/web/.next/standalone/web/.next/static/media/4fa387ec64143e14-s.3b336396.woff2 +0 -0
  144. package/web/.next/standalone/web/.next/static/media/5ce348bf30bf5439-s.56c1f21e.woff2 +0 -0
  145. package/web/.next/standalone/web/.next/static/media/6306c77e7c8268e4-s.e3369375.woff2 +0 -0
  146. package/web/.next/standalone/web/.next/static/media/797e433ab948586e-s.p.29207c2f.woff2 +0 -0
  147. package/web/.next/standalone/web/.next/static/media/7d817b4c03b0c5f1-s.a40b9a8b.woff2 +0 -0
  148. package/web/.next/standalone/web/.next/static/media/bbc41e54d2fcbd21-s.fe42ddf4.woff2 +0 -0
  149. package/web/.next/standalone/web/.next/static/static/chunks/185f69f6478ba713.js +1 -0
  150. package/web/.next/standalone/web/.next/static/static/chunks/20ca4e35e9bb3e94.js +3 -0
  151. package/web/.next/standalone/web/.next/static/static/chunks/{a7d5d0791c8c6223.css → 34d933785a17edf3.css} +1 -1
  152. package/web/.next/standalone/web/.next/static/static/chunks/7549a5b7c7f6786e.js +1 -0
  153. package/web/.next/{static/chunks/c5dd884b71007965.js → standalone/web/.next/static/static/chunks/a839c83078c56476.js} +1 -1
  154. package/web/.next/standalone/web/.next/static/static/media/4fa387ec64143e14-s.3b336396.woff2 +0 -0
  155. package/web/.next/standalone/web/.next/static/static/media/5ce348bf30bf5439-s.56c1f21e.woff2 +0 -0
  156. package/web/.next/standalone/web/.next/static/static/media/6306c77e7c8268e4-s.e3369375.woff2 +0 -0
  157. package/web/.next/standalone/web/.next/static/static/media/797e433ab948586e-s.p.29207c2f.woff2 +0 -0
  158. package/web/.next/standalone/web/.next/static/static/media/7d817b4c03b0c5f1-s.a40b9a8b.woff2 +0 -0
  159. package/web/.next/standalone/web/.next/static/static/media/bbc41e54d2fcbd21-s.fe42ddf4.woff2 +0 -0
  160. package/web/.next/standalone/web/package-lock.json +21 -21
  161. package/web/.next/standalone/web/runtime-config.json +2 -1
  162. package/web/.next/standalone/web/src/app/(main)/page.tsx +2 -2
  163. package/web/.next/standalone/web/src/app/(main)/settings/page.tsx +111 -11
  164. package/web/.next/standalone/web/src/app/__sfapi/[...path]/route.ts +96 -0
  165. package/web/.next/standalone/web/src/app/api/config/route.ts +5 -12
  166. package/web/.next/standalone/web/src/app/docs/installation/page.mdx +2 -2
  167. package/web/.next/standalone/web/src/app/docs/page.mdx +1 -1
  168. package/web/.next/standalone/web/src/components/sessions-sidebar.tsx +1 -1
  169. package/web/.next/standalone/web/src/lib/config.ts +26 -16
  170. package/web/.next/static/chunks/185f69f6478ba713.js +1 -0
  171. package/web/.next/static/chunks/20ca4e35e9bb3e94.js +3 -0
  172. package/web/.next/static/chunks/{a7d5d0791c8c6223.css → 34d933785a17edf3.css} +1 -1
  173. package/web/.next/static/chunks/7549a5b7c7f6786e.js +1 -0
  174. package/web/.next/{standalone/web/.next/static/chunks/c5dd884b71007965.js → static/chunks/a839c83078c56476.js} +1 -1
  175. package/web/.next/static/media/4fa387ec64143e14-s.3b336396.woff2 +0 -0
  176. package/web/.next/static/media/5ce348bf30bf5439-s.56c1f21e.woff2 +0 -0
  177. package/web/.next/static/media/6306c77e7c8268e4-s.e3369375.woff2 +0 -0
  178. package/web/.next/static/media/797e433ab948586e-s.p.29207c2f.woff2 +0 -0
  179. package/web/.next/static/media/7d817b4c03b0c5f1-s.a40b9a8b.woff2 +0 -0
  180. package/web/.next/static/media/bbc41e54d2fcbd21-s.fe42ddf4.woff2 +0 -0
  181. package/web/.next/standalone/web/.next/static/chunks/9b88f148788e4504.js +0 -3
  182. package/web/.next/standalone/web/.next/static/chunks/b203b9aa975135d3.js +0 -1
  183. package/web/.next/standalone/web/.next/static/chunks/ea89ca7892d8c557.js +0 -1
  184. package/web/.next/standalone/web/.next/static/media/4fa387ec64143e14-s.c36e1862.woff2 +0 -0
  185. package/web/.next/standalone/web/.next/static/media/5ce348bf30bf5439-s.ebceb24d.woff2 +0 -0
  186. package/web/.next/standalone/web/.next/static/media/6306c77e7c8268e4-s.ff4a2084.woff2 +0 -0
  187. package/web/.next/standalone/web/.next/static/media/797e433ab948586e-s.p.479bea2b.woff2 +0 -0
  188. package/web/.next/standalone/web/.next/static/media/7d817b4c03b0c5f1-s.f377b9c4.woff2 +0 -0
  189. package/web/.next/standalone/web/.next/static/media/bbc41e54d2fcbd21-s.d1207556.woff2 +0 -0
  190. package/web/.next/standalone/web/.next/static/static/chunks/9b88f148788e4504.js +0 -3
  191. package/web/.next/standalone/web/.next/static/static/chunks/b203b9aa975135d3.js +0 -1
  192. package/web/.next/standalone/web/.next/static/static/chunks/ea89ca7892d8c557.js +0 -1
  193. package/web/.next/standalone/web/.next/static/static/media/4fa387ec64143e14-s.c36e1862.woff2 +0 -0
  194. package/web/.next/standalone/web/.next/static/static/media/5ce348bf30bf5439-s.ebceb24d.woff2 +0 -0
  195. package/web/.next/standalone/web/.next/static/static/media/6306c77e7c8268e4-s.ff4a2084.woff2 +0 -0
  196. package/web/.next/standalone/web/.next/static/static/media/797e433ab948586e-s.p.479bea2b.woff2 +0 -0
  197. package/web/.next/standalone/web/.next/static/static/media/7d817b4c03b0c5f1-s.f377b9c4.woff2 +0 -0
  198. package/web/.next/standalone/web/.next/static/static/media/bbc41e54d2fcbd21-s.d1207556.woff2 +0 -0
  199. package/web/.next/static/chunks/9b88f148788e4504.js +0 -3
  200. package/web/.next/static/chunks/b203b9aa975135d3.js +0 -1
  201. package/web/.next/static/chunks/ea89ca7892d8c557.js +0 -1
  202. package/web/.next/static/media/4fa387ec64143e14-s.c36e1862.woff2 +0 -0
  203. package/web/.next/static/media/5ce348bf30bf5439-s.ebceb24d.woff2 +0 -0
  204. package/web/.next/static/media/6306c77e7c8268e4-s.ff4a2084.woff2 +0 -0
  205. package/web/.next/static/media/797e433ab948586e-s.p.479bea2b.woff2 +0 -0
  206. package/web/.next/static/media/7d817b4c03b0c5f1-s.f377b9c4.woff2 +0 -0
  207. package/web/.next/static/media/bbc41e54d2fcbd21-s.d1207556.woff2 +0 -0
  208. /package/web/.next/standalone/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_buildManifest.js +0 -0
  209. /package/web/.next/standalone/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_clientMiddlewareManifest.json +0 -0
  210. /package/web/.next/standalone/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_ssgManifest.js +0 -0
  211. /package/web/.next/standalone/web/.next/static/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_buildManifest.js +0 -0
  212. /package/web/.next/standalone/web/.next/static/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_clientMiddlewareManifest.json +0 -0
  213. /package/web/.next/standalone/web/.next/static/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_ssgManifest.js +0 -0
  214. /package/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_buildManifest.js +0 -0
  215. /package/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_clientMiddlewareManifest.json +0 -0
  216. /package/web/.next/static/{2mUQ8I-TCRE5uOBFhIWag → WaAcu3X3K00MDvfn1ik7H}/_ssgManifest.js +0 -0
@@ -1,5 +1,5 @@
1
- module.exports=[344934,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(252831),e=a.i(335520);let f=(0,e.default)("slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]]),g=(0,e.default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),h=(0,e.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),i=(0,e.default)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);var j=a.i(470564);let k=(0,e.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var l=a.i(762491),m=a.i(916454),n=a.i(95041),o=a.i(393700),p=a.i(190555),q=a.i(870514);let r=(0,e.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var s=a.i(221557),t=a.i(96014),t=t,u=a.i(300274);let v=(0,e.default)("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"}]]),w=(0,e.default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]);var x=a.i(195304),x=x,y=a.i(981965),y=y,z=a.i(64797),z=z,A=a.i(108343),B=a.i(589130),B=B,C=a.i(29950),C=C;let D=(0,e.default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var E=a.i(872),E=E,F=a.i(305165);let G=(0,e.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var H=a.i(257305);let I=(0,e.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var J=a.i(476031),K=a.i(338706),L=a.i(878137),M=a.i(555941),N=a.i(156033);let O=a=>`${(0,M.getApiUrl)()}${a}`;async function P(a,b){return(await fetch(O(a),{...b,headers:{"Content-Type":"application/json",...b?.headers||{}}})).json()}let Q=[{id:"general",label:"General",icon:q.Bot},{id:"integrations",label:"Integrations",icon:f},{id:"mcp",label:"MCP",icon:w},{id:"skills",label:"Skills",icon:C.default},{id:"schedules",label:"Schedules",icon:h},{id:"webhooks",label:"Webhooks",icon:i},{id:"audit",label:"Audit log",icon:x.default},{id:"models",label:"Models",icon:r},{id:"apikeys",label:"API Keys",icon:s.Key}];function R(){let[a,d]=(0,c.useState)("general"),[e,f]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let a=!1;return(async()=>{try{let b,c=await fetch(O("/health"));if(!c.ok)return;let d=await c.json();try{let a=d&&d.config?.remoteServer?.url;if(a){let c=await fetch(`${a.replace(/\/$/,"")}/health`);c.ok&&(b=(await c.json()).version)}}catch{}a||f({version:d?.version,remoteVersion:b})}catch{}})(),()=>{a=!0}},[]),(0,b.jsxs)("div",{className:"h-full flex bg-background",children:[(0,b.jsxs)("nav",{className:"w-56 shrink-0 border-r border-border/60 p-3 overflow-y-auto",children:[(0,b.jsxs)("div",{className:"px-2 py-2 mb-2",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:"Settings"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Configure your orchestrator and channels."}),e?.version&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 mt-1 font-mono",children:["sparkecoder v",e.version,e.remoteVersion&&(0,b.jsxs)(b.Fragment,{children:[" · remote v",e.remoteVersion]})]})]}),(0,b.jsx)("ul",{className:"space-y-0.5",children:Q.map(c=>{let e=c.icon,f=a===c.id;return(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>d(c.id),className:(0,N.cn)("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-sm transition-colors",f?"bg-accent text-foreground":"hover:bg-accent/60 text-foreground/80"),children:[(0,b.jsx)(e,{className:(0,N.cn)("size-4 shrink-0",f?"text-primary":"text-muted-foreground")}),(0,b.jsx)("span",{children:c.label})]})},c.id)})})]}),(0,b.jsx)("div",{className:"flex-1 min-w-0 overflow-y-auto",children:(0,b.jsxs)("div",{className:"max-w-3xl mx-auto p-6",children:["general"===a&&(0,b.jsx)(T,{}),"integrations"===a&&(0,b.jsx)(U,{}),"mcp"===a&&(0,b.jsx)(ai,{}),"schedules"===a&&(0,b.jsx)(_,{}),"webhooks"===a&&(0,b.jsx)(ac,{}),"audit"===a&&(0,b.jsx)(an,{}),"models"===a&&(0,b.jsx)(af,{}),"apikeys"===a&&(0,b.jsx)(ag,{}),"skills"===a&&(0,b.jsx)(ao,{})]})})]})}function S({title:a,description:c}){return(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a}),c&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:c})]})}function T(){let[a,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(!1),n=(0,c.useCallback)(async()=>{let a=await P("/api/orchestrator");e(a),g(a.name||""),i(a.personality||"")},[]);(0,c.useEffect)(()=>{n()},[n]);let o=async()=>{k(!0),m(!1);try{await P("/api/orchestrator",{method:"PATCH",body:JSON.stringify({name:f||void 0,personality:h})}),m(!0),setTimeout(()=>m(!1),1500)}finally{k(!1)}};if(!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let p=f!==a.name||h!==(a.personality||"");return(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"Orchestrator",description:"Your supervisor agent's name and personality. The personality is appended to its system prompt."}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-sm font-medium",children:"Agent name"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Shown in the sidebar and chat header."}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"Orchestrator",className:"max-w-md"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-sm font-medium",children:"Personality / persona"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Optional. Free-form instructions appended to your orchestrator's system prompt every turn. Examples: ",(0,b.jsx)("em",{children:'"speak in haiku"'}),", ",(0,b.jsx)("em",{children:'"be terse and professional"'}),", ",(0,b.jsx)("em",{children:'"respond in Korean"'}),",",(0,b.jsx)("em",{children:'"you are a senior engineer who values shipping over perfection"'}),"."]}),(0,b.jsx)("textarea",{value:h,onChange:a=>i(a.target.value),rows:6,placeholder:"(blank = default tone)",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3 pt-1",children:[(0,b.jsxs)(J.Button,{onClick:o,disabled:!p||j,children:[j?(0,b.jsx)(d.Loader2,{className:"size-4 animate-spin mr-2"}):null,"Save"]}),l&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"})]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/40 bg-muted/30 p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session id:"})," ",(0,b.jsx)("code",{children:a.id})]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Model:"})," ",(0,b.jsx)("code",{children:a.model})]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Working directory:"})," ",(0,b.jsx)("code",{className:"break-all",children:a.workingDirectory})]})]})]})]})}function U(){let[a,e]=(0,c.useState)(null),f=(0,c.useCallback)(async()=>{e(await P("/api/integrations"))},[]);return((0,c.useEffect)(()=>{f()},[f]),a)?(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)(S,{title:"Integrations",description:"External channels the orchestrator can send and receive messages on."}),(0,b.jsx)(V,{data:a,onChange:f}),(0,b.jsx)($,{data:a})]}):(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})})}function V({data:a,onChange:e}){var g;let h,[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!1),[s,u]=(0,c.useState)(""),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),A=async()=>{r(!0);try{await P("/api/integrations/slack",{method:"POST",body:JSON.stringify({botToken:i||void 0,signingSecret:k||void 0})}),j(""),l(""),e()}finally{r(!1)}},B=async()=>{confirm("Remove Slack credentials?")&&(await P("/api/integrations/slack",{method:"DELETE"}),e())},C=async()=>{if(!s)return;x("Sending…");let a=await P("/api/integrations/slack/test",{method:"POST",body:JSON.stringify({channel:s})});x(a.ok?"Sent.":`Failed: ${a.error}`)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(al,{children:[(0,b.jsx)(am,{icon:(0,b.jsx)(f,{className:"size-4 text-[#4A154B] dark:text-pink-300"}),title:"Slack",status:a.slack.configured?"Configured":"Not configured",statusTone:a.slack.configured?"text-emerald-500":"text-muted-foreground"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:"Lets the orchestrator receive @mentions and DMs in Slack and reply in-thread via the messenger tool."}),(0,b.jsx)("div",{className:"flex gap-2 mb-3",children:(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>z(!0),children:[(0,b.jsx)(t.default,{className:"size-3.5 mr-1.5"}),"Setup instructions"]})}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Bot token (xoxb-...)"}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(K.Input,{type:m?"text":"password",value:i,onChange:a=>j(a.target.value),placeholder:a.slack.botTokenSet?"(set)":"xoxb-...",className:"text-xs"}),(0,b.jsx)(J.Button,{variant:"outline",size:"icon",onClick:()=>n(a=>!a),children:m?(0,b.jsx)(p.EyeOff,{className:"size-3.5"}):(0,b.jsx)(o.Eye,{className:"size-3.5"})})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Signing secret"}),(0,b.jsx)(K.Input,{type:"password",value:k,onChange:a=>l(a.target.value),placeholder:a.slack.signingSecretSet?"(set)":"...",className:"text-xs"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:A,disabled:q||!i&&!k,children:q?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),a.slack.configured&&(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:B,children:"Disconnect"})]})]}),(0,b.jsxs)("div",{className:"mt-3 rounded border border-border/40 bg-background/50 p-2 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("strong",{children:"Events URL"})," (paste into Slack → Event Subscriptions):"]}),(0,b.jsx)("code",{className:"block px-2 py-1 rounded bg-muted text-[11px] break-all",children:a.slack.eventsUrl}),(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Subscribe to bot events: ",(0,b.jsx)("code",{children:"app_mention"}),", ",(0,b.jsx)("code",{children:"message.im"}),"."]})]}),a.slack.configured&&(0,b.jsxs)("div",{className:"mt-3 flex gap-2 items-end",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Test post (channel id or #channel)"}),(0,b.jsx)(K.Input,{value:s,onChange:a=>u(a.target.value),placeholder:"C0123 or #general",className:"text-xs"})]}),(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:C,disabled:!s,children:"Send test"}),w&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:w})]})]}),(0,b.jsxs)(al,{children:[(0,b.jsx)(am,{icon:(0,b.jsx)(v,{className:"size-4 text-amber-500"}),title:"Slack access control",status:(g=a.slack,h=[],g.allowedUsers.length>0&&h.push(`${g.allowedUsers.length} user(s)`),g.allowedChannels.length>0&&h.push(`${g.allowedChannels.length} channel(s)`),g.allowDmsFromAnyone||h.push("DMs locked"),0===h.length?"Open to anyone":h.join(" · ")),statusTone:"text-muted-foreground"}),(0,b.jsx)(W,{data:a,onChange:e})]}),y&&(0,b.jsx)(X,{eventsUrl:a.slack.eventsUrl,agentName:a.slack.defaultOrchestratorName||"orchestrator",onClose:()=>z(!1)})]})}function W({data:a,onChange:e}){let[f,g]=(0,c.useState)(a.slack.allowedUsers.join(", ")),[h,i]=(0,c.useState)(a.slack.allowedChannels.join(", ")),[j,k]=(0,c.useState)(a.slack.allowDmsFromAnyone),[l,m]=(0,c.useState)(a.slack.deniedReplyEnabled),[n,o]=(0,c.useState)(a.slack.deniedReplyTemplate),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),t=f.trim()!==a.slack.allowedUsers.join(", ").trim()||h.trim()!==a.slack.allowedChannels.join(", ").trim()||j!==a.slack.allowDmsFromAnyone||l!==a.slack.deniedReplyEnabled||n!==a.slack.deniedReplyTemplate,u=async()=>{q(!0),s(!1);try{let a=a=>a.split(/[\s,]+/).map(a=>a.trim()).filter(Boolean);await P("/api/integrations/slack",{method:"POST",body:JSON.stringify({allowedUsers:a(f),allowedChannels:a(h),allowDmsFromAnyone:j,deniedReplyEnabled:l,deniedReplyTemplate:n})}),e(),s(!0),setTimeout(()=>s(!1),1500)}finally{q(!1)}};return(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Empty lists = no allowlist (accept anyone Slack delivers an event for). When a list is set, only matching users / channels can talk to the orchestrator."}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Allowed users (Slack user IDs)"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Comma or space separated. e.g. ",(0,b.jsx)("code",{children:"U01ABCD"}),", ",(0,b.jsx)("code",{children:"U09XYZ"}),". Leave blank to allow anyone."]}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"U01..., U02...",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Allowed channels (Slack channel IDs)"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Channel IDs only (not ",(0,b.jsx)("code",{children:"#name"}),"). e.g. ",(0,b.jsx)("code",{children:"C012345"}),". Affects @mentions; DMs use the toggle below."]}),(0,b.jsx)(K.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"C012345, C098765",className:"text-xs font-mono"})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:j,onChange:a=>k(a.target.checked),className:"mt-1"}),(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"font-medium",children:"Allow DMs from anyone"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"On: anyone who DMs your bot can talk to it. Off: only users in the allowlist above can DM."})]})]}),(0,b.jsxs)("div",{className:"border-t border-border/40 pt-3",children:[(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:l,onChange:a=>m(a.target.checked),className:"mt-1"}),(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"font-medium",children:"Auto-reply to denied users"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"When someone is blocked by the rules above, post a canned reply (no AI) so they know why nothing happened. Posted in-thread for @mentions; in the DM for DMs."})]})]}),(0,b.jsxs)("div",{className:"mt-2 pl-6",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Reply template"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Placeholders: ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"{user}"})," → mentions the requester, ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"{channel}"})," → mentions the channel."]}),(0,b.jsx)("textarea",{value:n,onChange:a=>o(a.target.value),rows:3,disabled:!l,className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs disabled:opacity-50"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:u,disabled:!t||p,children:p?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),r&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"})]})]})}function X({eventsUrl:a,agentName:d,onClose:e}){var g;let h,i,[j,k]=(0,c.useState)(null),l=(g=a,JSON.stringify({display_information:{name:i=(h=(d||"orchestrator").trim()||"orchestrator").slice(0,35),description:`${i} — your orchestrator agent. Spawns worker agents, posts updates, answers questions.`,background_color:"#1f1f24"},features:{bot_user:{display_name:h.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"orchestrator",always_online:!0},app_home:{home_tab_enabled:!1,messages_tab_enabled:!0,messages_tab_read_only_enabled:!1}},oauth_config:{scopes:{bot:["app_mentions:read","channels:history","chat:write","groups:history","im:history","im:read","im:write","users:read"]}},settings:{event_subscriptions:{request_url:g,bot_events:["app_mention","message.im","message.channels","message.groups"]},interactivity:{is_enabled:!1},org_deploy_enabled:!1,socket_mode_enabled:!1,token_rotation_enabled:!1}},null,2)),m=async(a,b)=>{await navigator.clipboard.writeText(b),k(a),setTimeout(()=>k(null),1500)};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:e,children:(0,b.jsxs)("div",{className:"bg-card rounded-lg border border-border max-w-2xl w-full max-h-[85vh] overflow-y-auto shadow-2xl",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/60 sticky top-0 bg-card",children:[(0,b.jsxs)("h2",{className:"text-base font-semibold flex items-center gap-2",children:[(0,b.jsx)(f,{className:"size-4 text-[#4A154B] dark:text-pink-300"}),"Slack setup"]}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:e,children:(0,b.jsx)(u.X,{className:"size-4"})})]}),(0,b.jsxs)("div",{className:"p-5 space-y-5 text-sm",children:[(0,b.jsxs)(Y,{n:1,title:"Create a Slack app from manifest",children:[(0,b.jsxs)("p",{children:["Go to ",(0,b.jsx)("a",{href:"https://api.slack.com/apps?new_app=1",target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"api.slack.com/apps"}),", click ",(0,b.jsx)("strong",{children:"Create New App"})," → ",(0,b.jsx)("strong",{children:"From a manifest"}),", pick your workspace, paste the YAML below, then create."]}),(0,b.jsx)(Z,{label:"Slack manifest",value:l,onCopy:()=>m("manifest",l),copied:"manifest"===j})]}),(0,b.jsxs)(Y,{n:2,title:"Grab credentials",children:[(0,b.jsxs)("p",{children:["In your new app's ",(0,b.jsx)("strong",{children:"Basic Information"})," page, copy the ",(0,b.jsx)("strong",{children:"Signing Secret"}),". Then under ",(0,b.jsx)("strong",{children:"OAuth & Permissions"}),", install the app to your workspace and copy the ",(0,b.jsx)("strong",{children:"Bot User OAuth Token"})," (starts with ",(0,b.jsx)("code",{children:"xoxb-"}),")."]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paste both into the Slack card above, then click Save."})]}),(0,b.jsxs)(Y,{n:3,title:"Verify the Events URL",children:[(0,b.jsxs)("p",{children:["Slack will challenge the URL automatically when you create the app from the manifest (it's pre-filled with your URL below). If it shows ",(0,b.jsx)("strong",{children:"Verified"})," you're done."]}),(0,b.jsx)(Z,{label:"Events URL (already in the manifest)",value:a,onCopy:()=>m("eventsUrl",a),copied:"eventsUrl"===j,mono:!0}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"If verification fails, your sparkecoder isn't reachable from the public internet. Set up a cloudflared tunnel — see the Cloudflared card."})]}),(0,b.jsx)(Y,{n:4,title:"Invite the bot to channels",children:(0,b.jsxs)("p",{children:["In Slack: ",(0,b.jsx)("code",{children:"/invite @your-bot-name"})," in any channel you want it to respond in. (DMs work without an invite.)"]})}),(0,b.jsxs)(Y,{n:5,title:"Lock it down (optional but recommended)",children:[(0,b.jsxs)("p",{children:["By default ",(0,b.jsx)("strong",{children:"anyone"})," in your workspace can DM the bot or mention it in any channel it's in. Use the ",(0,b.jsx)("strong",{children:"Slack access control"})," section to limit access to specific Slack user IDs and channel IDs."]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Find a user ID: click their name in Slack → ⋮ → Copy member ID. Find a channel ID: click the channel name → About → bottom of the panel."})]})]})]})})}function Y({n:a,title:c,children:d}){return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("h3",{className:"font-medium flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex items-center justify-center size-5 rounded-full bg-primary/15 text-primary text-[11px] font-semibold",children:a}),c]}),(0,b.jsx)("div",{className:"pl-7 space-y-2 text-sm text-foreground/90",children:d})]})}function Z({label:a,value:c,onCopy:d,copied:e,mono:f}){return(0,b.jsxs)("div",{className:"rounded border border-border/60 bg-background/60 overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-3 py-1.5 flex items-center justify-between border-b border-border/40 bg-muted/40",children:[(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:a}),(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",onClick:d,className:"h-6 text-[11px]",children:[e?(0,b.jsx)(n.Check,{className:"size-3 mr-1"}):(0,b.jsx)(j.Copy,{className:"size-3 mr-1"}),e?"Copied":"Copy"]})]}),(0,b.jsx)("pre",{className:(0,N.cn)("px-3 py-2 text-[11px] overflow-x-auto whitespace-pre-wrap break-all",f&&"font-mono"),children:c})]})}function $({data:a}){return(0,b.jsxs)(al,{children:[(0,b.jsx)(am,{icon:(0,b.jsx)(g,{className:"size-4 text-orange-500"}),title:"Cloudflared tunnel",status:a.cloudflared.publicBaseUrl?"Hostname set":"Local-only",statusTone:a.cloudflared.publicBaseUrl?"text-emerald-500":"text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mb-2",children:["Required to receive Slack events and webhook hits from the public internet. Run"," ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted text-[11px]",children:"sparkecoder cloudflared-setup"})," for a copy-paste recipe."]}),a.cloudflared.publicBaseUrl&&(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Public base: "}),(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:a.cloudflared.publicBaseUrl})]}),a.cfAccess.enabled&&(0,b.jsxs)("div",{className:"mt-2 text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"CF Access: "}),(0,b.jsx)("span",{className:"text-emerald-500",children:"enabled"}),a.cfAccess.allowedEmails.length>0&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" · ",a.cfAccess.allowedEmails.length," allowed email(s)"]})]})]})}function _(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(!1),g=(0,c.useCallback)(async()=>{d((await P("/api/schedules")).schedules||[])},[]);return(0,c.useEffect)(()=>{g()},[g]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Schedules",description:"Recurring prompts that wake the orchestrator on a cron."}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>f(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),e&&(0,b.jsx)(aa,{onCancel:()=>f(!1),onSaved:()=>{f(!1),g()}}),0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No schedules yet."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(ab,{row:a,onChange:g},a.id))})]})}function aa({initial:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(a?.name||""),[i,j]=(0,c.useState)(a?.cron||"0 9 * * 1-5"),[k,l]=(0,c.useState)(a?.prompt||""),[m,n]=(0,c.useState)(a?.replyChannel||""),[o,p]=(0,c.useState)(!1),q=async()=>{if(g&&i&&k){p(!0);try{a?.id?await P(`/api/schedules/${a.id}`,{method:"PATCH",body:JSON.stringify({name:g,cron:i,prompt:k,replyChannel:m||void 0})}):await P("/api/schedules",{method:"POST",body:JSON.stringify({name:g,cron:i,prompt:k,replyChannel:m||void 0})}),f()}finally{p(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"standup-9am",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Cron (5 fields)"}),(0,b.jsx)(K.Input,{value:i,onChange:a=>j(a.target.value),placeholder:"0 9 * * 1-5",className:"text-xs font-mono"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Prompt"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"Summarize yesterday's git activity",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Default reply channel (optional)"}),(0,b.jsx)(K.Input,{value:m,onChange:a=>n(a.target.value),placeholder:"slack:#standup",className:"text-xs"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:q,disabled:o||!g||!i||!k,children:o?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function ab({row:a,onChange:c}){let d=async()=>{await P(`/api/schedules/${a.id}`,{method:"PATCH",body:JSON.stringify({enabled:!a.enabled})}),c()},e=async()=>{confirm(`Delete schedule "${a.name}"?`)&&(await P(`/api/schedules/${a.id}`,{method:"DELETE"}),c())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 flex items-start gap-3",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),!a.enabled&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"paused"})]}),(0,b.jsx)("code",{className:"text-[11px] text-muted-foreground font-mono",children:a.cron}),(0,b.jsx)("p",{className:"text-xs mt-1 line-clamp-2 text-foreground/80",children:a.prompt}),a.replyChannel&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["replyChannel: ",a.replyChannel]}),a.lastFiredAt&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["last fired ",new Date(a.lastFiredAt).toLocaleString()]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:d,children:a.enabled?"Pause":"Resume"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]})]})}function ac(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(!1),g=(0,c.useCallback)(async()=>{d((await P("/api/webhooks")).webhooks||[])},[]);return(0,c.useEffect)(()=>{g()},[g]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Webhooks",description:"Custom token-protected URLs. POST any JSON to ping the orchestrator."}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>f(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),e&&(0,b.jsx)(ad,{onCancel:()=>f(!1),onSaved:()=>{f(!1),g()}}),0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No webhooks yet."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(ae,{row:a,onChange:g},a.id))})]})}function ad({onCancel:a,onSaved:e}){let[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)("now"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(!1),n=async()=>{if(f){m(!0);try{await P("/api/webhooks",{method:"POST",body:JSON.stringify({name:f,wake:h,template:j||void 0})}),e()}finally{m(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"github-prs",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Wake"}),(0,b.jsxs)("select",{value:h,onChange:a=>i(a.target.value),className:"w-full text-xs h-9 rounded-md border border-input bg-background px-2",children:[(0,b.jsx)("option",{value:"now",children:"now — ping orchestrator immediately"}),(0,b.jsx)("option",{value:"next",children:"next — add as context, fire later"})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Template (optional)"}),(0,b.jsx)(K.Input,{value:j,onChange:a=>k(a.target.value),placeholder:"PR {{pull_request.title}} by {{sender.login}}",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:n,disabled:l||!f,children:l?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Create"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:a,children:"Cancel"})]})]})}function ae({row:a,onChange:d}){let[e,f]=(0,c.useState)(!1),g=async()=>{await navigator.clipboard.writeText(a.url),f(!0),setTimeout(()=>f(!1),1500)},h=async()=>{confirm("Rotate the token?")&&(await P(`/api/webhooks/${a.id}`,{method:"PATCH",body:JSON.stringify({rotateToken:!0})}),d())},i=async()=>{confirm(`Delete webhook "${a.name}"?`)&&(await P(`/api/webhooks/${a.id}`,{method:"DELETE"}),d())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsxs)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:["wake=",a.wake]}),(0,b.jsxs)("span",{className:"ml-auto text-[11px] text-muted-foreground",children:[a.hitCount," hit",1===a.hitCount?"":"s"]})]}),(0,b.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,b.jsx)("code",{className:"flex-1 text-[11px] px-2 py-1 rounded bg-muted break-all",children:a.url}),(0,b.jsx)(J.Button,{size:"icon",variant:"outline",onClick:g,children:e?(0,b.jsx)(n.Check,{className:"size-3.5"}):(0,b.jsx)(j.Copy,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"icon",variant:"outline",onClick:h,title:"Rotate token",children:(0,b.jsx)(k,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:i,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),a.template&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground font-mono",children:["template: ",a.template]}),a.lastHitAt&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["last hit ",new Date(a.lastHitAt).toLocaleString()]})]})}function af(){let[a,e]=(0,c.useState)(null);if((0,c.useEffect)(()=>{(async()=>{e(await (0,M.getConfig)())})()},[]),!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let f=a.availableModels.find(b=>b.id===a.defaultModel);return(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"Models",description:"Default model used for new sessions (orchestrator + workers). You can override per-session from the chat header."}),(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 max-w-lg",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Current default"}),(0,b.jsxs)("p",{className:"text-sm mt-1",children:[(0,b.jsx)("strong",{children:f?.name||a.defaultModel}),f?.provider&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",f.provider]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-2",children:["To change the default, set ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"defaultModel"})," in your"," ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"sparkecoder.config.json"})," and restart the server."]})]}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)(L.Label,{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Available models"}),(0,b.jsx)("div",{className:"mt-2 rounded-lg border border-border/60 divide-y divide-border/40",children:a.availableModels.map(c=>(0,b.jsxs)("div",{className:(0,N.cn)("flex items-center justify-between px-3 py-2 text-sm",c.id===a.defaultModel&&"bg-primary/5"),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"font-medium",children:c.name}),(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",c.provider]}),c.id===a.defaultModel&&(0,b.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-primary",children:"default"})]}),(0,b.jsx)("code",{className:"text-[10px] text-muted-foreground font-mono",children:c.id})]},c.id))})]})]})}function ag(){let[a,d]=(0,c.useState)([]),e=(0,c.useCallback)(async()=>{d((await P("/health/api-keys")).providers||[])},[]);return(0,c.useEffect)(()=>{e()},[e]),(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"API Keys",description:"Provider credentials used for AI inference (Vercel AI Gateway etc.). Keys are stored locally."}),(0,b.jsxs)("div",{className:"space-y-2",children:[a.map(a=>(0,b.jsx)(ah,{keyStatus:a,onChange:e},a.provider)),0===a.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No providers configured."})]})]})}function ah({keyStatus:a,onChange:e}){let[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[m,n]=(0,c.useState)(!1),q=async()=>{if(h.trim()){n(!0);try{await P("/health/api-keys",{method:"POST",body:JSON.stringify({provider:a.provider,apiKey:h.trim()})}),i(""),g(!1),e()}finally{n(!1)}}},r=async()=>{confirm(`Remove ${a.provider} API key?`)&&(await fetch(O(`/health/api-keys/${a.provider}`),{method:"DELETE"}),e())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),a.configured&&(0,b.jsx)("span",{className:(0,N.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===a.source?"bg-blue-500/20 text-blue-600 dark:text-blue-300":"bg-emerald-500/20 text-emerald-600 dark:text-emerald-300"),children:"env"===a.source?"from env":"saved"}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground font-mono",children:a.envVar})]}),f?(0,b.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(K.Input,{type:j?"text":"password",value:h,onChange:a=>i(a.target.value),placeholder:"Paste your API key…",className:"pr-8 text-xs font-mono",autoFocus:!0}),(0,b.jsx)(J.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>k(a=>!a),children:j?(0,b.jsx)(p.EyeOff,{className:"size-3.5"}):(0,b.jsx)(o.Eye,{className:"size-3.5"})})]}),(0,b.jsx)(J.Button,{size:"sm",onClick:q,disabled:m||!h.trim(),children:m?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>{g(!1),i("")},children:"Cancel"})]}):(0,b.jsxs)("div",{className:"flex items-center mt-1",children:[(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono flex-1",children:a.configured?a.maskedKey:"Not configured"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>g(!0),className:"h-7 text-xs",children:a.configured?"Update":"Add"}),a.configured&&"storage"===a.source&&(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:r,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]})]})}function ai(){let[a,e]=(0,c.useState)([]),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(!0),j=(0,c.useCallback)(async()=>{i(!0);try{let a=await P("/api/mcp");e(a.servers||[])}finally{i(!1)}},[]);return(0,c.useEffect)(()=>{j()},[j]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"MCP integrations",description:'Model Context Protocol servers. Each adds tools to every agent under "mcp_<name>_<tool>" on the next turn.'}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>g(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-3 max-w-2xl",children:["For OAuth-protected MCP servers, paste the access token as a header here:",(0,b.jsx)("code",{className:"px-1 rounded bg-muted ml-1",children:"{ Authorization: 'Bearer <your-token>' }"}),". For unauthed servers, leave headers empty. Use ",(0,b.jsx)("strong",{children:"Test"})," to confirm the server is reachable."]}),f&&(0,b.jsx)(aj,{onCancel:()=>g(!1),onSaved:()=>{g(!1),j()}}),h?(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)(d.Loader2,{className:"size-4 animate-spin text-muted-foreground"})}):0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No MCP servers configured."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(ak,{row:a,onChange:j},a.id))})]})}function aj({initial:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(a?.name||""),[i,j]=(0,c.useState)(a?.transport||"http"),[k,l]=(0,c.useState)(a?.url||""),[m,n]=(0,c.useState)(a?.headers?JSON.stringify(a.headers,null,2):""),[o,p]=(0,c.useState)(a?.command||""),[q,r]=(0,c.useState)(a?.args?.join(" ")||""),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),w=async()=>{let b;if(v(null),m.trim())try{let a=JSON.parse(m);a&&"object"==typeof a&&(b=a)}catch{v('Headers must be valid JSON, e.g. {"Authorization":"Bearer xxx"}');return}t(!0);try{let c={name:g,transport:i,enabled:!0};("http"===i||"sse"===i)&&(c.url=k,b&&(c.headers=b)),"stdio"===i&&(c.command=o,c.args=q.split(/\s+/).filter(Boolean)),a?.id?await P(`/api/mcp/${a.id}`,{method:"PATCH",body:JSON.stringify(c)}):await P("/api/mcp",{method:"POST",body:JSON.stringify(c)}),f()}catch(a){v(a?.message||"Save failed")}finally{t(!1)}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-3 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,b.jsxs)("div",{className:"col-span-2",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"github",className:"text-xs"}),(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Used as a tool prefix (e.g. ",(0,b.jsx)("code",{children:"mcp_github_search"}),")."]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Transport"}),(0,b.jsxs)("select",{value:i,onChange:a=>j(a.target.value),className:"w-full text-xs h-9 rounded-md border border-input bg-background px-2",children:[(0,b.jsx)("option",{value:"http",children:"HTTP (recommended)"}),(0,b.jsx)("option",{value:"sse",children:"SSE"}),(0,b.jsx)("option",{value:"stdio",children:"stdio (local)"})]})]})]}),"stdio"!==i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"URL"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"https://your-server.com/mcp",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Headers (JSON, optional)"}),(0,b.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),rows:3,placeholder:'{ "Authorization": "Bearer xxx" }',className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono"})]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Command"}),(0,b.jsx)(K.Input,{value:o,onChange:a=>p(a.target.value),placeholder:"node",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Args (space separated)"}),(0,b.jsx)(K.Input,{value:q,onChange:a=>r(a.target.value),placeholder:"src/stdio/dist/server.js",className:"text-xs font-mono"})]})]}),u&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:u}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:w,disabled:s||!g||("stdio"!==i?!k:!o),children:s?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function ak({row:a,onChange:e}){let[f,g]=(0,c.useState)(null),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(!1),m=async()=>{await P(`/api/mcp/${a.id}`,{method:"PATCH",body:JSON.stringify({enabled:!a.enabled})}),e()},n=async()=>{confirm(`Delete MCP server "${a.name}"?`)&&(await P(`/api/mcp/${a.id}`,{method:"DELETE"}),e())},o=async()=>{i(!0),g(null);try{let b=await P(`/api/mcp/${a.id}/test`,{method:"POST"});g(b)}finally{i(!1)}};return j?(0,b.jsx)(aj,{initial:a,onCancel:()=>k(!1),onSaved:()=>{k(!1),e()}}):(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(w,{className:(0,N.cn)("size-4",a.enabled?"text-emerald-500":"text-muted-foreground")}),(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:a.transport}),!a.enabled&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"disabled"}),(0,b.jsxs)("span",{className:"ml-auto text-[11px] text-muted-foreground font-mono break-all",children:["tool prefix: ",(0,b.jsxs)("code",{children:["mcp_",a.name,"_*"]})]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-1 break-all",children:["stdio"===a.transport?(0,b.jsxs)(b.Fragment,{children:["cmd: ",(0,b.jsxs)("code",{children:[a.command," ",a.args?.join(" ")]})]}):(0,b.jsxs)(b.Fragment,{children:["url: ",(0,b.jsx)("code",{children:a.url})]}),a.headers&&Object.keys(a.headers).length>0&&(0,b.jsxs)("span",{className:"ml-2",children:["headers: ",Object.entries(a.headers).map(([a,b])=>`${a}: ${b}`).join(", ")]})]}),(0,b.jsxs)("div",{className:"flex gap-1 mt-2",children:[(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:o,disabled:h,children:[h?(0,b.jsx)(d.Loader2,{className:"size-3 animate-spin mr-1"}):null,"Test"]}),(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:m,children:a.enabled?"Disable":"Enable"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>k(!0),children:"Edit"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:n,className:"text-rose-500 hover:text-rose-600 ml-auto",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),f&&(0,b.jsx)("div",{className:(0,N.cn)("mt-2 rounded border p-2 text-[11px]",f.ok?"border-emerald-500/40 bg-emerald-500/5":"border-rose-500/40 bg-rose-500/5"),children:f.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-emerald-500",children:["✓ Connected — ",f.toolCount," tool(s) discovered"]}),f.toolNames&&f.toolNames.length>0&&(0,b.jsx)("p",{className:"text-muted-foreground font-mono mt-0.5 break-all",children:f.toolNames.join(", ")})]}):(0,b.jsxs)("p",{className:"text-rose-500",children:["✗ ",f.error]})})]})}function al({children:a}){return(0,b.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-4",children:a})}function am({icon:a,title:c,status:d,statusTone:e}){return(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[a,(0,b.jsx)("h3",{className:"font-medium",children:c}),(0,b.jsx)("span",{className:(0,N.cn)("ml-auto text-xs",e),children:d})]})}function an(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)(""),[k,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(0),[t]=(0,c.useState)(50),[u,v]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=setTimeout(()=>{q(n),s(0)},250);return()=>clearTimeout(a)},[n]);let w=(0,c.useRef)(!1),x=(0,c.useCallback)(async()=>{w.current||h(!0);try{let a=new URLSearchParams;i&&a.set("source",i),k&&a.set("status",k),p&&a.set("q",p),a.set("limit",String(t)),a.set("offset",String(r*t));let b=await fetch(`${(0,M.getApiUrl)()}/api/integrations/events?${a.toString()}`);if(b.ok){let a=await b.json();d(a.events),f(a.total)}}finally{w.current||h(!1),w.current=!1}},[i,k,p,r,t]);(0,c.useEffect)(()=>{x()},[x]),(0,c.useEffect)(()=>{if(0!==r||i||k||p)return;let a=setInterval(()=>{w.current=!0,x()},5e3);return()=>clearInterval(a)},[r,i,k,p,x]);let C=async()=>{confirm("Clear ALL audit log entries? This cannot be undone.")&&(await fetch(`${(0,M.getApiUrl)()}/api/integrations/events`,{method:"DELETE"}),s(0),x())},D=Math.max(1,Math.ceil(e/t));return(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:"Audit log"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Every incoming Slack event, inbox webhook, schedule firing, and orchestrator turn outcome lands here. Use it to debug "why didn\'t the agent respond?".'})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 p-2 rounded-md border border-border/40 bg-card/40",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)(B.default,{className:"size-3.5 text-muted-foreground"}),(0,b.jsx)(K.Input,{value:n,onChange:a=>o(a.target.value),placeholder:"search channel, user, text, reason…",className:"h-7 w-56 text-xs"})]}),(0,b.jsxs)("select",{value:i,onChange:a=>{j(a.target.value),s(0)},className:"h-7 px-2 rounded text-xs bg-background border border-border/60",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"slack",children:"slack"}),(0,b.jsx)("option",{value:"inbox",children:"inbox"}),(0,b.jsx)("option",{value:"schedule",children:"schedule"}),(0,b.jsx)("option",{value:"webhook",children:"webhook"}),(0,b.jsx)("option",{value:"daemon",children:"daemon"})]}),(0,b.jsxs)("select",{value:k,onChange:a=>{m(a.target.value),s(0)},className:"h-7 px-2 rounded text-xs bg-background border border-border/60",children:[(0,b.jsx)("option",{value:"",children:"all statuses"}),(0,b.jsx)("option",{value:"routed",children:"routed"}),(0,b.jsx)("option",{value:"dropped",children:"dropped"}),(0,b.jsx)("option",{value:"error",children:"error"}),(0,b.jsx)("option",{value:"completed",children:"completed"}),(0,b.jsx)("option",{value:"failed",children:"failed"}),(0,b.jsx)("option",{value:"received",children:"received"})]}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>void x(),className:"h-7 px-2",children:(0,b.jsx)(A.RefreshCw,{className:"size-3.5"})}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:g?"loading…":`${e} event${1===e?"":"s"}`}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>void C(),className:"h-7 px-2 text-destructive",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/40 bg-card/40 overflow-hidden",children:[0===a.length&&!g&&(0,b.jsx)("p",{className:"p-4 text-xs text-muted-foreground text-center",children:"No events match the current filters."}),a.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{v(b=>b===a.id?null:a.id)},className:"w-full text-left px-3 py-2 border-b border-border/30 last:border-b-0 hover:bg-accent/40 transition-colors",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"font-mono text-muted-foreground tabular-nums whitespace-nowrap",title:new Date(a.ts).toLocaleString(),children:function(a){let b=new Date(a);if(isNaN(b.getTime()))return a;let c=new Date,d=b.toDateString()===c.toDateString(),e=b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});if(d)return e;let f=b.toLocaleDateString([],{month:"short",day:"numeric"});return`${f} ${e}`}(a.ts)}),(0,b.jsx)(as,{status:a.status}),(0,b.jsx)("span",{className:"font-medium text-muted-foreground uppercase text-[10px] tracking-wide",children:a.source}),a.subtype&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground/70",children:a.subtype}),a.channel&&(0,b.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground/80 truncate max-w-[160px]",children:a.channel}),a.user&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground/80 truncate max-w-[120px]",children:["@",a.user]}),void 0!==a.durationMs&&(0,b.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[(a.durationMs/1e3).toFixed(1),"s"]}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground/60 font-mono",children:a.id.slice(0,8)})]}),a.textSnippet&&(0,b.jsx)("p",{className:"mt-1 text-xs text-foreground/80 truncate",children:a.textSnippet}),a.dropReason&&(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-yellow-500/90",children:["dropped: ",a.dropReason]}),a.error&&(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-red-500/90",children:["error: ",a.error]}),u===a.id&&(0,b.jsx)("pre",{className:"mt-2 p-2 rounded bg-background/60 text-[10px] font-mono text-muted-foreground overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify(a,null,2)})]},a.id))]}),e>t&&(0,b.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:["Page ",r+1," of ",D]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:0===r,onClick:()=>s(0),className:"h-7 px-2",children:"First"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:0===r,onClick:()=>s(a=>a-1),className:"h-7 px-2",children:(0,b.jsx)(y.default,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:r>=D-1,onClick:()=>s(a=>a+1),className:"h-7 px-2",children:(0,b.jsx)(z.default,{className:"size-3.5"})})]})]})]})}function ao(){let[a,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(null),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),t=(0,c.useCallback)(async()=>{g(!0);try{e(await P("/api/skills"))}finally{g(!1)}},[]);if((0,c.useEffect)(()=>{t()},[t]),f||!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let u=a.directories.map(b=>({dir:b,items:a.skills.filter(a=>a.sourceDir===b.path).filter(a=>!h||a.name.toLowerCase().includes(h.toLowerCase())||a.description.toLowerCase().includes(h.toLowerCase()))})),v=async(a,b)=>{if(a&&0!==a.length){for(let c of Array.from(a)){if(!/\.(md|mdc|markdown|txt)$/i.test(c.name))continue;let a=await c.text();try{await P("/api/skills",{method:"POST",body:JSON.stringify({directory:b,fileName:c.name,content:a})})}catch(a){console.error("skill upload failed",a)}}t()}};return(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Skills",description:"Markdown skill files the orchestrator loads on demand. Pulled from built-in defaults plus any directories below — drop .md files in or create new ones from here."}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>q(!0),children:[(0,b.jsx)(D,{className:"size-3.5 mr-1"}),"Add folder"]}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:t,children:(0,b.jsx)(A.RefreshCw,{className:"size-3.5"})})]})]}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsxs)("div",{className:"relative max-w-sm",children:[(0,b.jsx)(B.default,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),(0,b.jsx)(K.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"Search skills…",className:"pl-7 h-8 text-xs"})]})}),p&&(0,b.jsx)(ap,{onCancel:()=>q(!1),onSaved:()=>{q(!1),t()}}),(0,b.jsx)("div",{className:"space-y-3",children:u.map(({dir:a,items:c})=>(0,b.jsxs)("div",{onDragOver:b=>{a.writable&&(b.preventDefault(),s(a.path))},onDragLeave:()=>s(b=>b===a.path?null:b),onDrop:b=>{b.preventDefault(),s(null),a.writable&&v(b.dataTransfer.files,a.path)},className:(0,N.cn)("rounded-lg border bg-card/40 p-3 transition-colors",r===a.path?"border-primary bg-primary/5":"border-border/60"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,b.jsx)(F.FolderOpen,{className:(0,N.cn)("size-4",a.alwaysApply?"text-amber-500":"text-muted-foreground")}),(0,b.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:a.source}),a.alwaysApply&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-amber-500",children:"always-on"}),!a.exists&&(0,b.jsx)("span",{className:"text-[10px] text-rose-500",children:"missing"}),(0,b.jsx)("code",{className:"ml-auto text-[10px] text-muted-foreground/70 font-mono truncate max-w-[280px]",children:a.path}),a.writable&&(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",className:"h-6 px-2",onClick:()=>o(a.path),children:[(0,b.jsx)(m.Plus,{className:"size-3 mr-1"}),"New"]}),"additional"===a.source&&(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",className:"h-6 px-1 text-rose-500",onClick:async()=>{confirm(`Stop loading skills from ${a.path}?`)&&(await P(`/api/skills/directories?path=${encodeURIComponent(a.path)}`,{method:"DELETE"}),t())},children:(0,b.jsx)(l.Trash2,{className:"size-3"})})]}),n===a.path&&(0,b.jsx)(aq,{directory:a.path,onCancel:()=>o(null),onSaved:()=>{o(null),t()}}),0===c.length?(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground italic px-1",children:a.writable?"No skills here yet — drop .md files or click New.":"No skills here."}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:c.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>k(a),className:"w-full flex items-start gap-2 px-1 py-2 text-left hover:bg-accent/40 rounded transition-colors",children:[(0,b.jsx)(E.default,{className:"size-3.5 text-muted-foreground shrink-0 mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium truncate",children:a.name}),(0,b.jsx)("code",{className:"text-[10px] text-muted-foreground font-mono truncate",children:a.fileName}),a.alwaysApply&&(0,b.jsx)("span",{className:"text-[10px] text-amber-500 uppercase tracking-wide",children:"always"}),a.globs.length>0&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.globs.join(", ")})]}),a.description&&(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground line-clamp-2 mt-0.5",children:a.description})]}),(0,b.jsx)(H.Pencil,{className:"size-3 text-muted-foreground/60 mt-1"})]},a.id))})]},a.path))}),j&&(0,b.jsx)(ar,{skill:j,onClose:()=>k(null),onSaved:()=>{k(null),t()}})]})}function ap({onCancel:a,onSaved:e}){let[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=async()=>{if(k(null),f.trim()){i(!0);try{let a=await P("/api/skills/directories",{method:"POST",body:JSON.stringify({path:f.trim()})});if(a.error)return void k(a.error);e()}finally{i(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-3 space-y-2",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Directory path"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["Absolute path (recommended) or a path relative to the orchestrator's working directory. All ",(0,b.jsx)("code",{children:".md"})," / ",(0,b.jsx)("code",{children:".mdc"})," files inside are picked up automatically."]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"/Users/you/skills or ./my-skills",className:"text-xs font-mono"}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>l.current?.click(),title:"Pick a folder to suggest its name (browser security: you'll still need to paste the absolute path)",children:[(0,b.jsx)(F.FolderOpen,{className:"size-3.5 mr-1"}),"Browse"]}),(0,b.jsx)("input",{ref:l,type:"file",webkitdirectory:"",directory:"",multiple:!0,hidden:!0,onChange:a=>{let b=a.target.files;if(!b||0===b.length)return;let c=b[0],d=(c.webkitRelativePath||c.name).split("/")[0];f||g(d)}})]}),j&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:j}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:m,disabled:h||!f.trim(),children:h?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Add folder"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:a,children:"Cancel"})]})]})}function aq({directory:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),s=(0,c.useRef)(null),t=async()=>{r(null);let b=g.trim()||(i?i.toLowerCase().replace(/[^a-z0-9]+/g,"-")+".md":"untitled.md");p(!0);try{let c,d=await P("/api/skills",{method:"POST",body:JSON.stringify({directory:a,fileName:b,content:(c=["---"],i&&c.push(`name: ${i}`),k&&c.push(`description: ${k.replace(/\n/g," ")}`),c.push("---",""),c.join("\n")+(m||`# ${i||"New skill"}
1
+ module.exports=[344934,a=>{"use strict";var b=a.i(256856),c=a.i(755132),d=a.i(252831),e=a.i(335520);let f=(0,e.default)("slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]]),g=(0,e.default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),h=(0,e.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),i=(0,e.default)("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);var j=a.i(470564);let k=(0,e.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var l=a.i(762491),m=a.i(916454),n=a.i(95041),o=a.i(393700),p=a.i(190555),q=a.i(870514);let r=(0,e.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var s=a.i(221557),t=a.i(96014),t=t,u=a.i(300274);let v=(0,e.default)("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"}]]),w=(0,e.default)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]);var x=a.i(195304),x=x,y=a.i(981965),y=y,z=a.i(64797),z=z,A=a.i(108343),B=a.i(589130),B=B,C=a.i(29950),C=C;let D=(0,e.default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var E=a.i(872),E=E,F=a.i(305165);let G=(0,e.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var H=a.i(257305);let I=(0,e.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var J=a.i(476031),K=a.i(338706),L=a.i(878137),M=a.i(555941),N=a.i(156033);let O=a=>`${(0,M.getApiUrl)()}${a}`;async function P(a,b){return(await fetch(O(a),{...b,headers:{"Content-Type":"application/json",...b?.headers||{}}})).json()}let Q=[{id:"general",label:"General",icon:q.Bot},{id:"integrations",label:"Integrations",icon:f},{id:"mcp",label:"MCP",icon:w},{id:"skills",label:"Skills",icon:C.default},{id:"schedules",label:"Schedules",icon:h},{id:"webhooks",label:"Webhooks",icon:i},{id:"audit",label:"Audit log",icon:x.default},{id:"models",label:"Models",icon:r},{id:"apikeys",label:"API Keys",icon:s.Key}];function R(){let[a,d]=(0,c.useState)("general"),[e,f]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let a=!1;return(async()=>{try{let b,c=await fetch(O("/health"));if(!c.ok)return;let d=await c.json();try{let a=d&&d.config?.remoteServer?.url;if(a){let c=await fetch(`${a.replace(/\/$/,"")}/health`);c.ok&&(b=(await c.json()).version)}}catch{}a||f({version:d?.version,remoteVersion:b})}catch{}})(),()=>{a=!0}},[]),(0,b.jsxs)("div",{className:"h-full flex bg-background",children:[(0,b.jsxs)("nav",{className:"w-56 shrink-0 border-r border-border/60 p-3 overflow-y-auto",children:[(0,b.jsxs)("div",{className:"px-2 py-2 mb-2",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:"Settings"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Configure your orchestrator and channels."}),e?.version&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 mt-1 font-mono",children:["sparkecoder v",e.version,e.remoteVersion&&(0,b.jsxs)(b.Fragment,{children:[" · remote v",e.remoteVersion]})]})]}),(0,b.jsx)("ul",{className:"space-y-0.5",children:Q.map(c=>{let e=c.icon,f=a===c.id;return(0,b.jsx)("li",{children:(0,b.jsxs)("button",{type:"button",onClick:()=>d(c.id),className:(0,N.cn)("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-sm transition-colors",f?"bg-accent text-foreground":"hover:bg-accent/60 text-foreground/80"),children:[(0,b.jsx)(e,{className:(0,N.cn)("size-4 shrink-0",f?"text-primary":"text-muted-foreground")}),(0,b.jsx)("span",{children:c.label})]})},c.id)})})]}),(0,b.jsx)("div",{className:"flex-1 min-w-0 overflow-y-auto",children:(0,b.jsxs)("div",{className:"max-w-3xl mx-auto p-6",children:["general"===a&&(0,b.jsx)(T,{}),"integrations"===a&&(0,b.jsx)(U,{}),"mcp"===a&&(0,b.jsx)(aj,{}),"schedules"===a&&(0,b.jsx)(aa,{}),"webhooks"===a&&(0,b.jsx)(ad,{}),"audit"===a&&(0,b.jsx)(ao,{}),"models"===a&&(0,b.jsx)(ag,{}),"apikeys"===a&&(0,b.jsx)(ah,{}),"skills"===a&&(0,b.jsx)(ap,{})]})})]})}function S({title:a,description:c}){return(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a}),c&&(0,b.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:c})]})}function T(){let[a,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(!1),n=(0,c.useCallback)(async()=>{let a=await P("/api/orchestrator");e(a),g(a.name||""),i(a.personality||"")},[]);(0,c.useEffect)(()=>{n()},[n]);let o=async()=>{k(!0),m(!1);try{await P("/api/orchestrator",{method:"PATCH",body:JSON.stringify({name:f||void 0,personality:h})}),m(!0),setTimeout(()=>m(!1),1500)}finally{k(!1)}};if(!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let p=f!==a.name||h!==(a.personality||"");return(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"Orchestrator",description:"Your supervisor agent's name and personality. The personality is appended to its system prompt."}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-sm font-medium",children:"Agent name"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Shown in the sidebar and chat header."}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"Orchestrator",className:"max-w-md"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-sm font-medium",children:"Personality / persona"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mb-1.5",children:["Optional. Free-form instructions appended to your orchestrator's system prompt every turn. Examples: ",(0,b.jsx)("em",{children:'"speak in haiku"'}),", ",(0,b.jsx)("em",{children:'"be terse and professional"'}),", ",(0,b.jsx)("em",{children:'"respond in Korean"'}),",",(0,b.jsx)("em",{children:'"you are a senior engineer who values shipping over perfection"'}),"."]}),(0,b.jsx)("textarea",{value:h,onChange:a=>i(a.target.value),rows:6,placeholder:"(blank = default tone)",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3 pt-1",children:[(0,b.jsxs)(J.Button,{onClick:o,disabled:!p||j,children:[j?(0,b.jsx)(d.Loader2,{className:"size-4 animate-spin mr-2"}):null,"Save"]}),l&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"})]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/40 bg-muted/30 p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Session id:"})," ",(0,b.jsx)("code",{children:a.id})]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Model:"})," ",(0,b.jsx)("code",{children:a.model})]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Working directory:"})," ",(0,b.jsx)("code",{className:"break-all",children:a.workingDirectory})]})]})]})]})}function U(){let[a,e]=(0,c.useState)(null),f=(0,c.useCallback)(async()=>{e(await P("/api/integrations"))},[]);return((0,c.useEffect)(()=>{f()},[f]),a)?(0,b.jsxs)("section",{className:"space-y-4",children:[(0,b.jsx)(S,{title:"Integrations",description:"External channels the orchestrator can send and receive messages on."}),(0,b.jsx)(V,{data:a,onChange:f}),(0,b.jsx)($,{data:a,onChange:f})]}):(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})})}function V({data:a,onChange:e}){var g;let h,[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!1),[s,u]=(0,c.useState)(""),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),A=async()=>{r(!0);try{await P("/api/integrations/slack",{method:"POST",body:JSON.stringify({botToken:i||void 0,signingSecret:k||void 0})}),j(""),l(""),e()}finally{r(!1)}},B=async()=>{confirm("Remove Slack credentials?")&&(await P("/api/integrations/slack",{method:"DELETE"}),e())},C=async()=>{if(!s)return;x("Sending…");let a=await P("/api/integrations/slack/test",{method:"POST",body:JSON.stringify({channel:s})});x(a.ok?"Sent.":`Failed: ${a.error}`)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(am,{children:[(0,b.jsx)(an,{icon:(0,b.jsx)(f,{className:"size-4 text-[#4A154B] dark:text-pink-300"}),title:"Slack",status:a.slack.configured?"Configured":"Not configured",statusTone:a.slack.configured?"text-emerald-500":"text-muted-foreground"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mb-3",children:"Lets the orchestrator receive @mentions and DMs in Slack and reply in-thread via the messenger tool."}),(0,b.jsx)("div",{className:"flex gap-2 mb-3",children:(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>z(!0),children:[(0,b.jsx)(t.default,{className:"size-3.5 mr-1.5"}),"Setup instructions"]})}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Bot token (xoxb-...)"}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(K.Input,{type:m?"text":"password",value:i,onChange:a=>j(a.target.value),placeholder:a.slack.botTokenSet?"(set)":"xoxb-...",className:"text-xs"}),(0,b.jsx)(J.Button,{variant:"outline",size:"icon",onClick:()=>n(a=>!a),children:m?(0,b.jsx)(p.EyeOff,{className:"size-3.5"}):(0,b.jsx)(o.Eye,{className:"size-3.5"})})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Signing secret"}),(0,b.jsx)(K.Input,{type:"password",value:k,onChange:a=>l(a.target.value),placeholder:a.slack.signingSecretSet?"(set)":"...",className:"text-xs"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:A,disabled:q||!i&&!k,children:q?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),a.slack.configured&&(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:B,children:"Disconnect"})]})]}),(0,b.jsxs)("div",{className:"mt-3 rounded border border-border/40 bg-background/50 p-2 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("strong",{children:"Events URL"})," (paste into Slack → Event Subscriptions):"]}),(0,b.jsx)("code",{className:"block px-2 py-1 rounded bg-muted text-[11px] break-all",children:a.slack.eventsUrl}),(0,b.jsxs)("p",{className:"text-muted-foreground",children:["Subscribe to bot events: ",(0,b.jsx)("code",{children:"app_mention"}),", ",(0,b.jsx)("code",{children:"message.im"}),"."]})]}),a.slack.configured&&(0,b.jsxs)("div",{className:"mt-3 flex gap-2 items-end",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Test post (channel id or #channel)"}),(0,b.jsx)(K.Input,{value:s,onChange:a=>u(a.target.value),placeholder:"C0123 or #general",className:"text-xs"})]}),(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:C,disabled:!s,children:"Send test"}),w&&(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:w})]})]}),(0,b.jsxs)(am,{children:[(0,b.jsx)(an,{icon:(0,b.jsx)(v,{className:"size-4 text-amber-500"}),title:"Slack access control",status:(g=a.slack,h=[],g.allowedUsers.length>0&&h.push(`${g.allowedUsers.length} user(s)`),g.allowedChannels.length>0&&h.push(`${g.allowedChannels.length} channel(s)`),g.allowDmsFromAnyone||h.push("DMs locked"),0===h.length?"Open to anyone":h.join(" · ")),statusTone:"text-muted-foreground"}),(0,b.jsx)(W,{data:a,onChange:e})]}),y&&(0,b.jsx)(X,{eventsUrl:a.slack.eventsUrl,agentName:a.slack.defaultOrchestratorName||"orchestrator",onClose:()=>z(!1)})]})}function W({data:a,onChange:e}){let[f,g]=(0,c.useState)(a.slack.allowedUsers.join(", ")),[h,i]=(0,c.useState)(a.slack.allowedChannels.join(", ")),[j,k]=(0,c.useState)(a.slack.allowDmsFromAnyone),[l,m]=(0,c.useState)(a.slack.deniedReplyEnabled),[n,o]=(0,c.useState)(a.slack.deniedReplyTemplate),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),t=f.trim()!==a.slack.allowedUsers.join(", ").trim()||h.trim()!==a.slack.allowedChannels.join(", ").trim()||j!==a.slack.allowDmsFromAnyone||l!==a.slack.deniedReplyEnabled||n!==a.slack.deniedReplyTemplate,u=async()=>{q(!0),s(!1);try{let a=a=>a.split(/[\s,]+/).map(a=>a.trim()).filter(Boolean);await P("/api/integrations/slack",{method:"POST",body:JSON.stringify({allowedUsers:a(f),allowedChannels:a(h),allowDmsFromAnyone:j,deniedReplyEnabled:l,deniedReplyTemplate:n})}),e(),s(!0),setTimeout(()=>s(!1),1500)}finally{q(!1)}};return(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Empty lists = no allowlist (accept anyone Slack delivers an event for). When a list is set, only matching users / channels can talk to the orchestrator."}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Allowed users (Slack user IDs)"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Comma or space separated. e.g. ",(0,b.jsx)("code",{children:"U01ABCD"}),", ",(0,b.jsx)("code",{children:"U09XYZ"}),". Leave blank to allow anyone."]}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"U01..., U02...",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Allowed channels (Slack channel IDs)"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Channel IDs only (not ",(0,b.jsx)("code",{children:"#name"}),"). e.g. ",(0,b.jsx)("code",{children:"C012345"}),". Affects @mentions; DMs use the toggle below."]}),(0,b.jsx)(K.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"C012345, C098765",className:"text-xs font-mono"})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:j,onChange:a=>k(a.target.checked),className:"mt-1"}),(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"font-medium",children:"Allow DMs from anyone"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"On: anyone who DMs your bot can talk to it. Off: only users in the allowlist above can DM."})]})]}),(0,b.jsxs)("div",{className:"border-t border-border/40 pt-3",children:[(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:l,onChange:a=>m(a.target.checked),className:"mt-1"}),(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"font-medium",children:"Auto-reply to denied users"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"When someone is blocked by the rules above, post a canned reply (no AI) so they know why nothing happened. Posted in-thread for @mentions; in the DM for DMs."})]})]}),(0,b.jsxs)("div",{className:"mt-2 pl-6",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Reply template"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Placeholders: ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"{user}"})," → mentions the requester, ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"{channel}"})," → mentions the channel."]}),(0,b.jsx)("textarea",{value:n,onChange:a=>o(a.target.value),rows:3,disabled:!l,className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs disabled:opacity-50"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:u,disabled:!t||p,children:p?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),r&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"})]})]})}function X({eventsUrl:a,agentName:d,onClose:e}){var g;let h,i,[j,k]=(0,c.useState)(null),l=(g=a,JSON.stringify({display_information:{name:i=(h=(d||"orchestrator").trim()||"orchestrator").slice(0,35),description:`${i} — your orchestrator agent. Spawns worker agents, posts updates, answers questions.`,background_color:"#1f1f24"},features:{bot_user:{display_name:h.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)||"orchestrator",always_online:!0},app_home:{home_tab_enabled:!1,messages_tab_enabled:!0,messages_tab_read_only_enabled:!1}},oauth_config:{scopes:{bot:["app_mentions:read","channels:history","chat:write","groups:history","im:history","im:read","im:write","users:read"]}},settings:{event_subscriptions:{request_url:g,bot_events:["app_mention","message.im","message.channels","message.groups"]},interactivity:{is_enabled:!1},org_deploy_enabled:!1,socket_mode_enabled:!1,token_rotation_enabled:!1}},null,2)),m=async(a,b)=>{await navigator.clipboard.writeText(b),k(a),setTimeout(()=>k(null),1500)};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:e,children:(0,b.jsxs)("div",{className:"bg-card rounded-lg border border-border max-w-2xl w-full max-h-[85vh] overflow-y-auto shadow-2xl",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/60 sticky top-0 bg-card",children:[(0,b.jsxs)("h2",{className:"text-base font-semibold flex items-center gap-2",children:[(0,b.jsx)(f,{className:"size-4 text-[#4A154B] dark:text-pink-300"}),"Slack setup"]}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:e,children:(0,b.jsx)(u.X,{className:"size-4"})})]}),(0,b.jsxs)("div",{className:"p-5 space-y-5 text-sm",children:[(0,b.jsxs)(Y,{n:1,title:"Create a Slack app from manifest",children:[(0,b.jsxs)("p",{children:["Go to ",(0,b.jsx)("a",{href:"https://api.slack.com/apps?new_app=1",target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"api.slack.com/apps"}),", click ",(0,b.jsx)("strong",{children:"Create New App"})," → ",(0,b.jsx)("strong",{children:"From a manifest"}),", pick your workspace, paste the YAML below, then create."]}),(0,b.jsx)(Z,{label:"Slack manifest",value:l,onCopy:()=>m("manifest",l),copied:"manifest"===j})]}),(0,b.jsxs)(Y,{n:2,title:"Grab credentials",children:[(0,b.jsxs)("p",{children:["In your new app's ",(0,b.jsx)("strong",{children:"Basic Information"})," page, copy the ",(0,b.jsx)("strong",{children:"Signing Secret"}),". Then under ",(0,b.jsx)("strong",{children:"OAuth & Permissions"}),", install the app to your workspace and copy the ",(0,b.jsx)("strong",{children:"Bot User OAuth Token"})," (starts with ",(0,b.jsx)("code",{children:"xoxb-"}),")."]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paste both into the Slack card above, then click Save."})]}),(0,b.jsxs)(Y,{n:3,title:"Verify the Events URL",children:[(0,b.jsxs)("p",{children:["Slack will challenge the URL automatically when you create the app from the manifest (it's pre-filled with your URL below). If it shows ",(0,b.jsx)("strong",{children:"Verified"})," you're done."]}),(0,b.jsx)(Z,{label:"Events URL (already in the manifest)",value:a,onCopy:()=>m("eventsUrl",a),copied:"eventsUrl"===j,mono:!0}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"If verification fails, your sparkecoder isn't reachable from the public internet. Set up a cloudflared tunnel — see the Cloudflared card."})]}),(0,b.jsx)(Y,{n:4,title:"Invite the bot to channels",children:(0,b.jsxs)("p",{children:["In Slack: ",(0,b.jsx)("code",{children:"/invite @your-bot-name"})," in any channel you want it to respond in. (DMs work without an invite.)"]})}),(0,b.jsxs)(Y,{n:5,title:"Lock it down (optional but recommended)",children:[(0,b.jsxs)("p",{children:["By default ",(0,b.jsx)("strong",{children:"anyone"})," in your workspace can DM the bot or mention it in any channel it's in. Use the ",(0,b.jsx)("strong",{children:"Slack access control"})," section to limit access to specific Slack user IDs and channel IDs."]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Find a user ID: click their name in Slack → ⋮ → Copy member ID. Find a channel ID: click the channel name → About → bottom of the panel."})]})]})]})})}function Y({n:a,title:c,children:d}){return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("h3",{className:"font-medium flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex items-center justify-center size-5 rounded-full bg-primary/15 text-primary text-[11px] font-semibold",children:a}),c]}),(0,b.jsx)("div",{className:"pl-7 space-y-2 text-sm text-foreground/90",children:d})]})}function Z({label:a,value:c,onCopy:d,copied:e,mono:f}){return(0,b.jsxs)("div",{className:"rounded border border-border/60 bg-background/60 overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-3 py-1.5 flex items-center justify-between border-b border-border/40 bg-muted/40",children:[(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:a}),(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",onClick:d,className:"h-6 text-[11px]",children:[e?(0,b.jsx)(n.Check,{className:"size-3 mr-1"}):(0,b.jsx)(j.Copy,{className:"size-3 mr-1"}),e?"Copied":"Copy"]})]}),(0,b.jsx)("pre",{className:(0,N.cn)("px-3 py-2 text-[11px] overflow-x-auto whitespace-pre-wrap break-all",f&&"font-mono"),children:c})]})}function $({data:a,onChange:c}){return(0,b.jsxs)(am,{children:[(0,b.jsx)(an,{icon:(0,b.jsx)(g,{className:"size-4 text-orange-500"}),title:"Cloudflared tunnel",status:a.cloudflared.publicBaseUrl?"Hostname set":"Local-only",statusTone:a.cloudflared.publicBaseUrl?"text-emerald-500":"text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mb-2",children:["Required to receive Slack events and webhook hits from the public internet. Run"," ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted text-[11px]",children:"sparkecoder cloudflared-setup"})," for a copy-paste recipe."]}),a.cloudflared.publicBaseUrl&&(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Public base: "}),(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:a.cloudflared.publicBaseUrl})]}),(0,b.jsx)("div",{className:"mt-3 border-t border-border/40 pt-3",children:(0,b.jsx)(_,{data:a,onChange:c})})]})}function _({data:a,onChange:e}){let[f,g]=(0,c.useState)(a.cfAccess.enabled),[h,i]=(0,c.useState)(a.cfAccess.teamDomain??""),[j,k]=(0,c.useState)(a.cfAccess.audTag??""),[l,m]=(0,c.useState)(a.cfAccess.allowedEmails.join(", ")),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),t=a.cfAccess.allowedEmails.join(", "),u=f!==a.cfAccess.enabled||h.trim()!==(a.cfAccess.teamDomain??"")||j.trim()!==(a.cfAccess.audTag??"")||l.trim()!==t.trim(),w=async()=>{o(!0),q(!1),s(null);try{let a=await fetch(O("/api/integrations/cf-access"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:f,teamDomain:h.trim(),audTag:j.trim(),allowedEmails:l.split(/[\s,]+/).map(a=>a.trim().toLowerCase()).filter(Boolean)})});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(b?.error||`Request failed (${a.status})`)}e(),q(!0),setTimeout(()=>q(!1),1500)}catch(a){s(a instanceof Error?a.message:"Failed to save")}finally{o(!1)}};return(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(v,{className:"size-3.5 text-emerald-500"}),(0,b.jsx)("span",{className:"text-xs font-medium",children:"Cloudflare Access"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Restrict who can reach your public tunnel URL by email. Localhost always bypasses this, so you can't lock yourself out of your own machine."}),(0,b.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,b.jsx)("input",{type:"checkbox",checked:f,onChange:a=>g(a.target.checked),className:"mt-1"}),(0,b.jsxs)("div",{className:"text-xs",children:[(0,b.jsx)("span",{className:"font-medium",children:"Enforce Cloudflare Access"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:"When on, every non-local request must carry a valid Cloudflare Access JWT whose email is in the allowlist below."})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Team domain"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["e.g. ",(0,b.jsx)("code",{children:"yourteam.cloudflareaccess.com"})]}),(0,b.jsx)(K.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"yourteam.cloudflareaccess.com",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Application AUD tag"}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground mb-1",children:"From the Cloudflare Access application (Access → Applications)."}),(0,b.jsx)(K.Input,{value:j,onChange:a=>k(a.target.value),placeholder:"abc123...",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Allowed emails or domains"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-1",children:["Comma or space separated. Use a full address (",(0,b.jsx)("code",{children:"you@example.com"}),") or a bare domain (",(0,b.jsx)("code",{children:"studyfetch.com"}),") to allow everyone on it. Leave blank to allow any email that passes your Cloudflare Access policy."]}),(0,b.jsx)(K.Input,{value:l,onChange:a=>m(a.target.value),placeholder:"studyfetch.com, you@example.com",className:"text-xs font-mono"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Heads up: this is one of two layers. You must also add the same emails to an “Allow” policy in the Cloudflare dashboard — that's the real gate."}),r&&(0,b.jsx)("p",{className:"text-xs text-red-500",children:r}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:w,disabled:!u||n,children:n?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),p&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"})]})]})}function aa(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(!1),g=(0,c.useCallback)(async()=>{d((await P("/api/schedules")).schedules||[])},[]);return(0,c.useEffect)(()=>{g()},[g]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Schedules",description:"Recurring prompts that wake the orchestrator on a cron."}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>f(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),e&&(0,b.jsx)(ab,{onCancel:()=>f(!1),onSaved:()=>{f(!1),g()}}),0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No schedules yet."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(ac,{row:a,onChange:g},a.id))})]})}function ab({initial:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(a?.name||""),[i,j]=(0,c.useState)(a?.cron||"0 9 * * 1-5"),[k,l]=(0,c.useState)(a?.prompt||""),[m,n]=(0,c.useState)(a?.replyChannel||""),[o,p]=(0,c.useState)(!1),q=async()=>{if(g&&i&&k){p(!0);try{a?.id?await P(`/api/schedules/${a.id}`,{method:"PATCH",body:JSON.stringify({name:g,cron:i,prompt:k,replyChannel:m||void 0})}):await P("/api/schedules",{method:"POST",body:JSON.stringify({name:g,cron:i,prompt:k,replyChannel:m||void 0})}),f()}finally{p(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"standup-9am",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Cron (5 fields)"}),(0,b.jsx)(K.Input,{value:i,onChange:a=>j(a.target.value),placeholder:"0 9 * * 1-5",className:"text-xs font-mono"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Prompt"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"Summarize yesterday's git activity",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Default reply channel (optional)"}),(0,b.jsx)(K.Input,{value:m,onChange:a=>n(a.target.value),placeholder:"slack:#standup",className:"text-xs"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:q,disabled:o||!g||!i||!k,children:o?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function ac({row:a,onChange:c}){let d=async()=>{await P(`/api/schedules/${a.id}`,{method:"PATCH",body:JSON.stringify({enabled:!a.enabled})}),c()},e=async()=>{confirm(`Delete schedule "${a.name}"?`)&&(await P(`/api/schedules/${a.id}`,{method:"DELETE"}),c())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 flex items-start gap-3",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),!a.enabled&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"paused"})]}),(0,b.jsx)("code",{className:"text-[11px] text-muted-foreground font-mono",children:a.cron}),(0,b.jsx)("p",{className:"text-xs mt-1 line-clamp-2 text-foreground/80",children:a.prompt}),a.replyChannel&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["replyChannel: ",a.replyChannel]}),a.lastFiredAt&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["last fired ",new Date(a.lastFiredAt).toLocaleString()]})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:d,children:a.enabled?"Pause":"Resume"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]})]})}function ad(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(!1),g=(0,c.useCallback)(async()=>{d((await P("/api/webhooks")).webhooks||[])},[]);return(0,c.useEffect)(()=>{g()},[g]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Webhooks",description:"Custom token-protected URLs. POST any JSON to ping the orchestrator."}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>f(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),e&&(0,b.jsx)(ae,{onCancel:()=>f(!1),onSaved:()=>{f(!1),g()}}),0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No webhooks yet."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(af,{row:a,onChange:g},a.id))})]})}function ae({onCancel:a,onSaved:e}){let[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)("now"),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(!1),n=async()=>{if(f){m(!0);try{await P("/api/webhooks",{method:"POST",body:JSON.stringify({name:f,wake:h,template:j||void 0})}),e()}finally{m(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"github-prs",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Wake"}),(0,b.jsxs)("select",{value:h,onChange:a=>i(a.target.value),className:"w-full text-xs h-9 rounded-md border border-input bg-background px-2",children:[(0,b.jsx)("option",{value:"now",children:"now — ping orchestrator immediately"}),(0,b.jsx)("option",{value:"next",children:"next — add as context, fire later"})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Template (optional)"}),(0,b.jsx)(K.Input,{value:j,onChange:a=>k(a.target.value),placeholder:"PR {{pull_request.title}} by {{sender.login}}",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:n,disabled:l||!f,children:l?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Create"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:a,children:"Cancel"})]})]})}function af({row:a,onChange:d}){let[e,f]=(0,c.useState)(!1),g=async()=>{await navigator.clipboard.writeText(a.url),f(!0),setTimeout(()=>f(!1),1500)},h=async()=>{confirm("Rotate the token?")&&(await P(`/api/webhooks/${a.id}`,{method:"PATCH",body:JSON.stringify({rotateToken:!0})}),d())},i=async()=>{confirm(`Delete webhook "${a.name}"?`)&&(await P(`/api/webhooks/${a.id}`,{method:"DELETE"}),d())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsxs)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:["wake=",a.wake]}),(0,b.jsxs)("span",{className:"ml-auto text-[11px] text-muted-foreground",children:[a.hitCount," hit",1===a.hitCount?"":"s"]})]}),(0,b.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,b.jsx)("code",{className:"flex-1 text-[11px] px-2 py-1 rounded bg-muted break-all",children:a.url}),(0,b.jsx)(J.Button,{size:"icon",variant:"outline",onClick:g,children:e?(0,b.jsx)(n.Check,{className:"size-3.5"}):(0,b.jsx)(j.Copy,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"icon",variant:"outline",onClick:h,title:"Rotate token",children:(0,b.jsx)(k,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:i,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),a.template&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground font-mono",children:["template: ",a.template]}),a.lastHitAt&&(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["last hit ",new Date(a.lastHitAt).toLocaleString()]})]})}function ag(){let[a,e]=(0,c.useState)(null);if((0,c.useEffect)(()=>{(async()=>{e(await (0,M.getConfig)())})()},[]),!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let f=a.availableModels.find(b=>b.id===a.defaultModel);return(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"Models",description:"Default model used for new sessions (orchestrator + workers). You can override per-session from the chat header."}),(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 max-w-lg",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Current default"}),(0,b.jsxs)("p",{className:"text-sm mt-1",children:[(0,b.jsx)("strong",{children:f?.name||a.defaultModel}),f?.provider&&(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",f.provider]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-2",children:["To change the default, set ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"defaultModel"})," in your"," ",(0,b.jsx)("code",{className:"px-1 rounded bg-muted",children:"sparkecoder.config.json"})," and restart the server."]})]}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)(L.Label,{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Available models"}),(0,b.jsx)("div",{className:"mt-2 rounded-lg border border-border/60 divide-y divide-border/40",children:a.availableModels.map(c=>(0,b.jsxs)("div",{className:(0,N.cn)("flex items-center justify-between px-3 py-2 text-sm",c.id===a.defaultModel&&"bg-primary/5"),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"font-medium",children:c.name}),(0,b.jsxs)("span",{className:"text-muted-foreground",children:[" — ",c.provider]}),c.id===a.defaultModel&&(0,b.jsx)("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-primary",children:"default"})]}),(0,b.jsx)("code",{className:"text-[10px] text-muted-foreground font-mono",children:c.id})]},c.id))})]})]})}function ah(){let[a,d]=(0,c.useState)([]),e=(0,c.useCallback)(async()=>{d((await P("/health/api-keys")).providers||[])},[]);return(0,c.useEffect)(()=>{e()},[e]),(0,b.jsxs)("section",{children:[(0,b.jsx)(S,{title:"API Keys",description:"Provider credentials used for AI inference (Vercel AI Gateway etc.). Keys are stored locally."}),(0,b.jsxs)("div",{className:"space-y-2",children:[a.map(a=>(0,b.jsx)(ai,{keyStatus:a,onChange:e},a.provider)),0===a.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No providers configured."})]})]})}function ai({keyStatus:a,onChange:e}){let[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(!1),[m,n]=(0,c.useState)(!1),q=async()=>{if(h.trim()){n(!0);try{await P("/health/api-keys",{method:"POST",body:JSON.stringify({provider:a.provider,apiKey:h.trim()})}),i(""),g(!1),e()}finally{n(!1)}}},r=async()=>{confirm(`Remove ${a.provider} API key?`)&&(await fetch(O(`/health/api-keys/${a.provider}`),{method:"DELETE"}),e())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium capitalize",children:a.provider}),a.configured&&(0,b.jsx)("span",{className:(0,N.cn)("text-[10px] px-1.5 py-0.5 rounded font-medium","env"===a.source?"bg-blue-500/20 text-blue-600 dark:text-blue-300":"bg-emerald-500/20 text-emerald-600 dark:text-emerald-300"),children:"env"===a.source?"from env":"saved"}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground font-mono",children:a.envVar})]}),f?(0,b.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(K.Input,{type:j?"text":"password",value:h,onChange:a=>i(a.target.value),placeholder:"Paste your API key…",className:"pr-8 text-xs font-mono",autoFocus:!0}),(0,b.jsx)(J.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-2 hover:bg-transparent",onClick:()=>k(a=>!a),children:j?(0,b.jsx)(p.EyeOff,{className:"size-3.5"}):(0,b.jsx)(o.Eye,{className:"size-3.5"})})]}),(0,b.jsx)(J.Button,{size:"sm",onClick:q,disabled:m||!h.trim(),children:m?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>{g(!1),i("")},children:"Cancel"})]}):(0,b.jsxs)("div",{className:"flex items-center mt-1",children:[(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono flex-1",children:a.configured?a.maskedKey:"Not configured"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>g(!0),className:"h-7 text-xs",children:a.configured?"Update":"Add"}),a.configured&&"storage"===a.source&&(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:r,className:"text-rose-500 hover:text-rose-600",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]})]})}function aj(){let[a,e]=(0,c.useState)([]),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(!0),j=(0,c.useCallback)(async()=>{i(!0);try{let a=await P("/api/mcp");e(a.servers||[])}finally{i(!1)}},[]);return(0,c.useEffect)(()=>{j()},[j]),(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"MCP integrations",description:'Model Context Protocol servers. Each adds tools to every agent under "mcp_<name>_<tool>" on the next turn.'}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>g(a=>!a),children:[(0,b.jsx)(m.Plus,{className:"size-3.5 mr-1"}),"New"]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mb-3 max-w-2xl",children:["For OAuth-protected MCP servers, paste the access token as a header here:",(0,b.jsx)("code",{className:"px-1 rounded bg-muted ml-1",children:"{ Authorization: 'Bearer <your-token>' }"}),". For unauthed servers, leave headers empty. Use ",(0,b.jsx)("strong",{children:"Test"})," to confirm the server is reachable."]}),f&&(0,b.jsx)(ak,{onCancel:()=>g(!1),onSaved:()=>{g(!1),j()}}),h?(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)(d.Loader2,{className:"size-4 animate-spin text-muted-foreground"})}):0===a.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic px-1",children:"No MCP servers configured."}):(0,b.jsx)("div",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(al,{row:a,onChange:j},a.id))})]})}function ak({initial:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(a?.name||""),[i,j]=(0,c.useState)(a?.transport||"http"),[k,l]=(0,c.useState)(a?.url||""),[m,n]=(0,c.useState)(a?.headers?JSON.stringify(a.headers,null,2):""),[o,p]=(0,c.useState)(a?.command||""),[q,r]=(0,c.useState)(a?.args?.join(" ")||""),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),w=async()=>{let b;if(v(null),m.trim())try{let a=JSON.parse(m);a&&"object"==typeof a&&(b=a)}catch{v('Headers must be valid JSON, e.g. {"Authorization":"Bearer xxx"}');return}t(!0);try{let c={name:g,transport:i,enabled:!0};("http"===i||"sse"===i)&&(c.url=k,b&&(c.headers=b)),"stdio"===i&&(c.command=o,c.args=q.split(/\s+/).filter(Boolean)),a?.id?await P(`/api/mcp/${a.id}`,{method:"PATCH",body:JSON.stringify(c)}):await P("/api/mcp",{method:"POST",body:JSON.stringify(c)}),f()}catch(a){v(a?.message||"Save failed")}finally{t(!1)}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-3 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,b.jsxs)("div",{className:"col-span-2",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"github",className:"text-xs"}),(0,b.jsxs)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Used as a tool prefix (e.g. ",(0,b.jsx)("code",{children:"mcp_github_search"}),")."]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Transport"}),(0,b.jsxs)("select",{value:i,onChange:a=>j(a.target.value),className:"w-full text-xs h-9 rounded-md border border-input bg-background px-2",children:[(0,b.jsx)("option",{value:"http",children:"HTTP (recommended)"}),(0,b.jsx)("option",{value:"sse",children:"SSE"}),(0,b.jsx)("option",{value:"stdio",children:"stdio (local)"})]})]})]}),"stdio"!==i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"URL"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"https://your-server.com/mcp",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Headers (JSON, optional)"}),(0,b.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),rows:3,placeholder:'{ "Authorization": "Bearer xxx" }',className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono"})]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Command"}),(0,b.jsx)(K.Input,{value:o,onChange:a=>p(a.target.value),placeholder:"node",className:"text-xs font-mono"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Args (space separated)"}),(0,b.jsx)(K.Input,{value:q,onChange:a=>r(a.target.value),placeholder:"src/stdio/dist/server.js",className:"text-xs font-mono"})]})]}),u&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:u}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:w,disabled:s||!g||("stdio"!==i?!k:!o),children:s?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Save"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function al({row:a,onChange:e}){let[f,g]=(0,c.useState)(null),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(!1),m=async()=>{await P(`/api/mcp/${a.id}`,{method:"PATCH",body:JSON.stringify({enabled:!a.enabled})}),e()},n=async()=>{confirm(`Delete MCP server "${a.name}"?`)&&(await P(`/api/mcp/${a.id}`,{method:"DELETE"}),e())},o=async()=>{i(!0),g(null);try{let b=await P(`/api/mcp/${a.id}/test`,{method:"POST"});g(b)}finally{i(!1)}};return j?(0,b.jsx)(ak,{initial:a,onCancel:()=>k(!1),onSaved:()=>{k(!1),e()}}):(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(w,{className:(0,N.cn)("size-4",a.enabled?"text-emerald-500":"text-muted-foreground")}),(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:a.transport}),!a.enabled&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"disabled"}),(0,b.jsxs)("span",{className:"ml-auto text-[11px] text-muted-foreground font-mono break-all",children:["tool prefix: ",(0,b.jsxs)("code",{children:["mcp_",a.name,"_*"]})]})]}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-1 break-all",children:["stdio"===a.transport?(0,b.jsxs)(b.Fragment,{children:["cmd: ",(0,b.jsxs)("code",{children:[a.command," ",a.args?.join(" ")]})]}):(0,b.jsxs)(b.Fragment,{children:["url: ",(0,b.jsx)("code",{children:a.url})]}),a.headers&&Object.keys(a.headers).length>0&&(0,b.jsxs)("span",{className:"ml-2",children:["headers: ",Object.entries(a.headers).map(([a,b])=>`${a}: ${b}`).join(", ")]})]}),(0,b.jsxs)("div",{className:"flex gap-1 mt-2",children:[(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:o,disabled:h,children:[h?(0,b.jsx)(d.Loader2,{className:"size-3 animate-spin mr-1"}):null,"Test"]}),(0,b.jsx)(J.Button,{size:"sm",variant:"outline",onClick:m,children:a.enabled?"Disable":"Enable"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>k(!0),children:"Edit"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:n,className:"text-rose-500 hover:text-rose-600 ml-auto",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),f&&(0,b.jsx)("div",{className:(0,N.cn)("mt-2 rounded border p-2 text-[11px]",f.ok?"border-emerald-500/40 bg-emerald-500/5":"border-rose-500/40 bg-rose-500/5"),children:f.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"text-emerald-500",children:["✓ Connected — ",f.toolCount," tool(s) discovered"]}),f.toolNames&&f.toolNames.length>0&&(0,b.jsx)("p",{className:"text-muted-foreground font-mono mt-0.5 break-all",children:f.toolNames.join(", ")})]}):(0,b.jsxs)("p",{className:"text-rose-500",children:["✗ ",f.error]})})]})}function am({children:a}){return(0,b.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-4",children:a})}function an({icon:a,title:c,status:d,statusTone:e}){return(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[a,(0,b.jsx)("h3",{className:"font-medium",children:c}),(0,b.jsx)("span",{className:(0,N.cn)("ml-auto text-xs",e),children:d})]})}function ao(){let[a,d]=(0,c.useState)([]),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)(""),[k,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(0),[t]=(0,c.useState)(50),[u,v]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=setTimeout(()=>{q(n),s(0)},250);return()=>clearTimeout(a)},[n]);let w=(0,c.useRef)(!1),x=(0,c.useCallback)(async()=>{w.current||h(!0);try{let a=new URLSearchParams;i&&a.set("source",i),k&&a.set("status",k),p&&a.set("q",p),a.set("limit",String(t)),a.set("offset",String(r*t));let b=await fetch(`${(0,M.getApiUrl)()}/api/integrations/events?${a.toString()}`);if(b.ok){let a=await b.json();d(a.events),f(a.total)}}finally{w.current||h(!1),w.current=!1}},[i,k,p,r,t]);(0,c.useEffect)(()=>{x()},[x]),(0,c.useEffect)(()=>{if(0!==r||i||k||p)return;let a=setInterval(()=>{w.current=!0,x()},5e3);return()=>clearInterval(a)},[r,i,k,p,x]);let C=async()=>{confirm("Clear ALL audit log entries? This cannot be undone.")&&(await fetch(`${(0,M.getApiUrl)()}/api/integrations/events`,{method:"DELETE"}),s(0),x())},D=Math.max(1,Math.ceil(e/t));return(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:"Audit log"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Every incoming Slack event, inbox webhook, schedule firing, and orchestrator turn outcome lands here. Use it to debug "why didn\'t the agent respond?".'})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 p-2 rounded-md border border-border/40 bg-card/40",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)(B.default,{className:"size-3.5 text-muted-foreground"}),(0,b.jsx)(K.Input,{value:n,onChange:a=>o(a.target.value),placeholder:"search channel, user, text, reason…",className:"h-7 w-56 text-xs"})]}),(0,b.jsxs)("select",{value:i,onChange:a=>{j(a.target.value),s(0)},className:"h-7 px-2 rounded text-xs bg-background border border-border/60",children:[(0,b.jsx)("option",{value:"",children:"all sources"}),(0,b.jsx)("option",{value:"slack",children:"slack"}),(0,b.jsx)("option",{value:"inbox",children:"inbox"}),(0,b.jsx)("option",{value:"schedule",children:"schedule"}),(0,b.jsx)("option",{value:"webhook",children:"webhook"}),(0,b.jsx)("option",{value:"daemon",children:"daemon"})]}),(0,b.jsxs)("select",{value:k,onChange:a=>{m(a.target.value),s(0)},className:"h-7 px-2 rounded text-xs bg-background border border-border/60",children:[(0,b.jsx)("option",{value:"",children:"all statuses"}),(0,b.jsx)("option",{value:"routed",children:"routed"}),(0,b.jsx)("option",{value:"dropped",children:"dropped"}),(0,b.jsx)("option",{value:"error",children:"error"}),(0,b.jsx)("option",{value:"completed",children:"completed"}),(0,b.jsx)("option",{value:"failed",children:"failed"}),(0,b.jsx)("option",{value:"received",children:"received"})]}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>void x(),className:"h-7 px-2",children:(0,b.jsx)(A.RefreshCw,{className:"size-3.5"})}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:g?"loading…":`${e} event${1===e?"":"s"}`}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:()=>void C(),className:"h-7 px-2 text-destructive",children:(0,b.jsx)(l.Trash2,{className:"size-3.5"})})]}),(0,b.jsxs)("div",{className:"rounded-md border border-border/40 bg-card/40 overflow-hidden",children:[0===a.length&&!g&&(0,b.jsx)("p",{className:"p-4 text-xs text-muted-foreground text-center",children:"No events match the current filters."}),a.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{v(b=>b===a.id?null:a.id)},className:"w-full text-left px-3 py-2 border-b border-border/30 last:border-b-0 hover:bg-accent/40 transition-colors",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"font-mono text-muted-foreground tabular-nums whitespace-nowrap",title:new Date(a.ts).toLocaleString(),children:function(a){let b=new Date(a);if(isNaN(b.getTime()))return a;let c=new Date,d=b.toDateString()===c.toDateString(),e=b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});if(d)return e;let f=b.toLocaleDateString([],{month:"short",day:"numeric"});return`${f} ${e}`}(a.ts)}),(0,b.jsx)(at,{status:a.status}),(0,b.jsx)("span",{className:"font-medium text-muted-foreground uppercase text-[10px] tracking-wide",children:a.source}),a.subtype&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground/70",children:a.subtype}),a.channel&&(0,b.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground/80 truncate max-w-[160px]",children:a.channel}),a.user&&(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground/80 truncate max-w-[120px]",children:["@",a.user]}),void 0!==a.durationMs&&(0,b.jsxs)("span",{className:"text-[10px] text-muted-foreground/70",children:[(a.durationMs/1e3).toFixed(1),"s"]}),(0,b.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground/60 font-mono",children:a.id.slice(0,8)})]}),a.textSnippet&&(0,b.jsx)("p",{className:"mt-1 text-xs text-foreground/80 truncate",children:a.textSnippet}),a.dropReason&&(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-yellow-500/90",children:["dropped: ",a.dropReason]}),a.error&&(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-red-500/90",children:["error: ",a.error]}),u===a.id&&(0,b.jsx)("pre",{className:"mt-2 p-2 rounded bg-background/60 text-[10px] font-mono text-muted-foreground overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify(a,null,2)})]},a.id))]}),e>t&&(0,b.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:["Page ",r+1," of ",D]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:0===r,onClick:()=>s(0),className:"h-7 px-2",children:"First"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:0===r,onClick:()=>s(a=>a-1),className:"h-7 px-2",children:(0,b.jsx)(y.default,{className:"size-3.5"})}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",disabled:r>=D-1,onClick:()=>s(a=>a+1),className:"h-7 px-2",children:(0,b.jsx)(z.default,{className:"size-3.5"})})]})]})]})}function ap(){let[a,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(null),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),t=(0,c.useCallback)(async()=>{g(!0);try{e(await P("/api/skills"))}finally{g(!1)}},[]);if((0,c.useEffect)(()=>{t()},[t]),f||!a)return(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})});let u=a.directories.map(b=>({dir:b,items:a.skills.filter(a=>a.sourceDir===b.path).filter(a=>!h||a.name.toLowerCase().includes(h.toLowerCase())||a.description.toLowerCase().includes(h.toLowerCase()))})),v=async(a,b)=>{if(a&&0!==a.length){for(let c of Array.from(a)){if(!/\.(md|mdc|markdown|txt)$/i.test(c.name))continue;let a=await c.text();try{await P("/api/skills",{method:"POST",body:JSON.stringify({directory:b,fileName:c.name,content:a})})}catch(a){console.error("skill upload failed",a)}}t()}};return(0,b.jsxs)("section",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)(S,{title:"Skills",description:"Markdown skill files the orchestrator loads on demand. Pulled from built-in defaults plus any directories below — drop .md files in or create new ones from here."}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>q(!0),children:[(0,b.jsx)(D,{className:"size-3.5 mr-1"}),"Add folder"]}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:t,children:(0,b.jsx)(A.RefreshCw,{className:"size-3.5"})})]})]}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsxs)("div",{className:"relative max-w-sm",children:[(0,b.jsx)(B.default,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),(0,b.jsx)(K.Input,{value:h,onChange:a=>i(a.target.value),placeholder:"Search skills…",className:"pl-7 h-8 text-xs"})]})}),p&&(0,b.jsx)(aq,{onCancel:()=>q(!1),onSaved:()=>{q(!1),t()}}),(0,b.jsx)("div",{className:"space-y-3",children:u.map(({dir:a,items:c})=>(0,b.jsxs)("div",{onDragOver:b=>{a.writable&&(b.preventDefault(),s(a.path))},onDragLeave:()=>s(b=>b===a.path?null:b),onDrop:b=>{b.preventDefault(),s(null),a.writable&&v(b.dataTransfer.files,a.path)},className:(0,N.cn)("rounded-lg border bg-card/40 p-3 transition-colors",r===a.path?"border-primary bg-primary/5":"border-border/60"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,b.jsx)(F.FolderOpen,{className:(0,N.cn)("size-4",a.alwaysApply?"text-amber-500":"text-muted-foreground")}),(0,b.jsx)("span",{className:"text-sm font-medium",children:a.label}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:a.source}),a.alwaysApply&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-amber-500",children:"always-on"}),!a.exists&&(0,b.jsx)("span",{className:"text-[10px] text-rose-500",children:"missing"}),(0,b.jsx)("code",{className:"ml-auto text-[10px] text-muted-foreground/70 font-mono truncate max-w-[280px]",children:a.path}),a.writable&&(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",className:"h-6 px-2",onClick:()=>o(a.path),children:[(0,b.jsx)(m.Plus,{className:"size-3 mr-1"}),"New"]}),"additional"===a.source&&(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",className:"h-6 px-1 text-rose-500",onClick:async()=>{confirm(`Stop loading skills from ${a.path}?`)&&(await P(`/api/skills/directories?path=${encodeURIComponent(a.path)}`,{method:"DELETE"}),t())},children:(0,b.jsx)(l.Trash2,{className:"size-3"})})]}),n===a.path&&(0,b.jsx)(ar,{directory:a.path,onCancel:()=>o(null),onSaved:()=>{o(null),t()}}),0===c.length?(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground italic px-1",children:a.writable?"No skills here yet — drop .md files or click New.":"No skills here."}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:c.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>k(a),className:"w-full flex items-start gap-2 px-1 py-2 text-left hover:bg-accent/40 rounded transition-colors",children:[(0,b.jsx)(E.default,{className:"size-3.5 text-muted-foreground shrink-0 mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium truncate",children:a.name}),(0,b.jsx)("code",{className:"text-[10px] text-muted-foreground font-mono truncate",children:a.fileName}),a.alwaysApply&&(0,b.jsx)("span",{className:"text-[10px] text-amber-500 uppercase tracking-wide",children:"always"}),a.globs.length>0&&(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.globs.join(", ")})]}),a.description&&(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground line-clamp-2 mt-0.5",children:a.description})]}),(0,b.jsx)(H.Pencil,{className:"size-3 text-muted-foreground/60 mt-1"})]},a.id))})]},a.path))}),j&&(0,b.jsx)(as,{skill:j,onClose:()=>k(null),onSaved:()=>{k(null),t()}})]})}function aq({onCancel:a,onSaved:e}){let[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(null),l=(0,c.useRef)(null),m=async()=>{if(k(null),f.trim()){i(!0);try{let a=await P("/api/skills/directories",{method:"POST",body:JSON.stringify({path:f.trim()})});if(a.error)return void k(a.error);e()}finally{i(!1)}}};return(0,b.jsxs)("div",{className:"rounded-lg border border-border/60 bg-card/40 p-3 mb-3 space-y-2",children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Directory path"}),(0,b.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["Absolute path (recommended) or a path relative to the orchestrator's working directory. All ",(0,b.jsx)("code",{children:".md"})," / ",(0,b.jsx)("code",{children:".mdc"})," files inside are picked up automatically."]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(K.Input,{value:f,onChange:a=>g(a.target.value),placeholder:"/Users/you/skills or ./my-skills",className:"text-xs font-mono"}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>l.current?.click(),title:"Pick a folder to suggest its name (browser security: you'll still need to paste the absolute path)",children:[(0,b.jsx)(F.FolderOpen,{className:"size-3.5 mr-1"}),"Browse"]}),(0,b.jsx)("input",{ref:l,type:"file",webkitdirectory:"",directory:"",multiple:!0,hidden:!0,onChange:a=>{let b=a.target.files;if(!b||0===b.length)return;let c=b[0],d=(c.webkitRelativePath||c.name).split("/")[0];f||g(d)}})]}),j&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:j}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:m,disabled:h||!f.trim(),children:h?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):"Add folder"}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:a,children:"Cancel"})]})]})}function ar({directory:a,onCancel:e,onSaved:f}){let[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),s=(0,c.useRef)(null),t=async()=>{r(null);let b=g.trim()||(i?i.toLowerCase().replace(/[^a-z0-9]+/g,"-")+".md":"untitled.md");p(!0);try{let c,d=await P("/api/skills",{method:"POST",body:JSON.stringify({directory:a,fileName:b,content:(c=["---"],i&&c.push(`name: ${i}`),k&&c.push(`description: ${k.replace(/\n/g," ")}`),c.push("---",""),c.join("\n")+(m||`# ${i||"New skill"}
2
2
 
3
- Describe what this skill does and when to use it.`))})});if(d.error)return void r(d.error);f()}finally{p(!1)}},u=async a=>{let b=a.target.files;if(!b||!b[0])return;let c=b[0];h(c.name),n(await c.text())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Skill name"}),(0,b.jsx)(K.Input,{value:i,onChange:a=>j(a.target.value),placeholder:"React Performance",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"File name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"react-performance.md",className:"text-xs font-mono"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Description"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"When to use this skill (one sentence).",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Body (markdown)"}),(0,b.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),rows:6,placeholder:"# How to do X Step 1…",className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono"})]}),q&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:q}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:t,disabled:o,children:o?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G,{className:"size-3.5 mr-1"}),"Save"]})}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>s.current?.click(),children:[(0,b.jsx)(I,{className:"size-3.5 mr-1"}),"Import .md"]}),(0,b.jsx)("input",{ref:s,type:"file",hidden:!0,accept:".md,.mdc,.markdown,.txt",onChange:u}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function ar({skill:a,onClose:e,onSaved:f}){let[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),[k,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return(async()=>{let c=await P(`/api/skills/${a.id}`);b||(h(c.content),q(c.content),j(c.writable))})(),()=>{b=!0}},[a.id]);let r=null!==g&&g!==p,s=async()=>{if(null!==g&&i){m(!0);try{await P(`/api/skills/${a.id}`,{method:"PUT",body:JSON.stringify({content:g})}),q(g),o(!0),setTimeout(()=>o(!1),1200)}finally{m(!1)}}},t=async()=>{confirm(`Delete skill "${a.name}"? This removes the file from disk.`)&&(await P(`/api/skills/${a.id}`,{method:"DELETE"}),f())};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:e,children:(0,b.jsxs)("div",{className:"bg-card rounded-lg border border-border max-w-3xl w-full max-h-[85vh] flex flex-col shadow-2xl",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/60",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h2",{className:"text-base font-semibold flex items-center gap-2 truncate",children:[(0,b.jsx)(E.default,{className:"size-4 text-muted-foreground"}),a.name,!i&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"read-only"})]}),(0,b.jsx)("code",{className:"text-[11px] text-muted-foreground font-mono truncate block",children:a.filePath})]}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:e,children:(0,b.jsx)(u.X,{className:"size-4"})})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col p-4",children:null===g?(0,b.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,b.jsx)("textarea",{value:g,onChange:a=>h(a.target.value),readOnly:!i,spellCheck:!1,className:"flex-1 w-full rounded-md border border-input bg-background px-3 py-2 text-xs font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary/40"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-5 py-3 border-t border-border/60",children:[i&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(J.Button,{size:"sm",onClick:s,disabled:!r||k,children:[k?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin mr-1"}):(0,b.jsx)(G,{className:"size-3.5 mr-1"}),"Save"]}),n&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"}),(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",onClick:t,className:"text-rose-500 hover:text-rose-600 ml-auto",children:[(0,b.jsx)(l.Trash2,{className:"size-3.5 mr-1"}),"Delete"]})]}),!i&&(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Built-in skills can't be edited from the UI. Copy the contents into a custom folder to override."})]})]})})}function as({status:a}){return(0,b.jsx)("span",{className:(0,N.cn)("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] border",{routed:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",completed:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",dropped:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",received:"bg-blue-500/15 text-blue-400 border-blue-500/30",error:"bg-red-500/15 text-red-400 border-red-500/30",failed:"bg-red-500/15 text-red-400 border-red-500/30"}[a]),children:a})}a.s(["default",()=>R],344934)}];
3
+ Describe what this skill does and when to use it.`))})});if(d.error)return void r(d.error);f()}finally{p(!1)}},u=async a=>{let b=a.target.files;if(!b||!b[0])return;let c=b[0];h(c.name),n(await c.text())};return(0,b.jsxs)("div",{className:"rounded-md border border-border/60 bg-background/50 p-3 mb-2 space-y-2",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Skill name"}),(0,b.jsx)(K.Input,{value:i,onChange:a=>j(a.target.value),placeholder:"React Performance",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"File name"}),(0,b.jsx)(K.Input,{value:g,onChange:a=>h(a.target.value),placeholder:"react-performance.md",className:"text-xs font-mono"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Description"}),(0,b.jsx)(K.Input,{value:k,onChange:a=>l(a.target.value),placeholder:"When to use this skill (one sentence).",className:"text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(L.Label,{className:"text-xs",children:"Body (markdown)"}),(0,b.jsx)("textarea",{value:m,onChange:a=>n(a.target.value),rows:6,placeholder:"# How to do X Step 1…",className:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono"})]}),q&&(0,b.jsx)("p",{className:"text-[11px] text-rose-500",children:q}),(0,b.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,b.jsx)(J.Button,{size:"sm",onClick:t,disabled:o,children:o?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G,{className:"size-3.5 mr-1"}),"Save"]})}),(0,b.jsxs)(J.Button,{size:"sm",variant:"outline",onClick:()=>s.current?.click(),children:[(0,b.jsx)(I,{className:"size-3.5 mr-1"}),"Import .md"]}),(0,b.jsx)("input",{ref:s,type:"file",hidden:!0,accept:".md,.mdc,.markdown,.txt",onChange:u}),(0,b.jsx)(J.Button,{size:"sm",variant:"ghost",onClick:e,children:"Cancel"})]})]})}function as({skill:a,onClose:e,onSaved:f}){let[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),[k,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("");(0,c.useEffect)(()=>{let b=!1;return(async()=>{let c=await P(`/api/skills/${a.id}`);b||(h(c.content),q(c.content),j(c.writable))})(),()=>{b=!0}},[a.id]);let r=null!==g&&g!==p,s=async()=>{if(null!==g&&i){m(!0);try{await P(`/api/skills/${a.id}`,{method:"PUT",body:JSON.stringify({content:g})}),q(g),o(!0),setTimeout(()=>o(!1),1200)}finally{m(!1)}}},t=async()=>{confirm(`Delete skill "${a.name}"? This removes the file from disk.`)&&(await P(`/api/skills/${a.id}`,{method:"DELETE"}),f())};return(0,b.jsx)("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",onClick:e,children:(0,b.jsxs)("div",{className:"bg-card rounded-lg border border-border max-w-3xl w-full max-h-[85vh] flex flex-col shadow-2xl",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border/60",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("h2",{className:"text-base font-semibold flex items-center gap-2 truncate",children:[(0,b.jsx)(E.default,{className:"size-4 text-muted-foreground"}),a.name,!i&&(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"read-only"})]}),(0,b.jsx)("code",{className:"text-[11px] text-muted-foreground font-mono truncate block",children:a.filePath})]}),(0,b.jsx)(J.Button,{size:"icon",variant:"ghost",onClick:e,children:(0,b.jsx)(u.X,{className:"size-4"})})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col p-4",children:null===g?(0,b.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):(0,b.jsx)("textarea",{value:g,onChange:a=>h(a.target.value),readOnly:!i,spellCheck:!1,className:"flex-1 w-full rounded-md border border-input bg-background px-3 py-2 text-xs font-mono resize-none focus:outline-none focus:ring-2 focus:ring-primary/40"})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 px-5 py-3 border-t border-border/60",children:[i&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(J.Button,{size:"sm",onClick:s,disabled:!r||k,children:[k?(0,b.jsx)(d.Loader2,{className:"size-3.5 animate-spin mr-1"}):(0,b.jsx)(G,{className:"size-3.5 mr-1"}),"Save"]}),n&&(0,b.jsx)("span",{className:"text-xs text-emerald-500",children:"Saved ✓"}),(0,b.jsxs)(J.Button,{size:"sm",variant:"ghost",onClick:t,className:"text-rose-500 hover:text-rose-600 ml-auto",children:[(0,b.jsx)(l.Trash2,{className:"size-3.5 mr-1"}),"Delete"]})]}),!i&&(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Built-in skills can't be edited from the UI. Copy the contents into a custom folder to override."})]})]})})}function at({status:a}){return(0,b.jsx)("span",{className:(0,N.cn)("inline-flex items-center px-1.5 py-0.5 rounded text-[10px] border",{routed:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",completed:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",dropped:"bg-yellow-500/15 text-yellow-400 border-yellow-500/30",received:"bg-blue-500/15 text-blue-400 border-blue-500/30",error:"bg-red-500/15 text-red-400 border-red-500/30",failed:"bg-red-500/15 text-red-400 border-red-500/30"}[a]),children:a})}a.s(["default",()=>R],344934)}];
4
4
 
5
5
  //# sourceMappingURL=web_src_app_%28main%29_settings_page_tsx_eb320e07._.js.map
@@ -1 +1 @@
1
- self.__NEXT_FONT_MANIFEST="{\n \"app\": {\n \"[project]/web/src/app/(main)/agents/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/(main)/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/(main)/session/[id]/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/(main)/settings/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/_not-found/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/docs/installation/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/docs/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/docs/skills/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ],\n \"[project]/web/src/app/docs/tools/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.479bea2b.woff2\"\n ]\n },\n \"appUsingSizeAdjust\": true,\n \"pages\": {},\n \"pagesUsingSizeAdjust\": false\n}"
1
+ self.__NEXT_FONT_MANIFEST="{\n \"app\": {\n \"[project]/web/src/app/(main)/agents/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/(main)/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/(main)/session/[id]/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/(main)/settings/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/_not-found/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/docs/installation/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/docs/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/docs/skills/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ],\n \"[project]/web/src/app/docs/tools/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2\",\n \"static/media/797e433ab948586e-s.p.29207c2f.woff2\"\n ]\n },\n \"appUsingSizeAdjust\": true,\n \"pages\": {},\n \"pagesUsingSizeAdjust\": false\n}"
@@ -2,39 +2,39 @@
2
2
  "app": {
3
3
  "[project]/web/src/app/(main)/agents/page": [
4
4
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
5
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
5
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
6
6
  ],
7
7
  "[project]/web/src/app/(main)/page": [
8
8
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
9
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
9
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
10
10
  ],
11
11
  "[project]/web/src/app/(main)/session/[id]/page": [
12
12
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
13
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
13
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
14
14
  ],
15
15
  "[project]/web/src/app/(main)/settings/page": [
16
16
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
17
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
17
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
18
18
  ],
19
19
  "[project]/web/src/app/_not-found/page": [
20
20
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
21
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
21
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
22
22
  ],
23
23
  "[project]/web/src/app/docs/installation/page": [
24
24
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
25
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
25
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
26
26
  ],
27
27
  "[project]/web/src/app/docs/page": [
28
28
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
29
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
29
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
30
30
  ],
31
31
  "[project]/web/src/app/docs/skills/page": [
32
32
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
33
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
33
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
34
34
  ],
35
35
  "[project]/web/src/app/docs/tools/page": [
36
36
  "static/media/caa3a2e1cccd8315-s.p.3b6cae6d.woff2",
37
- "static/media/797e433ab948586e-s.p.479bea2b.woff2"
37
+ "static/media/797e433ab948586e-s.p.29207c2f.woff2"
38
38
  ]
39
39
  },
40
40
  "appUsingSizeAdjust": true,
@@ -1 +1 @@
1
- <!DOCTYPE html><!--2mUQ8I_TCRE5uOBFhIWag--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/><link rel="stylesheet" href="/_next/static/chunks/a7d5d0791c8c6223.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/chunks/acb0fc66f5414af6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/735a2408c315b2f0.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-2c0905c7bbebae3f.js" async=""></script><script src="/_next/static/chunks/b203b9aa975135d3.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a0a0a"/><title>SparkeCoder - AI-Powered Coding Agent</title><meta name="description" content="SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming."/><meta name="author" content="SparkeCoder Team"/><link rel="manifest" href="/manifest.json"/><meta name="keywords" content="AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming"/><meta name="creator" content="SparkeCoder"/><meta name="publisher" content="SparkeCoder"/><meta name="robots" content="index, follow"/><meta name="googlebot" content="index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"/><meta name="category" content="technology"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="SparkeCoder"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><meta property="og:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta property="og:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta property="og:site_name" content="SparkeCoder"/><meta property="og:locale" content="en_US"/><meta property="og:image" content="http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png"/><meta property="og:image:width" content="512"/><meta property="og:image:height" content="512"/><meta property="og:image:type" content="image/png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta name="twitter:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta name="twitter:image" content="http://localhost:3001/twitter-image.png?twitter-image.ce342317.png"/><meta name="twitter:image:width" content="512"/><meta name="twitter:image:height" content="512"/><meta name="twitter:image:type" content="image/png"/><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/icon.png?icon.fdefec0f.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-icon.png?apple-icon.d6d14cbd.png" sizes="180x180" type="image/png"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[760800,[\"/_next/static/chunks/b203b9aa975135d3.js\"],\"ApiInit\"]\n3:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n5:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\na:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nc:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n:HL[\"/_next/static/chunks/a7d5d0791c8c6223.css\",\"style\"]\n:HL[\"/_next/static/chunks/acb0fc66f5414af6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"2mUQ8I-TCRE5uOBFhIWag\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/a7d5d0791c8c6223.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/acb0fc66f5414af6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/b203b9aa975135d3.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=5\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#ffffff\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#0a0a0a\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n7:null\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"title\",\"0\",{\"children\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"SparkeCoder Team\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"keywords\",\"content\":\"AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming\"}],[\"$\",\"meta\",\"5\",{\"name\":\"creator\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"6\",{\"name\":\"publisher\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"7\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"8\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"9\",{\"name\":\"category\",\"content\":\"technology\"}],[\"$\",\"meta\",\"10\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"11\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"12\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"13\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:site_name\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image\",\"content\":\"http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:image:type\",\"content\":\"image/png\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"http://localhost:3001/twitter-image.png?twitter-image.ce342317.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image:type\",\"content\":\"image/png\"}],[\"$\",\"link\",\"30\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"31\",{\"rel\":\"icon\",\"href\":\"/icon.png?icon.fdefec0f.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"32\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?apple-icon.d6d14cbd.png\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"33\",{}]]\n"])</script></body></html>
1
+ <!DOCTYPE html><!--WaAcu3X3K00MDvfn1ik7H--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5"/><link rel="stylesheet" href="/_next/static/chunks/34d933785a17edf3.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/chunks/acb0fc66f5414af6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/651e187cc15d66de.js"/><script src="/_next/static/chunks/735a2408c315b2f0.js" async=""></script><script src="/_next/static/chunks/186e0c1b3ff43c9c.js" async=""></script><script src="/_next/static/chunks/a14243261b055626.js" async=""></script><script src="/_next/static/chunks/862ced58ce21a270.js" async=""></script><script src="/_next/static/chunks/turbopack-2c0905c7bbebae3f.js" async=""></script><script src="/_next/static/chunks/185f69f6478ba713.js" async=""></script><script src="/_next/static/chunks/9b5512fb633ef95d.js" async=""></script><script src="/_next/static/chunks/0f1cf11540868e42.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff"/><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0a0a0a"/><title>SparkeCoder - AI-Powered Coding Agent</title><meta name="description" content="SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming."/><meta name="author" content="SparkeCoder Team"/><link rel="manifest" href="/manifest.json"/><meta name="keywords" content="AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming"/><meta name="creator" content="SparkeCoder"/><meta name="publisher" content="SparkeCoder"/><meta name="robots" content="index, follow"/><meta name="googlebot" content="index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"/><meta name="category" content="technology"/><meta name="format-detection" content="telephone=no"/><meta name="mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-title" content="SparkeCoder"/><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/><meta property="og:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta property="og:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta property="og:site_name" content="SparkeCoder"/><meta property="og:locale" content="en_US"/><meta property="og:image" content="http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png"/><meta property="og:image:width" content="512"/><meta property="og:image:height" content="512"/><meta property="og:image:type" content="image/png"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="SparkeCoder - AI-Powered Coding Agent"/><meta name="twitter:description" content="Build, debug, and ship code faster with intelligent AI automation and natural language programming."/><meta name="twitter:image" content="http://localhost:3001/twitter-image.png?twitter-image.ce342317.png"/><meta name="twitter:image:width" content="512"/><meta name="twitter:image:height" content="512"/><meta name="twitter:image:type" content="image/png"/><link rel="icon" href="/favicon.ico?favicon.e3cbed1b.ico" sizes="256x256" type="image/x-icon"/><link rel="icon" href="/icon.png?icon.fdefec0f.png" sizes="32x32" type="image/png"/><link rel="apple-touch-icon" href="/apple-icon.png?apple-icon.d6d14cbd.png" sizes="180x180" type="image/png"/><script src="/_next/static/chunks/a6dad97d9634a72d.js" noModule=""></script></head><body class="geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/651e187cc15d66de.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[760800,[\"/_next/static/chunks/185f69f6478ba713.js\"],\"ApiInit\"]\n3:I[488287,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n4:I[174895,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n5:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"ViewportBoundary\"]\na:I[151858,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"MetadataBoundary\"]\nc:I[552576,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"default\"]\n:HL[\"/_next/static/chunks/34d933785a17edf3.css\",\"style\"]\n:HL[\"/_next/static/chunks/acb0fc66f5414af6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"WaAcu3X3K00MDvfn1ik7H\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/34d933785a17edf3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/acb0fc66f5414af6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/185f69f6478ba713.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[\"$\",\"body\",null,{\"className\":\"geist_a71539c9-module__T19VSG__variable geist_mono_8d43a2aa-module__8Li5zG__variable antialiased\",\"children\":[[\"$\",\"$L2\",null,{}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:1:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",\"$undefined\"],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=5\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: light)\",\"content\":\"#ffffff\"}],[\"$\",\"meta\",\"3\",{\"name\":\"theme-color\",\"media\":\"(prefers-color-scheme: dark)\",\"content\":\"#0a0a0a\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[349310,[\"/_next/static/chunks/9b5512fb633ef95d.js\",\"/_next/static/chunks/0f1cf11540868e42.js\"],\"IconMark\"]\n7:null\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"title\",\"0\",{\"children\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"SparkeCoder is your AI-powered coding assistant. Build, debug, and ship code faster with intelligent automation and natural language programming.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"author\",\"content\":\"SparkeCoder Team\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"meta\",\"4\",{\"name\":\"keywords\",\"content\":\"AI coding assistant,code automation,AI programming,developer tools,coding agent,SparkeCoder,AI pair programming\"}],[\"$\",\"meta\",\"5\",{\"name\":\"creator\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"6\",{\"name\":\"publisher\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"7\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"8\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"meta\",\"9\",{\"name\":\"category\",\"content\":\"technology\"}],[\"$\",\"meta\",\"10\",{\"name\":\"format-detection\",\"content\":\"telephone=no\"}],[\"$\",\"meta\",\"11\",{\"name\":\"mobile-web-app-capable\",\"content\":\"yes\"}],[\"$\",\"meta\",\"12\",{\"name\":\"apple-mobile-web-app-title\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"13\",{\"name\":\"apple-mobile-web-app-status-bar-style\",\"content\":\"black-translucent\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:site_name\",\"content\":\"SparkeCoder\"}],[\"$\",\"meta\",\"17\",{\"property\":\"og:locale\",\"content\":\"en_US\"}],[\"$\",\"meta\",\"18\",{\"property\":\"og:image\",\"content\":\"http://localhost:3001/opengraph-image.png?opengraph-image.ce342317.png\"}],[\"$\",\"meta\",\"19\",{\"property\":\"og:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"20\",{\"property\":\"og:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"21\",{\"property\":\"og:image:type\",\"content\":\"image/png\"}],[\"$\",\"meta\",\"22\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:title\",\"content\":\"SparkeCoder - AI-Powered Coding Agent\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:description\",\"content\":\"Build, debug, and ship code faster with intelligent AI automation and natural language programming.\"}],[\"$\",\"meta\",\"26\",{\"name\":\"twitter:image\",\"content\":\"http://localhost:3001/twitter-image.png?twitter-image.ce342317.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"twitter:image:width\",\"content\":\"512\"}],[\"$\",\"meta\",\"28\",{\"name\":\"twitter:image:height\",\"content\":\"512\"}],[\"$\",\"meta\",\"29\",{\"name\":\"twitter:image:type\",\"content\":\"image/png\"}],[\"$\",\"link\",\"30\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.e3cbed1b.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"link\",\"31\",{\"rel\":\"icon\",\"href\":\"/icon.png?icon.fdefec0f.png\",\"sizes\":\"32x32\",\"type\":\"image/png\"}],[\"$\",\"link\",\"32\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png?apple-icon.d6d14cbd.png\",\"sizes\":\"180x180\",\"type\":\"image/png\"}],[\"$\",\"$Ld\",\"33\",{}]]\n"])</script></body></html>