@lovelybunch/api 1.0.76-alpha.1 → 1.0.76-alpha.3

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 (411) hide show
  1. package/dist/routes/api/v1/jobs/[id]/runs/[runId]/route.d.ts +2 -2
  2. package/dist/routes/api/v1/mail/route.d.ts +3 -3
  3. package/dist/routes/api/v1/slack/route.d.ts +6 -6
  4. package/dist/routes/api/v1/terminal/code/index.d.ts +3 -0
  5. package/dist/routes/api/v1/terminal/code/index.js +5 -0
  6. package/dist/routes/api/v1/terminal/{[proposalId]/destroy → code}/route.d.ts +5 -1
  7. package/dist/routes/api/v1/terminal/code/route.js +165 -0
  8. package/dist/server-with-static.js +2 -0
  9. package/dist/server.js +2 -0
  10. package/package.json +4 -4
  11. package/static/assets/{ActivityPage-DC2t-Kyv.js → ActivityPage-Cktjpci7.js} +1 -1
  12. package/static/assets/{ApiKeysSettingsPage-DbXgxh7i.js → ApiKeysSettingsPage-n-srNxQn.js} +1 -1
  13. package/static/assets/{ArchitectureEditPage-B5dNFxvL.js → ArchitectureEditPage-DG9ahyi7.js} +2 -2
  14. package/static/assets/{ArchitecturePage-D796d-Je.js → ArchitecturePage-BfBKdW5c.js} +1 -1
  15. package/static/assets/{AuthSettingsPage-nIgM05Yw.js → AuthSettingsPage-Db1Xoq5F.js} +2 -2
  16. package/static/assets/{CallbackPage-NNbLun2S.js → CallbackPage-CglxDr9P.js} +1 -1
  17. package/static/assets/CodePage-BrgNt-bV.js +2 -0
  18. package/static/assets/{CollapsibleSection-DbKW4cyU.js → CollapsibleSection-vKx39wB0.js} +1 -1
  19. package/static/assets/{DashboardPage-Aw1xWH4M.js → DashboardPage-BXGFgfmx.js} +2 -2
  20. package/static/assets/{GitPage-Hi0mdDOi.js → GitPage-BcjXkIIp.js} +3 -3
  21. package/static/assets/{GitSettingsPage-2vuCM-U-.js → GitSettingsPage-Dkf0xFd3.js} +2 -2
  22. package/static/assets/{IdentityPage-2BzLc2EI.js → IdentityPage-B9DlFVs2.js} +2 -2
  23. package/static/assets/{ImplementationStepsEditor-BlmI5YuN.js → ImplementationStepsEditor-BmhZCJkG.js} +1 -1
  24. package/static/assets/IntegrationsSettingsPage-pY_ByIP_.js +1 -0
  25. package/static/assets/{JobDetailPage-CLEY1Z5e.js → JobDetailPage-DG7g8kZw.js} +1 -1
  26. package/static/assets/{KnowledgeDetailPage-D94ukozt.js → KnowledgeDetailPage-CUTafqOC.js} +1 -1
  27. package/static/assets/KnowledgeEditPage-DemxKFuT.js +1 -0
  28. package/static/assets/{KnowledgePage-D-ahboFK.js → KnowledgePage-Cy94lzVN.js} +1 -1
  29. package/static/assets/{LoginPage-DQ2rJliF.js → LoginPage-DIOIFPpd.js} +1 -1
  30. package/static/assets/{MailInboxPage-Bfh0_pBU.js → MailInboxPage-C0DJJfjN.js} +1 -1
  31. package/static/assets/{MailProcessingModal-NF9kjdgr.js → MailProcessingModal-C5c7Hxr1.js} +2 -2
  32. package/static/assets/{MailReadPage-C0QhDa1x.js → MailReadPage-D850TxKf.js} +1 -1
  33. package/static/assets/{MailSentPage-Ctgcp1RB.js → MailSentPage-DdCosCt5.js} +1 -1
  34. package/static/assets/{McpSettingsPage-CFgpw5_r.js → McpSettingsPage-BFs7optm.js} +1 -1
  35. package/static/assets/NewKnowledgePage-CinAhmhe.js +9 -0
  36. package/static/assets/{NewSkillPage-CvBSXZFE.js → NewSkillPage-_PUiZWTT.js} +1 -1
  37. package/static/assets/{NewTaskPage-DRL-pyjV.js → NewTaskPage-Cj_pFRNh.js} +2 -2
  38. package/static/assets/{NotFoundPage-DW0gfvNA.js → NotFoundPage-C1WDBXFV.js} +1 -1
  39. package/static/assets/NotificationsSettingsPage-CLi28JAP.js +1 -0
  40. package/static/assets/ProjectEditPage-Dr366988.js +11 -0
  41. package/static/assets/{ProjectPage-78a-iVFG.js → ProjectPage-DweaymEr.js} +1 -1
  42. package/static/assets/PromptsSettingsPage-CYJ_llrO.js +1 -0
  43. package/static/assets/{ResourceDetailPage-CLcuo4yw.js → ResourceDetailPage-Q2RCaRRC.js} +1 -1
  44. package/static/assets/{ResourcesPage-C0TGRawd.js → ResourcesPage-DhPwqABQ.js} +2 -2
  45. package/static/assets/RoleEditPage-C31VNX51.js +13 -0
  46. package/static/assets/{RolePage-haUf186q.js → RolePage-BtP1ZAXn.js} +1 -1
  47. package/static/assets/{RulesSettingsPage-Cc8rvAvm.js → RulesSettingsPage-BL9_FzSn.js} +1 -1
  48. package/static/assets/SchedulePage-DUAZfOex.js +4 -0
  49. package/static/assets/{SkillDetailPage-BqhoNNkM.js → SkillDetailPage-DtO9qUkm.js} +1 -1
  50. package/static/assets/{SkillEditPage-cpSdv9D4.js → SkillEditPage-BeTa_IPy.js} +1 -1
  51. package/static/assets/{SkillsPage-Cxkm5ymf.js → SkillsPage-D7cQKv9a.js} +1 -1
  52. package/static/assets/{SkillsSettingsPage-DrmRher8.js → SkillsSettingsPage-DEWXQvQS.js} +1 -1
  53. package/static/assets/{SourceInput-C0WkiXS6.js → SourceInput-DoUioMfT.js} +1 -1
  54. package/static/assets/{TagInput-raThOrbG.js → TagInput-BxCMXfcS.js} +1 -1
  55. package/static/assets/{TaskDetailPage-BMzce3uJ.js → TaskDetailPage-DdqyQ4Md.js} +2 -2
  56. package/static/assets/TaskEditPage-Do2nmXct.js +1 -0
  57. package/static/assets/{TasksPage-CxKJQJ1_.js → TasksPage-CnvtbfDU.js} +3 -3
  58. package/static/assets/{TerminalPage-BWdNoEM5.js → TerminalPage-DoijWtPu.js} +1 -1
  59. package/static/assets/{TerminalSessionPage-B6_ssmNM.js → TerminalSessionPage-DpDou_1W.js} +2 -2
  60. package/static/assets/UserPreferencesPage-Delx2st9.js +1 -0
  61. package/static/assets/{UserSettingsPage-CqooRxDi.js → UserSettingsPage-BzvZ0ENB.js} +1 -1
  62. package/static/assets/{UtilitiesPage-e4IaR2YV.js → UtilitiesPage-Dn1sRlZ5.js} +1 -1
  63. package/static/assets/{alert-BGFBZOrZ.js → alert-rjIgDS-V.js} +1 -1
  64. package/static/assets/apl-B4CMkyY2.js +1 -0
  65. package/static/assets/{arrow-down-DXhs3vvo.js → arrow-down-BUF9PsVt.js} +1 -1
  66. package/static/assets/{arrow-left-PEX5RePT.js → arrow-left-D3otDKod.js} +1 -1
  67. package/static/assets/{arrow-up-D7z0QZsQ.js → arrow-up-D_qb79lZ.js} +1 -1
  68. package/static/assets/{arrow-up-down-OTrzDHIL.js → arrow-up-down-DNI83nZr.js} +1 -1
  69. package/static/assets/asciiarmor-Df11BRmG.js +1 -0
  70. package/static/assets/asn1-EdZsLKOL.js +1 -0
  71. package/static/assets/asterisk-B-8jnY81.js +1 -0
  72. package/static/assets/{badge-rki-Xf0E.js → badge-D2aQlcxQ.js} +1 -1
  73. package/static/assets/brainfuck-C4LP7Hcl.js +1 -0
  74. package/static/assets/{browser-modal-BKnqJnf5.js → browser-modal-Cdsk2tVF.js} +1 -1
  75. package/static/assets/{card-_Grh-Otl.js → card-CxtDjDKY.js} +1 -1
  76. package/static/assets/{chevron-left-LQtIDk73.js → chevron-left--lDS1l8m.js} +1 -1
  77. package/static/assets/{chevron-up-BM1GKhAV.js → chevron-up-CjDDMMJu.js} +1 -1
  78. package/static/assets/{chevrons-up-Ccej0FyZ.js → chevrons-up-BB0xPeZH.js} +1 -1
  79. package/static/assets/{circle-alert-C5k9mZfC.js → circle-alert-BMJmMq2s.js} +1 -1
  80. package/static/assets/{circle-check-fwIZxHsK.js → circle-check-ByTq4NJ8.js} +1 -1
  81. package/static/assets/{circle-check-big-BaFefwt0.js → circle-check-big-ffEHzVVe.js} +1 -1
  82. package/static/assets/{circle-play-C1R46Kry.js → circle-play-1hF_cA0H.js} +1 -1
  83. package/static/assets/{circle-x-CKuM1691.js → circle-x-DmE_F1rc.js} +1 -1
  84. package/static/assets/clike-B9uivgTg.js +1 -0
  85. package/static/assets/{clipboard-DWJnnRi8.js → clipboard-BjaDjgWb.js} +1 -1
  86. package/static/assets/{clock-Diqm3Csm.js → clock-BB0UgsVd.js} +1 -1
  87. package/static/assets/clojure-BMjYHr_A.js +1 -0
  88. package/static/assets/cmake-BQqOBYOt.js +1 -0
  89. package/static/assets/cobol-CWcv1MsR.js +1 -0
  90. package/static/assets/{code-Ao0cA5nW.js → code-DOk08pmu.js} +1 -1
  91. package/static/assets/coffeescript-S37ZYGWr.js +1 -0
  92. package/static/assets/commonlisp-DBKNyK5s.js +1 -0
  93. package/static/assets/crystal-SjHAIU92.js +1 -0
  94. package/static/assets/css-BnMrqG3P.js +1 -0
  95. package/static/assets/cypher-C_CwsFkJ.js +1 -0
  96. package/static/assets/d-pRatUO7H.js +1 -0
  97. package/static/assets/diff-DbItnlRl.js +1 -0
  98. package/static/assets/dockerfile-BKs6k2Af.js +1 -0
  99. package/static/assets/{download-5iQDQeY0.js → download-Dcxv9aVW.js} +1 -1
  100. package/static/assets/dtd-DF_7sFjM.js +1 -0
  101. package/static/assets/dylan-DwRh75JA.js +1 -0
  102. package/static/assets/ebnf-CDyGwa7X.js +1 -0
  103. package/static/assets/ecl-Cabwm37j.js +1 -0
  104. package/static/assets/eiffel-CnydiIhH.js +1 -0
  105. package/static/assets/elm-vLlmbW-K.js +1 -0
  106. package/static/assets/erlang-BNw1qcRV.js +1 -0
  107. package/static/assets/{external-link-B6dkiWgP.js → external-link-DIMKYjHG.js} +1 -1
  108. package/static/assets/{eye-DQUzAWBY.js → eye-jNavJOmE.js} +1 -1
  109. package/static/assets/factor-kuTfRLto.js +1 -0
  110. package/static/assets/fcl-Kvtd6kyn.js +1 -0
  111. package/static/assets/{folder-git-2-CQUj8P5W.js → folder-git-2-CYrsj8b-.js} +1 -1
  112. package/static/assets/forth-Ffai-XNe.js +1 -0
  113. package/static/assets/fortran-DYz_wnZ1.js +1 -0
  114. package/static/assets/gas-Bneqetm1.js +1 -0
  115. package/static/assets/gherkin-heZmZLOM.js +1 -0
  116. package/static/assets/groovy-D9Dt4D0W.js +1 -0
  117. package/static/assets/haskell-Cw1EW3IL.js +1 -0
  118. package/static/assets/haxe-H-WmDvRZ.js +1 -0
  119. package/static/assets/http-DBlCnlav.js +1 -0
  120. package/static/assets/idl-BEugSyMb.js +1 -0
  121. package/static/assets/index-B80Gxduz.js +1 -0
  122. package/static/assets/index-BA3w3CnT.js +1 -0
  123. package/static/assets/index-BVRdkhj2.js +1 -0
  124. package/static/assets/index-BduAKlgn.js +1 -0
  125. package/static/assets/index-Be7gMvi9.js +2 -0
  126. package/static/assets/index-BfNvp3tP.js +1 -0
  127. package/static/assets/index-Bnh1XFKf.js +1 -0
  128. package/static/assets/index-CD4GQ7sO.js +1 -0
  129. package/static/assets/index-CMVAyePi.js +1 -0
  130. package/static/assets/index-CP0Sm80t.js +1 -0
  131. package/static/assets/index-CVuqy6zg.js +1 -0
  132. package/static/assets/index-CWpX8DAq.js +1 -0
  133. package/static/assets/index-CjdjJ5zF.js +7 -0
  134. package/static/assets/index-CsUt0G9A.js +3 -0
  135. package/static/assets/index-DH_vXhd4.css +1 -0
  136. package/static/assets/{index-CIFIEidO.js → index-Dnh3d5dh.js} +103 -103
  137. package/static/assets/index-QNazGQsT.js +1 -0
  138. package/static/assets/index-SImVYpAE.js +1 -0
  139. package/static/assets/index-dad-EstO.js +1 -0
  140. package/static/assets/index-q8NyCSdt.js +1 -0
  141. package/static/assets/{info-BvzdeJ30.js → info-Yy5O8i5m.js} +1 -1
  142. package/static/assets/javascript-iXu5QeM3.js +1 -0
  143. package/static/assets/julia-DuME0IfC.js +1 -0
  144. package/static/assets/{label-B1lgxULu.js → label-Cz7OkZOa.js} +1 -1
  145. package/static/assets/livescript-BwQOo05w.js +1 -0
  146. package/static/assets/lua-BgMRiT3U.js +1 -0
  147. package/static/assets/markdown-editor-B6HEtSkH.css +1 -0
  148. package/static/assets/markdown-editor-BB9LQlVV.js +111 -0
  149. package/static/assets/mathematica-DTrFuWx2.js +1 -0
  150. package/static/assets/mbox-CNhZ1qSd.js +1 -0
  151. package/static/assets/{message-square-LKqx0LRr.js → message-square-CM5C3WrG.js} +1 -1
  152. package/static/assets/mirc-CjQqDB4T.js +1 -0
  153. package/static/assets/mllike-CXdrOF99.js +1 -0
  154. package/static/assets/modelica-Dc1JOy9r.js +1 -0
  155. package/static/assets/mscgen-BA5vi2Kp.js +1 -0
  156. package/static/assets/mumps-BT43cFF4.js +1 -0
  157. package/static/assets/nginx-DdIZxoE0.js +1 -0
  158. package/static/assets/nsis-LdVXkNf5.js +1 -0
  159. package/static/assets/ntriples-BfvgReVJ.js +1 -0
  160. package/static/assets/octave-Ck1zUtKM.js +1 -0
  161. package/static/assets/oz-BzwKVEFT.js +1 -0
  162. package/static/assets/{paperclip-Cvcr3t6l.js → paperclip-DeU_srFt.js} +1 -1
  163. package/static/assets/pascal--L3eBynH.js +1 -0
  164. package/static/assets/{pause-TaMz44vG.js → pause-CTaIY1s_.js} +1 -1
  165. package/static/assets/perl-CdXCOZ3F.js +1 -0
  166. package/static/assets/pig-CevX1Tat.js +1 -0
  167. package/static/assets/pipeline-builders-Bkf0wt_O.js +17 -0
  168. package/static/assets/{play-C4YxfQOO.js → play-B1b-UHj0.js} +1 -1
  169. package/static/assets/powershell-CFHJl5sT.js +1 -0
  170. package/static/assets/properties-C78fOPTZ.js +1 -0
  171. package/static/assets/protobuf-ChK-085T.js +1 -0
  172. package/static/assets/pug-DeIclll2.js +1 -0
  173. package/static/assets/puppet-DMA9R1ak.js +1 -0
  174. package/static/assets/python-BuPzkPfP.js +1 -0
  175. package/static/assets/q-pXgVlZs6.js +1 -0
  176. package/static/assets/r-B6wPVr8A.js +1 -0
  177. package/static/assets/{radio-group-D7Rt-k1F.js → radio-group-BWLXdTdF.js} +1 -1
  178. package/static/assets/{refresh-cw-C9ZWZi2c.js → refresh-cw-DY5O1wul.js} +1 -1
  179. package/static/assets/rpm-CTu-6PCP.js +1 -0
  180. package/static/assets/ruby-B2Rjki9n.js +1 -0
  181. package/static/assets/sas-B4kiWyti.js +1 -0
  182. package/static/assets/scheme-C41bIUwD.js +1 -0
  183. package/static/assets/{search-C1RuN2pO.js → search-B1RvqxVs.js} +1 -1
  184. package/static/assets/select-DGSoJZ_9.js +1 -0
  185. package/static/assets/shell-CjFT_Tl9.js +1 -0
  186. package/static/assets/sieve-C3Gn_uJK.js +1 -0
  187. package/static/assets/simple-mode-GW_nhZxv.js +1 -0
  188. package/static/assets/smalltalk-CnHTOXQT.js +1 -0
  189. package/static/assets/solr-DehyRSwq.js +1 -0
  190. package/static/assets/sparql-DkYu6x3z.js +1 -0
  191. package/static/assets/spreadsheet-BCZA_wO0.js +1 -0
  192. package/static/assets/sql-D0XecflT.js +1 -0
  193. package/static/assets/stex-C3f8Ysf7.js +1 -0
  194. package/static/assets/stylus-B533Al4x.js +1 -0
  195. package/static/assets/swift-BzpIVaGY.js +1 -0
  196. package/static/assets/{switch-LSkE6hx8.js → switch-BD6hHCvO.js} +1 -1
  197. package/static/assets/{tabs-etlvrbtm.js → tabs-gR86EHwh.js} +1 -1
  198. package/static/assets/{tag-B2iP7vv_.js → tag-B6vbC3rM.js} +1 -1
  199. package/static/assets/tcl-DVfN8rqt.js +1 -0
  200. package/static/assets/{terminal-preview-PyMHLXJ3.js → terminal-preview-BF6OYmEL.js} +1 -1
  201. package/static/assets/textile-CnDTJFAw.js +1 -0
  202. package/static/assets/tiddlywiki-DO-Gjzrf.js +1 -0
  203. package/static/assets/tiki-DGYXhP31.js +1 -0
  204. package/static/assets/toml-Bm5Em-hy.js +1 -0
  205. package/static/assets/troff-wAsdV37c.js +1 -0
  206. package/static/assets/ttcn-CfJYG6tj.js +1 -0
  207. package/static/assets/ttcn-cfg-B9xdYoR4.js +1 -0
  208. package/static/assets/turtle-B1tBg_DP.js +1 -0
  209. package/static/assets/{use-terminal-Blvh8GLp.js → use-terminal-D6UJQuYa.js} +1 -1
  210. package/static/assets/vb-CmGdzxic.js +1 -0
  211. package/static/assets/vbscript-BuJXcnF6.js +1 -0
  212. package/static/assets/velocity-D8B20fx6.js +1 -0
  213. package/static/assets/verilog-C6RDOZhf.js +1 -0
  214. package/static/assets/vhdl-lSbBsy5d.js +1 -0
  215. package/static/assets/{video-A2wzYKal.js → video-NvQlXQ8s.js} +1 -1
  216. package/static/assets/webidl-ZXfAyPTL.js +1 -0
  217. package/static/assets/xquery-DzFWVndE.js +1 -0
  218. package/static/assets/yacas-BJ4BC0dw.js +1 -0
  219. package/static/assets/z80-Hz9HOZM7.js +1 -0
  220. package/static/index.html +2 -2
  221. package/dist/lib/auth/auth-manager.d.ts.map +0 -1
  222. package/dist/lib/auth/auth-manager.js.map +0 -1
  223. package/dist/lib/gait-path.d.ts.map +0 -1
  224. package/dist/lib/gait-path.js.map +0 -1
  225. package/dist/lib/git-settings.d.ts.map +0 -1
  226. package/dist/lib/git-settings.js.map +0 -1
  227. package/dist/lib/git.d.ts.map +0 -1
  228. package/dist/lib/git.js.map +0 -1
  229. package/dist/lib/jobs/global-job-scheduler.d.ts.map +0 -1
  230. package/dist/lib/jobs/global-job-scheduler.js.map +0 -1
  231. package/dist/lib/jobs/job-runner.d.ts.map +0 -1
  232. package/dist/lib/jobs/job-runner.js.map +0 -1
  233. package/dist/lib/jobs/job-scheduler.d.ts.map +0 -1
  234. package/dist/lib/jobs/job-scheduler.js.map +0 -1
  235. package/dist/lib/jobs/job-store.d.ts.map +0 -1
  236. package/dist/lib/jobs/job-store.js.map +0 -1
  237. package/dist/lib/project-paths.d.ts.map +0 -1
  238. package/dist/lib/project-paths.js.map +0 -1
  239. package/dist/lib/storage/file-storage.d.ts.map +0 -1
  240. package/dist/lib/storage/file-storage.js.map +0 -1
  241. package/dist/lib/symlinks/symlink-manager.d.ts.map +0 -1
  242. package/dist/lib/symlinks/symlink-manager.js.map +0 -1
  243. package/dist/lib/symlinks/types.d.ts.map +0 -1
  244. package/dist/lib/symlinks/types.js.map +0 -1
  245. package/dist/lib/terminal/context-helper.d.ts.map +0 -1
  246. package/dist/lib/terminal/context-helper.js.map +0 -1
  247. package/dist/lib/terminal/global-manager.d.ts.map +0 -1
  248. package/dist/lib/terminal/global-manager.js.map +0 -1
  249. package/dist/lib/terminal/shell-utils.d.ts.map +0 -1
  250. package/dist/lib/terminal/shell-utils.js.map +0 -1
  251. package/dist/lib/terminal/terminal-manager.d.ts.map +0 -1
  252. package/dist/lib/terminal/terminal-manager.js.map +0 -1
  253. package/dist/lib/user-preferences.d.ts.map +0 -1
  254. package/dist/lib/user-preferences.js.map +0 -1
  255. package/dist/middleware/auth.d.ts.map +0 -1
  256. package/dist/middleware/auth.js.map +0 -1
  257. package/dist/routes/api/v1/agents/[id]/index.d.ts.map +0 -1
  258. package/dist/routes/api/v1/agents/[id]/index.js.map +0 -1
  259. package/dist/routes/api/v1/agents/[id]/route.d.ts.map +0 -1
  260. package/dist/routes/api/v1/agents/[id]/route.js.map +0 -1
  261. package/dist/routes/api/v1/agents/index.d.ts.map +0 -1
  262. package/dist/routes/api/v1/agents/index.js.map +0 -1
  263. package/dist/routes/api/v1/agents/route.d.ts.map +0 -1
  264. package/dist/routes/api/v1/agents/route.js.map +0 -1
  265. package/dist/routes/api/v1/ai/index.d.ts.map +0 -1
  266. package/dist/routes/api/v1/ai/index.js.map +0 -1
  267. package/dist/routes/api/v1/ai/route.d.ts.map +0 -1
  268. package/dist/routes/api/v1/ai/route.js.map +0 -1
  269. package/dist/routes/api/v1/ai/tools.d.ts +0 -17
  270. package/dist/routes/api/v1/ai/tools.js +0 -1114
  271. package/dist/routes/api/v1/api-keys/index.d.ts.map +0 -1
  272. package/dist/routes/api/v1/api-keys/index.js.map +0 -1
  273. package/dist/routes/api/v1/api-keys/route.d.ts.map +0 -1
  274. package/dist/routes/api/v1/api-keys/route.js.map +0 -1
  275. package/dist/routes/api/v1/auth/index.d.ts.map +0 -1
  276. package/dist/routes/api/v1/auth/index.js.map +0 -1
  277. package/dist/routes/api/v1/auth/route.d.ts.map +0 -1
  278. package/dist/routes/api/v1/auth/route.js.map +0 -1
  279. package/dist/routes/api/v1/auth-settings/index.d.ts.map +0 -1
  280. package/dist/routes/api/v1/auth-settings/index.js.map +0 -1
  281. package/dist/routes/api/v1/auth-settings/route.d.ts.map +0 -1
  282. package/dist/routes/api/v1/auth-settings/route.js.map +0 -1
  283. package/dist/routes/api/v1/chats/[id]/index.d.ts.map +0 -1
  284. package/dist/routes/api/v1/chats/[id]/index.js.map +0 -1
  285. package/dist/routes/api/v1/chats/[id]/route.d.ts.map +0 -1
  286. package/dist/routes/api/v1/chats/[id]/route.js.map +0 -1
  287. package/dist/routes/api/v1/chats/index.d.ts.map +0 -1
  288. package/dist/routes/api/v1/chats/index.js.map +0 -1
  289. package/dist/routes/api/v1/chats/route.d.ts.map +0 -1
  290. package/dist/routes/api/v1/chats/route.js.map +0 -1
  291. package/dist/routes/api/v1/config/index.d.ts.map +0 -1
  292. package/dist/routes/api/v1/config/index.js.map +0 -1
  293. package/dist/routes/api/v1/config/route.d.ts.map +0 -1
  294. package/dist/routes/api/v1/config/route.js.map +0 -1
  295. package/dist/routes/api/v1/context/architecture/route.d.ts.map +0 -1
  296. package/dist/routes/api/v1/context/architecture/route.js.map +0 -1
  297. package/dist/routes/api/v1/context/index.d.ts.map +0 -1
  298. package/dist/routes/api/v1/context/index.js.map +0 -1
  299. package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts +0 -1
  300. package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts.map +0 -1
  301. package/dist/routes/api/v1/context/knowledge/[filename]/index.js +0 -1
  302. package/dist/routes/api/v1/context/knowledge/[filename]/index.js.map +0 -1
  303. package/dist/routes/api/v1/context/knowledge/[filename]/route.d.ts +0 -3
  304. package/dist/routes/api/v1/context/knowledge/[filename]/route.d.ts.map +0 -1
  305. package/dist/routes/api/v1/context/knowledge/[filename]/route.js +0 -254
  306. package/dist/routes/api/v1/context/knowledge/[filename]/route.js.map +0 -1
  307. package/dist/routes/api/v1/context/knowledge/index.d.ts +0 -1
  308. package/dist/routes/api/v1/context/knowledge/index.d.ts.map +0 -1
  309. package/dist/routes/api/v1/context/knowledge/index.js +0 -1
  310. package/dist/routes/api/v1/context/knowledge/index.js.map +0 -1
  311. package/dist/routes/api/v1/context/knowledge/route.d.ts +0 -3
  312. package/dist/routes/api/v1/context/knowledge/route.d.ts.map +0 -1
  313. package/dist/routes/api/v1/context/knowledge/route.js +0 -176
  314. package/dist/routes/api/v1/context/knowledge/route.js.map +0 -1
  315. package/dist/routes/api/v1/context/project/route.d.ts.map +0 -1
  316. package/dist/routes/api/v1/context/project/route.js.map +0 -1
  317. package/dist/routes/api/v1/git/index.d.ts.map +0 -1
  318. package/dist/routes/api/v1/git/index.js.map +0 -1
  319. package/dist/routes/api/v1/jobs/[id]/route.d.ts.map +0 -1
  320. package/dist/routes/api/v1/jobs/[id]/route.js.map +0 -1
  321. package/dist/routes/api/v1/jobs/[id]/run/route.d.ts.map +0 -1
  322. package/dist/routes/api/v1/jobs/[id]/run/route.js.map +0 -1
  323. package/dist/routes/api/v1/jobs/index.d.ts.map +0 -1
  324. package/dist/routes/api/v1/jobs/index.js.map +0 -1
  325. package/dist/routes/api/v1/jobs/route.d.ts.map +0 -1
  326. package/dist/routes/api/v1/jobs/route.js.map +0 -1
  327. package/dist/routes/api/v1/jobs/status/route.d.ts.map +0 -1
  328. package/dist/routes/api/v1/jobs/status/route.js.map +0 -1
  329. package/dist/routes/api/v1/mcp/index.d.ts.map +0 -1
  330. package/dist/routes/api/v1/mcp/index.js.map +0 -1
  331. package/dist/routes/api/v1/mcp/route.d.ts.map +0 -1
  332. package/dist/routes/api/v1/mcp/route.js.map +0 -1
  333. package/dist/routes/api/v1/proposals/[id]/route.d.ts +0 -351
  334. package/dist/routes/api/v1/proposals/[id]/route.d.ts.map +0 -1
  335. package/dist/routes/api/v1/proposals/[id]/route.js +0 -156
  336. package/dist/routes/api/v1/proposals/[id]/route.js.map +0 -1
  337. package/dist/routes/api/v1/proposals/index.d.ts +0 -3
  338. package/dist/routes/api/v1/proposals/index.d.ts.map +0 -1
  339. package/dist/routes/api/v1/proposals/index.js +0 -10
  340. package/dist/routes/api/v1/proposals/index.js.map +0 -1
  341. package/dist/routes/api/v1/proposals/route.d.ts +0 -329
  342. package/dist/routes/api/v1/proposals/route.d.ts.map +0 -1
  343. package/dist/routes/api/v1/proposals/route.js +0 -126
  344. package/dist/routes/api/v1/proposals/route.js.map +0 -1
  345. package/dist/routes/api/v1/resources/[id]/index.d.ts.map +0 -1
  346. package/dist/routes/api/v1/resources/[id]/index.js.map +0 -1
  347. package/dist/routes/api/v1/resources/[id]/route.js.map +0 -1
  348. package/dist/routes/api/v1/resources/[id]/thumbnail/index.d.ts.map +0 -1
  349. package/dist/routes/api/v1/resources/[id]/thumbnail/index.js.map +0 -1
  350. package/dist/routes/api/v1/resources/[id]/thumbnail/route.js.map +0 -1
  351. package/dist/routes/api/v1/resources/index.d.ts.map +0 -1
  352. package/dist/routes/api/v1/resources/index.js.map +0 -1
  353. package/dist/routes/api/v1/resources/route.d.ts.map +0 -1
  354. package/dist/routes/api/v1/resources/route.js.map +0 -1
  355. package/dist/routes/api/v1/symlinks/index.d.ts.map +0 -1
  356. package/dist/routes/api/v1/symlinks/index.js.map +0 -1
  357. package/dist/routes/api/v1/symlinks/route.d.ts.map +0 -1
  358. package/dist/routes/api/v1/symlinks/route.js.map +0 -1
  359. package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts +0 -3
  360. package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts.map +0 -1
  361. package/dist/routes/api/v1/terminal/[proposalId]/create/index.js +0 -5
  362. package/dist/routes/api/v1/terminal/[proposalId]/create/index.js.map +0 -1
  363. package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts +0 -10
  364. package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts.map +0 -1
  365. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js +0 -27
  366. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js.map +0 -1
  367. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts +0 -3
  368. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts.map +0 -1
  369. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js +0 -5
  370. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js.map +0 -1
  371. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts.map +0 -1
  372. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js +0 -21
  373. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js.map +0 -1
  374. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts +0 -3
  375. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts.map +0 -1
  376. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js +0 -5
  377. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js.map +0 -1
  378. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts +0 -10
  379. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts.map +0 -1
  380. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js +0 -21
  381. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js.map +0 -1
  382. package/dist/routes/api/v1/terminal/sessions/index.d.ts.map +0 -1
  383. package/dist/routes/api/v1/terminal/sessions/index.js.map +0 -1
  384. package/dist/routes/api/v1/terminal/sessions/route.d.ts.map +0 -1
  385. package/dist/routes/api/v1/terminal/sessions/route.js.map +0 -1
  386. package/dist/routes/api/v1/user/index.d.ts.map +0 -1
  387. package/dist/routes/api/v1/user/index.js.map +0 -1
  388. package/dist/routes/api/v1/user/settings/index.d.ts.map +0 -1
  389. package/dist/routes/api/v1/user/settings/index.js.map +0 -1
  390. package/dist/routes/api/v1/user/settings/route.d.ts.map +0 -1
  391. package/dist/routes/api/v1/user/settings/route.js.map +0 -1
  392. package/dist/server-with-static.d.ts.map +0 -1
  393. package/dist/server-with-static.js.map +0 -1
  394. package/dist/server.d.ts.map +0 -1
  395. package/dist/server.js.map +0 -1
  396. package/static/assets/CodePage-xbYipiBR.js +0 -2
  397. package/static/assets/IntegrationsSettingsPage-Ds16sLG2.js +0 -1
  398. package/static/assets/KnowledgeEditPage-DpjdauND.js +0 -1
  399. package/static/assets/NewKnowledgePage-EqWKQ4lU.js +0 -9
  400. package/static/assets/NotificationsSettingsPage-BzVS1D5M.js +0 -1
  401. package/static/assets/ProjectEditPage-BlQk50Xs.js +0 -11
  402. package/static/assets/PromptsSettingsPage-DWEKgvMD.js +0 -1
  403. package/static/assets/RoleEditPage-m6lOchyA.js +0 -13
  404. package/static/assets/SchedulePage-DUSxe93C.js +0 -4
  405. package/static/assets/TaskEditPage-Dpsi2Rcp.js +0 -1
  406. package/static/assets/UserPreferencesPage-CY_0CoMe.js +0 -1
  407. package/static/assets/index-CHdBxVyk.css +0 -2
  408. package/static/assets/kiro-CGoI3Dqh.js +0 -17
  409. package/static/assets/markdown-editor-C-DC0mFI.js +0 -62
  410. package/static/assets/markdown-editor-DUEthZ0y.css +0 -1
  411. package/static/assets/select-Dp3J_OE9.js +0 -1
