@lovelybunch/api 1.0.76-alpha.0 → 1.0.76-alpha.2

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 (389) hide show
  1. package/dist/lib/mcp-client.d.ts +39 -0
  2. package/dist/lib/mcp-client.js +131 -0
  3. package/dist/routes/api/v1/ai/tools.js +49 -232
  4. package/dist/routes/api/v1/proposals/[id]/route.d.ts +10 -24
  5. package/dist/routes/api/v1/proposals/[id]/route.js +10 -1
  6. package/dist/routes/api/v1/proposals/route.d.ts +2 -16
  7. package/dist/routes/api/v1/proposals/route.js +11 -8
  8. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js +2 -2
  9. package/dist/routes/api/v1/terminal/code/index.d.ts +3 -0
  10. package/dist/routes/api/v1/terminal/code/index.js +5 -0
  11. package/dist/routes/api/v1/terminal/code/route.d.ts +13 -0
  12. package/dist/routes/api/v1/terminal/code/route.js +155 -0
  13. package/dist/server-with-static.js +2 -0
  14. package/dist/server.js +2 -0
  15. package/package.json +4 -4
  16. package/static/assets/{ActivityPage-DxajSxG1.js → ActivityPage-BIYCh5I6.js} +1 -1
  17. package/static/assets/{ApiKeysSettingsPage-DiBqSUMz.js → ApiKeysSettingsPage-uPmxt5fp.js} +1 -1
  18. package/static/assets/{ArchitectureEditPage-iflIJaCh.js → ArchitectureEditPage-DlNQfJe3.js} +2 -2
  19. package/static/assets/{ArchitecturePage-oB3FtdZ7.js → ArchitecturePage-z4FsbdfN.js} +1 -1
  20. package/static/assets/{AuthSettingsPage-BY7x-6wd.js → AuthSettingsPage-Ct9brG0C.js} +2 -2
  21. package/static/assets/{CallbackPage-CYcV3OHa.js → CallbackPage-DrMJVPyS.js} +1 -1
  22. package/static/assets/CodePage-CFl4HO-3.js +2 -0
  23. package/static/assets/{CollapsibleSection-BLZv27JC.js → CollapsibleSection-D_16mIbS.js} +1 -1
  24. package/static/assets/{DashboardPage-BdsK2Vor.js → DashboardPage---KVQx1B.js} +2 -2
  25. package/static/assets/{GitPage-CKIIMGjF.js → GitPage-CNYHAHAE.js} +3 -3
  26. package/static/assets/{GitSettingsPage-sI4uzGzt.js → GitSettingsPage-CQbe217E.js} +2 -2
  27. package/static/assets/{IdentityPage-vzzaKU2-.js → IdentityPage-BNrnoMAb.js} +2 -2
  28. package/static/assets/{ImplementationStepsEditor-BMHTxNEX.js → ImplementationStepsEditor-CpIE-yvb.js} +1 -1
  29. package/static/assets/IntegrationsSettingsPage-Bvrthw6u.js +1 -0
  30. package/static/assets/{JobDetailPage-C-IKmhAF.js → JobDetailPage-C1uyETkW.js} +1 -1
  31. package/static/assets/{KnowledgeDetailPage-C1RHtPzz.js → KnowledgeDetailPage-D4ZUM3Zz.js} +1 -1
  32. package/static/assets/KnowledgeEditPage-CkO6HZ1m.js +1 -0
  33. package/static/assets/{KnowledgePage-DJphs1Kg.js → KnowledgePage-DTgCuE5t.js} +1 -1
  34. package/static/assets/{LoginPage-DVaToPHL.js → LoginPage-kNNO_ouW.js} +1 -1
  35. package/static/assets/{MailInboxPage-I-MbS647.js → MailInboxPage-DFA4mCj0.js} +1 -1
  36. package/static/assets/{MailProcessingModal-DXtDHWM_.js → MailProcessingModal-Caii7A8L.js} +2 -2
  37. package/static/assets/{MailReadPage-DUN8EQjl.js → MailReadPage-DnxomkpM.js} +1 -1
  38. package/static/assets/{MailSentPage-DsGgBGBQ.js → MailSentPage-BHkc5X_Y.js} +1 -1
  39. package/static/assets/{McpSettingsPage-d66ZIwm7.js → McpSettingsPage-DFwFqNpn.js} +1 -1
  40. package/static/assets/NewKnowledgePage-Dst7m_BB.js +9 -0
  41. package/static/assets/{NewSkillPage-DesCsYgS.js → NewSkillPage-E2godqql.js} +1 -1
  42. package/static/assets/{NewTaskPage-CrmiPuuw.js → NewTaskPage--x_FMYzw.js} +2 -2
  43. package/static/assets/{NotFoundPage-BcTtqwNP.js → NotFoundPage-CWYaoUzq.js} +1 -1
  44. package/static/assets/NotificationsSettingsPage-BgGoQm7i.js +1 -0
  45. package/static/assets/ProjectEditPage-BlQkGGW3.js +11 -0
  46. package/static/assets/{ProjectPage-CKaHBZlw.js → ProjectPage-cnzG8ymb.js} +1 -1
  47. package/static/assets/PromptsSettingsPage-DEMozxxj.js +1 -0
  48. package/static/assets/{ResourceDetailPage-BSeDQxri.js → ResourceDetailPage-D-amMTWE.js} +1 -1
  49. package/static/assets/{ResourcesPage-YmerqN0J.js → ResourcesPage-BaxxCRUq.js} +2 -2
  50. package/static/assets/RoleEditPage-Bn5nL0Hm.js +13 -0
  51. package/static/assets/{RolePage-DoN5_uka.js → RolePage-BOBxbE4o.js} +1 -1
  52. package/static/assets/{RulesSettingsPage-yQELBKgb.js → RulesSettingsPage-BX4-A4bn.js} +1 -1
  53. package/static/assets/SchedulePage-BNmUnXVu.js +4 -0
  54. package/static/assets/{SkillDetailPage-BFjBVPS8.js → SkillDetailPage-Dyvc1AIM.js} +1 -1
  55. package/static/assets/{SkillEditPage-CjpscD5K.js → SkillEditPage-BBr2jC5s.js} +1 -1
  56. package/static/assets/{SkillsPage-Dr_uyKVB.js → SkillsPage-C8moT36F.js} +1 -1
  57. package/static/assets/{SkillsSettingsPage-BknrbJBC.js → SkillsSettingsPage-D1begXXp.js} +1 -1
  58. package/static/assets/{SourceInput-LclyzQLW.js → SourceInput-D_5iVkI5.js} +1 -1
  59. package/static/assets/{TagInput-BZ6JyIo1.js → TagInput-C1r8NbaU.js} +1 -1
  60. package/static/assets/{TaskDetailPage-D97oWW98.js → TaskDetailPage-DY-hfPO_.js} +2 -2
  61. package/static/assets/TaskEditPage-BQNQc-sZ.js +1 -0
  62. package/static/assets/{TasksPage-COvedmQz.js → TasksPage-ssM1z2ta.js} +3 -3
  63. package/static/assets/{TerminalPage-DhbOmISZ.js → TerminalPage-Cny60rpN.js} +1 -1
  64. package/static/assets/{TerminalSessionPage-D2rZb8Ej.js → TerminalSessionPage-Cy2h1IvH.js} +2 -2
  65. package/static/assets/UserPreferencesPage-DLLHv7Sv.js +1 -0
  66. package/static/assets/{UserSettingsPage-AXLWqe0G.js → UserSettingsPage-wrlm0m4w.js} +1 -1
  67. package/static/assets/{UtilitiesPage-CxQkYrza.js → UtilitiesPage-DDdi2gjr.js} +1 -1
  68. package/static/assets/{alert-BUrHsk9_.js → alert-ClYcOZrl.js} +1 -1
  69. package/static/assets/apl-B4CMkyY2.js +1 -0
  70. package/static/assets/{arrow-down-J9YP8VW9.js → arrow-down-C21GpXY8.js} +1 -1
  71. package/static/assets/{arrow-left-RAzvFXpe.js → arrow-left-Bo3ORcvL.js} +1 -1
  72. package/static/assets/{arrow-up-CjXXRPYC.js → arrow-up-BvV2LsrY.js} +1 -1
  73. package/static/assets/{arrow-up-down-BRoDh-fK.js → arrow-up-down-vbTTNMQ9.js} +1 -1
  74. package/static/assets/asciiarmor-Df11BRmG.js +1 -0
  75. package/static/assets/asn1-EdZsLKOL.js +1 -0
  76. package/static/assets/asterisk-B-8jnY81.js +1 -0
  77. package/static/assets/{badge-CA-A_JCd.js → badge-BIzmYH_4.js} +1 -1
  78. package/static/assets/brainfuck-C4LP7Hcl.js +1 -0
  79. package/static/assets/{browser-modal-DVtwh2h7.js → browser-modal-CkjrwJ8N.js} +1 -1
  80. package/static/assets/{card-DdrUHBUG.js → card-Bg-wA9s_.js} +1 -1
  81. package/static/assets/{chevron-left-C4bGr2Al.js → chevron-left-DO-Zz6cq.js} +1 -1
  82. package/static/assets/{chevron-up-CPpQ_jgb.js → chevron-up-C115Uf6r.js} +1 -1
  83. package/static/assets/{chevrons-up-C8oR0iOR.js → chevrons-up-bgADpoQ9.js} +1 -1
  84. package/static/assets/{circle-alert-B3zeVGHG.js → circle-alert-D8dEhUnq.js} +1 -1
  85. package/static/assets/{circle-check-OfRBf8tJ.js → circle-check-CS2LuTcV.js} +1 -1
  86. package/static/assets/{circle-check-big-CeVxJ4hA.js → circle-check-big-Bm4c-_XI.js} +1 -1
  87. package/static/assets/{circle-play-C_Chmziu.js → circle-play-N-BXePlE.js} +1 -1
  88. package/static/assets/{circle-x-CtfEmATn.js → circle-x-DWHqcJFb.js} +1 -1
  89. package/static/assets/clike-B9uivgTg.js +1 -0
  90. package/static/assets/{clipboard-Z_0Z5-r1.js → clipboard-BBdw7Fw8.js} +1 -1
  91. package/static/assets/{clock-B43LjbrK.js → clock-Cg9nPTux.js} +1 -1
  92. package/static/assets/clojure-BMjYHr_A.js +1 -0
  93. package/static/assets/cmake-BQqOBYOt.js +1 -0
  94. package/static/assets/cobol-CWcv1MsR.js +1 -0
  95. package/static/assets/{code-D77i0toJ.js → code-D21v96Wj.js} +1 -1
  96. package/static/assets/coffeescript-S37ZYGWr.js +1 -0
  97. package/static/assets/commonlisp-DBKNyK5s.js +1 -0
  98. package/static/assets/crystal-SjHAIU92.js +1 -0
  99. package/static/assets/css-BnMrqG3P.js +1 -0
  100. package/static/assets/cypher-C_CwsFkJ.js +1 -0
  101. package/static/assets/d-pRatUO7H.js +1 -0
  102. package/static/assets/diff-DbItnlRl.js +1 -0
  103. package/static/assets/dockerfile-BKs6k2Af.js +1 -0
  104. package/static/assets/{download-C8rLaNF6.js → download-ULpe9uEL.js} +1 -1
  105. package/static/assets/dtd-DF_7sFjM.js +1 -0
  106. package/static/assets/dylan-DwRh75JA.js +1 -0
  107. package/static/assets/ebnf-CDyGwa7X.js +1 -0
  108. package/static/assets/ecl-Cabwm37j.js +1 -0
  109. package/static/assets/eiffel-CnydiIhH.js +1 -0
  110. package/static/assets/elm-vLlmbW-K.js +1 -0
  111. package/static/assets/erlang-BNw1qcRV.js +1 -0
  112. package/static/assets/{external-link-D6UvIQYD.js → external-link--nEePPjR.js} +1 -1
  113. package/static/assets/{eye-C3fWwYx-.js → eye-nqxk2SXP.js} +1 -1
  114. package/static/assets/factor-kuTfRLto.js +1 -0
  115. package/static/assets/fcl-Kvtd6kyn.js +1 -0
  116. package/static/assets/{folder-git-2-Crtn4eyJ.js → folder-git-2-D1jARXTb.js} +1 -1
  117. package/static/assets/forth-Ffai-XNe.js +1 -0
  118. package/static/assets/fortran-DYz_wnZ1.js +1 -0
  119. package/static/assets/gas-Bneqetm1.js +1 -0
  120. package/static/assets/gherkin-heZmZLOM.js +1 -0
  121. package/static/assets/groovy-D9Dt4D0W.js +1 -0
  122. package/static/assets/haskell-Cw1EW3IL.js +1 -0
  123. package/static/assets/haxe-H-WmDvRZ.js +1 -0
  124. package/static/assets/http-DBlCnlav.js +1 -0
  125. package/static/assets/idl-BEugSyMb.js +1 -0
  126. package/static/assets/index-80RT6UXi.js +3 -0
  127. package/static/assets/index-AIsVwTBP.js +1 -0
  128. package/static/assets/index-AeonINTL.js +1 -0
  129. package/static/assets/index-BBY4n5t-.js +1 -0
  130. package/static/assets/index-BEkvG6MQ.js +1 -0
  131. package/static/assets/index-BEvAFxs_.js +1 -0
  132. package/static/assets/index-BS_uzzCh.js +1 -0
  133. package/static/assets/index-Beun4ywN.js +2 -0
  134. package/static/assets/index-CR0uN9wO.js +1 -0
  135. package/static/assets/index-CRSfgM43.js +1 -0
  136. package/static/assets/index-CawWXqM_.js +1 -0
  137. package/static/assets/index-ChD5bDHD.js +1 -0
  138. package/static/assets/index-ClFRvTkG.js +1 -0
  139. package/static/assets/index-D8UBHQdy.js +1 -0
  140. package/static/assets/index-DCrCdQ-J.js +1 -0
  141. package/static/assets/{index-SWBrq2bx.js → index-DF2yEDGL.js} +103 -103
  142. package/static/assets/index-DH_vXhd4.css +1 -0
  143. package/static/assets/index-DHmd0I4e.js +1 -0
  144. package/static/assets/index-DvIiLgyh.js +1 -0
  145. package/static/assets/index-p-EXqOgO.js +7 -0
  146. package/static/assets/{info-BZi8bEGv.js → info-jWH_Nbw8.js} +1 -1
  147. package/static/assets/javascript-iXu5QeM3.js +1 -0
  148. package/static/assets/julia-DuME0IfC.js +1 -0
  149. package/static/assets/{label-C8Wxd6GE.js → label-Bo7tep86.js} +1 -1
  150. package/static/assets/livescript-BwQOo05w.js +1 -0
  151. package/static/assets/lua-BgMRiT3U.js +1 -0
  152. package/static/assets/markdown-editor-B6HEtSkH.css +1 -0
  153. package/static/assets/markdown-editor-DGcgv9Jo.js +111 -0
  154. package/static/assets/mathematica-DTrFuWx2.js +1 -0
  155. package/static/assets/mbox-CNhZ1qSd.js +1 -0
  156. package/static/assets/{message-square-BpqFAvyq.js → message-square-CJkxqplf.js} +1 -1
  157. package/static/assets/mirc-CjQqDB4T.js +1 -0
  158. package/static/assets/mllike-CXdrOF99.js +1 -0
  159. package/static/assets/modelica-Dc1JOy9r.js +1 -0
  160. package/static/assets/mscgen-BA5vi2Kp.js +1 -0
  161. package/static/assets/mumps-BT43cFF4.js +1 -0
  162. package/static/assets/nginx-DdIZxoE0.js +1 -0
  163. package/static/assets/nsis-LdVXkNf5.js +1 -0
  164. package/static/assets/ntriples-BfvgReVJ.js +1 -0
  165. package/static/assets/octave-Ck1zUtKM.js +1 -0
  166. package/static/assets/oz-BzwKVEFT.js +1 -0
  167. package/static/assets/{paperclip-Dk7jEYtI.js → paperclip-Dw99lBW-.js} +1 -1
  168. package/static/assets/pascal--L3eBynH.js +1 -0
  169. package/static/assets/{pause-CX3StCWt.js → pause-CSm_MUb9.js} +1 -1
  170. package/static/assets/perl-CdXCOZ3F.js +1 -0
  171. package/static/assets/pig-CevX1Tat.js +1 -0
  172. package/static/assets/pipeline-builders-UvjOF56t.js +17 -0
  173. package/static/assets/{play-CRPN1vUy.js → play-Sq1Ji6eG.js} +1 -1
  174. package/static/assets/powershell-CFHJl5sT.js +1 -0
  175. package/static/assets/properties-C78fOPTZ.js +1 -0
  176. package/static/assets/protobuf-ChK-085T.js +1 -0
  177. package/static/assets/pug-DeIclll2.js +1 -0
  178. package/static/assets/puppet-DMA9R1ak.js +1 -0
  179. package/static/assets/python-BuPzkPfP.js +1 -0
  180. package/static/assets/q-pXgVlZs6.js +1 -0
  181. package/static/assets/r-B6wPVr8A.js +1 -0
  182. package/static/assets/{radio-group-DFIfCEpZ.js → radio-group-BfqZdNY5.js} +1 -1
  183. package/static/assets/{refresh-cw-DGBXSYy5.js → refresh-cw-DwXF5JvK.js} +1 -1
  184. package/static/assets/rpm-CTu-6PCP.js +1 -0
  185. package/static/assets/ruby-B2Rjki9n.js +1 -0
  186. package/static/assets/sas-B4kiWyti.js +1 -0
  187. package/static/assets/scheme-C41bIUwD.js +1 -0
  188. package/static/assets/{search-C9jI6Lg7.js → search-NagOQziO.js} +1 -1
  189. package/static/assets/select-XHfMw_BF.js +1 -0
  190. package/static/assets/shell-CjFT_Tl9.js +1 -0
  191. package/static/assets/sieve-C3Gn_uJK.js +1 -0
  192. package/static/assets/simple-mode-GW_nhZxv.js +1 -0
  193. package/static/assets/smalltalk-CnHTOXQT.js +1 -0
  194. package/static/assets/solr-DehyRSwq.js +1 -0
  195. package/static/assets/sparql-DkYu6x3z.js +1 -0
  196. package/static/assets/spreadsheet-BCZA_wO0.js +1 -0
  197. package/static/assets/sql-D0XecflT.js +1 -0
  198. package/static/assets/stex-C3f8Ysf7.js +1 -0
  199. package/static/assets/stylus-B533Al4x.js +1 -0
  200. package/static/assets/swift-BzpIVaGY.js +1 -0
  201. package/static/assets/{switch-C2zPfM3G.js → switch-uoWXvqqm.js} +1 -1
  202. package/static/assets/{tabs-B7fjkp5h.js → tabs-Be_b96k_.js} +1 -1
  203. package/static/assets/{tag-BOwlwHfi.js → tag-wGnl5hoT.js} +1 -1
  204. package/static/assets/tcl-DVfN8rqt.js +1 -0
  205. package/static/assets/{terminal-preview-BvBQu5Sd.js → terminal-preview-BBm_7lm8.js} +1 -1
  206. package/static/assets/textile-CnDTJFAw.js +1 -0
  207. package/static/assets/tiddlywiki-DO-Gjzrf.js +1 -0
  208. package/static/assets/tiki-DGYXhP31.js +1 -0
  209. package/static/assets/toml-Bm5Em-hy.js +1 -0
  210. package/static/assets/troff-wAsdV37c.js +1 -0
  211. package/static/assets/ttcn-CfJYG6tj.js +1 -0
  212. package/static/assets/ttcn-cfg-B9xdYoR4.js +1 -0
  213. package/static/assets/turtle-B1tBg_DP.js +1 -0
  214. package/static/assets/{use-terminal-xv9qDaX1.js → use-terminal-QLr-9n4J.js} +1 -1
  215. package/static/assets/vb-CmGdzxic.js +1 -0
  216. package/static/assets/vbscript-BuJXcnF6.js +1 -0
  217. package/static/assets/velocity-D8B20fx6.js +1 -0
  218. package/static/assets/verilog-C6RDOZhf.js +1 -0
  219. package/static/assets/vhdl-lSbBsy5d.js +1 -0
  220. package/static/assets/{video-CW0zFsfp.js → video-Dn8vsERP.js} +1 -1
  221. package/static/assets/webidl-ZXfAyPTL.js +1 -0
  222. package/static/assets/xquery-DzFWVndE.js +1 -0
  223. package/static/assets/yacas-BJ4BC0dw.js +1 -0
  224. package/static/assets/z80-Hz9HOZM7.js +1 -0
  225. package/static/index.html +2 -2
  226. package/dist/lib/auth/auth-manager.d.ts.map +0 -1
  227. package/dist/lib/auth/auth-manager.js.map +0 -1
  228. package/dist/lib/gait-path.d.ts.map +0 -1
  229. package/dist/lib/gait-path.js.map +0 -1
  230. package/dist/lib/git-settings.d.ts.map +0 -1
  231. package/dist/lib/git-settings.js.map +0 -1
  232. package/dist/lib/git.d.ts.map +0 -1
  233. package/dist/lib/git.js.map +0 -1
  234. package/dist/lib/jobs/global-job-scheduler.d.ts.map +0 -1
  235. package/dist/lib/jobs/global-job-scheduler.js.map +0 -1
  236. package/dist/lib/jobs/job-runner.d.ts.map +0 -1
  237. package/dist/lib/jobs/job-runner.js.map +0 -1
  238. package/dist/lib/jobs/job-scheduler.d.ts.map +0 -1
  239. package/dist/lib/jobs/job-scheduler.js.map +0 -1
  240. package/dist/lib/jobs/job-store.d.ts.map +0 -1
  241. package/dist/lib/jobs/job-store.js.map +0 -1
  242. package/dist/lib/project-paths.d.ts.map +0 -1
  243. package/dist/lib/project-paths.js.map +0 -1
  244. package/dist/lib/storage/file-storage.d.ts.map +0 -1
  245. package/dist/lib/storage/file-storage.js.map +0 -1
  246. package/dist/lib/symlinks/symlink-manager.d.ts.map +0 -1
  247. package/dist/lib/symlinks/symlink-manager.js.map +0 -1
  248. package/dist/lib/symlinks/types.d.ts.map +0 -1
  249. package/dist/lib/symlinks/types.js.map +0 -1
  250. package/dist/lib/terminal/context-helper.d.ts.map +0 -1
  251. package/dist/lib/terminal/context-helper.js.map +0 -1
  252. package/dist/lib/terminal/global-manager.d.ts.map +0 -1
  253. package/dist/lib/terminal/global-manager.js.map +0 -1
  254. package/dist/lib/terminal/shell-utils.d.ts.map +0 -1
  255. package/dist/lib/terminal/shell-utils.js.map +0 -1
  256. package/dist/lib/terminal/terminal-manager.d.ts.map +0 -1
  257. package/dist/lib/terminal/terminal-manager.js.map +0 -1
  258. package/dist/lib/user-preferences.d.ts.map +0 -1
  259. package/dist/lib/user-preferences.js.map +0 -1
  260. package/dist/middleware/auth.d.ts.map +0 -1
  261. package/dist/middleware/auth.js.map +0 -1
  262. package/dist/routes/api/v1/agents/[id]/index.d.ts.map +0 -1
  263. package/dist/routes/api/v1/agents/[id]/index.js.map +0 -1
  264. package/dist/routes/api/v1/agents/[id]/route.d.ts.map +0 -1
  265. package/dist/routes/api/v1/agents/[id]/route.js.map +0 -1
  266. package/dist/routes/api/v1/agents/index.d.ts.map +0 -1
  267. package/dist/routes/api/v1/agents/index.js.map +0 -1
  268. package/dist/routes/api/v1/agents/route.d.ts.map +0 -1
  269. package/dist/routes/api/v1/agents/route.js.map +0 -1
  270. package/dist/routes/api/v1/ai/index.d.ts.map +0 -1
  271. package/dist/routes/api/v1/ai/index.js.map +0 -1
  272. package/dist/routes/api/v1/ai/route.d.ts.map +0 -1
  273. package/dist/routes/api/v1/ai/route.js.map +0 -1
  274. package/dist/routes/api/v1/api-keys/index.d.ts.map +0 -1
  275. package/dist/routes/api/v1/api-keys/index.js.map +0 -1
  276. package/dist/routes/api/v1/api-keys/route.d.ts.map +0 -1
  277. package/dist/routes/api/v1/api-keys/route.js.map +0 -1
  278. package/dist/routes/api/v1/auth/index.d.ts.map +0 -1
  279. package/dist/routes/api/v1/auth/index.js.map +0 -1
  280. package/dist/routes/api/v1/auth/route.d.ts.map +0 -1
  281. package/dist/routes/api/v1/auth/route.js.map +0 -1
  282. package/dist/routes/api/v1/auth-settings/index.d.ts.map +0 -1
  283. package/dist/routes/api/v1/auth-settings/index.js.map +0 -1
  284. package/dist/routes/api/v1/auth-settings/route.d.ts.map +0 -1
  285. package/dist/routes/api/v1/auth-settings/route.js.map +0 -1
  286. package/dist/routes/api/v1/chats/[id]/index.d.ts.map +0 -1
  287. package/dist/routes/api/v1/chats/[id]/index.js.map +0 -1
  288. package/dist/routes/api/v1/chats/[id]/route.d.ts.map +0 -1
  289. package/dist/routes/api/v1/chats/[id]/route.js.map +0 -1
  290. package/dist/routes/api/v1/chats/index.d.ts.map +0 -1
  291. package/dist/routes/api/v1/chats/index.js.map +0 -1
  292. package/dist/routes/api/v1/chats/route.d.ts.map +0 -1
  293. package/dist/routes/api/v1/chats/route.js.map +0 -1
  294. package/dist/routes/api/v1/config/index.d.ts.map +0 -1
  295. package/dist/routes/api/v1/config/index.js.map +0 -1
  296. package/dist/routes/api/v1/config/route.d.ts.map +0 -1
  297. package/dist/routes/api/v1/config/route.js.map +0 -1
  298. package/dist/routes/api/v1/context/architecture/route.d.ts.map +0 -1
  299. package/dist/routes/api/v1/context/architecture/route.js.map +0 -1
  300. package/dist/routes/api/v1/context/index.d.ts.map +0 -1
  301. package/dist/routes/api/v1/context/index.js.map +0 -1
  302. package/dist/routes/api/v1/context/knowledge/[filename]/index.d.ts.map +0 -1
  303. package/dist/routes/api/v1/context/knowledge/[filename]/index.js.map +0 -1
  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.map +0 -1
  306. package/dist/routes/api/v1/context/knowledge/index.d.ts.map +0 -1
  307. package/dist/routes/api/v1/context/knowledge/index.js.map +0 -1
  308. package/dist/routes/api/v1/context/knowledge/route.d.ts.map +0 -1
  309. package/dist/routes/api/v1/context/knowledge/route.js.map +0 -1
  310. package/dist/routes/api/v1/context/project/route.d.ts.map +0 -1
  311. package/dist/routes/api/v1/context/project/route.js.map +0 -1
  312. package/dist/routes/api/v1/git/index.d.ts.map +0 -1
  313. package/dist/routes/api/v1/git/index.js.map +0 -1
  314. package/dist/routes/api/v1/jobs/[id]/route.d.ts.map +0 -1
  315. package/dist/routes/api/v1/jobs/[id]/route.js.map +0 -1
  316. package/dist/routes/api/v1/jobs/[id]/run/route.d.ts.map +0 -1
  317. package/dist/routes/api/v1/jobs/[id]/run/route.js.map +0 -1
  318. package/dist/routes/api/v1/jobs/index.d.ts.map +0 -1
  319. package/dist/routes/api/v1/jobs/index.js.map +0 -1
  320. package/dist/routes/api/v1/jobs/route.d.ts.map +0 -1
  321. package/dist/routes/api/v1/jobs/route.js.map +0 -1
  322. package/dist/routes/api/v1/jobs/status/route.d.ts.map +0 -1
  323. package/dist/routes/api/v1/jobs/status/route.js.map +0 -1
  324. package/dist/routes/api/v1/mcp/index.d.ts.map +0 -1
  325. package/dist/routes/api/v1/mcp/index.js.map +0 -1
  326. package/dist/routes/api/v1/mcp/route.d.ts.map +0 -1
  327. package/dist/routes/api/v1/mcp/route.js.map +0 -1
  328. package/dist/routes/api/v1/proposals/[id]/route.d.ts.map +0 -1
  329. package/dist/routes/api/v1/proposals/[id]/route.js.map +0 -1
  330. package/dist/routes/api/v1/proposals/index.d.ts.map +0 -1
  331. package/dist/routes/api/v1/proposals/index.js.map +0 -1
  332. package/dist/routes/api/v1/proposals/route.d.ts.map +0 -1
  333. package/dist/routes/api/v1/proposals/route.js.map +0 -1
  334. package/dist/routes/api/v1/resources/[id]/index.d.ts.map +0 -1
  335. package/dist/routes/api/v1/resources/[id]/index.js.map +0 -1
  336. package/dist/routes/api/v1/resources/[id]/route.js.map +0 -1
  337. package/dist/routes/api/v1/resources/[id]/thumbnail/index.d.ts.map +0 -1
  338. package/dist/routes/api/v1/resources/[id]/thumbnail/index.js.map +0 -1
  339. package/dist/routes/api/v1/resources/[id]/thumbnail/route.js.map +0 -1
  340. package/dist/routes/api/v1/resources/index.d.ts.map +0 -1
  341. package/dist/routes/api/v1/resources/index.js.map +0 -1
  342. package/dist/routes/api/v1/resources/route.d.ts.map +0 -1
  343. package/dist/routes/api/v1/resources/route.js.map +0 -1
  344. package/dist/routes/api/v1/symlinks/index.d.ts.map +0 -1
  345. package/dist/routes/api/v1/symlinks/index.js.map +0 -1
  346. package/dist/routes/api/v1/symlinks/route.d.ts.map +0 -1
  347. package/dist/routes/api/v1/symlinks/route.js.map +0 -1
  348. package/dist/routes/api/v1/terminal/[proposalId]/create/index.d.ts.map +0 -1
  349. package/dist/routes/api/v1/terminal/[proposalId]/create/index.js.map +0 -1
  350. package/dist/routes/api/v1/terminal/[proposalId]/create/route.d.ts.map +0 -1
  351. package/dist/routes/api/v1/terminal/[proposalId]/create/route.js.map +0 -1
  352. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.d.ts.map +0 -1
  353. package/dist/routes/api/v1/terminal/[proposalId]/destroy/index.js.map +0 -1
  354. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.d.ts.map +0 -1
  355. package/dist/routes/api/v1/terminal/[proposalId]/destroy/route.js.map +0 -1
  356. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.d.ts.map +0 -1
  357. package/dist/routes/api/v1/terminal/[proposalId]/resize/index.js.map +0 -1
  358. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.d.ts.map +0 -1
  359. package/dist/routes/api/v1/terminal/[proposalId]/resize/route.js.map +0 -1
  360. package/dist/routes/api/v1/terminal/sessions/index.d.ts.map +0 -1
  361. package/dist/routes/api/v1/terminal/sessions/index.js.map +0 -1
  362. package/dist/routes/api/v1/terminal/sessions/route.d.ts.map +0 -1
  363. package/dist/routes/api/v1/terminal/sessions/route.js.map +0 -1
  364. package/dist/routes/api/v1/user/index.d.ts.map +0 -1
  365. package/dist/routes/api/v1/user/index.js.map +0 -1
  366. package/dist/routes/api/v1/user/settings/index.d.ts.map +0 -1
  367. package/dist/routes/api/v1/user/settings/index.js.map +0 -1
  368. package/dist/routes/api/v1/user/settings/route.d.ts.map +0 -1
  369. package/dist/routes/api/v1/user/settings/route.js.map +0 -1
  370. package/dist/server-with-static.d.ts.map +0 -1
  371. package/dist/server-with-static.js.map +0 -1
  372. package/dist/server.d.ts.map +0 -1
  373. package/dist/server.js.map +0 -1
  374. package/static/assets/CodePage-DxJYFhiT.js +0 -2
  375. package/static/assets/IntegrationsSettingsPage-BzuUrHO1.js +0 -1
  376. package/static/assets/KnowledgeEditPage-D3gIqqKn.js +0 -1
  377. package/static/assets/NewKnowledgePage-WbN6BikQ.js +0 -9
  378. package/static/assets/NotificationsSettingsPage-BeJw7gY7.js +0 -1
  379. package/static/assets/ProjectEditPage-DiHz-pYk.js +0 -11
  380. package/static/assets/PromptsSettingsPage-B_Opt_KA.js +0 -1
  381. package/static/assets/RoleEditPage-Bm7HG4sg.js +0 -13
  382. package/static/assets/SchedulePage-nmchdGUK.js +0 -4
  383. package/static/assets/TaskEditPage-BTfzRYwM.js +0 -1
  384. package/static/assets/UserPreferencesPage-CgtsVqvs.js +0 -1
  385. package/static/assets/index-CHdBxVyk.css +0 -2
  386. package/static/assets/kiro-CX1mOsRO.js +0 -17
  387. package/static/assets/markdown-editor-DAk7M9Ju.js +0 -62
  388. package/static/assets/markdown-editor-DUEthZ0y.css +0 -1
  389. package/static/assets/select-DgNHsbaX.js +0 -1
@@ -0,0 +1,39 @@
1
+ /**
2
+ * MCP Client helper for connecting to HTTP/SSE MCP servers
3
+ * Provides tool discovery and execution proxying
4
+ */
5
+ export interface McpServerConfig {
6
+ name?: string;
7
+ type?: 'http' | 'sse' | 'stdio';
8
+ url?: string;
9
+ enabled?: boolean;
10
+ env?: Record<string, string>;
11
+ }
12
+ export interface DiscoveredTool {
13
+ name: string;
14
+ description?: string;
15
+ inputSchema?: object;
16
+ serverName: string;
17
+ serverUrl: string;
18
+ }
19
+ export interface ToolCallResult {
20
+ content: Array<{
21
+ type: string;
22
+ text?: string;
23
+ [key: string]: unknown;
24
+ }>;
25
+ isError?: boolean;
26
+ structuredContent?: unknown;
27
+ }
28
+ /**
29
+ * Connect to an HTTP/SSE MCP server and discover its available tools
30
+ */
31
+ export declare function discoverToolsFromServer(serverName: string, config: McpServerConfig): Promise<DiscoveredTool[]>;
32
+ /**
33
+ * Execute a tool on an HTTP/SSE MCP server
34
+ */
35
+ export declare function executeToolOnServer(serverName: string, config: McpServerConfig, toolName: string, args: Record<string, unknown>): Promise<ToolCallResult>;
36
+ /**
37
+ * Close all cached client connections (for cleanup)
38
+ */
39
+ export declare function closeAllConnections(): void;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * MCP Client helper for connecting to HTTP/SSE MCP servers
3
+ * Provides tool discovery and execution proxying
4
+ */
5
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
6
+ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
7
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
8
+ // Cache for active client connections
9
+ const clientCache = new Map();
10
+ // Clean up stale connections after 5 minutes
11
+ const CONNECTION_TTL_MS = 5 * 60 * 1000;
12
+ /**
13
+ * Get or create a client connection to an MCP server
14
+ */
15
+ async function getOrCreateClient(serverName, config) {
16
+ const cacheKey = `${serverName}:${config.url}`;
17
+ const cached = clientCache.get(cacheKey);
18
+ if (cached) {
19
+ cached.lastUsed = Date.now();
20
+ return cached.client;
21
+ }
22
+ const client = new Client({
23
+ name: 'coconut-api',
24
+ version: '1.0.0'
25
+ });
26
+ const url = new URL(config.url);
27
+ // Try StreamableHTTP first (newer), fall back to SSE (legacy)
28
+ let transport;
29
+ if (config.type === 'sse') {
30
+ // Explicitly SSE
31
+ transport = new SSEClientTransport(url);
32
+ }
33
+ else {
34
+ // Default to StreamableHTTP for 'http' type or unspecified
35
+ transport = new StreamableHTTPClientTransport(url);
36
+ }
37
+ await client.connect(transport);
38
+ clientCache.set(cacheKey, { client, lastUsed: Date.now() });
39
+ // Schedule cleanup
40
+ scheduleCleanup();
41
+ return client;
42
+ }
43
+ let cleanupScheduled = false;
44
+ function scheduleCleanup() {
45
+ if (cleanupScheduled)
46
+ return;
47
+ cleanupScheduled = true;
48
+ setTimeout(() => {
49
+ cleanupScheduled = false;
50
+ const now = Date.now();
51
+ for (const [key, entry] of clientCache.entries()) {
52
+ if (now - entry.lastUsed > CONNECTION_TTL_MS) {
53
+ try {
54
+ entry.client.close();
55
+ }
56
+ catch (e) {
57
+ // Ignore close errors
58
+ }
59
+ clientCache.delete(key);
60
+ }
61
+ }
62
+ // Reschedule if there are still cached connections
63
+ if (clientCache.size > 0) {
64
+ scheduleCleanup();
65
+ }
66
+ }, CONNECTION_TTL_MS);
67
+ }
68
+ /**
69
+ * Connect to an HTTP/SSE MCP server and discover its available tools
70
+ */
71
+ export async function discoverToolsFromServer(serverName, config) {
72
+ if (!config.url) {
73
+ throw new Error(`Server ${serverName} has no URL configured`);
74
+ }
75
+ if (config.enabled === false) {
76
+ return [];
77
+ }
78
+ try {
79
+ const client = await getOrCreateClient(serverName, config);
80
+ const toolsResult = await client.listTools();
81
+ return toolsResult.tools.map(tool => ({
82
+ name: tool.name,
83
+ description: tool.description,
84
+ inputSchema: tool.inputSchema,
85
+ serverName,
86
+ serverUrl: config.url
87
+ }));
88
+ }
89
+ catch (error) {
90
+ console.error(`Failed to discover tools from ${serverName}:`, error);
91
+ throw error;
92
+ }
93
+ }
94
+ /**
95
+ * Execute a tool on an HTTP/SSE MCP server
96
+ */
97
+ export async function executeToolOnServer(serverName, config, toolName, args) {
98
+ if (!config.url) {
99
+ throw new Error(`Server ${serverName} has no URL configured`);
100
+ }
101
+ try {
102
+ const client = await getOrCreateClient(serverName, config);
103
+ const result = await client.callTool({
104
+ name: toolName,
105
+ arguments: args
106
+ });
107
+ return {
108
+ content: result.content,
109
+ isError: result.isError,
110
+ structuredContent: result.structuredContent
111
+ };
112
+ }
113
+ catch (error) {
114
+ console.error(`Failed to execute tool ${toolName} on ${serverName}:`, error);
115
+ throw error;
116
+ }
117
+ }
118
+ /**
119
+ * Close all cached client connections (for cleanup)
120
+ */
121
+ export function closeAllConnections() {
122
+ for (const [key, entry] of clientCache.entries()) {
123
+ try {
124
+ entry.client.close();
125
+ }
126
+ catch (e) {
127
+ // Ignore close errors
128
+ }
129
+ clientCache.delete(key);
130
+ }
131
+ }
@@ -1,11 +1,9 @@
1
- import { fileURLToPath } from 'url';
2
1
  import { homedir } from 'os';