@@ -10,8 +10,8 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
10
10
  data: {
11
11
  id: string;
12
12
  jobId: string;
13
- trigger: import("@lovelybunch/core").ScheduledJobTrigger;
14
- status: import("@lovelybunch/core").ScheduledJobRunStatus;
13
+ trigger: import("@lovelybunch/types").ScheduledJobTrigger;
14
+ status: import("@lovelybunch/types").ScheduledJobRunStatus;
15
15
  startedAt: string;
16
16
  finishedAt?: string;
17
17
  outputPath?: string;
@@ -116,7 +116,7 @@ export declare function setMailStatusHandler(c: Context): Promise<(Response & im
116
116
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
117
117
  success: false;
118
118
  error: any;
119
- }, 500 | 404, "json">)>;
119
+ }, 404 | 500, "json">)>;
120
120
  /**
121
121
  * POST /api/v1/mail/:id/reply
122
122
  * Reply to an email
@@ -154,7 +154,7 @@ export declare function replyMailHandler(c: Context): Promise<(Response & import
154
154
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
155
155
  success: false;
156
156
  error: any;
157
- }, 500 | 404, "json">)>;
157
+ }, 404 | 500, "json">)>;
158
158
  /**
159
159
  * POST /api/v1/mail/send
160
160
  * Send an email (coming soon)
@@ -217,7 +217,7 @@ export declare function setMailActionHandler(c: Context): Promise<(Response & im
217
217
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
218
218
  success: false;
219
219
  error: any;
220
- }, 500 | 404, "json">)>;
220
+ }, 404 | 500, "json">)>;
221
221
  /**
222
222
  * GET /api/v1/mail/:id/processing
223
223
  * Get processing status and log tail for an email
@@ -7,6 +7,9 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
7
7
  success: true;
8
8
  data: {
9
9
  enabled: boolean;
10
+ channelId: string;
11
+ channelName: string;
12
+ siteUrl: string;
10
13
  notifications: {
11
14
  proposals: {
12
15
  created: boolean;
@@ -21,9 +24,6 @@ export declare function getConfig(c: Context): Promise<(Response & import("hono"
21
24
  merge: boolean;
22
25
  };
23
26
  };
24
- channelId: string;
25
- channelName: string;
26
- siteUrl: string;
27
27
  hasBotToken: boolean;
28
28
  hasSigningSecret: boolean;
29
29
  };
@@ -39,6 +39,9 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
39
39
  success: true;
40
40
  data: {
41
41
  enabled: boolean;
42
+ channelId: string;
43
+ channelName: string;
44
+ siteUrl: string;
42
45
  notifications: {
43
46
  proposals: {
44
47
  created: boolean;
@@ -53,9 +56,6 @@ export declare function updateConfig(c: Context): Promise<(Response & import("ho
53
56
  merge: boolean;
54
57
  };
55
58
  };
56
- channelId: string;
57
- channelName: string;
58
- siteUrl: string;
59
59
  hasBotToken: boolean;
60
60
  hasSigningSecret: boolean;
61
61
  };
@@ -0,0 +1,3 @@
1
+ import { Hono } from 'hono';
2
+ declare const code: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
3
+ export default code;
@@ -0,0 +1,5 @@
1
+ import { Hono } from 'hono';
2
+ import { POST } from './route.js';
3
+ const code = new Hono();
4
+ code.post('/', POST);
5
+ export default code;
@@ -4,7 +4,11 @@ export declare function POST(c: Context): Promise<(Response & import("hono").Typ
4
4
  }, 400, "json">) | (Response & import("hono").TypedResponse<{
5
5
  error: string;
6
6
  }, 404, "json">) | (Response & import("hono").TypedResponse<{
7
- success: true;
7
+ sessionId: string;
8
+ taskId: string;
9
+ command: string;
10
+ scriptPath: string;
11
+ createdAt: string;
8
12
  }, import("hono/utils/http-status").ContentfulStatusCode, "json">) | (Response & import("hono").TypedResponse<{
9
13
  error: string;
10
14
  }, 500, "json">)>;
@@ -0,0 +1,165 @@
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+ import matter from 'gray-matter';
4
+ import { getGlobalTerminalManager } from '../../../../../lib/terminal/global-manager.js';
5
+ import { loadUserSettings } from '../../../../../lib/user-preferences.js';
6
+ import { FileStorageAdapter } from '../../../../../lib/storage/file-storage.js';
7
+ import { buildPipelineScript, buildPipelineBanner } from '@lovelybunch/core';
8
+ const storage = new FileStorageAdapter();
9
+ const VALID_AGENTS = ['claude', 'gemini', 'codex', 'droid', 'kiro'];
10
+ const VALID_CONTEXT_TYPES = ['change-task', 'prepare-task', 'skill', 'general'];
11
+ function resolveGaitPath() {
12
+ if (process.env.NODE_ENV === 'development' && process.env.GAIT_DEV_ROOT) {
13
+ return process.env.GAIT_DEV_ROOT;
14
+ }
15
+ if (process.env.GAIT_DATA_PATH) {
16
+ return path.resolve(process.env.GAIT_DATA_PATH, '.nut');
17
+ }
18
+ return path.resolve(process.cwd(), '.nut');
19
+ }
20
+ async function loadMcpServers() {
21
+ const gaitPath = resolveGaitPath();
22
+ const mcpConfigPath = path.join(gaitPath, 'mcp', 'config.json');
23
+ try {
24
+ const raw = await fs.readFile(mcpConfigPath, 'utf-8');
25
+ const json = JSON.parse(raw);
26
+ const mcpServersMap = json.mcpServers || {};
27
+ return { servers: Object.keys(mcpServersMap), mcpServersMap };
28
+ }
29
+ catch {
30
+ return { servers: [], mcpServersMap: {} };
31
+ }
32
+ }
33
+ async function loadSkills() {
34
+ const gaitPath = resolveGaitPath();
35
+ const skillsPath = path.join(gaitPath, 'skills');
36
+ try {
37
+ await fs.mkdir(skillsPath, { recursive: true });
38
+ const entries = await fs.readdir(skillsPath, { withFileTypes: true });
39
+ const skills = await Promise.all(entries
40
+ .filter(entry => entry.isDirectory())
41
+ .map(async (entry) => {
42
+ const skillFile = path.join(skillsPath, entry.name, 'SKILL.md');
43
+ try {
44
+ const content = await fs.readFile(skillFile, 'utf-8');
45
+ const { data } = matter(content);
46
+ return { id: entry.name, name: data.name || entry.name };
47
+ }
48
+ catch {
49
+ return { id: entry.name, name: entry.name };
50
+ }
51
+ }));
52
+ return { skills, ids: skills.map(s => s.id) };
53
+ }
54
+ catch {
55
+ return { skills: [], ids: [] };
56
+ }
57
+ }
58
+ export async function POST(c) {
59
+ try {
60
+ const body = await c.req.json();
61
+ const { taskId } = body;
62
+ if (!taskId) {
63
+ return c.json({ error: 'taskId is required' }, 400);
64
+ }
65
+ const agent = (body.model || 'claude');
66
+ if (!VALID_AGENTS.includes(agent)) {
67
+ return c.json({ error: `Invalid model '${agent}'. Valid options: ${VALID_AGENTS.join(', ')}` }, 400);
68
+ }
69
+ const contextType = (body.contextType || 'change-task');
70
+ if (!VALID_CONTEXT_TYPES.includes(contextType)) {
71
+ return c.json({ error: `Invalid contextType '${contextType}'. Valid options: ${VALID_CONTEXT_TYPES.join(', ')}` }, 400);
72
+ }
73
+ // Validate task exists
74
+ const task = await storage.getTask(taskId);
75
+ if (!task) {
76
+ return c.json({ error: `Task '${taskId}' not found` }, 404);
77
+ }
78
+ // Optionally create a worktree
79
+ let worktreePath;
80
+ if (body.newWorktree) {
81
+ if (body.worktreeSuffix && body.worktreeBranch) {
82
+ return c.json({ error: 'Cannot use both worktreeSuffix and worktreeBranch' }, 400);
83
+ }
84
+ const idPart = taskId.startsWith('cp-') ? taskId.slice(3) : taskId;
85
+ const baseBranch = `feat/cp-${idPart}`;
86
+ let branchName;
87
+ if (body.worktreeBranch) {
88
+ branchName = body.worktreeBranch.trim();
89
+ }
90
+ else if (body.worktreeSuffix) {
91
+ const suffix = body.worktreeSuffix.trim().replace(/[^A-Za-z0-9_-]+/g, '-').replace(/^-+|-+$/g, '');
92
+ branchName = suffix ? `${baseBranch}-${suffix}` : baseBranch;
93
+ }
94
+ else {
95
+ branchName = baseBranch;
96
+ }
97
+ try {
98
+ const apiBase = `http://localhost:${process.env.PORT || 3000}`;
99
+ const worktreeResponse = await fetch(`${apiBase}/api/v1/git/worktrees`, {
100
+ method: 'POST',
101
+ headers: { 'Content-Type': 'application/json' },
102
+ body: JSON.stringify({ branch: branchName, from: 'main' }),
103
+ });
104
+ const worktreeResult = await worktreeResponse.json();
105
+ if (worktreeResult.success) {
106
+ worktreePath = worktreeResult.data?.added?.path;
107
+ }
108
+ }
109
+ catch {
110
+ // Continue without worktree
111
+ }
112
+ }
113
+ // Create terminal session
114
+ const userSettings = await loadUserSettings();
115
+ const shellPreference = (userSettings.preferences.terminalShell || 'bash');
116
+ const startupCommand = worktreePath
117
+ ? `cd '${worktreePath.replace(/'/g, "'\\''")}'`
118
+ : undefined;
119
+ const terminalManager = getGlobalTerminalManager();
120
+ const session = await terminalManager.createSession(taskId, shellPreference, startupCommand);
121
+ // Load MCP servers and skills
122
+ const { servers: selectedMcpServers, mcpServersMap } = await loadMcpServers();
123
+ const { skills, ids: selectedSkillIds } = await loadSkills();
124
+ // Build the raw node script and write to a temp file so the PTY
125
+ // command stays short (avoids echo noise and buffer-length limits).
126
+ const script = buildPipelineScript({
127
+ taskId,
128
+ contextType,
129
+ cliAgent: agent,
130
+ mcpServersMap,
131
+ selectedMcpServers,
132
+ skills,
133
+ selectedSkillIds,
134
+ automationEnabled: Boolean(body.autonomous),
135
+ customInstruction: body.customInstructions,
136
+ interactive: body.interactive ?? true,
137
+ });
138
+ const tmpDir = await fs.mkdtemp(path.join(require('os').tmpdir(), 'nut-pipeline-'));
139
+ const scriptPath = path.join(tmpDir, 'run.js');
140
+ await fs.writeFile(scriptPath, script, 'utf-8');
141
+ const interactive = body.interactive ?? true;
142
+ const banner = buildPipelineBanner({ taskId, cliAgent: agent, contextType, interactive });
143
+ const exitSuffix = interactive ? '' : '; exit';
144
+ const command = `printf '${banner}' && node ${scriptPath}${exitSuffix}`;
145
+ // Send the command to the terminal session after a brief delay for shell init
146
+ setTimeout(() => {
147
+ const s = terminalManager.getSession(session.id);
148
+ if (s?.pty) {
149
+ s.pty.write(command + '\r');
150
+ s.lastActivity = new Date();
151
+ }
152
+ }, 1500);
153
+ return c.json({
154
+ sessionId: session.id,
155
+ taskId: session.taskId,
156
+ command,
157
+ scriptPath,
158
+ createdAt: session.createdAt,
159
+ });
160
+ }
161
+ catch (error) {
162
+ console.error('Error starting code session:', error);
163
+ return c.json({ error: 'Failed to start code session' }, 500);
164
+ }
165
+ }
@@ -162,6 +162,7 @@ import terminalSessions from './routes/api/v1/terminal/sessions/index.js';
162
162
  import terminalCreate from './routes/api/v1/terminal/[taskId]/create/index.js';
163
163
  import terminalDestroy from './routes/api/v1/terminal/[taskId]/destroy/index.js';
164
164
  import terminalResize from './routes/api/v1/terminal/[taskId]/resize/index.js';
165
+ import terminalCode from './routes/api/v1/terminal/code/index.js';
165
166
  import ai from './routes/api/v1/ai/index.js';
166
167
  import chats from './routes/api/v1/chats/index.js';
167
168
  import chatsById from './routes/api/v1/chats/[id]/index.js';
@@ -193,6 +194,7 @@ app.route('/api/v1/terminal/sessions', terminalSessions);
193
194
  app.route('/api/v1/terminal/:taskId/create', terminalCreate);
194
195
  app.route('/api/v1/terminal/:taskId/destroy', terminalDestroy);
195
196
  app.route('/api/v1/terminal/:taskId/resize', terminalResize);
197
+ app.route('/api/v1/terminal/code', terminalCode);
196
198
  app.route('/api/v1/ai', ai);
197
199
  app.route('/api/v1/chats', chats);
198
200
  app.route('/api/v1/chats/:id', chatsById);
package/dist/server.js CHANGED
@@ -161,6 +161,7 @@ import terminalSessions from './routes/api/v1/terminal/sessions/index.js';
161
161
  import terminalCreate from './routes/api/v1/terminal/[taskId]/create/index.js';
162
162
  import terminalDestroy from './routes/api/v1/terminal/[taskId]/destroy/index.js';
163
163
  import terminalResize from './routes/api/v1/terminal/[taskId]/resize/index.js';
164
+ import terminalCode from './routes/api/v1/terminal/code/index.js';
164
165
  import ai from './routes/api/v1/ai/index.js';
165
166
  import chats from './routes/api/v1/chats/index.js';
166
167
  import chatsById from './routes/api/v1/chats/[id]/index.js';
@@ -191,6 +192,7 @@ app.route('/api/v1/terminal/sessions', terminalSessions);
191
192
  app.route('/api/v1/terminal/:taskId/create', terminalCreate);
192
193
  app.route('/api/v1/terminal/:taskId/destroy', terminalDestroy);
193
194
  app.route('/api/v1/terminal/:taskId/resize', terminalResize);
195
+ app.route('/api/v1/terminal/code', terminalCode);
194
196
  app.route('/api/v1/ai', ai);
195
197
  app.route('/api/v1/chats', chats);
196
198
  app.route('/api/v1/chats/:id', chatsById);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/api",
3
- "version": "1.0.76-alpha.1",
3
+ "version": "1.0.76-alpha.3",
4
4
  "type": "module",
5
5
  "main": "dist/server-with-static.js",
6
6
  "exports": {
@@ -37,9 +37,9 @@
37
37
  "@ai-sdk/anthropic": "^3.0.41",
38
38
  "@hono/node-server": "^1.13.7",
39
39
  "@hono/node-ws": "^1.0.6",
40
- "@lovelybunch/core": "^1.0.76-alpha.1",
41
- "@lovelybunch/mcp": "^1.0.76-alpha.1",
42
- "@lovelybunch/types": "^1.0.76-alpha.1",
40
+ "@lovelybunch/core": "^1.0.76-alpha.3",
41
+ "@lovelybunch/mcp": "^1.0.76-alpha.3",
42
+ "@lovelybunch/types": "^1.0.76-alpha.3",
43
43
  "adm-zip": "^0.5.16",
44
44
  "ai": "^6.0.79",
45
45
  "arctic": "^1.9.2",
@@ -1 +1 @@
1
- import{r as a,A as p,j as e,t as y,bu as v,B as N,n as w,C as b}from"./index-CIFIEidO.js";import{C as c,a as d,b as k,c as C}from"./card-_Grh-Otl.js";import{B as m}from"./badge-rki-Xf0E.js";import{R as E}from"./refresh-cw-C9ZWZi2c.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[u,h]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{h(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.toLowerCase()){case"error":return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case"warn":case"warning":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"debug":return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};return i?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(v,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Events Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Activity events will appear here as they occur."})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=u.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
1
+ import{r as a,A as p,j as e,t as y,bI as v,B as N,n as w,C as b}from"./index-Dnh3d5dh.js";import{C as c,a as d,b as k,c as C}from"./card-CxtDjDKY.js";import{B as m}from"./badge-D2aQlcxQ.js";import{R as E}from"./refresh-cw-DY5O1wul.js";const A=5e3;function $(){const[n,o]=a.useState([]),[i,x]=a.useState(!0),[h,u]=a.useState(new Set),l=a.useCallback(async()=>{x(!0);try{const s=await fetch(`${p}/api/v1/events?limit=${A}`);if(!s.ok)throw new Error("Failed to load events");const t=await s.json();o(Array.isArray(t.items)?[...t.items].reverse():[])}catch(s){console.error("Failed to load events:",s),o([])}finally{x(!1)}},[]),g=a.useCallback(s=>{u(t=>{const r=new Set(t);return r.has(s)?r.delete(s):r.add(s),r})},[]);a.useEffect(()=>{l()},[l]);const f=s=>{if(!s)return"Unknown time";try{return new Date(s).toLocaleString()}catch{return s}},j=s=>{switch(s?.toLowerCase()){case"error":return"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200";case"warn":case"warning":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";case"info":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"debug":return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}};return i?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading events..."})]})})})]}):n.length===0?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsx("p",{className:"text-muted-foreground",children:"View system activity and events"})]}),e.jsx(c,{children:e.jsx(d,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(v,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Events Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Activity events will appear here as they occur."})]})})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Activity"}),e.jsxs("p",{className:"text-muted-foreground",children:["View system activity and events (",n.length," events)"]})]}),e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>void l(),disabled:i,children:[e.jsx(E,{className:`h-4 w-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{className:"space-y-3",children:n.map(s=>{const t=h.has(s.seq);return e.jsxs(c,{className:"transition-colors",children:[e.jsx(k,{className:"py-3 cursor-pointer hover:bg-muted/30",onClick:()=>g(s.seq),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t?e.jsx(w,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}):e.jsx(b,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(C,{className:"text-sm font-medium",children:["#",s.seq]}),s.kind&&e.jsx(m,{variant:"outline",className:"text-xs",children:s.kind}),s.level&&e.jsx(m,{className:`text-xs ${j(s.level)}`,children:s.level})]}),s.message&&e.jsx("p",{className:`text-sm text-muted-foreground ${t?"":"truncate"}`,children:s.message})]})]}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:f(s.ts)})]})}),t&&e.jsx(d,{className:"pt-0 pb-4",children:e.jsx("pre",{className:"text-xs bg-muted p-3 rounded-md overflow-x-auto",children:JSON.stringify(s,null,2)})})]},s.seq)})})]})}export{$ as default};
@@ -1,2 +1,2 @@
1
- import{s as R,r as t,b0 as y,j as e,B as a,P as W,b1 as X,E as Y,D as j,b as g,d as v,f,g as A,I as F,W as N,af as J,v as i}from"./index-CIFIEidO.js";import{C as G,b as Q,c as V,d as Z,a as _}from"./card-_Grh-Otl.js";import{L as w}from"./label-B1lgxULu.js";import{B as ee}from"./badge-rki-Xf0E.js";import{A as I,a as C}from"./alert-BGFBZOrZ.js";import{I as L}from"./info-BvzdeJ30.js";import{C as se}from"./circle-alert-C5k9mZfC.js";function oe(){const{authEnabled:n}=R(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!1),d(!0),D(""),E("never"),await p(),i({title:"API Key Created",description:"Make sure to copy your API key now. You won't be able to see it again!"}))}catch(s){console.error("Failed to create API key:",s),i({title:"Error",description:"Failed to create API key",variant:"destructive"})}},B=async s=>{try{(await y(`/api/v1/api-keys/${s}`,{method:"DELETE"})).success&&(await p(),o(null),i({title:"API Key Deleted",description:"The API key has been permanently deleted"}))}catch(r){console.error("Failed to delete API key:",r),i({title:"Error",description:"Failed to delete API key",variant:"destructive"})}},H=async s=>{try{await navigator.clipboard.writeText(s),i({title:"Copied",description:"API key copied to clipboard"})}catch{i({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},u=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=s=>s?new Date(s)<new Date:!1,q=typeof window<"u"?window.location.origin:"http://localhost:3000",z=c?`curl -H "X-API-Key: ${c.key}" \\
1
+ import{s as R,r as t,bw as y,j as e,B as a,P as W,bx as X,E as Y,D as j,b as g,d as v,f,g as A,I as F,W as N,af as J,v as i}from"./index-Dnh3d5dh.js";import{C as G,b as Q,c as V,d as Z,a as _}from"./card-CxtDjDKY.js";import{L as w}from"./label-Cz7OkZOa.js";import{B as ee}from"./badge-D2aQlcxQ.js";import{A as I,a as C}from"./alert-rjIgDS-V.js";import{I as L}from"./info-Yy5O8i5m.js";import{C as se}from"./circle-alert-BMJmMq2s.js";function oe(){const{authEnabled:n}=R(),[P,k]=t.useState([]),[b,K]=t.useState(!0),[O,l]=t.useState(!1),[M,d]=t.useState(!1),[x,D]=t.useState(""),[h,E]=t.useState("never"),[c,S]=t.useState(null),[m,o]=t.useState(null);t.useEffect(()=>{p()},[]);const p=async()=>{K(!0);try{const s=await y("/api/v1/api-keys");s.success&&k(s.data?.apiKeys||[])}catch(s){console.error("Failed to load API keys:",s),k([])}finally{K(!1)}},U=async()=>{if(!x.trim()){i({title:"Error",description:"Please provide a name for the API key",variant:"destructive"});return}try{const s={name:x,scopes:["*"]};h!=="never"&&(s.expiresIn=h);const r=await y("/api/v1/api-keys",{method:"POST",body:JSON.stringify(s)});r.success&&(S(r.data),l(!1),d(!0),D(""),E("never"),await p(),i({title:"API Key Created",description:"Make sure to copy your API key now. You won't be able to see it again!"}))}catch(s){console.error("Failed to create API key:",s),i({title:"Error",description:"Failed to create API key",variant:"destructive"})}},B=async s=>{try{(await y(`/api/v1/api-keys/${s}`,{method:"DELETE"})).success&&(await p(),o(null),i({title:"API Key Deleted",description:"The API key has been permanently deleted"}))}catch(r){console.error("Failed to delete API key:",r),i({title:"Error",description:"Failed to delete API key",variant:"destructive"})}},H=async s=>{try{await navigator.clipboard.writeText(s),i({title:"Copied",description:"API key copied to clipboard"})}catch{i({title:"Error",description:"Failed to copy to clipboard",variant:"destructive"})}},u=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),$=s=>s?new Date(s)<new Date:!1,q=typeof window<"u"?window.location.origin:"http://localhost:3000",z=c?`curl -H "X-API-Key: ${c.key}" \\
2
2
  + ${q}/api/v1/tasks`:"",T=n?null:e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["Authentication is currently disabled. API keys will only be required once you enable authentication in the ",e.jsx("a",{href:"/settings/authentication",className:"underline",children:"Authentication settings"}),"."]})]});return!n&&b?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access"})]}),T]}):b?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"API Keys"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage API keys for programmatic access to your Coconut instance"})]}),T,n&&e.jsxs(I,{children:[e.jsx(L,{className:"h-4 w-4"}),e.jsxs(C,{children:["API keys provide programmatic access to your Coconut instance. Use them in CI/CD pipelines or automation scripts by including the key in the ",e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded",children:"X-API-Key"})," header."]})]}),e.jsxs(G,{children:[e.jsx(Q,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(V,{children:"Active API Keys"}),e.jsx(Z,{children:"API keys you've created for programmatic access"})]}),e.jsxs(a,{onClick:()=>l(!0),disabled:!n,children:[e.jsx(W,{className:"mr-2 h-4 w-4"}),"Create API Key"]})]})}),e.jsx(_,{children:P.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(X,{className:"h-12 w-12 mx-auto mb-4 opacity-20"}),e.jsx("p",{children:"No API keys yet"}),e.jsx("p",{className:"text-sm",children:"Create an API key to get started with programmatic access"})]}):e.jsx("div",{className:"space-y-4",children:P.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"font-medium",children:s.name}),$(s.expiresAt)&&e.jsx(ee,{variant:"destructive",children:"Expired"})]}),e.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:s.keyPreview}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["Created: ",u(s.createdAt)]}),s.expiresAt&&e.jsxs("span",{children:["Expires: ",u(s.expiresAt)]}),s.lastUsedAt&&e.jsxs("span",{children:["Last used: ",u(s.lastUsedAt)]})]})]}),e.jsx(a,{variant:"ghost",size:"icon",onClick:()=>o(s.id),children:e.jsx(Y,{className:"h-4 w-4 text-destructive"})})]},s.id))})})]}),e.jsx(j,{open:O,onOpenChange:l,children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Create API Key"}),e.jsx(A,{children:"Create a new API key for programmatic access. The key will only be shown once."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyName",children:"Name"}),e.jsx(F,{id:"keyName",placeholder:"CI/CD Pipeline",value:x,onChange:s=>D(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A descriptive name to identify this API key"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"keyExpiry",children:"Expiration"}),e.jsxs("select",{id:"keyExpiry",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:h,onChange:s=>E(s.target.value),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"30d",children:"30 days"}),e.jsx("option",{value:"90d",children:"90 days"}),e.jsx("option",{value:"1y",children:"1 year"})]})]})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(a,{onClick:U,disabled:!n,children:"Create API Key"})]})]})}),e.jsx(j,{open:M,onOpenChange:d,children:e.jsxs(g,{className:"sm:max-w-[600px]",children:[e.jsxs(v,{children:[e.jsx(f,{children:"API Key Created"}),e.jsx(A,{children:"Make sure to copy your API key now. You won't be able to see it again!"})]}),e.jsxs(I,{variant:"destructive",className:"my-4",children:[e.jsx(se,{className:"h-4 w-4"}),e.jsx(C,{children:"This is the only time you will see this key. Store it securely."})]}),c&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{children:"API Key"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(F,{readOnly:!0,value:c.key,className:"font-mono text-sm"}),e.jsx(a,{variant:"outline",size:"icon",onClick:()=>H(c.key),children:e.jsx(J,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"mb-2",children:"Usage example:"}),e.jsx("pre",{className:"bg-muted p-3 rounded-md whitespace-pre-wrap break-words",children:e.jsx("code",{className:"font-mono text-xs",children:z})})]})]}),e.jsx(N,{children:e.jsx(a,{onClick:()=>{d(!1),S(null)},children:"I've Saved My Key"})})]})}),e.jsx(j,{open:!!m,onOpenChange:s=>!s&&o(null),children:e.jsxs(g,{children:[e.jsxs(v,{children:[e.jsx(f,{children:"Delete API Key"}),e.jsx(A,{children:"Are you sure you want to delete this API key? This action cannot be undone and any scripts using this key will stop working."})]}),e.jsxs(N,{children:[e.jsx(a,{variant:"outline",onClick:()=>o(null),children:"Cancel"}),e.jsx(a,{variant:"destructive",onClick:()=>m&&B(m),children:"Delete API Key"})]})]})})]})}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{u as D,a as M,r as l,A as b,j as e,B as S,L as I,a0 as _,I as d,o as B}from"./index-CIFIEidO.js";import{C as u,a as p,b as j,c as v}from"./card-_Grh-Otl.js";import{L as o}from"./label-B1lgxULu.js";import{M as P}from"./markdown-editor-C-DC0mFI.js";import{A as R}from"./arrow-left-PEX5RePT.js";import{C as $}from"./circle-check-big-BaFefwt0.js";function Q(){const F=D(),{toast:h}=M(),[n,x]=l.useState({stack:{runtime:"",framework:"",language:"",database:"",deployment:"",repository:""},commands:{}}),[y,f]=l.useState(""),[E,k]=l.useState(""),[L,N]=l.useState(!0),[C,w]=l.useState(!1);l.useEffect(()=>{fetch(`${b}/api/v1/context/architecture`).then(t=>t.json()).then(t=>{if(t.success){const a=t.document,m={stack:{runtime:a.metadata.stack?.runtime||"",framework:a.metadata.stack?.framework||"",language:a.metadata.stack?.language||"",database:a.metadata.stack?.database||"",deployment:a.metadata.stack?.deployment||"",repository:a.metadata.stack?.repository||""},commands:a.metadata.commands||{}};x(m);const s=Object.entries(m.commands).map(([r,c])=>`${r}: ${c}`).join(`
1
+ import{u as D,a as M,r as l,A as b,j as e,B as S,L as I,a0 as _,I as d,o as B}from"./index-Dnh3d5dh.js";import{C as u,a as p,b as j,c as v}from"./card-CxtDjDKY.js";import{L as o}from"./label-Cz7OkZOa.js";import{M as P}from"./markdown-editor-BB9LQlVV.js";import{A as R}from"./arrow-left-D3otDKod.js";import{C as $}from"./circle-check-big-ffEHzVVe.js";import"./index-SImVYpAE.js";function W(){const F=D(),{toast:h}=M(),[n,x]=l.useState({stack:{runtime:"",framework:"",language:"",database:"",deployment:"",repository:""},commands:{}}),[y,f]=l.useState(""),[E,k]=l.useState(""),[L,N]=l.useState(!0),[C,w]=l.useState(!1);l.useEffect(()=>{fetch(`${b}/api/v1/context/architecture`).then(t=>t.json()).then(t=>{if(t.success){const a=t.document,m={stack:{runtime:a.metadata.stack?.runtime||"",framework:a.metadata.stack?.framework||"",language:a.metadata.stack?.language||"",database:a.metadata.stack?.database||"",deployment:a.metadata.stack?.deployment||"",repository:a.metadata.stack?.repository||""},commands:a.metadata.commands||{}};x(m);const s=Object.entries(m.commands).map(([r,c])=>`${r}: ${c}`).join(`
2
2
  `);k(s),f(a.content.trim())}N(!1)}).catch(t=>{console.error("Failed to load context:",t),h({title:"Error",description:"Failed to load architecture documentation",variant:"destructive"}),N(!1)})},[h]);const A=async()=>{w(!0);try{const a=await(await fetch(`${b}/api/v1/context/architecture`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y,metadata:{stack:n.stack,commands:n.commands}})})).json();if(a.success)h({title:"Success",description:"Architecture documentation saved successfully",action:e.jsx($,{className:"h-4 w-4"})}),F("/context/architecture");else throw new Error(a.error||"Failed to save context")}catch(t){console.error("Save error:",t),h({title:"Error",description:"Failed to save architecture documentation",variant:"destructive"})}finally{w(!1)}},i=(t,a)=>{x(m=>{const s={...m},r=t.split(".");let c=s;for(let g=0;g<r.length-1;g++)c=c[r[g]];return c[r[r.length-1]]=a,s})},T=t=>{k(t);const a={};t.split(`
3
3
  `).filter(s=>s.trim()).forEach(s=>{const[r,...c]=s.split(":");r&&c.length>0&&(a[r.trim()]=c.join(":").trim())}),x(s=>({...s,commands:a}))};return L?e.jsx("div",{className:"space-y-6",children:e.jsx(u,{children:e.jsx(p,{className:"pt-6",children:e.jsx("div",{className:"text-center",children:e.jsx("p",{children:"Loading..."})})})})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight",children:"Edit Architecture"}),e.jsx("p",{className:"text-muted-foreground text-sm hidden sm:block",children:"Edit technical architecture and supporting metadata"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(S,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(I,{to:"/context/architecture",className:"text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(R,{className:"w-4 h-4"})})}),e.jsxs(S,{onClick:A,disabled:C,size:"sm",children:[e.jsx(_,{className:"w-4 h-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:C?"Saving...":"Save"})]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(v,{children:"Technology Stack"})}),e.jsxs(p,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"runtime",children:"Runtime"}),e.jsx(d,{id:"runtime",value:n.stack.runtime,onChange:t=>i("stack.runtime",t.target.value),placeholder:"node|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"framework",children:"Framework"}),e.jsx(d,{id:"framework",value:n.stack.framework,onChange:t=>i("stack.framework",t.target.value),placeholder:"express|fastify|django|gin|etc"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"language",children:"Language"}),e.jsx(d,{id:"language",value:n.stack.language,onChange:t=>i("stack.language",t.target.value),placeholder:"typescript|javascript|python|go|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"database",children:"Database"}),e.jsx(d,{id:"database",value:n.stack.database,onChange:t=>i("stack.database",t.target.value),placeholder:"postgresql|mysql|mongodb|sqlite|etc"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"deployment",children:"Deployment"}),e.jsx(d,{id:"deployment",value:n.stack.deployment,onChange:t=>i("stack.deployment",t.target.value),placeholder:"docker|kubernetes|vercel|aws|etc"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"repository",children:"Repository"}),e.jsx(d,{id:"repository",value:n.stack.repository,onChange:t=>i("stack.repository",t.target.value),placeholder:"https://github.com/yourorg/yourproject"})]})]})]})]}),e.jsxs(u,{children:[e.jsx(j,{children:e.jsx(v,{children:"Quick Commands"})}),e.jsx(p,{className:"space-y-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"commands",children:"Commands (format: command_name: command_to_run)"}),e.jsx(B,{id:"commands",value:E,onChange:t=>T(t.target.value),placeholder:`install: npm install
4
4
  dev: npm run dev
@@ -18,4 +18,4 @@ project-root/
18
18
  │ ├── components/
19
19
  │ ├── pages/
20
20
  │ └── services/
21
- \`\`\``,height:800})})]})]})}export{Q as default};
21
+ \`\`\``,height:800})})]})]})}export{W as default};
@@ -1 +1 @@
1
- import{a as g,r as n,A as v,j as e,t as y,F as k,B as l,M as b,au as w,L as C,Y as E,ar as A}from"./index-CIFIEidO.js";import{C as a,a as c,b as o,c as m}from"./card-_Grh-Otl.js";import{c as D}from"./clipboard-B9ndUJKl.js";function S(){const{toast:h}=g(),[r,x]=n.useState(null),[u,p]=n.useState(!0),[j,i]=n.useState(!1);n.useEffect(()=>{fetch(`${v}/api/v1/context/architecture`).then(t=>{if(t.ok)return t.json();throw new Error("Not found")}).then(t=>{t.success?(x(t.document),i(!0)):i(!1)}).catch(()=>{i(!1)}).finally(()=>{p(!1)})},[]);const N=async()=>{const t=".nut/context/architecture.md";try{await D(t),h({title:"Copied!",description:`Path ${t} copied to clipboard`})}catch(d){console.error("Failed to copy path:",d),h({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},f=()=>{const t=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"architecture-md",filename:"architecture.md",name:"architecture.md",path:".nut/context/architecture.md"}});window.dispatchEvent(t)};if(u)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading architecture documentation..."})]})})})});if(!j||!r)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Architecture Documentation Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Architecture documentation will appear here once created."})]})})})});const s=r.metadata;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Technical Architecture"}),e.jsx("p",{className:"text-muted-foreground",children:"System design, components, and technical patterns"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:f,children:[e.jsx(b,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(l,{variant:"outline",size:"sm",onClick:N,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(l,{size:"sm",asChild:!0,children:e.jsxs(C,{to:"/context/architecture/edit",children:[e.jsx(E,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),s&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Technology Stack"})}),e.jsx(c,{className:"space-y-3",children:s.stack&&e.jsxs("div",{className:"space-y-1 text-sm",children:[s.stack.runtime&&e.jsxs("div",{children:["Runtime: ",s.stack.runtime]}),s.stack.framework&&e.jsxs("div",{children:["Framework: ",s.stack.framework]}),s.stack.language&&e.jsxs("div",{children:["Language: ",s.stack.language]}),s.stack.database&&e.jsxs("div",{children:["Database: ",s.stack.database]}),s.stack.deployment&&e.jsxs("div",{children:["Deployment: ",s.stack.deployment]}),s.stack.repository&&e.jsxs("div",{children:["Repository:"," ",e.jsx("a",{href:s.stack.repository,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:s.stack.repository})]})]})})]}),e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Quick Commands"})}),e.jsx(c,{className:"space-y-3",children:s.commands&&e.jsxs("div",{className:"space-y-1",children:[Object.entries(s.commands).slice(0,5).map(([t,d])=>e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"font-medium capitalize",children:[t,": "]}),e.jsx("code",{className:"bg-muted px-2 py-1 rounded text-xs",children:d})]},t)),Object.entries(s.commands).length>5&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["+ ",Object.entries(s.commands).length-5," more commands"]})]})})]})]}),e.jsxs(a,{children:[e.jsx(o,{children:e.jsx(m,{className:"text-lg font-semibold",children:"Architecture Documentation"})}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(A,{children:r.content||"No content available"})})})]})]})}export{S as default};
1
+ import{a as g,r as n,A as v,j as e,t as y,F as k,B as l,M as b,au as w,L as C,Y as E,ar as A}from"./index-Dnh3d5dh.js";import{C as a,a as c,b as o,c as m}from"./card-CxtDjDKY.js";import{c as D}from"./clipboard-B9ndUJKl.js";function S(){const{toast:h}=g(),[r,x]=n.useState(null),[u,p]=n.useState(!0),[j,i]=n.useState(!1);n.useEffect(()=>{fetch(`${v}/api/v1/context/architecture`).then(t=>{if(t.ok)return t.json();throw new Error("Not found")}).then(t=>{t.success?(x(t.document),i(!0)):i(!1)}).catch(()=>{i(!1)}).finally(()=>{p(!1)})},[]);const N=async()=>{const t=".nut/context/architecture.md";try{await D(t),h({title:"Copied!",description:`Path ${t} copied to clipboard`})}catch(d){console.error("Failed to copy path:",d),h({title:"Error",description:"Failed to copy path to clipboard",variant:"destructive"})}},f=()=>{const t=new CustomEvent("discuss-in-chat",{detail:{type:"context",id:"architecture-md",filename:"architecture.md",name:"architecture.md",path:".nut/context/architecture.md"}});window.dispatchEvent(t)};if(u)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(y,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading architecture documentation..."})]})})})});if(!j||!r)return e.jsx("div",{className:"space-y-6",children:e.jsx(a,{children:e.jsx(c,{className:"pt-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("h3",{className:"mt-4 text-lg font-semibold",children:"No Architecture Documentation Found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Architecture documentation will appear here once created."})]})})})});const s=r.metadata;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Technical Architecture"}),e.jsx("p",{className:"text-muted-foreground",children:"System design, components, and technical patterns"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:f,children:[e.jsx(b,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Discuss"})]}),e.jsxs(l,{variant:"outline",size:"sm",onClick:N,children:[e.jsx(w,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Copy Path"})]}),e.jsx(l,{size:"sm",asChild:!0,children:e.jsxs(C,{to:"/context/architecture/edit",children:[e.jsx(E,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})})]})]}),s&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Technology Stack"})}),e.jsx(c,{className:"space-y-3",children:s.stack&&e.jsxs("div",{className:"space-y-1 text-sm",children:[s.stack.runtime&&e.jsxs("div",{children:["Runtime: ",s.stack.runtime]}),s.stack.framework&&e.jsxs("div",{children:["Framework: ",s.stack.framework]}),s.stack.language&&e.jsxs("div",{children:["Language: ",s.stack.language]}),s.stack.database&&e.jsxs("div",{children:["Database: ",s.stack.database]}),s.stack.deployment&&e.jsxs("div",{children:["Deployment: ",s.stack.deployment]}),s.stack.repository&&e.jsxs("div",{children:["Repository:"," ",e.jsx("a",{href:s.stack.repository,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:s.stack.repository})]})]})})]}),e.jsxs(a,{children:[e.jsx(o,{className:"pb-3",children:e.jsx(m,{className:"text-lg font-semibold",children:"Quick Commands"})}),e.jsx(c,{className:"space-y-3",children:s.commands&&e.jsxs("div",{className:"space-y-1",children:[Object.entries(s.commands).slice(0,5).map(([t,d])=>e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"font-medium capitalize",children:[t,": "]}),e.jsx("code",{className:"bg-muted px-2 py-1 rounded text-xs",children:d})]},t)),Object.entries(s.commands).length>5&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["+ ",Object.entries(s.commands).length-5," more commands"]})]})})]})]}),e.jsxs(a,{children:[e.jsx(o,{children:e.jsx(m,{className:"text-lg font-semibold",children:"Architecture Documentation"})}),e.jsx(c,{children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",children:e.jsx(A,{children:r.content||"No content available"})})})]})]})}export{S as default};
@@ -1,4 +1,4 @@
1
- import{c as Y,s as le,r as n,b0 as c,j as e,a$ as O,i as ce,D as I,V as $,B as l,b as M,d as V,f as H,g as J,I as j,W as z,y as oe,z as de,E as he,H as ue,J as xe,N as me,O as ge,Q as je,R as pe,U as ve,v as r}from"./index-CIFIEidO.js";import{C as p,b as v,c as w,d as f,a as y}from"./card-_Grh-Otl.js";import{L as o}from"./label-B1lgxULu.js";import{S as _,a as W,b as q,c as B,d as a}from"./select-Dp3J_OE9.js";import{S as U}from"./switch-LSkE6hx8.js";import{B as k}from"./badge-rki-Xf0E.js";import{C as we}from"./circle-alert-C5k9mZfC.js";import"./chevron-up-BM1GKhAV.js";/**
1
+ import{c as Y,s as le,r as n,bw as c,j as e,bv as O,i as ce,D as I,V as M,B as l,b as V,d as $,f as H,g as J,I as j,W as z,y as oe,z as de,E as he,H as ue,J as xe,N as me,O as ge,Q as je,R as pe,U as ve,v as r}from"./index-Dnh3d5dh.js";import{C as p,b as v,c as w,d as f,a as y}from"./card-CxtDjDKY.js";import{L as o}from"./label-Cz7OkZOa.js";import{S as _,a as W,b as q,c as B,d as a}from"./select-DGSoJZ_9.js";import{S as U}from"./switch-BD6hHCvO.js";import{B as k}from"./badge-D2aQlcxQ.js";import{C as we}from"./circle-alert-BMJmMq2s.js";import"./index-SImVYpAE.js";import"./chevron-up-CjDDMMJu.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as Y,s as le,r as n,b0 as c,j as e,a$ as O,i as ce,D as I,V as $,B as l
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Ne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Se=Y("user-plus",Ne);function Pe(){const{user:N,authEnabled:K,checkAuthStatus:Q}=le(),[i,d]=n.useState(null),[G,F]=n.useState(!0),[S,D]=n.useState(!1),[X,C]=n.useState(!1),[b,P]=n.useState(""),[A,R]=n.useState(""),[T,L]=n.useState("viewer"),[E,u]=n.useState(null),[x,m]=n.useState(""),Z=!K||N?.role==="admin";n.useEffect(()=>{h()},[]);const h=async()=>{try{F(!0);const s=await c("/api/v1/auth-settings");s.success?d(s.data):d(null)}catch(s){console.error("Failed to load auth settings:",s),d(null)}finally{F(!1)}},ee=async()=>{if(!i)return;const s=!i.enabled;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({enabled:s})});if(t.success)d({...i,enabled:s}),await Q(),r({title:"Success",description:`Authentication ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to toggle auth")}catch(t){r({title:"Error",description:t.message||"Failed to toggle authentication",variant:"destructive"})}},se=async()=>{if(!i)return;const s=!i.allowRegistration;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({allowRegistration:s})});if(t.success)d({...i,allowRegistration:s}),r({title:"Success",description:`Self-registration ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to update setting")}catch(t){r({title:"Error",description:t.message||"Failed to update setting",variant:"destructive"})}},te=async()=>{if(!b||!A){r({title:"Error",description:"Please provide email and name",variant:"destructive"});return}try{const s=await c("/api/v1/auth-settings/users",{method:"POST",body:JSON.stringify({email:b,name:A,role:T})});if(s.success)await h(),C(!1),P(""),R(""),L("viewer"),r({title:"Success",description:"User added to whitelist"});else throw new Error(s.error||"Failed to add user")}catch(s){r({title:"Error",description:s.message||"Failed to add user",variant:"destructive"})}},ie=async s=>{try{const t=await c(`/api/v1/auth-settings/users/${s}`,{method:"DELETE"});if(t.success)await h(),r({title:"Success",description:"User removed from whitelist"});else throw new Error(t.error||"Failed to remove user")}catch(t){r({title:"Error",description:t.message||"Failed to remove user",variant:"destructive"})}},re=async(s,t)=>{try{const g=await c(`/api/v1/auth-settings/users/${s}`,{method:"PUT",body:JSON.stringify({role:t})});if(g.success)await h(),r({title:"Success",description:"User role updated"});else throw new Error(g.error||"Failed to update role")}catch(g){r({title:"Error",description:g.message||"Failed to update role",variant:"destructive"})}},ae=async()=>{if(!(!E||!x)){if(x.length<8){r({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}try{const s=await c(`/api/v1/auth-settings/users/${E}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:x})});if(s.success)u(null),m(""),r({title:"Success",description:"Password reset successfully"});else throw new Error(s.error||"Failed to reset password")}catch(s){r({title:"Error",description:s.message||"Failed to reset password",variant:"destructive"})}}},ne=async()=>{if(i)try{D(!0);const s=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({session:i.session})});if(s.success)r({title:"Success",description:"Session settings updated"});else throw new Error(s.error||"Failed to update settings")}catch(s){r({title:"Error",description:s.message||"Failed to update settings",variant:"destructive"})}finally{D(!1)}};return G?e.jsx("div",{children:"Loading..."}):i?Z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication settings and user access."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-5 w-5"}),e.jsx(w,{children:"Authentication Status"})]}),e.jsx(f,{children:"Control whether authentication is required to access Coconut."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"auth-enabled",children:"Require Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"When enabled, users must log in to access Coconut"})]}),e.jsx(U,{id:"auth-enabled",checked:i.enabled,onCheckedChange:ee})]}),i.enabled&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"allow-registration",children:"Allow Self-Registration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Whitelisted users can create their own accounts"})]}),e.jsx(U,{id:"allow-registration",checked:i.allowRegistration,onCheckedChange:se})]})]})]}),e.jsxs(p,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(w,{children:"Whitelisted Users"}),e.jsx(f,{children:"Manage users who can access this Coconut instance."})]}),e.jsxs(I,{open:X,onOpenChange:C,children:[e.jsx($,{asChild:!0,children:e.jsxs(l,{size:"sm",children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Add User"]})}),e.jsxs(M,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Add User to Whitelist"}),e.jsx(J,{children:"Add a user's email to allow them to register and access Coconut."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-email",children:"Email"}),e.jsx(j,{id:"new-email",type:"email",value:b,onChange:s=>P(s.target.value),placeholder:"user@example.com"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-name",children:"Name"}),e.jsx(j,{id:"new-name",value:A,onChange:s=>R(s.target.value),placeholder:"User Name"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-role",children:"Role"}),e.jsxs(_,{value:T,onValueChange:s=>L(s),children:[e.jsx(W,{children:e.jsx(q,{})}),e.jsxs(B,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(z,{children:[e.jsx(l,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsx(l,{onClick:te,children:"Add User"})]})]})]})]})}),e.jsx(y,{children:e.jsx("div",{className:"space-y-4",children:i.providers.local.users.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium",children:s.name}),s.registered?e.jsx(k,{variant:"default",className:"text-xs",children:"Registered"}):e.jsx(k,{variant:"secondary",className:"text-xs",children:"Pending"}),s.id===N?.id&&e.jsx(k,{variant:"outline",className:"text-xs",children:"You"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email}),s.lastLoginAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last login: ",new Date(s.lastLoginAt).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(_,{value:s.role,onValueChange:t=>re(s.id,t),children:[e.jsx(W,{className:"w-40",children:e.jsx(q,{})}),e.jsxs(B,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]}),e.jsxs(I,{open:E===s.id,onOpenChange:t=>{t||(u(null),m(""))},children:[e.jsx($,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s.id),children:e.jsx(ye,{className:"h-4 w-4"})})}),e.jsxs(M,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Reset Password"}),e.jsxs(J,{children:["Set a new password for ",s.name]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{children:[e.jsx(o,{htmlFor:"reset-password",children:"New Password"}),e.jsx(j,{id:"reset-password",type:"password",value:x,onChange:t=>m(t.target.value),placeholder:"At least 8 characters",minLength:8})]})}),e.jsxs(z,{children:[e.jsx(l,{variant:"outline",onClick:()=>{u(null),m("")},children:"Cancel"}),e.jsx(l,{onClick:ae,children:"Reset Password"})]})]})]}),s.id!==N?.id&&e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"destructive",children:e.jsx(he,{className:"h-4 w-4"})})}),e.jsxs(ue,{children:[e.jsxs(xe,{children:[e.jsx(me,{children:"Remove User"}),e.jsxs(ge,{children:["Are you sure you want to remove ",s.name," from the whitelist? They will no longer be able to access Coconut."]})]}),e.jsxs(je,{children:[e.jsx(pe,{children:"Cancel"}),e.jsx(ve,{onClick:()=>ie(s.id),children:"Remove"})]})]})]})]})]},s.id))})})]}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsx(w,{children:"Session Settings"}),e.jsx(f,{children:"Configure session behavior and security."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"session-expiry",children:"Session Expiry"}),e.jsx(j,{id:"session-expiry",value:i.session.expiresIn,onChange:s=>d({...i,session:{...i.session,expiresIn:s.target.value}}),placeholder:"7d"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Format: 30s, 15m, 24h, 7d"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"secure-cookies",children:"Secure Cookies (HTTPS only)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable in production with HTTPS"})]}),e.jsx(U,{id:"secure-cookies",checked:i.session.secure||!1,onCheckedChange:s=>d({...i,session:{...i.session,secure:s}})})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(l,{variant:"outline",onClick:h,disabled:S,children:"Cancel"}),e.jsx(l,{onClick:ne,disabled:S,children:S?"Saving...":"Save Session Settings"})]})]}):e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have permission to manage authentication settings."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Secure your Coconut instance with authentication."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(w,{children:"Authentication Not Configured"})]}),e.jsx(f,{children:"Authentication has not been initialized. Use the CLI to set up authentication."})]}),e.jsxs(y,{children:[e.jsx("div",{className:"bg-muted p-4 rounded-md",children:e.jsxs("code",{className:"text-sm",children:["$ nut auth init",e.jsx("br",{}),"$ nut auth toggle"]})}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"This will create an admin user and enable authentication for your Coconut instance."})]})]})]})}export{Pe as default};
11
+ */const Ne=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Se=Y("user-plus",Ne);function Re(){const{user:N,authEnabled:K,checkAuthStatus:Q}=le(),[i,d]=n.useState(null),[G,F]=n.useState(!0),[S,D]=n.useState(!1),[X,C]=n.useState(!1),[b,P]=n.useState(""),[A,R]=n.useState(""),[T,L]=n.useState("viewer"),[E,u]=n.useState(null),[x,m]=n.useState(""),Z=!K||N?.role==="admin";n.useEffect(()=>{h()},[]);const h=async()=>{try{F(!0);const s=await c("/api/v1/auth-settings");s.success?d(s.data):d(null)}catch(s){console.error("Failed to load auth settings:",s),d(null)}finally{F(!1)}},ee=async()=>{if(!i)return;const s=!i.enabled;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({enabled:s})});if(t.success)d({...i,enabled:s}),await Q(),r({title:"Success",description:`Authentication ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to toggle auth")}catch(t){r({title:"Error",description:t.message||"Failed to toggle authentication",variant:"destructive"})}},se=async()=>{if(!i)return;const s=!i.allowRegistration;try{const t=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({allowRegistration:s})});if(t.success)d({...i,allowRegistration:s}),r({title:"Success",description:`Self-registration ${s?"enabled":"disabled"}`});else throw new Error(t.error||"Failed to update setting")}catch(t){r({title:"Error",description:t.message||"Failed to update setting",variant:"destructive"})}},te=async()=>{if(!b||!A){r({title:"Error",description:"Please provide email and name",variant:"destructive"});return}try{const s=await c("/api/v1/auth-settings/users",{method:"POST",body:JSON.stringify({email:b,name:A,role:T})});if(s.success)await h(),C(!1),P(""),R(""),L("viewer"),r({title:"Success",description:"User added to whitelist"});else throw new Error(s.error||"Failed to add user")}catch(s){r({title:"Error",description:s.message||"Failed to add user",variant:"destructive"})}},ie=async s=>{try{const t=await c(`/api/v1/auth-settings/users/${s}`,{method:"DELETE"});if(t.success)await h(),r({title:"Success",description:"User removed from whitelist"});else throw new Error(t.error||"Failed to remove user")}catch(t){r({title:"Error",description:t.message||"Failed to remove user",variant:"destructive"})}},re=async(s,t)=>{try{const g=await c(`/api/v1/auth-settings/users/${s}`,{method:"PUT",body:JSON.stringify({role:t})});if(g.success)await h(),r({title:"Success",description:"User role updated"});else throw new Error(g.error||"Failed to update role")}catch(g){r({title:"Error",description:g.message||"Failed to update role",variant:"destructive"})}},ae=async()=>{if(!(!E||!x)){if(x.length<8){r({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}try{const s=await c(`/api/v1/auth-settings/users/${E}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:x})});if(s.success)u(null),m(""),r({title:"Success",description:"Password reset successfully"});else throw new Error(s.error||"Failed to reset password")}catch(s){r({title:"Error",description:s.message||"Failed to reset password",variant:"destructive"})}}},ne=async()=>{if(i)try{D(!0);const s=await c("/api/v1/auth-settings",{method:"PUT",body:JSON.stringify({session:i.session})});if(s.success)r({title:"Success",description:"Session settings updated"});else throw new Error(s.error||"Failed to update settings")}catch(s){r({title:"Error",description:s.message||"Failed to update settings",variant:"destructive"})}finally{D(!1)}};return G?e.jsx("div",{children:"Loading..."}):i?Z?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication settings and user access."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{className:"h-5 w-5"}),e.jsx(w,{children:"Authentication Status"})]}),e.jsx(f,{children:"Control whether authentication is required to access Coconut."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"auth-enabled",children:"Require Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"When enabled, users must log in to access Coconut"})]}),e.jsx(U,{id:"auth-enabled",checked:i.enabled,onCheckedChange:ee})]}),i.enabled&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"allow-registration",children:"Allow Self-Registration"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Whitelisted users can create their own accounts"})]}),e.jsx(U,{id:"allow-registration",checked:i.allowRegistration,onCheckedChange:se})]})]})]}),e.jsxs(p,{children:[e.jsx(v,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(w,{children:"Whitelisted Users"}),e.jsx(f,{children:"Manage users who can access this Coconut instance."})]}),e.jsxs(I,{open:X,onOpenChange:C,children:[e.jsx(M,{asChild:!0,children:e.jsxs(l,{size:"sm",children:[e.jsx(Se,{className:"h-4 w-4 mr-2"}),"Add User"]})}),e.jsxs(V,{children:[e.jsxs($,{children:[e.jsx(H,{children:"Add User to Whitelist"}),e.jsx(J,{children:"Add a user's email to allow them to register and access Coconut."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-email",children:"Email"}),e.jsx(j,{id:"new-email",type:"email",value:b,onChange:s=>P(s.target.value),placeholder:"user@example.com"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-name",children:"Name"}),e.jsx(j,{id:"new-name",value:A,onChange:s=>R(s.target.value),placeholder:"User Name"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"new-role",children:"Role"}),e.jsxs(_,{value:T,onValueChange:s=>L(s),children:[e.jsx(W,{children:e.jsx(q,{})}),e.jsxs(B,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]})]})]}),e.jsxs(z,{children:[e.jsx(l,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),e.jsx(l,{onClick:te,children:"Add User"})]})]})]})]})}),e.jsx(y,{children:e.jsx("div",{className:"space-y-4",children:i.providers.local.users.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[e.jsxs("div",{className:"space-y-1 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium",children:s.name}),s.registered?e.jsx(k,{variant:"default",className:"text-xs",children:"Registered"}):e.jsx(k,{variant:"secondary",className:"text-xs",children:"Pending"}),s.id===N?.id&&e.jsx(k,{variant:"outline",className:"text-xs",children:"You"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email}),s.lastLoginAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last login: ",new Date(s.lastLoginAt).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(_,{value:s.role,onValueChange:t=>re(s.id,t),children:[e.jsx(W,{className:"w-40",children:e.jsx(q,{})}),e.jsxs(B,{children:[e.jsx(a,{value:"viewer",children:"Viewer"}),e.jsx(a,{value:"engineer",children:"Engineer"}),e.jsx(a,{value:"designer",children:"Designer"}),e.jsx(a,{value:"product_manager",children:"Product Manager"}),e.jsx(a,{value:"manager",children:"Manager"}),e.jsx(a,{value:"admin",children:"Admin"})]})]}),e.jsxs(I,{open:E===s.id,onOpenChange:t=>{t||(u(null),m(""))},children:[e.jsx(M,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s.id),children:e.jsx(ye,{className:"h-4 w-4"})})}),e.jsxs(V,{children:[e.jsxs($,{children:[e.jsx(H,{children:"Reset Password"}),e.jsxs(J,{children:["Set a new password for ",s.name]})]}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{children:[e.jsx(o,{htmlFor:"reset-password",children:"New Password"}),e.jsx(j,{id:"reset-password",type:"password",value:x,onChange:t=>m(t.target.value),placeholder:"At least 8 characters",minLength:8})]})}),e.jsxs(z,{children:[e.jsx(l,{variant:"outline",onClick:()=>{u(null),m("")},children:"Cancel"}),e.jsx(l,{onClick:ae,children:"Reset Password"})]})]})]}),s.id!==N?.id&&e.jsxs(oe,{children:[e.jsx(de,{asChild:!0,children:e.jsx(l,{size:"sm",variant:"destructive",children:e.jsx(he,{className:"h-4 w-4"})})}),e.jsxs(ue,{children:[e.jsxs(xe,{children:[e.jsx(me,{children:"Remove User"}),e.jsxs(ge,{children:["Are you sure you want to remove ",s.name," from the whitelist? They will no longer be able to access Coconut."]})]}),e.jsxs(je,{children:[e.jsx(pe,{children:"Cancel"}),e.jsx(ve,{onClick:()=>ie(s.id),children:"Remove"})]})]})]})]})]},s.id))})})]}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsx(w,{children:"Session Settings"}),e.jsx(f,{children:"Configure session behavior and security."})]}),e.jsxs(y,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"session-expiry",children:"Session Expiry"}),e.jsx(j,{id:"session-expiry",value:i.session.expiresIn,onChange:s=>d({...i,session:{...i.session,expiresIn:s.target.value}}),placeholder:"7d"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Format: 30s, 15m, 24h, 7d"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"secure-cookies",children:"Secure Cookies (HTTPS only)"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable in production with HTTPS"})]}),e.jsx(U,{id:"secure-cookies",checked:i.session.secure||!1,onCheckedChange:s=>d({...i,session:{...i.session,secure:s}})})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2",children:[e.jsx(l,{variant:"outline",onClick:h,disabled:S,children:"Cancel"}),e.jsx(l,{onClick:ne,disabled:S,children:S?"Saving...":"Save Session Settings"})]})]}):e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have permission to manage authentication settings."})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Authentication"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Secure your Coconut instance with authentication."})]}),e.jsx(O,{}),e.jsxs(p,{children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-muted-foreground"}),e.jsx(w,{children:"Authentication Not Configured"})]}),e.jsx(f,{children:"Authentication has not been initialized. Use the CLI to set up authentication."})]}),e.jsxs(y,{children:[e.jsx("div",{className:"bg-muted p-4 rounded-md",children:e.jsxs("code",{className:"text-sm",children:["$ nut auth init",e.jsx("br",{}),"$ nut auth toggle"]})}),e.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"This will create an admin user and enable authentication for your Coconut instance."})]})]})]})}export{Re as default};
@@ -1 +1 @@
1
- import{r as m,j as e,t as x,A as f}from"./index-CIFIEidO.js";import{C as w}from"./circle-check-fwIZxHsK.js";import{C as b}from"./circle-x-CKuM1691.js";const r="coconut/github-auth-state";function j(s){try{window.opener&&window.opener.postMessage({type:"github-auth",...s},window.location.origin)}catch{}}const v=()=>{const[s,d]=m.useState("pending"),[h,p]=m.useState("Authorizing GitHub…");return m.useEffect(()=>{const a=new URLSearchParams(window.location.search),u=a.get("error"),l=a.get("token"),n=a.get("expires_at")||a.get("expiresAt"),c=a.get("state"),o=t=>{j(t),d(t.success?"success":"error"),p(t.message),setTimeout(()=>{try{window.close()}catch{}},1200)};if(u){localStorage.removeItem(r),o({success:!1,message:decodeURIComponent(u)});return}if(!l||!n||!c){localStorage.removeItem(r),o({success:!1,message:"Missing authorization parameters. Please try again."});return}const g=localStorage.getItem(r);if(!g||g!==c){localStorage.removeItem(r),o({success:!1,message:"Authorization state mismatch. Please start again."});return}(async()=>{try{const t=await fetch(`${f}/api/v1/git/providers/github/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l,expiresAt:n,state:c})}),i=await t.json();if(!t.ok||!i.success)throw new Error(i?.error?.message||"Failed to store GitHub token");localStorage.removeItem(r),o({success:!0,message:"GitHub connected successfully!",expiresAt:i.data?.expiresAt||n})}catch(t){localStorage.removeItem(r),o({success:!1,message:t?.message||"Failed to store GitHub token. Please try again."})}})()},[]),e.jsx("div",{className:"flex h-screen items-center justify-center bg-background px-6",children:e.jsxs("div",{className:"max-w-sm rounded-lg border bg-card p-6 text-center shadow-sm",children:[e.jsxs("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:[s==="pending"&&e.jsx(x,{className:"h-6 w-6 animate-spin text-muted-foreground"}),s==="success"&&e.jsx(w,{className:"h-6 w-6 text-green-600"}),s==="error"&&e.jsx(b,{className:"h-6 w-6 text-red-600"})]}),e.jsx("h1",{className:"text-lg font-semibold",children:"GitHub Authorization"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:h}),s!=="pending"&&e.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"You can close this window and return to Coconut."})]})})};export{v as default};
1
+ import{r as m,j as e,t as x,A as f}from"./index-Dnh3d5dh.js";import{C as w}from"./circle-check-ByTq4NJ8.js";import{C as b}from"./circle-x-DmE_F1rc.js";const r="coconut/github-auth-state";function j(s){try{window.opener&&window.opener.postMessage({type:"github-auth",...s},window.location.origin)}catch{}}const v=()=>{const[s,d]=m.useState("pending"),[h,p]=m.useState("Authorizing GitHub…");return m.useEffect(()=>{const a=new URLSearchParams(window.location.search),u=a.get("error"),l=a.get("token"),n=a.get("expires_at")||a.get("expiresAt"),c=a.get("state"),o=t=>{j(t),d(t.success?"success":"error"),p(t.message),setTimeout(()=>{try{window.close()}catch{}},1200)};if(u){localStorage.removeItem(r),o({success:!1,message:decodeURIComponent(u)});return}if(!l||!n||!c){localStorage.removeItem(r),o({success:!1,message:"Missing authorization parameters. Please try again."});return}const g=localStorage.getItem(r);if(!g||g!==c){localStorage.removeItem(r),o({success:!1,message:"Authorization state mismatch. Please start again."});return}(async()=>{try{const t=await fetch(`${f}/api/v1/git/providers/github/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l,expiresAt:n,state:c})}),i=await t.json();if(!t.ok||!i.success)throw new Error(i?.error?.message||"Failed to store GitHub token");localStorage.removeItem(r),o({success:!0,message:"GitHub connected successfully!",expiresAt:i.data?.expiresAt||n})}catch(t){localStorage.removeItem(r),o({success:!1,message:t?.message||"Failed to store GitHub token. Please try again."})}})()},[]),e.jsx("div",{className:"flex h-screen items-center justify-center bg-background px-6",children:e.jsxs("div",{className:"max-w-sm rounded-lg border bg-card p-6 text-center shadow-sm",children:[e.jsxs("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted",children:[s==="pending"&&e.jsx(x,{className:"h-6 w-6 animate-spin text-muted-foreground"}),s==="success"&&e.jsx(w,{className:"h-6 w-6 text-green-600"}),s==="error"&&e.jsx(b,{className:"h-6 w-6 text-red-600"})]}),e.jsx("h1",{className:"text-lg font-semibold",children:"GitHub Authorization"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:h}),s!=="pending"&&e.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"You can close this window and return to Coconut."})]})})};export{v as default};
@@ -0,0 +1,2 @@
1
+ import{u as ce,a as de,r as i,j as e,B as r,T as oe,n as M,X as me,F as xe,Y as he,D as ue,b as fe,d as pe,f as je,k as ge,a2 as B,a3 as R,a4 as H,a5 as L,a6 as O,aa as G,a9 as ve,o as Ne,A as T}from"./index-Dnh3d5dh.js";import{C as g,b as ye,a as _,c as we}from"./card-CxtDjDKY.js";import{B as U}from"./badge-D2aQlcxQ.js";import{u as Se}from"./use-terminal-D6UJQuYa.js";import{T as Ce}from"./terminal-preview-BF6OYmEL.js";import{S as be,a as ke,b as Ae,c as De,d as w}from"./select-DGSoJZ_9.js";import{b as Me,e as Te,d as Ie,c as $e,a as Ee}from"./pipeline-builders-Bkf0wt_O.js";import{R as Pe}from"./refresh-cw-DY5O1wul.js";import{C as ze,a as Fe}from"./chevrons-up-BB0xPeZH.js";import{P as Be}from"./play-B1b-UHj0.js";import{C as Re}from"./code-DOk08pmu.js";import{C as He}from"./chevron-up-CjDDMMJu.js";import"./xterm-DTxiCjtJ.js";import"./index-SImVYpAE.js";const Le=c=>c?Array.isArray(c)?c.filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean):typeof c=="string"?c.split(",").map(x=>x.trim()).filter(Boolean):[]:[];function ss(){const c=ce(),{sessions:x,loading:b,error:I,refreshSessions:S,createSession:V,destroySession:K}=Se(),{toast:v}=de(),[$,W]=i.useState([]),[q,X]=i.useState(!0),[j,k]=i.useState(()=>({})),[A,N]=i.useState(!1),[f,Y]=i.useState("claude"),[E,J]=i.useState(""),[D,P]=i.useState(!1),[h,Q]=i.useState([]),[p,y]=i.useState([]),[Z,ee]=i.useState({}),[u,se]=i.useState([]),[o,C]=i.useState([]),te=s=>{const t=Date.now(),a=new Date(s).getTime(),n=Math.max(0,Math.floor((t-a)/1e3));if(n<60)return`${n}s ago`;const d=Math.floor(n/60);if(d<60)return`${d}m ago`;const l=Math.floor(d/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`};i.useEffect(()=>{(async()=>{try{const t=await fetch(`${T}/api/v1/tasks`);if(t.ok){const a=await t.json(),n=a.data||a;W(Array.isArray(n)?n:[])}}catch(t){console.error("Error loading tasks:",t)}finally{X(!1)}})()},[]),i.useEffect(()=>{S()},[S]),i.useEffect(()=>{if(!A)return;(async()=>{try{const t=await fetch(`${T}/api/v1/mcp`);if(t.ok){const a=await t.json();a?.success&&Array.isArray(a.servers)&&(Q(a.servers),y(n=>n.filter(d=>a.servers.includes(d))),a.mcpServers&&typeof a.mcpServers=="object"&&ee(a.mcpServers))}}catch(t){console.error("Failed to load MCP servers",t)}try{const t=await fetch(`${T}/api/v1/skills`);if(t.ok){const a=await t.json(),d=(Array.isArray(a?.documents)?a.documents:[]).map(l=>({id:l.id,name:l?.metadata?.name||l.id,mcpServers:Le(l?.metadata?.metadata?.mcpServers)}));se(d),C(l=>l.filter(F=>d.some(le=>le.id===F)))}}catch(t){console.error("Failed to load skills",t)}})()},[A]),i.useEffect(()=>{o.length!==0&&y(s=>{const t=new Set(s),a=h.length>0?new Set(h):void 0;return o.forEach(n=>{const d=u.find(l=>l.id===n);d&&d.mcpServers.forEach(l=>{(!a||a.has(l))&&t.add(l)})}),Array.from(t)})},[o,u,h]);const m=i.useMemo(()=>x.filter(s=>s.taskId?.startsWith("cp-")||s.taskId?.startsWith("ag-")).sort((s,t)=>new Date(t.lastActivity).getTime()-new Date(s.lastActivity).getTime()),[x]);i.useEffect(()=>{k(s=>{const t={...s};return m.forEach(a=>{a.id in t||(t[a.id]=!0)}),t})},[m]);const z=i.useMemo(()=>$.filter(s=>s.status==="draft"||s.status==="ready").sort((s,t)=>new Date(t.metadata.createdAt).getTime()-new Date(s.metadata.createdAt).getTime()).slice(0,3),[$]),ae=()=>{const s=m.every(a=>j[a.id]),t={};m.forEach(a=>{t[a.id]=!s}),k(t)},ie=m.length>0&&m.every(s=>j[s.id]),ne=async s=>{await K(s)?(v({title:"Session closed",description:s}),setTimeout(()=>S(),100)):v({title:"Failed to close session",description:s,variant:"destructive"})},re=async()=>{P(!0);try{const s=`session-${Date.now()}`,t={taskId:s,contextType:"change-task",cliAgent:f,mcpServersMap:Z,selectedMcpServers:p,skills:u,selectedSkillIds:o,automationEnabled:!1,customInstruction:E.trim(),includeDefaultInstructions:!1};let a="";f==="claude"?a=Me(t):f==="gemini"?a=Te(t):f==="codex"?a=Ie(t):f==="droid"?a=$e(t):f==="kiro"&&(a=Ee(t)),await V(s,a)?(v({title:"Coding session started",description:`Session ${s} created`}),N(!1),c(`/terminal/${s}`)):v({title:"Failed to start session",description:"Could not create terminal session",variant:"destructive"})}catch(s){console.error("Error starting coding session:",s),v({title:"Error",description:"Failed to start coding session",variant:"destructive"})}finally{P(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Agents"}),e.jsx("p",{className:"text-muted-foreground hidden sm:block",children:"Manage agents and their active sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{variant:"outline",size:"sm",onClick:()=>S(),disabled:b,children:[e.jsx(Pe,{className:`h-4 w-4 sm:mr-2 ${b?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),m.length>0&&e.jsx(r,{variant:"outline",size:"sm",onClick:ae,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(ze,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Hide All"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Show All"})]})}),e.jsxs(r,{size:"sm",onClick:()=>N(!0),children:[e.jsx(Be,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Interactive Session"})]})]})]}),I&&e.jsx("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("div",{className:"text-red-600",children:I})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Sessions"}),b?e.jsx("div",{className:"space-y-2",children:[...Array(2)].map((s,t)=>e.jsx(g,{className:"p-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-4 w-4 rounded bg-muted animate-pulse"}),e.jsxs("div",{children:[e.jsx("div",{className:"h-4 w-40 bg-muted rounded animate-pulse mb-2"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]})]}),e.jsx("div",{className:"h-6 w-20 bg-muted rounded animate-pulse"})]})},t))}):m.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx(Re,{className:"h-12 w-12 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No active sessions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Get started by launching an"," ",e.jsx("button",{onClick:()=>N(!0),className:"text-primary hover:underline font-medium",children:"Interactive Session"})," ","or working on a"," ",e.jsx("button",{onClick:()=>c("/tasks"),className:"text-primary hover:underline font-medium",children:"New Task"})]})]})]})}):e.jsx("div",{className:"space-y-2",children:m.slice(0,10).map(s=>e.jsxs(g,{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(oe,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",children:s.taskId}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Session ",s.id.split("-").slice(-1)[0].substring(0,8)," • Last activity ",te(s.lastActivity)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("div",{className:`flex items-center gap-1 ${s.connected?"text-green-600":"text-gray-400"}`,title:s.connected?"Connected":"Disconnected",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${s.connected?"bg-green-500":"bg-gray-400"}`})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>{k(t=>({...t,[s.id]:!t[s.id]}))},"aria-label":j[s.id]?"Hide preview":"Show preview",title:j[s.id]?"Hide preview":"Show preview",children:j[s.id]?e.jsx(He,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})}),e.jsx(r,{size:"sm",variant:"outline",onClick:()=>c(`/terminal/${s.taskId}`),children:"Open"}),e.jsx(r,{size:"icon",variant:"destructive",onClick:()=>ne(s.id),title:"Close session","aria-label":"Close session",children:e.jsx(me,{className:"h-4 w-4"})})]})]}),j[s.id]&&e.jsx("div",{className:"mt-2 w-full p-2 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>c(`/terminal/${s.taskId}`),title:"Click to open full terminal session",children:e.jsx(Ce,{sessionId:s.id,heightPx:160,maxScrollback:200})})]},s.id))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"New Tasks"}),q?e.jsx("div",{className:"space-y-3",children:[...Array(3)].map((s,t)=>e.jsx(g,{children:e.jsx(ye,{className:"py-3",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-2/3 animate-pulse"}),e.jsx("div",{className:"h-3 bg-muted rounded w-1/3 animate-pulse"})]}),e.jsx("div",{className:"h-5 bg-muted rounded w-16 animate-pulse"})]})})},t))}):z.length===0?e.jsx(g,{children:e.jsx(_,{className:"flex items-center justify-center py-6",children:e.jsx("div",{className:"text-center text-sm text-gray-500",children:"No draft or approved tasks found"})})}):e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsx(g,{className:"hover:shadow-md transition-all cursor-pointer hover:border-primary/50",onClick:()=>c(`/terminal/${s.id}`),children:e.jsx(_,{className:"py-4",children:e.jsx("div",{className:"flex justify-between items-start gap-4",children:e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(we,{className:"text-base leading-tight",children:s.title||s.intent}),e.jsxs("div",{className:"flex gap-1 ml-3 flex-shrink-0",children:[s.priority&&e.jsx(U,{variant:s.priority==="high"||s.priority==="critical"?"destructive":s.priority==="medium"?"secondary":"outline",className:"text-xs",children:s.priority}),e.jsx(U,{variant:"default",className:"text-xs",children:s.status})]})]}),s.content&&e.jsxs("div",{className:"text-sm text-muted-foreground leading-relaxed",children:[s.content.split(`
2
+ `).slice(0,2).join(" ").substring(0,150),s.content.length>150?"...":""]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.id," • by ",s.author.name," • ",new Date(s.metadata.createdAt).toLocaleDateString()]}),e.jsxs("div",{className:"flex gap-2",onClick:t=>t.stopPropagation(),children:[e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/tasks/${s.id}`),className:"h-7 px-2 text-xs",children:[e.jsx(xe,{className:"h-3 w-3 mr-1"})," View"]}),e.jsxs(r,{variant:"ghost",size:"sm",onClick:()=>c(`/tasks/${s.id}/edit`),className:"h-7 px-2 text-xs",children:[e.jsx(he,{className:"h-3 w-3 mr-1"})," Edit"]})]})]})]})})})},s.id))})]}),e.jsx(ue,{open:A,onOpenChange:N,children:e.jsxs(fe,{className:"max-w-lg",children:[e.jsxs(pe,{children:[e.jsx(je,{children:"Start Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Start an interactive session"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Agent"}),e.jsxs(be,{value:f,onValueChange:s=>Y(s),children:[e.jsx(ke,{className:"w-full",children:e.jsx(Ae,{placeholder:"Select coding agent"})}),e.jsxs(De,{children:[e.jsx(w,{value:"claude",children:"Claude Code"}),e.jsx(w,{value:"gemini",children:"Google Gemini"}),e.jsx(w,{value:"codex",children:"OpenAI Codex"}),e.jsx(w,{value:"droid",children:"Factory Droid"}),e.jsx(w,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ge,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[o.length," of ",u.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[o.length===0?"Select skills...":o.length===u.length?"All skills selected":`${o.length} skill${o.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C(u.map(t=>t.id))},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),C([])},children:"None"})]})]}),e.jsx(O,{}),u.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No skills found"}):u.map(s=>e.jsx(G,{checked:o.includes(s.id),onCheckedChange:t=>{C(a=>t?a.includes(s.id)?a:[...a,s.id]:a.filter(n=>n!==s.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:s.name}),s.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",s.mcpServers.join(", ")]}),s.mcpServers.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},s.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ve,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[p.length," of ",h.length," selected"]})]}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsxs(r,{variant:"outline",className:"w-full justify-between",children:[p.length===0?"Select MCP servers...":p.length===h.length?"All servers selected":`${p.length} server${p.length!==1?"s":""} selected`,e.jsx(M,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(H,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(L,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),y(h)},children:"All"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:s=>{s.preventDefault(),y([])},children:"None"})]})]}),e.jsx(O,{}),h.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):h.map(s=>e.jsx(G,{checked:p.includes(s),onCheckedChange:t=>{y(a=>t?a.includes(s)?a:[...a,s]:a.filter(n=>n!==s))},children:s},s))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Additional Instructions (optional)"}),e.jsx(Ne,{value:E,onChange:s=>J(s.target.value),placeholder:"Add any custom instructions for the coding agent...",rows:4,className:"resize-none"})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(r,{variant:"outline",onClick:()=>N(!1),disabled:D,children:"Cancel"}),e.jsx(r,{onClick:re,disabled:D,children:D?"Starting...":"Start Session"})]})]})]})})]})}export{ss as default};
@@ -1 +1 @@
1
- import{r as x,j as e,e as a,n as m}from"./index-CIFIEidO.js";function u({title:n,description:t,icon:r,defaultOpen:o=!1,children:i,className:l}){const[s,d]=x.useState(o);return e.jsxs("div",{className:a("rounded-lg border bg-card text-card-foreground",l),children:[e.jsxs("button",{type:"button",onClick:()=>d(c=>!c),className:"flex w-full items-center justify-between gap-4 px-4 py-3 text-left","aria-expanded":s,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:n}),t&&e.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:t})]})]}),e.jsx(m,{className:a("h-4 w-4 shrink-0 transition-transform duration-200",s?"rotate-180":"rotate-0")})]}),s&&e.jsx("div",{className:"border-t px-4 py-4",children:i})]})}export{u as C};
1
+ import{r as x,j as e,e as a,n as m}from"./index-Dnh3d5dh.js";function u({title:n,description:t,icon:r,defaultOpen:o=!1,children:i,className:l}){const[s,d]=x.useState(o);return e.jsxs("div",{className:a("rounded-lg border bg-card text-card-foreground",l),children:[e.jsxs("button",{type:"button",onClick:()=>d(c=>!c),className:"flex w-full items-center justify-between gap-4 px-4 py-3 text-left","aria-expanded":s,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r,e.jsxs("div",{children:[e.jsx("p",{className:"font-medium leading-tight",children:n}),t&&e.jsx("p",{className:"text-sm text-muted-foreground leading-snug",children:t})]})]}),e.jsx(m,{className:a("h-4 w-4 shrink-0 transition-transform duration-200",s?"rotate-180":"rotate-0")})]}),s&&e.jsx("div",{className:"border-t px-4 py-4",children:i})]})}export{u as C};