3
2
  import { join, resolve as pathResolve, basename } from 'path';
4
3
  import { existsSync, readFileSync, promises as fs, createReadStream } from 'fs';
5
4
  import readline from 'readline';
6
- import { ZodError } from 'zod';
7
- import { getLogsDir, listProposals, getProposal, createProposal, updateProposal, deleteProposal, } from '@lovelybunch/core';
8
- import { proposalsFullTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, projectContextTool, architectureContextTool, roleContextTool } from '@lovelybunch/mcp';
5
+ import { getLogsDir } from '@lovelybunch/core';
6
+ import { proposalsReadOnlyTool, knowledgeTool, normalizeKnowledgeMetadata, eventsTool, projectContextTool, architectureContextTool } from '@lovelybunch/mcp';
9
7
  import matter from 'gray-matter';
10
8
  import { FileStorageAdapter } from '../../../../lib/storage/file-storage.js';
11
9
  // Function to get global config API key as fallback
@@ -53,7 +51,7 @@ export async function POST(c) {
53
51
  // Execute all tool calls
54
52
  const toolResults = await executeToolCalls(toolCalls);
55
53
  // Build the system prompt
56
- const baseSystem = getSystemPrompt();
54
+ const baseSystem = getSystemPrompt(context, contextContent);
57
55
  const systemPrompt = agentPersona
58
56
  ? `${baseSystem}\n\nThe following persona is authoritative and overrides general guidance above. You must strictly follow it.\n\n${agentPersona}`
59
57
  : baseSystem;
@@ -94,11 +92,11 @@ export async function POST(c) {
94
92
  ...toolResultMessages
95
93
  ];
96
94
  // Prepare tools for potential additional tool calls
97
- // Note: proposals/knowledge/project/architecture are read+write, events is read-only
95
+ // Note: proposals is read-only, knowledge/project/architecture are read+write, events is read-only
98
96
  const tools = [
99
97
  {
100
98
  type: "function",
101
- function: proposalsFullTool
99
+ function: proposalsReadOnlyTool
102
100
  },
103
101
  {
104
102
  type: "function",
@@ -115,10 +113,6 @@ export async function POST(c) {
115
113
  {
116
114
  type: "function",
117
115
  function: architectureContextTool
118
- },
119
- {
120
- type: "function",
121
- function: roleContextTool
122
116
  }
123
117
  ];
124
118
  // Accumulate all tool calls and results across multiple rounds
@@ -243,9 +237,6 @@ async function executeToolCalls(toolCalls) {
243
237
  let argsStr = toolCall.function.arguments;
244
238
  // Remove trailing commas before ] or }
245
239
  argsStr = argsStr.replace(/,(\s*[}\]])/g, '$1');
246
- // Fix common LLM JSON issues:
247
- // 1. Remove control characters (except \n, \r, \t which are valid in JSON strings)
248
- argsStr = argsStr.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, '');
249
240
  // Try parsing the sanitized string
250
241
  functionArgs = JSON.parse(argsStr);
251
242
  }
@@ -259,16 +250,11 @@ async function executeToolCalls(toolCalls) {
259
250
  arguments: toolCall.function?.arguments?.substring(0, 500),
260
251
  error: parseError instanceof Error ? parseError.message : 'Unknown parse error'
261
252
  });
262
- // Provide a more helpful error message
263
- const errorMsg = parseError instanceof Error ? parseError.message : 'JSON parse error';
264
- const hint = errorMsg.includes('position')
265
- ? 'The content may contain unescaped quotes or special characters. Try updating with shorter/simpler content, or update one field at a time.'
266
- : 'Please retry with simpler content.';
267
253
  return {
268
254
  tool_call_id: toolCall.id,
269
255
  content: JSON.stringify({
270
256
  success: false,
271
- error: `Invalid tool arguments: ${errorMsg}. ${hint}`
257
+ error: `Invalid tool arguments: ${parseError instanceof Error ? parseError.message : 'JSON parse error'}. Please retry with simpler content.`
272
258
  })
273
259
  };
274
260
  }
@@ -288,9 +274,6 @@ async function executeToolCalls(toolCalls) {
288
274
  else if (functionName === 'architecture_context') {
289
275
  result = await executeArchitectureContextToolDirect(functionArgs);
290
276
  }
291
- else if (functionName === 'role_context') {
292
- result = await executeRoleContextToolDirect(functionArgs);
293
- }
294
277
  return {
295
278
  tool_call_id: toolCall.id,
296
279
  content: JSON.stringify({
@@ -313,89 +296,38 @@ async function executeToolCalls(toolCalls) {
313
296
  });
314
297
  return Promise.all(resultPromises);
315
298
  }
316
- // Proposals tool - full CRUD operations using @lovelybunch/core
317
- async function executeProposalsToolDirect(args, _storage) {
318
- const { operation, id, filters, proposal, updates } = args;
299
+ // Proposals tool is READ-ONLY - only list and get operations are supported
300
+ async function executeProposalsToolDirect(args, storage) {
301
+ const { operation, id, filters } = args;
319
302
  try {
320
303
  switch (operation) {
321
304
  case 'list': {
322
- const proposals = await listProposals(filters || {});
305
+ const proposals = await storage.listCPs(filters || {});
323
306
  return {
324
307
  success: true,
325
308
  data: proposals,
326
- count: proposals.length,
327
- message: `Found ${proposals.length} tasks`
309
+ message: `Found ${proposals.length} proposals`
328
310
  };
329
311
  }
330
312
  case 'get': {
331
313
  if (!id) {
332
- return { success: false, error: 'Task ID is required for get operation' };
333
- }
334
- const result = await getProposal(id);
335
- if (!result) {
336
- return { success: false, error: 'Task not found' };
314
+ return { success: false, error: 'Proposal ID is required for get operation' };
337
315
  }
338
- return {
339
- success: true,
340
- data: result,
341
- message: `Retrieved task ${id}`
342
- };
343
- }
344
- case 'create': {
316
+ const proposal = await storage.getCP(id);
345
317
  if (!proposal) {
346
- return { success: false, error: 'Task data is required for create operation' };
347
- }
348
- const created = await createProposal(proposal);
349
- return {
350
- success: true,
351
- data: created,
352
- message: `Created task ${created.id}`
353
- };
354
- }
355
- case 'update': {
356
- if (!id) {
357
- return { success: false, error: 'Task ID is required for update operation' };
318
+ return { success: false, error: 'Proposal not found' };
358
319
  }
359
- const updateData = updates || proposal;
360
- if (!updateData) {
361
- return { success: false, error: 'Update data is required for update operation' };
362
- }
363
- const updated = await updateProposal(id, updateData);
364
320
  return {
365
321
  success: true,
366
- data: updated,
367
- message: `Updated task ${id}`
368
- };
369
- }
370
- case 'delete': {
371
- if (!id) {
372
- return { success: false, error: 'Task ID is required for delete operation' };
373
- }
374
- const deleted = await deleteProposal(id);
375
- if (!deleted) {
376
- return { success: false, error: 'Task not found' };
377
- }
378
- return {
379
- success: true,
380
- message: `Deleted task ${id}`
322
+ data: proposal,
323
+ message: `Retrieved proposal ${id}`
381
324
  };
382
325
  }
383
326
  default:
384
- return { success: false, error: `Unknown operation: ${operation}. Supported operations: list, get, create, update, delete` };
327
+ return { success: false, error: `Proposals are read-only. Only 'list' and 'get' operations are supported. To create proposals, use a coding agent (Claude Code, Cursor, etc.) or the Proposals UI.` };
385
328
  }
386
329
  }
387
330
  catch (error) {
388
- // Handle Zod validation errors specially
389
- if (error instanceof ZodError) {
390
- return {
391
- success: false,
392
- error: 'Validation failed',
393
- details: error.issues.map(e => ({
394
- path: e.path.join('.'),
395
- message: e.message
396
- }))
397
- };
398
- }
399
331
  console.error('Error executing proposals tool:', error);
400
332
  return { success: false, error: error.message || 'Tool execution failed' };
401
333
  }
@@ -864,114 +796,6 @@ async function executeArchitectureContextToolDirect(args) {
864
796
  return { success: false, error: error.message || 'Architecture context tool execution failed' };
865
797
  }
866
798
  }
867
- // Role context tool - read/write the role definition document
868
- async function executeRoleContextToolDirect(args) {
869
- const { operation, content, old_text, new_text } = args;
870
- try {
871
- const contextPath = getContextBasePath();
872
- const filePath = join(contextPath, 'role.md');
873
- switch (operation) {
874
- case 'get': {
875
- try {
876
- const fileContent = await fs.readFile(filePath, 'utf-8');
877
- const parsed = matter(fileContent);
878
- return {
879
- success: true,
880
- data: {
881
- content: parsed.content,
882
- frontmatter: parsed.data,
883
- raw: fileContent
884
- },
885
- message: 'Retrieved role context'
886
- };
887
- }
888
- catch (err) {
889
- if (err.code === 'ENOENT') {
890
- return {
891
- success: true,
892
- data: { content: '', frontmatter: {}, raw: '' },
893
- message: 'Role context document does not exist yet. You can create it with an update operation.'
894
- };
895
- }
896
- throw err;
897
- }
898
- }
899
- case 'append': {
900
- if (!content) {
901
- return { success: false, error: 'Content is required for append operation' };
902
- }
903
- await fs.mkdir(contextPath, { recursive: true });
904
- // Read existing content if file exists
905
- let existingContent = '';
906
- try {
907
- existingContent = await fs.readFile(filePath, 'utf-8');
908
- }
909
- catch (err) {
910
- if (err.code !== 'ENOENT')
911
- throw err;
912
- }
913
- // Append new content with a newline separator
914
- const newContent = existingContent
915
- ? existingContent.trimEnd() + '\n\n' + content
916
- : content;
917
- await fs.writeFile(filePath, newContent, 'utf-8');
918
- return {
919
- success: true,
920
- message: 'Appended content to role context document'
921
- };
922
- }
923
- case 'replace_section': {
924
- if (!old_text || !new_text) {
925
- return { success: false, error: 'Both old_text and new_text are required for replace_section operation' };
926
- }
927
- // Read existing content
928
- let existingContent = '';
929
- try {
930
- existingContent = await fs.readFile(filePath, 'utf-8');
931
- }
932
- catch (err) {
933
- if (err.code === 'ENOENT') {
934
- return { success: false, error: 'Role context document does not exist. Use append or update to create it first.' };
935
- }
936
- throw err;
937
- }
938
- // Check if old_text exists in the document
939
- if (!existingContent.includes(old_text)) {
940
- return {
941
- success: false,
942
- error: 'Could not find the specified text in the document. The text may have been paraphrased or changed.',
943
- fallback_markdown: new_text,
944
- suggestion: 'Here is the replacement text. You can copy it and manually edit the document at /context/role'
945
- };
946
- }
947
- // Replace the text
948
- const updatedContent = existingContent.replace(old_text, new_text);
949
- await fs.writeFile(filePath, updatedContent, 'utf-8');
950
- return {
951
- success: true,
952
- message: 'Replaced section in role context document'
953
- };
954
- }
955
- case 'update': {
956
- if (!content) {
957
- return { success: false, error: 'Content is required for update operation' };
958
- }
959
- await fs.mkdir(contextPath, { recursive: true });
960
- await fs.writeFile(filePath, content, 'utf-8');
961
- return {
962
- success: true,
963
- message: 'Updated role context document'
964
- };
965
- }
966
- default:
967
- return { success: false, error: `Unknown operation: ${operation}. Use 'get', 'append', 'replace_section', or 'update'.` };
968
- }
969
- }
970
- catch (error) {
971
- console.error('Error executing role context tool:', error);
972
- return { success: false, error: error.message || 'Role context tool execution failed' };
973
- }
974
- }
975
799
  function getContextBasePath() {
976
800
  let basePath;
977
801
  if (process.env.NODE_ENV === 'development' && process.env.GAIT_DEV_ROOT) {
@@ -1071,44 +895,37 @@ async function listKnowledgeDocuments(basePath, query) {
1071
895
  doc.metadata?.summary?.toLowerCase().includes(lowerQuery))
1072
896
  .sort((a, b) => a.filename.localeCompare(b.filename));
1073
897
  }
1074
- function readSharedPrompt(name) {
1075
- // Try multiple candidate paths depending on cwd when running via Turbo
1076
- const moduleDir = fileURLToPath(new URL('.', import.meta.url));
1077
- const candidates = [
1078
- // Monorepo root
1079
- join(process.cwd(), 'packages', 'shared', 'system-prompts', `${name}.md`),
1080
- // Relative to api package
1081
- join(moduleDir, '..', '..', '..', '..', 'shared', 'system-prompts', `${name}.md`),
1082
- join(process.cwd(), '..', 'shared', 'system-prompts', `${name}.md`),
1083
- ];
1084
- for (const p of candidates) {
1085
- try {
1086
- if (existsSync(p)) {
1087
- return readFileSync(p, 'utf-8');
1088
- }
1089
- }
1090
- catch { }
1091
- }
1092
- return null;
1093
- }
1094
- function readRoleContext() {
1095
- try {
1096
- const contextPath = getContextBasePath();
1097
- const rolePath = join(contextPath, 'role.md');
1098
- if (existsSync(rolePath)) {
1099
- return readFileSync(rolePath, 'utf-8');
1100
- }
1101
- }
1102
- catch { }
1103
- return null;
1104
- }
1105
- function getSystemPrompt() {
1106
- const basePrompt = readSharedPrompt('coconut-assistant') ||
1107
- `You are the Coconut 🥥 AI assistant for agent-native development workflows. You help developers with proposals, architecture decisions, planning, and execution.`;
1108
- // Add role context if it exists
1109
- const roleContent = readRoleContext();
1110
- if (roleContent) {
1111
- return `${basePrompt}\n\n## Your Role for This Instance\n\n${roleContent}`;
898
+ function getSystemPrompt(context, contextContent) {
899
+ const basePrompt = `You are the Coconut 🥥 AI assistant for agent-native development workflows. You help developers with proposals, architecture decisions, planning, and execution.`;
900
+ switch (context) {
901
+ case "proposals":
902
+ case "proposals-edit":
903
+ case "proposals-view":
904
+ let proposalPrompt = `${basePrompt} You are currently in the proposals section. Help users:
905
+ - Refine and improve their change proposals
906
+ - Suggest implementation approaches
907
+ - Identify potential challenges or risks
908
+ - Break down complex changes into manageable steps
909
+ - Provide feedback on proposal clarity and completeness`;
910
+ if (contextContent) {
911
+ proposalPrompt += `\n\nYou have access to the following proposal data:\n\n${contextContent}`;
912
+ }
913
+ return proposalPrompt;
914
+ case "context":
915
+ return `${basePrompt} You are currently in the context section (architecture, decisions, knowledge). Help users:
916
+ - Analyze architectural decisions and patterns
917
+ - Suggest improvements to documentation
918
+ - Identify gaps in knowledge or decisions
919
+ - Recommend best practices
920
+ - Help maintain consistency across the project`;
921
+ case "settings":
922
+ return `${basePrompt} You are currently in the settings section. Help users:
923
+ - Configure their Coconut environment
924
+ - Set up integrations and workflows
925
+ - Optimize their development process
926
+ - Understand configuration options
927
+ - Troubleshoot setup issues`;
928
+ default:
929
+ return `${basePrompt} Provide helpful, contextual assistance based on the user's current needs in their Coconut workflow.`;
1112
930
  }
1113
- return basePrompt;
1114
931
  }
@@ -9,11 +9,10 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
9
9
  success: true;
10
10
  data: {
11
11
  id: string;
12
- title: string;
13
- intent?: string;
12
+ intent: string;
14
13
  content?: string;
15
14
  author: {
16
- type: import("@lovelybunch/core").AuthorType;
15
+ type: import("@lovelybunch/types").AuthorType;
17
16
  id: string;
18
17
  name: string;
19
18
  email?: string;
@@ -48,7 +47,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
48
47
  version: string;
49
48
  name: string;
50
49
  description: string;
51
- type: import("@lovelybunch/core").FeatureFlagType;
50
+ type: import("@lovelybunch/types").FeatureFlagType;
52
51
  defaultValue: any;
53
52
  scopes: string[];
54
53
  targets: {
@@ -96,7 +95,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
96
95
  minimumSampleSize: number;
97
96
  testType: "two-tailed" | "one-tailed";
98
97
  };
99
- status: import("@lovelybunch/core").ExperimentStatus;
98
+ status: import("@lovelybunch/types").ExperimentStatus;
100
99
  startedAt?: string;
101
100
  endedAt?: string;
102
101
  }[];
@@ -134,13 +133,7 @@ export declare function GET(c: Context): Promise<(Response & import("hono").Type
134
133
  schedule?: string;
135
134
  rollbackPlan?: string;
136
135
  };
137
- status: import("@lovelybunch/core").CPStatus;
138
- comments?: {
139
- id: string;
140
- author: string;
141
- content: string;
142
- createdAt: string;
143
- }[];
136
+ status: import("@lovelybunch/types").CPStatus;
144
137
  metadata: {
145
138
  createdAt: string;
146
139
  updatedAt: string;
@@ -173,11 +166,10 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
173
166
  success: true;
174
167
  data: {
175
168
  id: string;
176
- title: string;
177
- intent?: string;
169
+ intent: string;
178
170
  content?: string;
179
171
  author: {
180
- type: import("@lovelybunch/core").AuthorType;
172
+ type: import("@lovelybunch/types").AuthorType;
181
173
  id: string;
182
174
  name: string;
183
175
  email?: string;
@@ -212,7 +204,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
212
204
  version: string;
213
205
  name: string;
214
206
  description: string;
215
- type: import("@lovelybunch/core").FeatureFlagType;
207
+ type: import("@lovelybunch/types").FeatureFlagType;
216
208
  defaultValue: any;
217
209
  scopes: string[];
218
210
  targets: {
@@ -260,7 +252,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
260
252
  minimumSampleSize: number;
261
253
  testType: "two-tailed" | "one-tailed";
262
254
  };
263
- status: import("@lovelybunch/core").ExperimentStatus;
255
+ status: import("@lovelybunch/types").ExperimentStatus;
264
256
  startedAt?: string;
265
257
  endedAt?: string;
266
258
  }[];
@@ -298,13 +290,7 @@ export declare function PATCH(c: Context): Promise<(Response & import("hono").Ty
298
290
  schedule?: string;
299
291
  rollbackPlan?: string;
300
292
  };
301
- status: import("@lovelybunch/core").CPStatus;
302
- comments?: {
303
- id: string;
304
- author: string;
305
- content: string;
306
- createdAt: string;
307
- }[];
293
+ status: import("@lovelybunch/types").CPStatus;
308
294
  metadata: {
309
295
  createdAt: string;
310
296
  updatedAt: string;
@@ -1,5 +1,6 @@
1
1
  import { FileStorageAdapter } from '../../../../../lib/storage/file-storage.js';
2
2
  import { getLogger } from '@lovelybunch/core/logging';
3
+ import { getSlackService } from '../../../../../lib/slack/slack-service.js';
3
4
  const storage = new FileStorageAdapter();
4
5
  // Logger is lazily initialized inside handlers to use server config
5
6
  export async function GET(c) {
@@ -90,6 +91,14 @@ export async function PATCH(c) {
90
91
  reason: null
91
92
  }
92
93
  });
94
+ // Send Slack notification for status change (non-blocking)
95
+ getSlackService().sendNotification({
96
+ type: 'proposal.statusChange',
97
+ proposalId: id,
98
+ intent: updatedProposal?.intent || existing.intent,
99
+ status: newStatus,
100
+ previousStatus: oldStatus,
101
+ }).catch(err => console.warn('[proposals] Slack notification failed:', err));
93
102
  }
94
103
  return c.json({
95
104
  success: true,
@@ -134,7 +143,7 @@ export async function DELETE(c) {
134
143
  tags: ['proposal'],
135
144
  payload: {
136
145
  id,
137
- title: proposal.title
146
+ intent: proposal.intent
138
147
  }
139
148
  });
140
149
  }